feat(widgets): add the widget node model and the five built-ins #32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/m5-widgets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Test plan
pnpm test- 385 tests, including a per-widget pass over defaults, geometry and a snapshot digestpnpm lintandpnpm buildclean- line and dot count come from repeat: { fill: true }, so the block absorbs whatever space is left of the page - dot and graph are grids of marks rather than a pattern, which is the count decision 6's primitive cap is set againstAuthoring the five turned up three places the format made a widget say something
sideways. None needed an engine change, all three are commented where they bite:
stepMinutesis a select and select values are strings, so the timelinebridges it to
timeSequencewith a conditional. A number-valued select wouldbe a change to the inputs schema (decision 11).
shapeis an enum on the node rather than a value slot, so the todo tick boxis a rect and a circle chosen by
whenrather than one mark with a shapeinput.
short dashes - the same answer decision 6 already budgets for a dot grid.
Three defaults are mine rather than the plan's, which names none for them:
rows8start08:00,end18:00styleruled, which is what the stated 7mm pitch goes withReview pass over the branch turned up four low-severity issues, all fixed here.
Fixed
__proto__was not a variable of its own. The scope and instance-value maps were built by assignment, so the name landed on the map's prototype and read back through the own-property guard as undeclared -unpackrefused withreads $__proto__, which is not one of its inputsand layout reportedunknown variable __proto__. Both maps are now built by definition. (1aca0ea)valueOfhanded the sameExprobject to every reference site, and the container reusedwhen,repeat,widthandheightfrom the tree it replaced. Decision 14 keeps both trees live as undo snapshots, so one in-place edit would have reached both. The widget node is now copied up front and each inlined value is cloned per site. (4ac018f)Sizeobject forwidthandheight.parseTemplaterebuilt them, so nothing on the page was affected, but a node built byinstantiateand used unparsed was not. (a58e12b)min/maxwere only ever checked against the declared default. A template passingrows: 500to an input declaredmax: 40parsed fine and opened the number control on a value the user could never return to - the exact casecheckBoundsexists to prevent, at the other way into the control. Rejected at parse time now; an expression prop is still allowed through, since it has no number until layout evaluates it. (00347bb)Checked and sound
when/repeat.oversubstitute in the outer frame and everything else in the repeat-shadowed frame, matchingresolve.ts's evaluation order.shadow()mirrorsbind(scope, {i})vs{item, i}for count/fill vs over.childDefinitenesstreats thestackwrapper unpack produces like awidgetparent, so fill repeats survive unpacking.Test plan
tsc --noEmit,eslint .andprettier --checkclean.