@almadar/ui 1.0.31 → 1.0.33

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 (90) 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/chunk-45CTDYBT.js +174 -0
  62. package/dist/{chunk-WRL6TBOL.js → chunk-BKC4XU44.js} +22 -90
  63. package/dist/{chunk-LRI6C6UI.js → chunk-BTXQJGFB.js} +25 -2
  64. package/dist/chunk-FZJ73RDM.js +9501 -0
  65. package/dist/chunk-N6DJVKZ6.js +747 -0
  66. package/dist/chunk-PE2H3NAW.js +383 -0
  67. package/dist/{chunk-RUGU4MSK.js → chunk-YXZM3WCF.js} +37 -1
  68. package/dist/cn-BoBXsxuX.d.ts +194 -0
  69. package/dist/components/index.css +1154 -0
  70. package/dist/components/index.d.ts +804 -329
  71. package/dist/components/index.js +8095 -15387
  72. package/dist/components/organisms/game/three/index.d.ts +0 -107
  73. package/dist/components/organisms/game/three/index.js +1 -1
  74. package/dist/context/index.d.ts +2 -2
  75. package/dist/context/index.js +2 -3
  76. package/dist/{event-bus-types-8-cjyMxw.d.ts → event-bus-types-CjJduURa.d.ts} +8 -0
  77. package/dist/hooks/index.d.ts +83 -120
  78. package/dist/hooks/index.js +4 -4
  79. package/dist/lib/index.d.ts +117 -153
  80. package/dist/lib/index.js +4 -683
  81. package/dist/locales/index.d.ts +22 -0
  82. package/dist/locales/index.js +334 -0
  83. package/dist/providers/index.css +1154 -0
  84. package/dist/providers/index.d.ts +79 -3
  85. package/dist/providers/index.js +158 -10
  86. package/dist/{useUISlots-mnggE9X9.d.ts → useUISlots-D0mttBSP.d.ts} +0 -20
  87. package/package.json +23 -10
  88. package/dist/chunk-VLWZZA6A.js +0 -239
  89. package/dist/chunk-W5YTXLXL.js +0 -29
  90. package/dist/cn-mqkxz8Sd.d.ts +0 -9
@@ -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,8 +1,8 @@
1
1
  import { apiClient } from './chunk-XSEDIUM6.js';
2
- import { SelectionContext, entityDataKeys } from './chunk-VLWZZA6A.js';
2
+ import { SelectionContext, entityDataKeys, useEntityList } from './chunk-PE2H3NAW.js';
3
+ import { useEventBus } from './chunk-YXZM3WCF.js';
3
4
  import { subscribe, getSnapshot, clearEntities, removeEntity, updateSingleton, updateEntity, spawnEntity, getSingleton, getAllEntities, getByType, getEntity } from './chunk-N7MVUW4R.js';
4
- import { useEventBus } from './chunk-RUGU4MSK.js';
5
- import { createContext, useCallback, useState, useEffect, useMemo, useContext, useSyncExternalStore } from 'react';
5
+ import { useCallback, useState, useEffect, useMemo, useContext, useSyncExternalStore } from 'react';
6
6
  import { useQueryClient, useMutation, useQuery } from '@tanstack/react-query';
7
7
 
8
8
  function useOrbitalHistory(options) {
@@ -988,72 +988,6 @@ function useSelectionContext() {
988
988
  const context = useContext(SelectionContext);
989
989
  return context;
990
990
  }
991
- var queryStores = /* @__PURE__ */ new Map();
992
- function getOrCreateStore(query) {
993
- if (!queryStores.has(query)) {
994
- queryStores.set(query, {
995
- search: "",
996
- filters: {},
997
- sortField: void 0,
998
- sortDirection: void 0,
999
- listeners: /* @__PURE__ */ new Set()
1000
- });
1001
- }
1002
- return queryStores.get(query);
1003
- }
1004
- function useQuerySingleton(query) {
1005
- const [, forceUpdate] = useState({});
1006
- if (!query) {
1007
- return null;
1008
- }
1009
- const store = useMemo(() => getOrCreateStore(query), [query]);
1010
- useMemo(() => {
1011
- const listener = () => forceUpdate({});
1012
- store.listeners.add(listener);
1013
- return () => {
1014
- store.listeners.delete(listener);
1015
- };
1016
- }, [store]);
1017
- const notifyListeners = useCallback(() => {
1018
- store.listeners.forEach((listener) => listener());
1019
- }, [store]);
1020
- const setSearch = useCallback((value) => {
1021
- store.search = value;
1022
- notifyListeners();
1023
- }, [store, notifyListeners]);
1024
- const setFilter = useCallback((key, value) => {
1025
- store.filters = { ...store.filters, [key]: value };
1026
- notifyListeners();
1027
- }, [store, notifyListeners]);
1028
- const clearFilters = useCallback(() => {
1029
- store.filters = {};
1030
- store.search = "";
1031
- notifyListeners();
1032
- }, [store, notifyListeners]);
1033
- const setSort = useCallback((field, direction) => {
1034
- store.sortField = field;
1035
- store.sortDirection = direction;
1036
- notifyListeners();
1037
- }, [store, notifyListeners]);
1038
- return {
1039
- search: store.search,
1040
- setSearch,
1041
- filters: store.filters,
1042
- setFilter,
1043
- clearFilters,
1044
- sortField: store.sortField,
1045
- sortDirection: store.sortDirection,
1046
- setSort
1047
- };
1048
- }
1049
- function parseQueryBinding(binding) {
1050
- const cleaned = binding.startsWith("@") ? binding.slice(1) : binding;
1051
- const parts = cleaned.split(".");
1052
- return {
1053
- query: parts[0],
1054
- field: parts.length > 1 ? parts.slice(1).join(".") : void 0
1055
- };
1056
- }
1057
991
  var ENTITY_EVENTS = {
1058
992
  CREATE: "ENTITY_CREATE",
1059
993
  UPDATE: "ENTITY_UPDATE",
@@ -1389,27 +1323,25 @@ function useInput() {
1389
1323
  }, [input?.id]);
1390
1324
  return { input, updateInput: update };
1391
1325
  }
1392
- var I18nContext = createContext({
1393
- locale: "en",
1394
- direction: "ltr",
1395
- t: (key) => key
1396
- // passthrough fallback
1397
- });
1398
- I18nContext.displayName = "I18nContext";
1399
- var I18nProvider = I18nContext.Provider;
1400
- function useTranslate() {
1401
- return useContext(I18nContext);
1402
- }
1403
- function createTranslate(messages) {
1404
- return (key, params) => {
1405
- let msg = messages[key] ?? key;
1406
- if (params) {
1407
- for (const [k, v] of Object.entries(params)) {
1408
- msg = msg.split(`{{${k}}}`).join(String(v));
1409
- }
1326
+ function useResolvedEntity(entity, data) {
1327
+ const shouldFetch = !data && !!entity;
1328
+ const fetched = useEntityList(entity, { skip: !shouldFetch });
1329
+ return useMemo(() => {
1330
+ if (data) {
1331
+ return {
1332
+ data,
1333
+ isLocal: true,
1334
+ isLoading: false,
1335
+ error: null
1336
+ };
1410
1337
  }
1411
- return msg;
1412
- };
1338
+ return {
1339
+ data: fetched.data,
1340
+ isLocal: false,
1341
+ isLoading: fetched.isLoading,
1342
+ error: fetched.error
1343
+ };
1344
+ }, [data, fetched.data, fetched.isLoading, fetched.error]);
1413
1345
  }
1414
1346
 
1415
1347
  // hooks/useAuthContext.ts
@@ -1497,4 +1429,4 @@ function useGitHubBranches(owner, repo, enabled = true) {
1497
1429
  });
1498
1430
  }
1499
1431
 
1500
- export { ENTITY_EVENTS, I18nProvider, createTranslate, parseQueryBinding, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useQuerySingleton, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useTranslate, useUIEvents, useUpdateEntity, useValidation };
1432
+ export { ENTITY_EVENTS, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation };
@@ -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",
@@ -252,5 +252,28 @@ function useTheme() {
252
252
  return context;
253
253
  }
254
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
+ }
255
278
 
256
- export { BUILT_IN_THEMES, ThemeContext_default, ThemeProvider, useTheme };
279
+ export { BUILT_IN_THEMES, ThemeContext_default, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots };