@almadar/ui 1.0.30 → 1.0.32

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 (91) hide show
  1. package/dist/KaTeX_AMS-Regular-CYEKBG2K.woff +0 -0
  2. package/dist/KaTeX_AMS-Regular-JKX5W2C4.ttf +0 -0
  3. package/dist/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
  4. package/dist/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
  5. package/dist/KaTeX_Caligraphic-Bold-WZ3QSGD3.woff +0 -0
  6. package/dist/KaTeX_Caligraphic-Bold-ZTS3R3HK.ttf +0 -0
  7. package/dist/KaTeX_Caligraphic-Regular-3LKEU76G.woff +0 -0
  8. package/dist/KaTeX_Caligraphic-Regular-A7XRTZ5Q.ttf +0 -0
  9. package/dist/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
  10. package/dist/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
  11. package/dist/KaTeX_Fraktur-Bold-T4SWXBMT.woff +0 -0
  12. package/dist/KaTeX_Fraktur-Bold-WGHVTYOR.ttf +0 -0
  13. package/dist/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
  14. package/dist/KaTeX_Fraktur-Regular-5U4OPH2X.ttf +0 -0
  15. package/dist/KaTeX_Fraktur-Regular-PQMHCIK6.woff +0 -0
  16. package/dist/KaTeX_Main-Bold-2GA4IZIN.woff +0 -0
  17. package/dist/KaTeX_Main-Bold-W5FBVCZM.ttf +0 -0
  18. package/dist/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
  19. package/dist/KaTeX_Main-BoldItalic-4P4C7HJH.woff +0 -0
  20. package/dist/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
  21. package/dist/KaTeX_Main-BoldItalic-ODMLBJJQ.ttf +0 -0
  22. package/dist/KaTeX_Main-Italic-I43T2HSR.ttf +0 -0
  23. package/dist/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
  24. package/dist/KaTeX_Main-Italic-SASNQFN2.woff +0 -0
  25. package/dist/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
  26. package/dist/KaTeX_Main-Regular-P5I74A2A.woff +0 -0
  27. package/dist/KaTeX_Main-Regular-W74P5G27.ttf +0 -0
  28. package/dist/KaTeX_Math-BoldItalic-6EBV3DK5.woff +0 -0
  29. package/dist/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
  30. package/dist/KaTeX_Math-BoldItalic-VB447A4D.ttf +0 -0
  31. package/dist/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
  32. package/dist/KaTeX_Math-Italic-KKK3USB2.woff +0 -0
  33. package/dist/KaTeX_Math-Italic-SON4MRCA.ttf +0 -0
  34. package/dist/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
  35. package/dist/KaTeX_SansSerif-Bold-STQ6RXC7.ttf +0 -0
  36. package/dist/KaTeX_SansSerif-Bold-X5M5EMOD.woff +0 -0
  37. package/dist/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
  38. package/dist/KaTeX_SansSerif-Italic-PSN4QKYX.woff +0 -0
  39. package/dist/KaTeX_SansSerif-Italic-WTBAZBGY.ttf +0 -0
  40. package/dist/KaTeX_SansSerif-Regular-2TL3USAE.ttf +0 -0
  41. package/dist/KaTeX_SansSerif-Regular-OQCII6EP.woff +0 -0
  42. package/dist/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
  43. package/dist/KaTeX_Script-Regular-72OLXYNA.ttf +0 -0
  44. package/dist/KaTeX_Script-Regular-A5IFOEBS.woff +0 -0
  45. package/dist/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
  46. package/dist/KaTeX_Size1-Regular-4HRHTS65.woff +0 -0
  47. package/dist/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
  48. package/dist/KaTeX_Size1-Regular-7K6AASVL.ttf +0 -0
  49. package/dist/KaTeX_Size2-Regular-222HN3GT.ttf +0 -0
  50. package/dist/KaTeX_Size2-Regular-K5ZHAIS6.woff +0 -0
  51. package/dist/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
  52. package/dist/KaTeX_Size3-Regular-TLFPAHDE.woff +0 -0
  53. package/dist/KaTeX_Size3-Regular-UFCO6WCA.ttf +0 -0
  54. package/dist/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
  55. package/dist/KaTeX_Size4-Regular-7PGNVPQK.ttf +0 -0
  56. package/dist/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
  57. package/dist/KaTeX_Size4-Regular-PKMWZHNC.woff +0 -0
  58. package/dist/KaTeX_Typewriter-Regular-3F5K6SQ6.ttf +0 -0
  59. package/dist/KaTeX_Typewriter-Regular-MJMFSK64.woff +0 -0
  60. package/dist/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
  61. package/dist/{ThemeContext-lI5bo85E.d.ts → ThemeContext-D9xUORq5.d.ts} +2 -0
  62. package/dist/chunk-45CTDYBT.js +174 -0
  63. package/dist/{chunk-4UFNDD6B.js → chunk-BTXQJGFB.js} +41 -8
  64. package/dist/chunk-N6DJVKZ6.js +747 -0
  65. package/dist/chunk-PE2H3NAW.js +383 -0
  66. package/dist/{chunk-7IYF4RUG.js → chunk-RFD6G3ZR.js} +23 -68
  67. package/dist/chunk-UCXZS2YJ.js +9501 -0
  68. package/dist/chunk-YXZM3WCF.js +222 -0
  69. package/dist/cn-BoBXsxuX.d.ts +194 -0
  70. package/dist/components/index.css +1154 -0
  71. package/dist/components/index.d.ts +1082 -673
  72. package/dist/components/index.js +8935 -16486
  73. package/dist/components/organisms/game/three/index.css +315 -0
  74. package/dist/components/organisms/game/three/index.d.ts +1162 -0
  75. package/dist/components/organisms/game/three/index.js +2378 -0
  76. package/dist/context/index.d.ts +4 -4
  77. package/dist/context/index.js +2 -3
  78. package/dist/{event-bus-types-8-cjyMxw.d.ts → event-bus-types-CjJduURa.d.ts} +8 -0
  79. package/dist/hooks/index.d.ts +120 -106
  80. package/dist/hooks/index.js +4 -3
  81. package/dist/isometric-ynNHVPZx.d.ts +111 -0
  82. package/dist/lib/index.d.ts +117 -153
  83. package/dist/lib/index.js +4 -683
  84. package/dist/providers/index.css +1154 -0
  85. package/dist/providers/index.d.ts +84 -4
  86. package/dist/providers/index.js +165 -8
  87. package/dist/{useUISlots-mnggE9X9.d.ts → useUISlots-D0mttBSP.d.ts} +0 -20
  88. package/package.json +32 -11
  89. package/dist/chunk-HY5EFCOK.js +0 -419
  90. package/dist/chunk-W5YTXLXL.js +0 -29
  91. package/dist/cn-mqkxz8Sd.d.ts +0 -9
@@ -56,6 +56,8 @@ interface ThemeProviderProps {
56
56
  defaultTheme?: string;
57
57
  /** Default color mode */
58
58
  defaultMode?: ColorMode;
59
+ /** Optional target element ref — when provided, theme attributes are applied to this element instead of document.documentElement */
60
+ targetRef?: React__default.RefObject<HTMLElement>;
59
61
  }
60
62
  /**
61
63
  * Unified ThemeProvider component
@@ -0,0 +1,174 @@
1
+ // lib/verificationRegistry.ts
2
+ var checks = /* @__PURE__ */ new Map();
3
+ var transitions = [];
4
+ var bridgeHealth = null;
5
+ var MAX_TRANSITIONS = 500;
6
+ var listeners = /* @__PURE__ */ new Set();
7
+ function notifyListeners() {
8
+ listeners.forEach((l) => l());
9
+ exposeOnWindow();
10
+ }
11
+ function registerCheck(id, label, status = "pending", details) {
12
+ checks.set(id, { id, label, status, details, updatedAt: Date.now() });
13
+ notifyListeners();
14
+ }
15
+ function updateCheck(id, status, details) {
16
+ const check = checks.get(id);
17
+ if (check) {
18
+ check.status = status;
19
+ if (details !== void 0) check.details = details;
20
+ check.updatedAt = Date.now();
21
+ } else {
22
+ checks.set(id, { id, label: id, status, details, updatedAt: Date.now() });
23
+ }
24
+ notifyListeners();
25
+ }
26
+ function getAllChecks() {
27
+ return Array.from(checks.values());
28
+ }
29
+ function recordTransition(trace) {
30
+ const entry = {
31
+ ...trace,
32
+ id: `t-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`
33
+ };
34
+ transitions.push(entry);
35
+ if (transitions.length > MAX_TRANSITIONS) {
36
+ transitions.shift();
37
+ }
38
+ if (entry.event === "INIT") {
39
+ const hasFetch = entry.effects.some((e) => e.type === "fetch");
40
+ const checkId = `init-fetch-${entry.traitName}`;
41
+ if (hasFetch) {
42
+ registerCheck(
43
+ checkId,
44
+ `INIT transition for "${entry.traitName}" has fetch effect`,
45
+ "pass"
46
+ );
47
+ } else {
48
+ const hasRenderUI = entry.effects.some((e) => e.type === "render-ui");
49
+ if (hasRenderUI) {
50
+ registerCheck(
51
+ checkId,
52
+ `INIT transition for "${entry.traitName}" missing fetch effect`,
53
+ "fail",
54
+ "Entity-bound render-ui without a fetch effect will show empty data"
55
+ );
56
+ }
57
+ }
58
+ }
59
+ const failedEffects = entry.effects.filter((e) => e.status === "failed");
60
+ if (failedEffects.length > 0) {
61
+ registerCheck(
62
+ `effects-${entry.id}`,
63
+ `Effects failed in ${entry.traitName}: ${entry.from} -> ${entry.to}`,
64
+ "fail",
65
+ failedEffects.map((e) => `${e.type}: ${e.error}`).join("; ")
66
+ );
67
+ }
68
+ notifyListeners();
69
+ }
70
+ function getTransitions() {
71
+ return [...transitions];
72
+ }
73
+ function getTransitionsForTrait(traitName) {
74
+ return transitions.filter((t) => t.traitName === traitName);
75
+ }
76
+ function updateBridgeHealth(health) {
77
+ bridgeHealth = { ...health };
78
+ const checkId = "server-bridge";
79
+ if (health.connected) {
80
+ registerCheck(checkId, "Server bridge connected", "pass");
81
+ } else {
82
+ registerCheck(
83
+ checkId,
84
+ "Server bridge disconnected",
85
+ "fail",
86
+ health.lastError || "Bridge is not connected"
87
+ );
88
+ }
89
+ notifyListeners();
90
+ }
91
+ function getBridgeHealth() {
92
+ return bridgeHealth ? { ...bridgeHealth } : null;
93
+ }
94
+ function getSummary() {
95
+ const allChecks = getAllChecks();
96
+ return {
97
+ totalChecks: allChecks.length,
98
+ passed: allChecks.filter((c) => c.status === "pass").length,
99
+ failed: allChecks.filter((c) => c.status === "fail").length,
100
+ warnings: allChecks.filter((c) => c.status === "warn").length,
101
+ pending: allChecks.filter((c) => c.status === "pending").length
102
+ };
103
+ }
104
+ function getSnapshot() {
105
+ return {
106
+ checks: getAllChecks(),
107
+ transitions: getTransitions(),
108
+ bridge: getBridgeHealth(),
109
+ summary: getSummary()
110
+ };
111
+ }
112
+ function subscribeToVerification(listener) {
113
+ listeners.add(listener);
114
+ return () => listeners.delete(listener);
115
+ }
116
+ function exposeOnWindow() {
117
+ if (typeof window === "undefined") return;
118
+ if (!window.__orbitalVerification) {
119
+ window.__orbitalVerification = {
120
+ getSnapshot,
121
+ getChecks: getAllChecks,
122
+ getTransitions,
123
+ getBridge: getBridgeHealth,
124
+ getSummary,
125
+ waitForTransition
126
+ };
127
+ }
128
+ }
129
+ function waitForTransition(event, timeoutMs = 1e4) {
130
+ return new Promise((resolve) => {
131
+ const existing = transitions.find((t) => t.event === event);
132
+ if (existing) {
133
+ resolve(existing);
134
+ return;
135
+ }
136
+ const timeout = setTimeout(() => {
137
+ unsub();
138
+ resolve(null);
139
+ }, timeoutMs);
140
+ const unsub = subscribeToVerification(() => {
141
+ const found = transitions.find((t) => t.event === event);
142
+ if (found) {
143
+ clearTimeout(timeout);
144
+ unsub();
145
+ resolve(found);
146
+ }
147
+ });
148
+ });
149
+ }
150
+ function bindEventBus(eventBus) {
151
+ if (typeof window === "undefined") return;
152
+ exposeOnWindow();
153
+ if (window.__orbitalVerification) {
154
+ window.__orbitalVerification.sendEvent = (event, payload) => {
155
+ eventBus.emit(event, payload);
156
+ };
157
+ }
158
+ }
159
+ function bindTraitStateGetter(getter) {
160
+ if (typeof window === "undefined") return;
161
+ exposeOnWindow();
162
+ if (window.__orbitalVerification) {
163
+ window.__orbitalVerification.getTraitState = getter;
164
+ }
165
+ }
166
+ function clearVerification() {
167
+ checks.clear();
168
+ transitions.length = 0;
169
+ bridgeHealth = null;
170
+ notifyListeners();
171
+ }
172
+ exposeOnWindow();
173
+
174
+ export { bindEventBus, bindTraitStateGetter, clearVerification, getAllChecks, getBridgeHealth, getSnapshot, getSummary, getTransitions, getTransitionsForTrait, recordTransition, registerCheck, subscribeToVerification, updateBridgeHealth, updateCheck, waitForTransition };
@@ -1,7 +1,7 @@
1
+ import { useUISlotManager } from './chunk-7NEWMNNU.js';
1
2
  import { createContext, useMemo, useState, useEffect, useCallback, useContext } from 'react';
2
3
  import { jsx } from 'react/jsx-runtime';
3
4
 
4
- // context/ThemeContext.tsx
5
5
  var BUILT_IN_THEMES = [
6
6
  {
7
7
  name: "wireframe",
@@ -118,7 +118,8 @@ var ThemeProvider = ({
118
118
  children,
119
119
  themes = [],
120
120
  defaultTheme = "wireframe",
121
- defaultMode = "system"
121
+ defaultMode = "system",
122
+ targetRef
122
123
  }) => {
123
124
  const availableThemes = useMemo(() => {
124
125
  const themeMap = /* @__PURE__ */ new Map();
@@ -126,8 +127,9 @@ var ThemeProvider = ({
126
127
  themes.forEach((t) => themeMap.set(t.name, t));
127
128
  return Array.from(themeMap.values());
128
129
  }, [themes]);
130
+ const isScoped = !!targetRef;
129
131
  const [theme, setThemeState] = useState(() => {
130
- if (typeof window === "undefined") return defaultTheme;
132
+ if (isScoped || typeof window === "undefined") return defaultTheme;
131
133
  const stored = localStorage.getItem(THEME_STORAGE_KEY);
132
134
  const validThemes = [
133
135
  ...BUILT_IN_THEMES.map((t) => t.name),
@@ -139,7 +141,7 @@ var ThemeProvider = ({
139
141
  return defaultTheme;
140
142
  });
141
143
  const [mode, setModeState] = useState(() => {
142
- if (typeof window === "undefined") return defaultMode;
144
+ if (isScoped || typeof window === "undefined") return defaultMode;
143
145
  const stored = localStorage.getItem(MODE_STORAGE_KEY);
144
146
  if (stored === "light" || stored === "dark" || stored === "system") {
145
147
  return stored;
@@ -167,17 +169,25 @@ var ThemeProvider = ({
167
169
  return void 0;
168
170
  }, [mode]);
169
171
  useEffect(() => {
172
+ if (isScoped) {
173
+ if (targetRef?.current) {
174
+ targetRef.current.setAttribute("data-theme", appliedTheme);
175
+ targetRef.current.classList.remove("light", "dark");
176
+ targetRef.current.classList.add(resolvedMode);
177
+ }
178
+ return;
179
+ }
170
180
  const root = document.documentElement;
171
181
  root.setAttribute("data-theme", appliedTheme);
172
182
  root.classList.remove("light", "dark");
173
183
  root.classList.add(resolvedMode);
174
- }, [appliedTheme, resolvedMode]);
184
+ }, [appliedTheme, resolvedMode, targetRef, isScoped]);
175
185
  const setTheme = useCallback(
176
186
  (newTheme) => {
177
187
  const validTheme = availableThemes.find((t) => t.name === newTheme);
178
188
  if (validTheme) {
179
189
  setThemeState(newTheme);
180
- if (typeof window !== "undefined") {
190
+ if (!isScoped && typeof window !== "undefined") {
181
191
  localStorage.setItem(THEME_STORAGE_KEY, newTheme);
182
192
  }
183
193
  } else {
@@ -190,7 +200,7 @@ var ThemeProvider = ({
190
200
  );
191
201
  const setMode = useCallback((newMode) => {
192
202
  setModeState(newMode);
193
- if (typeof window !== "undefined") {
203
+ if (!isScoped && typeof window !== "undefined") {
194
204
  localStorage.setItem(MODE_STORAGE_KEY, newMode);
195
205
  }
196
206
  }, []);
@@ -242,5 +252,28 @@ function useTheme() {
242
252
  return context;
243
253
  }
244
254
  var ThemeContext_default = ThemeContext;
255
+ var UISlotContext = createContext(null);
256
+ function UISlotProvider({ children }) {
257
+ const slotManager = useUISlotManager();
258
+ const contextValue = useMemo(() => slotManager, [slotManager]);
259
+ return /* @__PURE__ */ jsx(UISlotContext.Provider, { value: contextValue, children });
260
+ }
261
+ function useUISlots() {
262
+ const context = useContext(UISlotContext);
263
+ if (!context) {
264
+ throw new Error(
265
+ "useUISlots must be used within a UISlotProvider. Make sure your component tree is wrapped with <UISlotProvider>."
266
+ );
267
+ }
268
+ return context;
269
+ }
270
+ function useSlotContent(slot) {
271
+ const { getContent } = useUISlots();
272
+ return getContent(slot);
273
+ }
274
+ function useSlotHasContent(slot) {
275
+ const { hasContent } = useUISlots();
276
+ return hasContent(slot);
277
+ }
245
278
 
246
- export { BUILT_IN_THEMES, ThemeContext_default, ThemeProvider, useTheme };
279
+ export { BUILT_IN_THEMES, ThemeContext_default, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots };