MishkaCmsCore.Runtime.PageBuilder.Sequence (Mishka CMS Core v0.0.1)

Copy Markdown View Source

A number that says which one of these this is, kept in step when another arrives.

What it is for

chelekom-stepper-section declares step_number with a default of 1, and the stepper's own furnishing writes 1, 2, 3. Drop a fourth section and it says 1; duplicate the second and there are two 2s. The author edits the title, sees it change, looks for the number and finds nothing to change it with — which is what it was reported as: "it doesnt matter how many of them we have they alwas will show the number 1".

The rule, and why it is not a list of attribute names

A positional number is recognisable from the document rather than from anything a kit declares:

  • at least TWO siblings sharing the arriving node's component name, in document order,
  • every one of them holding an INTEGER LITERAL in that attribute,
  • and those integers forming a consecutive ascending run.

Three ones in a row are not a sequence and are left alone. step_number={@index} is the author binding it to their own data and is left alone. A component with no such siblings has no run to join. What is renumbered is the arriving node and everything after it, so inserting between two and three gives three, and the old three becomes four.

TWO, because one number is not counting. Twenty-eight attributes across the shipped kit are whole numbers and most of them are measurements — an image's width, a tooltip's delay, a clipboard's timeout. One image beside another with width={100} would have made the second 101; two steps reading 1 and 2 are people counting, and that is the evidence this acts on.

Only integer and pos_integer. A float is a measurement, and a string that happens to hold digits is a label.

Summary

Functions

The tree with the arriving node's positional numbers settled, or the tree unchanged.

Functions

settle(tree, node_id, components)

The tree with the arriving node's positional numbers settled, or the tree unchanged.

components is the palette, which is where the attribute's declared type is read from.