@syntrologie/runtime-sdk 2.13.0 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/SmartCanvasElementLit.d.ts +166 -0
- package/dist/actions/schema.d.ts +776 -776
- package/dist/actions/schema.js +4 -3
- package/dist/actions/types.d.ts +8 -2
- package/dist/anchor/AnchorResolver.d.ts +1 -0
- package/dist/api-lit.d.ts +84 -0
- package/dist/apps/builtinRuntimeModules-lit.d.ts +20 -0
- package/dist/bootstrap-types.d.ts +10 -0
- package/dist/chunk-2IQ2PTLJ.js +871 -0
- package/dist/chunk-2IQ2PTLJ.js.map +7 -0
- package/dist/chunk-4HXPGXUC.js +226 -0
- package/dist/chunk-4HXPGXUC.js.map +7 -0
- package/dist/{chunk-GF364MMB.js → chunk-CVMZW3II.js} +1102 -1098
- package/dist/chunk-CVMZW3II.js.map +7 -0
- package/dist/{chunk-XDYJ64IN.js → chunk-GX7BBYX6.js} +4 -4
- package/dist/chunk-GX7BBYX6.js.map +7 -0
- package/dist/chunk-JMHRHAEL.js +18 -0
- package/dist/chunk-JMHRHAEL.js.map +7 -0
- package/dist/{chunk-L6RJMBR2.js → chunk-XVRDKBYF.js} +3 -3
- package/dist/components/ShadowCanvasOverlay.d.ts +1 -2
- package/dist/components/SyntroCanvasOverlay.d.ts +100 -0
- package/dist/components/SyntroDrawer.d.ts +110 -0
- package/dist/components/SyntroLauncher.d.ts +105 -0
- package/dist/components/SyntroTileCard.d.ts +74 -0
- package/dist/components/SyntroTileWheel.d.ts +51 -0
- package/dist/config/schema.d.ts +147 -136
- package/dist/config/schema.js +3 -2
- package/dist/controllers/DecisionController.d.ts +48 -0
- package/dist/controllers/NotificationsController.d.ts +59 -0
- package/dist/controllers/RuntimeController.d.ts +52 -0
- package/dist/controllers/RuntimeEventsController.d.ts +42 -0
- package/dist/controllers/ThemeController.d.ts +110 -0
- package/dist/controllers/index.d.ts +13 -0
- package/dist/decisions/schema.d.ts +47 -47
- package/dist/decisions/schema.js +2 -1
- package/dist/decisions/types.d.ts +4 -0
- package/dist/editorLoader.d.ts +5 -0
- package/dist/fetchers/experimentsFetcher.d.ts +3 -3
- package/dist/fetchers/mergeConfigs.d.ts +7 -7
- package/dist/index-lit.d.ts +40 -0
- package/dist/index.js +1264 -19
- package/dist/index.js.map +4 -4
- package/dist/interop/LitInReact.d.ts +27 -0
- package/dist/interop/ReactInLit.d.ts +42 -0
- package/dist/interop/index.d.ts +7 -0
- package/dist/metrics/sessionMetrics.d.ts +4 -0
- package/dist/notifications/SyntroToastStack.d.ts +43 -0
- package/dist/react-compat.d.ts +114 -0
- package/dist/react.js +6 -4
- package/dist/react.js.map +1 -1
- package/dist/smart-canvas.esm.js +856 -240
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +31387 -39860
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +855 -240
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/theme/index.js +30 -0
- package/dist/theme/index.js.map +7 -0
- package/dist/version.d.ts +1 -1
- package/package.json +10 -1
- package/schema/canvas-config.schema.json +2347 -11396
- package/dist/chunk-BU4Z6PD7.js +0 -218
- package/dist/chunk-BU4Z6PD7.js.map +0 -7
- package/dist/chunk-GF364MMB.js.map +0 -7
- package/dist/chunk-XDYJ64IN.js.map +0 -7
- /package/dist/{chunk-L6RJMBR2.js.map → chunk-XVRDKBYF.js.map} +0 -0
package/dist/config/schema.js
CHANGED
|
@@ -12,8 +12,9 @@ import {
|
|
|
12
12
|
TileNotificationRuleZ,
|
|
13
13
|
TileZ,
|
|
14
14
|
configSchemas
|
|
15
|
-
} from "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
} from "../chunk-GX7BBYX6.js";
|
|
16
|
+
import "../chunk-4HXPGXUC.js";
|
|
17
|
+
import "../chunk-JMHRHAEL.js";
|
|
17
18
|
export {
|
|
18
19
|
CanvasConfigResponseZ,
|
|
19
20
|
CanvasElementConfigZ,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DecisionController
|
|
3
|
+
*
|
|
4
|
+
* A Lit ReactiveController that replaces the `useDecision()` React hook
|
|
5
|
+
* from RuntimeProvider.tsx. Evaluates a DecisionStrategy against the runtime
|
|
6
|
+
* when the host element connects and exposes the result as reactive properties.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```ts
|
|
10
|
+
* class MyElement extends LitElement {
|
|
11
|
+
* private _decision = new DecisionController(
|
|
12
|
+
* this,
|
|
13
|
+
* runtime,
|
|
14
|
+
* strategy,
|
|
15
|
+
* false // defaultValue
|
|
16
|
+
* );
|
|
17
|
+
*
|
|
18
|
+
* render() {
|
|
19
|
+
* if (this._decision.isLoading) return html`...`;
|
|
20
|
+
* return this._decision.value ? html`<shown-content>` : html``;
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
26
|
+
import type { DecisionStrategy } from '../decisions/types.js';
|
|
27
|
+
import type { SmartCanvasRuntime } from '../runtime.js';
|
|
28
|
+
export declare class DecisionController<T> implements ReactiveController {
|
|
29
|
+
private _host;
|
|
30
|
+
private _runtime;
|
|
31
|
+
private _strategy;
|
|
32
|
+
private _defaultValue;
|
|
33
|
+
private _value;
|
|
34
|
+
private _isFallback;
|
|
35
|
+
private _isLoading;
|
|
36
|
+
private _cancelled;
|
|
37
|
+
constructor(host: ReactiveControllerHost, runtime: SmartCanvasRuntime | null | undefined, strategy: DecisionStrategy<T> | null | undefined, defaultValue: T);
|
|
38
|
+
get value(): T;
|
|
39
|
+
get isFallback(): boolean;
|
|
40
|
+
get isLoading(): boolean;
|
|
41
|
+
hostConnected(): void;
|
|
42
|
+
hostDisconnected(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Update the strategy and re-evaluate. Triggers a host update when done.
|
|
45
|
+
*/
|
|
46
|
+
setStrategy(strategy: DecisionStrategy<T> | null | undefined): void;
|
|
47
|
+
private _evaluate;
|
|
48
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
import type { EventBus } from '../events/EventBus.js';
|
|
3
|
+
import type { ActiveNotification } from '../notifications/types.js';
|
|
4
|
+
import type { TileConfig } from '../types.js';
|
|
5
|
+
/**
|
|
6
|
+
* NotificationsController — Lit ReactiveController equivalent of useNotifications().
|
|
7
|
+
*
|
|
8
|
+
* Subscribes to the EventBus, evaluates notification rules from tile configs,
|
|
9
|
+
* and manages the active toast queue.
|
|
10
|
+
*
|
|
11
|
+
* Features:
|
|
12
|
+
* - Max 3 visible toasts (FIFO eviction when exceeded)
|
|
13
|
+
* - Deduplication by tileId + itemId
|
|
14
|
+
* - Cooldown per rule (prevents rapid re-firing)
|
|
15
|
+
* - Auto-dismiss after TTL
|
|
16
|
+
* - Publishes NOTIFICATION_SHOWN / NOTIFICATION_DISMISSED telemetry events
|
|
17
|
+
*
|
|
18
|
+
* Usage (decorator-free):
|
|
19
|
+
* class MyElement extends LitElement {
|
|
20
|
+
* private _notifications: NotificationsController;
|
|
21
|
+
*
|
|
22
|
+
* constructor() {
|
|
23
|
+
* super();
|
|
24
|
+
* this._notifications = new NotificationsController(this, eventBus, tiles);
|
|
25
|
+
* }
|
|
26
|
+
*
|
|
27
|
+
* render() {
|
|
28
|
+
* return html`${this._notifications.notifications.map(...)}`;
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
*/
|
|
32
|
+
export declare class NotificationsController implements ReactiveController {
|
|
33
|
+
private host;
|
|
34
|
+
private eventBus;
|
|
35
|
+
private tiles;
|
|
36
|
+
private _notifications;
|
|
37
|
+
private _cooldownMap;
|
|
38
|
+
private _timerIds;
|
|
39
|
+
private _unsubscribe;
|
|
40
|
+
constructor(host: ReactiveControllerHost, eventBus: EventBus | null, tiles: TileConfig[]);
|
|
41
|
+
/** Returns the current list of active (visible) notifications. */
|
|
42
|
+
get notifications(): ActiveNotification[];
|
|
43
|
+
/** Update the tile configs (and thus notification rules) after construction. */
|
|
44
|
+
setTiles(tiles: TileConfig[]): void;
|
|
45
|
+
/**
|
|
46
|
+
* Swap the EventBus after construction (e.g. when runtimeRef changes).
|
|
47
|
+
* Tears down the existing subscription and re-subscribes on the new bus.
|
|
48
|
+
*/
|
|
49
|
+
setEventBus(eventBus: EventBus | null): void;
|
|
50
|
+
hostConnected(): void;
|
|
51
|
+
hostDisconnected(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Manually dismiss a notification by ID.
|
|
54
|
+
* Cancels its auto-dismiss timer and publishes NOTIFICATION_DISMISSED.
|
|
55
|
+
*/
|
|
56
|
+
dismiss(id: string): void;
|
|
57
|
+
private _publishDismissed;
|
|
58
|
+
private _scheduleDismiss;
|
|
59
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RuntimeController — Lit ReactiveController equivalent of the React runtime hooks.
|
|
3
|
+
*
|
|
4
|
+
* Replaces the following hooks from RuntimeProvider.tsx for Lit-based components:
|
|
5
|
+
* useRuntime() → controller.runtime
|
|
6
|
+
* useRuntimeContext() → controller.context
|
|
7
|
+
* usePageContext() → controller.page
|
|
8
|
+
* useSessionContext() → controller.session
|
|
9
|
+
* useViewportContext() → controller.viewport
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* class MyElement extends LitElement {
|
|
13
|
+
* static override properties = { ... };
|
|
14
|
+
*
|
|
15
|
+
* #runtimeCtrl = new RuntimeController(this, myRuntime);
|
|
16
|
+
*
|
|
17
|
+
* override render() {
|
|
18
|
+
* const page = this.#runtimeCtrl.page;
|
|
19
|
+
* return html`<p>${page?.url}</p>`;
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* The controller subscribes to runtime.context.subscribe() when the host connects
|
|
24
|
+
* to the DOM and calls host.requestUpdate() on every context change, mirroring
|
|
25
|
+
* the React useState/useEffect pattern in RuntimeProvider.
|
|
26
|
+
*
|
|
27
|
+
* Decorator-free: relies on static `properties` declarations on the host element
|
|
28
|
+
* instead of @property / @state decorators (tsconfig does not enable
|
|
29
|
+
* experimentalDecorators).
|
|
30
|
+
*/
|
|
31
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
32
|
+
import type { PageContext, RuntimeContext, SessionContext, ViewportContext } from '../context/types.js';
|
|
33
|
+
import type { SmartCanvasRuntime } from '../runtime.js';
|
|
34
|
+
export declare class RuntimeController implements ReactiveController {
|
|
35
|
+
readonly host: ReactiveControllerHost;
|
|
36
|
+
private readonly _runtime;
|
|
37
|
+
private _context;
|
|
38
|
+
private _unsubscribe;
|
|
39
|
+
constructor(host: ReactiveControllerHost, runtime: SmartCanvasRuntime);
|
|
40
|
+
hostConnected(): void;
|
|
41
|
+
hostDisconnected(): void;
|
|
42
|
+
/** The SmartCanvasRuntime instance (equivalent to useRuntime()). */
|
|
43
|
+
get runtime(): SmartCanvasRuntime;
|
|
44
|
+
/** Current reactive RuntimeContext snapshot (equivalent to useRuntimeContext()). */
|
|
45
|
+
get context(): RuntimeContext | null;
|
|
46
|
+
/** Current page context (equivalent to usePageContext()). */
|
|
47
|
+
get page(): PageContext | null;
|
|
48
|
+
/** Current session context (equivalent to useSessionContext()). */
|
|
49
|
+
get session(): SessionContext | null;
|
|
50
|
+
/** Current viewport context (equivalent to useViewportContext()). */
|
|
51
|
+
get viewport(): ViewportContext | null;
|
|
52
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RuntimeEventsController
|
|
3
|
+
*
|
|
4
|
+
* A Lit ReactiveController that replaces the `useRuntimeEvents()` React hook
|
|
5
|
+
* from RuntimeProvider.tsx. Subscribes to the runtime event bus when the host
|
|
6
|
+
* element connects to the DOM and unsubscribes when it disconnects.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```ts
|
|
10
|
+
* class MyElement extends LitElement {
|
|
11
|
+
* private _events = new RuntimeEventsController(
|
|
12
|
+
* this,
|
|
13
|
+
* runtime,
|
|
14
|
+
* { names: ['ui.click'] },
|
|
15
|
+
* (event) => { ... }
|
|
16
|
+
* );
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
21
|
+
import type { EventFilter, NormalizedEvent } from '../events/types.js';
|
|
22
|
+
import type { SmartCanvasRuntime } from '../runtime.js';
|
|
23
|
+
export type { EventFilter };
|
|
24
|
+
export declare class RuntimeEventsController implements ReactiveController {
|
|
25
|
+
private _host;
|
|
26
|
+
private _runtime;
|
|
27
|
+
private _filter;
|
|
28
|
+
private _callback;
|
|
29
|
+
private _unsubscribe;
|
|
30
|
+
constructor(host: ReactiveControllerHost, runtime: SmartCanvasRuntime | null | undefined, filter: EventFilter | undefined, callback: (event: NormalizedEvent) => void);
|
|
31
|
+
hostConnected(): void;
|
|
32
|
+
hostDisconnected(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Update the event filter. Resubscribes immediately if the host is connected.
|
|
35
|
+
*/
|
|
36
|
+
setFilter(filter: EventFilter | undefined): void;
|
|
37
|
+
/**
|
|
38
|
+
* Update the event callback. Resubscribes immediately if the host is connected.
|
|
39
|
+
*/
|
|
40
|
+
setCallback(callback: (event: NormalizedEvent) => void): void;
|
|
41
|
+
private _subscribe;
|
|
42
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ThemeController — Lit ReactiveController replacing ThemeProvider + useTheme.
|
|
3
|
+
*
|
|
4
|
+
* Merges theme config with defaults, flattens to CSS variables,
|
|
5
|
+
* and injects them into the host's shadow root.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
8
|
+
import type { CanvasThemeConfig } from '../theme/types.js';
|
|
9
|
+
export interface ThemeState {
|
|
10
|
+
config: Required<CanvasThemeConfig>;
|
|
11
|
+
mode: 'light' | 'dark';
|
|
12
|
+
cssVariables: Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
export declare class ThemeController implements ReactiveController {
|
|
15
|
+
#private;
|
|
16
|
+
get config(): Required<{
|
|
17
|
+
content?: {
|
|
18
|
+
background?: string | undefined;
|
|
19
|
+
border?: string | undefined;
|
|
20
|
+
backgroundHover?: string | undefined;
|
|
21
|
+
borderRadius?: string | undefined;
|
|
22
|
+
textColor?: string | undefined;
|
|
23
|
+
bodyPadding?: string | undefined;
|
|
24
|
+
textSecondaryColor?: string | undefined;
|
|
25
|
+
itemDivider?: string | undefined;
|
|
26
|
+
itemGap?: string | undefined;
|
|
27
|
+
itemPadding?: string | undefined;
|
|
28
|
+
itemFontSize?: string | undefined;
|
|
29
|
+
bodyFontSize?: string | undefined;
|
|
30
|
+
categoryPadding?: string | undefined;
|
|
31
|
+
categoryGap?: string | undefined;
|
|
32
|
+
categoryFontSize?: string | undefined;
|
|
33
|
+
searchBackground?: string | undefined;
|
|
34
|
+
searchColor?: string | undefined;
|
|
35
|
+
chevronColor?: string | undefined;
|
|
36
|
+
} | undefined;
|
|
37
|
+
overlay?: {
|
|
38
|
+
background?: string | undefined;
|
|
39
|
+
border?: string | undefined;
|
|
40
|
+
borderRadius?: string | undefined;
|
|
41
|
+
titleColor?: string | undefined;
|
|
42
|
+
textColor?: string | undefined;
|
|
43
|
+
arrowColor?: string | undefined;
|
|
44
|
+
arrowSize?: string | undefined;
|
|
45
|
+
scrimOpacity?: string | undefined;
|
|
46
|
+
highlightRing?: string | undefined;
|
|
47
|
+
} | undefined;
|
|
48
|
+
borderRadius?: string | undefined;
|
|
49
|
+
mode?: "dark" | "light" | undefined;
|
|
50
|
+
fontFamily?: string | undefined;
|
|
51
|
+
colorPrimary?: string | undefined;
|
|
52
|
+
colorPrimaryHover?: string | undefined;
|
|
53
|
+
canvas?: {
|
|
54
|
+
position?: "right" | "left" | undefined;
|
|
55
|
+
layout?: "push" | "overlay" | undefined;
|
|
56
|
+
background?: string | undefined;
|
|
57
|
+
blur?: string | undefined;
|
|
58
|
+
border?: string | undefined;
|
|
59
|
+
width?: string | undefined;
|
|
60
|
+
transitionDuration?: string | undefined;
|
|
61
|
+
transitionEasing?: string | undefined;
|
|
62
|
+
transitionFade?: string | undefined;
|
|
63
|
+
} | undefined;
|
|
64
|
+
launcher?: {
|
|
65
|
+
size?: string | undefined;
|
|
66
|
+
icon?: string | undefined;
|
|
67
|
+
background?: string | undefined;
|
|
68
|
+
backgroundHover?: string | undefined;
|
|
69
|
+
color?: string | undefined;
|
|
70
|
+
shadow?: string | undefined;
|
|
71
|
+
borderRadius?: string | undefined;
|
|
72
|
+
} | undefined;
|
|
73
|
+
tile?: {
|
|
74
|
+
background?: string | undefined;
|
|
75
|
+
border?: string | undefined;
|
|
76
|
+
backgroundHover?: string | undefined;
|
|
77
|
+
shadow?: string | undefined;
|
|
78
|
+
borderRadius?: string | undefined;
|
|
79
|
+
titleColor?: string | undefined;
|
|
80
|
+
textColor?: string | undefined;
|
|
81
|
+
iconBackground?: string | undefined;
|
|
82
|
+
iconShadow?: string | undefined;
|
|
83
|
+
headerPadding?: string | undefined;
|
|
84
|
+
bodyPadding?: string | undefined;
|
|
85
|
+
gap?: string | undefined;
|
|
86
|
+
} | undefined;
|
|
87
|
+
notification?: {
|
|
88
|
+
background?: string | undefined;
|
|
89
|
+
border?: string | undefined;
|
|
90
|
+
borderRadius?: string | undefined;
|
|
91
|
+
textColor?: string | undefined;
|
|
92
|
+
iconBackground?: string | undefined;
|
|
93
|
+
textSecondaryColor?: string | undefined;
|
|
94
|
+
successColor?: string | undefined;
|
|
95
|
+
warningColor?: string | undefined;
|
|
96
|
+
errorColor?: string | undefined;
|
|
97
|
+
progressGradient?: string | undefined;
|
|
98
|
+
} | undefined;
|
|
99
|
+
}>;
|
|
100
|
+
get mode(): "dark" | "light";
|
|
101
|
+
get cssVariables(): Record<string, string>;
|
|
102
|
+
constructor(host: ReactiveControllerHost & HTMLElement, themeConfig?: CanvasThemeConfig, workspaceTheme?: CanvasThemeConfig);
|
|
103
|
+
hostConnected(): void;
|
|
104
|
+
hostDisconnected(): void;
|
|
105
|
+
hostUpdated(): void;
|
|
106
|
+
/**
|
|
107
|
+
* Update theme config and re-compute + re-inject CSS variables.
|
|
108
|
+
*/
|
|
109
|
+
setThemeConfig(themeConfig: CanvasThemeConfig, workspaceTheme?: CanvasThemeConfig): void;
|
|
110
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lit ReactiveControllers — replacements for React hooks.
|
|
3
|
+
*
|
|
4
|
+
* These controllers provide the same reactive state management as the
|
|
5
|
+
* React hooks in RuntimeProvider.tsx and notification hooks, but work
|
|
6
|
+
* with any LitElement host via the ReactiveController protocol.
|
|
7
|
+
*/
|
|
8
|
+
export { DecisionController } from './DecisionController.js';
|
|
9
|
+
export { NotificationsController } from './NotificationsController.js';
|
|
10
|
+
export { RuntimeController } from './RuntimeController.js';
|
|
11
|
+
export { RuntimeEventsController } from './RuntimeEventsController.js';
|
|
12
|
+
export type { ThemeState } from './ThemeController.js';
|
|
13
|
+
export { ThemeController } from './ThemeController.js';
|