@syntrologie/runtime-sdk 2.8.0-canary.155 → 2.8.0-canary.157
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/actions/schema.d.ts +26 -26
- package/dist/components/SyntroBottomSheet.d.ts +171 -0
- package/dist/components/SyntroCanvasOverlay.d.ts +14 -0
- package/dist/config/schema.d.ts +180 -180
- package/dist/context/ContextManager.d.ts +33 -1
- package/dist/context/types.d.ts +34 -0
- package/dist/controllers/ThemeController.d.ts +12 -12
- package/dist/events/normalizers/canvas.d.ts +16 -2
- package/dist/events/schema.d.ts +12 -12
- package/dist/index.js +1209 -671
- package/dist/index.js.map +4 -4
- package/dist/runtime.d.ts +6 -0
- package/dist/smart-canvas.esm.js +231 -183
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +1857 -1341
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +231 -183
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/actions/schema.d.ts
CHANGED
|
@@ -121,12 +121,12 @@ declare const WidgetConfigZ: z.ZodObject<{
|
|
|
121
121
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
122
122
|
}, "strict", z.ZodTypeAny, {
|
|
123
123
|
widgetId: string;
|
|
124
|
-
priority?: number | undefined;
|
|
125
124
|
props?: Record<string, unknown> | undefined;
|
|
125
|
+
priority?: number | undefined;
|
|
126
126
|
}, {
|
|
127
127
|
widgetId: string;
|
|
128
|
-
priority?: number | undefined;
|
|
129
128
|
props?: Record<string, unknown> | undefined;
|
|
129
|
+
priority?: number | undefined;
|
|
130
130
|
}>;
|
|
131
131
|
/**
|
|
132
132
|
* Tour step (schema-safe version).
|
|
@@ -4067,10 +4067,6 @@ declare const InsertHtmlZ: z.ZodObject<{
|
|
|
4067
4067
|
};
|
|
4068
4068
|
position: "before" | "after" | "prepend" | "append" | "replace";
|
|
4069
4069
|
html: string;
|
|
4070
|
-
deepLink?: {
|
|
4071
|
-
tileId: string;
|
|
4072
|
-
itemId?: string | undefined;
|
|
4073
|
-
} | undefined;
|
|
4074
4070
|
label?: string | undefined;
|
|
4075
4071
|
triggerWhen?: {
|
|
4076
4072
|
type: "rules";
|
|
@@ -4153,6 +4149,10 @@ declare const InsertHtmlZ: z.ZodObject<{
|
|
|
4153
4149
|
method?: "GET" | "POST" | undefined;
|
|
4154
4150
|
timeoutMs?: number | undefined;
|
|
4155
4151
|
} | null | undefined;
|
|
4152
|
+
deepLink?: {
|
|
4153
|
+
tileId: string;
|
|
4154
|
+
itemId?: string | undefined;
|
|
4155
|
+
} | undefined;
|
|
4156
4156
|
}, {
|
|
4157
4157
|
kind: "content:insertHtml";
|
|
4158
4158
|
anchorId: {
|
|
@@ -4161,10 +4161,6 @@ declare const InsertHtmlZ: z.ZodObject<{
|
|
|
4161
4161
|
};
|
|
4162
4162
|
position: "before" | "after" | "prepend" | "append" | "replace";
|
|
4163
4163
|
html: string;
|
|
4164
|
-
deepLink?: {
|
|
4165
|
-
tileId: string;
|
|
4166
|
-
itemId?: string | undefined;
|
|
4167
|
-
} | undefined;
|
|
4168
4164
|
label?: string | undefined;
|
|
4169
4165
|
triggerWhen?: {
|
|
4170
4166
|
type: "rules";
|
|
@@ -4247,6 +4243,10 @@ declare const InsertHtmlZ: z.ZodObject<{
|
|
|
4247
4243
|
method?: "GET" | "POST" | undefined;
|
|
4248
4244
|
timeoutMs?: number | undefined;
|
|
4249
4245
|
} | null | undefined;
|
|
4246
|
+
deepLink?: {
|
|
4247
|
+
tileId: string;
|
|
4248
|
+
itemId?: string | undefined;
|
|
4249
|
+
} | undefined;
|
|
4250
4250
|
}>;
|
|
4251
4251
|
declare const HighlightZ: z.ZodObject<{
|
|
4252
4252
|
kind: z.ZodLiteral<"overlays:highlight">;
|
|
@@ -9154,12 +9154,12 @@ declare const MountWidgetZ: z.ZodObject<{
|
|
|
9154
9154
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
9155
9155
|
}, "strict", z.ZodTypeAny, {
|
|
9156
9156
|
widgetId: string;
|
|
9157
|
-
priority?: number | undefined;
|
|
9158
9157
|
props?: Record<string, unknown> | undefined;
|
|
9158
|
+
priority?: number | undefined;
|
|
9159
9159
|
}, {
|
|
9160
9160
|
widgetId: string;
|
|
9161
|
-
priority?: number | undefined;
|
|
9162
9161
|
props?: Record<string, unknown> | undefined;
|
|
9162
|
+
priority?: number | undefined;
|
|
9163
9163
|
}>;
|
|
9164
9164
|
label: z.ZodOptional<z.ZodString>;
|
|
9165
9165
|
} & {
|
|
@@ -9653,8 +9653,8 @@ declare const MountWidgetZ: z.ZodObject<{
|
|
|
9653
9653
|
slot: string;
|
|
9654
9654
|
widget: {
|
|
9655
9655
|
widgetId: string;
|
|
9656
|
-
priority?: number | undefined;
|
|
9657
9656
|
props?: Record<string, unknown> | undefined;
|
|
9657
|
+
priority?: number | undefined;
|
|
9658
9658
|
};
|
|
9659
9659
|
label?: string | undefined;
|
|
9660
9660
|
triggerWhen?: {
|
|
@@ -9743,8 +9743,8 @@ declare const MountWidgetZ: z.ZodObject<{
|
|
|
9743
9743
|
slot: string;
|
|
9744
9744
|
widget: {
|
|
9745
9745
|
widgetId: string;
|
|
9746
|
-
priority?: number | undefined;
|
|
9747
9746
|
props?: Record<string, unknown> | undefined;
|
|
9747
|
+
priority?: number | undefined;
|
|
9748
9748
|
};
|
|
9749
9749
|
label?: string | undefined;
|
|
9750
9750
|
triggerWhen?: {
|
|
@@ -17291,10 +17291,6 @@ export declare const coreActionStepSchemas: ({
|
|
|
17291
17291
|
};
|
|
17292
17292
|
position: "before" | "after" | "prepend" | "append" | "replace";
|
|
17293
17293
|
html: string;
|
|
17294
|
-
deepLink?: {
|
|
17295
|
-
tileId: string;
|
|
17296
|
-
itemId?: string | undefined;
|
|
17297
|
-
} | undefined;
|
|
17298
17294
|
label?: string | undefined;
|
|
17299
17295
|
triggerWhen?: {
|
|
17300
17296
|
type: "rules";
|
|
@@ -17377,6 +17373,10 @@ export declare const coreActionStepSchemas: ({
|
|
|
17377
17373
|
method?: "GET" | "POST" | undefined;
|
|
17378
17374
|
timeoutMs?: number | undefined;
|
|
17379
17375
|
} | null | undefined;
|
|
17376
|
+
deepLink?: {
|
|
17377
|
+
tileId: string;
|
|
17378
|
+
itemId?: string | undefined;
|
|
17379
|
+
} | undefined;
|
|
17380
17380
|
}, {
|
|
17381
17381
|
kind: "content:insertHtml";
|
|
17382
17382
|
anchorId: {
|
|
@@ -17385,10 +17385,6 @@ export declare const coreActionStepSchemas: ({
|
|
|
17385
17385
|
};
|
|
17386
17386
|
position: "before" | "after" | "prepend" | "append" | "replace";
|
|
17387
17387
|
html: string;
|
|
17388
|
-
deepLink?: {
|
|
17389
|
-
tileId: string;
|
|
17390
|
-
itemId?: string | undefined;
|
|
17391
|
-
} | undefined;
|
|
17392
17388
|
label?: string | undefined;
|
|
17393
17389
|
triggerWhen?: {
|
|
17394
17390
|
type: "rules";
|
|
@@ -17471,6 +17467,10 @@ export declare const coreActionStepSchemas: ({
|
|
|
17471
17467
|
method?: "GET" | "POST" | undefined;
|
|
17472
17468
|
timeoutMs?: number | undefined;
|
|
17473
17469
|
} | null | undefined;
|
|
17470
|
+
deepLink?: {
|
|
17471
|
+
tileId: string;
|
|
17472
|
+
itemId?: string | undefined;
|
|
17473
|
+
} | undefined;
|
|
17474
17474
|
}>;
|
|
17475
17475
|
} | {
|
|
17476
17476
|
defName: string;
|
|
@@ -22394,12 +22394,12 @@ export declare const coreActionStepSchemas: ({
|
|
|
22394
22394
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
22395
22395
|
}, "strict", z.ZodTypeAny, {
|
|
22396
22396
|
widgetId: string;
|
|
22397
|
-
priority?: number | undefined;
|
|
22398
22397
|
props?: Record<string, unknown> | undefined;
|
|
22398
|
+
priority?: number | undefined;
|
|
22399
22399
|
}, {
|
|
22400
22400
|
widgetId: string;
|
|
22401
|
-
priority?: number | undefined;
|
|
22402
22401
|
props?: Record<string, unknown> | undefined;
|
|
22402
|
+
priority?: number | undefined;
|
|
22403
22403
|
}>;
|
|
22404
22404
|
label: z.ZodOptional<z.ZodString>;
|
|
22405
22405
|
} & {
|
|
@@ -22893,8 +22893,8 @@ export declare const coreActionStepSchemas: ({
|
|
|
22893
22893
|
slot: string;
|
|
22894
22894
|
widget: {
|
|
22895
22895
|
widgetId: string;
|
|
22896
|
-
priority?: number | undefined;
|
|
22897
22896
|
props?: Record<string, unknown> | undefined;
|
|
22897
|
+
priority?: number | undefined;
|
|
22898
22898
|
};
|
|
22899
22899
|
label?: string | undefined;
|
|
22900
22900
|
triggerWhen?: {
|
|
@@ -22983,8 +22983,8 @@ export declare const coreActionStepSchemas: ({
|
|
|
22983
22983
|
slot: string;
|
|
22984
22984
|
widget: {
|
|
22985
22985
|
widgetId: string;
|
|
22986
|
-
priority?: number | undefined;
|
|
22987
22986
|
props?: Record<string, unknown> | undefined;
|
|
22987
|
+
priority?: number | undefined;
|
|
22988
22988
|
};
|
|
22989
22989
|
label?: string | undefined;
|
|
22990
22990
|
triggerWhen?: {
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SyntroBottomSheet — mobile-mode equivalent of {@link SyntroDrawer}.
|
|
3
|
+
*
|
|
4
|
+
* On phone-sized viewports a side-aligned 380px panel feels foreign.
|
|
5
|
+
* Visitors expect the iOS / Telegram pattern: tap launcher → sheet rises
|
|
6
|
+
* from the bottom edge, three snap points (peek / mid / full), drag-handle
|
|
7
|
+
* dismiss, and nested-scroll handoff so dragging on long content scrolls
|
|
8
|
+
* the content first and only takes over the sheet once the content has
|
|
9
|
+
* reached its top.
|
|
10
|
+
*
|
|
11
|
+
* **Geometry:** ``position: fixed; left:0; right:0; bottom:0;
|
|
12
|
+
* height: 100vh`` with a vertical ``translateY()`` to position the
|
|
13
|
+
* **top edge** of the sheet at the active snap point. ``height = 100vh``
|
|
14
|
+
* keeps the sheet's bottom anchored even when the snap point moves —
|
|
15
|
+
* the content area below the handle just expands. Inner padding uses
|
|
16
|
+
* ``env(safe-area-inset-bottom)`` so the iPhone home indicator doesn't
|
|
17
|
+
* eat the last row of tiles.
|
|
18
|
+
*
|
|
19
|
+
* **Snap points** (vh percentages, peek default 30, mid 70, full 95)
|
|
20
|
+
* are configurable via ``theme.canvas.snapPoints``. ``peek`` is the
|
|
21
|
+
* lowest position the sheet rests at — dragging below peek with a
|
|
22
|
+
* downward velocity dispatches ``canvas-toggle`` (close) rather than
|
|
23
|
+
* snapping back. The translateY is computed as ``(100 - snapVh)%``.
|
|
24
|
+
*
|
|
25
|
+
* **Drag handle** is a 44px-tall touch target across the top, matching
|
|
26
|
+
* Apple's recommended minimum for finger taps. ``pointerdown`` here
|
|
27
|
+
* always treats the gesture as sheet drag — no nested-scroll
|
|
28
|
+
* negotiation. The grabber pill (4×40px) inside it is purely visual.
|
|
29
|
+
*
|
|
30
|
+
* **Drag on content** uses the standard iOS handoff: when the touch
|
|
31
|
+
* lands inside the content scroll container *and* the container has
|
|
32
|
+
* ``scrollTop > 0``, the content scrolls and the sheet stays put. Once
|
|
33
|
+
* the content reaches ``scrollTop === 0`` and the user keeps dragging
|
|
34
|
+
* down, the sheet takes over (decided lazily at first ``pointermove``).
|
|
35
|
+
*
|
|
36
|
+
* **Snap-on-release** computes velocity from the last ~100ms of
|
|
37
|
+
* pointermove samples. ``|velocity| > 0.5px/ms`` → step one snap in the
|
|
38
|
+
* fling direction. Otherwise → nearest snap by current position. Below
|
|
39
|
+
* peek with downward intent → dismiss.
|
|
40
|
+
*
|
|
41
|
+
* **Animation** reuses ``themeConfig.canvas.transitionDuration`` and
|
|
42
|
+
* ``transitionEasing`` (same tokens as the drawer). Transition is
|
|
43
|
+
* disabled during active drag and re-enabled at release so the snap
|
|
44
|
+
* animates smoothly.
|
|
45
|
+
*
|
|
46
|
+
* Decorator-free (matches drawer): uses ``static override properties``.
|
|
47
|
+
*/
|
|
48
|
+
import { LitElement, nothing } from 'lit';
|
|
49
|
+
import type { SmartCanvasRuntime } from '../runtime.js';
|
|
50
|
+
import type { TelemetryClient } from '../telemetry/types.js';
|
|
51
|
+
import type { TileConfig } from '../types.js';
|
|
52
|
+
import './SyntroTileStack.js';
|
|
53
|
+
export interface BottomSheetSnapPoints {
|
|
54
|
+
/** Lowest rest position. Drag below this with downward intent → dismiss. */
|
|
55
|
+
peek?: number;
|
|
56
|
+
/** Default open position when the sheet first appears. */
|
|
57
|
+
mid?: number;
|
|
58
|
+
/** Maximum height. Sheet won't grow past this even if dragged up further. */
|
|
59
|
+
full?: number;
|
|
60
|
+
}
|
|
61
|
+
export interface BottomSheetThemeConfig {
|
|
62
|
+
canvas: {
|
|
63
|
+
transitionDuration?: string;
|
|
64
|
+
transitionEasing?: string;
|
|
65
|
+
border?: string;
|
|
66
|
+
blur?: string;
|
|
67
|
+
snapPoints?: BottomSheetSnapPoints;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
type SnapName = 'peek' | 'mid' | 'full';
|
|
71
|
+
export declare class SyntroBottomSheet extends LitElement {
|
|
72
|
+
static properties: {
|
|
73
|
+
isOpen: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
};
|
|
76
|
+
tiles: {
|
|
77
|
+
attribute: boolean;
|
|
78
|
+
};
|
|
79
|
+
isLoading: {
|
|
80
|
+
type: BooleanConstructor;
|
|
81
|
+
};
|
|
82
|
+
error: {
|
|
83
|
+
type: StringConstructor;
|
|
84
|
+
};
|
|
85
|
+
canvasTitle: {
|
|
86
|
+
type: StringConstructor;
|
|
87
|
+
};
|
|
88
|
+
runtimeRef: {
|
|
89
|
+
attribute: boolean;
|
|
90
|
+
};
|
|
91
|
+
telemetry: {
|
|
92
|
+
attribute: boolean;
|
|
93
|
+
};
|
|
94
|
+
themeConfig: {
|
|
95
|
+
attribute: boolean;
|
|
96
|
+
};
|
|
97
|
+
snap: {
|
|
98
|
+
attribute: boolean;
|
|
99
|
+
};
|
|
100
|
+
dragOffsetVh: {
|
|
101
|
+
attribute: boolean;
|
|
102
|
+
};
|
|
103
|
+
isDragging: {
|
|
104
|
+
attribute: boolean;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
isOpen: boolean;
|
|
108
|
+
tiles: TileConfig[];
|
|
109
|
+
isLoading: boolean;
|
|
110
|
+
error: string | undefined;
|
|
111
|
+
canvasTitle: string | undefined;
|
|
112
|
+
runtimeRef: SmartCanvasRuntime | null;
|
|
113
|
+
telemetry: TelemetryClient | null;
|
|
114
|
+
themeConfig: BottomSheetThemeConfig;
|
|
115
|
+
snap: SnapName;
|
|
116
|
+
/** Live drag offset in vh — added to the active snap's translateY
|
|
117
|
+
* during an in-progress drag. Reset to 0 on release. */
|
|
118
|
+
dragOffsetVh: number;
|
|
119
|
+
isDragging: boolean;
|
|
120
|
+
private _activePointerId;
|
|
121
|
+
private _dragStartY;
|
|
122
|
+
private _dragStartSnap;
|
|
123
|
+
private _samples;
|
|
124
|
+
/** True once the gesture has committed to dragging the sheet. Used to
|
|
125
|
+
* defer the nested-scroll-vs-sheet decision until the first move. */
|
|
126
|
+
private _gestureCommitted;
|
|
127
|
+
/** True if the pointerdown landed on the drag handle. Handle gestures
|
|
128
|
+
* always commit to sheet-drag without nested-scroll negotiation. */
|
|
129
|
+
private _gestureFromHandle;
|
|
130
|
+
/** Cached scroll container ref so we can check ``scrollTop`` cheaply
|
|
131
|
+
* during pointermove without re-querying. */
|
|
132
|
+
private _scrollEl;
|
|
133
|
+
private _onDocumentMousedown;
|
|
134
|
+
createRenderRoot(): this;
|
|
135
|
+
private get _canvas();
|
|
136
|
+
private get _duration();
|
|
137
|
+
private get _easing();
|
|
138
|
+
private get _border();
|
|
139
|
+
private get _blur();
|
|
140
|
+
/** Resolved snap-point heights (vh). */
|
|
141
|
+
private get snapPoints();
|
|
142
|
+
/** Top-edge position in vh (from top of viewport) for the active snap
|
|
143
|
+
* plus any in-progress drag offset. Higher value = sheet sits lower. */
|
|
144
|
+
private get _topEdgeVh();
|
|
145
|
+
connectedCallback(): void;
|
|
146
|
+
disconnectedCallback(): void;
|
|
147
|
+
updated(changed: Map<string, unknown>): void;
|
|
148
|
+
/** Convert a vertical pointer delta (px, downward = positive) to a vh
|
|
149
|
+
* offset. Used during drag and for velocity calculations. */
|
|
150
|
+
private _pxToVh;
|
|
151
|
+
/** Velocity in vh/ms over the last ``VELOCITY_SAMPLE_WINDOW_MS``. */
|
|
152
|
+
private _computeVelocityVhPerMs;
|
|
153
|
+
/** Pick the destination snap from the current top-edge position
|
|
154
|
+
* (without drag offset overriding the active snap), velocity, and
|
|
155
|
+
* fling threshold. Returns ``null`` to indicate dismiss. */
|
|
156
|
+
private _decideSnapOnRelease;
|
|
157
|
+
/** Adapter: ``_computeVelocityVhPerMs`` returns vh/ms; the threshold is
|
|
158
|
+
* expressed in px/ms (matching existing iOS conventions). Convert
|
|
159
|
+
* back so the comparison is unit-correct. */
|
|
160
|
+
private _pxToVelocityForDecision;
|
|
161
|
+
private _onPointerDown;
|
|
162
|
+
private _onPointerMove;
|
|
163
|
+
private _onPointerUp;
|
|
164
|
+
render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
165
|
+
}
|
|
166
|
+
declare global {
|
|
167
|
+
interface HTMLElementTagNameMap {
|
|
168
|
+
'syntro-bottom-sheet': SyntroBottomSheet;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
export {};
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* experimentalDecorators).
|
|
24
24
|
*/
|
|
25
25
|
import { LitElement } from 'lit';
|
|
26
|
+
import './SyntroBottomSheet.js';
|
|
26
27
|
import type { SmartCanvasRuntime } from '../runtime.js';
|
|
27
28
|
import type { TelemetryClient } from '../telemetry/types.js';
|
|
28
29
|
import type { TileConfig } from '../types.js';
|
|
@@ -58,6 +59,9 @@ export declare class SyntroCanvasOverlay extends LitElement {
|
|
|
58
59
|
launcherAnimate: {
|
|
59
60
|
type: BooleanConstructor;
|
|
60
61
|
};
|
|
62
|
+
isMobileMode: {
|
|
63
|
+
attribute: boolean;
|
|
64
|
+
};
|
|
61
65
|
};
|
|
62
66
|
isOpen: boolean;
|
|
63
67
|
tiles: TileConfig[];
|
|
@@ -69,7 +73,15 @@ export declare class SyntroCanvasOverlay extends LitElement {
|
|
|
69
73
|
telemetry: TelemetryClient | null;
|
|
70
74
|
themeConfig: Record<string, any>;
|
|
71
75
|
launcherAnimate: boolean;
|
|
76
|
+
/** Tracks ``runtime.context.surface.mode === 'mobile'`` so the
|
|
77
|
+
* template can switch between ``<syntro-drawer>`` and
|
|
78
|
+
* ``<syntro-bottom-sheet>``. Agent surfaces are handled at a higher
|
|
79
|
+
* level by ``SmartCanvasElementLit`` (which renders inline-shell
|
|
80
|
+
* before this overlay ever mounts), so this overlay only ever runs
|
|
81
|
+
* on web — mobile vs desktop is the only branch it needs. */
|
|
82
|
+
isMobileMode: boolean;
|
|
72
83
|
private _notifications;
|
|
84
|
+
private _surfaceUnsub;
|
|
73
85
|
/** Prev-state map: entry.id → last evaluated boolean */
|
|
74
86
|
private _notifyPrevState;
|
|
75
87
|
/** Unsubscribe for the EventBus notify-watcher subscription */
|
|
@@ -80,12 +92,14 @@ export declare class SyntroCanvasOverlay extends LitElement {
|
|
|
80
92
|
createRenderRoot(): this;
|
|
81
93
|
connectedCallback(): void;
|
|
82
94
|
disconnectedCallback(): void;
|
|
95
|
+
private _subscribeSurface;
|
|
83
96
|
updated(changed: Map<string, unknown>): void;
|
|
84
97
|
private _syncNotificationsController;
|
|
85
98
|
private _startNotifyWatcher;
|
|
86
99
|
private _stopNotifyWatcher;
|
|
87
100
|
private _restartNotifyWatcher;
|
|
88
101
|
private _trackTilesViewed;
|
|
102
|
+
private _surfaceMeta;
|
|
89
103
|
private _toggle;
|
|
90
104
|
private _handleNotificationClick;
|
|
91
105
|
private _handleNotificationDismiss;
|