@syntrologie/runtime-sdk 2.4.0-canary.20 → 2.4.0-canary.21
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 +36 -0
- package/dist/actions/schema.js +2 -1
- package/dist/apps/examples/gamification-app.example.d.ts +8 -8
- package/dist/chunk-2UYZ5DWI.js +126 -0
- package/dist/chunk-2UYZ5DWI.js.map +7 -0
- package/dist/{chunk-LR5AA5SE.js → chunk-HF3D7YFQ.js} +5 -1
- package/dist/chunk-HF3D7YFQ.js.map +7 -0
- package/dist/{chunk-OJA7NRHL.js → chunk-IPU3WVPY.js} +21 -4
- package/dist/chunk-IPU3WVPY.js.map +7 -0
- package/dist/config/schema.d.ts +222 -222
- package/dist/config/schema.js +14 -109
- package/dist/config/schema.js.map +3 -3
- package/dist/events/schema.d.ts +4 -4
- package/dist/index.js +47 -6
- package/dist/index.js.map +2 -2
- package/dist/react.js +3 -2
- package/dist/react.js.map +1 -1
- package/dist/smart-canvas.esm.js +34 -34
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +161 -8
- package/dist/smart-canvas.js.map +3 -3
- package/dist/smart-canvas.min.js +32 -32
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/version.d.ts +1 -1
- package/package.json +7 -7
- package/schema/canvas-config.schema.json +15 -0
- package/dist/chunk-LR5AA5SE.js.map +0 -7
- package/dist/chunk-OJA7NRHL.js.map +0 -7
package/dist/actions/schema.d.ts
CHANGED
|
@@ -7777,6 +7777,16 @@ declare const InsertHtmlZ: z.ZodObject<{
|
|
|
7777
7777
|
}>;
|
|
7778
7778
|
html: z.ZodString;
|
|
7779
7779
|
position: z.ZodEnum<["before", "after", "prepend", "append", "replace"]>;
|
|
7780
|
+
deepLink: z.ZodOptional<z.ZodObject<{
|
|
7781
|
+
tileId: z.ZodString;
|
|
7782
|
+
itemId: z.ZodOptional<z.ZodString>;
|
|
7783
|
+
}, "strict", z.ZodTypeAny, {
|
|
7784
|
+
tileId: string;
|
|
7785
|
+
itemId?: string | undefined;
|
|
7786
|
+
}, {
|
|
7787
|
+
tileId: string;
|
|
7788
|
+
itemId?: string | undefined;
|
|
7789
|
+
}>>;
|
|
7780
7790
|
label: z.ZodOptional<z.ZodString>;
|
|
7781
7791
|
} & {
|
|
7782
7792
|
activation: z.ZodOptional<z.ZodObject<{
|
|
@@ -9023,6 +9033,10 @@ declare const InsertHtmlZ: z.ZodObject<{
|
|
|
9023
9033
|
method?: "GET" | "POST" | undefined;
|
|
9024
9034
|
timeoutMs?: number | undefined;
|
|
9025
9035
|
} | null | undefined;
|
|
9036
|
+
deepLink?: {
|
|
9037
|
+
tileId: string;
|
|
9038
|
+
itemId?: string | undefined;
|
|
9039
|
+
} | undefined;
|
|
9026
9040
|
activation?: {
|
|
9027
9041
|
routes: {
|
|
9028
9042
|
include?: string[] | undefined;
|
|
@@ -9200,6 +9214,10 @@ declare const InsertHtmlZ: z.ZodObject<{
|
|
|
9200
9214
|
method?: "GET" | "POST" | undefined;
|
|
9201
9215
|
timeoutMs?: number | undefined;
|
|
9202
9216
|
} | null | undefined;
|
|
9217
|
+
deepLink?: {
|
|
9218
|
+
tileId: string;
|
|
9219
|
+
itemId?: string | undefined;
|
|
9220
|
+
} | undefined;
|
|
9203
9221
|
activation?: {
|
|
9204
9222
|
routes: {
|
|
9205
9223
|
include?: string[] | undefined;
|
|
@@ -37321,6 +37339,16 @@ export declare const coreActionStepSchemas: ({
|
|
|
37321
37339
|
}>;
|
|
37322
37340
|
html: z.ZodString;
|
|
37323
37341
|
position: z.ZodEnum<["before", "after", "prepend", "append", "replace"]>;
|
|
37342
|
+
deepLink: z.ZodOptional<z.ZodObject<{
|
|
37343
|
+
tileId: z.ZodString;
|
|
37344
|
+
itemId: z.ZodOptional<z.ZodString>;
|
|
37345
|
+
}, "strict", z.ZodTypeAny, {
|
|
37346
|
+
tileId: string;
|
|
37347
|
+
itemId?: string | undefined;
|
|
37348
|
+
}, {
|
|
37349
|
+
tileId: string;
|
|
37350
|
+
itemId?: string | undefined;
|
|
37351
|
+
}>>;
|
|
37324
37352
|
label: z.ZodOptional<z.ZodString>;
|
|
37325
37353
|
} & {
|
|
37326
37354
|
activation: z.ZodOptional<z.ZodObject<{
|
|
@@ -38567,6 +38595,10 @@ export declare const coreActionStepSchemas: ({
|
|
|
38567
38595
|
method?: "GET" | "POST" | undefined;
|
|
38568
38596
|
timeoutMs?: number | undefined;
|
|
38569
38597
|
} | null | undefined;
|
|
38598
|
+
deepLink?: {
|
|
38599
|
+
tileId: string;
|
|
38600
|
+
itemId?: string | undefined;
|
|
38601
|
+
} | undefined;
|
|
38570
38602
|
activation?: {
|
|
38571
38603
|
routes: {
|
|
38572
38604
|
include?: string[] | undefined;
|
|
@@ -38744,6 +38776,10 @@ export declare const coreActionStepSchemas: ({
|
|
|
38744
38776
|
method?: "GET" | "POST" | undefined;
|
|
38745
38777
|
timeoutMs?: number | undefined;
|
|
38746
38778
|
} | null | undefined;
|
|
38779
|
+
deepLink?: {
|
|
38780
|
+
tileId: string;
|
|
38781
|
+
itemId?: string | undefined;
|
|
38782
|
+
} | undefined;
|
|
38747
38783
|
activation?: {
|
|
38748
38784
|
routes: {
|
|
38749
38785
|
include?: string[] | undefined;
|
package/dist/actions/schema.js
CHANGED
|
@@ -40,8 +40,8 @@ export declare const configSchema: z.ZodObject<{
|
|
|
40
40
|
count?: number | undefined;
|
|
41
41
|
};
|
|
42
42
|
id: string;
|
|
43
|
-
name: string;
|
|
44
43
|
icon: string;
|
|
44
|
+
name: string;
|
|
45
45
|
description?: string | undefined;
|
|
46
46
|
}, {
|
|
47
47
|
trigger: {
|
|
@@ -49,8 +49,8 @@ export declare const configSchema: z.ZodObject<{
|
|
|
49
49
|
count?: number | undefined;
|
|
50
50
|
};
|
|
51
51
|
id: string;
|
|
52
|
-
name: string;
|
|
53
52
|
icon: string;
|
|
53
|
+
name: string;
|
|
54
54
|
description?: string | undefined;
|
|
55
55
|
}>, "many">>;
|
|
56
56
|
showProgress: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -62,8 +62,8 @@ export declare const configSchema: z.ZodObject<{
|
|
|
62
62
|
count?: number | undefined;
|
|
63
63
|
};
|
|
64
64
|
id: string;
|
|
65
|
-
name: string;
|
|
66
65
|
icon: string;
|
|
66
|
+
name: string;
|
|
67
67
|
description?: string | undefined;
|
|
68
68
|
}[];
|
|
69
69
|
showProgress: boolean;
|
|
@@ -75,8 +75,8 @@ export declare const configSchema: z.ZodObject<{
|
|
|
75
75
|
count?: number | undefined;
|
|
76
76
|
};
|
|
77
77
|
id: string;
|
|
78
|
-
name: string;
|
|
79
78
|
icon: string;
|
|
79
|
+
name: string;
|
|
80
80
|
description?: string | undefined;
|
|
81
81
|
}[] | undefined;
|
|
82
82
|
showProgress?: boolean | undefined;
|
|
@@ -247,8 +247,8 @@ export declare const manifest: {
|
|
|
247
247
|
count?: number | undefined;
|
|
248
248
|
};
|
|
249
249
|
id: string;
|
|
250
|
-
name: string;
|
|
251
250
|
icon: string;
|
|
251
|
+
name: string;
|
|
252
252
|
description?: string | undefined;
|
|
253
253
|
}, {
|
|
254
254
|
trigger: {
|
|
@@ -256,8 +256,8 @@ export declare const manifest: {
|
|
|
256
256
|
count?: number | undefined;
|
|
257
257
|
};
|
|
258
258
|
id: string;
|
|
259
|
-
name: string;
|
|
260
259
|
icon: string;
|
|
260
|
+
name: string;
|
|
261
261
|
description?: string | undefined;
|
|
262
262
|
}>, "many">>;
|
|
263
263
|
showProgress: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -269,8 +269,8 @@ export declare const manifest: {
|
|
|
269
269
|
count?: number | undefined;
|
|
270
270
|
};
|
|
271
271
|
id: string;
|
|
272
|
-
name: string;
|
|
273
272
|
icon: string;
|
|
273
|
+
name: string;
|
|
274
274
|
description?: string | undefined;
|
|
275
275
|
}[];
|
|
276
276
|
showProgress: boolean;
|
|
@@ -282,8 +282,8 @@ export declare const manifest: {
|
|
|
282
282
|
count?: number | undefined;
|
|
283
283
|
};
|
|
284
284
|
id: string;
|
|
285
|
-
name: string;
|
|
286
285
|
icon: string;
|
|
286
|
+
name: string;
|
|
287
287
|
description?: string | undefined;
|
|
288
288
|
}[] | undefined;
|
|
289
289
|
showProgress?: boolean | undefined;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ActivationConfigZ
|
|
3
|
+
} from "./chunk-P5G4KT2U.js";
|
|
4
|
+
|
|
5
|
+
// src/config/schema.ts
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
var NotificationDeepLinkZ = z.object({
|
|
8
|
+
tileId: z.string(),
|
|
9
|
+
itemId: z.string().optional()
|
|
10
|
+
}).strict();
|
|
11
|
+
var TileNotificationRuleZ = z.object({
|
|
12
|
+
on: z.string(),
|
|
13
|
+
title: z.string(),
|
|
14
|
+
body: z.string().optional(),
|
|
15
|
+
icon: z.string().optional(),
|
|
16
|
+
ttl: z.number().optional(),
|
|
17
|
+
cooldown: z.number().optional(),
|
|
18
|
+
deepLink: NotificationDeepLinkZ.optional()
|
|
19
|
+
}).strict();
|
|
20
|
+
var TileZ = z.object({
|
|
21
|
+
id: z.string(),
|
|
22
|
+
title: z.string().optional(),
|
|
23
|
+
priority: z.number().optional(),
|
|
24
|
+
widget: z.string(),
|
|
25
|
+
props: z.record(z.unknown()).optional(),
|
|
26
|
+
activation: ActivationConfigZ.optional(),
|
|
27
|
+
notifications: z.array(TileNotificationRuleZ).optional()
|
|
28
|
+
}).strict();
|
|
29
|
+
var CanvasElementConfigZ = z.object({
|
|
30
|
+
position: z.enum(["left", "right"]).optional(),
|
|
31
|
+
background: z.string().optional(),
|
|
32
|
+
blur: z.string().optional(),
|
|
33
|
+
border: z.string().optional(),
|
|
34
|
+
width: z.string().optional()
|
|
35
|
+
});
|
|
36
|
+
var LauncherElementConfigZ = z.object({
|
|
37
|
+
background: z.string().optional(),
|
|
38
|
+
backgroundHover: z.string().optional(),
|
|
39
|
+
color: z.string().optional(),
|
|
40
|
+
size: z.string().optional(),
|
|
41
|
+
shadow: z.string().optional()
|
|
42
|
+
});
|
|
43
|
+
var TileElementConfigZ = z.object({
|
|
44
|
+
background: z.string().optional(),
|
|
45
|
+
backgroundHover: z.string().optional(),
|
|
46
|
+
border: z.string().optional(),
|
|
47
|
+
borderRadius: z.string().optional(),
|
|
48
|
+
shadow: z.string().optional(),
|
|
49
|
+
titleColor: z.string().optional(),
|
|
50
|
+
textColor: z.string().optional(),
|
|
51
|
+
iconBackground: z.string().optional(),
|
|
52
|
+
iconShadow: z.string().optional()
|
|
53
|
+
});
|
|
54
|
+
var OverlayElementConfigZ = z.object({
|
|
55
|
+
background: z.string().optional(),
|
|
56
|
+
textColor: z.string().optional(),
|
|
57
|
+
border: z.string().optional(),
|
|
58
|
+
borderRadius: z.string().optional(),
|
|
59
|
+
scrimOpacity: z.string().optional(),
|
|
60
|
+
highlightRing: z.string().optional()
|
|
61
|
+
});
|
|
62
|
+
var NotificationElementConfigZ = z.object({
|
|
63
|
+
background: z.string().optional(),
|
|
64
|
+
textColor: z.string().optional(),
|
|
65
|
+
textSecondaryColor: z.string().optional(),
|
|
66
|
+
border: z.string().optional(),
|
|
67
|
+
borderRadius: z.string().optional(),
|
|
68
|
+
successColor: z.string().optional(),
|
|
69
|
+
warningColor: z.string().optional(),
|
|
70
|
+
errorColor: z.string().optional(),
|
|
71
|
+
iconBackground: z.string().optional(),
|
|
72
|
+
progressGradient: z.string().optional()
|
|
73
|
+
});
|
|
74
|
+
var CanvasThemeConfigZ = z.object({
|
|
75
|
+
mode: z.enum(["dark", "light"]).optional(),
|
|
76
|
+
fontFamily: z.string().optional(),
|
|
77
|
+
colorPrimary: z.string().optional(),
|
|
78
|
+
colorPrimaryHover: z.string().optional(),
|
|
79
|
+
borderRadius: z.string().optional(),
|
|
80
|
+
canvas: CanvasElementConfigZ.optional(),
|
|
81
|
+
launcher: LauncherElementConfigZ.optional(),
|
|
82
|
+
tile: TileElementConfigZ.optional(),
|
|
83
|
+
overlay: OverlayElementConfigZ.optional(),
|
|
84
|
+
notification: NotificationElementConfigZ.optional()
|
|
85
|
+
}).strict();
|
|
86
|
+
var LauncherConfigZ = z.object({
|
|
87
|
+
enabled: z.boolean().optional(),
|
|
88
|
+
label: z.string().optional(),
|
|
89
|
+
position: z.string().optional(),
|
|
90
|
+
animate: z.boolean().optional(),
|
|
91
|
+
animationStyle: z.enum(["pulse", "bounce", "glow"]).optional(),
|
|
92
|
+
notificationCount: z.number().optional()
|
|
93
|
+
}).strict();
|
|
94
|
+
var CanvasConfigResponseZ = z.object({
|
|
95
|
+
schemaVersion: z.string().optional(),
|
|
96
|
+
fetchedAt: z.string().datetime(),
|
|
97
|
+
configVersion: z.string().optional(),
|
|
98
|
+
canvasTitle: z.string().optional(),
|
|
99
|
+
tiles: z.array(TileZ),
|
|
100
|
+
actions: z.array(z.any()),
|
|
101
|
+
theme: CanvasThemeConfigZ.optional(),
|
|
102
|
+
launcher: LauncherConfigZ.optional(),
|
|
103
|
+
verificationSteps: z.array(z.string()).optional()
|
|
104
|
+
}).strict();
|
|
105
|
+
var configSchemas = [
|
|
106
|
+
{ defName: "tile", schema: TileZ },
|
|
107
|
+
{ defName: "themeConfig", schema: CanvasThemeConfigZ },
|
|
108
|
+
{ defName: "launcherConfig", schema: LauncherConfigZ },
|
|
109
|
+
{ defName: "canvasConfigResponse", schema: CanvasConfigResponseZ }
|
|
110
|
+
];
|
|
111
|
+
|
|
112
|
+
export {
|
|
113
|
+
NotificationDeepLinkZ,
|
|
114
|
+
TileNotificationRuleZ,
|
|
115
|
+
TileZ,
|
|
116
|
+
CanvasElementConfigZ,
|
|
117
|
+
LauncherElementConfigZ,
|
|
118
|
+
TileElementConfigZ,
|
|
119
|
+
OverlayElementConfigZ,
|
|
120
|
+
NotificationElementConfigZ,
|
|
121
|
+
CanvasThemeConfigZ,
|
|
122
|
+
LauncherConfigZ,
|
|
123
|
+
CanvasConfigResponseZ,
|
|
124
|
+
configSchemas
|
|
125
|
+
};
|
|
126
|
+
//# sourceMappingURL=chunk-2UYZ5DWI.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/config/schema.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Zod schemas for canvas configuration types.\n *\n * Single source of truth for tile, theme, launcher, and top-level\n * CanvasConfigResponse shapes. These schemas are converted to JSON Schema\n * during build and merged into the unified canvas-config.schema.json.\n *\n * Design decisions:\n * - `.strict()` on top-level objects \u2192 `additionalProperties: false` in JSON Schema\n * - Element sub-schemas (canvas, tile, etc.) are NOT strict to allow future expansion\n */\n\nimport { z } from 'zod';\nimport { ActivationConfigZ } from '../decisions/schema';\n\n// ============================================================================\n// Tile Notification Sub-Types\n// ============================================================================\n\nconst NotificationDeepLinkZ = z\n .object({\n tileId: z.string(),\n itemId: z.string().optional(),\n })\n .strict();\n\nconst TileNotificationRuleZ = z\n .object({\n on: z.string(),\n title: z.string(),\n body: z.string().optional(),\n icon: z.string().optional(),\n ttl: z.number().optional(),\n cooldown: z.number().optional(),\n deepLink: NotificationDeepLinkZ.optional(),\n })\n .strict();\n\n// ============================================================================\n// Tile\n// ============================================================================\n\nexport const TileZ = z\n .object({\n id: z.string(),\n title: z.string().optional(),\n priority: z.number().optional(),\n widget: z.string(),\n props: z.record(z.unknown()).optional(),\n activation: ActivationConfigZ.optional(),\n notifications: z.array(TileNotificationRuleZ).optional(),\n })\n .strict();\n\n// ============================================================================\n// Theme Config \u2014 Element Sub-Schemas\n// ============================================================================\n\nexport const CanvasElementConfigZ = z.object({\n position: z.enum(['left', 'right']).optional(),\n background: z.string().optional(),\n blur: z.string().optional(),\n border: z.string().optional(),\n width: z.string().optional(),\n});\n\nexport const LauncherElementConfigZ = z.object({\n background: z.string().optional(),\n backgroundHover: z.string().optional(),\n color: z.string().optional(),\n size: z.string().optional(),\n shadow: z.string().optional(),\n});\n\nexport const TileElementConfigZ = z.object({\n background: z.string().optional(),\n backgroundHover: z.string().optional(),\n border: z.string().optional(),\n borderRadius: z.string().optional(),\n shadow: z.string().optional(),\n titleColor: z.string().optional(),\n textColor: z.string().optional(),\n iconBackground: z.string().optional(),\n iconShadow: z.string().optional(),\n});\n\nexport const OverlayElementConfigZ = z.object({\n background: z.string().optional(),\n textColor: z.string().optional(),\n border: z.string().optional(),\n borderRadius: z.string().optional(),\n scrimOpacity: z.string().optional(),\n highlightRing: z.string().optional(),\n});\n\nexport const NotificationElementConfigZ = z.object({\n background: z.string().optional(),\n textColor: z.string().optional(),\n textSecondaryColor: z.string().optional(),\n border: z.string().optional(),\n borderRadius: z.string().optional(),\n successColor: z.string().optional(),\n warningColor: z.string().optional(),\n errorColor: z.string().optional(),\n iconBackground: z.string().optional(),\n progressGradient: z.string().optional(),\n});\n\n// ============================================================================\n// Theme Config \u2014 Top-Level\n// ============================================================================\n\nexport const CanvasThemeConfigZ = z\n .object({\n mode: z.enum(['dark', 'light']).optional(),\n fontFamily: z.string().optional(),\n colorPrimary: z.string().optional(),\n colorPrimaryHover: z.string().optional(),\n borderRadius: z.string().optional(),\n canvas: CanvasElementConfigZ.optional(),\n launcher: LauncherElementConfigZ.optional(),\n tile: TileElementConfigZ.optional(),\n overlay: OverlayElementConfigZ.optional(),\n notification: NotificationElementConfigZ.optional(),\n })\n .strict();\n\n// ============================================================================\n// Launcher Config\n// ============================================================================\n\nexport const LauncherConfigZ = z\n .object({\n enabled: z.boolean().optional(),\n label: z.string().optional(),\n position: z.string().optional(),\n animate: z.boolean().optional(),\n animationStyle: z.enum(['pulse', 'bounce', 'glow']).optional(),\n notificationCount: z.number().optional(),\n })\n .strict();\n\n// ============================================================================\n// Canvas Config Response (top-level)\n// ============================================================================\n\nexport const CanvasConfigResponseZ = z\n .object({\n schemaVersion: z.string().optional(),\n fetchedAt: z.string().datetime(),\n configVersion: z.string().optional(),\n canvasTitle: z.string().optional(),\n tiles: z.array(TileZ),\n actions: z.array(z.any()),\n theme: CanvasThemeConfigZ.optional(),\n launcher: LauncherConfigZ.optional(),\n verificationSteps: z.array(z.string()).optional(),\n })\n .strict();\n\n// ============================================================================\n// Export: Array for unified schema generation\n// ============================================================================\n\n/**\n * Config schemas for unified JSON Schema generation.\n * The generator imports this array and converts each to a JSON Schema $def.\n */\nexport const configSchemas = [\n { defName: 'tile', schema: TileZ },\n { defName: 'themeConfig', schema: CanvasThemeConfigZ },\n { defName: 'launcherConfig', schema: LauncherConfigZ },\n { defName: 'canvasConfigResponse', schema: CanvasConfigResponseZ },\n];\n\n// ============================================================================\n// Named Exports\n// ============================================================================\n\nexport { NotificationDeepLinkZ, TileNotificationRuleZ };\n"],
|
|
5
|
+
"mappings": ";;;;;AAYA,SAAS,SAAS;AAOlB,IAAM,wBAAwB,EAC3B,OAAO;AAAA,EACN,QAAQ,EAAE,OAAO;AAAA,EACjB,QAAQ,EAAE,OAAO,EAAE,SAAS;AAC9B,CAAC,EACA,OAAO;AAEV,IAAM,wBAAwB,EAC3B,OAAO;AAAA,EACN,IAAI,EAAE,OAAO;AAAA,EACb,OAAO,EAAE,OAAO;AAAA,EAChB,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,KAAK,EAAE,OAAO,EAAE,SAAS;AAAA,EACzB,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,UAAU,sBAAsB,SAAS;AAC3C,CAAC,EACA,OAAO;AAMH,IAAM,QAAQ,EAClB,OAAO;AAAA,EACN,IAAI,EAAE,OAAO;AAAA,EACb,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,QAAQ,EAAE,OAAO;AAAA,EACjB,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,SAAS;AAAA,EACtC,YAAY,kBAAkB,SAAS;AAAA,EACvC,eAAe,EAAE,MAAM,qBAAqB,EAA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A,EAC9B,gBAAgB,EAAE,KAAK,CAAC,SAAS,UAAU,MAAM,CAAC,EAAE,SAAS;AAAA,EAC7D,mBAAmB,EAAE,OAAO,EAAE,SAAS;AACzC,CAAC,EACA,OAAO;AAMH,IAAM,wBAAwB,EAClC,OAAO;AAAA,EACN,eAAe,EAAE,OAAO,EAAE,SAAS;AAAA,EACnC,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,eAAe,EAAE,OAAO,EAAE,SAAS;AAAA,EACnC,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,OAAO,EAAE,MAAM,KAAK;AAAA,EACpB,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC;AAAA,EACxB,OAAO,mBAAmB,SAAS;AAAA,EACnC,UAAU,gBAAgB,SAAS;AAAA,EACnC,mBAAmB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS;AAClD,CAAC,EACA,OAAO;AAUH,IAAM,gBAAgB;AAAA,EAC3B,EAAE,SAAS,QAAQ,QAAQ,MAAM;AAAA,EACjC,EAAE,SAAS,eAAe,QAAQ,mBAAmB;AAAA,EACrD,EAAE,SAAS,kBAAkB,QAAQ,gBAAgB;AAAA,EACrD,EAAE,SAAS,wBAAwB,QAAQ,sBAAsB;AACnE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NotificationDeepLinkZ
|
|
3
|
+
} from "./chunk-2UYZ5DWI.js";
|
|
1
4
|
import {
|
|
2
5
|
ActivationConfigZ,
|
|
3
6
|
DecisionStrategyZ
|
|
@@ -99,6 +102,7 @@ var InsertHtmlZ = z.object({
|
|
|
99
102
|
anchorId: AnchorIdZ,
|
|
100
103
|
html: z.string(),
|
|
101
104
|
position: InsertPositionZ,
|
|
105
|
+
deepLink: NotificationDeepLinkZ.optional(),
|
|
102
106
|
label: z.string().optional()
|
|
103
107
|
}).extend(ActionActivationZ).strict();
|
|
104
108
|
var HighlightZ = z.object({
|
|
@@ -247,4 +251,4 @@ export {
|
|
|
247
251
|
TourZ,
|
|
248
252
|
coreActionStepSchemas
|
|
249
253
|
};
|
|
250
|
-
//# sourceMappingURL=chunk-
|
|
254
|
+
//# sourceMappingURL=chunk-HF3D7YFQ.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/actions/schema.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Core Action Zod Schemas\n *\n * Single source of truth for the shape of all 18 core action types.\n * These schemas are converted to JSON Schema during build and merged\n * into the unified canvas-config.schema.json.\n *\n * Design decisions:\n * - `.strict()` on most objects \u2192 `additionalProperties: false` in JSON Schema\n * - Tour/TourStep use `.passthrough()` to allow adaptive-specific extensions (e.g. `workflow`)\n * - Matches `types.ts` exactly (fixes all drift from the old manual JSON defs)\n * - Recursive ActionStep references use `z.any()` as placeholder; the generator\n * replaces `{}` with `{ \"$ref\": \"#/$defs/actionStep\" }` post-conversion\n */\n\nimport { z } from 'zod';\nimport { NotificationDeepLinkZ } from '../config/schema';\nimport { ActivationConfigZ, DecisionStrategyZ } from '../decisions/schema';\n\n// ============================================================================\n// Shared Sub-Types\n// ============================================================================\n\n/** Optional activation config \u2014 every action can declare its own route scoping */\nconst ActionActivationZ = {\n activation: ActivationConfigZ.optional(),\n triggerWhen: DecisionStrategyZ.nullable().optional(),\n};\n\n/** Route-scoped anchor identifier */\nconst AnchorIdZ = z\n .object({\n selector: z.string(),\n route: z.union([z.string(), z.array(z.string())]),\n })\n .strict();\n\n/** Highlight style configuration */\nconst HighlightStyleZ = z\n .object({\n color: z.string().optional(),\n scrimOpacity: z.number().min(0).max(1).optional(),\n paddingPx: z.number().optional(),\n radiusPx: z.number().optional(),\n })\n .strict();\n\n/** Badge position relative to anchor */\nconst BadgePositionZ = z.enum(['top-left', 'top-right', 'bottom-left', 'bottom-right']);\n\n/**\n * Floating-ui Placement \u2014 all 12 values.\n * Matches `@floating-ui/dom` `Placement` type.\n */\nconst PlacementZ = z.enum([\n 'top',\n 'top-start',\n 'top-end',\n 'bottom',\n 'bottom-start',\n 'bottom-end',\n 'left',\n 'left-start',\n 'left-end',\n 'right',\n 'right-start',\n 'right-end',\n]);\n\n/** CTA button configuration for tooltips/modals */\nconst CtaButtonZ = z\n .object({\n label: z.string(),\n actionId: z.string(),\n primary: z.boolean().optional(),\n })\n .strict();\n\n/**\n * Tooltip content (schema-safe version).\n * Omits `cta` (legacy field with recursive ActionStep; never in JSON schema).\n */\nconst TooltipContentZ = z\n .object({\n title: z.string().optional(),\n body: z.string(),\n ctaButtons: z.array(CtaButtonZ).optional(),\n })\n .strict();\n\n/** Modal content configuration */\nconst ModalContentZ = z\n .object({\n title: z.string().optional(),\n body: z.string(),\n })\n .strict();\n\n/** Position where HTML/content should be inserted */\nconst InsertPositionZ = z.enum(['before', 'after', 'prepend', 'append', 'replace']);\n\n/** Tooltip trigger mode */\nconst TooltipTriggerZ = z.enum(['immediate', 'hover', 'click']);\n\n/** Widget configuration for surface mounting */\nconst WidgetConfigZ = z\n .object({\n widgetId: z.string(),\n props: z.record(z.unknown()).optional(),\n priority: z.number().optional(),\n })\n .strict();\n\n/**\n * Tour step (schema-safe version).\n * Uses `z.any()` for the `action` field \u2014 the generator replaces it with a $ref.\n */\nconst TourStepForSchemaZ = z\n .object({\n id: z.string(),\n action: z.any(),\n route: z.string().optional(),\n onAction: z.record(z.string()).optional(),\n })\n .passthrough();\n\n// ============================================================================\n// ScrollBehavior / ScrollLogicalPosition (DOM built-in types as Zod enums)\n// ============================================================================\n\nconst ScrollBehaviorZ = z.enum(['auto', 'smooth', 'instant']);\nconst ScrollLogicalPositionZ = z.enum(['start', 'center', 'end', 'nearest']);\n\n// ============================================================================\n// Core Action Schemas (18 total)\n// ============================================================================\n\n// --- Content Actions ---\n\nconst SetTextZ = z\n .object({\n kind: z.literal('content:setText'),\n anchorId: AnchorIdZ,\n text: z.string(),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\nconst SetAttrZ = z\n .object({\n kind: z.literal('content:setAttr'),\n anchorId: AnchorIdZ,\n attr: z.string(),\n value: z.string(),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\nconst AddClassZ = z\n .object({\n kind: z.literal('content:addClass'),\n anchorId: AnchorIdZ,\n className: z.string(),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\nconst RemoveClassZ = z\n .object({\n kind: z.literal('content:removeClass'),\n anchorId: AnchorIdZ,\n className: z.string(),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\nconst SetStyleZ = z\n .object({\n kind: z.literal('content:setStyle'),\n anchorId: AnchorIdZ,\n styles: z.record(z.string()),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\nconst InsertHtmlZ = z\n .object({\n kind: z.literal('content:insertHtml'),\n anchorId: AnchorIdZ,\n html: z.string(),\n position: InsertPositionZ,\n deepLink: NotificationDeepLinkZ.optional(),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\n// --- Overlay Actions ---\n\nconst HighlightZ = z\n .object({\n kind: z.literal('overlays:highlight'),\n anchorId: AnchorIdZ,\n style: HighlightStyleZ.optional(),\n duration: z.number().optional(),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\nconst PulseZ = z\n .object({\n kind: z.literal('overlays:pulse'),\n anchorId: AnchorIdZ,\n duration: z.number().optional(),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\nconst BadgeZ = z\n .object({\n kind: z.literal('overlays:badge'),\n anchorId: AnchorIdZ,\n content: z.string(),\n position: BadgePositionZ.optional(),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\nconst TooltipZ = z\n .object({\n kind: z.literal('overlays:tooltip'),\n anchorId: AnchorIdZ,\n content: TooltipContentZ,\n trigger: TooltipTriggerZ.optional(),\n placement: PlacementZ.optional(),\n waitFor: z.string().optional(),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\nconst ModalZ = z\n .object({\n kind: z.literal('overlays:modal'),\n content: ModalContentZ,\n size: z.enum(['sm', 'md', 'lg']).optional(),\n blocking: z.boolean().optional(),\n scrim: z\n .object({\n opacity: z.number().min(0).max(1).optional(),\n })\n .strict()\n .optional(),\n dismiss: z\n .object({\n onEsc: z.boolean().optional(),\n closeButton: z.boolean().optional(),\n timeoutMs: z.number().min(0).optional(),\n })\n .strict()\n .optional(),\n ctaButtons: z.array(CtaButtonZ).optional(),\n waitFor: z.string().optional(),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\n// --- Navigation Actions ---\n\nconst ScrollToZ = z\n .object({\n kind: z.literal('navigation:scrollTo'),\n anchorId: AnchorIdZ,\n behavior: ScrollBehaviorZ.optional(),\n block: ScrollLogicalPositionZ.optional(),\n inline: ScrollLogicalPositionZ.optional(),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\nconst NavigateZ = z\n .object({\n kind: z.literal('navigation:navigate'),\n url: z.string(),\n target: z.enum(['_self', '_blank']).optional(),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\n// --- Core Primitives ---\n\nconst MountWidgetZ = z\n .object({\n kind: z.literal('core:mountWidget'),\n slot: z.string(),\n widget: WidgetConfigZ,\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\nconst WaitZ = z\n .object({\n kind: z.literal('core:wait'),\n durationMs: z.number().min(0).optional(),\n event: z.string().optional(),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\n/**\n * Sequence \u2014 executes actions serially.\n * `actions` uses `z.any()` as placeholder for recursive ActionStep refs.\n */\nconst SequenceZ = z\n .object({\n kind: z.literal('core:sequence'),\n actions: z.array(z.any()),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\n/**\n * Parallel \u2014 executes actions concurrently.\n * `actions` uses `z.any()` as placeholder for recursive ActionStep refs.\n */\nconst ParallelZ = z\n .object({\n kind: z.literal('core:parallel'),\n actions: z.array(z.any()),\n waitFor: z.enum(['all', 'any']).optional(),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .strict();\n\n/**\n * Tour \u2014 orchestrate sequential steps with cross-page state.\n * `steps` contains TourStepForSchemaZ which uses z.any() for step.action.\n */\nconst TourZ = z\n .object({\n kind: z.literal('core:tour'),\n tourId: z.string(),\n steps: z.array(TourStepForSchemaZ).min(1),\n startStep: z.string().optional(),\n autoStart: z.boolean().optional(),\n label: z.string().optional(),\n })\n .extend(ActionActivationZ)\n .passthrough();\n\n// ============================================================================\n// Export: Array for unified schema generation\n// ============================================================================\n\n/**\n * All 18 core action step schemas for unified JSON Schema generation.\n * The generator imports this array and converts each to JSON Schema,\n * then merges them into `$defs` and `actionStep.oneOf`.\n *\n * `defName` values match the existing `$defs` keys for backward compat.\n */\nexport const coreActionStepSchemas = [\n { defName: 'setText', schema: SetTextZ },\n { defName: 'setAttr', schema: SetAttrZ },\n { defName: 'addClass', schema: AddClassZ },\n { defName: 'removeClass', schema: RemoveClassZ },\n { defName: 'setStyle', schema: SetStyleZ },\n { defName: 'insertHtml', schema: InsertHtmlZ },\n { defName: 'highlight', schema: HighlightZ },\n { defName: 'pulse', schema: PulseZ },\n { defName: 'badge', schema: BadgeZ },\n { defName: 'tooltip', schema: TooltipZ },\n { defName: 'modal', schema: ModalZ },\n { defName: 'scrollTo', schema: ScrollToZ },\n { defName: 'navigate', schema: NavigateZ },\n { defName: 'mountWidget', schema: MountWidgetZ },\n { defName: 'wait', schema: WaitZ },\n { defName: 'sequence', schema: SequenceZ },\n { defName: 'parallel', schema: ParallelZ },\n { defName: 'tour', schema: TourZ },\n];\n\n// ============================================================================\n// Named Exports (for unit tests and direct usage)\n// ============================================================================\n\nexport {\n // Sub-types\n AnchorIdZ,\n HighlightStyleZ,\n BadgePositionZ,\n PlacementZ,\n CtaButtonZ,\n TooltipContentZ,\n ModalContentZ,\n InsertPositionZ,\n TooltipTriggerZ,\n WidgetConfigZ,\n TourStepForSchemaZ,\n ScrollBehaviorZ,\n ScrollLogicalPositionZ,\n // Actions\n SetTextZ,\n SetAttrZ,\n AddClassZ,\n RemoveClassZ,\n SetStyleZ,\n InsertHtmlZ,\n HighlightZ,\n PulseZ,\n BadgeZ,\n TooltipZ,\n ModalZ,\n ScrollToZ,\n NavigateZ,\n MountWidgetZ,\n WaitZ,\n SequenceZ,\n ParallelZ,\n TourZ,\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAeA,SAAS,SAAS;AASlB,IAAM,oBAAoB;AAAA,EACxB,YAAY,kBAAkB,SAAS;AAAA,EACvC,aAAa,kBAAkB,SAAS,EAAE,SAAS;AACrD;AAGA,IAAM,YAAY,EACf,OAAO;AAAA,EACN,UAAU,EAAE,OAAO;AAAA,EACnB,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAClD,CAAC,EACA,OAAO;AAGV,IAAM,kBAAkB,EACrB,OAAO;AAAA,EACN,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,cAAc,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EAChD,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,UAAU,EAAE,OAAO,EAAE,SAAS;AAChC,CAAC,EACA,OAAO;AAGV,IAAM,iBAAiB,EAAE,KAAK,CAAC,YAAY,aAAa,eAAe,cAAc,CAAC;AAMtF,IAAM,aAAa,EAAE,KAAK;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGD,IAAM,aAAa,EAChB,OAAO;AAAA,EACN,O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ACzC,EAAE,SAAS,cAAc,QAAQ,YAAY;AAAA,EAC7C,EAAE,SAAS,aAAa,QAAQ,WAAW;AAAA,EAC3C,EAAE,SAAS,SAAS,QAAQ,OAAO;AAAA,EACnC,EAAE,SAAS,SAAS,QAAQ,OAAO;AAAA,EACnC,EAAE,SAAS,WAAW,QAAQ,SAAS;AAAA,EACvC,EAAE,SAAS,SAAS,QAAQ,OAAO;AAAA,EACnC,EAAE,SAAS,YAAY,QAAQ,UAAU;AAAA,EACzC,EAAE,SAAS,YAAY,QAAQ,UAAU;AAAA,EACzC,EAAE,SAAS,eAAe,QAAQ,aAAa;AAAA,EAC/C,EAAE,SAAS,QAAQ,QAAQ,MAAM;AAAA,EACjC,EAAE,SAAS,YAAY,QAAQ,UAAU;AAAA,EACzC,EAAE,SAAS,YAAY,QAAQ,UAAU;AAAA,EACzC,EAAE,SAAS,QAAQ,QAAQ,MAAM;AACnC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -156,6 +156,20 @@ var executeInsertHtml = async (action, context) => {
|
|
|
156
156
|
anchorEl.replaceWith(container);
|
|
157
157
|
break;
|
|
158
158
|
}
|
|
159
|
+
let deepLinkHandler = null;
|
|
160
|
+
if (action.deepLink) {
|
|
161
|
+
const { tileId, itemId } = action.deepLink;
|
|
162
|
+
deepLinkHandler = () => {
|
|
163
|
+
var _a2, _b, _c;
|
|
164
|
+
const handle = (_a2 = window.SynOS) == null ? void 0 : _a2.handle;
|
|
165
|
+
if (handle) {
|
|
166
|
+
handle.open();
|
|
167
|
+
(_c = (_b = handle.runtime) == null ? void 0 : _b.events) == null ? void 0 : _c.publish("notification.deep_link", { tileId, itemId });
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
container.style.cursor = "pointer";
|
|
171
|
+
container.addEventListener("click", deepLinkHandler);
|
|
172
|
+
}
|
|
159
173
|
context.publishEvent("action.applied", {
|
|
160
174
|
id: context.generateId(),
|
|
161
175
|
kind: "content:insertHtml",
|
|
@@ -183,6 +197,9 @@ var executeInsertHtml = async (action, context) => {
|
|
|
183
197
|
const guardCleanup = guardAgainstReconciliation(container, anchorEl, reinsertFn);
|
|
184
198
|
return {
|
|
185
199
|
cleanup: () => {
|
|
200
|
+
if (deepLinkHandler) {
|
|
201
|
+
container.removeEventListener("click", deepLinkHandler);
|
|
202
|
+
}
|
|
186
203
|
guardCleanup();
|
|
187
204
|
if (action.position === "replace" && originalContent !== null) {
|
|
188
205
|
const restoredEl = document.createElement(anchorEl.tagName);
|
|
@@ -3223,7 +3240,7 @@ function getAntiFlickerSnippet(config = {}) {
|
|
|
3223
3240
|
}
|
|
3224
3241
|
|
|
3225
3242
|
// src/version.ts
|
|
3226
|
-
var SDK_VERSION = "2.4.0-canary.
|
|
3243
|
+
var SDK_VERSION = "2.4.0-canary.21";
|
|
3227
3244
|
|
|
3228
3245
|
// src/types.ts
|
|
3229
3246
|
var SDK_SCHEMA_VERSION = "2.0";
|
|
@@ -4001,7 +4018,7 @@ function useNotifications(eventBus, tiles) {
|
|
|
4001
4018
|
const match = matchEvent(event, tiles);
|
|
4002
4019
|
if (!match) return;
|
|
4003
4020
|
const { notification: matched, rule: matchedRule } = match;
|
|
4004
|
-
const cooldownKey = `${matched.tileId}:${event.name}`;
|
|
4021
|
+
const cooldownKey = matched.itemId ? `${matched.tileId}:${event.name}:${matched.itemId}` : `${matched.tileId}:${event.name}`;
|
|
4005
4022
|
const lastFired = cooldownMap.current.get(cooldownKey);
|
|
4006
4023
|
const now = Date.now();
|
|
4007
4024
|
const cooldown = (_a2 = matchedRule.cooldown) != null ? _a2 : DEFAULT_COOLDOWN;
|
|
@@ -4308,7 +4325,7 @@ function TileCard({
|
|
|
4308
4325
|
padding: "0 1rem 1rem",
|
|
4309
4326
|
borderTop: "1px solid rgba(255, 255, 255, 0.06)"
|
|
4310
4327
|
},
|
|
4311
|
-
children: /* @__PURE__ */ jsx4("div", { style: { paddingTop: "0.875rem" }, children: /* @__PURE__ */ jsx4(WidgetMount, { widgetId: widget, props }) })
|
|
4328
|
+
children: /* @__PURE__ */ jsx4("div", { style: { paddingTop: "0.875rem" }, children: /* @__PURE__ */ jsx4(WidgetMount, { widgetId: widget, props: { ...props, instanceId: config.id } }) })
|
|
4312
4329
|
}
|
|
4313
4330
|
)
|
|
4314
4331
|
]
|
|
@@ -10916,4 +10933,4 @@ export {
|
|
|
10916
10933
|
encodeToken,
|
|
10917
10934
|
Syntro
|
|
10918
10935
|
};
|
|
10919
|
-
//# sourceMappingURL=chunk-
|
|
10936
|
+
//# sourceMappingURL=chunk-IPU3WVPY.js.map
|