@pie-players/pie-section-player 0.3.37 → 0.3.38
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/README.md +18 -68
- package/dist/chunks/tool-annotation-toolbar-db5bfbec.js +197 -197
- package/dist/contracts/runtime-host-contract.d.ts +0 -13
- package/dist/contracts/runtime-host-contract.d.ts.map +1 -1
- package/dist/pie-section-player.d.ts +2 -2
- package/dist/pie-section-player.d.ts.map +1 -1
- package/dist/pie-section-player.js +8106 -8005
- package/dist/policies/index.d.ts +1 -8
- package/dist/policies/index.d.ts.map +1 -1
- package/dist/policies/types.d.ts +0 -21
- package/dist/policies/types.d.ts.map +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -243,50 +243,25 @@ host.hooks = {
|
|
|
243
243
|
|
|
244
244
|
Advanced CE props are still supported as escape hatches (`runtime`, `coordinator`, etc.), but hosts should prefer JS/controller composition for non-standard behavior. Note: `createSectionController` is **runtime-only** — set it on `runtime.createSectionController` rather than as a top-level CE prop (the prop alias was removed in the broad architecture review compat sweep).
|
|
245
245
|
|
|
246
|
-
###
|
|
247
|
-
|
|
248
|
-
Section-player owns its own focus contract so hosts can integrate a
|
|
249
|
-
"Skip to Main" affordance and keyboard navigation without re-encoding
|
|
250
|
-
the passage-first rule.
|
|
251
|
-
|
|
252
|
-
**Public focus targets.** Both card custom elements are `tabindex="-1"`
|
|
253
|
-
(programmatically focusable, never in sequential tab order) and expose a
|
|
254
|
-
`:focus-visible` outline:
|
|
255
|
-
|
|
256
|
-
- `<pie-section-player-passage-card>` (when the section has a passage)
|
|
257
|
-
- `<pie-section-player-item-card>`
|
|
258
|
-
|
|
259
|
-
The inner `.pie-section-player-content-card[data-section-item-card]`
|
|
260
|
-
selector is an internal back-compat hook and is not part of the public
|
|
261
|
-
contract — prefer querying the custom element tags.
|
|
262
|
-
|
|
263
|
-
**Declarative control.** The `SectionPlayerFocusPolicy.autoFocus` strategy
|
|
264
|
-
governs focus on every navigation event (Next / Back / `navigateTo`) and is
|
|
265
|
-
also honored by the imperative `focusStart()`:
|
|
266
|
-
|
|
267
|
-
- `"start-of-content"` *(default)* — focus the passage card when present,
|
|
268
|
-
otherwise the first item card. Matches the canonical assessment UX where
|
|
269
|
-
Skip-to-Main and navigation land in the same place. Best for
|
|
270
|
-
one-item-per-page layouts (splitpane, tabbed).
|
|
271
|
-
- `"current-item"` — focus the newly-active item card (queried as
|
|
272
|
-
`pie-section-player-item-card[is-current]`). Best for stacked/list
|
|
273
|
-
layouts where multiple items are visible at once (vertical, custom
|
|
274
|
-
kernel-host variants). Works in both paginated and keep-together
|
|
275
|
-
sections — QTI 3 `keep-together` is a pagination hint only and does
|
|
276
|
-
not disable item-level navigation or current-item tracking.
|
|
277
|
-
- `"none"` — framework never moves focus on navigation; the host owns it
|
|
278
|
-
entirely. `focusStart()` still moves focus (defaults to
|
|
279
|
-
start-of-content) because hosts only call it when they *want* focus to
|
|
280
|
-
move.
|
|
246
|
+
### Host-owned focus
|
|
281
247
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
248
|
+
Section-player does not move focus on behalf of host-level affordances such
|
|
249
|
+
as "Skip to Main", nor does it make passage/question containers tab stops.
|
|
250
|
+
Hosts own page chrome, skip links, landmarks, and any special focus placement.
|
|
251
|
+
For example, Quiz Engine's Fixed Player shell can focus its own
|
|
252
|
+
`main#main-content`; the next Tab then follows the browser's natural order
|
|
253
|
+
into the first actionable control rendered inside the section player.
|
|
254
|
+
|
|
255
|
+
The passage and item card custom elements are content/layout surfaces, not
|
|
256
|
+
public focus targets. Splitpane passage content remains scrollable through the
|
|
257
|
+
pane's native scroll behavior, but the passage pane itself is not inserted into
|
|
258
|
+
sequential keyboard navigation.
|
|
259
|
+
|
|
260
|
+
```html
|
|
261
|
+
<a href="#main-content" class="skip-link">Skip to Main</a>
|
|
262
|
+
<main id="main-content" tabindex="-1">
|
|
263
|
+
<pie-section-player-splitpane></pie-section-player-splitpane>
|
|
264
|
+
</main>
|
|
290
265
|
```
|
|
291
266
|
|
|
292
267
|
**Wired policy toggles.** Each `SectionPlayerPolicies` field has a real
|
|
@@ -299,8 +274,6 @@ runtime effect; nothing in this surface is decorative.
|
|
|
299
274
|
still mount and item-players register their own elements on demand. Use
|
|
300
275
|
this to disable section pre-warm when the host already owns element
|
|
301
276
|
registration end-to-end. Default: `true`.
|
|
302
|
-
- `focus.autoFocus` — focus strategy on navigation; see "Focus management"
|
|
303
|
-
above.
|
|
304
277
|
- `telemetry.enabled` — when `false`, the layout custom elements skip
|
|
305
278
|
`attachInstrumentationEventBridge` setup, so no `pie-section-*`
|
|
306
279
|
telemetry events flow through the bridge. Hosts that want a different
|
|
@@ -312,29 +285,6 @@ helpers read these toggles with the documented default-true semantics, so
|
|
|
312
285
|
host code that needs to mirror the same gate (e.g. when composing a custom
|
|
313
286
|
layout host) can call them directly.
|
|
314
287
|
|
|
315
|
-
**Imperative escape hatch (host-owned focus moments).** Every layout
|
|
316
|
-
element (`pie-section-player-splitpane`, `-vertical`, `-tabbed`,
|
|
317
|
-
`-kernel-host`, and `-base`) exposes a `focusStart(): boolean` method.
|
|
318
|
-
Call it from host-owned affordances the framework cannot observe — most
|
|
319
|
-
commonly a "Skip to Main" button in the host's ribbon:
|
|
320
|
-
|
|
321
|
-
```ts
|
|
322
|
-
document.querySelector("pie-section-player-splitpane")?.focusStart();
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
`focusStart()` honors the `autoFocus` strategy so Skip-to-Main lands
|
|
326
|
-
wherever the host has opted in for navigation focus:
|
|
327
|
-
|
|
328
|
-
- `"start-of-content"` *(default)* → passage card when present, else first
|
|
329
|
-
item card.
|
|
330
|
-
- `"current-item"` → the item card currently marked `is-current`, falling
|
|
331
|
-
back to start-of-content if no current item is resolvable.
|
|
332
|
-
- `"none"` → start-of-content (hosts call `focusStart()` precisely
|
|
333
|
-
because they want focus to move).
|
|
334
|
-
|
|
335
|
-
For Next / Back / question-number navigation the host does **not** call
|
|
336
|
-
`focusStart()` — the `autoFocus` policy fires automatically.
|
|
337
|
-
|
|
338
288
|
### Navigation signals
|
|
339
289
|
|
|
340
290
|
- `item-selected`: item-level navigation change within the current section in the `SectionController` broadcast stream (`itemIndex`, `currentItemId`, `totalItems`).
|