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

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 (32) hide show
  1. package/README.md +192 -12
  2. package/dist/chunks/dist-24a90544.js +193 -138
  3. package/dist/chunks/{dist-Bud4G4lv-b2620662.js → dist-DIBQdekL-ec6db34a.js} +120 -66
  4. package/dist/chunks/dist-c4148994.js +14 -2
  5. package/dist/chunks/{dist-DwP27yIs-cfd207a3.js → dist-rF11IR1B-adc4857f.js} +13 -1
  6. package/dist/chunks/module-c1d68911.js +1819 -1835
  7. package/dist/chunks/player-preload-79b07366.js +6701 -3674
  8. package/dist/chunks/tool-annotation-toolbar-db5bfbec.js +1555 -1470
  9. package/dist/components/section-player-tabbed-element.d.ts +2 -0
  10. package/dist/components/section-player-tabbed-element.d.ts.map +1 -0
  11. package/dist/contracts/host-hooks.d.ts +5 -0
  12. package/dist/contracts/host-hooks.d.ts.map +1 -0
  13. package/dist/contracts/layout-contract.d.ts +3 -3
  14. package/dist/contracts/layout-contract.d.ts.map +1 -1
  15. package/dist/contracts/layout-parity-metadata.d.ts +1 -0
  16. package/dist/contracts/layout-parity-metadata.d.ts.map +1 -1
  17. package/dist/contracts/runtime-host-contract.d.ts +13 -0
  18. package/dist/contracts/runtime-host-contract.d.ts.map +1 -1
  19. package/dist/controllers/SectionController.d.ts.map +1 -1
  20. package/dist/controllers/SectionItemNavigationService.d.ts +0 -1
  21. package/dist/controllers/SectionItemNavigationService.d.ts.map +1 -1
  22. package/dist/controllers/types.d.ts +16 -0
  23. package/dist/controllers/types.d.ts.map +1 -1
  24. package/dist/pie-section-player.d.ts +4 -3
  25. package/dist/pie-section-player.d.ts.map +1 -1
  26. package/dist/pie-section-player.js +6251 -5036
  27. package/dist/policies/index.d.ts +9 -1
  28. package/dist/policies/index.d.ts.map +1 -1
  29. package/dist/policies/types.d.ts +23 -1
  30. package/dist/policies/types.d.ts.map +1 -1
  31. package/package.json +23 -14
  32. /package/dist/chunks/{defineProperty-318b8855.js → defineProperty-aab5a8e0.js} +0 -0
@@ -1,3 +1,11 @@
1
- import { SectionPlayerPolicies } from './types.js';
1
+ import { SectionPlayerAutoFocusStrategy, SectionPlayerFocusPolicy, SectionPlayerPolicies } from './types.js';
2
+ export declare const DEFAULT_FOCUS_POLICY: SectionPlayerFocusPolicy;
2
3
  export declare const DEFAULT_SECTION_PLAYER_POLICIES: SectionPlayerPolicies;
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.
9
+ */
10
+ export declare function resolveAutoFocusStrategy(policy: SectionPlayerFocusPolicy | null | undefined): SectionPlayerAutoFocusStrategy;
3
11
  //# 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,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,eAAO,MAAM,+BAA+B,EAAE,qBAK7C,CAAC"}
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"}
@@ -5,8 +5,30 @@ export type SectionPlayerReadinessPolicy = {
5
5
  export type SectionPlayerPreloadPolicy = {
6
6
  enabled: boolean;
7
7
  };
8
+ /**
9
+ * Strategy the section player uses to move focus after every navigation event
10
+ * (Next / Back / navigateTo) and when the host calls `focusStart()` on the
11
+ * layout element (Skip-to-Main).
12
+ *
13
+ * - `"start-of-content"` (default): focus the passage card when present,
14
+ * else the first item card. Matches assessment UX where Skip-to-Main and
15
+ * navigation land in the same place. Best for one-item-per-page layouts.
16
+ * - `"current-item"`: focus the newly-active item card (queried as
17
+ * `pie-section-player-item-card[is-current]`). Best for stacked/list
18
+ * layouts where multiple items are visible at once.
19
+ * - `"none"`: framework never moves focus on navigation; the host owns it
20
+ * entirely. `focusStart()` still moves focus (defaults to
21
+ * start-of-content) because hosts only call it when they want focus
22
+ * to move.
23
+ */
24
+ export type SectionPlayerAutoFocusStrategy = "none" | "start-of-content" | "current-item";
8
25
  export type SectionPlayerFocusPolicy = {
9
- autoFocusFirstItem: boolean;
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;
10
32
  };
11
33
  export type SectionPlayerTelemetryPolicy = {
12
34
  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,MAAM,MAAM,wBAAwB,GAAG;IACtC,kBAAkB,EAAE,OAAO,CAAC;CAC5B,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;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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-players/pie-section-player",
3
- "version": "0.3.28",
3
+ "version": "0.3.30",
4
4
  "type": "module",
5
5
  "description": "Web component for rendering QTI 3.0 assessment sections with passages and items",
6
6
  "license": "MIT",
@@ -29,6 +29,10 @@
29
29
  "types": "./dist/pie-section-player.d.ts",
30
30
  "import": "./dist/pie-section-player.js"
31
31
  },
32
+ "./components/section-player-tabbed-element": {
33
+ "types": "./dist/pie-section-player.d.ts",
34
+ "import": "./dist/pie-section-player.js"
35
+ },
32
36
  "./components/section-player-shell-element": {
33
37
  "types": "./dist/pie-section-player.d.ts",
34
38
  "import": "./dist/pie-section-player.js"
@@ -69,6 +73,10 @@
69
73
  "types": "./dist/pie-section-player.d.ts",
70
74
  "import": "./dist/pie-section-player.js"
71
75
  },
76
+ "./contracts/host-hooks": {
77
+ "types": "./dist/pie-section-player.d.ts",
78
+ "import": "./dist/pie-section-player.js"
79
+ },
72
80
  "./policies": {
73
81
  "types": "./dist/pie-section-player.d.ts",
74
82
  "import": "./dist/pie-section-player.js"
@@ -89,7 +97,7 @@
89
97
  "lint": "biome check ."
90
98
  },
91
99
  "peerDependencies": {
92
- "@pie-players/pie-tool-annotation-toolbar": "0.3.28"
100
+ "@pie-players/pie-tool-annotation-toolbar": "0.3.30"
93
101
  },
94
102
  "peerDependenciesMeta": {
95
103
  "@pie-players/pie-tool-annotation-toolbar": {
@@ -97,25 +105,26 @@
97
105
  }
98
106
  },
99
107
  "dependencies": {
100
- "@pie-players/pie-assessment-toolkit": "0.3.28",
101
- "@pie-players/pie-item-player": "0.3.28",
102
- "@pie-players/pie-context": "0.3.28",
103
- "@pie-players/pie-players-shared": "0.3.28",
104
- "@pie-players/pie-tool-calculator-desmos": "0.3.28",
105
- "@pie-players/pie-tool-text-to-speech": "0.3.28",
106
- "@pie-players/pie-tool-tts-inline": "0.3.28",
107
- "@pie-players/pie-toolbars": "0.3.28"
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"
108
116
  },
109
117
  "devDependencies": {
110
118
  "@axe-core/playwright": "^4.11.1",
111
- "@biomejs/biome": "^2.3.13",
112
- "@playwright/test": "^1.58.2",
119
+ "@biomejs/biome": "^2.4.12",
120
+ "@happy-dom/global-registrator": "^20.9.0",
121
+ "@playwright/test": "^1.59.1",
113
122
  "@sveltejs/vite-plugin-svelte": "^7.0.0",
114
123
  "@types/node": "^25.1.0",
115
124
  "svelte": "^5.54.0",
116
- "svelte-check": "^4.4.5",
125
+ "svelte-check": "^4.4.6",
117
126
  "typescript": "^5.9.3",
118
- "vite": "^8.0.1",
127
+ "vite": "^8.0.10",
119
128
  "vite-plugin-dts": "^4.5.4"
120
129
  },
121
130
  "homepage": "https://github.com/pie-framework/pie-players/tree/master/packages/section-player#readme",