@syntrologie/adapt-gamification 2.15.0 → 2.17.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/dist/cdn.d.ts +22 -14
- package/dist/cdn.d.ts.map +1 -1
- package/dist/runtime.js +47 -85
- package/dist/runtime.js.map +7 -0
- package/dist/schema.d.ts +40 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +208 -79
- package/dist/schema.js.map +7 -0
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -15
- package/dist/cdn.js +0 -40
- package/dist/editor.d.ts +0 -22
- package/dist/editor.d.ts.map +0 -1
- package/dist/editor.js +0 -18
- package/dist/types.js +0 -7
package/dist/cdn.d.ts
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CDN Entry Point for Adaptive Gamification
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
*
|
|
4
|
+
* Bundled for CDN delivery and loaded on-demand by the host runtime's
|
|
5
|
+
* AppLoader when a config references gamification actions/widgets.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors the pattern in adaptive-mcp/src/cdn.ts: builds the manifest from
|
|
8
|
+
* the runtime export, then self-registers with the host's app registry on
|
|
9
|
+
* import. The host's AppLoader fetches this bundle, esbuild's IIFE wrapper
|
|
10
|
+
* runs the registration, and AppRegistry.activate() can then wire the
|
|
11
|
+
* executors into the runtime.
|
|
12
|
+
*
|
|
13
|
+
* Without this entry, the build script (build-adaptives-only.js) silently
|
|
14
|
+
* skips the package — gamification ends up "lazy in name only" with no
|
|
15
|
+
* bundle on disk, and any config using `gamification:awardBadge` /
|
|
16
|
+
* `gamification:addPoints` hits "Unknown action kind".
|
|
10
17
|
*/
|
|
11
18
|
export declare const manifest: {
|
|
12
19
|
id: string;
|
|
@@ -23,17 +30,18 @@ export declare const manifest: {
|
|
|
23
30
|
handler: (_event: unknown, _ctx: unknown) => void;
|
|
24
31
|
}[];
|
|
25
32
|
};
|
|
26
|
-
editor: {
|
|
27
|
-
panel: {
|
|
28
|
-
title: string;
|
|
29
|
-
icon: string;
|
|
30
|
-
description: string;
|
|
31
|
-
};
|
|
32
|
-
component: typeof import("./editor").GamificationEditor;
|
|
33
|
-
};
|
|
34
33
|
metadata: {
|
|
35
34
|
isBuiltIn: boolean;
|
|
36
35
|
};
|
|
37
36
|
};
|
|
37
|
+
declare global {
|
|
38
|
+
interface Window {
|
|
39
|
+
SynOS?: {
|
|
40
|
+
appRegistry?: {
|
|
41
|
+
register?: (m: unknown) => void;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
38
46
|
export default manifest;
|
|
39
47
|
//# sourceMappingURL=cdn.d.ts.map
|
package/dist/cdn.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdn.d.ts","sourceRoot":"","sources":["../src/cdn.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cdn.d.ts","sourceRoot":"","sources":["../src/cdn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;CAYpB,CAAC;AAEF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,KAAK,CAAC,EAAE;YACN,WAAW,CAAC,EAAE;gBACZ,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;aACjC,CAAC;SACH,CAAC;KACH;CACF;AASD,eAAe,QAAQ,CAAC"}
|
package/dist/runtime.js
CHANGED
|
@@ -1,90 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
* Note: This executor uses publishEvent to track badge awards.
|
|
14
|
-
* State management is handled at the app level via AppContext,
|
|
15
|
-
* not at the action executor level.
|
|
16
|
-
*/
|
|
17
|
-
export const executeAwardBadge = async (action, context) => {
|
|
18
|
-
const { badgeId } = action;
|
|
19
|
-
// Emit telemetry event (state management handled at app level)
|
|
20
|
-
context.publishEvent('gamification.badge_awarded', {
|
|
21
|
-
badgeId,
|
|
22
|
-
awardedAt: Date.now(),
|
|
23
|
-
});
|
|
24
|
-
return {
|
|
25
|
-
cleanup: () => {
|
|
26
|
-
// Badge awards are permanent, no cleanup needed
|
|
27
|
-
},
|
|
28
|
-
};
|
|
1
|
+
// src/runtime.ts
|
|
2
|
+
var executeAwardBadge = async (action, context) => {
|
|
3
|
+
const { badgeId } = action;
|
|
4
|
+
context.publishEvent("gamification.badge_awarded", {
|
|
5
|
+
badgeId,
|
|
6
|
+
awardedAt: Date.now()
|
|
7
|
+
});
|
|
8
|
+
return {
|
|
9
|
+
cleanup: () => {
|
|
10
|
+
}
|
|
11
|
+
};
|
|
29
12
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
points,
|
|
42
|
-
reason,
|
|
43
|
-
timestamp: Date.now(),
|
|
44
|
-
});
|
|
45
|
-
return {
|
|
46
|
-
cleanup: () => {
|
|
47
|
-
// Points are permanent, no cleanup needed
|
|
48
|
-
},
|
|
49
|
-
};
|
|
13
|
+
var executeAddPoints = async (action, context) => {
|
|
14
|
+
const { points, reason } = action;
|
|
15
|
+
context.publishEvent("gamification.points_added", {
|
|
16
|
+
points,
|
|
17
|
+
reason,
|
|
18
|
+
timestamp: Date.now()
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
cleanup: () => {
|
|
22
|
+
}
|
|
23
|
+
};
|
|
50
24
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
*/
|
|
57
|
-
export const badgeTriggerHandler = {
|
|
58
|
-
names: ['page_view', 'button_click'],
|
|
59
|
-
handler: (_event, _ctx) => {
|
|
60
|
-
// Auto-award badges based on event triggers
|
|
61
|
-
// This would check badge trigger conditions in the config
|
|
62
|
-
console.log('[Gamification] Event received for badge trigger check');
|
|
63
|
-
},
|
|
25
|
+
var badgeTriggerHandler = {
|
|
26
|
+
names: ["page_view", "button_click"],
|
|
27
|
+
handler: (_event, _ctx) => {
|
|
28
|
+
console.log("[Gamification] Event received for badge trigger check");
|
|
29
|
+
}
|
|
64
30
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* All executors provided by this app.
|
|
70
|
-
* These are registered with the runtime's ExecutorRegistry.
|
|
71
|
-
*/
|
|
72
|
-
export const executors = [
|
|
73
|
-
{ kind: 'gamification:awardBadge', executor: executeAwardBadge },
|
|
74
|
-
{ kind: 'gamification:addPoints', executor: executeAddPoints },
|
|
31
|
+
var executors = [
|
|
32
|
+
{ kind: "gamification:awardBadge", executor: executeAwardBadge },
|
|
33
|
+
{ kind: "gamification:addPoints", executor: executeAddPoints }
|
|
75
34
|
];
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
id: 'adaptive-gamification',
|
|
85
|
-
version: '1.0.0',
|
|
86
|
-
name: 'Gamification',
|
|
87
|
-
description: 'Badges, rewards, points, and engagement mechanics',
|
|
88
|
-
executors,
|
|
89
|
-
eventHandlers,
|
|
35
|
+
var eventHandlers = [badgeTriggerHandler];
|
|
36
|
+
var runtime = {
|
|
37
|
+
id: "adaptive-gamification",
|
|
38
|
+
version: "1.0.0",
|
|
39
|
+
name: "Gamification",
|
|
40
|
+
description: "Badges, rewards, points, and engagement mechanics",
|
|
41
|
+
executors,
|
|
42
|
+
eventHandlers
|
|
90
43
|
};
|
|
44
|
+
export {
|
|
45
|
+
badgeTriggerHandler,
|
|
46
|
+
eventHandlers,
|
|
47
|
+
executeAddPoints,
|
|
48
|
+
executeAwardBadge,
|
|
49
|
+
executors,
|
|
50
|
+
runtime
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/runtime.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Adaptive Gamification - Runtime Module\n *\n * Gamification actions: awardBadge, addPoints.\n * Provides gamification features like badges, points, and rewards.\n */\n\nimport type { ActionExecutor, ExecutorResult } from './types';\n\n// ============================================================================\n// Action Types\n// ============================================================================\n\n/**\n * Award badge action\n */\nexport interface AwardBadgeAction {\n kind: 'gamification:awardBadge';\n badgeId: string;\n anchorId?: string;\n label?: string;\n}\n\n/**\n * Add points action\n */\nexport interface AddPointsAction {\n kind: 'gamification:addPoints';\n points: number;\n reason?: string;\n label?: string;\n}\n\n// ============================================================================\n// Executors\n// ============================================================================\n\n/**\n * Execute an awardBadge action\n *\n * Note: This executor uses publishEvent to track badge awards.\n * State management is handled at the app level via AppContext,\n * not at the action executor level.\n */\nexport const executeAwardBadge: ActionExecutor<AwardBadgeAction> = async (\n action,\n context\n): Promise<ExecutorResult> => {\n const { badgeId } = action;\n\n // Emit telemetry event (state management handled at app level)\n context.publishEvent('gamification.badge_awarded', {\n badgeId,\n awardedAt: Date.now(),\n });\n\n return {\n cleanup: () => {\n // Badge awards are permanent, no cleanup needed\n },\n };\n};\n\n/**\n * Execute an addPoints action\n *\n * Note: This executor uses publishEvent to track points.\n * State management is handled at the app level via AppContext,\n * not at the action executor level.\n */\nexport const executeAddPoints: ActionExecutor<AddPointsAction> = async (\n action,\n context\n): Promise<ExecutorResult> => {\n const { points, reason } = action;\n\n // Emit telemetry event (state management handled at app level)\n context.publishEvent('gamification.points_added', {\n points,\n reason,\n timestamp: Date.now(),\n });\n\n return {\n cleanup: () => {\n // Points are permanent, no cleanup needed\n },\n };\n};\n\n// ============================================================================\n// Event Handlers\n// ============================================================================\n\n/**\n * Event handler for auto-awarding badges based on triggers.\n */\nexport const badgeTriggerHandler = {\n names: ['page_view', 'button_click'],\n handler: (_event: unknown, _ctx: unknown) => {\n // Auto-award badges based on event triggers\n // This would check badge trigger conditions in the config\n console.log('[Gamification] Event received for badge trigger check');\n },\n};\n\n// ============================================================================\n// Executor Definitions for Registration\n// ============================================================================\n\n/**\n * All executors provided by this app.\n * These are registered with the runtime's ExecutorRegistry.\n */\nexport const executors = [\n { kind: 'gamification:awardBadge', executor: executeAwardBadge },\n { kind: 'gamification:addPoints', executor: executeAddPoints },\n] as const;\n\n/**\n * Event handlers provided by this app.\n */\nexport const eventHandlers = [badgeTriggerHandler];\n\n/**\n * App runtime manifest.\n */\nexport const runtime = {\n id: 'adaptive-gamification',\n version: '1.0.0',\n name: 'Gamification',\n description: 'Badges, rewards, points, and engagement mechanics',\n executors,\n eventHandlers,\n};\n"],
|
|
5
|
+
"mappings": ";AA4CO,IAAM,oBAAsD,OACjE,QACA,YAC4B;AAC5B,QAAM,EAAE,QAAQ,IAAI;AAGpB,UAAQ,aAAa,8BAA8B;AAAA,IACjD;AAAA,IACA,WAAW,KAAK,IAAI;AAAA,EACtB,CAAC;AAED,SAAO;AAAA,IACL,SAAS,MAAM;AAAA,IAEf;AAAA,EACF;AACF;AASO,IAAM,mBAAoD,OAC/D,QACA,YAC4B;AAC5B,QAAM,EAAE,QAAQ,OAAO,IAAI;AAG3B,UAAQ,aAAa,6BAA6B;AAAA,IAChD;AAAA,IACA;AAAA,IACA,WAAW,KAAK,IAAI;AAAA,EACtB,CAAC;AAED,SAAO;AAAA,IACL,SAAS,MAAM;AAAA,IAEf;AAAA,EACF;AACF;AASO,IAAM,sBAAsB;AAAA,EACjC,OAAO,CAAC,aAAa,cAAc;AAAA,EACnC,SAAS,CAAC,QAAiB,SAAkB;AAG3C,YAAQ,IAAI,uDAAuD;AAAA,EACrE;AACF;AAUO,IAAM,YAAY;AAAA,EACvB,EAAE,MAAM,2BAA2B,UAAU,kBAAkB;AAAA,EAC/D,EAAE,MAAM,0BAA0B,UAAU,iBAAiB;AAC/D;AAKO,IAAM,gBAAgB,CAAC,mBAAmB;AAK1C,IAAM,UAAU;AAAA,EACrB,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,MAAM;AAAA,EACN,aAAa;AAAA,EACb;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/schema.d.ts
CHANGED
|
@@ -642,9 +642,15 @@ export declare const AwardBadgeSchema: z.ZodObject<{
|
|
|
642
642
|
method?: "GET" | "POST" | undefined;
|
|
643
643
|
timeoutMs?: number | undefined;
|
|
644
644
|
}>]>>>;
|
|
645
|
+
} & {
|
|
646
|
+
readonly title: z.ZodOptional<z.ZodString>;
|
|
647
|
+
readonly description: z.ZodOptional<z.ZodString>;
|
|
648
|
+
readonly validation: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
645
649
|
}, "strip", z.ZodTypeAny, {
|
|
646
650
|
badgeId: string;
|
|
647
651
|
kind: "gamification:awardBadge";
|
|
652
|
+
description?: string | undefined;
|
|
653
|
+
validation?: string[] | undefined;
|
|
648
654
|
anchorId?: {
|
|
649
655
|
selector: string;
|
|
650
656
|
route: string | string[];
|
|
@@ -731,9 +737,12 @@ export declare const AwardBadgeSchema: z.ZodObject<{
|
|
|
731
737
|
method?: "GET" | "POST" | undefined;
|
|
732
738
|
timeoutMs?: number | undefined;
|
|
733
739
|
} | null | undefined;
|
|
740
|
+
title?: string | undefined;
|
|
734
741
|
}, {
|
|
735
742
|
badgeId: string;
|
|
736
743
|
kind: "gamification:awardBadge";
|
|
744
|
+
description?: string | undefined;
|
|
745
|
+
validation?: string[] | undefined;
|
|
737
746
|
anchorId?: {
|
|
738
747
|
selector: string;
|
|
739
748
|
route: string | string[];
|
|
@@ -820,6 +829,7 @@ export declare const AwardBadgeSchema: z.ZodObject<{
|
|
|
820
829
|
method?: "GET" | "POST" | undefined;
|
|
821
830
|
timeoutMs?: number | undefined;
|
|
822
831
|
} | null | undefined;
|
|
832
|
+
title?: string | undefined;
|
|
823
833
|
}>;
|
|
824
834
|
/**
|
|
825
835
|
* Schema for adding points to a user's score.
|
|
@@ -1315,10 +1325,16 @@ export declare const AddPointsSchema: z.ZodObject<{
|
|
|
1315
1325
|
method?: "GET" | "POST" | undefined;
|
|
1316
1326
|
timeoutMs?: number | undefined;
|
|
1317
1327
|
}>]>>>;
|
|
1328
|
+
} & {
|
|
1329
|
+
readonly title: z.ZodOptional<z.ZodString>;
|
|
1330
|
+
readonly description: z.ZodOptional<z.ZodString>;
|
|
1331
|
+
readonly validation: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1318
1332
|
}, "strip", z.ZodTypeAny, {
|
|
1319
1333
|
points: number;
|
|
1320
1334
|
kind: "gamification:addPoints";
|
|
1321
1335
|
reason?: string | undefined;
|
|
1336
|
+
description?: string | undefined;
|
|
1337
|
+
validation?: string[] | undefined;
|
|
1322
1338
|
label?: string | undefined;
|
|
1323
1339
|
triggerWhen?: {
|
|
1324
1340
|
type: "rules";
|
|
@@ -1401,10 +1417,13 @@ export declare const AddPointsSchema: z.ZodObject<{
|
|
|
1401
1417
|
method?: "GET" | "POST" | undefined;
|
|
1402
1418
|
timeoutMs?: number | undefined;
|
|
1403
1419
|
} | null | undefined;
|
|
1420
|
+
title?: string | undefined;
|
|
1404
1421
|
}, {
|
|
1405
1422
|
points: number;
|
|
1406
1423
|
kind: "gamification:addPoints";
|
|
1407
1424
|
reason?: string | undefined;
|
|
1425
|
+
description?: string | undefined;
|
|
1426
|
+
validation?: string[] | undefined;
|
|
1408
1427
|
label?: string | undefined;
|
|
1409
1428
|
triggerWhen?: {
|
|
1410
1429
|
type: "rules";
|
|
@@ -1487,6 +1506,7 @@ export declare const AddPointsSchema: z.ZodObject<{
|
|
|
1487
1506
|
method?: "GET" | "POST" | undefined;
|
|
1488
1507
|
timeoutMs?: number | undefined;
|
|
1489
1508
|
} | null | undefined;
|
|
1509
|
+
title?: string | undefined;
|
|
1490
1510
|
}>;
|
|
1491
1511
|
/**
|
|
1492
1512
|
* Action step schemas for unified JSON Schema generation.
|
|
@@ -1995,9 +2015,15 @@ export declare const actionStepSchemas: ({
|
|
|
1995
2015
|
method?: "GET" | "POST" | undefined;
|
|
1996
2016
|
timeoutMs?: number | undefined;
|
|
1997
2017
|
}>]>>>;
|
|
2018
|
+
} & {
|
|
2019
|
+
readonly title: z.ZodOptional<z.ZodString>;
|
|
2020
|
+
readonly description: z.ZodOptional<z.ZodString>;
|
|
2021
|
+
readonly validation: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1998
2022
|
}, "strip", z.ZodTypeAny, {
|
|
1999
2023
|
badgeId: string;
|
|
2000
2024
|
kind: "gamification:awardBadge";
|
|
2025
|
+
description?: string | undefined;
|
|
2026
|
+
validation?: string[] | undefined;
|
|
2001
2027
|
anchorId?: {
|
|
2002
2028
|
selector: string;
|
|
2003
2029
|
route: string | string[];
|
|
@@ -2084,9 +2110,12 @@ export declare const actionStepSchemas: ({
|
|
|
2084
2110
|
method?: "GET" | "POST" | undefined;
|
|
2085
2111
|
timeoutMs?: number | undefined;
|
|
2086
2112
|
} | null | undefined;
|
|
2113
|
+
title?: string | undefined;
|
|
2087
2114
|
}, {
|
|
2088
2115
|
badgeId: string;
|
|
2089
2116
|
kind: "gamification:awardBadge";
|
|
2117
|
+
description?: string | undefined;
|
|
2118
|
+
validation?: string[] | undefined;
|
|
2090
2119
|
anchorId?: {
|
|
2091
2120
|
selector: string;
|
|
2092
2121
|
route: string | string[];
|
|
@@ -2173,6 +2202,7 @@ export declare const actionStepSchemas: ({
|
|
|
2173
2202
|
method?: "GET" | "POST" | undefined;
|
|
2174
2203
|
timeoutMs?: number | undefined;
|
|
2175
2204
|
} | null | undefined;
|
|
2205
|
+
title?: string | undefined;
|
|
2176
2206
|
}>;
|
|
2177
2207
|
} | {
|
|
2178
2208
|
defName: string;
|
|
@@ -2667,10 +2697,16 @@ export declare const actionStepSchemas: ({
|
|
|
2667
2697
|
method?: "GET" | "POST" | undefined;
|
|
2668
2698
|
timeoutMs?: number | undefined;
|
|
2669
2699
|
}>]>>>;
|
|
2700
|
+
} & {
|
|
2701
|
+
readonly title: z.ZodOptional<z.ZodString>;
|
|
2702
|
+
readonly description: z.ZodOptional<z.ZodString>;
|
|
2703
|
+
readonly validation: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2670
2704
|
}, "strip", z.ZodTypeAny, {
|
|
2671
2705
|
points: number;
|
|
2672
2706
|
kind: "gamification:addPoints";
|
|
2673
2707
|
reason?: string | undefined;
|
|
2708
|
+
description?: string | undefined;
|
|
2709
|
+
validation?: string[] | undefined;
|
|
2674
2710
|
label?: string | undefined;
|
|
2675
2711
|
triggerWhen?: {
|
|
2676
2712
|
type: "rules";
|
|
@@ -2753,10 +2789,13 @@ export declare const actionStepSchemas: ({
|
|
|
2753
2789
|
method?: "GET" | "POST" | undefined;
|
|
2754
2790
|
timeoutMs?: number | undefined;
|
|
2755
2791
|
} | null | undefined;
|
|
2792
|
+
title?: string | undefined;
|
|
2756
2793
|
}, {
|
|
2757
2794
|
points: number;
|
|
2758
2795
|
kind: "gamification:addPoints";
|
|
2759
2796
|
reason?: string | undefined;
|
|
2797
|
+
description?: string | undefined;
|
|
2798
|
+
validation?: string[] | undefined;
|
|
2760
2799
|
label?: string | undefined;
|
|
2761
2800
|
triggerWhen?: {
|
|
2762
2801
|
type: "rules";
|
|
@@ -2839,6 +2878,7 @@ export declare const actionStepSchemas: ({
|
|
|
2839
2878
|
method?: "GET" | "POST" | undefined;
|
|
2840
2879
|
timeoutMs?: number | undefined;
|
|
2841
2880
|
} | null | undefined;
|
|
2881
|
+
title?: string | undefined;
|
|
2842
2882
|
}>;
|
|
2843
2883
|
})[];
|
|
2844
2884
|
//# sourceMappingURL=schema.d.ts.map
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAStB,CAAC;AAUH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASvB,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAM9D;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAStB,CAAC;AAUH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASvB,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAM9D;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;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G,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAA8c,CAAC;;;;yBAAgH,CAAC;;;4BAA2E,CAAC;4BAA0C,CAAC;6BAA2C,CAAC;6BAA2C,CAAC;;;;;;;;;4BAA4T,CAAC;;;;4BAAuH,CAAC;;;;;4BAAkJ,CAAC;;;;;;4BAAwM,CAAC;2BAAyC,CAAC;;6BAAsS,CAAC;kCAA6C,CAAC;oCAAqE,CAAC;;;;qBAA4G,CAAC;;;;;;;;;;;;;;;;;;;;;;;;IAD1y7E,CAAC"}
|
package/dist/schema.js
CHANGED
|
@@ -1,83 +1,212 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
// ../../sdk-contracts/dist/schemas.js
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var AnchorIdZ = z.object({
|
|
4
|
+
selector: z.string(),
|
|
5
|
+
route: z.union([z.string(), z.array(z.string())])
|
|
6
|
+
}).strict();
|
|
7
|
+
var AuthoringFieldsZ = {
|
|
8
|
+
title: z.string().max(200).optional().describe("Authoring-only: short label shown on the action plan dashboard. Stripped before serving to the runtime SDK."),
|
|
9
|
+
description: z.string().max(1e3).optional().describe("Authoring-only: one-sentence explanation of what this action does and why. Stripped before serving to the runtime SDK."),
|
|
10
|
+
validation: z.array(z.string().max(500)).max(10).optional().describe("Authoring-only: ordered steps a reviewer can follow to trigger this action and visually confirm it works. Each entry is one step. Stripped before serving to the runtime SDK.")
|
|
11
|
+
};
|
|
12
|
+
var COUNTABLE_EVENTS = [
|
|
13
|
+
// User interactions (from PostHog autocapture normalization)
|
|
14
|
+
"ui.click",
|
|
15
|
+
"ui.scroll",
|
|
16
|
+
"ui.input",
|
|
17
|
+
"ui.change",
|
|
18
|
+
"ui.submit",
|
|
19
|
+
// Behavioral detectors (from event-processor)
|
|
20
|
+
"ui.hover",
|
|
21
|
+
"ui.idle",
|
|
22
|
+
"ui.scroll_thrash",
|
|
23
|
+
"ui.focus_bounce",
|
|
24
|
+
// Navigation
|
|
25
|
+
"nav.page_view",
|
|
26
|
+
"nav.page_leave",
|
|
27
|
+
// Derived behavioral signals
|
|
28
|
+
"behavior.rage_click",
|
|
29
|
+
"behavior.hesitation",
|
|
30
|
+
"behavior.confusion"
|
|
31
|
+
];
|
|
32
|
+
var CountableEventZ = z.enum(COUNTABLE_EVENTS).describe("Event name to count. ui.* = user interactions and behavioral detectors, nav.* = page navigation, behavior.* = derived behavioral signals.");
|
|
33
|
+
var SESSION_METRIC_KEYS = ["time_on_page", "page_views", "scroll_depth"];
|
|
34
|
+
var SessionMetricKeyZ = z.enum(SESSION_METRIC_KEYS).describe("Session metric key. time_on_page = seconds on current page, page_views = pages visited this session, scroll_depth = 0-100 percentage.");
|
|
35
|
+
var PageUrlConditionZ = z.object({
|
|
36
|
+
type: z.literal("page_url"),
|
|
37
|
+
url: z.string().describe('URL path to match (e.g. "/pricing", "/dashboard")')
|
|
38
|
+
}).describe('Fires when the current page URL matches. Use for page-specific actions. Example: {"type": "page_url", "url": "/pricing"}');
|
|
39
|
+
var RouteConditionZ = z.object({
|
|
40
|
+
type: z.literal("route"),
|
|
41
|
+
routeId: z.string().describe("Named route ID from the route filter")
|
|
42
|
+
}).describe("Fires when the current route matches a named route ID.");
|
|
43
|
+
var AnchorVisibleConditionZ = z.object({
|
|
44
|
+
type: z.literal("anchor_visible"),
|
|
45
|
+
anchorId: z.string().describe("CSS selector of the anchor element"),
|
|
46
|
+
state: z.enum(["visible", "present", "absent"]).describe('"visible" = in viewport, "present" = in DOM, "absent" = not in DOM')
|
|
47
|
+
}).describe(`Fires based on a DOM element's visibility state. Example: {"type": "anchor_visible", "anchorId": "#cta-button", "state": "visible"}`);
|
|
48
|
+
var EventOccurredConditionZ = z.object({
|
|
49
|
+
type: z.literal("event_occurred"),
|
|
50
|
+
eventName: z.string().describe('Event name (e.g. "ui.click", "$pageview")'),
|
|
51
|
+
withinMs: z.number().optional().describe("Time window in ms. Omit = any time this session.")
|
|
52
|
+
}).describe('Fires when a specific event has occurred during this session. Example: {"type": "event_occurred", "eventName": "ui.click", "withinMs": 5000}');
|
|
53
|
+
var StateEqualsConditionZ = z.object({
|
|
54
|
+
type: z.literal("state_equals"),
|
|
55
|
+
key: z.string().describe("Key in the SDK persistent state store (localStorage). Only valid for keys the host app explicitly sets via syntro.state.set()."),
|
|
56
|
+
value: z.unknown().describe("Expected value to match against")
|
|
57
|
+
}).describe("Checks the SDK persistent state store (localStorage). ONLY for host-app state set via syntro.state.set() \u2014 NOT for user attributes like region, device, or UTM params (those are handled by segment targeting). Do NOT use this for targeting. If you do not know the valid state keys, do not use this condition type.");
|
|
58
|
+
var ViewportConditionZ = z.object({
|
|
59
|
+
type: z.literal("viewport"),
|
|
60
|
+
minWidth: z.number().optional().describe("Minimum viewport width in pixels"),
|
|
61
|
+
maxWidth: z.number().optional().describe("Maximum viewport width in pixels"),
|
|
62
|
+
minHeight: z.number().optional().describe("Minimum viewport height in pixels"),
|
|
63
|
+
maxHeight: z.number().optional().describe("Maximum viewport height in pixels")
|
|
64
|
+
}).describe('Fires based on viewport (screen) size. Use for responsive behavior. Example: {"type": "viewport", "minWidth": 768} \u2014 fires on tablet and larger.');
|
|
65
|
+
var SessionMetricConditionZ = z.object({
|
|
66
|
+
type: z.literal("session_metric"),
|
|
67
|
+
key: SessionMetricKeyZ,
|
|
68
|
+
operator: z.enum(["gte", "lte", "eq", "gt", "lt"]),
|
|
69
|
+
threshold: z.number().describe("Numeric threshold to compare against")
|
|
70
|
+
}).describe('Fires when a session metric crosses a threshold. Valid keys: "time_on_page" (seconds), "page_views" (count), "scroll_depth" (0-100). Example: {"type": "session_metric", "key": "time_on_page", "operator": "gte", "threshold": 30}');
|
|
71
|
+
var DismissedConditionZ = z.object({
|
|
72
|
+
type: z.literal("dismissed"),
|
|
73
|
+
key: z.string().describe("Dismissal key (usually a tile or action ID)"),
|
|
74
|
+
inverted: z.boolean().optional().describe("When true, fires if NOT dismissed (default behavior)")
|
|
75
|
+
}).describe("Checks if an item has been dismissed by the user. Use with inverted: true to show only if not dismissed.");
|
|
76
|
+
var CooldownActiveConditionZ = z.object({
|
|
77
|
+
type: z.literal("cooldown_active"),
|
|
78
|
+
key: z.string().describe("Cooldown key"),
|
|
79
|
+
inverted: z.boolean().optional().describe("When true, fires if cooldown is NOT active")
|
|
80
|
+
}).describe("Checks if a cooldown timer is currently active. Use to prevent showing the same intervention too frequently.");
|
|
81
|
+
var FrequencyLimitConditionZ = z.object({
|
|
82
|
+
type: z.literal("frequency_limit"),
|
|
83
|
+
key: z.string().describe("Frequency counter key"),
|
|
84
|
+
limit: z.number().describe("Maximum allowed count"),
|
|
85
|
+
inverted: z.boolean().optional().describe("When true, fires if limit NOT reached")
|
|
86
|
+
}).describe("Checks if a frequency limit has been reached. Use to cap how many times an action fires per session.");
|
|
87
|
+
var MatchOpZ = z.object({
|
|
88
|
+
equals: z.union([z.string(), z.number(), z.boolean()]).optional(),
|
|
89
|
+
contains: z.string().optional()
|
|
90
|
+
}).describe("Match operator for counter filters. Exactly one of equals or contains must be specified.");
|
|
91
|
+
var CounterDefZ = z.object({
|
|
92
|
+
events: z.array(CountableEventZ).min(1).describe("Event names to count. Use values from the countable events enum."),
|
|
93
|
+
match: z.record(z.string(), MatchOpZ).optional().describe("Property filters. Keys are event prop names or element-chain fields (tag_name, $el_text, attr__*). All entries AND together.")
|
|
94
|
+
}).describe("Defines what events to count. Registered as an accumulator predicate at config-load time.");
|
|
95
|
+
var EventCountConditionZ = z.object({
|
|
96
|
+
type: z.literal("event_count"),
|
|
97
|
+
key: z.string().describe("Unique key for this counter (used for accumulator registration)"),
|
|
98
|
+
operator: z.enum(["gte", "lte", "eq", "gt", "lt"]),
|
|
99
|
+
count: z.number().int().min(0).describe("Target count threshold"),
|
|
100
|
+
withinMs: z.number().positive().optional().describe("Time window in ms. Omit = count across entire session."),
|
|
101
|
+
counter: CounterDefZ.optional().describe("Inline counter definition. Defines what events to count.")
|
|
102
|
+
}).describe('Fires when accumulated event count crosses a threshold. Most powerful trigger type. Example: {"type": "event_count", "key": "pricing-clicks", "operator": "gte", "count": 3, "counter": {"events": ["ui.click"], "match": {"attr__data-cta": {"contains": "pricing"}}}}');
|
|
103
|
+
var ConditionZ = z.discriminatedUnion("type", [
|
|
104
|
+
PageUrlConditionZ,
|
|
105
|
+
RouteConditionZ,
|
|
106
|
+
AnchorVisibleConditionZ,
|
|
107
|
+
EventOccurredConditionZ,
|
|
108
|
+
StateEqualsConditionZ,
|
|
109
|
+
ViewportConditionZ,
|
|
110
|
+
SessionMetricConditionZ,
|
|
111
|
+
DismissedConditionZ,
|
|
112
|
+
CooldownActiveConditionZ,
|
|
113
|
+
FrequencyLimitConditionZ,
|
|
114
|
+
EventCountConditionZ
|
|
115
|
+
]);
|
|
116
|
+
var RuleZ = z.object({
|
|
117
|
+
conditions: z.array(ConditionZ).describe("Array of conditions \u2014 ALL must match (AND logic) for this rule to fire."),
|
|
118
|
+
value: z.unknown().describe("Value returned when all conditions match. For triggerWhen: true = fire the action.")
|
|
119
|
+
}).describe("A single rule. ALL conditions must match (AND logic). Rules in a strategy are evaluated top-to-bottom \u2014 first rule where all conditions match wins and returns its value.");
|
|
120
|
+
var RuleStrategyZ = z.object({
|
|
121
|
+
type: z.literal("rules"),
|
|
122
|
+
rules: z.array(RuleZ).describe("Ordered list of rules. Evaluated top-to-bottom \u2014 first match wins."),
|
|
123
|
+
default: z.unknown().describe("Fallback value when no rule matches. For triggerWhen: false = do not fire by default.")
|
|
124
|
+
}).describe("Rule-based strategy. Evaluates rules top-to-bottom. First rule where ALL conditions match returns its value. If no rule matches, returns default. For triggerWhen: set value=true on matching rules, default=false.");
|
|
125
|
+
var ScoreStrategyZ = z.object({
|
|
126
|
+
type: z.literal("score"),
|
|
127
|
+
field: z.string(),
|
|
128
|
+
threshold: z.number(),
|
|
129
|
+
above: z.unknown(),
|
|
130
|
+
below: z.unknown()
|
|
131
|
+
}).describe("Score-based strategy. Compares a field value against a threshold.");
|
|
132
|
+
var ModelStrategyZ = z.object({
|
|
133
|
+
type: z.literal("model"),
|
|
134
|
+
modelId: z.string(),
|
|
135
|
+
inputs: z.array(z.string()),
|
|
136
|
+
outputMapping: z.record(z.string(), z.unknown()),
|
|
137
|
+
default: z.unknown()
|
|
138
|
+
}).describe("ML model strategy. Sends inputs to a model and maps outputs.");
|
|
139
|
+
var ExternalStrategyZ = z.object({
|
|
140
|
+
type: z.literal("external"),
|
|
141
|
+
endpoint: z.string(),
|
|
142
|
+
method: z.enum(["GET", "POST"]).optional(),
|
|
143
|
+
default: z.unknown(),
|
|
144
|
+
timeoutMs: z.number().optional()
|
|
145
|
+
}).describe("External API strategy. Calls an endpoint to determine the value.");
|
|
146
|
+
var DecisionStrategyZ = z.discriminatedUnion("type", [
|
|
147
|
+
RuleStrategyZ,
|
|
148
|
+
ScoreStrategyZ,
|
|
149
|
+
ModelStrategyZ,
|
|
150
|
+
ExternalStrategyZ
|
|
151
|
+
]);
|
|
152
|
+
var TriggerWhenZ = DecisionStrategyZ.nullable().optional();
|
|
153
|
+
var EventScopeZ = z.object({
|
|
154
|
+
events: z.array(z.string()),
|
|
155
|
+
urlContains: z.string().optional(),
|
|
156
|
+
props: z.record(z.union([z.string(), z.number(), z.boolean()])).optional()
|
|
157
|
+
});
|
|
158
|
+
var NotifyZ = z.object({
|
|
159
|
+
title: z.string().optional(),
|
|
160
|
+
body: z.string().optional(),
|
|
161
|
+
icon: z.string().optional()
|
|
162
|
+
}).nullable().optional();
|
|
163
|
+
|
|
164
|
+
// src/schema.ts
|
|
165
|
+
import { z as z2 } from "zod";
|
|
166
|
+
var ActionTriggerZ = { triggerWhen: TriggerWhenZ };
|
|
167
|
+
var badgeSchema = z2.object({
|
|
168
|
+
id: z2.string(),
|
|
169
|
+
name: z2.string(),
|
|
170
|
+
icon: z2.string(),
|
|
171
|
+
description: z2.string().optional(),
|
|
172
|
+
trigger: z2.object({
|
|
173
|
+
event: z2.string(),
|
|
174
|
+
conditions: z2.array(z2.unknown()).optional()
|
|
175
|
+
})
|
|
26
176
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const leaderboardConfigSchema = z.object({
|
|
31
|
-
enabled: z.boolean().default(false),
|
|
32
|
-
refreshInterval: z.number().default(60000),
|
|
177
|
+
var leaderboardConfigSchema = z2.object({
|
|
178
|
+
enabled: z2.boolean().default(false),
|
|
179
|
+
refreshInterval: z2.number().default(6e4)
|
|
33
180
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
.object({
|
|
42
|
-
enabled: z.boolean().default(false),
|
|
43
|
-
multiplier: z.number().default(1),
|
|
44
|
-
})
|
|
45
|
-
.optional(),
|
|
181
|
+
var configSchema = z2.object({
|
|
182
|
+
badges: z2.array(badgeSchema).default([]),
|
|
183
|
+
leaderboard: leaderboardConfigSchema.optional(),
|
|
184
|
+
points: z2.object({
|
|
185
|
+
enabled: z2.boolean().default(false),
|
|
186
|
+
multiplier: z2.number().default(1)
|
|
187
|
+
}).optional()
|
|
46
188
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
* Schema for adding points to a user's score.
|
|
63
|
-
*/
|
|
64
|
-
export const AddPointsSchema = z
|
|
65
|
-
.object({
|
|
66
|
-
kind: z.literal('gamification:addPoints'),
|
|
67
|
-
points: z.number(),
|
|
68
|
-
reason: z.string().optional(),
|
|
69
|
-
label: z.string().optional(),
|
|
70
|
-
})
|
|
71
|
-
.extend(ActionTriggerZ);
|
|
72
|
-
// ============================================================================
|
|
73
|
-
// Unified Schema Export
|
|
74
|
-
// ============================================================================
|
|
75
|
-
/**
|
|
76
|
-
* Action step schemas for unified JSON Schema generation.
|
|
77
|
-
* The build script reads this array to merge adaptive actions into the
|
|
78
|
-
* unified canvas-config.schema.json.
|
|
79
|
-
*/
|
|
80
|
-
export const actionStepSchemas = [
|
|
81
|
-
{ defName: 'awardBadge', schema: AwardBadgeSchema },
|
|
82
|
-
{ defName: 'addPoints', schema: AddPointsSchema },
|
|
189
|
+
var AwardBadgeSchema = z2.object({
|
|
190
|
+
kind: z2.literal("gamification:awardBadge"),
|
|
191
|
+
badgeId: z2.string(),
|
|
192
|
+
anchorId: AnchorIdZ.optional(),
|
|
193
|
+
label: z2.string().optional()
|
|
194
|
+
}).extend(ActionTriggerZ).extend(AuthoringFieldsZ);
|
|
195
|
+
var AddPointsSchema = z2.object({
|
|
196
|
+
kind: z2.literal("gamification:addPoints"),
|
|
197
|
+
points: z2.number(),
|
|
198
|
+
reason: z2.string().optional(),
|
|
199
|
+
label: z2.string().optional()
|
|
200
|
+
}).extend(ActionTriggerZ).extend(AuthoringFieldsZ);
|
|
201
|
+
var actionStepSchemas = [
|
|
202
|
+
{ defName: "awardBadge", schema: AwardBadgeSchema },
|
|
203
|
+
{ defName: "addPoints", schema: AddPointsSchema }
|
|
83
204
|
];
|
|
205
|
+
export {
|
|
206
|
+
AddPointsSchema,
|
|
207
|
+
AwardBadgeSchema,
|
|
208
|
+
actionStepSchemas,
|
|
209
|
+
badgeSchema,
|
|
210
|
+
configSchema
|
|
211
|
+
};
|
|
212
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../sdk-contracts/dist/schemas.js", "../src/schema.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Shared Zod schemas for decision strategies, conditions, and event scoping.\n *\n * These are the canonical definitions \u2014 runtime-sdk and all adaptive packages\n * should import from here instead of duplicating.\n */\nimport { z } from 'zod';\n// =============================================================================\n// ANCHOR ID SCHEMA\n// =============================================================================\nexport const AnchorIdZ = z\n .object({\n selector: z.string(),\n route: z.union([z.string(), z.array(z.string())]),\n})\n .strict();\n// =============================================================================\n// AUTHORING FIELDS \u2014 title / description / validation\n//\n// These live on every action *during authoring* (LLM produces them; dashboard\n// displays them; reviewers QA-verify with them) but are stripped before the\n// runtime SDK receives the config. Stripping happens server-side in\n// `to_runtime_config` (platform/backend/app/domains/experiments/helpers.py).\n// They appear in the JSON Schema (and therefore in the tactician's prompt)\n// because the LLM needs to know they are valid action properties \u2014 otherwise\n// schema validation would reject what the prompt commands.\n//\n// Each action variant should `.extend(AuthoringFieldsZ)` alongside any\n// triggerWhen/condition extensions. Validation is an ordered list of\n// human-readable step strings \u2014 reviewers scan it as a checklist.\n// =============================================================================\nexport const AuthoringFieldsZ = {\n title: z\n .string()\n .max(200)\n .optional()\n .describe('Authoring-only: short label shown on the action plan dashboard. Stripped before serving to the runtime SDK.'),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe('Authoring-only: one-sentence explanation of what this action does and why. Stripped before serving to the runtime SDK.'),\n validation: z\n .array(z.string().max(500))\n .max(10)\n .optional()\n .describe('Authoring-only: ordered steps a reviewer can follow to trigger this action and visually confirm it works. Each entry is one step. Stripped before serving to the runtime SDK.'),\n};\n// =============================================================================\n// TRIGGER VOCABULARY \u2014 canonical lists of valid event names, metric keys, etc.\n// These flow through to the JSON schema as enums and are used by the LLM prompt.\n// =============================================================================\n/** Events that can be counted in event_count conditions. */\nexport const COUNTABLE_EVENTS = [\n // User interactions (from PostHog autocapture normalization)\n 'ui.click',\n 'ui.scroll',\n 'ui.input',\n 'ui.change',\n 'ui.submit',\n // Behavioral detectors (from event-processor)\n 'ui.hover',\n 'ui.idle',\n 'ui.scroll_thrash',\n 'ui.focus_bounce',\n // Navigation\n 'nav.page_view',\n 'nav.page_leave',\n // Derived behavioral signals\n 'behavior.rage_click',\n 'behavior.hesitation',\n 'behavior.confusion',\n];\nexport const CountableEventZ = z\n .enum(COUNTABLE_EVENTS)\n .describe('Event name to count. ui.* = user interactions and behavioral detectors, nav.* = page navigation, behavior.* = derived behavioral signals.');\n/** Valid session metric keys. */\nexport const SESSION_METRIC_KEYS = ['time_on_page', 'page_views', 'scroll_depth'];\nexport const SessionMetricKeyZ = z\n .enum(SESSION_METRIC_KEYS)\n .describe('Session metric key. time_on_page = seconds on current page, page_views = pages visited this session, scroll_depth = 0-100 percentage.');\n/** Element chain match field prefixes for counter filters. */\nexport const ELEMENT_MATCH_FIELDS = ['tag_name', '$el_text'];\n// Note: attr__* is a dynamic prefix (attr__data-id, attr__class, attr__href, etc.)\n// and cannot be enumerated. The match key is either one of ELEMENT_MATCH_FIELDS\n// or starts with \"attr__\".\n// =============================================================================\n// CONDITION SCHEMAS\n// =============================================================================\nexport const PageUrlConditionZ = z\n .object({\n type: z.literal('page_url'),\n url: z.string().describe('URL path to match (e.g. \"/pricing\", \"/dashboard\")'),\n})\n .describe('Fires when the current page URL matches. Use for page-specific actions. ' +\n 'Example: {\"type\": \"page_url\", \"url\": \"/pricing\"}');\nexport const RouteConditionZ = z\n .object({\n type: z.literal('route'),\n routeId: z.string().describe('Named route ID from the route filter'),\n})\n .describe('Fires when the current route matches a named route ID.');\nexport const AnchorVisibleConditionZ = z\n .object({\n type: z.literal('anchor_visible'),\n anchorId: z.string().describe('CSS selector of the anchor element'),\n state: z\n .enum(['visible', 'present', 'absent'])\n .describe('\"visible\" = in viewport, \"present\" = in DOM, \"absent\" = not in DOM'),\n})\n .describe(\"Fires based on a DOM element's visibility state. \" +\n 'Example: {\"type\": \"anchor_visible\", \"anchorId\": \"#cta-button\", \"state\": \"visible\"}');\nexport const EventOccurredConditionZ = z\n .object({\n type: z.literal('event_occurred'),\n eventName: z.string().describe('Event name (e.g. \"ui.click\", \"$pageview\")'),\n withinMs: z.number().optional().describe('Time window in ms. Omit = any time this session.'),\n})\n .describe('Fires when a specific event has occurred during this session. ' +\n 'Example: {\"type\": \"event_occurred\", \"eventName\": \"ui.click\", \"withinMs\": 5000}');\nexport const StateEqualsConditionZ = z\n .object({\n type: z.literal('state_equals'),\n key: z\n .string()\n .describe('Key in the SDK persistent state store (localStorage). Only valid for keys the host app explicitly sets via syntro.state.set().'),\n value: z.unknown().describe('Expected value to match against'),\n})\n .describe('Checks the SDK persistent state store (localStorage). ONLY for host-app state set via syntro.state.set() \u2014 ' +\n 'NOT for user attributes like region, device, or UTM params (those are handled by segment targeting). ' +\n 'Do NOT use this for targeting. If you do not know the valid state keys, do not use this condition type.');\nexport const ViewportConditionZ = z\n .object({\n type: z.literal('viewport'),\n minWidth: z.number().optional().describe('Minimum viewport width in pixels'),\n maxWidth: z.number().optional().describe('Maximum viewport width in pixels'),\n minHeight: z.number().optional().describe('Minimum viewport height in pixels'),\n maxHeight: z.number().optional().describe('Maximum viewport height in pixels'),\n})\n .describe('Fires based on viewport (screen) size. Use for responsive behavior. ' +\n 'Example: {\"type\": \"viewport\", \"minWidth\": 768} \u2014 fires on tablet and larger.');\nexport const SessionMetricConditionZ = z\n .object({\n type: z.literal('session_metric'),\n key: SessionMetricKeyZ,\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n threshold: z.number().describe('Numeric threshold to compare against'),\n})\n .describe('Fires when a session metric crosses a threshold. Valid keys: \"time_on_page\" (seconds), ' +\n '\"page_views\" (count), \"scroll_depth\" (0-100). ' +\n 'Example: {\"type\": \"session_metric\", \"key\": \"time_on_page\", \"operator\": \"gte\", \"threshold\": 30}');\nexport const DismissedConditionZ = z\n .object({\n type: z.literal('dismissed'),\n key: z.string().describe('Dismissal key (usually a tile or action ID)'),\n inverted: z\n .boolean()\n .optional()\n .describe('When true, fires if NOT dismissed (default behavior)'),\n})\n .describe('Checks if an item has been dismissed by the user. Use with inverted: true to show only if not dismissed.');\nexport const CooldownActiveConditionZ = z\n .object({\n type: z.literal('cooldown_active'),\n key: z.string().describe('Cooldown key'),\n inverted: z.boolean().optional().describe('When true, fires if cooldown is NOT active'),\n})\n .describe('Checks if a cooldown timer is currently active. Use to prevent showing the same intervention too frequently.');\nexport const FrequencyLimitConditionZ = z\n .object({\n type: z.literal('frequency_limit'),\n key: z.string().describe('Frequency counter key'),\n limit: z.number().describe('Maximum allowed count'),\n inverted: z.boolean().optional().describe('When true, fires if limit NOT reached'),\n})\n .describe('Checks if a frequency limit has been reached. Use to cap how many times an action fires per session.');\nexport const MatchOpZ = z\n .object({\n equals: z.union([z.string(), z.number(), z.boolean()]).optional(),\n contains: z.string().optional(),\n})\n .describe('Match operator for counter filters. Exactly one of equals or contains must be specified.');\nexport const CounterDefZ = z\n .object({\n events: z\n .array(CountableEventZ)\n .min(1)\n .describe('Event names to count. Use values from the countable events enum.'),\n match: z\n .record(z.string(), MatchOpZ)\n .optional()\n .describe('Property filters. Keys are event prop names or element-chain fields ' +\n '(tag_name, $el_text, attr__*). All entries AND together.'),\n})\n .describe('Defines what events to count. Registered as an accumulator predicate at config-load time.');\nexport const EventCountConditionZ = z\n .object({\n type: z.literal('event_count'),\n key: z.string().describe('Unique key for this counter (used for accumulator registration)'),\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n count: z.number().int().min(0).describe('Target count threshold'),\n withinMs: z\n .number()\n .positive()\n .optional()\n .describe('Time window in ms. Omit = count across entire session.'),\n counter: CounterDefZ.optional().describe('Inline counter definition. Defines what events to count.'),\n})\n .describe('Fires when accumulated event count crosses a threshold. Most powerful trigger type. ' +\n 'Example: {\"type\": \"event_count\", \"key\": \"pricing-clicks\", \"operator\": \"gte\", \"count\": 3, ' +\n '\"counter\": {\"events\": [\"ui.click\"], \"match\": {\"attr__data-cta\": {\"contains\": \"pricing\"}}}}');\nexport const ConditionZ = z.discriminatedUnion('type', [\n PageUrlConditionZ,\n RouteConditionZ,\n AnchorVisibleConditionZ,\n EventOccurredConditionZ,\n StateEqualsConditionZ,\n ViewportConditionZ,\n SessionMetricConditionZ,\n DismissedConditionZ,\n CooldownActiveConditionZ,\n FrequencyLimitConditionZ,\n EventCountConditionZ,\n]);\n// =============================================================================\n// STRATEGY SCHEMAS\n// =============================================================================\nexport const RuleZ = z\n .object({\n conditions: z\n .array(ConditionZ)\n .describe('Array of conditions \u2014 ALL must match (AND logic) for this rule to fire.'),\n value: z\n .unknown()\n .describe('Value returned when all conditions match. For triggerWhen: true = fire the action.'),\n})\n .describe('A single rule. ALL conditions must match (AND logic). Rules in a strategy are evaluated ' +\n 'top-to-bottom \u2014 first rule where all conditions match wins and returns its value.');\nexport const RuleStrategyZ = z\n .object({\n type: z.literal('rules'),\n rules: z\n .array(RuleZ)\n .describe('Ordered list of rules. Evaluated top-to-bottom \u2014 first match wins.'),\n default: z\n .unknown()\n .describe('Fallback value when no rule matches. For triggerWhen: false = do not fire by default.'),\n})\n .describe('Rule-based strategy. Evaluates rules top-to-bottom. First rule where ALL conditions match ' +\n 'returns its value. If no rule matches, returns default. ' +\n 'For triggerWhen: set value=true on matching rules, default=false.');\nexport const ScoreStrategyZ = z\n .object({\n type: z.literal('score'),\n field: z.string(),\n threshold: z.number(),\n above: z.unknown(),\n below: z.unknown(),\n})\n .describe('Score-based strategy. Compares a field value against a threshold.');\nexport const ModelStrategyZ = z\n .object({\n type: z.literal('model'),\n modelId: z.string(),\n inputs: z.array(z.string()),\n outputMapping: z.record(z.string(), z.unknown()),\n default: z.unknown(),\n})\n .describe('ML model strategy. Sends inputs to a model and maps outputs.');\nexport const ExternalStrategyZ = z\n .object({\n type: z.literal('external'),\n endpoint: z.string(),\n method: z.enum(['GET', 'POST']).optional(),\n default: z.unknown(),\n timeoutMs: z.number().optional(),\n})\n .describe('External API strategy. Calls an endpoint to determine the value.');\nexport const DecisionStrategyZ = z.discriminatedUnion('type', [\n RuleStrategyZ,\n ScoreStrategyZ,\n ModelStrategyZ,\n ExternalStrategyZ,\n]);\n/** Canonical Zod schema for the optional triggerWhen field on actions and adaptive items. */\nexport const TriggerWhenZ = DecisionStrategyZ.nullable().optional();\n// =============================================================================\n// TRIGGER DOCUMENTATION \u2014 examples and match field docs\n// Exported as constants so the schema generator can inject them into the\n// JSON schema. The Python prompt builder reads them from the schema.\n// =============================================================================\n/** Complete triggerWhen examples showing the full rules wrapper structure. */\nexport const TRIGGER_EXAMPLES = [\n {\n name: 'Click count on a specific element',\n description: 'Fire when user clicks an element with data-id=\"hero-cta\" 2+ times',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'event_count',\n key: 'cta-clicks',\n operator: 'gte',\n count: 2,\n counter: {\n events: ['ui.click'],\n match: { 'attr__data-id': { equals: 'hero-cta' } },\n },\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Time on page threshold',\n description: 'Fire after user spends 30+ seconds on the page',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'session_metric',\n key: 'time_on_page',\n operator: 'gte',\n threshold: 30,\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Element visible in viewport',\n description: 'Fire when a DOM element becomes visible',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'anchor_visible',\n anchorId: '#pricing-section',\n state: 'visible',\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'No trigger (fire immediately)',\n description: 'Action fires as soon as the segment matches \u2014 no in-session condition needed',\n triggerWhen: null,\n },\n];\n/** Documentation for counter.match field keys. */\nexport const MATCH_FIELD_DOCS = {\n tag_name: 'HTML tag name (e.g. \"button\", \"a\", \"input\")',\n $el_text: 'Visible text content of the element',\n 'attr__*': 'HTML attribute prefixed with attr__. Example: attr__data-id matches the data-id attribute, ' +\n 'attr__class matches the class attribute, attr__href matches the href attribute.',\n};\n// =============================================================================\n// EVENT SCOPE SCHEMA\n// =============================================================================\n/** Scopes a widget to specific events/URLs. */\nexport const EventScopeZ = z.object({\n events: z.array(z.string()),\n urlContains: z.string().optional(),\n props: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),\n});\n// =============================================================================\n// NOTIFY SCHEMA\n// =============================================================================\n/** Toast notification config for triggerWhen transitions. */\nexport const NotifyZ = z\n .object({\n title: z.string().optional(),\n body: z.string().optional(),\n icon: z.string().optional(),\n})\n .nullable()\n .optional();\n", "/**\n * Adaptive Gamification - Config Schema\n *\n * Zod schema for validating gamification app configuration.\n */\n\nimport { AnchorIdZ, AuthoringFieldsZ, TriggerWhenZ } from '@syntrologie/sdk-contracts';\nimport { z } from 'zod';\n\n/**\n * Conditional execution for actions.\n * Actions use `triggerWhen` (DecisionStrategy) exclusively \u2014 `activation`\n * (routes/strategy) is for TILES only and is never evaluated by ActionEngine.\n */\nconst ActionTriggerZ = { triggerWhen: TriggerWhenZ };\n\n/**\n * Badge definition schema.\n */\nexport const badgeSchema = z.object({\n id: z.string(),\n name: z.string(),\n icon: z.string(),\n description: z.string().optional(),\n trigger: z.object({\n event: z.string(),\n conditions: z.array(z.unknown()).optional(),\n }),\n});\n\n/**\n * Leaderboard configuration schema.\n */\nconst leaderboardConfigSchema = z.object({\n enabled: z.boolean().default(false),\n refreshInterval: z.number().default(60000),\n});\n\n/**\n * Gamification app config schema.\n */\nexport const configSchema = z.object({\n badges: z.array(badgeSchema).default([]),\n leaderboard: leaderboardConfigSchema.optional(),\n points: z\n .object({\n enabled: z.boolean().default(false),\n multiplier: z.number().default(1),\n })\n .optional(),\n});\n\nexport type GamificationConfig = z.infer<typeof configSchema>;\n\n// ============================================================================\n// Executor Action Schemas\n// ============================================================================\n\n/**\n * Schema for awarding a badge to a user.\n */\nexport const AwardBadgeSchema = z\n .object({\n kind: z.literal('gamification:awardBadge'),\n badgeId: z.string(),\n anchorId: AnchorIdZ.optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .extend(AuthoringFieldsZ);\n\n/**\n * Schema for adding points to a user's score.\n */\nexport const AddPointsSchema = z\n .object({\n kind: z.literal('gamification:addPoints'),\n points: z.number(),\n reason: z.string().optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .extend(AuthoringFieldsZ);\n\n// ============================================================================\n// Unified Schema Export\n// ============================================================================\n\n/**\n * Action step schemas for unified JSON Schema generation.\n * The build script reads this array to merge adaptive actions into the\n * unified canvas-config.schema.json.\n */\nexport const actionStepSchemas = [\n { defName: 'awardBadge', schema: AwardBadgeSchema },\n { defName: 'addPoints', schema: AddPointsSchema },\n];\n"],
|
|
5
|
+
"mappings": ";AAMA,SAAS,SAAS;AAIX,IAAM,YAAY,EACpB,OAAO;AAAA,EACR,UAAU,EAAE,OAAO;AAAA,EACnB,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACpD,CAAC,EACI,OAAO;AAgBL,IAAM,mBAAmB;AAAA,EAC5B,OAAO,EACF,OAAO,EACP,IAAI,GAAG,EACP,SAAS,EACT,SAAS,6GAA6G;AAAA,EAC3H,aAAa,EACR,OAAO,EACP,IAAI,GAAI,EACR,SAAS,EACT,SAAS,wHAAwH;AAAA,EACtI,YAAY,EACP,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,CAAC,EACzB,IAAI,EAAE,EACN,SAAS,EACT,SAAS,+KAA+K;AACjM;AAMO,IAAM,mBAAmB;AAAA;AAAA,EAE5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AACJ;AACO,IAAM,kBAAkB,EAC1B,KAAK,gBAAgB,EACrB,SAAS,2IAA2I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AAS;AAC7B,CAAC,EACA,OAAO,cAAc,EACrB,OAAO,gBAAgB;AAKnB,IAAM,kBAAkBA,GAC5B,OAAO;AAAA,EACN,MAAMA,GAAE,QAAQ,wBAAwB;AAAA,EACxC,QAAQA,GAAE,OAAO;AAAA,EACjB,QAAQA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,OAAOA,GAAE,OAAO,EAAE,SAAS;AAC7B,CAAC,EACA,OAAO,cAAc,EACrB,OAAO,gBAAgB;AAWnB,IAAM,oBAAoB;AAAA,EAC/B,EAAE,SAAS,cAAc,QAAQ,iBAAiB;AAAA,EAClD,EAAE,SAAS,aAAa,QAAQ,gBAAgB;AAClD;",
|
|
6
|
+
"names": ["z"]
|
|
7
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -4,6 +4,5 @@
|
|
|
4
4
|
* Minimal type definitions for building this app independently.
|
|
5
5
|
* These match the types exported from @syntrologie/runtime-sdk/types.
|
|
6
6
|
*/
|
|
7
|
-
export type { EditorPanelProps } from '@syntrologie/sdk-contracts';
|
|
8
7
|
export type { ActionExecutor, ExecutorCleanup, ExecutorContext, ExecutorResult, ExecutorUpdate, } from '@syntrologie/sdk-contracts';
|
|
9
8
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,GACf,MAAM,4BAA4B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syntrologie/adapt-gamification",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.0",
|
|
4
4
|
"description": "Adaptive Gamification app - Badges, rewards, points, and engagement mechanics",
|
|
5
5
|
"license": "Proprietary",
|
|
6
6
|
"private": false,
|
|
@@ -22,10 +22,6 @@
|
|
|
22
22
|
"./schema": {
|
|
23
23
|
"types": "./dist/schema.d.ts",
|
|
24
24
|
"import": "./dist/schema.js"
|
|
25
|
-
},
|
|
26
|
-
"./editor": {
|
|
27
|
-
"types": "./dist/editor.d.ts",
|
|
28
|
-
"import": "./dist/editor.js"
|
|
29
25
|
}
|
|
30
26
|
},
|
|
31
27
|
"files": [
|
|
@@ -36,27 +32,18 @@
|
|
|
36
32
|
],
|
|
37
33
|
"scripts": {
|
|
38
34
|
"prepack": "node ../../../scripts/prepare-bundled-deps.mjs",
|
|
39
|
-
"build": "tsc",
|
|
35
|
+
"build": "tsc --emitDeclarationOnly && node ../scripts/build-lib.mjs",
|
|
40
36
|
"typecheck": "tsc --noEmit",
|
|
41
37
|
"clean": "rm -rf dist",
|
|
42
38
|
"test": "vitest run",
|
|
43
39
|
"test:watch": "vitest"
|
|
44
40
|
},
|
|
45
41
|
"peerDependencies": {
|
|
46
|
-
"react": ">=18.0.0",
|
|
47
|
-
"react-dom": ">=18.0.0",
|
|
48
42
|
"zod": "^3.0.0"
|
|
49
43
|
},
|
|
50
|
-
"dependencies": {
|
|
51
|
-
"@syntrologie/sdk-contracts": "*"
|
|
52
|
-
},
|
|
53
44
|
"devDependencies": {
|
|
54
45
|
"@syntrologie/sdk-contracts": "*",
|
|
55
|
-
"@testing-library/react": "16.3.2",
|
|
56
|
-
"@types/react": "19.2.14",
|
|
57
46
|
"jsdom": "26.1.0",
|
|
58
|
-
"react": "19.2.1",
|
|
59
|
-
"react-dom": "19.2.1",
|
|
60
47
|
"typescript": "5.9.3",
|
|
61
48
|
"vitest": "4.0.18",
|
|
62
49
|
"zod": "3.25.76"
|
package/dist/cdn.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CDN Entry Point for Adaptive Gamification
|
|
3
|
-
*
|
|
4
|
-
* This module is bundled for CDN delivery and self-registers with the global
|
|
5
|
-
* SynOS app registry when loaded dynamically via the AppLoader.
|
|
6
|
-
*/
|
|
7
|
-
import { editor } from './editor';
|
|
8
|
-
import { eventHandlers, executors, runtime } from './runtime';
|
|
9
|
-
/**
|
|
10
|
-
* App manifest for registry registration.
|
|
11
|
-
* Follows the AppManifest interface expected by AppLoader/AppRegistry.
|
|
12
|
-
*/
|
|
13
|
-
export const manifest = {
|
|
14
|
-
id: 'adaptive-gamification',
|
|
15
|
-
version: runtime.version,
|
|
16
|
-
name: runtime.name,
|
|
17
|
-
description: runtime.description,
|
|
18
|
-
runtime: {
|
|
19
|
-
actions: executors.map(({ kind, executor }) => ({
|
|
20
|
-
kind,
|
|
21
|
-
executor,
|
|
22
|
-
})),
|
|
23
|
-
events: eventHandlers,
|
|
24
|
-
},
|
|
25
|
-
editor,
|
|
26
|
-
metadata: {
|
|
27
|
-
isBuiltIn: false,
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Self-register with global registry if available.
|
|
32
|
-
* This happens when loaded via script tag (UMD).
|
|
33
|
-
*/
|
|
34
|
-
if (typeof window !== 'undefined') {
|
|
35
|
-
const registry = window.SynOS?.appRegistry;
|
|
36
|
-
if (registry && typeof registry.register === 'function') {
|
|
37
|
-
registry.register(manifest);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export default manifest;
|
package/dist/editor.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adaptive Gamification - Editor Module
|
|
3
|
-
*
|
|
4
|
-
* Editor panel for configuring gamification features.
|
|
5
|
-
*/
|
|
6
|
-
import type { EditorPanelProps } from './types';
|
|
7
|
-
/**
|
|
8
|
-
* Gamification editor panel component.
|
|
9
|
-
*/
|
|
10
|
-
export declare function GamificationEditor({ config: _config, onChange: _onChange, editor: _editor, }: EditorPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
/**
|
|
12
|
-
* Editor module configuration.
|
|
13
|
-
*/
|
|
14
|
-
export declare const editor: {
|
|
15
|
-
panel: {
|
|
16
|
-
title: string;
|
|
17
|
-
icon: string;
|
|
18
|
-
description: string;
|
|
19
|
-
};
|
|
20
|
-
component: typeof GamificationEditor;
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=editor.d.ts.map
|
package/dist/editor.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../src/editor.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,OAAO,GAChB,EAAE,gBAAgB,2CAOlB;AAED;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;CAOlB,CAAC"}
|
package/dist/editor.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Gamification editor panel component.
|
|
4
|
-
*/
|
|
5
|
-
export function GamificationEditor({ config: _config, onChange: _onChange, editor: _editor, }) {
|
|
6
|
-
return (_jsxs("div", { className: "syntro-gamification-editor", children: [_jsx("p", { children: "Gamification editor coming soon..." }), _jsx("p", { children: "Configure badges, points, rewards, and leaderboards." })] }));
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Editor module configuration.
|
|
10
|
-
*/
|
|
11
|
-
export const editor = {
|
|
12
|
-
panel: {
|
|
13
|
-
title: 'Gamification',
|
|
14
|
-
icon: '🎮',
|
|
15
|
-
description: 'Badges, rewards, and engagement',
|
|
16
|
-
},
|
|
17
|
-
component: GamificationEditor,
|
|
18
|
-
};
|