@pie-players/pie-section-player 0.3.30 → 0.3.32

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.
Files changed (40) hide show
  1. package/README.md +87 -24
  2. package/dist/chunks/tool-annotation-toolbar-db5bfbec.js +1018 -934
  3. package/dist/components/shared/player-preload.d.ts +88 -71
  4. package/dist/components/shared/player-preload.d.ts.map +1 -1
  5. package/dist/components/shared/section-player-host-runtime.d.ts +72 -0
  6. package/dist/components/shared/section-player-host-runtime.d.ts.map +1 -0
  7. package/dist/components/shared/section-player-runtime-callbacks.d.ts +33 -0
  8. package/dist/components/shared/section-player-runtime-callbacks.d.ts.map +1 -0
  9. package/dist/components/shared/section-player-view-state.d.ts.map +1 -1
  10. package/dist/contracts/host-hooks.d.ts +20 -0
  11. package/dist/contracts/host-hooks.d.ts.map +1 -1
  12. package/dist/contracts/layout-contract.d.ts +2 -2
  13. package/dist/contracts/layout-contract.d.ts.map +1 -1
  14. package/dist/contracts/layout-parity-metadata.d.ts.map +1 -1
  15. package/dist/contracts/public-events.d.ts +86 -10
  16. package/dist/contracts/public-events.d.ts.map +1 -1
  17. package/dist/contracts/stages.d.ts +11 -0
  18. package/dist/contracts/stages.d.ts.map +1 -0
  19. package/dist/controllers/SectionController.d.ts +9 -0
  20. package/dist/controllers/SectionController.d.ts.map +1 -1
  21. package/dist/controllers/toolkit-section-contracts.d.ts +1 -1
  22. package/dist/controllers/toolkit-section-contracts.d.ts.map +1 -1
  23. package/dist/controllers/types.d.ts +6 -0
  24. package/dist/controllers/types.d.ts.map +1 -1
  25. package/dist/pie-section-player.d.ts +2 -2
  26. package/dist/pie-section-player.d.ts.map +1 -1
  27. package/dist/pie-section-player.js +18407 -6465
  28. package/dist/policies/index.d.ts +21 -4
  29. package/dist/policies/index.d.ts.map +1 -1
  30. package/dist/policies/types.d.ts +0 -5
  31. package/dist/policies/types.d.ts.map +1 -1
  32. package/package.json +12 -15
  33. package/dist/chunks/player-preload-79b07366.js +0 -10093
  34. package/dist/components/shared/section-player-readiness.d.ts +0 -14
  35. package/dist/components/shared/section-player-readiness.d.ts.map +0 -1
  36. package/dist/components/shared/section-player-runtime.d.ts +0 -154
  37. package/dist/components/shared/section-player-runtime.d.ts.map +0 -1
  38. package/dist/utils/player-preload.d.ts +0 -2
  39. package/dist/utils/player-preload.d.ts.map +0 -1
  40. package/dist/utils/player-preload.js +0 -8
@@ -2,10 +2,27 @@ import { SectionPlayerAutoFocusStrategy, SectionPlayerFocusPolicy, SectionPlayer
2
2
  export declare const DEFAULT_FOCUS_POLICY: SectionPlayerFocusPolicy;
3
3
  export declare const DEFAULT_SECTION_PLAYER_POLICIES: SectionPlayerPolicies;
4
4
  /**
5
- * Resolve the auto-focus strategy from a focus policy input, honoring the
6
- * deprecated `autoFocusFirstItem` boolean when present. Presence is detected
7
- * via `"autoFocusFirstItem" in policy` so that explicit `false` wins over the
8
- * default, mirroring how callers historically toggled the old flag.
5
+ * Whether the section-level element preload pipeline should run. Defaults to
6
+ * `true` when the policy is unset or partially set so existing hosts are
7
+ * unaffected. Hosts opt out by passing `policies.preload.enabled === false`,
8
+ * which short-circuits `warmupSectionElements` in `SectionItemsPane`. Items
9
+ * still mount and item-players register their own elements on demand.
10
+ */
11
+ export declare function isPreloadEnabled(policies: SectionPlayerPolicies | null | undefined): boolean;
12
+ /**
13
+ * Whether the section-player layout elements should attach the
14
+ * instrumentation event bridge. Defaults to `true` when the policy is unset
15
+ * or partially set. Hosts opt out by passing
16
+ * `policies.telemetry.enabled === false`, which skips
17
+ * `attachInstrumentationEventBridge` setup entirely. Hosts that want a
18
+ * different shape of opt-out can still supply a custom
19
+ * `instrumentationProvider`.
20
+ */
21
+ export declare function isTelemetryEnabled(policies: SectionPlayerPolicies | null | undefined): boolean;
22
+ /**
23
+ * Resolve the auto-focus strategy from a focus policy input, falling back to
24
+ * the package default (`"start-of-content"`) when the policy is unset or
25
+ * leaves `autoFocus` undefined.
9
26
  */
10
27
  export declare function resolveAutoFocusStrategy(policy: SectionPlayerFocusPolicy | null | undefined): SectionPlayerAutoFocusStrategy;
11
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/policies/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,8BAA8B,EAC9B,wBAAwB,EACxB,qBAAqB,EACrB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,oBAAoB,EAAE,wBAElC,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,qBAK7C,CAAC;AAIF;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,wBAAwB,GAAG,IAAI,GAAG,SAAS,GACjD,8BAA8B,CAahC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/policies/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,8BAA8B,EAC9B,wBAAwB,EACxB,qBAAqB,EACrB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,oBAAoB,EAAE,wBAElC,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,qBAK7C,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,qBAAqB,GAAG,IAAI,GAAG,SAAS,GAChD,OAAO,CAET;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CACjC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,GAAG,SAAS,GAChD,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,wBAAwB,GAAG,IAAI,GAAG,SAAS,GACjD,8BAA8B,CAGhC"}
@@ -24,11 +24,6 @@ export type SectionPlayerPreloadPolicy = {
24
24
  export type SectionPlayerAutoFocusStrategy = "none" | "start-of-content" | "current-item";
25
25
  export type SectionPlayerFocusPolicy = {
26
26
  autoFocus: SectionPlayerAutoFocusStrategy;
27
- /**
28
- * @deprecated Use `autoFocus` instead. `true` maps to `"start-of-content"`,
29
- * `false` maps to `"none"`. Scheduled for removal in the next major version.
30
- */
31
- autoFocusFirstItem?: boolean;
32
27
  };
33
28
  export type SectionPlayerTelemetryPolicy = {
34
29
  enabled: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/policies/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,+BAA+B,CAAC;AAExF,MAAM,MAAM,4BAA4B,GAAG;IAC1C,IAAI,EAAE,aAAa,GAAG,QAAQ,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACxC,OAAO,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,8BAA8B,GACvC,MAAM,GACN,kBAAkB,GAClB,cAAc,CAAC;AAElB,MAAM,MAAM,wBAAwB,GAAG;IACtC,SAAS,EAAE,8BAA8B,CAAC;IAC1C;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IAC1C,OAAO,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IACnC,SAAS,EAAE,4BAA4B,CAAC;IACxC,OAAO,EAAE,0BAA0B,CAAC;IACpC,KAAK,EAAE,wBAAwB,CAAC;IAChC,SAAS,EAAE,4BAA4B,CAAC;CACxC,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACtC,iBAAiB,CAAC,MAAM,EAAE,kCAAkC,GAAG,OAAO,CAAC;CACvE"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/policies/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,+BAA+B,CAAC;AAExF,MAAM,MAAM,4BAA4B,GAAG;IAC1C,IAAI,EAAE,aAAa,GAAG,QAAQ,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACxC,OAAO,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,8BAA8B,GACvC,MAAM,GACN,kBAAkB,GAClB,cAAc,CAAC;AAElB,MAAM,MAAM,wBAAwB,GAAG;IACtC,SAAS,EAAE,8BAA8B,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IAC1C,OAAO,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IACnC,SAAS,EAAE,4BAA4B,CAAC;IACxC,OAAO,EAAE,0BAA0B,CAAC;IACpC,KAAK,EAAE,wBAAwB,CAAC;IAChC,SAAS,EAAE,4BAA4B,CAAC;CACxC,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACtC,iBAAiB,CAAC,MAAM,EAAE,kCAAkC,GAAG,OAAO,CAAC;CACvE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-players/pie-section-player",
3
- "version": "0.3.30",
3
+ "version": "0.3.32",
4
4
  "type": "module",
5
5
  "description": "Web component for rendering QTI 3.0 assessment sections with passages and items",
6
6
  "license": "MIT",
@@ -80,10 +80,6 @@
80
80
  "./policies": {
81
81
  "types": "./dist/pie-section-player.d.ts",
82
82
  "import": "./dist/pie-section-player.js"
83
- },
84
- "./utils/player-preload": {
85
- "types": "./dist/utils/player-preload.d.ts",
86
- "import": "./dist/utils/player-preload.js"
87
83
  }
88
84
  },
89
85
  "files": [
@@ -94,10 +90,11 @@
94
90
  "dev": "vite build --watch",
95
91
  "typecheck": "tsc --noEmit",
96
92
  "check": "svelte-check --tsconfig ./tsconfig.svelte-check.json --compiler-warnings options_missing_custom_element:ignore",
97
- "lint": "biome check ."
93
+ "lint": "biome check .",
94
+ "test": "bun test '.test.ts'"
98
95
  },
99
96
  "peerDependencies": {
100
- "@pie-players/pie-tool-annotation-toolbar": "0.3.30"
97
+ "@pie-players/pie-tool-annotation-toolbar": "0.3.32"
101
98
  },
102
99
  "peerDependenciesMeta": {
103
100
  "@pie-players/pie-tool-annotation-toolbar": {
@@ -105,14 +102,14 @@
105
102
  }
106
103
  },
107
104
  "dependencies": {
108
- "@pie-players/pie-assessment-toolkit": "0.3.30",
109
- "@pie-players/pie-item-player": "0.3.30",
110
- "@pie-players/pie-context": "0.3.30",
111
- "@pie-players/pie-players-shared": "0.3.30",
112
- "@pie-players/pie-tool-calculator-desmos": "0.3.30",
113
- "@pie-players/pie-tool-text-to-speech": "0.3.30",
114
- "@pie-players/pie-tool-tts-inline": "0.3.30",
115
- "@pie-players/pie-toolbars": "0.3.30"
105
+ "@pie-players/pie-assessment-toolkit": "0.3.32",
106
+ "@pie-players/pie-item-player": "0.3.32",
107
+ "@pie-players/pie-context": "0.3.32",
108
+ "@pie-players/pie-players-shared": "0.3.32",
109
+ "@pie-players/pie-tool-calculator-desmos": "0.3.32",
110
+ "@pie-players/pie-tool-text-to-speech": "0.3.32",
111
+ "@pie-players/pie-tool-tts-inline": "0.3.32",
112
+ "@pie-players/pie-toolbars": "0.3.32"
116
113
  },
117
114
  "devDependencies": {
118
115
  "@axe-core/playwright": "^4.11.1",