@project-sunbird/collection-editor-react 0.1.18 → 0.1.19

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.
@@ -0,0 +1,38 @@
1
+ import { IContext } from '../../types/editor';
2
+
3
+ export interface QumlContextProps {
4
+ mode?: string;
5
+ cdata?: unknown[];
6
+ contextRollup?: Record<string, string>;
7
+ objectRollup?: Record<string, string>;
8
+ }
9
+ export interface QumlPlayerConfig {
10
+ context: Record<string, unknown>;
11
+ config: Record<string, unknown>;
12
+ metadata: Record<string, unknown>;
13
+ }
14
+ /**
15
+ * Owns the lifecycle of the <sunbird-quml-player> web component:
16
+ * script/style loading, element creation, and event wiring.
17
+ * Ported from spark-portal's QumlPlayerService, with the telemetry context
18
+ * built from the editor's IContext instead of portal identity singletons.
19
+ */
20
+ export declare class QumlPlayerService {
21
+ private eventHandlers;
22
+ private static scriptLoaded;
23
+ private static scriptLoading?;
24
+ private static stylesLoaded;
25
+ private loadScript;
26
+ private loadStyles;
27
+ /** Removes the QuML stylesheet on unmount to prevent style bleed. */
28
+ static unloadStyles(): void;
29
+ /**
30
+ * Waits for the web component script to load, then assembles the player
31
+ * config from the editor context + enriched questionset metadata.
32
+ */
33
+ createConfig(metadata: Record<string, unknown>, ctx: IContext | undefined, props?: QumlContextProps): Promise<QumlPlayerConfig>;
34
+ createElement(config: QumlPlayerConfig): HTMLElement;
35
+ attachEventListeners(el: HTMLElement, onPlayerEvent?: (e: CustomEvent) => void, onTelemetryEvent?: (e: unknown) => void): void;
36
+ removeEventListeners(el: HTMLElement): void;
37
+ }
38
+ export declare const qumlPlayerService: QumlPlayerService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@project-sunbird/collection-editor-react",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -33,6 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@dnd-kit/core": "^6.1.0",
36
+ "@project-sunbird/sunbird-quml-player-web-component": "^6.0.10",
36
37
  "@dnd-kit/sortable": "^8.0.0",
37
38
  "@dnd-kit/utilities": "^3.2.2",
38
39
  "@tanstack/react-query": "^5.51.0",