mythik 0.2.0 → 0.2.1
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.
- package/README.md +68 -44
- package/dist/actions/dispatcher.d.ts +2 -0
- package/dist/actions/dispatcher.d.ts.map +1 -1
- package/dist/actions/dispatcher.js +11 -2
- package/dist/actions/dispatcher.js.map +1 -1
- package/dist/contract/extractor.js +3 -0
- package/dist/contract/extractor.js.map +1 -1
- package/dist/data/data-sources.d.ts +4 -0
- package/dist/data/data-sources.d.ts.map +1 -1
- package/dist/data/data-sources.js +3 -1
- package/dist/data/data-sources.js.map +1 -1
- package/dist/editor-session/engine.d.ts +1 -0
- package/dist/editor-session/engine.d.ts.map +1 -1
- package/dist/editor-session/engine.js +5 -4
- package/dist/editor-session/engine.js.map +1 -1
- package/dist/fetch/framework-fetch.d.ts +1 -0
- package/dist/fetch/framework-fetch.d.ts.map +1 -1
- package/dist/fetch/framework-fetch.js +34 -4
- package/dist/fetch/framework-fetch.js.map +1 -1
- package/dist/fetch/interceptors/auth.d.ts +2 -0
- package/dist/fetch/interceptors/auth.d.ts.map +1 -1
- package/dist/fetch/interceptors/auth.js +31 -2
- package/dist/fetch/interceptors/auth.js.map +1 -1
- package/dist/fetch/types.d.ts +4 -0
- package/dist/fetch/types.d.ts.map +1 -1
- package/dist/renderer/engine.d.ts.map +1 -1
- package/dist/renderer/engine.js +29 -4
- package/dist/renderer/engine.js.map +1 -1
- package/dist/renderer/prop-schemas.d.ts +5 -0
- package/dist/renderer/prop-schemas.d.ts.map +1 -1
- package/dist/renderer/prop-schemas.js +11 -2
- package/dist/renderer/prop-schemas.js.map +1 -1
- package/dist/runtime/mount-spec-runtime.d.ts +2 -0
- package/dist/runtime/mount-spec-runtime.d.ts.map +1 -1
- package/dist/runtime/mount-spec-runtime.js +4 -1
- package/dist/runtime/mount-spec-runtime.js.map +1 -1
- package/dist/security/spec-validator.d.ts.map +1 -1
- package/dist/security/spec-validator.js +61 -0
- package/dist/security/spec-validator.js.map +1 -1
- package/dist/spec-stores/file.js +1 -1
- package/dist/spec-stores/file.js.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/consumer/ai-context-patterns.md +42 -7
- package/docs/consumer/ai-context-primitives.md +25 -2
- package/docs/consumer/ai-context-runtime-semantics.md +36 -26
- package/docs/consumer/ai-context.md +57 -38
- package/docs/consumer/reference-doc.md +97 -59
- package/docs/wiki/compiled/concept-component-variants.md +39 -10
- package/docs/wiki/compiled/concept-templates-vs-variants.md +77 -13
- package/docs/wiki/compiled/pattern-reusable-components.md +42 -12
- package/package.json +1 -1
|
@@ -12,12 +12,13 @@ style blocks.**
|
|
|
12
12
|
|
|
13
13
|
## Decision
|
|
14
14
|
|
|
15
|
-
| Need | Pick |
|
|
16
|
-
|---|---|
|
|
17
|
-
| Same primitive type, different style set | `tokens.components.{type}.{variant}` |
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
15
|
+
| Need | Pick |
|
|
16
|
+
|---|---|
|
|
17
|
+
| Same primitive type, different style set | `tokens.components.{type}.{variant}` |
|
|
18
|
+
| Primitive style plus repeated primitive props such as table `headerStyle` / `rowStyle` | `appSpec.templates` |
|
|
19
|
+
| Composite (custom type wrapping primitive + children slot) | `appSpec.templates` |
|
|
20
|
+
| Style varies by state (hover/active/focus) | Variants (built-in state slots) |
|
|
21
|
+
| Parametrized via props + children | Templates (with `$prop` + `$children`) |
|
|
21
22
|
|
|
22
23
|
See [[@concept-templates-vs-variants]] for the full decision walk-through.
|
|
23
24
|
|
|
@@ -35,7 +36,22 @@ If the same rich style object appears in 2+ specs (or 2+ places in same
|
|
|
35
36
|
spec), extract to a template or variant. Duplication inflates DB storage,
|
|
36
37
|
breaks DRY, makes updates O(N).
|
|
37
38
|
|
|
38
|
-
See [[@antipattern-style-block-duplication]].
|
|
39
|
+
See [[@antipattern-style-block-duplication]].
|
|
40
|
+
|
|
41
|
+
## Boundary: style reuse vs prop-bearing reuse
|
|
42
|
+
|
|
43
|
+
Variants cover primitive visual slots only: `style`, `hover`, `active`,
|
|
44
|
+
`focus`, `transition`, and `animations`. Do not use variants for table
|
|
45
|
+
`headerStyle`, table `rowStyle`, `columns`, `onRowClick`, action bindings,
|
|
46
|
+
or composed children.
|
|
47
|
+
|
|
48
|
+
Use both mechanisms together when needed:
|
|
49
|
+
|
|
50
|
+
- `tokens.components.box.tableCard` for a repeated table panel shell.
|
|
51
|
+
- `appSpec.templates.ops-table` for the table itself, including shared
|
|
52
|
+
`headerStyle` / `rowStyle` and `$prop` pass-through.
|
|
53
|
+
- static `touchable` / `text` variants for filter chip shell and label
|
|
54
|
+
style, with active `$state` / `$item` styling kept on the actual elements.
|
|
39
55
|
|
|
40
56
|
## Right approach — extract once
|
|
41
57
|
|
|
@@ -43,11 +59,25 @@ See [[@antipattern-style-block-duplication]].
|
|
|
43
59
|
// appSpec.templates once
|
|
44
60
|
{ "templates": { "button-pulse-cta": { ...full definition... } } }
|
|
45
61
|
|
|
46
|
-
// both screens
|
|
47
|
-
{ "type": "button-pulse-cta", "props": { "label": "..." } }
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
|
|
62
|
+
// both screens
|
|
63
|
+
{ "type": "button-pulse-cta", "props": { "label": "..." } }
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
For repeated table chrome:
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
// appSpec tokens once
|
|
70
|
+
{ "tokens": { "components": { "box": { "tableCard": { "style": { "...": "..." } } } } } }
|
|
71
|
+
|
|
72
|
+
// appSpec template once
|
|
73
|
+
{ "templates": { "ops-table": { "type": "table", "props": { "headerStyle": { "...": "..." }, "rowStyle": { "...": "..." }, "columns": { "$prop": "columns" }, "data": { "$prop": "data" } } } } }
|
|
74
|
+
|
|
75
|
+
// each screen
|
|
76
|
+
{ "type": "box", "props": { "variant": "tableCard" }, "children": ["orders-table"] }
|
|
77
|
+
{ "type": "ops-table", "props": { "data": { "$state": "/orders" }, "columns": [...] } }
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Animations cascade across BOTH mechanisms
|
|
51
81
|
|
|
52
82
|
`animations` declared at any of these levels merges via the cascade —
|
|
53
83
|
identity → variant → template → element — with per-trigger null semantics.
|
package/package.json
CHANGED