@almadar/shell-web 0.0.0-stage → 0.1.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 (274) hide show
  1. package/bundling.d.mts +18 -0
  2. package/bundling.mjs +28 -0
  3. package/dist/ArbitraryClassCompiler-Mzabq-UB.d.ts +100 -0
  4. package/dist/AvlGlyph-JKJOAH23.js +6 -0
  5. package/dist/AvlStateMachine-PI4YGREK.js +8 -0
  6. package/dist/AvlTransitionDetail-ZH7V24UG.js +12 -0
  7. package/dist/AvlTransitionExplainer-ZSRT7L6Y.js +13 -0
  8. package/dist/BehaviorValueFrame-6RUJXT4A.js +29 -0
  9. package/dist/BehaviorValueFrame-SSEMEBTG.css +1756 -0
  10. package/dist/BehaviorView-RFEE5J6E.js +10 -0
  11. package/dist/Canvas3DHost-_Y-5uLM_.d.ts +552 -0
  12. package/dist/EventBusProvider-CVwjkV_2.d.ts +284 -0
  13. package/dist/FileTree-BCFnBEuQ.d.ts +254 -0
  14. package/dist/FlowCanvas-3JRMNJLV.css +1756 -0
  15. package/dist/FlowCanvas-STDC4OWK.js +27 -0
  16. package/dist/GameAudioProvider-Cm9BnvmP.d.ts +93 -0
  17. package/dist/KaTeX_AMS-Regular-CYEKBG2K.woff +0 -0
  18. package/dist/KaTeX_AMS-Regular-JKX5W2C4.ttf +0 -0
  19. package/dist/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
  20. package/dist/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
  21. package/dist/KaTeX_Caligraphic-Bold-WZ3QSGD3.woff +0 -0
  22. package/dist/KaTeX_Caligraphic-Bold-ZTS3R3HK.ttf +0 -0
  23. package/dist/KaTeX_Caligraphic-Regular-3LKEU76G.woff +0 -0
  24. package/dist/KaTeX_Caligraphic-Regular-A7XRTZ5Q.ttf +0 -0
  25. package/dist/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
  26. package/dist/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
  27. package/dist/KaTeX_Fraktur-Bold-T4SWXBMT.woff +0 -0
  28. package/dist/KaTeX_Fraktur-Bold-WGHVTYOR.ttf +0 -0
  29. package/dist/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
  30. package/dist/KaTeX_Fraktur-Regular-5U4OPH2X.ttf +0 -0
  31. package/dist/KaTeX_Fraktur-Regular-PQMHCIK6.woff +0 -0
  32. package/dist/KaTeX_Main-Bold-2GA4IZIN.woff +0 -0
  33. package/dist/KaTeX_Main-Bold-W5FBVCZM.ttf +0 -0
  34. package/dist/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
  35. package/dist/KaTeX_Main-BoldItalic-4P4C7HJH.woff +0 -0
  36. package/dist/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
  37. package/dist/KaTeX_Main-BoldItalic-ODMLBJJQ.ttf +0 -0
  38. package/dist/KaTeX_Main-Italic-I43T2HSR.ttf +0 -0
  39. package/dist/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
  40. package/dist/KaTeX_Main-Italic-SASNQFN2.woff +0 -0
  41. package/dist/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
  42. package/dist/KaTeX_Main-Regular-P5I74A2A.woff +0 -0
  43. package/dist/KaTeX_Main-Regular-W74P5G27.ttf +0 -0
  44. package/dist/KaTeX_Math-BoldItalic-6EBV3DK5.woff +0 -0
  45. package/dist/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
  46. package/dist/KaTeX_Math-BoldItalic-VB447A4D.ttf +0 -0
  47. package/dist/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
  48. package/dist/KaTeX_Math-Italic-KKK3USB2.woff +0 -0
  49. package/dist/KaTeX_Math-Italic-SON4MRCA.ttf +0 -0
  50. package/dist/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
  51. package/dist/KaTeX_SansSerif-Bold-STQ6RXC7.ttf +0 -0
  52. package/dist/KaTeX_SansSerif-Bold-X5M5EMOD.woff +0 -0
  53. package/dist/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
  54. package/dist/KaTeX_SansSerif-Italic-PSN4QKYX.woff +0 -0
  55. package/dist/KaTeX_SansSerif-Italic-WTBAZBGY.ttf +0 -0
  56. package/dist/KaTeX_SansSerif-Regular-2TL3USAE.ttf +0 -0
  57. package/dist/KaTeX_SansSerif-Regular-OQCII6EP.woff +0 -0
  58. package/dist/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
  59. package/dist/KaTeX_Script-Regular-72OLXYNA.ttf +0 -0
  60. package/dist/KaTeX_Script-Regular-A5IFOEBS.woff +0 -0
  61. package/dist/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
  62. package/dist/KaTeX_Size1-Regular-4HRHTS65.woff +0 -0
  63. package/dist/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
  64. package/dist/KaTeX_Size1-Regular-7K6AASVL.ttf +0 -0
  65. package/dist/KaTeX_Size2-Regular-222HN3GT.ttf +0 -0
  66. package/dist/KaTeX_Size2-Regular-K5ZHAIS6.woff +0 -0
  67. package/dist/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
  68. package/dist/KaTeX_Size3-Regular-TLFPAHDE.woff +0 -0
  69. package/dist/KaTeX_Size3-Regular-UFCO6WCA.ttf +0 -0
  70. package/dist/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
  71. package/dist/KaTeX_Size4-Regular-7PGNVPQK.ttf +0 -0
  72. package/dist/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
  73. package/dist/KaTeX_Size4-Regular-PKMWZHNC.woff +0 -0
  74. package/dist/KaTeX_Typewriter-Regular-3F5K6SQ6.ttf +0 -0
  75. package/dist/KaTeX_Typewriter-Regular-MJMFSK64.woff +0 -0
  76. package/dist/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
  77. package/dist/KernelEngineContext-BOCQoFwk.d.ts +43 -0
  78. package/dist/LayersPanel-BBQ54IVG.js +7 -0
  79. package/dist/ModuleCard-3TT2X7IW.js +7 -0
  80. package/dist/OrbInspector-K6T6O7GI.js +27 -0
  81. package/dist/OrbInspector-MHLJ6OEE.css +1756 -0
  82. package/dist/Select-mDZIwNqN.d.ts +199 -0
  83. package/dist/ServerBridge-Cm1On51b.d.ts +233 -0
  84. package/dist/ThemeContext-DJmO59xd.d.ts +147 -0
  85. package/dist/TraitValueFrame-2PJGLLVI.js +28 -0
  86. package/dist/TraitValueFrame-4G3KOUBR.css +1756 -0
  87. package/dist/UISlotContext-Dl_ewwCI.d.ts +79 -0
  88. package/dist/UISlotRenderer-JKFSX24W.js +27 -0
  89. package/dist/UISlotRenderer-KVFO6J7R.css +1756 -0
  90. package/dist/UserContext-DqWeZkUZ.d.ts +100 -0
  91. package/dist/auth/browser/index.d.ts +2 -0
  92. package/dist/auth/browser/index.js +1 -0
  93. package/dist/auth/react/index.d.ts +49 -0
  94. package/dist/auth/react/index.js +119 -0
  95. package/dist/avl/index.css +1756 -0
  96. package/dist/avl/index.d.ts +2238 -0
  97. package/dist/avl/index.js +2693 -0
  98. package/dist/avl-3d-context-BIRKWpaL.d.ts +204 -0
  99. package/dist/avl-schema-parser-CtJxJ9KU.d.ts +132 -0
  100. package/dist/avl-zoom-state-CKMVuBFg.d.ts +17 -0
  101. package/dist/chunk-2PY54Z44.js +227 -0
  102. package/dist/chunk-2QOH2HWM.js +95 -0
  103. package/dist/chunk-3BBUBJFF.js +339 -0
  104. package/dist/chunk-42FY4RYA.js +191 -0
  105. package/dist/chunk-5QTYQTPS.js +15 -0
  106. package/dist/chunk-6P3MWXYE.js +440 -0
  107. package/dist/chunk-73SRAB4P.js +1053 -0
  108. package/dist/chunk-A2LR6VQQ.js +349 -0
  109. package/dist/chunk-AILY3XPS.js +562 -0
  110. package/dist/chunk-B4BU77LT.js +432 -0
  111. package/dist/chunk-DFNZUYX4.js +378 -0
  112. package/dist/chunk-DJ433ET5.js +1327 -0
  113. package/dist/chunk-DLZF4PVE.js +24 -0
  114. package/dist/chunk-DYEKAA4L.js +787 -0
  115. package/dist/chunk-DZ42OJQC.js +176 -0
  116. package/dist/chunk-EOWMARUB.js +16 -0
  117. package/dist/chunk-EQAMU2ZC.js +14 -0
  118. package/dist/chunk-FAJDTHWC.js +98 -0
  119. package/dist/chunk-FIW6WN23.js +508 -0
  120. package/dist/chunk-FP3WIKTC.js +303 -0
  121. package/dist/chunk-G7DCAZ22.js +19 -0
  122. package/dist/chunk-GAR5TQ5B.js +199 -0
  123. package/dist/chunk-GKIFONTE.js +131 -0
  124. package/dist/chunk-GYTPOFVC.js +47155 -0
  125. package/dist/chunk-KVQS4GXU.js +328 -0
  126. package/dist/chunk-L2DEKY4J.js +97 -0
  127. package/dist/chunk-L677XGY3.js +701 -0
  128. package/dist/chunk-MBQAMMSE.js +11877 -0
  129. package/dist/chunk-P4LNHAFI.js +1051 -0
  130. package/dist/chunk-P4ZFUQFF.js +93 -0
  131. package/dist/chunk-PC7K4SK7.js +1384 -0
  132. package/dist/chunk-R5O5AUPI.js +573 -0
  133. package/dist/chunk-SGM3FASH.js +672 -0
  134. package/dist/chunk-SJGJJKBY.js +502 -0
  135. package/dist/chunk-TESBIVUA.js +11 -0
  136. package/dist/chunk-TZZBINQY.js +82 -0
  137. package/dist/chunk-U6QRZASX.js +280 -0
  138. package/dist/chunk-VFF5OO47.js +319 -0
  139. package/dist/chunk-YDNJLLG6.js +516 -0
  140. package/dist/chunk-YHMRX6YA.js +455 -0
  141. package/dist/chunk-ZO6MXAS3.js +69 -0
  142. package/dist/components/index.css +1756 -0
  143. package/dist/components/index.d.ts +11093 -0
  144. package/dist/components/index.js +1110 -0
  145. package/dist/context/index.d.ts +9 -0
  146. package/dist/context/index.js +7 -0
  147. package/dist/core.d.ts +2523 -0
  148. package/dist/core.js +2 -0
  149. package/dist/design-classes/index.cjs +429 -0
  150. package/dist/design-classes/index.d.cts +165 -0
  151. package/dist/design-classes/index.d.ts +165 -0
  152. package/dist/design-classes/index.js +397 -0
  153. package/dist/emojiItems-QGSNAABW.js +20 -0
  154. package/dist/fx-CmQjnHmT.d.ts +371 -0
  155. package/dist/hooks/index.d.ts +936 -0
  156. package/dist/hooks/index.js +7 -0
  157. package/dist/index.d.ts +486 -0
  158. package/dist/index.js +38 -0
  159. package/dist/katexPlugin-FA7NX4PE.css +1161 -0
  160. package/dist/katexPlugin-NCDKOOQY.js +2 -0
  161. package/dist/kernel-client-ZH4PSMCN.js +367 -0
  162. package/dist/kernel-wire-B4S8pnP3.d.ts +65 -0
  163. package/dist/lib/index.d.ts +602 -0
  164. package/dist/lib/index.js +1288 -0
  165. package/dist/paintDispatch-ChW5mVuK.d.ts +698 -0
  166. package/dist/parseLessonSegments-GpCeMrb2.d.ts +334 -0
  167. package/dist/perf-CKiBKbkw.d.ts +22 -0
  168. package/dist/perf-Dr28-AgT.d.ts +57 -0
  169. package/dist/prism-AIWGN2X5.js +134 -0
  170. package/dist/providers/index.css +1756 -0
  171. package/dist/providers/index.d.ts +340 -0
  172. package/dist/providers/index.js +30 -0
  173. package/dist/renderer/index.d.ts +467 -0
  174. package/dist/renderer/index.js +3 -0
  175. package/dist/runtime/index.css +1756 -0
  176. package/dist/runtime/index.d.ts +440 -0
  177. package/dist/runtime/index.js +31 -0
  178. package/dist/slot-host-CPzrxLo9.d.ts +48 -0
  179. package/dist/ssr/index.cjs +7631 -0
  180. package/dist/ssr/index.d.cts +487 -0
  181. package/dist/ssr/index.d.ts +487 -0
  182. package/dist/ssr/index.js +7599 -0
  183. package/dist/storage/browser/index.d.ts +1 -0
  184. package/dist/storage/browser/index.js +1 -0
  185. package/dist/test-support.d.ts +35 -0
  186. package/dist/test-support.js +114 -0
  187. package/dist/themeTokens-CRd8AEDF.d.ts +125 -0
  188. package/dist/three/index.css +503 -0
  189. package/dist/three/index.d.ts +1185 -0
  190. package/dist/three/index.js +3896 -0
  191. package/dist/useKeyboardRouter-Dsq553Ur.d.ts +42 -0
  192. package/dist/useUISlots-CiobNFGb.d.ts +211 -0
  193. package/dist/verification-C5pTeMJv.d.ts +66 -0
  194. package/dist/verificationRegistry-CabxhfTv.d.ts +122 -0
  195. package/dist/wrapCallbackForEvent-B9QLbhxX.d.ts +19 -0
  196. package/index.css +199 -0
  197. package/package.json +269 -3
  198. package/src/core/locales/ar.json +1263 -0
  199. package/src/core/locales/en.json +1263 -0
  200. package/src/core/locales/index.ts +54 -0
  201. package/src/core/locales/sl.json +1263 -0
  202. package/src/core/tokens/native-tokens.json +369 -0
  203. package/tailwind-compile.cjs +29 -0
  204. package/tailwind-preset.cjs +991 -0
  205. package/themes/_base.css +451 -0
  206. package/themes/_contract.md +307 -0
  207. package/themes/_fonts-kenney.css +11 -0
  208. package/themes/_fonts.css +12 -0
  209. package/themes/_foundation.css +105 -0
  210. package/themes/_head.css +22 -0
  211. package/themes/_presets.css +67 -0
  212. package/themes/almadar-heritage.css +455 -0
  213. package/themes/almadar-website.css +269 -0
  214. package/themes/almadar.css +269 -0
  215. package/themes/aqua.css +455 -0
  216. package/themes/arabesque.css +459 -0
  217. package/themes/art-deco.css +457 -0
  218. package/themes/art-nouveau.css +459 -0
  219. package/themes/atelier.css +463 -0
  220. package/themes/bauhaus.css +461 -0
  221. package/themes/bloomberg-dense.css +463 -0
  222. package/themes/blueprint.css +457 -0
  223. package/themes/clay.css +449 -0
  224. package/themes/comic.css +453 -0
  225. package/themes/constructivist.css +457 -0
  226. package/themes/corporate.css +449 -0
  227. package/themes/cyberpunk.css +453 -0
  228. package/themes/frutiger-aero.css +458 -0
  229. package/themes/game-adventure.css +201 -0
  230. package/themes/game-rpg.css +203 -0
  231. package/themes/game-sci-fi.css +201 -0
  232. package/themes/game-ui-pack.css +200 -0
  233. package/themes/gazette.css +449 -0
  234. package/themes/glass.css +457 -0
  235. package/themes/gothic.css +453 -0
  236. package/themes/index.css +21 -0
  237. package/themes/ink-wash.css +459 -0
  238. package/themes/kawaii.css +459 -0
  239. package/themes/kflow.css +310 -0
  240. package/themes/kiosk.css +449 -0
  241. package/themes/linear-clean.css +463 -0
  242. package/themes/luxury.css +451 -0
  243. package/themes/mac-classic.css +455 -0
  244. package/themes/material.css +463 -0
  245. package/themes/memphis.css +453 -0
  246. package/themes/mid-century.css +455 -0
  247. package/themes/minimalist.css +449 -0
  248. package/themes/mudcloth.css +459 -0
  249. package/themes/nata.css +310 -0
  250. package/themes/neon.css +453 -0
  251. package/themes/neumorphic.css +451 -0
  252. package/themes/newsprint.css +455 -0
  253. package/themes/notion-editorial.css +463 -0
  254. package/themes/orb.css +465 -0
  255. package/themes/pixel.css +449 -0
  256. package/themes/prism.css +309 -0
  257. package/themes/rawi.css +310 -0
  258. package/themes/retro.css +452 -0
  259. package/themes/risograph.css +463 -0
  260. package/themes/scandi.css +469 -0
  261. package/themes/sketch.css +455 -0
  262. package/themes/solarpunk.css +469 -0
  263. package/themes/steampunk.css +451 -0
  264. package/themes/swiss.css +455 -0
  265. package/themes/terminal.css +466 -0
  266. package/themes/trait-wars.css +487 -0
  267. package/themes/ukiyo-e.css +459 -0
  268. package/themes/vaporwave.css +455 -0
  269. package/themes/victorian.css +453 -0
  270. package/themes/wabi-sabi.css +459 -0
  271. package/themes/win95.css +455 -0
  272. package/themes/wireframe.css +439 -0
  273. package/themes/zine.css +455 -0
  274. package/README.md +0 -3
@@ -0,0 +1,467 @@
1
+ import { PatternConfig, FieldValue, EntityRow, UISlot } from '@almadar/core';
2
+ export { PatternConfig, UISlot } from '@almadar/core';
3
+ import { PatternPropDef } from '@almadar/core/patterns';
4
+ import * as React from 'react';
5
+
6
+ /**
7
+ * Shared Renderer Types
8
+ *
9
+ * Type definitions used by both Builder and compiled shells for
10
+ * the dual execution model. These types define the contract between
11
+ * server and client for effect execution.
12
+ *
13
+ * @packageDocumentation
14
+ */
15
+
16
+ type ClientEffect = ['render-ui', string, PatternConfig | null] | ['navigate', string, Record<string, FieldValue>?] | ['emit', string, FieldValue?];
17
+ /**
18
+ * Resolved pattern with component information from component-mapping.json
19
+ */
20
+ interface MappedPattern {
21
+ /** Component name (e.g., 'DataTable') */
22
+ component: string;
23
+ /** Import path for the component */
24
+ importPath: string;
25
+ /** Pattern category (e.g., 'display', 'form') */
26
+ category: string;
27
+ /** Validated and normalized props */
28
+ validatedProps: Record<string, FieldValue>;
29
+ }
30
+ /**
31
+ * Response from server after processing an event.
32
+ * This is the unified response format for both Builder and compiled shells.
33
+ */
34
+ interface EventResponse {
35
+ /** Whether the event was processed successfully */
36
+ success: boolean;
37
+ /** New state after transition (if transition occurred) */
38
+ newState?: string;
39
+ /** Data fetched by server effects (e.g., { Task: [...] }) */
40
+ data?: Record<string, EntityRow[]>;
41
+ /** Client effects to execute (render-ui, navigate, emit) */
42
+ clientEffects?: ClientEffect[];
43
+ /** Results of individual effect executions (for debugging) */
44
+ effectResults?: Array<{
45
+ effect: string;
46
+ success: boolean;
47
+ data?: FieldValue;
48
+ error?: string;
49
+ }>;
50
+ /** Error message if success is false */
51
+ error?: string;
52
+ }
53
+ /**
54
+ * Configuration for the client effect executor.
55
+ * Provides implementations for each effect type.
56
+ */
57
+ interface ClientEffectExecutorConfig {
58
+ /**
59
+ * Render a pattern to a slot.
60
+ * Called for 'render-ui' effects.
61
+ */
62
+ renderToSlot: (slot: string, pattern: PatternConfig | null) => void;
63
+ /**
64
+ * Navigate to a route.
65
+ * Called for 'navigate' effects.
66
+ */
67
+ navigate: (path: string, params?: Record<string, FieldValue>) => void;
68
+ /**
69
+ * Emit an event to the event bus.
70
+ * Called for 'emit' effects.
71
+ */
72
+ eventBus: {
73
+ emit: (event: string, payload?: FieldValue) => void;
74
+ };
75
+ /**
76
+ * Optional: Data from server response for render-ui.
77
+ * Components can use this to access fetched entity data.
78
+ */
79
+ data?: Record<string, EntityRow[]>;
80
+ /**
81
+ * Optional: Callback when all effects have been executed.
82
+ */
83
+ onComplete?: () => void;
84
+ }
85
+ /**
86
+ * Slot type classification
87
+ */
88
+ type SlotType = 'inline' | 'portal';
89
+ /**
90
+ * Definition of a slot including its rendering behavior
91
+ */
92
+ interface SlotDefinition {
93
+ /** Slot name */
94
+ name: UISlot;
95
+ /** Whether to render inline or via portal */
96
+ type: SlotType;
97
+ /** For portal slots: where to render (default: document.body) */
98
+ portalTarget?: string;
99
+ /** Z-index for portal slots */
100
+ zIndex?: number;
101
+ /**
102
+ * A notification surface (toast): an embedded trait's render here shows in
103
+ * the slot itself, never as its host frame's content. Every other slot's
104
+ * render of an embedded trait IS its frame content.
105
+ */
106
+ notification?: boolean;
107
+ }
108
+ /**
109
+ * Context for resolving entity data.
110
+ * Supports multiple data sources with priority.
111
+ */
112
+ interface DataContext {
113
+ /** Server-provided data (highest priority) */
114
+ fetchedData?: Record<string, EntityRow[]>;
115
+ /** In-memory mock data (for Builder preview) */
116
+ entityStore?: {
117
+ getRecords: (entityName: string) => EntityRow[];
118
+ };
119
+ /** Query singleton for filtering */
120
+ querySingleton?: {
121
+ getFilters: (queryRef: string) => Record<string, FieldValue>;
122
+ };
123
+ }
124
+ /**
125
+ * Result of data resolution
126
+ */
127
+ interface DataResolution {
128
+ /** Resolved data array */
129
+ data: EntityRow[];
130
+ /** Whether data is still loading */
131
+ loading: boolean;
132
+ /** Error if resolution failed */
133
+ error?: Error;
134
+ }
135
+
136
+ /**
137
+ * Pattern Resolver
138
+ *
139
+ * Resolves pattern configurations to component information.
140
+ * Uses the central pattern registry and component mapping from orbital-shared/patterns/.
141
+ *
142
+ * This is the shared logic used by both Builder's PatternRenderer and
143
+ * the compiled shell's UISlotRenderer.
144
+ *
145
+ * @packageDocumentation
146
+ */
147
+
148
+ /**
149
+ * Component mapping entry from component-mapping.json
150
+ */
151
+ interface ComponentMappingEntry {
152
+ component: string;
153
+ importPath: string;
154
+ category: string;
155
+ deprecated?: boolean;
156
+ replacedBy?: string;
157
+ }
158
+ /**
159
+ * Pattern definition from registry.json
160
+ */
161
+ interface PatternDefinition {
162
+ type: string;
163
+ category: string;
164
+ description: string;
165
+ propsSchema?: Record<string, PatternPropDef>;
166
+ }
167
+ /**
168
+ * Initialize the pattern resolver with mappings.
169
+ * Called at app startup with data from JSON files.
170
+ */
171
+ declare function initializePatternResolver(config: {
172
+ componentMapping: Record<string, ComponentMappingEntry>;
173
+ patternRegistry: Record<string, PatternDefinition>;
174
+ }): void;
175
+ /**
176
+ * Set component mapping (alternative to full initialization).
177
+ */
178
+ declare function setComponentMapping(mapping: Record<string, ComponentMappingEntry>): void;
179
+ /**
180
+ * Set pattern registry (alternative to full initialization).
181
+ */
182
+ declare function setPatternRegistry(registry: Record<string, PatternDefinition>): void;
183
+ /**
184
+ * Resolve a pattern configuration to component information.
185
+ *
186
+ * @param config - Pattern configuration from render-ui effect
187
+ * @returns Resolved pattern with component name, import path, and validated props
188
+ * @throws Error if pattern type is unknown
189
+ *
190
+ * @example
191
+ * ```typescript
192
+ * const resolved = resolvePattern({
193
+ * type: 'entity-table',
194
+ * entity: 'Task',
195
+ * columns: ['title', 'status']
196
+ * });
197
+ * // resolved.component === 'DataTable'
198
+ * // resolved.importPath === '@/components/organisms/DataTable'
199
+ * ```
200
+ */
201
+ declare function resolvePattern(config: PatternConfig): MappedPattern;
202
+ /**
203
+ * Check if a pattern type is known.
204
+ */
205
+ declare function isKnownPattern(type: string): boolean;
206
+ /**
207
+ * Get all known pattern types.
208
+ */
209
+ declare function getKnownPatterns(): string[];
210
+ /**
211
+ * Get patterns by category.
212
+ */
213
+ declare function getPatternsByCategory(category: string): string[];
214
+ /**
215
+ * Get the component mapping for a pattern type.
216
+ */
217
+ declare function getPatternMapping(type: string): ComponentMappingEntry | undefined;
218
+ /**
219
+ * Get the pattern definition from the registry.
220
+ */
221
+ declare function getPatternDefinition(type: string): PatternDefinition | undefined;
222
+
223
+ /**
224
+ * Client Effect Executor
225
+ *
226
+ * Executes client effects returned from the server.
227
+ * This is the core of the dual execution model - the server processes
228
+ * events and returns client effects, which this module executes.
229
+ *
230
+ * Used by both Builder preview and compiled shells.
231
+ *
232
+ * @packageDocumentation
233
+ */
234
+
235
+ /**
236
+ * Execute an array of client effects.
237
+ *
238
+ * Effects are executed sequentially in order.
239
+ * Errors in one effect don't prevent subsequent effects from executing.
240
+ *
241
+ * @param effects - Array of client effects to execute
242
+ * @param config - Configuration providing implementations for each effect type
243
+ *
244
+ * @example
245
+ * ```typescript
246
+ * executeClientEffects(
247
+ * [
248
+ * ['render-ui', 'main', { type: 'entity-table', entity: 'Task' }],
249
+ * ['emit', 'TASKS_LOADED']
250
+ * ],
251
+ * {
252
+ * renderToSlot: (slot, pattern) => slotManager.render(slot, pattern),
253
+ * navigate: (path) => router.push(path),
254
+ * eventBus: { emit: (event, payload) => bus.emit(event, payload) }
255
+ * }
256
+ * );
257
+ * ```
258
+ */
259
+ declare function executeClientEffects(effects: ClientEffect[], config: ClientEffectExecutorConfig): void;
260
+ /**
261
+ * Parse a raw effect array into a typed ClientEffect.
262
+ * Handles unknown effect formats gracefully.
263
+ */
264
+ declare function parseClientEffect(raw: FieldValue[]): ClientEffect | null;
265
+ /**
266
+ * Parse an array of raw effects into typed ClientEffects.
267
+ * Filters out invalid effects.
268
+ */
269
+ declare function parseClientEffects(raw: FieldValue[] | undefined): ClientEffect[];
270
+ /**
271
+ * Get all render-ui effects.
272
+ */
273
+ declare function getRenderUIEffects(effects: ClientEffect[]): Array<['render-ui', string, PatternConfig | null]>;
274
+
275
+ /**
276
+ * Options for the useClientEffects hook
277
+ */
278
+ interface UseClientEffectsOptions extends ClientEffectExecutorConfig {
279
+ /**
280
+ * Whether to execute effects. Defaults to true.
281
+ * Set to false to temporarily disable effect execution.
282
+ */
283
+ enabled?: boolean;
284
+ /**
285
+ * Debug mode - logs effect execution details.
286
+ */
287
+ debug?: boolean;
288
+ }
289
+ /**
290
+ * Result of useClientEffects hook
291
+ */
292
+ interface UseClientEffectsResult {
293
+ /**
294
+ * Number of effects executed in the last batch.
295
+ */
296
+ executedCount: number;
297
+ /**
298
+ * Whether effects are currently being executed.
299
+ */
300
+ executing: boolean;
301
+ /**
302
+ * Manually trigger effect execution.
303
+ * Useful for imperative control.
304
+ */
305
+ execute: (effects: ClientEffect[]) => void;
306
+ }
307
+ /**
308
+ * Execute client effects from server response.
309
+ *
310
+ * This hook automatically executes effects when they change,
311
+ * tracking which effects have been executed to prevent duplicates.
312
+ *
313
+ * @param effects - Array of client effects to execute (from server response)
314
+ * @param options - Configuration including effect implementations
315
+ * @returns Hook result with execution state and manual trigger
316
+ *
317
+ * @example
318
+ * ```typescript
319
+ * function useMyTrait() {
320
+ * const [state, setState] = useState({ pendingEffects: [] });
321
+ * const effectConfig = useClientEffectConfig();
322
+ *
323
+ * useClientEffects(state.pendingEffects, {
324
+ * ...effectConfig,
325
+ * onComplete: () => setState(s => ({ ...s, pendingEffects: [] }))
326
+ * });
327
+ *
328
+ * // ...
329
+ * }
330
+ * ```
331
+ */
332
+ declare function useClientEffects(effects: ClientEffect[] | undefined, options: UseClientEffectsOptions): UseClientEffectsResult;
333
+ declare const ClientEffectConfigContext: React.Context<ClientEffectExecutorConfig | null>;
334
+ /**
335
+ * Provider for client effect configuration.
336
+ */
337
+ declare const ClientEffectConfigProvider: React.Provider<ClientEffectExecutorConfig | null>;
338
+ /**
339
+ * Hook to get the client effect configuration from context.
340
+ *
341
+ * @throws Error if used outside of ClientEffectConfigProvider
342
+ *
343
+ * @example
344
+ * ```typescript
345
+ * function MyTraitHook() {
346
+ * const effectConfig = useClientEffectConfig();
347
+ *
348
+ * useClientEffects(pendingEffects, {
349
+ * ...effectConfig,
350
+ * onComplete: () => clearPendingEffects()
351
+ * });
352
+ * }
353
+ * ```
354
+ */
355
+ declare function useClientEffectConfig(): ClientEffectExecutorConfig;
356
+ /**
357
+ * Hook to get client effect configuration, returning null if not available.
358
+ * Use this for optional integration where effects may not be configured.
359
+ */
360
+ declare function useClientEffectConfigOptional(): ClientEffectExecutorConfig | null;
361
+
362
+ /**
363
+ * Data Resolver
364
+ *
365
+ * Resolves entity data for pattern rendering.
366
+ * Supports multiple data sources with priority:
367
+ * 1. Server-provided data (from EventResponse.data)
368
+ * 2. Entity store (Builder in-memory mock data)
369
+ * 3. Empty array (fallback)
370
+ *
371
+ * Used by both Builder's PatternRenderer and compiled shell's UISlotRenderer.
372
+ *
373
+ * @packageDocumentation
374
+ */
375
+
376
+ /**
377
+ * Resolve entity data from available sources.
378
+ *
379
+ * Priority:
380
+ * 1. fetchedData (from server response) - highest priority
381
+ * 2. entityStore (Builder mock data)
382
+ * 3. Empty array (fallback)
383
+ *
384
+ * @param entityName - Name of the entity to resolve data for
385
+ * @param context - Data context with available sources
386
+ * @returns Resolved data with loading state
387
+ *
388
+ * @example
389
+ * ```typescript
390
+ * const { data, loading } = resolveEntityData('Task', {
391
+ * fetchedData: response.data,
392
+ * entityStore: mockStore
393
+ * });
394
+ * ```
395
+ */
396
+ declare function resolveEntityData(entityName: string, context: DataContext): DataResolution;
397
+ /**
398
+ * Resolve entity data with query filtering.
399
+ *
400
+ * Applies query singleton filters if available.
401
+ *
402
+ * @param entityName - Name of the entity
403
+ * @param queryRef - Optional query reference for filtering
404
+ * @param context - Data context
405
+ * @returns Filtered resolved data
406
+ */
407
+ declare function resolveEntityDataWithQuery(entityName: string, queryRef: string | undefined, context: DataContext): DataResolution;
408
+ /**
409
+ * Get a single entity record by ID.
410
+ */
411
+ declare function resolveEntityById(entityName: string, id: string | number, context: DataContext): EntityRow | null;
412
+ /**
413
+ * Check if any entities exist for a given entity name.
414
+ */
415
+ declare function hasEntities(entityName: string, context: DataContext): boolean;
416
+
417
+ /**
418
+ * Slot Definitions
419
+ *
420
+ * Defines the available UI slots and their rendering behavior.
421
+ * Slots are either inline (rendered in the component tree) or
422
+ * portal (rendered to document.body via React Portal).
423
+ *
424
+ * @packageDocumentation
425
+ */
426
+
427
+ /**
428
+ * Definitions for all available UI slots.
429
+ *
430
+ * Inline slots render within the component hierarchy.
431
+ * Portal slots render to document.body, breaking out of overflow containers.
432
+ */
433
+ declare const SLOT_DEFINITIONS: Partial<Record<UISlot, SlotDefinition>> & Record<'main' | 'sidebar' | 'dock' | 'modal' | 'drawer' | 'overlay' | 'center' | 'toast' | 'hud-top' | 'hud-bottom' | 'floating', SlotDefinition>;
434
+ /**
435
+ * Get the slot definition for a slot name.
436
+ */
437
+ declare function getSlotDefinition(slot: UISlot): SlotDefinition | undefined;
438
+ /**
439
+ * Check if a slot is a portal slot.
440
+ */
441
+ declare function isPortalSlot(slot: string): boolean;
442
+ /**
443
+ * Get all inline slots.
444
+ */
445
+ declare function getInlineSlots(): UISlot[];
446
+ /**
447
+ * All valid slot names.
448
+ */
449
+ declare const ALL_SLOTS: UISlot[];
450
+
451
+ /**
452
+ * Pattern Resolver Initialization
453
+ *
454
+ * Loads pattern registry and component mapping from @almadar/core/patterns
455
+ * and initializes the pattern resolver at app startup.
456
+ *
457
+ * @packageDocumentation
458
+ */
459
+ /**
460
+ * Initialize the pattern resolver with shared pattern data.
461
+ * Must be called once at app startup before any pattern rendering.
462
+ * @returns The number of patterns initialized
463
+ */
464
+ declare function initializePatterns(): number;
465
+
466
+ export { ALL_SLOTS, ClientEffectConfigContext, ClientEffectConfigProvider, SLOT_DEFINITIONS, executeClientEffects, getInlineSlots, getKnownPatterns, getPatternDefinition, getPatternMapping, getPatternsByCategory, getRenderUIEffects, getSlotDefinition, hasEntities, initializePatternResolver, initializePatterns, isKnownPattern, isPortalSlot, parseClientEffect, parseClientEffects, resolveEntityById, resolveEntityData, resolveEntityDataWithQuery, resolvePattern, setComponentMapping, setPatternRegistry, useClientEffectConfig, useClientEffectConfigOptional, useClientEffects };
467
+ export type { ClientEffect, ClientEffectExecutorConfig, DataContext, DataResolution, EventResponse, MappedPattern, SlotDefinition, SlotType, UseClientEffectsOptions, UseClientEffectsResult };
@@ -0,0 +1,3 @@
1
+ export { ClientEffectConfigContext, ClientEffectConfigProvider, executeClientEffects, getKnownPatterns, getPatternDefinition, getPatternMapping, getPatternsByCategory, getRenderUIEffects, hasEntities, initializePatternResolver, initializePatterns, isKnownPattern, parseClientEffect, parseClientEffects, resolveEntityById, resolveEntityData, resolveEntityDataWithQuery, resolvePattern, setComponentMapping, setPatternRegistry, useClientEffectConfig, useClientEffectConfigOptional, useClientEffects } from '../chunk-A2LR6VQQ.js';
2
+ export { ALL_SLOTS, SLOT_DEFINITIONS, getInlineSlots, getSlotDefinition, isPortalSlot } from '../chunk-P4ZFUQFF.js';
3
+ import '../chunk-G7DCAZ22.js';