@almadar/std 16.151.0 → 16.152.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/behaviors/lolo/ui/core/atoms/std-browse.lolo +14 -4
  2. package/behaviors/lolo/ui/core/molecules/ui-data-list.lolo +12 -0
  3. package/behaviors/lolo/ui/game/atoms/ui-draw-group.lolo +54 -0
  4. package/behaviors/lolo/ui/game/atoms/ui-draw-shape.lolo +6 -1
  5. package/behaviors/lolo/ui/game/atoms/ui-svg-draw-group.lolo +58 -0
  6. package/behaviors/lolo/ui/game/atoms/ui-svg-draw-shape.lolo +103 -0
  7. package/behaviors/lolo/ui/game/atoms/ui-svg-draw-text.lolo +58 -0
  8. package/behaviors/lolo/ui/game/molecules/ui-draw-shape-layer.lolo +3 -2
  9. package/behaviors/lolo/ui/game/molecules/ui-svg-draw-shape-layer.lolo +52 -0
  10. package/behaviors/lolo/ui/game/molecules/ui-svg-stage.lolo +98 -0
  11. package/behaviors/registry/ui/core/atoms/std-browse.orb +104 -28
  12. package/behaviors/registry/ui/core/molecules/ui-data-list.orb +21 -0
  13. package/behaviors/registry/ui/game/atoms/ui-draw-group.orb +196 -0
  14. package/behaviors/registry/ui/game/atoms/ui-draw-shape.orb +9 -1
  15. package/behaviors/registry/ui/game/atoms/ui-svg-draw-group.orb +186 -0
  16. package/behaviors/registry/ui/game/atoms/ui-svg-draw-shape.orb +259 -0
  17. package/behaviors/registry/ui/game/atoms/ui-svg-draw-text.orb +195 -0
  18. package/behaviors/registry/ui/game/molecules/ui-draw-shape-layer.orb +9 -1
  19. package/behaviors/registry/ui/game/molecules/ui-svg-draw-shape-layer.orb +188 -0
  20. package/behaviors/registry/ui/game/molecules/ui-svg-stage.orb +362 -0
  21. package/dist/behaviors/behaviors-embeddings.json +511 -487
  22. package/dist/behaviors/behaviors-registry.json +2277 -341
  23. package/dist/behaviors/functions/index.d.ts +14 -2
  24. package/dist/behaviors/index.d.ts +1 -1
  25. package/dist/behaviors/knob-embeddings.json +1 -1
  26. package/dist/behaviors/registry/ui/core/atoms/std-browse.orb +104 -28
  27. package/dist/behaviors/registry/ui/core/molecules/ui-data-list.orb +21 -0
  28. package/dist/behaviors/registry/ui/game/atoms/ui-draw-group.orb +196 -0
  29. package/dist/behaviors/registry/ui/game/atoms/ui-draw-shape.orb +9 -1
  30. package/dist/behaviors/registry/ui/game/atoms/ui-svg-draw-group.orb +186 -0
  31. package/dist/behaviors/registry/ui/game/atoms/ui-svg-draw-shape.orb +259 -0
  32. package/dist/behaviors/registry/ui/game/atoms/ui-svg-draw-text.orb +195 -0
  33. package/dist/behaviors/registry/ui/game/molecules/ui-draw-shape-layer.orb +9 -1
  34. package/dist/behaviors/registry/ui/game/molecules/ui-svg-draw-shape-layer.orb +188 -0
  35. package/dist/behaviors/registry/ui/game/molecules/ui-svg-stage.orb +362 -0
  36. package/dist/behaviors-embeddings.json +511 -487
  37. package/dist/behaviors-registry.json +2277 -341
  38. package/dist/index.d.ts +1 -1
  39. package/dist/knob-embeddings.json +1 -1
  40. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- app std-browse "2.4.0"
1
+ app std-browse "2.5.0"
2
2
  "std-browse as a Function — single primitive: data-grid. Owns the fetch + REFETCH (query/filter/page) state machine. Consumers configure fields/imageField/itemActions/cols/gap/variant; the atom renders the grid. Each `fields[]` entry accepts `{ name, label, variant }` plus optional `referenceEntity` + `displayField` to render a foreign-key column as the joined entity's display value (data-grid resolves @list[referenceEntity] at render time when both keys are present). `browseLook` (table default / dense / feed / gallery / master-detail / triage) selects one of six render bodies; dense/feed/gallery were folded in from std-browse-dense/-feed/-gallery (Phase 5.B); master-detail (split record view driven by the guarded VIEW/CLOSE self-transitions) and triage (inbox rows) were folded in 2026-07-26. Consumers retarget by setting browseLook."
3
3
  type FieldSpec = { name : string!, label : string, variant : h3 | h4 | body | caption | badge | small | progress, icon : string, format : date | currency | number | boolean | percent, key : string, header : string }
4
4
  type ItemAction = { label : string!, event : string, navigatesTo : string, variant : primary | secondary | ghost | danger, icon : string }
@@ -75,7 +75,7 @@ orbital BrowseItemOrbital {
75
75
  INIT -> loading
76
76
  (fetch BrowseItem {
77
77
  emit: { failure: BrowseItemLoadFailed, success: BrowseItemLoaded }
78
- filter: (or ["=", @config.scopeField, ""] ["=", (object/get @entity @config.scopeField), @user.id])
78
+ filter: (and (or ["=", @config.scopeField, ""] ["=", (object/get @entity @config.scopeField), @user.id]) (or ["=", @config.initialFilterField, ""] ["=", (object/get @entity @config.initialFilterField), @config.initialFilterValue]))
79
79
  limit: @config.pageSize
80
80
  offset: 0
81
81
  })
@@ -104,7 +104,7 @@ orbital BrowseItemOrbital {
104
104
  INIT -> loading
105
105
  (fetch BrowseItem {
106
106
  emit: { failure: BrowseItemLoadFailed, success: BrowseItemLoaded }
107
- filter: (or ["=", @config.scopeField, ""] ["=", (object/get @entity @config.scopeField), @user.id])
107
+ filter: (and (or ["=", @config.scopeField, ""] ["=", (object/get @entity @config.scopeField), @user.id]) (or ["=", @config.initialFilterField, ""] ["=", (object/get @entity @config.initialFilterField), @config.initialFilterValue]))
108
108
  limit: @config.pageSize
109
109
  offset: 0
110
110
  })
@@ -161,7 +161,7 @@ orbital BrowseItemOrbital {
161
161
  INIT -> loading
162
162
  (fetch BrowseItem {
163
163
  emit: { failure: BrowseItemLoadFailed, success: BrowseItemLoaded }
164
- filter: (or ["=", @config.scopeField, ""] ["=", (object/get @entity @config.scopeField), @user.id])
164
+ filter: (and (or ["=", @config.scopeField, ""] ["=", (object/get @entity @config.scopeField), @user.id]) (or ["=", @config.initialFilterField, ""] ["=", (object/get @entity @config.initialFilterField), @config.initialFilterValue]))
165
165
  limit: @config.pageSize
166
166
  offset: 0
167
167
  })
@@ -353,6 +353,16 @@ orbital BrowseItemOrbital {
353
353
  @description "Name the field on this entity that holds the viewer's id (e.g. memberId, patientId, assignee). When set, the list loads ONLY rows whose that field equals @user.id — the 'my bookings' / 'my appointments' shape. Left blank the list loads every row, which is the default. Declared, never inferred: guessing the column from its name would silently scope the wrong one."
354
354
  @synonyms "owner field, my records, only mine, only my own, scope to user, per-user list, mine only, owned by me"
355
355
  @tier "policy"
356
+ initialFilterField : string = ""
357
+ @label "Which field does the first load filter on?"
358
+ @description "Name the field the INITIAL load filters on, paired with initialFilterValue. This is the detail half of a list-detail pair: a thread that must wait for a conversation to be picked sets the field to its parent key and leaves the value blank, so the first load matches nothing and the empty state shows instead of every record in the table. REFETCH_FILTER then supplies the real selection. Left blank the first load is unfiltered, which is the default."
359
+ @synonyms "initial filter, first load filter, wait for selection, detail pane filter, requires selection, start empty"
360
+ @tier "policy"
361
+ initialFilterValue : string = ""
362
+ @label "What value does the first load filter for?"
363
+ @description "The value initialFilterField must equal on the first load. Blank is meaningful: it matches only records whose field is itself blank, which for a detail pane is normally none — that is how a thread stays empty until its parent is selected."
364
+ @synonyms "initial filter value, first load value, default selection"
365
+ @tier "policy"
356
366
  selectable : boolean = false
357
367
  @label "Show row selection checkboxes?"
358
368
  @description "Adds a checkbox column with select-all to the dense table. Enable only when the surface offers bulk actions — checkboxes with nothing to act on are a dead affordance."
@@ -84,6 +84,8 @@ orbital DataListOrbital {
84
84
  loadMoreEvent: @config.loadMoreEvent
85
85
  hasMore: @config.hasMore
86
86
  pageSize: @config.pageSize
87
+ sortBy: @config.sortBy
88
+ sortDirection: @config.sortDirection
87
89
  look: @config.look
88
90
  type: data-list
89
91
  })
@@ -123,6 +125,8 @@ orbital DataListOrbital {
123
125
  loadMoreEvent: @config.loadMoreEvent
124
126
  hasMore: @config.hasMore
125
127
  pageSize: @config.pageSize
128
+ sortBy: @config.sortBy
129
+ sortDirection: @config.sortDirection
126
130
  look: @config.look
127
131
  type: data-list
128
132
  })
@@ -303,6 +307,14 @@ orbital DataListOrbital {
303
307
  @label "Page Size"
304
308
  @description "Max items to show before 'Show More' button. Defaults to 5. Set to 0 to disable."
305
309
  @tier "presentation"
310
+ sortBy : string
311
+ @label "Sort By"
312
+ @description "Field name to order rows by. Values are compared by their own type — numbers numerically, date-like strings chronologically, everything else alphabetically — never by what the field is called. Empty cells sort last. Unset leaves the incoming order untouched. Orders only the rows already fetched: a collection larger than its `limit` still needs ordering at the data layer."
313
+ @tier "presentation"
314
+ sortDirection : "asc" | "desc" = asc
315
+ @label "Sort Direction"
316
+ @description "Direction for `sortBy`. Defaults to ascending."
317
+ @tier "presentation"
306
318
  look : "dense" | "spacious" | "striped" | "borderless" | "card-rows" = dense
307
319
  @label "Look"
308
320
  @description "Layer 2 visual treatment — mirrors the `entity-table` look enum so data-grid / data-list / entity-table share one knob name from authors."
@@ -0,0 +1,54 @@
1
+ app ui-draw-group "1.0.0"
2
+ "DrawGroup — UI factory (1:1 with the @almadar/ui draw-group pattern)."
3
+ orbital DrawGroupOrbital {
4
+ type DrawGroupPosition = {
5
+ x : number!
6
+ y : number!
7
+ z : number
8
+ }
9
+
10
+ entity DrawGroupItem [runtime] {
11
+ id : string!
12
+ }
13
+
14
+ trait DrawGroupRender -> @rebindable DrawGroupItem [interaction, instance] {
15
+ initial: idle
16
+
17
+ state idle {
18
+ INIT -> idle
19
+ (render-ui main {
20
+ position: @config.position
21
+ scale: @config.scale
22
+ rotate: @config.rotate
23
+ opacity: @config.opacity
24
+ items: @config.items
25
+ type: draw-group
26
+ })
27
+ }
28
+
29
+ config {
30
+ position : DrawGroupPosition = { x: 1, y: 1, z: 1 }
31
+ @label "Position"
32
+ @description "Logical scene position; the projector maps it to pixels / world."
33
+ @tier "presentation"
34
+ scale : number
35
+ @label "Scale"
36
+ @description "Uniform scale applied to the whole group."
37
+ @tier "presentation"
38
+ rotate : number
39
+ @label "Rotate"
40
+ @description "Rotation in radians (painter units)."
41
+ @tier "presentation"
42
+ opacity : number
43
+ @label "Opacity"
44
+ @description "0..1 opacity."
45
+ @tier "presentation"
46
+ items : [json] = []
47
+ @label "Items"
48
+ @description "The grouped drawables, painted through the normal dispatch."
49
+ @tier "presentation"
50
+ }
51
+ }
52
+
53
+ page "/draw-group" as DrawGroupPage -> DrawGroupRender
54
+ }
@@ -27,6 +27,7 @@ orbital DrawShapeOrbital {
27
27
  offsetX: @config.offsetX
28
28
  offsetY: @config.offsetY
29
29
  points: @config.points
30
+ d: @config.d
30
31
  fill: @config.fill
31
32
  stroke: @config.stroke
32
33
  strokeWidth: @config.strokeWidth
@@ -36,7 +37,7 @@ orbital DrawShapeOrbital {
36
37
  }
37
38
 
38
39
  config {
39
- shape : "cell" | "rect" | "ellipse" | "poly" = cell
40
+ shape : "cell" | "rect" | "ellipse" | "poly" | "path" = cell
40
41
  @label "Shape"
41
42
  @description "shape prop"
42
43
  @tier "presentation"
@@ -76,6 +77,10 @@ orbital DrawShapeOrbital {
76
77
  @label "Points"
77
78
  @description "Poly vertices as world-unit offsets relative to the cell's projected top-left."
78
79
  @tier "presentation"
80
+ d : string
81
+ @label "D"
82
+ @description "SVG path data in world units relative to the cell's projected top-left — same coordinate convention as `points`."
83
+ @tier "presentation"
79
84
  fill : string
80
85
  @label "Fill"
81
86
  @description "fill prop"
@@ -0,0 +1,58 @@
1
+ app ui-svg-draw-group "1.0.0"
2
+ "SvgDrawGroup — UI factory (1:1 with the @almadar/ui svg-draw-group pattern)."
3
+ orbital SvgDrawGroupOrbital {
4
+ entity SvgDrawGroupItem [runtime] {
5
+ id : string!
6
+ }
7
+
8
+ trait SvgDrawGroupRender -> @rebindable SvgDrawGroupItem [interaction, instance] {
9
+ initial: idle
10
+
11
+ state idle {
12
+ INIT -> idle
13
+ (render-ui main {
14
+ x: @config.x
15
+ y: @config.y
16
+ scale: @config.scale
17
+ rotate: @config.rotate
18
+ opacity: @config.opacity
19
+ className: @config.className
20
+ children: @config.children
21
+ type: svg-draw-group
22
+ })
23
+ }
24
+
25
+ config {
26
+ x : number = 0
27
+ @label "X"
28
+ @description "Grid-cell x of the group's origin."
29
+ @tier "presentation"
30
+ y : number = 0
31
+ @label "Y"
32
+ @description "Grid-cell y of the group's origin."
33
+ @tier "presentation"
34
+ scale : number
35
+ @label "Scale"
36
+ @description "Uniform scale applied after the translate."
37
+ @tier "presentation"
38
+ rotate : number
39
+ @label "Rotate"
40
+ @description "Rotation in degrees applied after the translate."
41
+ @tier "presentation"
42
+ opacity : number
43
+ @label "Opacity"
44
+ @description "0..1 opacity."
45
+ @tier "presentation"
46
+ className : string
47
+ @label "Class Name"
48
+ @description "Additional CSS classes"
49
+ @tier "presentation"
50
+ children : node
51
+ @label "Children"
52
+ @description "children prop"
53
+ @tier "presentation"
54
+ }
55
+ }
56
+
57
+ page "/svg-draw-group" as SvgDrawGroupPage -> SvgDrawGroupRender
58
+ }
@@ -0,0 +1,103 @@
1
+ app ui-svg-draw-shape "1.0.0"
2
+ "SvgDrawShape — UI factory (1:1 with the @almadar/ui svg-draw-shape pattern)."
3
+ orbital SvgDrawShapeOrbital {
4
+ entity SvgDrawShapeItem [runtime] {
5
+ id : string!
6
+ }
7
+
8
+ trait SvgDrawShapeRender -> @rebindable SvgDrawShapeItem [interaction, instance] {
9
+ initial: idle
10
+
11
+ state idle {
12
+ INIT -> idle
13
+ (render-ui main {
14
+ shape: @config.shape
15
+ x: @config.x
16
+ y: @config.y
17
+ width: @config.width
18
+ height: @config.height
19
+ radius: @config.radius
20
+ radiusY: @config.radiusY
21
+ points: @config.points
22
+ d: @config.d
23
+ x2: @config.x2
24
+ y2: @config.y2
25
+ fill: @config.fill
26
+ stroke: @config.stroke
27
+ strokeWidth: @config.strokeWidth
28
+ opacity: @config.opacity
29
+ className: @config.className
30
+ type: svg-draw-shape
31
+ })
32
+ }
33
+
34
+ config {
35
+ shape : "rect" | "circle" | "ellipse" | "polygon" | "polyline" | "path" | "line" = rect
36
+ @label "Shape"
37
+ @description "shape prop"
38
+ @tier "presentation"
39
+ x : number = 1
40
+ @label "X"
41
+ @description "Grid-cell x of the element's translated origin."
42
+ @tier "presentation"
43
+ y : number = 1
44
+ @label "Y"
45
+ @description "Grid-cell y of the element's translated origin."
46
+ @tier "presentation"
47
+ width : number
48
+ @label "Width"
49
+ @description "Rect width in cell units."
50
+ @tier "presentation"
51
+ height : number
52
+ @label "Height"
53
+ @description "Rect height in cell units."
54
+ @tier "presentation"
55
+ radius : number
56
+ @label "Radius"
57
+ @description "Circle radius / ellipse horizontal radius in cell units."
58
+ @tier "presentation"
59
+ radiusY : number
60
+ @label "Radius Y"
61
+ @description "Ellipse vertical radius in cell units; omitted → `radius` (a circle)."
62
+ @tier "presentation"
63
+ points : string
64
+ @label "Points"
65
+ @description "Polygon/polyline points, viewBox units relative to the translated origin."
66
+ @tier "presentation"
67
+ d : string
68
+ @label "D"
69
+ @description "Path data, viewBox units relative to the translated origin."
70
+ @tier "presentation"
71
+ x2 : number
72
+ @label "X2"
73
+ @description "Line end x in cell units."
74
+ @tier "presentation"
75
+ y2 : number
76
+ @label "Y2"
77
+ @description "Line end y in cell units."
78
+ @tier "presentation"
79
+ fill : string
80
+ @label "Fill"
81
+ @description "fill prop"
82
+ @tier "presentation"
83
+ stroke : string
84
+ @label "Stroke"
85
+ @description "stroke prop"
86
+ @tier "presentation"
87
+ strokeWidth : number
88
+ @label "Stroke Width"
89
+ @description "strokeWidth prop"
90
+ @tier "presentation"
91
+ opacity : number
92
+ @label "Opacity"
93
+ @description "0..1 opacity."
94
+ @tier "presentation"
95
+ className : string
96
+ @label "Class Name"
97
+ @description "Additional CSS classes"
98
+ @tier "presentation"
99
+ }
100
+ }
101
+
102
+ page "/svg-draw-shape" as SvgDrawShapePage -> SvgDrawShapeRender
103
+ }
@@ -0,0 +1,58 @@
1
+ app ui-svg-draw-text "1.0.0"
2
+ "SvgDrawText — UI factory (1:1 with the @almadar/ui svg-draw-text pattern)."
3
+ orbital SvgDrawTextOrbital {
4
+ entity SvgDrawTextItem [runtime] {
5
+ id : string!
6
+ }
7
+
8
+ trait SvgDrawTextRender -> @rebindable SvgDrawTextItem [interaction, instance] {
9
+ initial: idle
10
+
11
+ state idle {
12
+ INIT -> idle
13
+ (render-ui main {
14
+ x: @config.x
15
+ y: @config.y
16
+ text: @config.text
17
+ size: @config.size
18
+ fill: @config.fill
19
+ anchor: @config.anchor
20
+ className: @config.className
21
+ type: svg-draw-text
22
+ })
23
+ }
24
+
25
+ config {
26
+ x : number = 1
27
+ @label "X"
28
+ @description "Grid-cell x of the text anchor."
29
+ @tier "presentation"
30
+ y : number = 1
31
+ @label "Y"
32
+ @description "Grid-cell y of the text anchor."
33
+ @tier "presentation"
34
+ text : string = ""
35
+ @label "Text"
36
+ @description "The text content."
37
+ @tier "presentation"
38
+ size : number = 12
39
+ @label "Size"
40
+ @description "Font size in viewBox units (default 12)."
41
+ @tier "presentation"
42
+ fill : string = "var(--color-foreground)"
43
+ @label "Fill"
44
+ @description "fill prop"
45
+ @tier "presentation"
46
+ anchor : "start" | "middle" | "end" = middle
47
+ @label "Anchor"
48
+ @description "Text anchor (default 'middle')."
49
+ @tier "presentation"
50
+ className : string
51
+ @label "Class Name"
52
+ @description "Additional CSS classes"
53
+ @tier "presentation"
54
+ }
55
+ }
56
+
57
+ page "/svg-draw-text" as SvgDrawTextPage -> SvgDrawTextRender
58
+ }
@@ -3,7 +3,7 @@ app ui-draw-shape-layer "1.0.0"
3
3
  orbital DrawShapeLayerOrbital {
4
4
  type DrawShapeLayerItemsItem = {
5
5
  type : json!
6
- shape : "cell" | "rect" | "ellipse" | "poly"!
6
+ shape : "cell" | "rect" | "ellipse" | "poly" | "path"!
7
7
  position : DrawShapeLayerItemsItemPosition!
8
8
  anchor : json
9
9
  width : number
@@ -13,6 +13,7 @@ orbital DrawShapeLayerOrbital {
13
13
  offsetX : number
14
14
  offsetY : number
15
15
  points : [json]
16
+ d : string
16
17
  fill : string
17
18
  stroke : string
18
19
  strokeWidth : number
@@ -40,7 +41,7 @@ orbital DrawShapeLayerOrbital {
40
41
  }
41
42
 
42
43
  config {
43
- items : [DrawShapeLayerItemsItem] = [{ type: "Type", shape: cell, position: { x: 1, y: 1, z: 1 }, width: 1, height: 1, radiusX: 1, radiusY: 1, offsetX: 1, offsetY: 1, points: [], fill: "Fill", stroke: "Stroke", strokeWidth: 1, opacity: 1 }, { type: "Type 2", shape: rect, position: { x: 2, y: 2, z: 2 }, width: 2, height: 2, radiusX: 2, radiusY: 2, offsetX: 2, offsetY: 2, points: [], fill: "Fill 2", stroke: "Stroke 2", strokeWidth: 2, opacity: 2 }]
44
+ items : [DrawShapeLayerItemsItem] = [{ type: "Type", shape: cell, position: { x: 1, y: 1, z: 1 }, width: 1, height: 1, radiusX: 1, radiusY: 1, offsetX: 1, offsetY: 1, points: [], d: "D", fill: "Fill", stroke: "Stroke", strokeWidth: 1, opacity: 1 }, { type: "Type 2", shape: rect, position: { x: 2, y: 2, z: 2 }, width: 2, height: 2, radiusX: 2, radiusY: 2, offsetX: 2, offsetY: 2, points: [], d: "D 2", fill: "Fill 2", stroke: "Stroke 2", strokeWidth: 2, opacity: 2 }]
44
45
  @label "Items"
45
46
  @description "items prop"
46
47
  @tier "presentation"
@@ -0,0 +1,52 @@
1
+ app ui-svg-draw-shape-layer "1.0.0"
2
+ "SvgDrawShapeLayer — UI factory (1:1 with the @almadar/ui svg-draw-shape-layer pattern)."
3
+ orbital SvgDrawShapeLayerOrbital {
4
+ type SvgDrawShapeLayerItemsItem = {
5
+ id : string!
6
+ }
7
+
8
+ entity SvgDrawShapeLayerItem [runtime] {
9
+ id : string!
10
+ }
11
+
12
+ trait SvgDrawShapeLayerRender -> @rebindable SvgDrawShapeLayerItem [interaction, instance] {
13
+ initial: idle
14
+
15
+ state idle {
16
+ INIT -> idle
17
+ (render-ui main {
18
+ items: @config.items
19
+ fill: @config.fill
20
+ stroke: @config.stroke
21
+ strokeWidth: @config.strokeWidth
22
+ opacity: @config.opacity
23
+ type: svg-draw-shape-layer
24
+ })
25
+ }
26
+
27
+ config {
28
+ items : [SvgDrawShapeLayerItemsItem] = [{ id: "Id" }, { id: "Id 2" }]
29
+ @label "Items"
30
+ @description "items prop"
31
+ @tier "presentation"
32
+ fill : string
33
+ @label "Fill"
34
+ @description "Default fill for items that don't set one."
35
+ @tier "presentation"
36
+ stroke : string
37
+ @label "Stroke"
38
+ @description "Default stroke for items that don't set one."
39
+ @tier "presentation"
40
+ strokeWidth : number
41
+ @label "Stroke Width"
42
+ @description "Default strokeWidth for items that don't set one."
43
+ @tier "presentation"
44
+ opacity : number
45
+ @label "Opacity"
46
+ @description "Default 0..1 opacity for items that don't set one."
47
+ @tier "presentation"
48
+ }
49
+ }
50
+
51
+ page "/svg-draw-shape-layer" as SvgDrawShapeLayerPage -> SvgDrawShapeLayerRender
52
+ }
@@ -0,0 +1,98 @@
1
+ app ui-svg-stage "1.0.0"
2
+ "SvgStage — UI factory (1:1 with the @almadar/ui svg-stage pattern)."
3
+ orbital SvgStageOrbital {
4
+ entity SvgStageItem [runtime] {
5
+ id : string!
6
+ }
7
+
8
+ trait SvgStageRender -> @rebindable SvgStageItem [interaction, instance] {
9
+ initial: idle
10
+
11
+ state idle {
12
+ INIT -> idle
13
+ (render-ui main {
14
+ cols: @config.cols
15
+ rows: @config.rows
16
+ tileSize: @config.tileSize
17
+ background: @config.background
18
+ tileClickEvent: @config.tileClickEvent
19
+ tileHoverEvent: @config.tileHoverEvent
20
+ tileLeaveEvent: @config.tileLeaveEvent
21
+ keyMap: @config.keyMap
22
+ keyUpMap: @config.keyUpMap
23
+ className: @config.className
24
+ children: @config.children
25
+ type: svg-stage
26
+ })
27
+ }
28
+
29
+ emits {
30
+ @config.tileClickEvent -> external {
31
+ x : number!
32
+ y : number!
33
+ }
34
+ @description "Emitted as `UI:<event>` with `{ x, y }` cell coords on pointer up (<5px drag)."
35
+ @tier "essential"
36
+ @config.tileHoverEvent -> external {
37
+ x : number!
38
+ y : number!
39
+ }
40
+ @description "Emitted as `UI:<event>` with `{ x, y }` cell coords on pointer move."
41
+ @tier "essential"
42
+ @config.tileLeaveEvent -> external {
43
+ id : string
44
+ }
45
+ @description "Emitted as `UI:<event>` with `{}` when the pointer leaves the stage."
46
+ @tier "essential"
47
+ }
48
+
49
+ config {
50
+ cols : number = 1
51
+ @label "Cols"
52
+ @description "Grid width in cells."
53
+ @tier "presentation"
54
+ rows : number = 1
55
+ @label "Rows"
56
+ @description "Grid height in cells."
57
+ @tier "presentation"
58
+ tileSize : number = 32
59
+ @label "Tile Size"
60
+ @description "ViewBox units per cell (default 32); viewBox is `0 0 cols*tileSize rows*tileSize`."
61
+ @tier "presentation"
62
+ background : string = "var(--color-background)"
63
+ @label "Background"
64
+ @description "Background rect fill (default `var(--color-background)`)."
65
+ @tier "presentation"
66
+ tileClickEvent : string = "TILE_CLICK"
67
+ @label "Tile Click Event"
68
+ @description "Emitted as `UI:<event>` with `{ x, y }` cell coords on pointer up (<5px drag)."
69
+ @tier "presentation"
70
+ tileHoverEvent : string = "TILE_HOVER"
71
+ @label "Tile Hover Event"
72
+ @description "Emitted as `UI:<event>` with `{ x, y }` cell coords on pointer move."
73
+ @tier "presentation"
74
+ tileLeaveEvent : string = "TILE_LEAVE"
75
+ @label "Tile Leave Event"
76
+ @description "Emitted as `UI:<event>` with `{}` when the pointer leaves the stage."
77
+ @tier "presentation"
78
+ keyMap : Map string string = { item: "Item" }
79
+ @label "Key Map"
80
+ @description "Keyboard → semantic events: `e.code` → event name, emitted as `UI:<event>` with `{}`."
81
+ @tier "presentation"
82
+ keyUpMap : Map string string = { item: "Item" }
83
+ @label "Key Up Map"
84
+ @description "Keyup counterpart of `keyMap`."
85
+ @tier "presentation"
86
+ className : string
87
+ @label "Class Name"
88
+ @description "Additional CSS classes"
89
+ @tier "presentation"
90
+ children : node
91
+ @label "Children"
92
+ @description "children prop"
93
+ @tier "presentation"
94
+ }
95
+ }
96
+
97
+ page "/svg-stage" as SvgStagePage -> SvgStageRender
98
+ }