@almadar/shell-web 0.0.0-stage → 1.0.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 (266) hide show
  1. package/bundling.d.mts +18 -0
  2. package/bundling.mjs +28 -0
  3. package/dist/ArbitraryClassCompiler-CO_iASBn.d.ts +195 -0
  4. package/dist/AvlGlyph-EPJKFEO3.js +6 -0
  5. package/dist/AvlStateMachine-RKZIKNGC.js +9 -0
  6. package/dist/AvlTransitionDetail-63SD6GZF.js +11 -0
  7. package/dist/AvlTransitionExplainer-ZBTLOM3T.js +12 -0
  8. package/dist/BehaviorView-YS5G4GNB.js +11 -0
  9. package/dist/Canvas3DHost-BkZQB5l2.d.ts +552 -0
  10. package/dist/EventBusProvider-BFFHfN4O.d.ts +296 -0
  11. package/dist/FileTree-BCFnBEuQ.d.ts +254 -0
  12. package/dist/FlowCanvas-3JRMNJLV.css +1756 -0
  13. package/dist/FlowCanvas-AUMTWMNG.js +26 -0
  14. package/dist/GameAudioProvider-ceM_n0ey.d.ts +90 -0
  15. package/dist/KaTeX_AMS-Regular-CYEKBG2K.woff +0 -0
  16. package/dist/KaTeX_AMS-Regular-JKX5W2C4.ttf +0 -0
  17. package/dist/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
  18. package/dist/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
  19. package/dist/KaTeX_Caligraphic-Bold-WZ3QSGD3.woff +0 -0
  20. package/dist/KaTeX_Caligraphic-Bold-ZTS3R3HK.ttf +0 -0
  21. package/dist/KaTeX_Caligraphic-Regular-3LKEU76G.woff +0 -0
  22. package/dist/KaTeX_Caligraphic-Regular-A7XRTZ5Q.ttf +0 -0
  23. package/dist/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
  24. package/dist/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
  25. package/dist/KaTeX_Fraktur-Bold-T4SWXBMT.woff +0 -0
  26. package/dist/KaTeX_Fraktur-Bold-WGHVTYOR.ttf +0 -0
  27. package/dist/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
  28. package/dist/KaTeX_Fraktur-Regular-5U4OPH2X.ttf +0 -0
  29. package/dist/KaTeX_Fraktur-Regular-PQMHCIK6.woff +0 -0
  30. package/dist/KaTeX_Main-Bold-2GA4IZIN.woff +0 -0
  31. package/dist/KaTeX_Main-Bold-W5FBVCZM.ttf +0 -0
  32. package/dist/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
  33. package/dist/KaTeX_Main-BoldItalic-4P4C7HJH.woff +0 -0
  34. package/dist/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
  35. package/dist/KaTeX_Main-BoldItalic-ODMLBJJQ.ttf +0 -0
  36. package/dist/KaTeX_Main-Italic-I43T2HSR.ttf +0 -0
  37. package/dist/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
  38. package/dist/KaTeX_Main-Italic-SASNQFN2.woff +0 -0
  39. package/dist/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
  40. package/dist/KaTeX_Main-Regular-P5I74A2A.woff +0 -0
  41. package/dist/KaTeX_Main-Regular-W74P5G27.ttf +0 -0
  42. package/dist/KaTeX_Math-BoldItalic-6EBV3DK5.woff +0 -0
  43. package/dist/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
  44. package/dist/KaTeX_Math-BoldItalic-VB447A4D.ttf +0 -0
  45. package/dist/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
  46. package/dist/KaTeX_Math-Italic-KKK3USB2.woff +0 -0
  47. package/dist/KaTeX_Math-Italic-SON4MRCA.ttf +0 -0
  48. package/dist/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
  49. package/dist/KaTeX_SansSerif-Bold-STQ6RXC7.ttf +0 -0
  50. package/dist/KaTeX_SansSerif-Bold-X5M5EMOD.woff +0 -0
  51. package/dist/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
  52. package/dist/KaTeX_SansSerif-Italic-PSN4QKYX.woff +0 -0
  53. package/dist/KaTeX_SansSerif-Italic-WTBAZBGY.ttf +0 -0
  54. package/dist/KaTeX_SansSerif-Regular-2TL3USAE.ttf +0 -0
  55. package/dist/KaTeX_SansSerif-Regular-OQCII6EP.woff +0 -0
  56. package/dist/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
  57. package/dist/KaTeX_Script-Regular-72OLXYNA.ttf +0 -0
  58. package/dist/KaTeX_Script-Regular-A5IFOEBS.woff +0 -0
  59. package/dist/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
  60. package/dist/KaTeX_Size1-Regular-4HRHTS65.woff +0 -0
  61. package/dist/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
  62. package/dist/KaTeX_Size1-Regular-7K6AASVL.ttf +0 -0
  63. package/dist/KaTeX_Size2-Regular-222HN3GT.ttf +0 -0
  64. package/dist/KaTeX_Size2-Regular-K5ZHAIS6.woff +0 -0
  65. package/dist/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
  66. package/dist/KaTeX_Size3-Regular-TLFPAHDE.woff +0 -0
  67. package/dist/KaTeX_Size3-Regular-UFCO6WCA.ttf +0 -0
  68. package/dist/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
  69. package/dist/KaTeX_Size4-Regular-7PGNVPQK.ttf +0 -0
  70. package/dist/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
  71. package/dist/KaTeX_Size4-Regular-PKMWZHNC.woff +0 -0
  72. package/dist/KaTeX_Typewriter-Regular-3F5K6SQ6.ttf +0 -0
  73. package/dist/KaTeX_Typewriter-Regular-MJMFSK64.woff +0 -0
  74. package/dist/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
  75. package/dist/KernelEngineContext-CcxGYtlr.d.ts +33 -0
  76. package/dist/LayersPanel-M2LHWUFF.js +6 -0
  77. package/dist/ModuleCard-QHDGK5XK.js +7 -0
  78. package/dist/OrbInspector-MHLJ6OEE.css +1756 -0
  79. package/dist/OrbInspector-QCPEPUPH.js +26 -0
  80. package/dist/Select-B-iDdnvE.d.ts +185 -0
  81. package/dist/ServerBridge-Bqsj-lOU.d.ts +124 -0
  82. package/dist/ThemeContext-DJmO59xd.d.ts +147 -0
  83. package/dist/UISlotContext-Dl_ewwCI.d.ts +79 -0
  84. package/dist/UISlotRenderer-C7WWOK43.js +26 -0
  85. package/dist/UISlotRenderer-KVFO6J7R.css +1756 -0
  86. package/dist/auth/browser/index.d.ts +2 -0
  87. package/dist/auth/browser/index.js +2 -0
  88. package/dist/auth/react/index.d.ts +56 -0
  89. package/dist/auth/react/index.js +157 -0
  90. package/dist/avl/index.css +1756 -0
  91. package/dist/avl/index.d.ts +2248 -0
  92. package/dist/avl/index.js +2693 -0
  93. package/dist/avl-3d-context-BycmO6tG.d.ts +201 -0
  94. package/dist/avl-schema-parser-CtJxJ9KU.d.ts +132 -0
  95. package/dist/avl-zoom-state-CKMVuBFg.d.ts +17 -0
  96. package/dist/chunk-3BBUBJFF.js +339 -0
  97. package/dist/chunk-3S54FWRC.js +131 -0
  98. package/dist/chunk-3VZ36ZKO.js +775 -0
  99. package/dist/chunk-4T3P43NS.js +1133 -0
  100. package/dist/chunk-4YXBKHHM.js +11488 -0
  101. package/dist/chunk-57DC34LY.js +525 -0
  102. package/dist/chunk-5QTYQTPS.js +15 -0
  103. package/dist/chunk-A2LR6VQQ.js +349 -0
  104. package/dist/chunk-AB3X7QTE.js +505 -0
  105. package/dist/chunk-AE7VCQB6.js +561 -0
  106. package/dist/chunk-AGXD77SL.js +98 -0
  107. package/dist/chunk-AU7O65OX.js +66 -0
  108. package/dist/chunk-CPLN6NBQ.js +701 -0
  109. package/dist/chunk-DZBQA2OW.js +176 -0
  110. package/dist/chunk-E6KA4J6N.js +227 -0
  111. package/dist/chunk-EOWMARUB.js +16 -0
  112. package/dist/chunk-G7DCAZ22.js +19 -0
  113. package/dist/chunk-GFXCPUMX.js +1334 -0
  114. package/dist/chunk-HH5KSMH5.js +311 -0
  115. package/dist/chunk-ILQXJ2AR.js +280 -0
  116. package/dist/chunk-ILZ7ORX7.js +432 -0
  117. package/dist/chunk-K4MOPSEL.js +674 -0
  118. package/dist/chunk-LHP2TK7O.js +47587 -0
  119. package/dist/chunk-P4ZFUQFF.js +93 -0
  120. package/dist/chunk-PCR37T3U.js +296 -0
  121. package/dist/chunk-PRXQGGCO.js +580 -0
  122. package/dist/chunk-REXYVBUO.js +191 -0
  123. package/dist/chunk-ROICKAU7.js +24 -0
  124. package/dist/chunk-SP5CDJ6K.js +338 -0
  125. package/dist/chunk-TUPZWTRE.js +1051 -0
  126. package/dist/chunk-TXAUOLWZ.js +490 -0
  127. package/dist/chunk-TZZBINQY.js +82 -0
  128. package/dist/chunk-UTDC2NEA.js +14 -0
  129. package/dist/chunk-UU57VNS2.js +1053 -0
  130. package/dist/chunk-UXLE3IPR.js +421 -0
  131. package/dist/chunk-VO2TTLS5.js +94 -0
  132. package/dist/chunk-X3DMMX27.js +11 -0
  133. package/dist/chunk-YHMRX6YA.js +455 -0
  134. package/dist/components/index.css +1756 -0
  135. package/dist/components/index.d.ts +11299 -0
  136. package/dist/components/index.js +1110 -0
  137. package/dist/context/index.d.ts +8 -0
  138. package/dist/context/index.js +8 -0
  139. package/dist/core.d.ts +2599 -0
  140. package/dist/core.js +3 -0
  141. package/dist/design-classes/index.cjs +431 -0
  142. package/dist/design-classes/index.d.cts +165 -0
  143. package/dist/design-classes/index.d.ts +165 -0
  144. package/dist/design-classes/index.js +399 -0
  145. package/dist/emojiItems-QGSNAABW.js +20 -0
  146. package/dist/fx-CmQjnHmT.d.ts +371 -0
  147. package/dist/hooks/index.d.ts +971 -0
  148. package/dist/hooks/index.js +8 -0
  149. package/dist/index.d.ts +408 -0
  150. package/dist/index.js +178 -0
  151. package/dist/katexPlugin-FA7NX4PE.css +1161 -0
  152. package/dist/katexPlugin-NCDKOOQY.js +2 -0
  153. package/dist/kernel-client-TZKGHJRY.js +516 -0
  154. package/dist/kernel-wire-wNdAPfhJ.d.ts +88 -0
  155. package/dist/lib/index.d.ts +602 -0
  156. package/dist/lib/index.js +1289 -0
  157. package/dist/paintDispatch-CuJLsr9Y.d.ts +688 -0
  158. package/dist/parseLessonSegments-GpCeMrb2.d.ts +334 -0
  159. package/dist/perf-CKiBKbkw.d.ts +22 -0
  160. package/dist/perf-Dr28-AgT.d.ts +57 -0
  161. package/dist/prism-X5YWKXO5.js +136 -0
  162. package/dist/providers/index.css +1756 -0
  163. package/dist/providers/index.d.ts +355 -0
  164. package/dist/providers/index.js +29 -0
  165. package/dist/renderer/index.d.ts +465 -0
  166. package/dist/renderer/index.js +4 -0
  167. package/dist/runtime/index.css +1756 -0
  168. package/dist/runtime/index.d.ts +239 -0
  169. package/dist/runtime/index.js +28 -0
  170. package/dist/slot-host-CPzrxLo9.d.ts +48 -0
  171. package/dist/ssr/index.cjs +9739 -0
  172. package/dist/ssr/index.d.cts +464 -0
  173. package/dist/ssr/index.d.ts +464 -0
  174. package/dist/ssr/index.js +9703 -0
  175. package/dist/storage/browser/index.d.ts +1 -0
  176. package/dist/storage/browser/index.js +2 -0
  177. package/dist/test-support.d.ts +42 -0
  178. package/dist/test-support.js +181 -0
  179. package/dist/themeTokens-CRd8AEDF.d.ts +125 -0
  180. package/dist/three/index.css +503 -0
  181. package/dist/three/index.d.ts +1185 -0
  182. package/dist/three/index.js +3908 -0
  183. package/dist/useUISlots-CiobNFGb.d.ts +211 -0
  184. package/dist/verification-C5pTeMJv.d.ts +66 -0
  185. package/dist/verificationRegistry-CVrcxG1s.d.ts +122 -0
  186. package/dist/wrapCallbackForEvent-B9QLbhxX.d.ts +19 -0
  187. package/index.css +199 -0
  188. package/package.json +273 -3
  189. package/src/core/lib/band-shapes.json +7 -0
  190. package/src/core/locales/ar.json +1276 -0
  191. package/src/core/locales/en.json +1276 -0
  192. package/src/core/locales/index.ts +54 -0
  193. package/src/core/locales/sl.json +1276 -0
  194. package/src/core/tokens/native-tokens.json +369 -0
  195. package/tailwind-compile.cjs +29 -0
  196. package/tailwind-preset.cjs +1020 -0
  197. package/themes/_base.css +451 -0
  198. package/themes/_contract.md +307 -0
  199. package/themes/_fonts-kenney.css +11 -0
  200. package/themes/_fonts.css +12 -0
  201. package/themes/_foundation.css +105 -0
  202. package/themes/_head.css +22 -0
  203. package/themes/_presets.css +67 -0
  204. package/themes/almadar-heritage.css +455 -0
  205. package/themes/almadar-website.css +269 -0
  206. package/themes/almadar.css +269 -0
  207. package/themes/aqua.css +455 -0
  208. package/themes/arabesque.css +459 -0
  209. package/themes/art-deco.css +457 -0
  210. package/themes/art-nouveau.css +459 -0
  211. package/themes/atelier.css +463 -0
  212. package/themes/bauhaus.css +461 -0
  213. package/themes/bloomberg-dense.css +463 -0
  214. package/themes/blueprint.css +457 -0
  215. package/themes/clay.css +449 -0
  216. package/themes/comic.css +453 -0
  217. package/themes/constructivist.css +457 -0
  218. package/themes/corporate.css +449 -0
  219. package/themes/cyberpunk.css +453 -0
  220. package/themes/frutiger-aero.css +458 -0
  221. package/themes/game-adventure.css +201 -0
  222. package/themes/game-rpg.css +203 -0
  223. package/themes/game-sci-fi.css +201 -0
  224. package/themes/game-ui-pack.css +200 -0
  225. package/themes/gazette.css +449 -0
  226. package/themes/glass.css +457 -0
  227. package/themes/gothic.css +453 -0
  228. package/themes/index.css +21 -0
  229. package/themes/ink-wash.css +459 -0
  230. package/themes/kawaii.css +459 -0
  231. package/themes/kflow.css +310 -0
  232. package/themes/kiosk.css +449 -0
  233. package/themes/linear-clean.css +463 -0
  234. package/themes/luxury.css +451 -0
  235. package/themes/mac-classic.css +455 -0
  236. package/themes/material.css +463 -0
  237. package/themes/memphis.css +453 -0
  238. package/themes/mid-century.css +455 -0
  239. package/themes/minimalist.css +449 -0
  240. package/themes/mudcloth.css +459 -0
  241. package/themes/nata.css +310 -0
  242. package/themes/neon.css +453 -0
  243. package/themes/neumorphic.css +451 -0
  244. package/themes/newsprint.css +455 -0
  245. package/themes/notion-editorial.css +463 -0
  246. package/themes/orb.css +465 -0
  247. package/themes/pixel.css +449 -0
  248. package/themes/prism.css +309 -0
  249. package/themes/rawi.css +310 -0
  250. package/themes/retro.css +452 -0
  251. package/themes/risograph.css +463 -0
  252. package/themes/scandi.css +469 -0
  253. package/themes/sketch.css +455 -0
  254. package/themes/solarpunk.css +469 -0
  255. package/themes/steampunk.css +451 -0
  256. package/themes/swiss.css +455 -0
  257. package/themes/terminal.css +466 -0
  258. package/themes/trait-wars.css +487 -0
  259. package/themes/ukiyo-e.css +459 -0
  260. package/themes/vaporwave.css +455 -0
  261. package/themes/victorian.css +453 -0
  262. package/themes/wabi-sabi.css +459 -0
  263. package/themes/win95.css +455 -0
  264. package/themes/wireframe.css +439 -0
  265. package/themes/zine.css +455 -0
  266. package/README.md +0 -3
@@ -0,0 +1,296 @@
1
+ import * as React from 'react';
2
+ import React__default, { ReactNode } from 'react';
3
+ import { A11yProps, EventEmit, EventPayload, BusEventSource, BusEventListener, Unsubscribe, EntityRow } from '@almadar/core';
4
+
5
+ type VideoReadyPayload = {
6
+ source: string;
7
+ };
8
+ type VideoErrorPayload = {
9
+ error: string;
10
+ code: string;
11
+ };
12
+ type VideoPlayPayload = {
13
+ source: string;
14
+ };
15
+ /**
16
+ * Embedded video player: a YouTube video by id, or any player page by URL. Fires a ready event once it can play and an error event when it cannot.
17
+ * @capabilities embedded video, YouTube player, lesson video, video embed, play a video by id or URL, player ready and error events
18
+ * @accessibleName title
19
+ */
20
+ interface VideoEmbedProps extends A11yProps {
21
+ /** YouTube video id (the 11 characters of the share URL); played through the YouTube IFrame API */
22
+ videoId?: string;
23
+ /** URL of any other embeddable player page; used when no `videoId` is set */
24
+ src?: string;
25
+ /** Accessible name of the player */
26
+ title?: string;
27
+ /** Text shown when no video is selected */
28
+ noVideoLabel?: string;
29
+ /** Text for a YouTube API loading failure */
30
+ apiUnavailableMessage?: string;
31
+ /** Text for YouTube error code 2 */
32
+ invalidVideoMessage?: string;
33
+ /** Text for YouTube error code 5 or an unknown code */
34
+ playbackFailedMessage?: string;
35
+ /** Text for YouTube error code 100 */
36
+ notFoundMessage?: string;
37
+ /** Text for YouTube error codes 101 and 150 */
38
+ notEmbeddableMessage?: string;
39
+ /** Start playback as soon as the player is ready (YouTube ids only) */
40
+ autoplay?: boolean;
41
+ /** Show the player's own controls (YouTube ids only) */
42
+ controls?: boolean;
43
+ /** Second of the video to start from (YouTube ids only) */
44
+ start?: number;
45
+ /** Event fired once the player is ready to play; the payload names the video id or URL */
46
+ readyEvent?: EventEmit<VideoReadyPayload>;
47
+ /** Event fired each time the YouTube player begins or resumes playing; the payload names the video id */
48
+ playEvent?: EventEmit<VideoPlayPayload>;
49
+ /** Event fired when the YouTube player cannot load or play the video; the payload carries the message and the player's error code. A plain URL never fires it: a browser reports no load failure for a page frame */
50
+ errorEvent?: EventEmit<VideoErrorPayload>;
51
+ /** Additional class names */
52
+ className?: string;
53
+ }
54
+ interface YouTubePlayer {
55
+ destroy(): void;
56
+ }
57
+ interface YouTubePlayerOptions {
58
+ videoId: string;
59
+ playerVars: {
60
+ autoplay: 0 | 1;
61
+ controls: 0 | 1;
62
+ start: number;
63
+ rel: 0;
64
+ };
65
+ events: {
66
+ onReady: () => void;
67
+ onError: (event: {
68
+ data: number;
69
+ }) => void;
70
+ onStateChange: (event: {
71
+ data: number;
72
+ }) => void;
73
+ };
74
+ }
75
+ interface YouTubeApi {
76
+ Player: new (host: HTMLElement, options: YouTubePlayerOptions) => YouTubePlayer;
77
+ }
78
+ declare global {
79
+ interface Window {
80
+ YT?: YouTubeApi;
81
+ onYouTubeIframeAPIReady?: () => void;
82
+ }
83
+ }
84
+ declare const VideoEmbed: React.FC<VideoEmbedProps>;
85
+
86
+ /**
87
+ * Event Bus Types
88
+ *
89
+ * Re-exports from @almadar/core so every package agrees on the same
90
+ * bus event envelope. @almadar/ui no longer owns its own KFlowEvent —
91
+ * that type was folded into core's BusEvent.
92
+ *
93
+ * @packageDocumentation
94
+ */
95
+
96
+ /**
97
+ * Event bus context type.
98
+ *
99
+ * `emit` accepts `EventPayload` from `@almadar/core` — the canonical
100
+ * object shape (index signature over `EventPayloadValue`) that the bus
101
+ * envelope stores and listeners consume. Pattern-specific payload types
102
+ * from `@almadar/core/patterns` (`ItemActionPayload`, `SelectionChangePayload`,
103
+ * `FormSubmitPayload`, ...) are structural subtypes of `EventPayload`,
104
+ * so components can pass them in without casts.
105
+ */
106
+ interface EventBusContextType {
107
+ /**
108
+ * Emit an event to all listeners.
109
+ *
110
+ * @param type - Event type identifier
111
+ * @param payload - Optional payload data (shape matches {@link EventPayload})
112
+ * @param source - Optional origin info (orbital/trait/...)
113
+ */
114
+ emit: (type: string, payload?: EventPayload, source?: BusEventSource) => void;
115
+ /**
116
+ * Subscribe to an event type.
117
+ *
118
+ * @param type - Event type to listen for
119
+ * @param listener - Callback function
120
+ * @returns Unsubscribe function
121
+ */
122
+ on: (type: string, listener: BusEventListener) => Unsubscribe;
123
+ /**
124
+ * Subscribe to an event type, but only fire once.
125
+ *
126
+ * @param type - Event type to listen for
127
+ * @param listener - Callback function
128
+ * @returns Unsubscribe function
129
+ */
130
+ once: (type: string, listener: BusEventListener) => Unsubscribe;
131
+ /**
132
+ * Check if there are any listeners for an event type.
133
+ *
134
+ * @param type - Event type to check
135
+ * @returns True if there are listeners
136
+ */
137
+ hasListeners: (type: string) => boolean;
138
+ /**
139
+ * Subscribe to ALL events regardless of type.
140
+ * Useful for verification, debugging, and analytics.
141
+ *
142
+ * @param listener - Callback function invoked for every emitted event
143
+ * @returns Unsubscribe function
144
+ */
145
+ onAny?: (listener: BusEventListener) => Unsubscribe;
146
+ }
147
+
148
+ declare global {
149
+ interface Window {
150
+ __kflowEventBus?: EventBusContextType | null;
151
+ }
152
+ }
153
+ /**
154
+ * Global event bus reference for bridging between packages.
155
+ *
156
+ * Uses window-level global to enable cross-package communication.
157
+ * This allows @almadar/ui components to emit events to the same bus
158
+ * that the consuming app's trait state machine listens to.
159
+ *
160
+ * When the EventBusProvider mounts, it sets window.__kflowEventBus.
161
+ * Components in any package can then use this shared event bus.
162
+ *
163
+ * SSR Safety: All window access is guarded by `typeof window !== 'undefined'`.
164
+ * React Compiler Safety: The global bus reference is set once at provider mount
165
+ * and is stable — no render-path side effects. In practice, the React context
166
+ * path (priority 1) is used in real apps; the window global (priority 2) is
167
+ * only reached when no EventBusProvider is in the tree (e.g., Storybook).
168
+ */
169
+ /**
170
+ * Set the global event bus reference.
171
+ * Called by EventBusProvider when it mounts.
172
+ *
173
+ * @param bus - The event bus context to set as global, or null to clear
174
+ */
175
+ declare function setGlobalEventBus(bus: EventBusContextType | null): void;
176
+ /**
177
+ * Get the global event bus reference.
178
+ *
179
+ * @returns The global event bus if set, null otherwise
180
+ */
181
+ declare function getGlobalEventBus(): EventBusContextType | null;
182
+ /**
183
+ * Hook for accessing the event bus.
184
+ *
185
+ * Uses EventBusProvider context if available, otherwise falls back to
186
+ * a simple in-memory event bus (for design system / Storybook).
187
+ *
188
+ * @returns Event bus instance with emit, on, once, and hasListeners methods
189
+ *
190
+ * @example
191
+ * ```tsx
192
+ * const eventBus = useEventBus();
193
+ *
194
+ * // Emit an event
195
+ * eventBus.emit('UI:CLICK', { id: '123' });
196
+ *
197
+ * // Subscribe to an event
198
+ * useEffect(() => {
199
+ * return eventBus.on('UI:CLICK', (event) => {
200
+ * console.log('Clicked:', event.payload);
201
+ * });
202
+ * }, []);
203
+ * ```
204
+ */
205
+ declare function useEventBus(): EventBusContextType;
206
+ /**
207
+ * The bus with no trait-scope rewriting: a machine-originated relay (an embedded
208
+ * program's emit) goes out on exactly the keys it names.
209
+ */
210
+ declare function useRootEventBus(): EventBusContextType;
211
+ /**
212
+ * Hook for subscribing to a specific event.
213
+ * Automatically cleans up subscription on unmount.
214
+ *
215
+ * @param event - Event name to subscribe to
216
+ * @param handler - Event handler function
217
+ *
218
+ * @example
219
+ * ```tsx
220
+ * useEventListener('UI:CLICK', (event) => {
221
+ * console.log('Clicked:', event.payload);
222
+ * });
223
+ * ```
224
+ */
225
+ declare function useEventListener(event: string, handler: BusEventListener): void;
226
+ /**
227
+ * Alias for useEventListener for backward compatibility
228
+ */
229
+ declare const useEventSubscription: typeof useEventListener;
230
+ /**
231
+ * Hook for emitting events.
232
+ * Returns a memoized emit function.
233
+ *
234
+ * @returns Function to emit events
235
+ *
236
+ * @example
237
+ * ```tsx
238
+ * const emit = useEmitEvent();
239
+ *
240
+ * const handleClick = () => {
241
+ * emit('UI:CLICK', { id: '123' });
242
+ * };
243
+ * ```
244
+ */
245
+ declare function useEmitEvent(): (type: string, payload?: EventPayload, source?: BusEventSource) => void;
246
+
247
+ /**
248
+ * EventBusProvider - React context provider for the event bus
249
+ *
250
+ * Provides a page-scoped event bus for trait communication.
251
+ * Each page has its own event bus instance.
252
+ *
253
+ * NOTE: Selection state has been moved to SelectionProvider.
254
+ * Use SelectionProvider for tracking selected entities.
255
+ *
256
+ * @packageDocumentation
257
+ */
258
+
259
+ /**
260
+ * Extended context type for backward compatibility.
261
+ *
262
+ * @deprecated getSelectedEntity and clearSelectedEntity are deprecated.
263
+ * Use SelectionProvider and useSelection hook instead.
264
+ */
265
+ interface EventBusContextTypeExtended extends EventBusContextType {
266
+ /** @deprecated Use useSelection from SelectionProvider instead. */
267
+ getSelectedEntity: () => EntityRow | null;
268
+ /** @deprecated Use useSelection from SelectionProvider instead. */
269
+ clearSelectedEntity: () => void;
270
+ }
271
+ declare global {
272
+ var __almadarUiEventBusContext: React__default.Context<EventBusContextTypeExtended | null> | undefined;
273
+ }
274
+ declare const EventBusContext: React__default.Context<EventBusContextTypeExtended | null>;
275
+ interface EventBusProviderProps {
276
+ children?: ReactNode;
277
+ /**
278
+ * @deprecated No-op. Logging is now gated by `@almadar/logger` —
279
+ * use `setLogLevel('DEBUG')` or `setNamespaceLevel('almadar:eventbus', 'DEBUG')`
280
+ * from `@almadar/logger` to control verbosity. Kept for API compatibility.
281
+ */
282
+ debug?: boolean;
283
+ /**
284
+ * When true, this provider does NOT register itself as the global event bus
285
+ * (`window.__kflowEventBus`). Use for SANDBOXED subtrees — e.g. a studio
286
+ * preview (`OrbPreview isolated`) embedded inside a host app — whose internal
287
+ * events must stay context-local and must NOT clobber the host's global bus.
288
+ * Children still get this bus via React context; only the global bridge is
289
+ * skipped. Default false (root/standalone providers own the global bridge).
290
+ */
291
+ isolated?: boolean;
292
+ }
293
+ declare function EventBusProvider({ children, isolated }: EventBusProviderProps): React__default.JSX.Element;
294
+
295
+ export { EventBusContext as E, VideoEmbed as V, EventBusProvider as c, getGlobalEventBus as h, useEventBus as i, useEventListener as j, useEventSubscription as k, useRootEventBus as l, setGlobalEventBus as s, useEmitEvent as u };
296
+ export type { EventBusContextType as a, EventBusContextTypeExtended as b, VideoEmbedProps as d, VideoErrorPayload as e, VideoPlayPayload as f, VideoReadyPayload as g };
@@ -0,0 +1,254 @@
1
+ import React__default from 'react';
2
+ import { A11yProps, EventEmit, JsonObject, EntityPersistence, OrbitalSchema } from '@almadar/core';
3
+ import { T as TraitLevelData, F as FieldInfo, O as OrbitalTraitInfo, a as OrbitalPageInfo, E as ExternalLink } from './avl-schema-parser-CtJxJ9KU.js';
4
+ import { Node, Edge } from '@xyflow/react';
5
+
6
+ /**
7
+ * Author-supplied explanations for AVL diagrams: a note per state, per
8
+ * transition event and per effect type, shown in a popover on hover/focus.
9
+ */
10
+ interface AvlNote {
11
+ /** Short heading. */
12
+ title?: string;
13
+ /** The explanation. */
14
+ body: string;
15
+ }
16
+ interface AvlAnnotations {
17
+ /** Keyed by state name. */
18
+ states?: Record<string, AvlNote>;
19
+ /** Keyed by transition event. */
20
+ transitions?: Record<string, AvlNote>;
21
+ /** Keyed by effect type (e.g. `persist`). */
22
+ effects?: Record<string, AvlNote>;
23
+ }
24
+
25
+ /**
26
+ * AvlStateMachine — the one state-machine renderer: a trait's states and
27
+ * transitions laid out left→right (ELK), themed entirely through tokens, with
28
+ * optional execution position (active state, fired transition, visited path).
29
+ */
30
+
31
+ interface AvlStateMachineProps extends A11yProps {
32
+ /** The trait to draw (see `parseTraitLevel`).
33
+ * @example {"name":"OrderFlow","linkedEntity":"Order","states":[{"name":"browsing","isInitial":true,"isTerminal":false},{"name":"editing","isInitial":false,"isTerminal":false},{"name":"saving","isInitial":false,"isTerminal":false},{"name":"confirmed","isInitial":false,"isTerminal":true},{"name":"failed","isInitial":false,"isTerminal":false}],"transitions":[{"from":"browsing","to":"editing","event":"EDIT","effects":[{"type":"render-ui","args":[]}],"index":0},{"from":"editing","to":"saving","event":"SAVE","effects":[{"type":"persist","args":[]},{"type":"notify","args":[]}],"index":1},{"from":"saving","to":"confirmed","event":"SAVED","effects":[{"type":"emit","args":[]},{"type":"render-ui","args":[]}],"index":2},{"from":"saving","to":"failed","event":"SAVE_FAILED","effects":[{"type":"notify","args":[]}],"index":3},{"from":"failed","to":"editing","event":"RETRY","effects":[],"index":4},{"from":"editing","to":"browsing","event":"CANCEL","effects":[{"type":"render-ui","args":[]}],"index":5},{"from":"confirmed","to":"browsing","event":"DONE","effects":[{"type":"navigate","args":[]}],"index":6}],"emittedEvents":["ORDER_SAVED"],"listenedEvents":["PAYMENT_OK"]}
34
+ */
35
+ trait: TraitLevelData;
36
+ /** State execution is currently in. */
37
+ activeState?: string;
38
+ /** `index` of the transition that just fired. */
39
+ activeTransition?: number;
40
+ /** States already passed through, in order. */
41
+ visitedStates?: string[];
42
+ /** Keep the active state in view: when it changes, the diagram scrolls sideways to centre it. @default false */
43
+ followActive?: boolean;
44
+ /** Emits UI:{stateClickEvent} with { stateId } when a state is clicked. */
45
+ stateClickEvent?: EventEmit<{
46
+ stateId: string;
47
+ }>;
48
+ /** Emits UI:{transitionClickEvent} with { index, event, from, to } when a transition label is clicked. */
49
+ transitionClickEvent?: EventEmit<{
50
+ index: number;
51
+ event: string;
52
+ from: string;
53
+ to: string;
54
+ }>;
55
+ /** Direct transition-click callback, for React hosts (e.g. a canvas node). */
56
+ onTransitionClick?: (transition: {
57
+ index: number;
58
+ event: string;
59
+ from: string;
60
+ to: string;
61
+ }) => void;
62
+ /** State picked in an editor (first click). */
63
+ selectedState?: string;
64
+ /** Source of a transition being drawn — the next state click picks its target. */
65
+ pendingSourceState?: string;
66
+ /** Node silhouette. @default 'pill' */
67
+ nodeShape?: 'pill' | 'gear';
68
+ /** Entity field names listed in the header. */
69
+ entityFields?: string[];
70
+ /** Flow direction. @default 'ltr' */
71
+ direction?: 'ltr' | 'rtl';
72
+ /** Show the trait header (name, entity, listens/emits). @default true */
73
+ showHeader?: boolean;
74
+ /** Author explanations shown in a popover on hover: a note per state name, per transition event and per effect type.
75
+ * @example {"states":{"pending":{"title":"Unpaid","body":"Every order starts here."}},"transitions":{"PAY":{"body":"Only fires when the amount is positive."}},"effects":{"persist":{"body":"Saves the order."}}}
76
+ */
77
+ annotations?: AvlAnnotations;
78
+ className?: string;
79
+ }
80
+ declare const AvlStateMachine: React__default.FC<AvlStateMachineProps>;
81
+
82
+ /**
83
+ * AVL Flow Converter
84
+ *
85
+ * Converts an OrbitalSchema into React Flow nodes and edges
86
+ * for the unified AVL canvas. Reuses the existing AVL schema parser.
87
+ */
88
+
89
+ /** Data carried by every orbital node in the unified canvas. */
90
+ interface AvlNodeData extends JsonObject {
91
+ orbitalName: string;
92
+ entityName: string;
93
+ persistence: EntityPersistence;
94
+ fields: FieldInfo[];
95
+ traits: OrbitalTraitInfo[];
96
+ pages: OrbitalPageInfo[];
97
+ traitDetails: {
98
+ [k: string]: TraitLevelData;
99
+ };
100
+ externalLinks: ExternalLink[];
101
+ }
102
+ /** Data carried by edges in the unified canvas. */
103
+ interface AvlEdgeData extends JsonObject {
104
+ edgeKind: string;
105
+ event: string | null;
106
+ fromTrait: string | null;
107
+ toTrait: string | null;
108
+ }
109
+ /**
110
+ * Transform an OrbitalSchema into React Flow nodes and edges.
111
+ * Pre-parses all orbital and trait details for responsive zoom.
112
+ */
113
+ declare function schemaToFlowGraph(schema: OrbitalSchema): {
114
+ nodes: Node<AvlNodeData>[];
115
+ edges: Edge<AvlEdgeData>[];
116
+ };
117
+
118
+ /**
119
+ * ModuleCard — Structured card for the module zoom band (0.4x-1.0x).
120
+ *
121
+ * Renders AVL primitives inside a card container:
122
+ * - Entity section: AvlEntity glyph + AvlPersistence + AvlFieldType grid
123
+ * - Trait sections: MiniStateMachine per trait + AvlEffect icons + emit/listen indicators
124
+ * - Pages section: AvlPage squares with route labels
125
+ */
126
+
127
+ /**
128
+ * ModuleCard — a compact summary card for one orbital module: its entity and
129
+ * fields, a mini state machine per trait, and its pages.
130
+ *
131
+ * @capabilities orbital module summary card, entity and trait overview card, app architecture node card
132
+ */
133
+ interface ModuleCardProps extends Omit<React__default.AriaAttributes, keyof A11yProps>, A11yProps {
134
+ /** The orbital to summarize.
135
+ * @example {"orbitalName":"OrderOrbital","entityName":"Order","persistence":"persistent","fields":[{"name":"customer","type":"string","required":true,"hasDefault":false},{"name":"qty","type":"number","required":true,"hasDefault":true},{"name":"status","type":"string","required":false,"hasDefault":true}],"traits":[{"name":"OrderFlow","stateCount":5,"eventCount":7,"transitionCount":7,"emits":["ORDER_SAVED"],"listens":["PAYMENT_OK"]}],"pages":[{"name":"Orders","route":"/orders"}],"traitDetails":{"OrderFlow":{"name":"OrderFlow","linkedEntity":"Order","states":[{"name":"browsing","isInitial":true,"isTerminal":false},{"name":"editing","isInitial":false,"isTerminal":false},{"name":"saving","isInitial":false,"isTerminal":false},{"name":"confirmed","isInitial":false,"isTerminal":true},{"name":"failed","isInitial":false,"isTerminal":false}],"transitions":[{"from":"browsing","to":"editing","event":"EDIT","effects":[{"type":"render-ui","args":[]}],"index":0},{"from":"editing","to":"saving","event":"SAVE","effects":[{"type":"persist","args":[]},{"type":"notify","args":[]}],"index":1},{"from":"saving","to":"confirmed","event":"SAVED","effects":[{"type":"emit","args":[]},{"type":"render-ui","args":[]}],"index":2},{"from":"saving","to":"failed","event":"SAVE_FAILED","effects":[{"type":"notify","args":[]}],"index":3},{"from":"failed","to":"editing","event":"RETRY","effects":[],"index":4},{"from":"editing","to":"browsing","event":"CANCEL","effects":[{"type":"render-ui","args":[]}],"index":5},{"from":"confirmed","to":"browsing","event":"DONE","effects":[{"type":"navigate","args":[]}],"index":6}],"emittedEvents":["ORDER_SAVED"],"listenedEvents":["PAYMENT_OK"]}},"externalLinks":[{"targetOrbital":"PaymentOrbital","eventName":"PAYMENT_OK","direction":"in","traitName":"OrderFlow"}]}
136
+ */
137
+ data: AvlNodeData;
138
+ /** Author explanations per trait name (states, transition events, effect types), shown in a popover on hover.
139
+ * @example {"OrderFlow":{"states":{"saving":{"body":"Waiting for the server to confirm."}},"effects":{"persist":{"body":"Saves the order."}}}}
140
+ */
141
+ annotations?: Record<string, AvlAnnotations>;
142
+ }
143
+ /**
144
+ * Self-contained ModuleCard. The connection `<Handle>`s need the ReactFlow store,
145
+ * so standalone they'd throw ("no zustand provider as an ancestor"). When this
146
+ * card isn't already a flow node (`useNodeId() === null`) it bundles its own
147
+ * `<ReactFlowProvider>` so it renders anywhere; inside `<FlowCanvas>` it's a real
148
+ * node and renders raw (no nested provider). The provider is an implementation
149
+ * detail, never a precondition for using the component.
150
+ */
151
+ declare const ModuleCard: React__default.FC<ModuleCardProps>;
152
+
153
+ /**
154
+ * BehaviorView — an orbital's behavior: one themed state machine per trait.
155
+ */
156
+
157
+ interface BehaviorViewProps extends Omit<React__default.AriaAttributes, keyof A11yProps>, A11yProps {
158
+ /** The orbital to summarize.
159
+ * @example {"orbitalName":"OrderOrbital","entityName":"Order","persistence":"persistent","fields":[{"name":"customer","type":"string","required":true,"hasDefault":false},{"name":"qty","type":"number","required":true,"hasDefault":true},{"name":"status","type":"string","required":false,"hasDefault":true}],"traits":[{"name":"OrderFlow","stateCount":5,"eventCount":7,"transitionCount":7,"emits":["ORDER_SAVED"],"listens":["PAYMENT_OK"]}],"pages":[{"name":"Orders","route":"/orders"}],"traitDetails":{"OrderFlow":{"name":"OrderFlow","linkedEntity":"Order","states":[{"name":"browsing","isInitial":true,"isTerminal":false},{"name":"editing","isInitial":false,"isTerminal":false},{"name":"saving","isInitial":false,"isTerminal":false},{"name":"confirmed","isInitial":false,"isTerminal":true},{"name":"failed","isInitial":false,"isTerminal":false}],"transitions":[{"from":"browsing","to":"editing","event":"EDIT","effects":[{"type":"render-ui","args":[]}],"index":0},{"from":"editing","to":"saving","event":"SAVE","effects":[{"type":"persist","args":[]},{"type":"notify","args":[]}],"index":1},{"from":"saving","to":"confirmed","event":"SAVED","effects":[{"type":"emit","args":[]},{"type":"render-ui","args":[]}],"index":2},{"from":"saving","to":"failed","event":"SAVE_FAILED","effects":[{"type":"notify","args":[]}],"index":3},{"from":"failed","to":"editing","event":"RETRY","effects":[],"index":4},{"from":"editing","to":"browsing","event":"CANCEL","effects":[{"type":"render-ui","args":[]}],"index":5},{"from":"confirmed","to":"browsing","event":"DONE","effects":[{"type":"navigate","args":[]}],"index":6}],"emittedEvents":["ORDER_SAVED"],"listenedEvents":["PAYMENT_OK"]}},"externalLinks":[{"targetOrbital":"PaymentOrbital","eventName":"PAYMENT_OK","direction":"in","traitName":"OrderFlow"}]}
160
+ */
161
+ data: AvlNodeData;
162
+ }
163
+ declare const BehaviorView: React__default.FC<BehaviorViewProps>;
164
+
165
+ /**
166
+ * FileTree Molecule
167
+ *
168
+ * A filesystem tree navigator with folder expand/collapse, file-type icons,
169
+ * and click-to-select. Used by the Workspace tab to browse the agent's
170
+ * workspace directory.
171
+ *
172
+ * Follows atomic design: composes Box, Icon, Typography atoms.
173
+ */
174
+
175
+ interface FileTreeNode {
176
+ /** File or directory name */
177
+ name: string;
178
+ /** Relative path from workspace root */
179
+ path: string;
180
+ /** 'file' or 'dir' */
181
+ type: 'file' | 'dir';
182
+ /** A directory's entries — or, on a file, the files derived from it (a `.lolo` source's `.orb`), nested under it. */
183
+ children?: FileTreeNode[];
184
+ /** A short muted note after the name (e.g. "generated"). */
185
+ note?: string;
186
+ /** Has children not loaded yet: shows the toggle, and expanding it calls `onNodeExpand`. */
187
+ expandable?: boolean;
188
+ /** File size in bytes (optional, for display) */
189
+ size?: number;
190
+ /** Detected language for syntax highlighting */
191
+ language?: string;
192
+ }
193
+ /** Flat tree row for `items` mode — nested at render time by `parentId`. */
194
+ interface FileTreeItem {
195
+ /** Unique node id */
196
+ id: string;
197
+ /** Display label */
198
+ label: string;
199
+ /** Id of this node's parent; empty/absent marks a root */
200
+ parentId?: string;
201
+ /** Icon name override (falls back to folder/file by presence of children) */
202
+ icon?: string;
203
+ }
204
+ interface FileTreeProps extends Omit<React__default.AriaAttributes, keyof A11yProps>, A11yProps {
205
+ /** The tree data (pre-nested). Ignored when `items` is provided. */
206
+ tree?: FileTreeNode[];
207
+ /** Flat node list, nested by `parentId` at render time — takes precedence
208
+ * over `tree` when provided. A `parentId` with no matching row renders
209
+ * that node as a root rather than dropping it. */
210
+ items?: FileTreeItem[];
211
+ /** Currently selected file path */
212
+ selectedPath?: string;
213
+ /** Currently selected node id, in flat `items` mode: the row highlights
214
+ * and every ancestor auto-expands so the selection is always visible —
215
+ * the "you are here" a navigation tree needs. */
216
+ selectedId?: string;
217
+ /** Visual treatment for flat `items` mode: `files` (default) keeps the
218
+ * monospace file-browser look; `nav` renders a sidebar navigation tree —
219
+ * regular font, document icons, roomier hit areas. */
220
+ look?: 'files' | 'nav';
221
+ /** Called when a file is clicked */
222
+ onFileSelect?: (path: string) => void;
223
+ /** Called the first time a node marked `expandable` is expanded, with its path, so its children can be loaded. */
224
+ onNodeExpand?: (path: string) => void;
225
+ /** Paths to show expanded (e.g. to reveal a node): each is expanded when it appears here, loading its children if needed. */
226
+ expandedPaths?: readonly string[];
227
+ /** Called when a node is clicked, in flat `items` mode; carries the
228
+ * selected node's id. Presence-gated: binding this prop is what turns on
229
+ * the click-to-select affordance, mirroring Badge's `onRemove`.
230
+ * @offByDefault */
231
+ onNodeSelect?: (id: string) => void;
232
+ /** Called from the row's hover action button, in flat `items` mode;
233
+ * carries that node's id. Presence-gated: binding it renders the action.
234
+ * @offByDefault */
235
+ onNodeAction?: (id: string) => void;
236
+ /** Icon for the row hover action (default: plus). */
237
+ nodeActionIcon?: string;
238
+ /** Accessible label/tooltip for the row hover action. */
239
+ nodeActionLabel?: string;
240
+ /** Called when a row is dropped onto another, in flat `items` mode; carries
241
+ * the moved node's id, its new parent id (`null` for a root drop), and its
242
+ * index within the new parent's children. Presence-gated: binding this
243
+ * prop is what turns on row dragging.
244
+ * @offByDefault */
245
+ onNodeReorder?: (id: string, newParentId: string | null, index: number) => void;
246
+ /** CSS class */
247
+ className?: string;
248
+ /** Indent size per level in px (default: 16) */
249
+ indent?: number;
250
+ }
251
+ declare const FileTree: React__default.FC<FileTreeProps>;
252
+
253
+ export { BehaviorView as B, ModuleCard as M, AvlStateMachine as d, FileTree as g, schemaToFlowGraph as s };
254
+ export type { AvlAnnotations as A, FileTreeItem as F, AvlNodeData as a, AvlNote as b, AvlEdgeData as c, AvlStateMachineProps as e, BehaviorViewProps as f, FileTreeNode as h, FileTreeProps as i, ModuleCardProps as j };