@syntrologie/runtime-sdk 1.0.1-canary.3 → 2.0.0-canary.1
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/CAPABILITIES.md +630 -463
- package/README.md +285 -62
- package/dist/RuntimeProvider.d.ts +51 -0
- package/dist/RuntimeProvider.js +114 -0
- package/dist/RuntimeProvider.js.map +1 -0
- package/dist/SmartCanvasApp.d.ts +9 -3
- package/dist/SmartCanvasApp.js +36 -38
- package/dist/SmartCanvasApp.js.map +1 -1
- package/dist/actions/ActionEngine.d.ts +11 -0
- package/dist/actions/ActionEngine.js +274 -0
- package/dist/actions/ActionEngine.js.map +1 -0
- package/dist/actions/executors/index.d.ts +118 -0
- package/dist/actions/executors/index.js +242 -0
- package/dist/actions/executors/index.js.map +1 -0
- package/dist/actions/executors/tour.d.ts +18 -0
- package/dist/actions/executors/tour.js +332 -0
- package/dist/actions/executors/tour.js.map +1 -0
- package/dist/actions/index.d.ts +10 -0
- package/dist/actions/index.js +12 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/types.d.ts +399 -0
- package/dist/actions/types.js +8 -0
- package/dist/actions/types.js.map +1 -0
- package/dist/actions/validation.d.ts +14 -0
- package/dist/actions/validation.js +603 -0
- package/dist/actions/validation.js.map +1 -0
- package/dist/api.d.ts +32 -18
- package/dist/api.js +56 -39
- package/dist/api.js.map +1 -1
- package/dist/apps/AppContext.d.ts +31 -0
- package/dist/apps/AppContext.js +93 -0
- package/dist/apps/AppContext.js.map +1 -0
- package/dist/apps/AppLoader.d.ts +84 -0
- package/dist/apps/AppLoader.js +250 -0
- package/dist/apps/AppLoader.js.map +1 -0
- package/dist/apps/AppRegistry.d.ts +102 -0
- package/dist/apps/AppRegistry.js +317 -0
- package/dist/apps/AppRegistry.js.map +1 -0
- package/dist/apps/examples/gamification-app.example.d.ts +305 -0
- package/dist/apps/examples/gamification-app.example.js +329 -0
- package/dist/apps/examples/gamification-app.example.js.map +1 -0
- package/dist/apps/index.d.ts +18 -0
- package/dist/apps/index.js +26 -0
- package/dist/apps/index.js.map +1 -0
- package/dist/apps/types.d.ts +231 -0
- package/dist/apps/types.js +8 -0
- package/dist/apps/types.js.map +1 -0
- package/dist/bootstrap.d.ts +24 -0
- package/dist/bootstrap.js +133 -33
- package/dist/bootstrap.js.map +1 -1
- package/dist/components/ShadowCanvasOverlay.js +36 -9
- package/dist/components/ShadowCanvasOverlay.js.map +1 -1
- package/dist/components/TileCard.js +37 -18
- package/dist/components/TileCard.js.map +1 -1
- package/dist/context/schema.d.ts +16 -16
- package/dist/decisions/schema.d.ts +96 -96
- package/dist/earlyPatcher.d.ts +8 -20
- package/dist/earlyPatcher.js +13 -62
- package/dist/earlyPatcher.js.map +1 -1
- package/dist/editorLoader.d.ts +2 -0
- package/dist/editorLoader.js +46 -7
- package/dist/editorLoader.js.map +1 -1
- package/dist/events/normalizers/posthog.d.ts +24 -0
- package/dist/events/normalizers/posthog.js.map +1 -1
- package/dist/events/schema.d.ts +8 -8
- package/dist/events/types.d.ts +6 -0
- package/dist/events/types.js +8 -0
- package/dist/events/types.js.map +1 -1
- package/dist/hooks/useCanvasOverlays.d.ts +4 -1
- package/dist/hooks/useCanvasOverlays.js +53 -6
- package/dist/hooks/useCanvasOverlays.js.map +1 -1
- package/dist/hooks/useShadowCanvasConfig.d.ts +3 -7
- package/dist/hooks/useShadowCanvasConfig.js +2 -3
- package/dist/hooks/useShadowCanvasConfig.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/overlays/schema.d.ts +153 -153
- package/dist/runtime.d.ts +24 -0
- package/dist/runtime.js +75 -1
- package/dist/runtime.js.map +1 -1
- package/dist/smart-canvas.esm.js +162 -55
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +21133 -17957
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +162 -55
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/store/example.d.ts +1 -0
- package/dist/store/example.js +43 -0
- package/dist/store/example.js.map +1 -0
- package/dist/store/mini-effector.d.ts +46 -0
- package/dist/store/mini-effector.js +90 -0
- package/dist/store/mini-effector.js.map +1 -0
- package/dist/surfaces/Surfaces.d.ts +11 -0
- package/dist/surfaces/Surfaces.js +361 -0
- package/dist/surfaces/Surfaces.js.map +1 -0
- package/dist/surfaces/index.d.ts +9 -0
- package/dist/surfaces/index.js +12 -0
- package/dist/surfaces/index.js.map +1 -0
- package/dist/surfaces/positioning.d.ts +50 -0
- package/dist/surfaces/positioning.js +231 -0
- package/dist/surfaces/positioning.js.map +1 -0
- package/dist/surfaces/types.d.ts +167 -0
- package/dist/surfaces/types.js +23 -0
- package/dist/surfaces/types.js.map +1 -0
- package/dist/telemetry/adapters/posthog.d.ts +6 -0
- package/dist/telemetry/adapters/posthog.js +9 -0
- package/dist/telemetry/adapters/posthog.js.map +1 -1
- package/dist/types-only.d.ts +32 -0
- package/dist/types-only.js +11 -0
- package/dist/types-only.js.map +1 -0
- package/dist/types.d.ts +26 -14
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/widgets/WidgetRegistry.d.ts +139 -0
- package/dist/widgets/WidgetRegistry.js +182 -0
- package/dist/widgets/WidgetRegistry.js.map +1 -0
- package/dist/widgets/index.d.ts +7 -0
- package/dist/widgets/index.js +7 -0
- package/dist/widgets/index.js.map +1 -0
- package/package.json +13 -3
- package/schema/canvas-config.schema.json +444 -254
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example usage of mini-effector
|
|
3
|
+
*/
|
|
4
|
+
import { createEvent, createStore, createEffect, sample } from "./mini-effector";
|
|
5
|
+
// Events
|
|
6
|
+
const tooltipDismissed = createEvent();
|
|
7
|
+
const tourStepCompleted = createEvent();
|
|
8
|
+
const pageViewed = createEvent();
|
|
9
|
+
// Stores
|
|
10
|
+
const $dismissedTooltips = createStore([]);
|
|
11
|
+
const $tourProgress = createStore({});
|
|
12
|
+
// Connect events → stores
|
|
13
|
+
$dismissedTooltips.on(tooltipDismissed, (list, { anchorId }) => [...list, anchorId]);
|
|
14
|
+
$tourProgress.on(tourStepCompleted, (progress, { tourId, step }) => ({
|
|
15
|
+
...progress,
|
|
16
|
+
[tourId]: step,
|
|
17
|
+
}));
|
|
18
|
+
// Effect (async side effect)
|
|
19
|
+
const saveProgressFx = createEffect(async (data) => {
|
|
20
|
+
console.log("Saving progress:", data);
|
|
21
|
+
// await api.saveProgress(data);
|
|
22
|
+
return { saved: true };
|
|
23
|
+
});
|
|
24
|
+
// Wire event → effect with filter
|
|
25
|
+
sample({
|
|
26
|
+
clock: tourStepCompleted,
|
|
27
|
+
filter: ({ step }) => step > 0, // Only save after first step
|
|
28
|
+
fn: ({ tourId, step }) => ({ tourId, step }),
|
|
29
|
+
target: saveProgressFx,
|
|
30
|
+
});
|
|
31
|
+
// Watch for debugging
|
|
32
|
+
$dismissedTooltips.watch(list => console.log("Dismissed:", list));
|
|
33
|
+
$tourProgress.watch(progress => console.log("Progress:", progress));
|
|
34
|
+
saveProgressFx.done.watch(({ result }) => console.log("Saved:", result));
|
|
35
|
+
// Test it
|
|
36
|
+
console.log("--- Testing mini-effector ---");
|
|
37
|
+
tooltipDismissed({ anchorId: "#hero" });
|
|
38
|
+
tooltipDismissed({ anchorId: "#cta" });
|
|
39
|
+
tourStepCompleted({ tourId: "onboarding", step: 1 });
|
|
40
|
+
tourStepCompleted({ tourId: "onboarding", step: 2 });
|
|
41
|
+
console.log("Final dismissed:", $dismissedTooltips.getState());
|
|
42
|
+
console.log("Final progress:", $tourProgress.getState());
|
|
43
|
+
//# sourceMappingURL=example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example.js","sourceRoot":"","sources":["../../src/store/example.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,WAAW,EA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CAAC;AAEH,sBAAsB;AACtB,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;AAClE,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;AACpE,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAEzE,UAAU;AACV,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;AAC7C,gBAAgB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;AACxC,gBAAgB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;AACvC,iBAAiB,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AACrD,iBAAiB,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AAErD,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC/D,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mini Effector - Minimal event→state implementation
|
|
3
|
+
*
|
|
4
|
+
* Core concepts from Effector in ~100 lines:
|
|
5
|
+
* - createEvent: callable + subscribable
|
|
6
|
+
* - createStore: reactive state with .on() for event connections
|
|
7
|
+
* - sample: connect clock → source → filter → target
|
|
8
|
+
*/
|
|
9
|
+
type Subscriber<T> = (payload: T) => void;
|
|
10
|
+
export interface Event<T> {
|
|
11
|
+
(payload: T): void;
|
|
12
|
+
watch(fn: Subscriber<T>): () => void;
|
|
13
|
+
/** Internal: get subscribers for sample() */
|
|
14
|
+
_subscribers: Set<Subscriber<T>>;
|
|
15
|
+
}
|
|
16
|
+
export declare function createEvent<T = void>(): Event<T>;
|
|
17
|
+
export interface Store<T> {
|
|
18
|
+
getState(): T;
|
|
19
|
+
watch(fn: Subscriber<T>): () => void;
|
|
20
|
+
on<E>(event: Event<E>, reducer: (state: T, payload: E) => T): Store<T>;
|
|
21
|
+
/** Internal: update state */
|
|
22
|
+
_setState(value: T): void;
|
|
23
|
+
}
|
|
24
|
+
export declare function createStore<T>(initialState: T): Store<T>;
|
|
25
|
+
export interface Effect<T, R> {
|
|
26
|
+
(payload: T): Promise<R>;
|
|
27
|
+
done: Event<{
|
|
28
|
+
params: T;
|
|
29
|
+
result: R;
|
|
30
|
+
}>;
|
|
31
|
+
fail: Event<{
|
|
32
|
+
params: T;
|
|
33
|
+
error: Error;
|
|
34
|
+
}>;
|
|
35
|
+
pending: Store<boolean>;
|
|
36
|
+
}
|
|
37
|
+
export declare function createEffect<T, R>(handler: (payload: T) => Promise<R>): Effect<T, R>;
|
|
38
|
+
interface SampleConfig<Clock, Source, Target, EffectResult = unknown> {
|
|
39
|
+
clock: Event<Clock>;
|
|
40
|
+
source?: Store<Source>;
|
|
41
|
+
filter?: (clockPayload: Clock, sourceState?: Source) => boolean;
|
|
42
|
+
fn?: (clockPayload: Clock, sourceState?: Source) => Target;
|
|
43
|
+
target?: Event<Target> | Effect<Target, EffectResult>;
|
|
44
|
+
}
|
|
45
|
+
export declare function sample<Clock, Source, Target, EffectResult = unknown>(config: SampleConfig<Clock, Source, Target, EffectResult>): void;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mini Effector - Minimal event→state implementation
|
|
3
|
+
*
|
|
4
|
+
* Core concepts from Effector in ~100 lines:
|
|
5
|
+
* - createEvent: callable + subscribable
|
|
6
|
+
* - createStore: reactive state with .on() for event connections
|
|
7
|
+
* - sample: connect clock → source → filter → target
|
|
8
|
+
*/
|
|
9
|
+
export function createEvent() {
|
|
10
|
+
const subscribers = new Set();
|
|
11
|
+
const event = ((payload) => {
|
|
12
|
+
subscribers.forEach(fn => fn(payload));
|
|
13
|
+
});
|
|
14
|
+
event.watch = (fn) => {
|
|
15
|
+
subscribers.add(fn);
|
|
16
|
+
return () => subscribers.delete(fn);
|
|
17
|
+
};
|
|
18
|
+
event._subscribers = subscribers;
|
|
19
|
+
return event;
|
|
20
|
+
}
|
|
21
|
+
export function createStore(initialState) {
|
|
22
|
+
let state = initialState;
|
|
23
|
+
const subscribers = new Set();
|
|
24
|
+
const store = {
|
|
25
|
+
getState: () => state,
|
|
26
|
+
watch: (fn) => {
|
|
27
|
+
subscribers.add(fn);
|
|
28
|
+
return () => subscribers.delete(fn);
|
|
29
|
+
},
|
|
30
|
+
on: (event, reducer) => {
|
|
31
|
+
event.watch(payload => {
|
|
32
|
+
const nextState = reducer(state, payload);
|
|
33
|
+
if (nextState !== state) {
|
|
34
|
+
state = nextState;
|
|
35
|
+
subscribers.forEach(fn => fn(state));
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return store;
|
|
39
|
+
},
|
|
40
|
+
_setState: (value) => {
|
|
41
|
+
if (value !== state) {
|
|
42
|
+
state = value;
|
|
43
|
+
subscribers.forEach(fn => fn(state));
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
return store;
|
|
48
|
+
}
|
|
49
|
+
export function createEffect(handler) {
|
|
50
|
+
const done = createEvent();
|
|
51
|
+
const fail = createEvent();
|
|
52
|
+
const pending = createStore(false);
|
|
53
|
+
pending.on(done, () => false);
|
|
54
|
+
pending.on(fail, () => false);
|
|
55
|
+
const effect = (async (payload) => {
|
|
56
|
+
pending._setState(true);
|
|
57
|
+
try {
|
|
58
|
+
const result = await handler(payload);
|
|
59
|
+
done({ params: payload, result });
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
fail({ params: payload, error: err });
|
|
64
|
+
throw err;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
effect.done = done;
|
|
68
|
+
effect.fail = fail;
|
|
69
|
+
effect.pending = pending;
|
|
70
|
+
return effect;
|
|
71
|
+
}
|
|
72
|
+
export function sample(config) {
|
|
73
|
+
const { clock, source, filter, fn, target } = config;
|
|
74
|
+
clock.watch(clockPayload => {
|
|
75
|
+
const sourceState = source === null || source === void 0 ? void 0 : source.getState();
|
|
76
|
+
// Check filter
|
|
77
|
+
if (filter && !filter(clockPayload, sourceState)) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
// Transform
|
|
81
|
+
const result = fn
|
|
82
|
+
? fn(clockPayload, sourceState)
|
|
83
|
+
: clockPayload;
|
|
84
|
+
// Send to target
|
|
85
|
+
if (target) {
|
|
86
|
+
target(result);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=mini-effector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mini-effector.js","sourceRoot":"","sources":["../../src/store/mini-effector.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAeH,MAAM,UAAU,WAAW;IACzB,MAAM,WAAW,GAAG,IAAI,GAAG,EAAiB,CAAC;IAE7C,MAAM,KAAK,GAAG,CAAC,CAAC,OAAU,EAAE,EAAE;QAC5B,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACzC,CAAC,CAAa,CAAC;IAEf,KAAK,CAAC,KAAK,GAAG,CAAC,EAAiB,EAAE,EAAE;QAClC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACpB,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC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AAC;YACjD,OAAO;QACT,CAAC;QAED,YAAY;QACZ,MAAM,MAAM,GAAG,EAAE;YACf,CAAC,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,CAAC;YAC/B,CAAC,CAAE,YAAkC,CAAC;QAExC,iBAAiB;QACjB,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surfaces
|
|
3
|
+
*
|
|
4
|
+
* Managed surface system for rendering UI into named slots.
|
|
5
|
+
* Handles layout, stacking, animations, and priority-based arbitration.
|
|
6
|
+
*/
|
|
7
|
+
import type { Surfaces, SurfacesOptions } from "./types";
|
|
8
|
+
/**
|
|
9
|
+
* Create a Surfaces instance.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createSurfaces(options: SurfacesOptions): Surfaces;
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surfaces
|
|
3
|
+
*
|
|
4
|
+
* Managed surface system for rendering UI into named slots.
|
|
5
|
+
* Handles layout, stacking, animations, and priority-based arbitration.
|
|
6
|
+
*/
|
|
7
|
+
import { getSlotType, getSlotAnchorId } from "./types";
|
|
8
|
+
import { sanitizeWithFallback } from "../hostPatcher/core/sanitizer";
|
|
9
|
+
import { applyStaticSlotStyles, setupAdjacentPositioning, setupInlinePositioning, playEnterAnimation, playExitAnimation, createSurfaceContainer, getSlotZIndex, } from "./positioning";
|
|
10
|
+
/** Counter for generating unique mount IDs */
|
|
11
|
+
let mountIdCounter = 0;
|
|
12
|
+
/**
|
|
13
|
+
* Create a Surfaces instance.
|
|
14
|
+
*/
|
|
15
|
+
export function createSurfaces(options) {
|
|
16
|
+
const { overlayRoot, eventBus, anchorResolver, defaultAnimation = "fade", widgetRegistry, } = options;
|
|
17
|
+
/** Map of current mounts by slot */
|
|
18
|
+
const mounts = new Map();
|
|
19
|
+
/** Map of mount counts by slot (for stats) */
|
|
20
|
+
const mountCounts = new Map();
|
|
21
|
+
/** Map of state change callbacks by slot */
|
|
22
|
+
const stateCallbacks = new Map();
|
|
23
|
+
/**
|
|
24
|
+
* Generate a unique mount ID.
|
|
25
|
+
*/
|
|
26
|
+
function generateMountId() {
|
|
27
|
+
return `mount-${++mountIdCounter}`;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Publish an event to the EventBus if available.
|
|
31
|
+
*/
|
|
32
|
+
function publishEvent(name, props) {
|
|
33
|
+
if (eventBus) {
|
|
34
|
+
eventBus.publish(name, props);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Notify state change callbacks for a slot.
|
|
39
|
+
*/
|
|
40
|
+
function notifyStateChange(slot) {
|
|
41
|
+
const callbacks = stateCallbacks.get(slot);
|
|
42
|
+
if (callbacks) {
|
|
43
|
+
const state = getState(slot);
|
|
44
|
+
for (const callback of callbacks) {
|
|
45
|
+
try {
|
|
46
|
+
callback(state);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
console.error("[Surfaces] State callback error:", error);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** Track mounted widget handles for cleanup */
|
|
55
|
+
const widgetHandles = new Map();
|
|
56
|
+
/**
|
|
57
|
+
* Render content into a container.
|
|
58
|
+
*/
|
|
59
|
+
function renderContent(container, content, mountId) {
|
|
60
|
+
switch (content.type) {
|
|
61
|
+
case "html":
|
|
62
|
+
container.innerHTML = sanitizeWithFallback(content.content);
|
|
63
|
+
return undefined;
|
|
64
|
+
case "widget": {
|
|
65
|
+
// Use widget registry if available
|
|
66
|
+
if (widgetRegistry && widgetRegistry.has(content.widgetId)) {
|
|
67
|
+
const handle = widgetRegistry.mount(content.widgetId, container, content.config);
|
|
68
|
+
if (mountId) {
|
|
69
|
+
widgetHandles.set(mountId, handle);
|
|
70
|
+
}
|
|
71
|
+
return () => {
|
|
72
|
+
handle.unmount();
|
|
73
|
+
if (mountId) {
|
|
74
|
+
widgetHandles.delete(mountId);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
// Fallback: create a placeholder if widget not found
|
|
79
|
+
console.warn(`[Surfaces] Widget not found: ${content.widgetId}`);
|
|
80
|
+
container.innerHTML = `<div data-widget-id="${content.widgetId}" data-widget-missing="true">Widget: ${content.widgetId}</div>`;
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
case "custom":
|
|
84
|
+
return content.mount(container);
|
|
85
|
+
case "react":
|
|
86
|
+
// React rendering would require ReactDOM
|
|
87
|
+
// For now, create a placeholder
|
|
88
|
+
container.innerHTML = `<div data-react-component>React Component</div>`;
|
|
89
|
+
return undefined;
|
|
90
|
+
default:
|
|
91
|
+
console.warn("[Surfaces] Unknown content type");
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Mount content to a surface slot.
|
|
97
|
+
*/
|
|
98
|
+
function mount(slot, content, opts) {
|
|
99
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
100
|
+
const id = generateMountId();
|
|
101
|
+
const slotType = getSlotType(slot);
|
|
102
|
+
const priority = (_a = opts === null || opts === void 0 ? void 0 : opts.priority) !== null && _a !== void 0 ? _a : 0;
|
|
103
|
+
const animation = (_b = opts === null || opts === void 0 ? void 0 : opts.animation) !== null && _b !== void 0 ? _b : defaultAnimation;
|
|
104
|
+
const exclusive = (_c = opts === null || opts === void 0 ? void 0 : opts.exclusive) !== null && _c !== void 0 ? _c : true;
|
|
105
|
+
// Check for existing mount
|
|
106
|
+
const existingMount = mounts.get(slot);
|
|
107
|
+
if (existingMount) {
|
|
108
|
+
if (exclusive) {
|
|
109
|
+
// Priority-based arbitration
|
|
110
|
+
if (existingMount.options.priority > priority) {
|
|
111
|
+
throw new Error(`Slot ${slot} is occupied by higher priority content (${existingMount.options.priority} > ${priority})`);
|
|
112
|
+
}
|
|
113
|
+
// Unmount existing content
|
|
114
|
+
unmountEntry(existingMount);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// Create container
|
|
118
|
+
const container = createSurfaceContainer(slot, id);
|
|
119
|
+
container.style.zIndex = String(getSlotZIndex(slot));
|
|
120
|
+
// Set up positioning based on slot type
|
|
121
|
+
let positionCleanup;
|
|
122
|
+
if (slotType === "static") {
|
|
123
|
+
applyStaticSlotStyles(container, slot, opts === null || opts === void 0 ? void 0 : opts.constraints);
|
|
124
|
+
overlayRoot.appendChild(container);
|
|
125
|
+
}
|
|
126
|
+
else if (slotType === "inline") {
|
|
127
|
+
const anchorId = getSlotAnchorId(slot);
|
|
128
|
+
if (!anchorId) {
|
|
129
|
+
throw new Error(`Invalid inline slot: ${slot}`);
|
|
130
|
+
}
|
|
131
|
+
if (!anchorResolver) {
|
|
132
|
+
throw new Error("Anchor resolver required for inline slots");
|
|
133
|
+
}
|
|
134
|
+
const anchorEl = anchorResolver(anchorId);
|
|
135
|
+
if (!anchorEl) {
|
|
136
|
+
throw new Error(`Anchor not found for inline slot: ${anchorId}`);
|
|
137
|
+
}
|
|
138
|
+
positionCleanup = setupInlinePositioning(container, anchorEl);
|
|
139
|
+
}
|
|
140
|
+
else if (slotType === "adjacent") {
|
|
141
|
+
const anchorId = getSlotAnchorId(slot);
|
|
142
|
+
if (!anchorId) {
|
|
143
|
+
throw new Error(`Invalid adjacent slot: ${slot}`);
|
|
144
|
+
}
|
|
145
|
+
if (!anchorResolver) {
|
|
146
|
+
throw new Error("Anchor resolver required for adjacent slots");
|
|
147
|
+
}
|
|
148
|
+
const anchorEl = anchorResolver(anchorId);
|
|
149
|
+
if (!anchorEl) {
|
|
150
|
+
throw new Error(`Anchor not found for adjacent slot: ${anchorId}`);
|
|
151
|
+
}
|
|
152
|
+
overlayRoot.appendChild(container);
|
|
153
|
+
positionCleanup = setupAdjacentPositioning(container, anchorEl, (_d = opts === null || opts === void 0 ? void 0 : opts.position) !== null && _d !== void 0 ? _d : { placement: "bottom" });
|
|
154
|
+
}
|
|
155
|
+
// Render content
|
|
156
|
+
const contentCleanup = renderContent(container, content, id);
|
|
157
|
+
// Play enter animation
|
|
158
|
+
playEnterAnimation(container, animation);
|
|
159
|
+
// Create internal entry
|
|
160
|
+
const entry = {
|
|
161
|
+
id,
|
|
162
|
+
slot,
|
|
163
|
+
content,
|
|
164
|
+
options: {
|
|
165
|
+
priority,
|
|
166
|
+
exclusive,
|
|
167
|
+
animation,
|
|
168
|
+
position: (_e = opts === null || opts === void 0 ? void 0 : opts.position) !== null && _e !== void 0 ? _e : { placement: "auto" },
|
|
169
|
+
constraints: (_f = opts === null || opts === void 0 ? void 0 : opts.constraints) !== null && _f !== void 0 ? _f : {},
|
|
170
|
+
adaptiveId: opts === null || opts === void 0 ? void 0 : opts.adaptiveId,
|
|
171
|
+
autoUnmountOnRouteChange: (_g = opts === null || opts === void 0 ? void 0 : opts.autoUnmountOnRouteChange) !== null && _g !== void 0 ? _g : true,
|
|
172
|
+
},
|
|
173
|
+
container,
|
|
174
|
+
cleanup: () => {
|
|
175
|
+
positionCleanup === null || positionCleanup === void 0 ? void 0 : positionCleanup();
|
|
176
|
+
contentCleanup === null || contentCleanup === void 0 ? void 0 : contentCleanup();
|
|
177
|
+
},
|
|
178
|
+
mountedAt: Date.now(),
|
|
179
|
+
};
|
|
180
|
+
// Store mount
|
|
181
|
+
mounts.set(slot, entry);
|
|
182
|
+
// Update mount count
|
|
183
|
+
mountCounts.set(slot, ((_h = mountCounts.get(slot)) !== null && _h !== void 0 ? _h : 0) + 1);
|
|
184
|
+
// Publish event
|
|
185
|
+
publishEvent("surface.mounted", {
|
|
186
|
+
slot,
|
|
187
|
+
id,
|
|
188
|
+
adaptiveId: opts === null || opts === void 0 ? void 0 : opts.adaptiveId,
|
|
189
|
+
});
|
|
190
|
+
// Notify state change
|
|
191
|
+
notifyStateChange(slot);
|
|
192
|
+
// Create and return handle
|
|
193
|
+
const handle = {
|
|
194
|
+
id,
|
|
195
|
+
update(newContent) {
|
|
196
|
+
const entry = mounts.get(slot);
|
|
197
|
+
if (!entry || entry.id !== id) {
|
|
198
|
+
throw new Error("Mount no longer active");
|
|
199
|
+
}
|
|
200
|
+
// Clean up existing widget handle if present
|
|
201
|
+
const existingWidgetHandle = widgetHandles.get(id);
|
|
202
|
+
if (existingWidgetHandle) {
|
|
203
|
+
// If content is a widget and we have an update method, use it
|
|
204
|
+
if (newContent.type === "widget") {
|
|
205
|
+
existingWidgetHandle.update(newContent.config);
|
|
206
|
+
entry.content = newContent;
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
// Otherwise, unmount the old widget
|
|
210
|
+
existingWidgetHandle.unmount();
|
|
211
|
+
widgetHandles.delete(id);
|
|
212
|
+
}
|
|
213
|
+
// Clear existing content
|
|
214
|
+
entry.container.innerHTML = "";
|
|
215
|
+
// Render new content
|
|
216
|
+
const newCleanup = renderContent(entry.container, newContent, id);
|
|
217
|
+
entry.content = newContent;
|
|
218
|
+
// Update cleanup if needed
|
|
219
|
+
if (newCleanup) {
|
|
220
|
+
const oldCleanup = entry.cleanup;
|
|
221
|
+
entry.cleanup = () => {
|
|
222
|
+
oldCleanup === null || oldCleanup === void 0 ? void 0 : oldCleanup();
|
|
223
|
+
newCleanup();
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
setOptions(newOpts) {
|
|
228
|
+
const entry = mounts.get(slot);
|
|
229
|
+
if (!entry || entry.id !== id) {
|
|
230
|
+
throw new Error("Mount no longer active");
|
|
231
|
+
}
|
|
232
|
+
// Update options
|
|
233
|
+
if (newOpts.priority !== undefined) {
|
|
234
|
+
entry.options.priority = newOpts.priority;
|
|
235
|
+
}
|
|
236
|
+
if (newOpts.animation !== undefined) {
|
|
237
|
+
entry.options.animation = newOpts.animation;
|
|
238
|
+
}
|
|
239
|
+
// Re-apply constraints if changed
|
|
240
|
+
if (newOpts.constraints && slotType === "static") {
|
|
241
|
+
if (newOpts.constraints.maxWidth)
|
|
242
|
+
entry.container.style.maxWidth = newOpts.constraints.maxWidth;
|
|
243
|
+
if (newOpts.constraints.maxHeight)
|
|
244
|
+
entry.container.style.maxHeight = newOpts.constraints.maxHeight;
|
|
245
|
+
if (newOpts.constraints.minWidth)
|
|
246
|
+
entry.container.style.minWidth = newOpts.constraints.minWidth;
|
|
247
|
+
if (newOpts.constraints.minHeight)
|
|
248
|
+
entry.container.style.minHeight = newOpts.constraints.minHeight;
|
|
249
|
+
}
|
|
250
|
+
notifyStateChange(slot);
|
|
251
|
+
},
|
|
252
|
+
async unmount() {
|
|
253
|
+
const entry = mounts.get(slot);
|
|
254
|
+
if (!entry || entry.id !== id)
|
|
255
|
+
return;
|
|
256
|
+
await unmountEntry(entry);
|
|
257
|
+
},
|
|
258
|
+
isMounted() {
|
|
259
|
+
const entry = mounts.get(slot);
|
|
260
|
+
return (entry === null || entry === void 0 ? void 0 : entry.id) === id;
|
|
261
|
+
},
|
|
262
|
+
getContainer() {
|
|
263
|
+
const entry = mounts.get(slot);
|
|
264
|
+
return (entry === null || entry === void 0 ? void 0 : entry.id) === id ? entry.container : null;
|
|
265
|
+
},
|
|
266
|
+
};
|
|
267
|
+
return handle;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Unmount an entry with animation.
|
|
271
|
+
*/
|
|
272
|
+
async function unmountEntry(entry) {
|
|
273
|
+
var _a;
|
|
274
|
+
// Play exit animation
|
|
275
|
+
await playExitAnimation(entry.container, entry.options.animation);
|
|
276
|
+
// Run cleanup
|
|
277
|
+
(_a = entry.cleanup) === null || _a === void 0 ? void 0 : _a.call(entry);
|
|
278
|
+
// Remove container
|
|
279
|
+
entry.container.remove();
|
|
280
|
+
// Remove from mounts
|
|
281
|
+
mounts.delete(entry.slot);
|
|
282
|
+
// Publish event
|
|
283
|
+
publishEvent("surface.unmounted", {
|
|
284
|
+
slot: entry.slot,
|
|
285
|
+
id: entry.id,
|
|
286
|
+
});
|
|
287
|
+
// Notify state change
|
|
288
|
+
notifyStateChange(entry.slot);
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Get the current state of a slot.
|
|
292
|
+
*/
|
|
293
|
+
function getState(slot) {
|
|
294
|
+
var _a;
|
|
295
|
+
const entry = mounts.get(slot);
|
|
296
|
+
return {
|
|
297
|
+
slot,
|
|
298
|
+
occupied: !!entry,
|
|
299
|
+
currentPriority: entry === null || entry === void 0 ? void 0 : entry.options.priority,
|
|
300
|
+
currentAdaptiveId: entry === null || entry === void 0 ? void 0 : entry.options.adaptiveId,
|
|
301
|
+
mountCount: (_a = mountCounts.get(slot)) !== null && _a !== void 0 ? _a : 0,
|
|
302
|
+
currentMountId: entry === null || entry === void 0 ? void 0 : entry.id,
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Subscribe to state changes for a slot.
|
|
307
|
+
*/
|
|
308
|
+
function onStateChange(slot, fn) {
|
|
309
|
+
let callbacks = stateCallbacks.get(slot);
|
|
310
|
+
if (!callbacks) {
|
|
311
|
+
callbacks = new Set();
|
|
312
|
+
stateCallbacks.set(slot, callbacks);
|
|
313
|
+
}
|
|
314
|
+
callbacks.add(fn);
|
|
315
|
+
return () => {
|
|
316
|
+
callbacks === null || callbacks === void 0 ? void 0 : callbacks.delete(fn);
|
|
317
|
+
if ((callbacks === null || callbacks === void 0 ? void 0 : callbacks.size) === 0) {
|
|
318
|
+
stateCallbacks.delete(slot);
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Check if content can be mounted to a slot.
|
|
324
|
+
*/
|
|
325
|
+
function canMount(slot, priority) {
|
|
326
|
+
const existingMount = mounts.get(slot);
|
|
327
|
+
if (!existingMount)
|
|
328
|
+
return true;
|
|
329
|
+
// Check priority if provided
|
|
330
|
+
if (priority !== undefined) {
|
|
331
|
+
return priority >= existingMount.options.priority;
|
|
332
|
+
}
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Clean up all mounted surfaces.
|
|
337
|
+
*/
|
|
338
|
+
function destroy() {
|
|
339
|
+
var _a;
|
|
340
|
+
// Unmount all surfaces
|
|
341
|
+
for (const entry of mounts.values()) {
|
|
342
|
+
try {
|
|
343
|
+
(_a = entry.cleanup) === null || _a === void 0 ? void 0 : _a.call(entry);
|
|
344
|
+
entry.container.remove();
|
|
345
|
+
}
|
|
346
|
+
catch (error) {
|
|
347
|
+
console.error("[Surfaces] Error during cleanup:", error);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
mounts.clear();
|
|
351
|
+
stateCallbacks.clear();
|
|
352
|
+
}
|
|
353
|
+
return {
|
|
354
|
+
mount,
|
|
355
|
+
getState,
|
|
356
|
+
onStateChange,
|
|
357
|
+
canMount,
|
|
358
|
+
destroy,
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
//# sourceMappingURL=Surfaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Surfaces.js","sourceRoot":"","sources":["../../src/surfaces/Surfaces.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB,8CAA8C;AAC9C,IAAI,cAAc,GAAG,CAAC,CAAC;AAEvB;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,OAAwB;IACrD,MAAM,EACJ,WAAW,EACX,QAAQ,EACR,cAAc,EACd,gBAAgB,GAAG,MAAM,EACzB,cAAc,GACf,GAAG,OAAO,CAAC;I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,SAAS,EAAE,CAAC;YAC3B,OAAO,QAAQ,IAAI,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC;QACpD,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACH,SAAS,OAAO;;QACd,uBAAuB;QACvB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;YACpC,IAAI,CAAC;gBACH,MAAA,KAAK,CAAC,OAAO,qDAAI,CAAC;gBAClB,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;YAC3B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;QAED,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,cAAc,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;IAED,OAAO;QACL,KAAK;QACL,QAAQ;QACR,aAAa;QACb,QAAQ;QACR,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surfaces Module
|
|
3
|
+
*
|
|
4
|
+
* Managed surface system for rendering UI into named slots.
|
|
5
|
+
*/
|
|
6
|
+
export { createSurfaces } from "./Surfaces";
|
|
7
|
+
export type { Surfaces, SurfacesOptions, SurfacesWidgetRegistry, MountHandle, SurfaceState, SurfaceChangeCallback, SurfaceSlot, StaticSurfaceSlot, InlineSurfaceSlot, AdjacentSurfaceSlot, RenderableContent, ReactContent, HtmlContent, WidgetContent, CustomContent, MountOptions, PositionConfig, MountConstraints, AnimationType, } from "./types";
|
|
8
|
+
export { getSlotType, getSlotAnchorId } from "./types";
|
|
9
|
+
export { STATIC_SLOT_STYLES, ANIMATION_KEYFRAMES, applyStaticSlotStyles, setupAdjacentPositioning, setupInlinePositioning, playEnterAnimation, playExitAnimation, createSurfaceContainer, getSlotZIndex, } from "./positioning";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surfaces Module
|
|
3
|
+
*
|
|
4
|
+
* Managed surface system for rendering UI into named slots.
|
|
5
|
+
*/
|
|
6
|
+
// Main factory
|
|
7
|
+
export { createSurfaces } from "./Surfaces";
|
|
8
|
+
// Utilities
|
|
9
|
+
export { getSlotType, getSlotAnchorId } from "./types";
|
|
10
|
+
// Positioning (for advanced usage)
|
|
11
|
+
export { STATIC_SLOT_STYLES, ANIMATION_KEYFRAMES, applyStaticSlotStyles, setupAdjacentPositioning, setupInlinePositioning, playEnterAnimation, playExitAnimation, createSurfaceContainer, getSlotZIndex, } from "./positioning";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/surfaces/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAe;AACf,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAgC5C,YAAY;AACZ,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEvD,mCAAmC;AACnC,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,GACd,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surfaces Positioning
|
|
3
|
+
*
|
|
4
|
+
* Handles positioning for different slot types using CSS for static slots
|
|
5
|
+
* and Floating UI for adjacent slots.
|
|
6
|
+
*/
|
|
7
|
+
import type { SurfaceSlot, StaticSurfaceSlot, PositionConfig, MountConstraints, AnimationType } from "./types";
|
|
8
|
+
/**
|
|
9
|
+
* CSS styles for static surface slots.
|
|
10
|
+
*/
|
|
11
|
+
export declare const STATIC_SLOT_STYLES: Record<StaticSurfaceSlot, Record<string, string>>;
|
|
12
|
+
/**
|
|
13
|
+
* Animation keyframes for different animation types.
|
|
14
|
+
*/
|
|
15
|
+
export declare const ANIMATION_KEYFRAMES: Record<AnimationType, Keyframe[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Animation options.
|
|
18
|
+
*/
|
|
19
|
+
export declare const ANIMATION_OPTIONS: KeyframeAnimationOptions;
|
|
20
|
+
/**
|
|
21
|
+
* Apply static slot positioning to an element.
|
|
22
|
+
*/
|
|
23
|
+
export declare function applyStaticSlotStyles(element: HTMLElement, slot: StaticSurfaceSlot, constraints?: MountConstraints): void;
|
|
24
|
+
/**
|
|
25
|
+
* Set up adjacent slot positioning using Floating UI.
|
|
26
|
+
* Returns a cleanup function.
|
|
27
|
+
*/
|
|
28
|
+
export declare function setupAdjacentPositioning(container: HTMLElement, anchorEl: HTMLElement, config: PositionConfig): () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Set up inline slot positioning.
|
|
31
|
+
* Inline slots render content inside the anchor element.
|
|
32
|
+
*/
|
|
33
|
+
export declare function setupInlinePositioning(container: HTMLElement, anchorEl: HTMLElement, position?: "prepend" | "append"): () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Play enter animation on an element.
|
|
36
|
+
*/
|
|
37
|
+
export declare function playEnterAnimation(element: HTMLElement, animationType: AnimationType): Animation | null;
|
|
38
|
+
/**
|
|
39
|
+
* Play exit animation on an element.
|
|
40
|
+
* Returns a promise that resolves when the animation completes.
|
|
41
|
+
*/
|
|
42
|
+
export declare function playExitAnimation(element: HTMLElement, animationType: AnimationType): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Create and style a surface container element.
|
|
45
|
+
*/
|
|
46
|
+
export declare function createSurfaceContainer(slot: SurfaceSlot, id: string): HTMLElement;
|
|
47
|
+
/**
|
|
48
|
+
* Get the z-index for a slot type.
|
|
49
|
+
*/
|
|
50
|
+
export declare function getSlotZIndex(slot: SurfaceSlot): number;
|