@syntrologie/adapt-gamification 2.8.0-canary.152 → 2.8.0-canary.154
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 +47 -0
- package/dist/cdn.d.ts.map +1 -0
- package/dist/cdn.js +38 -0
- package/package.json +1 -1
package/dist/cdn.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CDN Entry Point for Adaptive Gamification
|
|
3
|
+
*
|
|
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".
|
|
17
|
+
*/
|
|
18
|
+
export declare const manifest: {
|
|
19
|
+
id: string;
|
|
20
|
+
version: string;
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
runtime: {
|
|
24
|
+
actions: {
|
|
25
|
+
kind: "gamification:awardBadge" | "gamification:addPoints";
|
|
26
|
+
executor: import("packages/sdk-contracts/dist").ActionExecutor<import("./runtime").AwardBadgeAction> | import("packages/sdk-contracts/dist").ActionExecutor<import("./runtime").AddPointsAction>;
|
|
27
|
+
}[];
|
|
28
|
+
events: {
|
|
29
|
+
names: string[];
|
|
30
|
+
handler: (_event: unknown, _ctx: unknown) => void;
|
|
31
|
+
}[];
|
|
32
|
+
};
|
|
33
|
+
metadata: {
|
|
34
|
+
isBuiltIn: boolean;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
declare global {
|
|
38
|
+
interface Window {
|
|
39
|
+
SynOS?: {
|
|
40
|
+
appRegistry?: {
|
|
41
|
+
register?: (m: unknown) => void;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export default manifest;
|
|
47
|
+
//# sourceMappingURL=cdn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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/cdn.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CDN Entry Point for Adaptive Gamification
|
|
3
|
+
*
|
|
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".
|
|
17
|
+
*/
|
|
18
|
+
import { eventHandlers, executors, runtime } from './runtime';
|
|
19
|
+
export const manifest = {
|
|
20
|
+
id: runtime.id,
|
|
21
|
+
version: runtime.version,
|
|
22
|
+
name: runtime.name,
|
|
23
|
+
description: runtime.description,
|
|
24
|
+
runtime: {
|
|
25
|
+
actions: executors.map(({ kind, executor }) => ({ kind, executor })),
|
|
26
|
+
events: eventHandlers,
|
|
27
|
+
},
|
|
28
|
+
metadata: {
|
|
29
|
+
isBuiltIn: false,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
if (typeof window !== 'undefined') {
|
|
33
|
+
const registry = window.SynOS?.appRegistry;
|
|
34
|
+
if (registry && typeof registry.register === 'function') {
|
|
35
|
+
registry.register(manifest);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export default manifest;
|
package/package.json
CHANGED