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.
Files changed (52) hide show
  1. package/README.md +68 -44
  2. package/dist/actions/dispatcher.d.ts +2 -0
  3. package/dist/actions/dispatcher.d.ts.map +1 -1
  4. package/dist/actions/dispatcher.js +11 -2
  5. package/dist/actions/dispatcher.js.map +1 -1
  6. package/dist/contract/extractor.js +3 -0
  7. package/dist/contract/extractor.js.map +1 -1
  8. package/dist/data/data-sources.d.ts +4 -0
  9. package/dist/data/data-sources.d.ts.map +1 -1
  10. package/dist/data/data-sources.js +3 -1
  11. package/dist/data/data-sources.js.map +1 -1
  12. package/dist/editor-session/engine.d.ts +1 -0
  13. package/dist/editor-session/engine.d.ts.map +1 -1
  14. package/dist/editor-session/engine.js +5 -4
  15. package/dist/editor-session/engine.js.map +1 -1
  16. package/dist/fetch/framework-fetch.d.ts +1 -0
  17. package/dist/fetch/framework-fetch.d.ts.map +1 -1
  18. package/dist/fetch/framework-fetch.js +34 -4
  19. package/dist/fetch/framework-fetch.js.map +1 -1
  20. package/dist/fetch/interceptors/auth.d.ts +2 -0
  21. package/dist/fetch/interceptors/auth.d.ts.map +1 -1
  22. package/dist/fetch/interceptors/auth.js +31 -2
  23. package/dist/fetch/interceptors/auth.js.map +1 -1
  24. package/dist/fetch/types.d.ts +4 -0
  25. package/dist/fetch/types.d.ts.map +1 -1
  26. package/dist/renderer/engine.d.ts.map +1 -1
  27. package/dist/renderer/engine.js +29 -4
  28. package/dist/renderer/engine.js.map +1 -1
  29. package/dist/renderer/prop-schemas.d.ts +5 -0
  30. package/dist/renderer/prop-schemas.d.ts.map +1 -1
  31. package/dist/renderer/prop-schemas.js +11 -2
  32. package/dist/renderer/prop-schemas.js.map +1 -1
  33. package/dist/runtime/mount-spec-runtime.d.ts +2 -0
  34. package/dist/runtime/mount-spec-runtime.d.ts.map +1 -1
  35. package/dist/runtime/mount-spec-runtime.js +4 -1
  36. package/dist/runtime/mount-spec-runtime.js.map +1 -1
  37. package/dist/security/spec-validator.d.ts.map +1 -1
  38. package/dist/security/spec-validator.js +61 -0
  39. package/dist/security/spec-validator.js.map +1 -1
  40. package/dist/spec-stores/file.js +1 -1
  41. package/dist/spec-stores/file.js.map +1 -1
  42. package/dist/types.d.ts +8 -0
  43. package/dist/types.d.ts.map +1 -1
  44. package/docs/consumer/ai-context-patterns.md +42 -7
  45. package/docs/consumer/ai-context-primitives.md +25 -2
  46. package/docs/consumer/ai-context-runtime-semantics.md +36 -26
  47. package/docs/consumer/ai-context.md +57 -38
  48. package/docs/consumer/reference-doc.md +97 -59
  49. package/docs/wiki/compiled/concept-component-variants.md +39 -10
  50. package/docs/wiki/compiled/concept-templates-vs-variants.md +77 -13
  51. package/docs/wiki/compiled/pattern-reusable-components.md +42 -12
  52. 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
- | Composite (custom type wrapping primitive + children slot) | `appSpec.templates` |
19
- | Style varies by state (hover/active/focus) | Variants (built-in state slots) |
20
- | Parametrized via props + children | Templates (with `$prop` + `$children`) |
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
- ## Animations cascade across BOTH mechanisms
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mythik",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "AI-first JSON-native core runtime for validated applications, APIs, editor sessions, state, actions, validation, and versioning.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",