@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.
- package/dist/KaTeX_AMS-Regular-CYEKBG2K.woff +0 -0
- package/dist/KaTeX_AMS-Regular-JKX5W2C4.ttf +0 -0
- package/dist/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
- package/dist/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
- package/dist/KaTeX_Caligraphic-Bold-WZ3QSGD3.woff +0 -0
- package/dist/KaTeX_Caligraphic-Bold-ZTS3R3HK.ttf +0 -0
- package/dist/KaTeX_Caligraphic-Regular-3LKEU76G.woff +0 -0
- package/dist/KaTeX_Caligraphic-Regular-A7XRTZ5Q.ttf +0 -0
- package/dist/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Bold-T4SWXBMT.woff +0 -0
- package/dist/KaTeX_Fraktur-Bold-WGHVTYOR.ttf +0 -0
- package/dist/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Regular-5U4OPH2X.ttf +0 -0
- package/dist/KaTeX_Fraktur-Regular-PQMHCIK6.woff +0 -0
- package/dist/KaTeX_Main-Bold-2GA4IZIN.woff +0 -0
- package/dist/KaTeX_Main-Bold-W5FBVCZM.ttf +0 -0
- package/dist/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
- package/dist/KaTeX_Main-BoldItalic-4P4C7HJH.woff +0 -0
- package/dist/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
- package/dist/KaTeX_Main-BoldItalic-ODMLBJJQ.ttf +0 -0
- package/dist/KaTeX_Main-Italic-I43T2HSR.ttf +0 -0
- package/dist/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
- package/dist/KaTeX_Main-Italic-SASNQFN2.woff +0 -0
- package/dist/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
- package/dist/KaTeX_Main-Regular-P5I74A2A.woff +0 -0
- package/dist/KaTeX_Main-Regular-W74P5G27.ttf +0 -0
- package/dist/KaTeX_Math-BoldItalic-6EBV3DK5.woff +0 -0
- package/dist/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
- package/dist/KaTeX_Math-BoldItalic-VB447A4D.ttf +0 -0
- package/dist/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
- package/dist/KaTeX_Math-Italic-KKK3USB2.woff +0 -0
- package/dist/KaTeX_Math-Italic-SON4MRCA.ttf +0 -0
- package/dist/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
- package/dist/KaTeX_SansSerif-Bold-STQ6RXC7.ttf +0 -0
- package/dist/KaTeX_SansSerif-Bold-X5M5EMOD.woff +0 -0
- package/dist/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
- package/dist/KaTeX_SansSerif-Italic-PSN4QKYX.woff +0 -0
- package/dist/KaTeX_SansSerif-Italic-WTBAZBGY.ttf +0 -0
- package/dist/KaTeX_SansSerif-Regular-2TL3USAE.ttf +0 -0
- package/dist/KaTeX_SansSerif-Regular-OQCII6EP.woff +0 -0
- package/dist/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
- package/dist/KaTeX_Script-Regular-72OLXYNA.ttf +0 -0
- package/dist/KaTeX_Script-Regular-A5IFOEBS.woff +0 -0
- package/dist/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
- package/dist/KaTeX_Size1-Regular-4HRHTS65.woff +0 -0
- package/dist/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
- package/dist/KaTeX_Size1-Regular-7K6AASVL.ttf +0 -0
- package/dist/KaTeX_Size2-Regular-222HN3GT.ttf +0 -0
- package/dist/KaTeX_Size2-Regular-K5ZHAIS6.woff +0 -0
- package/dist/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
- package/dist/KaTeX_Size3-Regular-TLFPAHDE.woff +0 -0
- package/dist/KaTeX_Size3-Regular-UFCO6WCA.ttf +0 -0
- package/dist/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
- package/dist/KaTeX_Size4-Regular-7PGNVPQK.ttf +0 -0
- package/dist/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
- package/dist/KaTeX_Size4-Regular-PKMWZHNC.woff +0 -0
- package/dist/KaTeX_Typewriter-Regular-3F5K6SQ6.ttf +0 -0
- package/dist/KaTeX_Typewriter-Regular-MJMFSK64.woff +0 -0
- package/dist/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
- package/dist/{ThemeContext-lI5bo85E.d.ts → ThemeContext-D9xUORq5.d.ts} +2 -0
- package/dist/chunk-45CTDYBT.js +174 -0
- package/dist/{chunk-4UFNDD6B.js → chunk-BTXQJGFB.js} +41 -8
- package/dist/chunk-N6DJVKZ6.js +747 -0
- package/dist/chunk-PE2H3NAW.js +383 -0
- package/dist/{chunk-7IYF4RUG.js → chunk-RFD6G3ZR.js} +23 -68
- package/dist/chunk-UCXZS2YJ.js +9501 -0
- package/dist/chunk-YXZM3WCF.js +222 -0
- package/dist/cn-BoBXsxuX.d.ts +194 -0
- package/dist/components/index.css +1154 -0
- package/dist/components/index.d.ts +1082 -673
- package/dist/components/index.js +8935 -16486
- package/dist/components/organisms/game/three/index.css +315 -0
- package/dist/components/organisms/game/three/index.d.ts +1162 -0
- package/dist/components/organisms/game/three/index.js +2378 -0
- package/dist/context/index.d.ts +4 -4
- package/dist/context/index.js +2 -3
- package/dist/{event-bus-types-8-cjyMxw.d.ts → event-bus-types-CjJduURa.d.ts} +8 -0
- package/dist/hooks/index.d.ts +120 -106
- package/dist/hooks/index.js +4 -3
- package/dist/isometric-ynNHVPZx.d.ts +111 -0
- package/dist/lib/index.d.ts +117 -153
- package/dist/lib/index.js +4 -683
- package/dist/providers/index.css +1154 -0
- package/dist/providers/index.d.ts +84 -4
- package/dist/providers/index.js +165 -8
- package/dist/{useUISlots-mnggE9X9.d.ts → useUISlots-D0mttBSP.d.ts} +0 -20
- package/package.json +32 -11
- package/dist/chunk-HY5EFCOK.js +0 -419
- package/dist/chunk-W5YTXLXL.js +0 -29
- package/dist/cn-mqkxz8Sd.d.ts +0 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { ReactNode } from 'react';
|
|
2
|
-
import { b as ThemeDefinition } from '../ThemeContext-
|
|
2
|
+
import { b as ThemeDefinition } from '../ThemeContext-D9xUORq5.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import { E as EventBusContextType } from '../event-bus-types-
|
|
4
|
+
import { E as EventBusContextType } from '../event-bus-types-CjJduURa.js';
|
|
5
5
|
import { U as UseOfflineExecutorResult, a as UseOfflineExecutorOptions } from '../offline-executor-CHr4uAhf.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -247,10 +247,27 @@ interface OrbitalProviderProps {
|
|
|
247
247
|
defaultTheme?: string;
|
|
248
248
|
/** Default color mode */
|
|
249
249
|
defaultMode?: 'light' | 'dark' | 'system';
|
|
250
|
+
/** Optional target element ref for scoped theme application */
|
|
251
|
+
targetRef?: React__default.RefObject<HTMLElement>;
|
|
252
|
+
/** Skip ThemeProvider (use when already inside a themed container like shadow DOM) */
|
|
253
|
+
skipTheme?: boolean;
|
|
250
254
|
/** Enable debug logging for all providers */
|
|
251
255
|
debug?: boolean;
|
|
252
256
|
/** Initial fetched data */
|
|
253
257
|
initialData?: Record<string, unknown[]>;
|
|
258
|
+
/**
|
|
259
|
+
* Enable Suspense mode. When true, UISlotRenderer wraps each slot in
|
|
260
|
+
* `<ErrorBoundary><Suspense>` with Skeleton fallbacks.
|
|
261
|
+
* Opt-in — existing isLoading prop pattern still works when false/absent.
|
|
262
|
+
*/
|
|
263
|
+
suspense?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Enable verification wiring for visual testing.
|
|
266
|
+
* When true, lifecycle events are recorded and exposed via
|
|
267
|
+
* `window.__orbitalVerification` for Playwright/automation.
|
|
268
|
+
* Default: true in development, false in production.
|
|
269
|
+
*/
|
|
270
|
+
verification?: boolean;
|
|
254
271
|
}
|
|
255
272
|
/**
|
|
256
273
|
* OrbitalProvider - Unified context provider for Orbital applications
|
|
@@ -299,11 +316,74 @@ interface OrbitalProviderProps {
|
|
|
299
316
|
* }
|
|
300
317
|
* ```
|
|
301
318
|
*/
|
|
302
|
-
declare function OrbitalProvider({ children, themes, defaultTheme, defaultMode, debug, initialData, }: OrbitalProviderProps): React__default.ReactElement;
|
|
319
|
+
declare function OrbitalProvider({ children, themes, defaultTheme, defaultMode, targetRef, skipTheme, debug, initialData, suspense, verification, }: OrbitalProviderProps): React__default.ReactElement;
|
|
303
320
|
declare namespace OrbitalProvider {
|
|
304
321
|
var displayName: string;
|
|
305
322
|
}
|
|
306
323
|
|
|
324
|
+
/**
|
|
325
|
+
* VerificationProvider
|
|
326
|
+
*
|
|
327
|
+
* Wires the verification registry to both compiled and runtime execution paths.
|
|
328
|
+
*
|
|
329
|
+
* **Compiled apps**: Intercepts event bus lifecycle events
|
|
330
|
+
* (`{traitName}:DISPATCH`, `{traitName}:{event}:SUCCESS`, `{traitName}:{event}:ERROR`)
|
|
331
|
+
* emitted by `useOrbitalBridge` and records transitions via `recordTransition()`.
|
|
332
|
+
*
|
|
333
|
+
* **Runtime apps**: Accepts an optional `StateMachineManager` and wires its
|
|
334
|
+
* `TransitionObserver` to `recordTransition()`.
|
|
335
|
+
*
|
|
336
|
+
* **Both**: Calls `bindEventBus()` and `bindTraitStateGetter()` to populate
|
|
337
|
+
* `window.__orbitalVerification` for Playwright/automation.
|
|
338
|
+
*
|
|
339
|
+
* @packageDocumentation
|
|
340
|
+
*/
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Observer interface compatible with `StateMachineManager.setObserver()`.
|
|
344
|
+
* Defined locally to avoid hard dependency on `@almadar/runtime`.
|
|
345
|
+
*/
|
|
346
|
+
interface TransitionObserver {
|
|
347
|
+
onTransition(trace: {
|
|
348
|
+
traitName: string;
|
|
349
|
+
from: string;
|
|
350
|
+
to: string;
|
|
351
|
+
event: string;
|
|
352
|
+
guardResult?: boolean;
|
|
353
|
+
effects: Array<{
|
|
354
|
+
type: string;
|
|
355
|
+
args: unknown[];
|
|
356
|
+
status: 'executed' | 'failed' | 'skipped';
|
|
357
|
+
error?: string;
|
|
358
|
+
durationMs?: number;
|
|
359
|
+
}>;
|
|
360
|
+
}): void;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Minimal interface for StateMachineManager — avoids importing the full runtime.
|
|
364
|
+
*/
|
|
365
|
+
interface StateMachineManagerLike {
|
|
366
|
+
setObserver(observer: TransitionObserver): void;
|
|
367
|
+
getState?(traitName: string): string | undefined;
|
|
368
|
+
}
|
|
369
|
+
interface VerificationProviderProps {
|
|
370
|
+
children: ReactNode;
|
|
371
|
+
/** Enable verification wiring (default: true in dev, false in prod) */
|
|
372
|
+
enabled?: boolean;
|
|
373
|
+
/** Optional runtime StateMachineManager for interpreted mode */
|
|
374
|
+
runtimeManager?: StateMachineManagerLike;
|
|
375
|
+
/** Optional trait state getter for compiled apps (maps traitName → currentState) */
|
|
376
|
+
traitStateGetter?: (traitName: string) => string | undefined;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* VerificationProvider — wires the verification registry to the event bus
|
|
380
|
+
* and optional runtime manager. Renders children unchanged.
|
|
381
|
+
*/
|
|
382
|
+
declare function VerificationProvider({ children, enabled, runtimeManager, traitStateGetter, }: VerificationProviderProps): React__default.ReactElement;
|
|
383
|
+
declare namespace VerificationProvider {
|
|
384
|
+
var displayName: string;
|
|
385
|
+
}
|
|
386
|
+
|
|
307
387
|
/**
|
|
308
388
|
* OfflineModeProvider
|
|
309
389
|
*
|
|
@@ -382,4 +462,4 @@ declare function useOfflineMode(): OfflineModeContextValue;
|
|
|
382
462
|
*/
|
|
383
463
|
declare function useOptionalOfflineMode(): OfflineModeContextValue | null;
|
|
384
464
|
|
|
385
|
-
export { type EntityRecord, EventBusContext, EventBusProvider, FetchedDataContext, type FetchedDataContextValue, FetchedDataProvider, type FetchedDataProviderProps, type FetchedDataState, type OfflineModeContextValue, OfflineModeProvider, type OfflineModeProviderProps, OrbitalProvider, type OrbitalProviderProps, SelectionContext, type SelectionContextType, SelectionProvider, ThemeDefinition, useFetchedData, useFetchedDataContext, useFetchedEntity, useOfflineMode, useOptionalOfflineMode, useSelection, useSelectionOptional };
|
|
465
|
+
export { type EntityRecord, EventBusContext, EventBusProvider, FetchedDataContext, type FetchedDataContextValue, FetchedDataProvider, type FetchedDataProviderProps, type FetchedDataState, type OfflineModeContextValue, OfflineModeProvider, type OfflineModeProviderProps, OrbitalProvider, type OrbitalProviderProps, SelectionContext, type SelectionContextType, SelectionProvider, ThemeDefinition, VerificationProvider, type VerificationProviderProps, useFetchedData, useFetchedDataContext, useFetchedEntity, useOfflineMode, useOptionalOfflineMode, useSelection, useSelectionOptional };
|
package/dist/providers/index.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { SuspenseConfigProvider } from '../chunk-UCXZS2YJ.js';
|
|
2
|
+
import { ThemeProvider } from '../chunk-BTXQJGFB.js';
|
|
3
|
+
import { SelectionProvider, EntityDataProvider } from '../chunk-PE2H3NAW.js';
|
|
4
|
+
export { SelectionContext, SelectionProvider, useSelection, useSelectionOptional } from '../chunk-PE2H3NAW.js';
|
|
5
|
+
import '../chunk-7NEWMNNU.js';
|
|
6
|
+
import { recordTransition, registerCheck, bindEventBus, bindTraitStateGetter } from '../chunk-45CTDYBT.js';
|
|
7
|
+
import '../chunk-KKCVDUK7.js';
|
|
4
8
|
import { useOfflineExecutor } from '../chunk-PL7MD6GF.js';
|
|
9
|
+
import { useEventBus, EventBusProvider } from '../chunk-YXZM3WCF.js';
|
|
10
|
+
export { EventBusContext, EventBusProvider } from '../chunk-YXZM3WCF.js';
|
|
5
11
|
import '../chunk-PKBMQBKP.js';
|
|
6
|
-
import { createContext, useState, useCallback, useMemo, useContext } from 'react';
|
|
7
|
-
import { jsx } from 'react/jsx-runtime';
|
|
12
|
+
import { createContext, useState, useCallback, useMemo, useContext, useRef, useEffect } from 'react';
|
|
13
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
8
14
|
|
|
9
15
|
var FetchedDataContext = createContext(null);
|
|
10
16
|
function FetchedDataProvider({
|
|
@@ -161,6 +167,144 @@ function useFetchedEntity(entityName) {
|
|
|
161
167
|
error: context.error
|
|
162
168
|
};
|
|
163
169
|
}
|
|
170
|
+
var DISPATCH_SUFFIX = ":DISPATCH";
|
|
171
|
+
var SUCCESS_SUFFIX = ":SUCCESS";
|
|
172
|
+
var ERROR_SUFFIX = ":ERROR";
|
|
173
|
+
function parseLifecycleEvent(type) {
|
|
174
|
+
if (type.endsWith(DISPATCH_SUFFIX)) {
|
|
175
|
+
const traitName = type.slice(0, -DISPATCH_SUFFIX.length);
|
|
176
|
+
if (traitName) return { kind: "dispatch", traitName };
|
|
177
|
+
} else if (type.endsWith(SUCCESS_SUFFIX)) {
|
|
178
|
+
const rest = type.slice(0, -SUCCESS_SUFFIX.length);
|
|
179
|
+
const colonIdx = rest.indexOf(":");
|
|
180
|
+
if (colonIdx > 0) {
|
|
181
|
+
return {
|
|
182
|
+
kind: "success",
|
|
183
|
+
traitName: rest.slice(0, colonIdx),
|
|
184
|
+
event: rest.slice(colonIdx + 1)
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
} else if (type.endsWith(ERROR_SUFFIX)) {
|
|
188
|
+
const rest = type.slice(0, -ERROR_SUFFIX.length);
|
|
189
|
+
const colonIdx = rest.indexOf(":");
|
|
190
|
+
if (colonIdx > 0) {
|
|
191
|
+
return {
|
|
192
|
+
kind: "error",
|
|
193
|
+
traitName: rest.slice(0, colonIdx),
|
|
194
|
+
event: rest.slice(colonIdx + 1)
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
function VerificationProvider({
|
|
201
|
+
children,
|
|
202
|
+
enabled,
|
|
203
|
+
runtimeManager,
|
|
204
|
+
traitStateGetter
|
|
205
|
+
}) {
|
|
206
|
+
const isEnabled = enabled ?? (typeof process !== "undefined" && process.env?.NODE_ENV !== "production");
|
|
207
|
+
const eventBus = useEventBus();
|
|
208
|
+
const pendingRef = useRef(/* @__PURE__ */ new Map());
|
|
209
|
+
useEffect(() => {
|
|
210
|
+
if (!isEnabled) return;
|
|
211
|
+
if (!eventBus.onAny) return;
|
|
212
|
+
const unsub = eventBus.onAny((evt) => {
|
|
213
|
+
const parsed = parseLifecycleEvent(evt.type);
|
|
214
|
+
if (!parsed) return;
|
|
215
|
+
const payload = evt.payload ?? {};
|
|
216
|
+
if (parsed.kind === "dispatch") {
|
|
217
|
+
const key = `${parsed.traitName}:${String(payload["event"] ?? "")}`;
|
|
218
|
+
pendingRef.current.set(key, {
|
|
219
|
+
traitName: parsed.traitName,
|
|
220
|
+
event: String(payload["event"] ?? ""),
|
|
221
|
+
from: payload["currentState"],
|
|
222
|
+
timestamp: evt.timestamp
|
|
223
|
+
});
|
|
224
|
+
} else if (parsed.kind === "success" && parsed.event) {
|
|
225
|
+
const key = `${parsed.traitName}:${parsed.event}`;
|
|
226
|
+
const pending = pendingRef.current.get(key);
|
|
227
|
+
pendingRef.current.delete(key);
|
|
228
|
+
const newState = payload["newState"] ?? payload["state"] ?? "unknown";
|
|
229
|
+
const effects = Array.isArray(payload["clientEffects"]) ? payload["clientEffects"].map((e) => ({
|
|
230
|
+
type: String(e["type"] ?? "unknown"),
|
|
231
|
+
args: Array.isArray(e["args"]) ? e["args"] : [],
|
|
232
|
+
status: "executed"
|
|
233
|
+
})) : [];
|
|
234
|
+
recordTransition({
|
|
235
|
+
traitName: parsed.traitName,
|
|
236
|
+
from: pending?.from ?? "unknown",
|
|
237
|
+
to: newState,
|
|
238
|
+
event: parsed.event,
|
|
239
|
+
effects,
|
|
240
|
+
timestamp: Date.now()
|
|
241
|
+
});
|
|
242
|
+
} else if (parsed.kind === "error" && parsed.event) {
|
|
243
|
+
const key = `${parsed.traitName}:${parsed.event}`;
|
|
244
|
+
const pending = pendingRef.current.get(key);
|
|
245
|
+
pendingRef.current.delete(key);
|
|
246
|
+
const errorMsg = payload["error"] ?? "Unknown error";
|
|
247
|
+
recordTransition({
|
|
248
|
+
traitName: parsed.traitName,
|
|
249
|
+
from: pending?.from ?? "unknown",
|
|
250
|
+
to: pending?.from ?? "unknown",
|
|
251
|
+
// state didn't change on error
|
|
252
|
+
event: parsed.event,
|
|
253
|
+
effects: [{
|
|
254
|
+
type: "server-call",
|
|
255
|
+
args: [],
|
|
256
|
+
status: "failed",
|
|
257
|
+
error: errorMsg
|
|
258
|
+
}],
|
|
259
|
+
timestamp: Date.now()
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
registerCheck(
|
|
264
|
+
"verification-provider",
|
|
265
|
+
"VerificationProvider active (compiled path)",
|
|
266
|
+
"pass"
|
|
267
|
+
);
|
|
268
|
+
return unsub;
|
|
269
|
+
}, [isEnabled, eventBus]);
|
|
270
|
+
useEffect(() => {
|
|
271
|
+
if (!isEnabled) return;
|
|
272
|
+
if (!runtimeManager) return;
|
|
273
|
+
runtimeManager.setObserver({
|
|
274
|
+
onTransition(trace) {
|
|
275
|
+
recordTransition({
|
|
276
|
+
traitName: trace.traitName,
|
|
277
|
+
from: trace.from,
|
|
278
|
+
to: trace.to,
|
|
279
|
+
event: trace.event,
|
|
280
|
+
guardResult: trace.guardResult,
|
|
281
|
+
effects: trace.effects,
|
|
282
|
+
timestamp: Date.now()
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
registerCheck(
|
|
287
|
+
"verification-provider",
|
|
288
|
+
"VerificationProvider active (runtime path)",
|
|
289
|
+
"pass"
|
|
290
|
+
);
|
|
291
|
+
}, [isEnabled, runtimeManager]);
|
|
292
|
+
useEffect(() => {
|
|
293
|
+
if (!isEnabled) return;
|
|
294
|
+
bindEventBus(eventBus);
|
|
295
|
+
}, [isEnabled, eventBus]);
|
|
296
|
+
useEffect(() => {
|
|
297
|
+
if (!isEnabled) return;
|
|
298
|
+
if (traitStateGetter) {
|
|
299
|
+
bindTraitStateGetter(traitStateGetter);
|
|
300
|
+
} else if (runtimeManager?.getState) {
|
|
301
|
+
const mgr = runtimeManager;
|
|
302
|
+
bindTraitStateGetter((traitName) => mgr.getState(traitName));
|
|
303
|
+
}
|
|
304
|
+
}, [isEnabled, traitStateGetter, runtimeManager]);
|
|
305
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
306
|
+
}
|
|
307
|
+
VerificationProvider.displayName = "VerificationProvider";
|
|
164
308
|
function FetchedDataBridge({ children }) {
|
|
165
309
|
const fetchedData = useFetchedData();
|
|
166
310
|
const adapter = useMemo(() => ({
|
|
@@ -176,16 +320,29 @@ function OrbitalProvider({
|
|
|
176
320
|
themes,
|
|
177
321
|
defaultTheme = "wireframe",
|
|
178
322
|
defaultMode = "system",
|
|
323
|
+
targetRef,
|
|
324
|
+
skipTheme = false,
|
|
179
325
|
debug = false,
|
|
180
|
-
initialData
|
|
326
|
+
initialData,
|
|
327
|
+
suspense = false,
|
|
328
|
+
verification
|
|
181
329
|
}) {
|
|
330
|
+
const suspenseConfig = useMemo(
|
|
331
|
+
() => ({ enabled: suspense }),
|
|
332
|
+
[suspense]
|
|
333
|
+
);
|
|
334
|
+
const inner = /* @__PURE__ */ jsx(FetchedDataProvider, { initialData, children: /* @__PURE__ */ jsx(FetchedDataBridge, { children: /* @__PURE__ */ jsx(EventBusProvider, { debug, children: /* @__PURE__ */ jsx(VerificationProvider, { enabled: verification, children: /* @__PURE__ */ jsx(SelectionProvider, { debug, children: /* @__PURE__ */ jsx(SuspenseConfigProvider, { config: suspenseConfig, children }) }) }) }) }) });
|
|
335
|
+
if (skipTheme) {
|
|
336
|
+
return inner;
|
|
337
|
+
}
|
|
182
338
|
return /* @__PURE__ */ jsx(
|
|
183
339
|
ThemeProvider,
|
|
184
340
|
{
|
|
185
341
|
themes,
|
|
186
342
|
defaultTheme,
|
|
187
343
|
defaultMode,
|
|
188
|
-
|
|
344
|
+
targetRef,
|
|
345
|
+
children: inner
|
|
189
346
|
}
|
|
190
347
|
);
|
|
191
348
|
}
|
|
@@ -220,4 +377,4 @@ function useOptionalOfflineMode() {
|
|
|
220
377
|
return useContext(OfflineModeContext);
|
|
221
378
|
}
|
|
222
379
|
|
|
223
|
-
export { FetchedDataContext, FetchedDataProvider, OfflineModeProvider, OrbitalProvider, useFetchedData, useFetchedDataContext, useFetchedEntity, useOfflineMode, useOptionalOfflineMode };
|
|
380
|
+
export { FetchedDataContext, FetchedDataProvider, OfflineModeProvider, OrbitalProvider, VerificationProvider, useFetchedData, useFetchedDataContext, useFetchedEntity, useOfflineMode, useOptionalOfflineMode };
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* useUISlots Hook
|
|
3
|
-
*
|
|
4
|
-
* Core hook for managing UI slot rendering in the trait-driven architecture.
|
|
5
|
-
* Traits use render_ui effects to dynamically render content into slots.
|
|
6
|
-
*
|
|
7
|
-
* Slots:
|
|
8
|
-
* - main: Primary content area
|
|
9
|
-
* - sidebar: Left/right sidebar
|
|
10
|
-
* - modal: Modal overlay
|
|
11
|
-
* - drawer: Slide-in drawer
|
|
12
|
-
* - overlay: Full-screen overlay
|
|
13
|
-
* - center: Centered popup
|
|
14
|
-
* - toast: Toast notifications
|
|
15
|
-
* - hud-top: Game HUD top bar
|
|
16
|
-
* - hud-bottom: Game HUD bottom bar
|
|
17
|
-
* - floating: Draggable floating panel
|
|
18
|
-
*
|
|
19
|
-
* @packageDocumentation
|
|
20
|
-
*/
|
|
21
1
|
/**
|
|
22
2
|
* Valid UI slot names
|
|
23
3
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.32",
|
|
4
4
|
"description": "React UI components, hooks, and providers for Almadar",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/components/index.js",
|
|
@@ -39,6 +39,18 @@
|
|
|
39
39
|
"import": "./dist/lib/index.js",
|
|
40
40
|
"types": "./dist/lib/index.d.ts"
|
|
41
41
|
},
|
|
42
|
+
"./components/organisms/game/three": {
|
|
43
|
+
"import": "./dist/components/organisms/game/three/index.js",
|
|
44
|
+
"types": "./dist/components/organisms/game/three/index.d.ts"
|
|
45
|
+
},
|
|
46
|
+
"./components/organisms/game/TraitStateViewer": {
|
|
47
|
+
"import": "./components/organisms/game/TraitStateViewer.tsx",
|
|
48
|
+
"types": "./components/organisms/game/TraitStateViewer.tsx"
|
|
49
|
+
},
|
|
50
|
+
"./components/organisms/game/TraitSlot": {
|
|
51
|
+
"import": "./components/organisms/game/TraitSlot.tsx",
|
|
52
|
+
"types": "./components/organisms/game/TraitSlot.tsx"
|
|
53
|
+
},
|
|
42
54
|
"./templates": {
|
|
43
55
|
"import": "./templates/index.ts",
|
|
44
56
|
"types": "./templates/index.ts"
|
|
@@ -57,13 +69,18 @@
|
|
|
57
69
|
"clsx": "^2.1.0",
|
|
58
70
|
"tailwind-merge": "^2.2.0",
|
|
59
71
|
"lucide-react": "^0.344.0",
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
72
|
+
"react-markdown": "^9.0.0",
|
|
73
|
+
"remark-gfm": "^4.0.0",
|
|
74
|
+
"remark-math": "^6.0.0",
|
|
75
|
+
"rehype-katex": "^7.0.0",
|
|
76
|
+
"react-syntax-highlighter": "^15.6.1",
|
|
77
|
+
"@almadar/core": "1.0.18",
|
|
78
|
+
"@almadar/patterns": "1.1.1",
|
|
79
|
+
"@almadar/evaluator": "1.0.16"
|
|
63
80
|
},
|
|
64
81
|
"peerDependencies": {
|
|
65
|
-
"react": "
|
|
66
|
-
"react-dom": "
|
|
82
|
+
"react": ">=18.0.0",
|
|
83
|
+
"react-dom": ">=18.0.0",
|
|
67
84
|
"react-router-dom": "^7.0.0",
|
|
68
85
|
"@tanstack/react-query": "^5.0.0",
|
|
69
86
|
"three": "^0.160.0",
|
|
@@ -71,12 +88,12 @@
|
|
|
71
88
|
"@react-three/drei": "^9.92.0"
|
|
72
89
|
},
|
|
73
90
|
"devDependencies": {
|
|
74
|
-
"react": "^
|
|
75
|
-
"react-dom": "^
|
|
91
|
+
"react": "^19.0.0",
|
|
92
|
+
"react-dom": "^19.0.0",
|
|
76
93
|
"react-router-dom": "^7.13.0",
|
|
77
94
|
"@tanstack/react-query": "^5.0.0",
|
|
78
|
-
"@types/react": "^
|
|
79
|
-
"@types/react-dom": "^
|
|
95
|
+
"@types/react": "^19.0.0",
|
|
96
|
+
"@types/react-dom": "^19.0.0",
|
|
80
97
|
"@types/three": "^0.160.0",
|
|
81
98
|
"@storybook/addon-links": "^10.2.6",
|
|
82
99
|
"@storybook/addon-themes": "^10.2.6",
|
|
@@ -84,6 +101,8 @@
|
|
|
84
101
|
"@storybook/react-vite": "^10.2.6",
|
|
85
102
|
"storybook": "^10.2.6",
|
|
86
103
|
"@vitejs/plugin-react": "^4.2.0",
|
|
104
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
105
|
+
"react-compiler-runtime": "^1.0.0",
|
|
87
106
|
"autoprefixer": "^10.4.0",
|
|
88
107
|
"postcss": "^8.4.35",
|
|
89
108
|
"tailwindcss": "^3.4.0",
|
|
@@ -96,7 +115,9 @@
|
|
|
96
115
|
"@testing-library/jest-dom": "^6.4.0",
|
|
97
116
|
"@vitest/ui": "^1.4.0",
|
|
98
117
|
"jsdom": "^24.0.0",
|
|
99
|
-
"@storybook/addon-docs": "^10.2.6"
|
|
118
|
+
"@storybook/addon-docs": "^10.2.6",
|
|
119
|
+
"@types/react-syntax-highlighter": "^15.5.0",
|
|
120
|
+
"katex": "^0.16.0"
|
|
100
121
|
},
|
|
101
122
|
"repository": {
|
|
102
123
|
"type": "git",
|