@xenosystem/elements 0.0.6 โ†’ 0.0.8

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 (38) hide show
  1. package/README.md +65 -65
  2. package/dist/elements/archive.js +11 -0
  3. package/dist/elements/book-up.d.ts +10 -0
  4. package/dist/elements/book-up.js +22 -0
  5. package/dist/elements/bookmark.js +7 -0
  6. package/dist/elements/bring-to-front.d.ts +10 -0
  7. package/dist/elements/bring-to-front.js +25 -0
  8. package/dist/elements/broadcast.d.ts +12 -0
  9. package/dist/elements/broadcast.js +27 -0
  10. package/dist/elements/clipboard-check.d.ts +10 -0
  11. package/dist/elements/clipboard-check.js +23 -0
  12. package/dist/elements/command.d.ts +11 -0
  13. package/dist/elements/command.js +26 -0
  14. package/dist/elements/ellipse.d.ts +15 -0
  15. package/dist/elements/ellipse.js +26 -0
  16. package/dist/elements/frame.d.ts +14 -0
  17. package/dist/elements/frame.js +28 -0
  18. package/dist/elements/group.d.ts +11 -0
  19. package/dist/elements/group.js +27 -0
  20. package/dist/elements/next-dismiss.js +4 -0
  21. package/dist/elements/pen.d.ts +12 -0
  22. package/dist/elements/pen.js +27 -0
  23. package/dist/elements/pointer.d.ts +10 -0
  24. package/dist/elements/pointer.js +21 -0
  25. package/dist/elements/polygon.d.ts +10 -0
  26. package/dist/elements/polygon.js +21 -0
  27. package/dist/elements/send-to-back.d.ts +10 -0
  28. package/dist/elements/send-to-back.js +25 -0
  29. package/dist/elements/star.js +5 -0
  30. package/dist/elements/template.d.ts +11 -0
  31. package/dist/elements/template.js +25 -0
  32. package/dist/elements/ungroup.d.ts +9 -0
  33. package/dist/elements/ungroup.js +21 -0
  34. package/dist/elements/zoom-in.d.ts +10 -0
  35. package/dist/elements/zoom-in.js +23 -0
  36. package/dist/schema.d.ts +15 -0
  37. package/dist/states.js +4 -2
  38. package/package.json +2 -2
package/README.md CHANGED
@@ -1,65 +1,65 @@
1
- # @xenosystem/elements
2
-
3
- **The XENO element contract โ€” the source of truth.**
4
-
5
- > Status: ๐ŸŸก **Phase 1** โ€” schema written, declarations not yet drawn. Not published.
6
-
7
- Framework-free, platform-free, zero dependencies. This package is a **contract**, not a component
8
- library โ€” it contains no React, no rendering, and nothing platform-specific. Every renderer on
9
- every platform is an interpretation of what is declared here.
10
-
11
- ## What lives here
12
-
13
- | | |
14
- |---|---|
15
- | `src/schema.ts` | The contract: state axes, signals, transitions, bindings, compatibility |
16
- | `src/elements/` | Element declarations โ€” the glyphs and composites *(Phase 1, in progress)* |
17
- | `src/tokens/` | Design tokens, resolved from `DESIGN_SYSTEM.md` *(Phase 1)* |
18
-
19
- ## The two properties to preserve
20
-
21
- **1. There is no "icon" type.** An icon is the degenerate `ElementDeclaration` โ€” no children,
22
- pure geometry. A button is the compound one. They share one schema and one release path, which is
23
- what makes *"edit one icon"* and *"edit one button"* the identical operation. A refactor that
24
- gives icons their own type has thrown away the reason this repo exists.
25
-
26
- **2. A declaration contains data, never code.** No functions, no expressions, no executable
27
- animation. `Binding` is a *description* a renderer interprets. This is an architectural boundary
28
- with a legal edge โ€” see `docs/STATE-MODEL.md` ยง4.1.
29
-
30
- ## The state model, briefly
31
-
32
- Three orthogonal axes, because a single enum cannot express a disabled toggle that is *on*:
33
-
34
- ```ts
35
- { availability: 'enabled' | 'disabled' | 'busy'
36
- selection: 'off' | 'on' | 'mixed' // semantic, persists
37
- interaction: 'idle' | 'engaged' | 'pressed' } // transient
38
- ```
39
-
40
- Plus continuous **signals** (`progress` 0โ€ฆ1, `activity`) and momentary **transitions**
41
- (`commit`, `reject`, `toggle`).
42
-
43
- `engaged` = hover on pointer devices, **nothing on touch**. Full model:
44
- [`docs/STATE-MODEL.md`](../../docs/STATE-MODEL.md).
45
-
46
- ## Contract compatibility
47
-
48
- `checkCompatibility()` answers the question behind automatic propagation: *may this change reach
49
- a shipped product without that product rebuilding?*
50
-
51
- Refinements pass โ€” redrawn geometry, retuned timings, added variants, new elements. Breaks are
52
- refused โ€” a dropped axis, a changed viewBox, a removed element, a renamed id.
53
-
54
- It **fails closed**: anything it does not positively understand is a break. A permissive contract
55
- checker is worse than none, because it produces evidence of safety it has not established.
56
-
57
- ## Never barrel the declarations
58
-
59
- `src/index.ts` re-exports the schema โ€” small, tree-shakes cleanly. **Element declarations get
60
- per-element entry points.** A single index importing every element is exactly why `lucide-react`
61
- weighs 2.4 MB, and `lucide-react/dynamic` collapses to an empty chunk in production.
62
-
63
- ---
64
- Part of [`xeno-elements`](../../README.md). Visual authority:
65
- [`DESIGN_SYSTEM.md`](../../DESIGN_SYSTEM.md) โ€” LOCKED.
1
+ # @xenosystem/elements
2
+
3
+ **The XENO element contract โ€” the source of truth.**
4
+
5
+ > Status: ๐ŸŸก **Phase 1** โ€” schema written, declarations not yet drawn. Not published.
6
+
7
+ Framework-free, platform-free, zero dependencies. This package is a **contract**, not a component
8
+ library โ€” it contains no React, no rendering, and nothing platform-specific. Every renderer on
9
+ every platform is an interpretation of what is declared here.
10
+
11
+ ## What lives here
12
+
13
+ | | |
14
+ |---|---|
15
+ | `src/schema.ts` | The contract: state axes, signals, transitions, bindings, compatibility |
16
+ | `src/elements/` | Element declarations โ€” the glyphs and composites *(Phase 1, in progress)* |
17
+ | `src/tokens/` | Design tokens, resolved from `DESIGN_SYSTEM.md` *(Phase 1)* |
18
+
19
+ ## The two properties to preserve
20
+
21
+ **1. There is no "icon" type.** An icon is the degenerate `ElementDeclaration` โ€” no children,
22
+ pure geometry. A button is the compound one. They share one schema and one release path, which is
23
+ what makes *"edit one icon"* and *"edit one button"* the identical operation. A refactor that
24
+ gives icons their own type has thrown away the reason this repo exists.
25
+
26
+ **2. A declaration contains data, never code.** No functions, no expressions, no executable
27
+ animation. `Binding` is a *description* a renderer interprets. This is an architectural boundary
28
+ with a legal edge โ€” see `docs/STATE-MODEL.md` ยง4.1.
29
+
30
+ ## The state model, briefly
31
+
32
+ Three orthogonal axes, because a single enum cannot express a disabled toggle that is *on*:
33
+
34
+ ```ts
35
+ { availability: 'enabled' | 'disabled' | 'busy'
36
+ selection: 'off' | 'on' | 'mixed' // semantic, persists
37
+ interaction: 'idle' | 'engaged' | 'pressed' } // transient
38
+ ```
39
+
40
+ Plus continuous **signals** (`progress` 0โ€ฆ1, `activity`) and momentary **transitions**
41
+ (`commit`, `reject`, `toggle`).
42
+
43
+ `engaged` = hover on pointer devices, **nothing on touch**. Full model:
44
+ [`docs/STATE-MODEL.md`](../../docs/STATE-MODEL.md).
45
+
46
+ ## Contract compatibility
47
+
48
+ `checkCompatibility()` answers the question behind automatic propagation: *may this change reach
49
+ a shipped product without that product rebuilding?*
50
+
51
+ Refinements pass โ€” redrawn geometry, retuned timings, added variants, new elements. Breaks are
52
+ refused โ€” a dropped axis, a changed viewBox, a removed element, a renamed id.
53
+
54
+ It **fails closed**: anything it does not positively understand is a break. A permissive contract
55
+ checker is worse than none, because it produces evidence of safety it has not established.
56
+
57
+ ## Never barrel the declarations
58
+
59
+ `src/index.ts` re-exports the schema โ€” small, tree-shakes cleanly. **Element declarations get
60
+ per-element entry points.** A single index importing every element is exactly why `lucide-react`
61
+ weighs 2.4 MB, and `lucide-react/dynamic` collapses to an empty chunk in production.
62
+
63
+ ---
64
+ Part of [`xeno-elements`](../../README.md). Visual authority:
65
+ [`DESIGN_SYSTEM.md`](../../DESIGN_SYSTEM.md) โ€” LOCKED.
@@ -32,6 +32,17 @@ export const Archive = {
32
32
  { kind: 'path', d: 'M5 8.4v9.6A2 2 0 0 0 7 20h10a2 2 0 0 0 2-2V8.4' },
33
33
  { kind: 'path', d: 'M9.9 12.4h4.2' },
34
34
  ],
35
+ // MIXED โ€” the lid is where this element carries its state (it fills for `on`), so the partial state
36
+ // lives there too: the lid HALF filled, left half solid. NOT the system indeterminate bar used by
37
+ // bookmark and star โ€” archive's body already carries a slot of exactly that shape, and a bar in the
38
+ // lid read as a second slot in review rather than as "partly set". A half-filled lid is the one
39
+ // reading that cannot be mistaken for another part of the glyph.
40
+ 'selection:mixed': [
41
+ { kind: 'rect', x: 3, y: 4, w: 18, h: 4.4, rx: 1.2 },
42
+ { kind: 'path', d: 'M5 8.4v9.6A2 2 0 0 0 7 20h10a2 2 0 0 0 2-2V8.4' },
43
+ { kind: 'path', d: 'M9.9 12.4h4.2' },
44
+ { kind: 'rect', x: 3, y: 4, w: 9, h: 4.4, rx: 1.2, fill: 'foreground' },
45
+ ],
35
46
  },
36
47
  bindings: [],
37
48
  a11y: { role: 'img', label: 'Archive' },
@@ -0,0 +1,10 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.book-up` โ€” Publish library. A degenerate element (pure geometry, no children).
4
+ *
5
+ * A bound book with an up-arrow on its cover: a library being PUBLISHED. The Canvas Assets panel uses
6
+ * it for "Publishโ€ฆ" of a component library. `xeno.upload` is a file leaving the machine and
7
+ * `xeno.library` is a shelf; this is specifically the library going out as a unit.
8
+ */
9
+ export declare const BookUp: ElementDeclaration;
10
+ export default BookUp;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * `xeno.book-up` โ€” Publish library. A degenerate element (pure geometry, no children).
3
+ *
4
+ * A bound book with an up-arrow on its cover: a library being PUBLISHED. The Canvas Assets panel uses
5
+ * it for "Publishโ€ฆ" of a component library. `xeno.upload` is a file leaving the machine and
6
+ * `xeno.library` is a shelf; this is specifically the library going out as a unit.
7
+ */
8
+ export const BookUp = {
9
+ id: 'xeno.book-up',
10
+ kind: 'icon',
11
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
12
+ geometry: {
13
+ base: [
14
+ { kind: 'path', d: 'M5 18.5V5.2A2.2 2.2 0 0 1 7.2 3H19V21H7A2 2 0 0 1 5 19V18.5A2 2 0 0 1 7 16.5H19' },
15
+ { kind: 'path', d: 'M12 13V7M9.5 9.5 12 7 14.5 9.5' },
16
+ ],
17
+ },
18
+ bindings: [],
19
+ a11y: { role: 'img', label: 'Publish library' },
20
+ meta: { tags: ['book', 'book-up', 'publish', 'library', 'release'], since: '0.0.7' },
21
+ };
22
+ export default BookUp;
@@ -20,6 +20,13 @@ export const Bookmark = {
20
20
  'selection:on': [
21
21
  { kind: 'path', d: 'M6 4h12v17l-6-4-6 4z', fill: 'foreground' },
22
22
  ],
23
+ // MIXED โ€” some of a set are saved. The outline stays (not every item is on) and carries the
24
+ // system's one indeterminate mark, the bar `Checkbox` stamps for `mixed`: tri-state reads the
25
+ // same everywhere instead of each glyph inventing its own half-state.
26
+ 'selection:mixed': [
27
+ { kind: 'path', d: 'M6 4h12v17l-6-4-6 4z' },
28
+ { kind: 'rect', x: 9, y: 9.1, w: 6, h: 1.8, rx: 0.4, fill: 'foreground' },
29
+ ],
23
30
  },
24
31
  bindings: [],
25
32
  a11y: { role: 'img', label: 'Bookmark' },
@@ -0,0 +1,10 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.bring-to-front` โ€” Bring to front. A degenerate element (pure geometry, no children).
4
+ *
5
+ * Two overlapping squares where the FRONT one is SOLID and the one behind is an outline cut off where
6
+ * the front one covers it. Solid-on-top is the whole meaning; `xeno.send-to-back` is the same pair
7
+ * with the stacking reversed, so the two differ in exactly the property the actions change.
8
+ */
9
+ export declare const BringToFront: ElementDeclaration;
10
+ export default BringToFront;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * `xeno.bring-to-front` โ€” Bring to front. A degenerate element (pure geometry, no children).
3
+ *
4
+ * Two overlapping squares where the FRONT one is SOLID and the one behind is an outline cut off where
5
+ * the front one covers it. Solid-on-top is the whole meaning; `xeno.send-to-back` is the same pair
6
+ * with the stacking reversed, so the two differ in exactly the property the actions change.
7
+ */
8
+ export const BringToFront = {
9
+ id: 'xeno.bring-to-front',
10
+ kind: 'icon',
11
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
12
+ geometry: {
13
+ base: [
14
+ // The square BEHIND (footprint 4..14): an outline broken 2 units short of the front square, so
15
+ // the break itself says "covered". Only the parts that would be visible are drawn.
16
+ { kind: 'path', d: 'M8 14H5.4A1.4 1.4 0 0 1 4 12.6V5.4A1.4 1.4 0 0 1 5.4 4H12.6A1.4 1.4 0 0 1 14 5.4V8' },
17
+ // The square IN FRONT (footprint 10..20): solid.
18
+ { kind: 'rect', x: 10, y: 10, w: 10, h: 10, rx: 1.4, fill: 'foreground' },
19
+ ],
20
+ },
21
+ bindings: [],
22
+ a11y: { role: 'img', label: 'Bring to front' },
23
+ meta: { tags: ['bring-to-front', 'z-order', 'raise', 'arrange', 'stack'], since: '0.0.7' },
24
+ };
25
+ export default BringToFront;
@@ -0,0 +1,12 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.broadcast` โ€” Live session. A degenerate element (pure geometry, no children).
4
+ *
5
+ * A square emitter with two pairs of bracket-shaped waves either side: something is being SHARED LIVE.
6
+ * Canvas uses it for hosting and joining a multiplayer session. The usual radio mark draws arcs of a
7
+ * circle around a dot; here the emitter is a square and each wave is a bracket with rounded corners,
8
+ * so the silhouette survives and the circles DESIGN_SYSTEM ยง3 forbids do not. `xeno.dot-square` is a
9
+ * static marker and carries no sense of transmission.
10
+ */
11
+ export declare const Broadcast: ElementDeclaration;
12
+ export default Broadcast;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `xeno.broadcast` โ€” Live session. A degenerate element (pure geometry, no children).
3
+ *
4
+ * A square emitter with two pairs of bracket-shaped waves either side: something is being SHARED LIVE.
5
+ * Canvas uses it for hosting and joining a multiplayer session. The usual radio mark draws arcs of a
6
+ * circle around a dot; here the emitter is a square and each wave is a bracket with rounded corners,
7
+ * so the silhouette survives and the circles DESIGN_SYSTEM ยง3 forbids do not. `xeno.dot-square` is a
8
+ * static marker and carries no sense of transmission.
9
+ */
10
+ export const Broadcast = {
11
+ id: 'xeno.broadcast',
12
+ kind: 'icon',
13
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
14
+ geometry: {
15
+ base: [
16
+ { kind: 'rect', x: 10, y: 10, w: 4, h: 4, rx: 0.8, fill: 'foreground' },
17
+ { kind: 'path', d: 'M7.6 8.4 6.6 9.4Q6 10 6 10.8V13.2Q6 14 6.6 14.6L7.6 15.6' },
18
+ { kind: 'path', d: 'M16.4 8.4 17.4 9.4Q18 10 18 10.8V13.2Q18 14 17.4 14.6L16.4 15.6' },
19
+ { kind: 'path', d: 'M5 5.8 3.2 7.6Q2.5 8.3 2.5 9.3V14.7Q2.5 15.7 3.2 16.4L5 18.2' },
20
+ { kind: 'path', d: 'M19 5.8 20.8 7.6Q21.5 8.3 21.5 9.3V14.7Q21.5 15.7 20.8 16.4L19 18.2' },
21
+ ],
22
+ },
23
+ bindings: [],
24
+ a11y: { role: 'img', label: 'Live session' },
25
+ meta: { tags: ['broadcast', 'radio', 'live', 'share', 'multiplayer', 'session'], since: '0.0.7' },
26
+ };
27
+ export default Broadcast;
@@ -0,0 +1,10 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.clipboard-check` โ€” Audit. A degenerate element (pure geometry, no children).
4
+ *
5
+ * A clipboard with a tick on it: a checklist that has been run. Canvas uses it for the local page
6
+ * audit (contrast, touch targets, component candidates). `xeno.check-square` is a checkbox โ€” a single
7
+ * ticked control โ€” and cannot carry "a review was performed".
8
+ */
9
+ export declare const ClipboardCheck: ElementDeclaration;
10
+ export default ClipboardCheck;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * `xeno.clipboard-check` โ€” Audit. A degenerate element (pure geometry, no children).
3
+ *
4
+ * A clipboard with a tick on it: a checklist that has been run. Canvas uses it for the local page
5
+ * audit (contrast, touch targets, component candidates). `xeno.check-square` is a checkbox โ€” a single
6
+ * ticked control โ€” and cannot carry "a review was performed".
7
+ */
8
+ export const ClipboardCheck = {
9
+ id: 'xeno.clipboard-check',
10
+ kind: 'icon',
11
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
12
+ geometry: {
13
+ base: [
14
+ { kind: 'path', d: 'M8 4.5H6.2A1.2 1.2 0 0 0 5 5.7V19.8A1.2 1.2 0 0 0 6.2 21H17.8A1.2 1.2 0 0 0 19 19.8V5.7A1.2 1.2 0 0 0 17.8 4.5H16' },
15
+ { kind: 'rect', x: 8, y: 2.5, w: 8, h: 4, rx: 1 },
16
+ { kind: 'path', d: 'M8.8 13.6 11 15.8 15.4 11.4' },
17
+ ],
18
+ },
19
+ bindings: [],
20
+ a11y: { role: 'img', label: 'Audit' },
21
+ meta: { tags: ['clipboard', 'clipboard-check', 'audit', 'checklist', 'review'], since: '0.0.7' },
22
+ };
23
+ export default ClipboardCheck;
@@ -0,0 +1,11 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.command` โ€” Command. A degenerate element (pure geometry, no children).
4
+ *
5
+ * The command-key mark redrawn in the shape language: a centre square with a rounded-square loop at
6
+ * each corner, each loop sharing one corner with the centre. The usual mark draws those loops as arcs
7
+ * of a circle; small rounded squares keep the silhouette and drop the circles DESIGN_SYSTEM ยง3
8
+ * forbids. It labels the command palette โ€” `xeno.menu` is navigation, not "run a command".
9
+ */
10
+ export declare const Command: ElementDeclaration;
11
+ export default Command;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * `xeno.command` โ€” Command. A degenerate element (pure geometry, no children).
3
+ *
4
+ * The command-key mark redrawn in the shape language: a centre square with a rounded-square loop at
5
+ * each corner, each loop sharing one corner with the centre. The usual mark draws those loops as arcs
6
+ * of a circle; small rounded squares keep the silhouette and drop the circles DESIGN_SYSTEM ยง3
7
+ * forbids. It labels the command palette โ€” `xeno.menu` is navigation, not "run a command".
8
+ */
9
+ export const Command = {
10
+ id: 'xeno.command',
11
+ kind: 'icon',
12
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
13
+ geometry: {
14
+ base: [
15
+ { kind: 'path', d: 'M9 9H15V15H9Z' },
16
+ { kind: 'path', d: 'M9 9H5.8A1.8 1.8 0 0 1 4 7.2V5.8A1.8 1.8 0 0 1 5.8 4H7.2A1.8 1.8 0 0 1 9 5.8Z' },
17
+ { kind: 'path', d: 'M15 9V5.8A1.8 1.8 0 0 1 16.8 4H18.2A1.8 1.8 0 0 1 20 5.8V7.2A1.8 1.8 0 0 1 18.2 9Z' },
18
+ { kind: 'path', d: 'M15 15H18.2A1.8 1.8 0 0 1 20 16.8V18.2A1.8 1.8 0 0 1 18.2 20H16.8A1.8 1.8 0 0 1 15 18.2Z' },
19
+ { kind: 'path', d: 'M9 15V18.2A1.8 1.8 0 0 1 7.2 20H5.8A1.8 1.8 0 0 1 4 18.2V16.8A1.8 1.8 0 0 1 5.8 15Z' },
20
+ ],
21
+ },
22
+ bindings: [],
23
+ a11y: { role: 'img', label: 'Command' },
24
+ meta: { tags: ['command', 'cmd', 'command-palette', 'shortcut'], since: '0.0.7' },
25
+ };
26
+ export default Command;
@@ -0,0 +1,15 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.ellipse` โ€” Ellipse tool. A degenerate element (pure geometry, no children).
4
+ *
5
+ * ๐Ÿ”ด NOT a circle, and that is the design decision this glyph exists to record. `DESIGN_SYSTEM.md ยง3`
6
+ * forbids circles in the UI; the tool, however, DRAWS ellipses, and its button has to say so. The
7
+ * resolution is a SUPERELLIPSE (a squircle): a rounded square whose corners are continuous-curvature
8
+ * cubics, drawn rounder than any `rx` rectangle in the set so it reads as "the round shape" next to
9
+ * `xeno.square` โ€” while still being a rectangle with corner radius, which is the only shape family the
10
+ * system permits. The four cubics are symmetric about both axes; no arc command is used. The handle
11
+ * length (5.5 of 8, from each edge midpoint) was set by eye at 16px: at 6.4 it read as a large-radius
12
+ * rounded square โ€” too close to `xeno.square` for a tool palette that shows both.
13
+ */
14
+ export declare const Ellipse: ElementDeclaration;
15
+ export default Ellipse;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * `xeno.ellipse` โ€” Ellipse tool. A degenerate element (pure geometry, no children).
3
+ *
4
+ * ๐Ÿ”ด NOT a circle, and that is the design decision this glyph exists to record. `DESIGN_SYSTEM.md ยง3`
5
+ * forbids circles in the UI; the tool, however, DRAWS ellipses, and its button has to say so. The
6
+ * resolution is a SUPERELLIPSE (a squircle): a rounded square whose corners are continuous-curvature
7
+ * cubics, drawn rounder than any `rx` rectangle in the set so it reads as "the round shape" next to
8
+ * `xeno.square` โ€” while still being a rectangle with corner radius, which is the only shape family the
9
+ * system permits. The four cubics are symmetric about both axes; no arc command is used. The handle
10
+ * length (5.5 of 8, from each edge midpoint) was set by eye at 16px: at 6.4 it read as a large-radius
11
+ * rounded square โ€” too close to `xeno.square` for a tool palette that shows both.
12
+ */
13
+ export const Ellipse = {
14
+ id: 'xeno.ellipse',
15
+ kind: 'icon',
16
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
17
+ geometry: {
18
+ base: [
19
+ { kind: 'path', d: 'M12 4C17.5 4 20 6.5 20 12C20 17.5 17.5 20 12 20C6.5 20 4 17.5 4 12C4 6.5 6.5 4 12 4Z' },
20
+ ],
21
+ },
22
+ bindings: [],
23
+ a11y: { role: 'img', label: 'Ellipse' },
24
+ meta: { tags: ['ellipse', 'oval', 'circle', 'shape', 'tool', 'superellipse'], since: '0.0.7' },
25
+ };
26
+ export default Ellipse;
@@ -0,0 +1,14 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.frame` โ€” Frame. A degenerate element (pure geometry, no children).
4
+ *
5
+ * Two pairs of crop lines that run PAST each other at the corners โ€” the frame / artboard mark, the
6
+ * convention a Figma user already knows from that tool. The overrun is the meaning: it says "a region
7
+ * is being bounded", which a plain square does not, so `xeno.square` (the rectangle tool) cannot stand
8
+ * in for it. Coordinates are our own grid (3โ€“21, rules at 7 and 17).
9
+ *
10
+ * โš ๏ธ Tried and rejected during review: four separate L/cross crop marks. At 16px they read as four
11
+ * PLUS signs โ€” "add", four times โ€” which is worse than a convention every designer recognises.
12
+ */
13
+ export declare const Frame: ElementDeclaration;
14
+ export default Frame;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * `xeno.frame` โ€” Frame. A degenerate element (pure geometry, no children).
3
+ *
4
+ * Two pairs of crop lines that run PAST each other at the corners โ€” the frame / artboard mark, the
5
+ * convention a Figma user already knows from that tool. The overrun is the meaning: it says "a region
6
+ * is being bounded", which a plain square does not, so `xeno.square` (the rectangle tool) cannot stand
7
+ * in for it. Coordinates are our own grid (3โ€“21, rules at 7 and 17).
8
+ *
9
+ * โš ๏ธ Tried and rejected during review: four separate L/cross crop marks. At 16px they read as four
10
+ * PLUS signs โ€” "add", four times โ€” which is worse than a convention every designer recognises.
11
+ */
12
+ export const Frame = {
13
+ id: 'xeno.frame',
14
+ kind: 'icon',
15
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
16
+ geometry: {
17
+ base: [
18
+ { kind: 'path', d: 'M3 7H21' },
19
+ { kind: 'path', d: 'M3 17H21' },
20
+ { kind: 'path', d: 'M7 3V21' },
21
+ { kind: 'path', d: 'M17 3V21' },
22
+ ],
23
+ },
24
+ bindings: [],
25
+ a11y: { role: 'img', label: 'Frame' },
26
+ meta: { tags: ['frame', 'artboard', 'board', 'crop', 'tool'], since: '0.0.7' },
27
+ };
28
+ export default Frame;
@@ -0,0 +1,11 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.group` โ€” Group. A degenerate element (pure geometry, no children).
4
+ *
5
+ * Two overlapping objects held by a SELECTION BOUNDARY drawn as four corner brackets. The brackets
6
+ * are the grouping: they are what `xeno.ungroup` removes, and the pair is distinguishable at 16px
7
+ * precisely because one has them and the other does not. Distinct from `xeno.blocks` (three parts in
8
+ * a library) and `xeno.layers` (a stack), which is why neither of those stands in for it.
9
+ */
10
+ export declare const Group: ElementDeclaration;
11
+ export default Group;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `xeno.group` โ€” Group. A degenerate element (pure geometry, no children).
3
+ *
4
+ * Two overlapping objects held by a SELECTION BOUNDARY drawn as four corner brackets. The brackets
5
+ * are the grouping: they are what `xeno.ungroup` removes, and the pair is distinguishable at 16px
6
+ * precisely because one has them and the other does not. Distinct from `xeno.blocks` (three parts in
7
+ * a library) and `xeno.layers` (a stack), which is why neither of those stands in for it.
8
+ */
9
+ export const Group = {
10
+ id: 'xeno.group',
11
+ kind: 'icon',
12
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
13
+ geometry: {
14
+ base: [
15
+ { kind: 'path', d: 'M3 8V4.2A1.2 1.2 0 0 1 4.2 3H8' },
16
+ { kind: 'path', d: 'M16 3h3.8A1.2 1.2 0 0 1 21 4.2V8' },
17
+ { kind: 'path', d: 'M21 16v3.8a1.2 1.2 0 0 1-1.2 1.2H16' },
18
+ { kind: 'path', d: 'M8 21H4.2A1.2 1.2 0 0 1 3 19.8V16' },
19
+ { kind: 'rect', x: 7, y: 7, w: 7, h: 6, rx: 1 },
20
+ { kind: 'rect', x: 10, y: 11, w: 7, h: 6, rx: 1 },
21
+ ],
22
+ },
23
+ bindings: [],
24
+ a11y: { role: 'img', label: 'Group' },
25
+ meta: { tags: ['group', 'combine', 'selection', 'arrange'], since: '0.0.7' },
26
+ };
27
+ export default Group;
@@ -33,6 +33,10 @@ export const NextDismiss = {
33
33
  weight: 'regular',
34
34
  strokeFamily: 'xeno-regular',
35
35
  axes: ['selection'],
36
+ // A two-state morph: arrow, then cross. `mixed` has no meaning here โ€” there is no half-advanced
37
+ // card โ€” so it is NARROWED AWAY rather than drawn. Leaving it enumerated rendered `base` under the
38
+ // name `mixed`, a state a product could drive that showed the arrow while claiming otherwise.
39
+ values: { selection: ['off', 'on'] },
36
40
  signals: [],
37
41
  },
38
42
  geometry: {
@@ -0,0 +1,12 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.pen` โ€” Pen tool. A degenerate element (pure geometry, no children).
4
+ *
5
+ * The vector pen as the tool actually behaves: a Bรฉzier SEGMENT between two square anchors, with one
6
+ * anchor's HANDLE pulled out to a square control point. The handle is the meaning โ€” it is what makes
7
+ * this the pen tool rather than `xeno.spline` (a finished curve) or `xeno.edit` (a pencil). Anchors
8
+ * and control point are squares because DESIGN_SYSTEM ยง3 forbids circles, which is also how Canvas
9
+ * draws them on the canvas.
10
+ */
11
+ export declare const Pen: ElementDeclaration;
12
+ export default Pen;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `xeno.pen` โ€” Pen tool. A degenerate element (pure geometry, no children).
3
+ *
4
+ * The vector pen as the tool actually behaves: a Bรฉzier SEGMENT between two square anchors, with one
5
+ * anchor's HANDLE pulled out to a square control point. The handle is the meaning โ€” it is what makes
6
+ * this the pen tool rather than `xeno.spline` (a finished curve) or `xeno.edit` (a pencil). Anchors
7
+ * and control point are squares because DESIGN_SYSTEM ยง3 forbids circles, which is also how Canvas
8
+ * draws them on the canvas.
9
+ */
10
+ export const Pen = {
11
+ id: 'xeno.pen',
12
+ kind: 'icon',
13
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
14
+ geometry: {
15
+ base: [
16
+ { kind: 'path', d: 'M6 18C6 11 11 6 18 6' },
17
+ { kind: 'path', d: 'M6 18 13 18' },
18
+ { kind: 'rect', x: 4, y: 16, w: 4, h: 4, rx: 0.8, fill: 'foreground' },
19
+ { kind: 'rect', x: 16, y: 4, w: 4, h: 4, rx: 0.8 },
20
+ { kind: 'rect', x: 13, y: 16.5, w: 3, h: 3, rx: 0.6 },
21
+ ],
22
+ },
23
+ bindings: [],
24
+ a11y: { role: 'img', label: 'Pen' },
25
+ meta: { tags: ['pen', 'pen-tool', 'bezier', 'vector', 'path', 'tool'], since: '0.0.7' },
26
+ };
27
+ export default Pen;
@@ -0,0 +1,10 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.pointer` โ€” Move / select tool. A degenerate element (pure geometry, no children).
4
+ *
5
+ * An arrow cursor: tip at the top-left, a straight left edge, a notch where the tail leaves. It is
6
+ * the cursor, not a direction, which is why `xeno.navigation` (a symmetric chevron-arrow meaning
7
+ * "go/route") cannot stand in for it.
8
+ */
9
+ export declare const Pointer: ElementDeclaration;
10
+ export default Pointer;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * `xeno.pointer` โ€” Move / select tool. A degenerate element (pure geometry, no children).
3
+ *
4
+ * An arrow cursor: tip at the top-left, a straight left edge, a notch where the tail leaves. It is
5
+ * the cursor, not a direction, which is why `xeno.navigation` (a symmetric chevron-arrow meaning
6
+ * "go/route") cannot stand in for it.
7
+ */
8
+ export const Pointer = {
9
+ id: 'xeno.pointer',
10
+ kind: 'icon',
11
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
12
+ geometry: {
13
+ base: [
14
+ { kind: 'path', d: 'M5 4 5 19 9.2 15 12.2 21 14.6 19.9 11.7 14 17.8 14Z' },
15
+ ],
16
+ },
17
+ bindings: [],
18
+ a11y: { role: 'img', label: 'Move' },
19
+ meta: { tags: ['pointer', 'cursor', 'select', 'move', 'mouse-pointer', 'tool'], since: '0.0.7' },
20
+ };
21
+ export default Pointer;
@@ -0,0 +1,10 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.polygon` โ€” Polygon tool. A degenerate element (pure geometry, no children).
4
+ *
5
+ * A regular hexagon, pointy-top, vertices on a radius of 8 about the centre. Distinct from
6
+ * `xeno.shapes` (a triangle and a square โ€” "shapes, plural") because the polygon tool draws ONE
7
+ * n-sided figure.
8
+ */
9
+ export declare const Polygon: ElementDeclaration;
10
+ export default Polygon;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * `xeno.polygon` โ€” Polygon tool. A degenerate element (pure geometry, no children).
3
+ *
4
+ * A regular hexagon, pointy-top, vertices on a radius of 8 about the centre. Distinct from
5
+ * `xeno.shapes` (a triangle and a square โ€” "shapes, plural") because the polygon tool draws ONE
6
+ * n-sided figure.
7
+ */
8
+ export const Polygon = {
9
+ id: 'xeno.polygon',
10
+ kind: 'icon',
11
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
12
+ geometry: {
13
+ base: [
14
+ { kind: 'path', d: 'M12 4 18.93 8 18.93 16 12 20 5.07 16 5.07 8Z' },
15
+ ],
16
+ },
17
+ bindings: [],
18
+ a11y: { role: 'img', label: 'Polygon' },
19
+ meta: { tags: ['polygon', 'hexagon', 'shape', 'tool'], since: '0.0.7' },
20
+ };
21
+ export default Polygon;
@@ -0,0 +1,10 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.send-to-back` โ€” Send to back. A degenerate element (pure geometry, no children).
4
+ *
5
+ * The `xeno.bring-to-front` pair with the stacking reversed: the SOLID square is now BEHIND, visible
6
+ * only where the outlined front square does not cover it. The front square is drawn whole and the
7
+ * solid one is clipped to the L that shows around it, so the outline reads as being on top.
8
+ */
9
+ export declare const SendToBack: ElementDeclaration;
10
+ export default SendToBack;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * `xeno.send-to-back` โ€” Send to back. A degenerate element (pure geometry, no children).
3
+ *
4
+ * The `xeno.bring-to-front` pair with the stacking reversed: the SOLID square is now BEHIND, visible
5
+ * only where the outlined front square does not cover it. The front square is drawn whole and the
6
+ * solid one is clipped to the L that shows around it, so the outline reads as being on top.
7
+ */
8
+ export const SendToBack = {
9
+ id: 'xeno.send-to-back',
10
+ kind: 'icon',
11
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
12
+ geometry: {
13
+ base: [
14
+ // The square BEHIND (footprint 4..14): solid, cut back to the L that shows around the front one
15
+ // with the same 2-unit break `xeno.bring-to-front` uses โ€” same two footprints, paint swapped.
16
+ { kind: 'path', d: 'M5.4 4H12.6A1.4 1.4 0 0 1 14 5.4V8H9.4A1.4 1.4 0 0 0 8 9.4V14H5.4A1.4 1.4 0 0 1 4 12.6V5.4A1.4 1.4 0 0 1 5.4 4Z', fill: 'foreground' },
17
+ // The square IN FRONT (footprint 10..20): outline, drawn whole.
18
+ { kind: 'rect', x: 10, y: 10, w: 10, h: 10, rx: 1.4 },
19
+ ],
20
+ },
21
+ bindings: [],
22
+ a11y: { role: 'img', label: 'Send to back' },
23
+ meta: { tags: ['send-to-back', 'z-order', 'lower', 'arrange', 'stack'], since: '0.0.7' },
24
+ };
25
+ export default SendToBack;
@@ -20,6 +20,11 @@ export const Star = {
20
20
  'selection:on': [
21
21
  { kind: 'path', d: 'M12 3.6l2.6 5.4 5.9.8-4.3 4.1 1 5.9-5.2-2.8-5.2 2.8 1-5.9L3.5 9.8l5.9-.8z', fill: 'foreground' },
22
22
  ],
23
+ // MIXED โ€” the outline plus the system indeterminate bar (see `bookmark`), sat in the star's body.
24
+ 'selection:mixed': [
25
+ { kind: 'path', d: 'M12 3.6l2.6 5.4 5.9.8-4.3 4.1 1 5.9-5.2-2.8-5.2 2.8 1-5.9L3.5 9.8l5.9-.8z' },
26
+ { kind: 'rect', x: 9.5, y: 11.6, w: 5, h: 1.6, rx: 0.4, fill: 'foreground' },
27
+ ],
23
28
  },
24
29
  bindings: [],
25
30
  a11y: { role: 'img', label: 'Star' },
@@ -0,0 +1,11 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.template` โ€” Template. A degenerate element (pure geometry, no children).
4
+ *
5
+ * A page ARRANGEMENT inside one page frame: a header band across the top, then a wide content block
6
+ * beside a narrow sidebar. It is a layout, not a collection โ€” `xeno.library` (books on a shelf) and
7
+ * `xeno.grid` (four equal cells) both mean something else, which is why neither stands in for "start
8
+ * from a template". The outer frame is what makes it read as ONE page rather than three loose blocks.
9
+ */
10
+ export declare const Template: ElementDeclaration;
11
+ export default Template;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * `xeno.template` โ€” Template. A degenerate element (pure geometry, no children).
3
+ *
4
+ * A page ARRANGEMENT inside one page frame: a header band across the top, then a wide content block
5
+ * beside a narrow sidebar. It is a layout, not a collection โ€” `xeno.library` (books on a shelf) and
6
+ * `xeno.grid` (four equal cells) both mean something else, which is why neither stands in for "start
7
+ * from a template". The outer frame is what makes it read as ONE page rather than three loose blocks.
8
+ */
9
+ export const Template = {
10
+ id: 'xeno.template',
11
+ kind: 'icon',
12
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
13
+ geometry: {
14
+ base: [
15
+ { kind: 'rect', x: 3.5, y: 3.5, w: 17, h: 17, rx: 2 },
16
+ { kind: 'rect', x: 6.5, y: 6.5, w: 11, h: 3, rx: 0.8, fill: 'foreground' },
17
+ { kind: 'rect', x: 6.5, y: 11.5, w: 6.5, h: 6, rx: 0.8 },
18
+ { kind: 'rect', x: 15, y: 11.5, w: 2.5, h: 6, rx: 0.8 },
19
+ ],
20
+ },
21
+ bindings: [],
22
+ a11y: { role: 'img', label: 'Template' },
23
+ meta: { tags: ['template', 'layout', 'layout-template', 'arrangement', 'starter'], since: '0.0.7' },
24
+ };
25
+ export default Template;
@@ -0,0 +1,9 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.ungroup` โ€” Ungroup. A degenerate element (pure geometry, no children).
4
+ *
5
+ * The two objects of `xeno.group` with the boundary removed and pulled APART so they no longer
6
+ * overlap โ€” the separation, not a missing stroke, is what reads as "ungrouped" at 16px.
7
+ */
8
+ export declare const Ungroup: ElementDeclaration;
9
+ export default Ungroup;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * `xeno.ungroup` โ€” Ungroup. A degenerate element (pure geometry, no children).
3
+ *
4
+ * The two objects of `xeno.group` with the boundary removed and pulled APART so they no longer
5
+ * overlap โ€” the separation, not a missing stroke, is what reads as "ungrouped" at 16px.
6
+ */
7
+ export const Ungroup = {
8
+ id: 'xeno.ungroup',
9
+ kind: 'icon',
10
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
11
+ geometry: {
12
+ base: [
13
+ { kind: 'rect', x: 4, y: 4, w: 8, h: 6, rx: 1 },
14
+ { kind: 'rect', x: 12, y: 14, w: 8, h: 6, rx: 1 },
15
+ ],
16
+ },
17
+ bindings: [],
18
+ a11y: { role: 'img', label: 'Ungroup' },
19
+ meta: { tags: ['ungroup', 'separate', 'split', 'arrange'], since: '0.0.7' },
20
+ };
21
+ export default Ungroup;
@@ -0,0 +1,10 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.zoom-in` โ€” Zoom lens tool. A degenerate element (pure geometry, no children).
4
+ *
5
+ * `xeno.search`'s square lens with a plus inside it. The plus is the whole distinction: search FINDS,
6
+ * the zoom lens MAGNIFIES, and a tool palette that shows both needs them apart. The lens frame and
7
+ * handle reuse search's proportions so the two read as one family.
8
+ */
9
+ export declare const ZoomIn: ElementDeclaration;
10
+ export default ZoomIn;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * `xeno.zoom-in` โ€” Zoom lens tool. A degenerate element (pure geometry, no children).
3
+ *
4
+ * `xeno.search`'s square lens with a plus inside it. The plus is the whole distinction: search FINDS,
5
+ * the zoom lens MAGNIFIES, and a tool palette that shows both needs them apart. The lens frame and
6
+ * handle reuse search's proportions so the two read as one family.
7
+ */
8
+ export const ZoomIn = {
9
+ id: 'xeno.zoom-in',
10
+ kind: 'icon',
11
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
12
+ geometry: {
13
+ base: [
14
+ { kind: 'rect', x: 3, y: 3, w: 13, h: 13, rx: 3.2 },
15
+ { kind: 'path', d: 'M15.2 15.2 20.8 20.8' },
16
+ { kind: 'path', d: 'M9.5 6.8V12.2M6.8 9.5H12.2' },
17
+ ],
18
+ },
19
+ bindings: [],
20
+ a11y: { role: 'img', label: 'Zoom in' },
21
+ meta: { tags: ['zoom', 'zoom-in', 'magnify', 'lens', 'tool'], since: '0.0.7' },
22
+ };
23
+ export default ZoomIn;
package/dist/schema.d.ts CHANGED
@@ -181,6 +181,21 @@ export interface ElementContract {
181
181
  readonly strokeFamily: string;
182
182
  /** Which axes this element honours. A decorative glyph declares none. */
183
183
  readonly axes: readonly AxisName[];
184
+ /**
185
+ * OPTIONAL narrowing: which VALUES of a declared axis this element honours. Omitted = every value.
186
+ *
187
+ * An axis is declared whole, but not every element has a meaning for every value on it. `mixed`
188
+ * is real for a bookmark (a set of items some of which are saved) and has no meaning at all for
189
+ * `next-dismiss`, which is a two-state morph. Before this field existed the only honest options
190
+ * were to invent a glyph for a state that means nothing, or to leave it rendering `base` โ€” and the
191
+ * second is a state a product can drive that shows something false. The workshop gate now fails
192
+ * on exactly that, so an element must either DRAW a value or NOT ENUMERATE it.
193
+ *
194
+ * Each listed axis must also appear in `axes`, and each listed value must belong to that axis.
195
+ */
196
+ readonly values?: {
197
+ readonly [K in AxisName]?: readonly ElementState[K][];
198
+ };
184
199
  /** Which continuous inputs it accepts. */
185
200
  readonly signals: readonly SignalName[];
186
201
  }
package/dist/states.js CHANGED
@@ -69,7 +69,9 @@ const SIGNAL_SAMPLE = {
69
69
  * request โ€” would split in two.
70
70
  */
71
71
  const AXIS_ORDER = ['availability', 'selection', 'interaction'];
72
- const cross = (axes) => AXIS_ORDER.filter((a) => axes.includes(a)).reduce((acc, axis) => acc.flatMap((base) => AXIS_VALUES[axis].map((v) => ({ ...base, [axis]: v }))), [{}]);
72
+ /** The values of `axis` this contract honours: its `values` narrowing if present, else every value. */
73
+ const valuesFor = (contract, axis) => contract.values?.[axis] ?? AXIS_VALUES[axis];
74
+ const cross = (contract) => AXIS_ORDER.filter((a) => contract.axes.includes(a)).reduce((acc, axis) => acc.flatMap((base) => valuesFor(contract, axis).map((v) => ({ ...base, [axis]: v }))), [{}]);
73
75
  const keyFor = (state) => {
74
76
  const parts = AXIS_ORDER.filter((a) => state[a] !== undefined).map((a) => `${a}-${state[a]}`);
75
77
  return parts.length ? parts.join('_') : 'default';
@@ -79,7 +81,7 @@ const keyFor = (state) => {
79
81
  * signal it declares. Never empty โ€” an element with neither yields a single `default` entry.
80
82
  */
81
83
  export function statesOf(decl) {
82
- const discrete = cross(decl.contract.axes).map((elementState) => ({
84
+ const discrete = cross(decl.contract).map((elementState) => ({
83
85
  id: decl.id,
84
86
  state: keyFor(elementState),
85
87
  elementState,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenosystem/elements",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "license": "UNLICENSED",
5
5
  "description": "The XENO element contract โ€” declarations, schema, state model. Framework-free, platform-free.",
6
6
  "author": "XENO Corporation <emilian@bnkrsys.com>",
@@ -35,7 +35,7 @@
35
35
  "LICENSE"
36
36
  ],
37
37
  "scripts": {
38
- "build": "tsc -p tsconfig.json",
38
+ "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json",
39
39
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit",
40
40
  "test": "vitest run",
41
41
  "import-glyphs": "node --no-warnings scripts/import-glyphs.mjs",