@syntrologie/runtime-sdk 2.4.1 → 2.6.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 +66 -1
- package/dist/SmartCanvasApp.d.ts +5 -3
- package/dist/actions/executors/index.d.ts +1 -2
- package/dist/actions/index.d.ts +2 -2
- package/dist/actions/schema.d.ts +19111 -20709
- package/dist/actions/schema.js +5 -2
- package/dist/actions/types.d.ts +45 -48
- package/dist/anchor/AnchorResolver.d.ts +18 -0
- package/dist/anchor/index.d.ts +2 -0
- package/dist/api.d.ts +3 -8
- package/dist/apps/examples/gamification-app.example.d.ts +8 -8
- package/dist/{chunk-4NYS7GAW.js → chunk-BU4Z6PD7.js} +45 -7
- package/dist/chunk-BU4Z6PD7.js.map +7 -0
- package/dist/{chunk-QGWATS3Z.js → chunk-Q4WGXNKC.js} +2775 -1052
- package/dist/chunk-Q4WGXNKC.js.map +7 -0
- package/dist/{chunk-OGTCFYR3.js → chunk-R5DNAIRI.js} +45 -34
- package/dist/chunk-R5DNAIRI.js.map +7 -0
- package/dist/chunk-XDYJ64IN.js +178 -0
- package/dist/chunk-XDYJ64IN.js.map +7 -0
- package/dist/components/ShadowCanvasOverlay.d.ts +2 -20
- package/dist/components/TileIcon.d.ts +14 -0
- package/dist/config/schema.d.ts +5529 -3620
- package/dist/config/schema.js +21 -61
- package/dist/config/schema.js.map +3 -3
- package/dist/context/schema.d.ts +16 -16
- package/dist/decisions/schema.d.ts +357 -2789
- package/dist/decisions/schema.js +7 -1
- package/dist/decisions/types.d.ts +24 -2
- package/dist/events/registerConfigPredicates.d.ts +7 -10
- package/dist/events/schema.d.ts +12 -12
- package/dist/experiments/adapters/growthbook.d.ts +2 -0
- package/dist/experiments/types.d.ts +7 -0
- package/dist/hooks/useShadowCanvasConfig.d.ts +6 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +154 -186
- package/dist/index.js.map +3 -3
- package/dist/overlays/schema.d.ts +70 -70
- package/dist/react.js +4 -3
- package/dist/react.js.map +1 -1
- package/dist/runtime.d.ts +3 -0
- package/dist/smart-canvas.esm.js +123 -84
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +3271 -1210
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +123 -84
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/surfaces/types.d.ts +2 -1
- package/dist/theme/ThemeProvider.d.ts +11 -16
- package/dist/theme/defaultTheme.d.ts +6 -1
- package/dist/theme/index.d.ts +3 -4
- package/dist/theme/types.d.ts +11 -0
- package/dist/version.d.ts +1 -1
- package/dist/widgets/WidgetRegistry.d.ts +1 -0
- package/package.json +9 -8
- package/schema/canvas-config.schema.json +10583 -1049
- package/scripts/validate-config.mjs +180 -0
- package/dist/actions/executors/tour.d.ts +0 -18
- package/dist/chunk-4NYS7GAW.js.map +0 -7
- package/dist/chunk-OGTCFYR3.js.map +0 -7
- package/dist/chunk-QGWATS3Z.js.map +0 -7
- package/dist/hooks/useHostPatches.d.ts +0 -9
- package/dist/theme/extractHostTheme.d.ts +0 -14
|
@@ -15,11 +15,11 @@ export declare const SelectorZ: z.ZodUnion<[z.ZodObject<{
|
|
|
15
15
|
type: z.ZodLiteral<"css">;
|
|
16
16
|
value: z.ZodString;
|
|
17
17
|
}, "strip", z.ZodTypeAny, {
|
|
18
|
-
value: string;
|
|
19
18
|
type: "css";
|
|
20
|
-
}, {
|
|
21
19
|
value: string;
|
|
20
|
+
}, {
|
|
22
21
|
type: "css";
|
|
22
|
+
value: string;
|
|
23
23
|
}>, z.ZodObject<{
|
|
24
24
|
type: z.ZodLiteral<"aria">;
|
|
25
25
|
role: z.ZodOptional<z.ZodString>;
|
|
@@ -36,11 +36,11 @@ export declare const SelectorZ: z.ZodUnion<[z.ZodObject<{
|
|
|
36
36
|
type: z.ZodLiteral<"shadow-css">;
|
|
37
37
|
value: z.ZodString;
|
|
38
38
|
}, "strip", z.ZodTypeAny, {
|
|
39
|
-
value: string;
|
|
40
39
|
type: "shadow-css";
|
|
41
|
-
}, {
|
|
42
40
|
value: string;
|
|
41
|
+
}, {
|
|
43
42
|
type: "shadow-css";
|
|
43
|
+
value: string;
|
|
44
44
|
}>, z.ZodObject<{
|
|
45
45
|
type: z.ZodLiteral<"ref">;
|
|
46
46
|
el: z.ZodAny;
|
|
@@ -70,11 +70,11 @@ export declare const TooltipStepZ: z.ZodObject<{
|
|
|
70
70
|
type: z.ZodLiteral<"css">;
|
|
71
71
|
value: z.ZodString;
|
|
72
72
|
}, "strip", z.ZodTypeAny, {
|
|
73
|
-
value: string;
|
|
74
73
|
type: "css";
|
|
75
|
-
}, {
|
|
76
74
|
value: string;
|
|
75
|
+
}, {
|
|
77
76
|
type: "css";
|
|
77
|
+
value: string;
|
|
78
78
|
}>, z.ZodObject<{
|
|
79
79
|
type: z.ZodLiteral<"aria">;
|
|
80
80
|
role: z.ZodOptional<z.ZodString>;
|
|
@@ -91,11 +91,11 @@ export declare const TooltipStepZ: z.ZodObject<{
|
|
|
91
91
|
type: z.ZodLiteral<"shadow-css">;
|
|
92
92
|
value: z.ZodString;
|
|
93
93
|
}, "strip", z.ZodTypeAny, {
|
|
94
|
-
value: string;
|
|
95
94
|
type: "shadow-css";
|
|
96
|
-
}, {
|
|
97
95
|
value: string;
|
|
96
|
+
}, {
|
|
98
97
|
type: "shadow-css";
|
|
98
|
+
value: string;
|
|
99
99
|
}>, z.ZodObject<{
|
|
100
100
|
type: z.ZodLiteral<"ref">;
|
|
101
101
|
el: z.ZodAny;
|
|
@@ -125,13 +125,13 @@ export declare const TooltipStepZ: z.ZodObject<{
|
|
|
125
125
|
closeButton: z.ZodOptional<z.ZodBoolean>;
|
|
126
126
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
127
127
|
}, "strip", z.ZodTypeAny, {
|
|
128
|
-
timeoutMs?: number | undefined;
|
|
129
128
|
onEsc?: boolean | undefined;
|
|
130
129
|
closeButton?: boolean | undefined;
|
|
131
|
-
}, {
|
|
132
130
|
timeoutMs?: number | undefined;
|
|
131
|
+
}, {
|
|
133
132
|
onEsc?: boolean | undefined;
|
|
134
133
|
closeButton?: boolean | undefined;
|
|
134
|
+
timeoutMs?: number | undefined;
|
|
135
135
|
}>>;
|
|
136
136
|
}, "strip", z.ZodTypeAny, {
|
|
137
137
|
kind: "tooltip";
|
|
@@ -145,15 +145,15 @@ export declare const TooltipStepZ: z.ZodObject<{
|
|
|
145
145
|
key: string;
|
|
146
146
|
value?: string | undefined;
|
|
147
147
|
} | {
|
|
148
|
-
value: string;
|
|
149
148
|
type: "css";
|
|
149
|
+
value: string;
|
|
150
150
|
} | {
|
|
151
151
|
type: "aria";
|
|
152
152
|
label?: string | undefined;
|
|
153
153
|
role?: string | undefined;
|
|
154
154
|
} | {
|
|
155
|
-
value: string;
|
|
156
155
|
type: "shadow-css";
|
|
156
|
+
value: string;
|
|
157
157
|
} | {
|
|
158
158
|
type: "ref";
|
|
159
159
|
el?: any;
|
|
@@ -162,9 +162,9 @@ export declare const TooltipStepZ: z.ZodObject<{
|
|
|
162
162
|
placement?: "top" | "right" | "bottom" | "left" | "auto" | undefined;
|
|
163
163
|
blocking?: boolean | undefined;
|
|
164
164
|
dismiss?: {
|
|
165
|
-
timeoutMs?: number | undefined;
|
|
166
165
|
onEsc?: boolean | undefined;
|
|
167
166
|
closeButton?: boolean | undefined;
|
|
167
|
+
timeoutMs?: number | undefined;
|
|
168
168
|
} | undefined;
|
|
169
169
|
offsetPx?: number | undefined;
|
|
170
170
|
}, {
|
|
@@ -179,15 +179,15 @@ export declare const TooltipStepZ: z.ZodObject<{
|
|
|
179
179
|
key: string;
|
|
180
180
|
value?: string | undefined;
|
|
181
181
|
} | {
|
|
182
|
-
value: string;
|
|
183
182
|
type: "css";
|
|
183
|
+
value: string;
|
|
184
184
|
} | {
|
|
185
185
|
type: "aria";
|
|
186
186
|
label?: string | undefined;
|
|
187
187
|
role?: string | undefined;
|
|
188
188
|
} | {
|
|
189
|
-
value: string;
|
|
190
189
|
type: "shadow-css";
|
|
190
|
+
value: string;
|
|
191
191
|
} | {
|
|
192
192
|
type: "ref";
|
|
193
193
|
el?: any;
|
|
@@ -196,9 +196,9 @@ export declare const TooltipStepZ: z.ZodObject<{
|
|
|
196
196
|
placement?: "top" | "right" | "bottom" | "left" | "auto" | undefined;
|
|
197
197
|
blocking?: boolean | undefined;
|
|
198
198
|
dismiss?: {
|
|
199
|
-
timeoutMs?: number | undefined;
|
|
200
199
|
onEsc?: boolean | undefined;
|
|
201
200
|
closeButton?: boolean | undefined;
|
|
201
|
+
timeoutMs?: number | undefined;
|
|
202
202
|
} | undefined;
|
|
203
203
|
offsetPx?: number | undefined;
|
|
204
204
|
}>;
|
|
@@ -221,11 +221,11 @@ export declare const HighlightStepZ: z.ZodObject<{
|
|
|
221
221
|
type: z.ZodLiteral<"css">;
|
|
222
222
|
value: z.ZodString;
|
|
223
223
|
}, "strip", z.ZodTypeAny, {
|
|
224
|
-
value: string;
|
|
225
224
|
type: "css";
|
|
226
|
-
}, {
|
|
227
225
|
value: string;
|
|
226
|
+
}, {
|
|
228
227
|
type: "css";
|
|
228
|
+
value: string;
|
|
229
229
|
}>, z.ZodObject<{
|
|
230
230
|
type: z.ZodLiteral<"aria">;
|
|
231
231
|
role: z.ZodOptional<z.ZodString>;
|
|
@@ -242,11 +242,11 @@ export declare const HighlightStepZ: z.ZodObject<{
|
|
|
242
242
|
type: z.ZodLiteral<"shadow-css">;
|
|
243
243
|
value: z.ZodString;
|
|
244
244
|
}, "strip", z.ZodTypeAny, {
|
|
245
|
-
value: string;
|
|
246
245
|
type: "shadow-css";
|
|
247
|
-
}, {
|
|
248
246
|
value: string;
|
|
247
|
+
}, {
|
|
249
248
|
type: "shadow-css";
|
|
249
|
+
value: string;
|
|
250
250
|
}>, z.ZodObject<{
|
|
251
251
|
type: z.ZodLiteral<"ref">;
|
|
252
252
|
el: z.ZodAny;
|
|
@@ -282,12 +282,12 @@ export declare const HighlightStepZ: z.ZodObject<{
|
|
|
282
282
|
onEsc: z.ZodOptional<z.ZodBoolean>;
|
|
283
283
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
284
284
|
}, "strip", z.ZodTypeAny, {
|
|
285
|
-
timeoutMs?: number | undefined;
|
|
286
285
|
onEsc?: boolean | undefined;
|
|
286
|
+
timeoutMs?: number | undefined;
|
|
287
287
|
onClickOutside?: boolean | undefined;
|
|
288
288
|
}, {
|
|
289
|
-
timeoutMs?: number | undefined;
|
|
290
289
|
onEsc?: boolean | undefined;
|
|
290
|
+
timeoutMs?: number | undefined;
|
|
291
291
|
onClickOutside?: boolean | undefined;
|
|
292
292
|
}>>;
|
|
293
293
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -298,15 +298,15 @@ export declare const HighlightStepZ: z.ZodObject<{
|
|
|
298
298
|
key: string;
|
|
299
299
|
value?: string | undefined;
|
|
300
300
|
} | {
|
|
301
|
-
value: string;
|
|
302
301
|
type: "css";
|
|
302
|
+
value: string;
|
|
303
303
|
} | {
|
|
304
304
|
type: "aria";
|
|
305
305
|
label?: string | undefined;
|
|
306
306
|
role?: string | undefined;
|
|
307
307
|
} | {
|
|
308
|
-
value: string;
|
|
309
308
|
type: "shadow-css";
|
|
309
|
+
value: string;
|
|
310
310
|
} | {
|
|
311
311
|
type: "ref";
|
|
312
312
|
el?: any;
|
|
@@ -316,8 +316,8 @@ export declare const HighlightStepZ: z.ZodObject<{
|
|
|
316
316
|
opacity?: number | undefined;
|
|
317
317
|
} | undefined;
|
|
318
318
|
dismiss?: {
|
|
319
|
-
timeoutMs?: number | undefined;
|
|
320
319
|
onEsc?: boolean | undefined;
|
|
320
|
+
timeoutMs?: number | undefined;
|
|
321
321
|
onClickOutside?: boolean | undefined;
|
|
322
322
|
} | undefined;
|
|
323
323
|
copy?: string | undefined;
|
|
@@ -334,15 +334,15 @@ export declare const HighlightStepZ: z.ZodObject<{
|
|
|
334
334
|
key: string;
|
|
335
335
|
value?: string | undefined;
|
|
336
336
|
} | {
|
|
337
|
-
value: string;
|
|
338
337
|
type: "css";
|
|
338
|
+
value: string;
|
|
339
339
|
} | {
|
|
340
340
|
type: "aria";
|
|
341
341
|
label?: string | undefined;
|
|
342
342
|
role?: string | undefined;
|
|
343
343
|
} | {
|
|
344
|
-
value: string;
|
|
345
344
|
type: "shadow-css";
|
|
345
|
+
value: string;
|
|
346
346
|
} | {
|
|
347
347
|
type: "ref";
|
|
348
348
|
el?: any;
|
|
@@ -352,8 +352,8 @@ export declare const HighlightStepZ: z.ZodObject<{
|
|
|
352
352
|
opacity?: number | undefined;
|
|
353
353
|
} | undefined;
|
|
354
354
|
dismiss?: {
|
|
355
|
-
timeoutMs?: number | undefined;
|
|
356
355
|
onEsc?: boolean | undefined;
|
|
356
|
+
timeoutMs?: number | undefined;
|
|
357
357
|
onClickOutside?: boolean | undefined;
|
|
358
358
|
} | undefined;
|
|
359
359
|
copy?: string | undefined;
|
|
@@ -386,11 +386,11 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
386
386
|
type: z.ZodLiteral<"css">;
|
|
387
387
|
value: z.ZodString;
|
|
388
388
|
}, "strip", z.ZodTypeAny, {
|
|
389
|
-
value: string;
|
|
390
389
|
type: "css";
|
|
391
|
-
}, {
|
|
392
390
|
value: string;
|
|
391
|
+
}, {
|
|
393
392
|
type: "css";
|
|
393
|
+
value: string;
|
|
394
394
|
}>, z.ZodObject<{
|
|
395
395
|
type: z.ZodLiteral<"aria">;
|
|
396
396
|
role: z.ZodOptional<z.ZodString>;
|
|
@@ -407,11 +407,11 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
407
407
|
type: z.ZodLiteral<"shadow-css">;
|
|
408
408
|
value: z.ZodString;
|
|
409
409
|
}, "strip", z.ZodTypeAny, {
|
|
410
|
-
value: string;
|
|
411
410
|
type: "shadow-css";
|
|
412
|
-
}, {
|
|
413
411
|
value: string;
|
|
412
|
+
}, {
|
|
414
413
|
type: "shadow-css";
|
|
414
|
+
value: string;
|
|
415
415
|
}>, z.ZodObject<{
|
|
416
416
|
type: z.ZodLiteral<"ref">;
|
|
417
417
|
el: z.ZodAny;
|
|
@@ -441,13 +441,13 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
441
441
|
closeButton: z.ZodOptional<z.ZodBoolean>;
|
|
442
442
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
443
443
|
}, "strip", z.ZodTypeAny, {
|
|
444
|
-
timeoutMs?: number | undefined;
|
|
445
444
|
onEsc?: boolean | undefined;
|
|
446
445
|
closeButton?: boolean | undefined;
|
|
447
|
-
}, {
|
|
448
446
|
timeoutMs?: number | undefined;
|
|
447
|
+
}, {
|
|
449
448
|
onEsc?: boolean | undefined;
|
|
450
449
|
closeButton?: boolean | undefined;
|
|
450
|
+
timeoutMs?: number | undefined;
|
|
451
451
|
}>>;
|
|
452
452
|
}, "strip", z.ZodTypeAny, {
|
|
453
453
|
kind: "tooltip";
|
|
@@ -461,15 +461,15 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
461
461
|
key: string;
|
|
462
462
|
value?: string | undefined;
|
|
463
463
|
} | {
|
|
464
|
-
value: string;
|
|
465
464
|
type: "css";
|
|
465
|
+
value: string;
|
|
466
466
|
} | {
|
|
467
467
|
type: "aria";
|
|
468
468
|
label?: string | undefined;
|
|
469
469
|
role?: string | undefined;
|
|
470
470
|
} | {
|
|
471
|
-
value: string;
|
|
472
471
|
type: "shadow-css";
|
|
472
|
+
value: string;
|
|
473
473
|
} | {
|
|
474
474
|
type: "ref";
|
|
475
475
|
el?: any;
|
|
@@ -478,9 +478,9 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
478
478
|
placement?: "top" | "right" | "bottom" | "left" | "auto" | undefined;
|
|
479
479
|
blocking?: boolean | undefined;
|
|
480
480
|
dismiss?: {
|
|
481
|
-
timeoutMs?: number | undefined;
|
|
482
481
|
onEsc?: boolean | undefined;
|
|
483
482
|
closeButton?: boolean | undefined;
|
|
483
|
+
timeoutMs?: number | undefined;
|
|
484
484
|
} | undefined;
|
|
485
485
|
offsetPx?: number | undefined;
|
|
486
486
|
}, {
|
|
@@ -495,15 +495,15 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
495
495
|
key: string;
|
|
496
496
|
value?: string | undefined;
|
|
497
497
|
} | {
|
|
498
|
-
value: string;
|
|
499
498
|
type: "css";
|
|
499
|
+
value: string;
|
|
500
500
|
} | {
|
|
501
501
|
type: "aria";
|
|
502
502
|
label?: string | undefined;
|
|
503
503
|
role?: string | undefined;
|
|
504
504
|
} | {
|
|
505
|
-
value: string;
|
|
506
505
|
type: "shadow-css";
|
|
506
|
+
value: string;
|
|
507
507
|
} | {
|
|
508
508
|
type: "ref";
|
|
509
509
|
el?: any;
|
|
@@ -512,9 +512,9 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
512
512
|
placement?: "top" | "right" | "bottom" | "left" | "auto" | undefined;
|
|
513
513
|
blocking?: boolean | undefined;
|
|
514
514
|
dismiss?: {
|
|
515
|
-
timeoutMs?: number | undefined;
|
|
516
515
|
onEsc?: boolean | undefined;
|
|
517
516
|
closeButton?: boolean | undefined;
|
|
517
|
+
timeoutMs?: number | undefined;
|
|
518
518
|
} | undefined;
|
|
519
519
|
offsetPx?: number | undefined;
|
|
520
520
|
}>, z.ZodObject<{
|
|
@@ -536,11 +536,11 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
536
536
|
type: z.ZodLiteral<"css">;
|
|
537
537
|
value: z.ZodString;
|
|
538
538
|
}, "strip", z.ZodTypeAny, {
|
|
539
|
-
value: string;
|
|
540
539
|
type: "css";
|
|
541
|
-
}, {
|
|
542
540
|
value: string;
|
|
541
|
+
}, {
|
|
543
542
|
type: "css";
|
|
543
|
+
value: string;
|
|
544
544
|
}>, z.ZodObject<{
|
|
545
545
|
type: z.ZodLiteral<"aria">;
|
|
546
546
|
role: z.ZodOptional<z.ZodString>;
|
|
@@ -557,11 +557,11 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
557
557
|
type: z.ZodLiteral<"shadow-css">;
|
|
558
558
|
value: z.ZodString;
|
|
559
559
|
}, "strip", z.ZodTypeAny, {
|
|
560
|
-
value: string;
|
|
561
560
|
type: "shadow-css";
|
|
562
|
-
}, {
|
|
563
561
|
value: string;
|
|
562
|
+
}, {
|
|
564
563
|
type: "shadow-css";
|
|
564
|
+
value: string;
|
|
565
565
|
}>, z.ZodObject<{
|
|
566
566
|
type: z.ZodLiteral<"ref">;
|
|
567
567
|
el: z.ZodAny;
|
|
@@ -597,12 +597,12 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
597
597
|
onEsc: z.ZodOptional<z.ZodBoolean>;
|
|
598
598
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
599
599
|
}, "strip", z.ZodTypeAny, {
|
|
600
|
-
timeoutMs?: number | undefined;
|
|
601
600
|
onEsc?: boolean | undefined;
|
|
601
|
+
timeoutMs?: number | undefined;
|
|
602
602
|
onClickOutside?: boolean | undefined;
|
|
603
603
|
}, {
|
|
604
|
-
timeoutMs?: number | undefined;
|
|
605
604
|
onEsc?: boolean | undefined;
|
|
605
|
+
timeoutMs?: number | undefined;
|
|
606
606
|
onClickOutside?: boolean | undefined;
|
|
607
607
|
}>>;
|
|
608
608
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -613,15 +613,15 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
613
613
|
key: string;
|
|
614
614
|
value?: string | undefined;
|
|
615
615
|
} | {
|
|
616
|
-
value: string;
|
|
617
616
|
type: "css";
|
|
617
|
+
value: string;
|
|
618
618
|
} | {
|
|
619
619
|
type: "aria";
|
|
620
620
|
label?: string | undefined;
|
|
621
621
|
role?: string | undefined;
|
|
622
622
|
} | {
|
|
623
|
-
value: string;
|
|
624
623
|
type: "shadow-css";
|
|
624
|
+
value: string;
|
|
625
625
|
} | {
|
|
626
626
|
type: "ref";
|
|
627
627
|
el?: any;
|
|
@@ -631,8 +631,8 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
631
631
|
opacity?: number | undefined;
|
|
632
632
|
} | undefined;
|
|
633
633
|
dismiss?: {
|
|
634
|
-
timeoutMs?: number | undefined;
|
|
635
634
|
onEsc?: boolean | undefined;
|
|
635
|
+
timeoutMs?: number | undefined;
|
|
636
636
|
onClickOutside?: boolean | undefined;
|
|
637
637
|
} | undefined;
|
|
638
638
|
copy?: string | undefined;
|
|
@@ -649,15 +649,15 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
649
649
|
key: string;
|
|
650
650
|
value?: string | undefined;
|
|
651
651
|
} | {
|
|
652
|
-
value: string;
|
|
653
652
|
type: "css";
|
|
653
|
+
value: string;
|
|
654
654
|
} | {
|
|
655
655
|
type: "aria";
|
|
656
656
|
label?: string | undefined;
|
|
657
657
|
role?: string | undefined;
|
|
658
658
|
} | {
|
|
659
|
-
value: string;
|
|
660
659
|
type: "shadow-css";
|
|
660
|
+
value: string;
|
|
661
661
|
} | {
|
|
662
662
|
type: "ref";
|
|
663
663
|
el?: any;
|
|
@@ -667,8 +667,8 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
667
667
|
opacity?: number | undefined;
|
|
668
668
|
} | undefined;
|
|
669
669
|
dismiss?: {
|
|
670
|
-
timeoutMs?: number | undefined;
|
|
671
670
|
onEsc?: boolean | undefined;
|
|
671
|
+
timeoutMs?: number | undefined;
|
|
672
672
|
onClickOutside?: boolean | undefined;
|
|
673
673
|
} | undefined;
|
|
674
674
|
copy?: string | undefined;
|
|
@@ -691,15 +691,15 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
691
691
|
key: string;
|
|
692
692
|
value?: string | undefined;
|
|
693
693
|
} | {
|
|
694
|
-
value: string;
|
|
695
694
|
type: "css";
|
|
695
|
+
value: string;
|
|
696
696
|
} | {
|
|
697
697
|
type: "aria";
|
|
698
698
|
label?: string | undefined;
|
|
699
699
|
role?: string | undefined;
|
|
700
700
|
} | {
|
|
701
|
-
value: string;
|
|
702
701
|
type: "shadow-css";
|
|
702
|
+
value: string;
|
|
703
703
|
} | {
|
|
704
704
|
type: "ref";
|
|
705
705
|
el?: any;
|
|
@@ -708,9 +708,9 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
708
708
|
placement?: "top" | "right" | "bottom" | "left" | "auto" | undefined;
|
|
709
709
|
blocking?: boolean | undefined;
|
|
710
710
|
dismiss?: {
|
|
711
|
-
timeoutMs?: number | undefined;
|
|
712
711
|
onEsc?: boolean | undefined;
|
|
713
712
|
closeButton?: boolean | undefined;
|
|
713
|
+
timeoutMs?: number | undefined;
|
|
714
714
|
} | undefined;
|
|
715
715
|
offsetPx?: number | undefined;
|
|
716
716
|
} | {
|
|
@@ -721,15 +721,15 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
721
721
|
key: string;
|
|
722
722
|
value?: string | undefined;
|
|
723
723
|
} | {
|
|
724
|
-
value: string;
|
|
725
724
|
type: "css";
|
|
725
|
+
value: string;
|
|
726
726
|
} | {
|
|
727
727
|
type: "aria";
|
|
728
728
|
label?: string | undefined;
|
|
729
729
|
role?: string | undefined;
|
|
730
730
|
} | {
|
|
731
|
-
value: string;
|
|
732
731
|
type: "shadow-css";
|
|
732
|
+
value: string;
|
|
733
733
|
} | {
|
|
734
734
|
type: "ref";
|
|
735
735
|
el?: any;
|
|
@@ -739,8 +739,8 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
739
739
|
opacity?: number | undefined;
|
|
740
740
|
} | undefined;
|
|
741
741
|
dismiss?: {
|
|
742
|
-
timeoutMs?: number | undefined;
|
|
743
742
|
onEsc?: boolean | undefined;
|
|
743
|
+
timeoutMs?: number | undefined;
|
|
744
744
|
onClickOutside?: boolean | undefined;
|
|
745
745
|
} | undefined;
|
|
746
746
|
copy?: string | undefined;
|
|
@@ -766,15 +766,15 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
766
766
|
key: string;
|
|
767
767
|
value?: string | undefined;
|
|
768
768
|
} | {
|
|
769
|
-
value: string;
|
|
770
769
|
type: "css";
|
|
770
|
+
value: string;
|
|
771
771
|
} | {
|
|
772
772
|
type: "aria";
|
|
773
773
|
label?: string | undefined;
|
|
774
774
|
role?: string | undefined;
|
|
775
775
|
} | {
|
|
776
|
-
value: string;
|
|
777
776
|
type: "shadow-css";
|
|
777
|
+
value: string;
|
|
778
778
|
} | {
|
|
779
779
|
type: "ref";
|
|
780
780
|
el?: any;
|
|
@@ -783,9 +783,9 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
783
783
|
placement?: "top" | "right" | "bottom" | "left" | "auto" | undefined;
|
|
784
784
|
blocking?: boolean | undefined;
|
|
785
785
|
dismiss?: {
|
|
786
|
-
timeoutMs?: number | undefined;
|
|
787
786
|
onEsc?: boolean | undefined;
|
|
788
787
|
closeButton?: boolean | undefined;
|
|
788
|
+
timeoutMs?: number | undefined;
|
|
789
789
|
} | undefined;
|
|
790
790
|
offsetPx?: number | undefined;
|
|
791
791
|
} | {
|
|
@@ -796,15 +796,15 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
796
796
|
key: string;
|
|
797
797
|
value?: string | undefined;
|
|
798
798
|
} | {
|
|
799
|
-
value: string;
|
|
800
799
|
type: "css";
|
|
800
|
+
value: string;
|
|
801
801
|
} | {
|
|
802
802
|
type: "aria";
|
|
803
803
|
label?: string | undefined;
|
|
804
804
|
role?: string | undefined;
|
|
805
805
|
} | {
|
|
806
|
-
value: string;
|
|
807
806
|
type: "shadow-css";
|
|
807
|
+
value: string;
|
|
808
808
|
} | {
|
|
809
809
|
type: "ref";
|
|
810
810
|
el?: any;
|
|
@@ -814,8 +814,8 @@ export declare const CanvasRecipeZ: z.ZodObject<{
|
|
|
814
814
|
opacity?: number | undefined;
|
|
815
815
|
} | undefined;
|
|
816
816
|
dismiss?: {
|
|
817
|
-
timeoutMs?: number | undefined;
|
|
818
817
|
onEsc?: boolean | undefined;
|
|
818
|
+
timeoutMs?: number | undefined;
|
|
819
819
|
onClickOutside?: boolean | undefined;
|
|
820
820
|
} | undefined;
|
|
821
821
|
copy?: string | undefined;
|
|
@@ -842,15 +842,15 @@ export declare function validateRecipe(json: unknown): {
|
|
|
842
842
|
key: string;
|
|
843
843
|
value?: string | undefined;
|
|
844
844
|
} | {
|
|
845
|
-
value: string;
|
|
846
845
|
type: "css";
|
|
846
|
+
value: string;
|
|
847
847
|
} | {
|
|
848
848
|
type: "aria";
|
|
849
849
|
label?: string | undefined;
|
|
850
850
|
role?: string | undefined;
|
|
851
851
|
} | {
|
|
852
|
-
value: string;
|
|
853
852
|
type: "shadow-css";
|
|
853
|
+
value: string;
|
|
854
854
|
} | {
|
|
855
855
|
type: "ref";
|
|
856
856
|
el?: any;
|
|
@@ -859,9 +859,9 @@ export declare function validateRecipe(json: unknown): {
|
|
|
859
859
|
placement?: "top" | "right" | "bottom" | "left" | "auto" | undefined;
|
|
860
860
|
blocking?: boolean | undefined;
|
|
861
861
|
dismiss?: {
|
|
862
|
-
timeoutMs?: number | undefined;
|
|
863
862
|
onEsc?: boolean | undefined;
|
|
864
863
|
closeButton?: boolean | undefined;
|
|
864
|
+
timeoutMs?: number | undefined;
|
|
865
865
|
} | undefined;
|
|
866
866
|
offsetPx?: number | undefined;
|
|
867
867
|
} | {
|
|
@@ -872,15 +872,15 @@ export declare function validateRecipe(json: unknown): {
|
|
|
872
872
|
key: string;
|
|
873
873
|
value?: string | undefined;
|
|
874
874
|
} | {
|
|
875
|
-
value: string;
|
|
876
875
|
type: "css";
|
|
876
|
+
value: string;
|
|
877
877
|
} | {
|
|
878
878
|
type: "aria";
|
|
879
879
|
label?: string | undefined;
|
|
880
880
|
role?: string | undefined;
|
|
881
881
|
} | {
|
|
882
|
-
value: string;
|
|
883
882
|
type: "shadow-css";
|
|
883
|
+
value: string;
|
|
884
884
|
} | {
|
|
885
885
|
type: "ref";
|
|
886
886
|
el?: any;
|
|
@@ -890,8 +890,8 @@ export declare function validateRecipe(json: unknown): {
|
|
|
890
890
|
opacity?: number | undefined;
|
|
891
891
|
} | undefined;
|
|
892
892
|
dismiss?: {
|
|
893
|
-
timeoutMs?: number | undefined;
|
|
894
893
|
onEsc?: boolean | undefined;
|
|
894
|
+
timeoutMs?: number | undefined;
|
|
895
895
|
onClickOutside?: boolean | undefined;
|
|
896
896
|
} | undefined;
|
|
897
897
|
copy?: string | undefined;
|
package/dist/react.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Syntro
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-Q4WGXNKC.js";
|
|
4
|
+
import "./chunk-R5DNAIRI.js";
|
|
5
|
+
import "./chunk-XDYJ64IN.js";
|
|
6
|
+
import "./chunk-BU4Z6PD7.js";
|
|
6
7
|
|
|
7
8
|
// src/react.tsx
|
|
8
9
|
import { createContext, useContext, useEffect, useRef, useState } from "react";
|
package/dist/react.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/react.tsx"],
|
|
4
4
|
"sourcesContent": ["/**\n * React bindings for the Syntro SDK.\n *\n * Usage:\n * ```tsx\n * import { SyntroProvider, useSyntro } from '@syntrologie/runtime-sdk/react';\n *\n * function App() {\n * return (\n * <SyntroProvider token=\"syn_xxx\">\n * <MyApp />\n * </SyntroProvider>\n * );\n * }\n *\n * function MyComponent() {\n * const { canvas, experiments, telemetry, isReady } = useSyntro();\n * // ...\n * }\n * ```\n */\nimport { createContext, type ReactNode, useContext, useEffect, useRef, useState } from 'react';\n\nimport type { SmartCanvasHandle } from './api';\nimport { Syntro, type SyntroInitOptions, type SyntroInitResult } from './bootstrap';\nimport type { ExperimentClient } from './experiments/types';\nimport type { TelemetryClient } from './telemetry/types';\n\nexport interface SyntroContextValue {\n /** The SmartCanvas handle */\n canvas: SmartCanvasHandle | null;\n /** The experiment client */\n experiments: ExperimentClient | null;\n /** The telemetry client */\n telemetry: TelemetryClient | null;\n /** Whether the SDK has finished initializing */\n isReady: boolean;\n /** Any error that occurred during initialization */\n error: Error | null;\n}\n\nconst SyntroContext = createContext<SyntroContextValue | null>(null);\n\n// Global tracking to handle React Strict Mode double-mounting\nlet globalInitPromise: Promise<SyntroInitResult> | null = null;\nlet globalInitToken: string | null = null;\n\nexport interface SyntroProviderProps {\n /**\n * The Syntro token containing all credentials.\n */\n token: string;\n\n /**\n * Optional canvas configuration overrides.\n */\n canvasOptions?: SyntroInitOptions['canvas'];\n\n /**\n * Custom config fetcher to override the default experiment-based fetcher.\n * Use this for local development or when bypassing the experiment server.\n */\n fetcher?: SyntroInitOptions['fetcher'];\n\n /**\n * Children to render.\n */\n children: ReactNode;\n\n /**\n * Called when initialization completes.\n */\n onReady?: (result: SyntroInitResult) => void;\n\n /**\n * Called when initialization fails.\n */\n onError?: (error: Error) => void;\n}\n\n/**\n * Provider component that initializes the Syntro SDK.\n *\n * Place this at the root of your app or at the top of any subtree\n * that needs access to the SDK.\n */\nexport function SyntroProvider({\n token,\n canvasOptions,\n fetcher,\n children,\n onReady,\n onError,\n}: SyntroProviderProps) {\n const [state, setState] = useState<SyntroContextValue>({\n canvas: null,\n experiments: null,\n telemetry: null,\n isReady: false,\n error: null,\n });\n\n const initRef = useRef(false);\n const handleRef = useRef<SmartCanvasHandle | null>(null);\n\n useEffect(() => {\n if (!token) return;\n\n // Reuse existing init if same token (handles React Strict Mode remounts)\n if (globalInitPromise && globalInitToken === token) {\n globalInitPromise.then((result) => {\n handleRef.current = result.canvas;\n setState({\n canvas: result.canvas,\n experiments: result.experiments ?? null,\n telemetry: result.telemetry ?? null,\n isReady: true,\n error: null,\n });\n });\n return;\n }\n\n // Prevent double init\n if (initRef.current) return;\n initRef.current = true;\n\n globalInitToken = token;\n globalInitPromise = Syntro.init({ token, canvas: canvasOptions, fetcher });\n\n globalInitPromise\n .then((result) => {\n handleRef.current = result.canvas;\n setState({\n canvas: result.canvas,\n experiments: result.experiments ?? null,\n telemetry: result.telemetry ?? null,\n isReady: true,\n error: null,\n });\n onReady?.(result);\n })\n .catch((err) => {\n const error = err instanceof Error ? err : new Error(String(err));\n setState((prev) => ({ ...prev, error, isReady: true }));\n onError?.(error);\n // Clear global state on error so retry is possible\n globalInitPromise = null;\n globalInitToken = null;\n });\n\n // Don't destroy on unmount in dev mode - React Strict Mode will remount\n // The canvas persists and will be reused on remount\n }, [token, canvasOptions, fetcher, onError, onReady]);\n\n return <SyntroContext.Provider value={state}>{children}</SyntroContext.Provider>;\n}\n\n/**\n * Hook to access the Syntro SDK.\n *\n * Must be used within a SyntroProvider.\n *\n * @returns The SDK context containing canvas, experiments, telemetry, and status\n */\nexport function useSyntro(): SyntroContextValue {\n const context = useContext(SyntroContext);\n if (!context) {\n throw new Error('useSyntro must be used within a SyntroProvider');\n }\n return context;\n}\n\n/**\n * Hook to check if the SDK is ready.\n *\n * Shorthand for `useSyntro().isReady`.\n */\nexport function useSyntroReady(): boolean {\n return useSyntro().isReady;\n}\n\n/**\n * Hook to access the experiment client.\n *\n * @returns The experiment client, or null if not configured\n */\nexport function useSyntroExperiments(): ExperimentClient | null {\n return useSyntro().experiments;\n}\n\n/**\n * Hook to access the telemetry client.\n *\n * @returns The telemetry client, or null if not configured\n */\nexport function useSyntroTelemetry(): TelemetryClient | null {\n return useSyntro().telemetry;\n}\n\n/**\n * Hook to access the canvas handle.\n *\n * @returns The canvas handle, or null if not ready\n */\nexport function useSyntroCanvas(): SmartCanvasHandle | null {\n return useSyntro().canvas;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;AAqBA,SAAS,eAA+B,YAAY,WAAW,QAAQ,gBAAgB;AAsI9E;AAlHT,IAAM,gBAAgB,cAAyC,IAAI;AAGnE,IAAI,oBAAsD;AAC1D,IAAI,kBAAiC;AAyC9B,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAwB;AACtB,QAAM,CAAC,OAAO,QAAQ,IAAI,SAA6B;AAAA,IACrD,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,WAAW;AAAA,IACX,SAAS;AAAA,IACT,OAAO;AAAA,EACT,CAAC;AAED,QAAM,UAAU,OAAO,KAAK;AAC5B,QAAM,YAAY,OAAiC,IAAI;AAEvD,YAAU,MAAM;AACd,QAAI,CAAC,MAAO;AAGZ,QAAI,qBAAqB,oBAAoB,OAAO;AAClD,wBAAkB,KAAK,CAAC,WAAW;AA9GzC;AA+GQ,kBAAU,UAAU,OAAO;AAC3B,iBAAS;AAAA,UACP,QAAQ,OAAO;AAAA,UACf,cAAa,YAAO,gBAAP,YAAsB;AAAA,UACnC,YAAW,YAAO,cAAP,YAAoB;AAAA,UAC/B,SAAS;AAAA,UACT,OAAO;AAAA,QACT,CAAC;AAAA,MACH,CAAC;AACD;AAAA,IACF;AAGA,QAAI,QAAQ,QAAS;AACrB,YAAQ,UAAU;AAElB,sBAAkB;AAClB,wBAAoB,OAAO,KAAK,EAAE,OAAO,QAAQ,eAAe,QAAQ,CAAC;AAEzE,sBACG,KAAK,CAAC,WAAW;AAnIxB;AAoIQ,gBAAU,UAAU,OAAO;AAC3B,eAAS;AAAA,QACP,QAAQ,OAAO;AAAA,QACf,cAAa,YAAO,gBAAP,YAAsB;AAAA,QACnC,YAAW,YAAO,cAAP,YAAoB;AAAA,QAC/B,SAAS;AAAA,QACT,OAAO;AAAA,MACT,CAAC;AACD,yCAAU;AAAA,IACZ,CAAC,EACA,MAAM,CAAC,QAAQ;AACd,YAAM,QAAQ,eAAe,QAAQ,MAAM,IAAI,MAAM,OAAO,GAAG,CAAC;AAChE,eAAS,CAAC,UAAU,EAAE,GAAG,MAAM,OAAO,SAAS,KAAK,EAAE;AACtD,yCAAU;AAEV,0BAAoB;AACpB,wBAAkB;AAAA,IACpB,CAAC;AAAA,EAIL,GAAG,CAAC,OAAO,eAAe,SAAS,SAAS,OAAO,CAAC;AAEpD,SAAO,oBAAC,cAAc,UAAd,EAAuB,OAAO,OAAQ,UAAS;AACzD;AASO,SAAS,YAAgC;AAC9C,QAAM,UAAU,WAAW,aAAa;AACxC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,gDAAgD;AAAA,EAClE;AACA,SAAO;AACT;AAOO,SAAS,iBAA0B;AACxC,SAAO,UAAU,EAAE;AACrB;AAOO,SAAS,uBAAgD;AAC9D,SAAO,UAAU,EAAE;AACrB;AAOO,SAAS,qBAA6C;AAC3D,SAAO,UAAU,EAAE;AACrB;AAOO,SAAS,kBAA4C;AAC1D,SAAO,UAAU,EAAE;AACrB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/runtime.d.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* The runtime receives the config and makes decisions using DecisionStrategy.
|
|
15
15
|
*/
|
|
16
16
|
import { type ActionEngine, type ExecutorRegistry } from './actions';
|
|
17
|
+
import { type AnchorResolver } from './anchor';
|
|
17
18
|
import { type AppRegistry } from './apps';
|
|
18
19
|
import { type ContextManager } from './context/ContextManager';
|
|
19
20
|
import type { DecisionResult, DecisionStrategy, RouteFilter } from './decisions/types';
|
|
@@ -60,6 +61,8 @@ export interface SmartCanvasRuntime {
|
|
|
60
61
|
apps: AppRegistry;
|
|
61
62
|
/** Event accumulator for event_count conditions */
|
|
62
63
|
accumulator: EventAccumulator;
|
|
64
|
+
/** Centralized anchor resolver for DOM observation */
|
|
65
|
+
anchorResolver: AnchorResolver;
|
|
63
66
|
/** Centralized navigation monitor for History API interception */
|
|
64
67
|
navigation: NavigationMonitor;
|
|
65
68
|
/** Runtime version */
|