@pie-players/pie-section-player 0.3.75 → 1.0.0-beta.1

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 (59) hide show
  1. package/README.md +845 -964
  2. package/custom-elements.json +3922 -0
  3. package/dist/browser/assets/{evaluation-worker-CORp9m0K.js → evaluation-worker-0xRDVTJx.js} +82215 -73234
  4. package/dist/browser/chunks/ToolCoordinator-0a6c4088.js +1 -0
  5. package/dist/browser/chunks/attribute-coercion-b93b482c.js +1 -0
  6. package/dist/browser/chunks/calculator-element-271c142f.js +8 -9
  7. package/dist/browser/chunks/catalog-context-46d3e50e.js +1 -1
  8. package/dist/browser/chunks/classPrivateFieldGet2-338e0179.js +1 -1
  9. package/dist/browser/chunks/classPrivateMethodInitSpec-563cd0a5.js +1 -0
  10. package/dist/browser/chunks/custom-element-define-2a92deb0.js +1 -0
  11. package/dist/browser/chunks/dist-41b39e7f.js +1 -1
  12. package/dist/browser/chunks/dist-ca9b9622.js +1 -1
  13. package/dist/browser/chunks/focus-trap-44913bf3.js +1 -1
  14. package/dist/browser/chunks/math-rendering-ready-9a0fd90a.js +1 -1
  15. package/dist/browser/chunks/mathjax-BKrHE4xs-3ca05bf6.js +1 -1
  16. package/dist/browser/chunks/nl-NL-364d61b9.js +1 -1
  17. package/dist/browser/chunks/nl-NL-8b7e6d4b.js +1 -1
  18. package/dist/browser/chunks/pie-api-client-687c319a.js +1 -1
  19. package/dist/browser/chunks/provider-4c704118.js +1 -1
  20. package/dist/browser/chunks/runtime-YFqnU6ic-d5c0cb49.js +8605 -0
  21. package/dist/browser/chunks/{src-BcptuNS5-ed25d7fd.js → src-D_1goyPT-8cca0246.js} +81 -82
  22. package/dist/browser/chunks/{sre-engine-jd8cc08x-42d270e5.js → sre-engine-bj997w4b-891a4cbe.js} +1 -1
  23. package/dist/browser/chunks/term-lookup-632cf6b1.js +1 -0
  24. package/dist/browser/chunks/tool-annotation-toolbar-997438b4.js +5 -5
  25. package/dist/browser/chunks/tool-answer-eliminator-35483abd.js +6 -6
  26. package/dist/browser/chunks/tool-color-scheme-b7de5cdf.js +5 -5
  27. package/dist/browser/chunks/tool-dictionary-cecff3b4.js +3 -3
  28. package/dist/browser/chunks/tool-graph-cb0338e8.js +6 -6
  29. package/dist/browser/chunks/tool-host-contract-fae1c415.js +1 -0
  30. package/dist/browser/chunks/tool-instance-id-76ac45e2.js +1 -0
  31. package/dist/browser/chunks/tool-line-reader-f8ef3c6a.js +3 -3
  32. package/dist/browser/chunks/tool-periodic-table-43b133b8.js +13 -16
  33. package/dist/browser/chunks/tool-picture-dictionary-33721e91.js +3 -3
  34. package/dist/browser/chunks/tool-protractor-23f77028.js +6 -6
  35. package/dist/browser/chunks/tool-ruler-1d9a03a6.js +12 -9
  36. package/dist/browser/chunks/tool-tts-inline-98c2ce7a.js +24 -30
  37. package/dist/browser/chunks/toolbar-registration-helpers-a7ab1ad4.js +194 -0
  38. package/dist/browser/chunks/versioned-tag-54a76be9.js +1 -1
  39. package/dist/browser/pie-section-player.js +66 -65
  40. package/dist/chunks/nl-NL-364d61b9.js +34 -6
  41. package/dist/chunks/{sre-engine-jd8cc08x-42d270e5.js → sre-engine-bj997w4b-891a4cbe.js} +1 -1
  42. package/dist/component-definitions.d.ts +0 -2
  43. package/dist/components/shared/card-media-region.d.ts +3 -4
  44. package/dist/components/shared/framework-error-latch.d.ts +4 -2
  45. package/dist/components/shared/missing-tool-providers.d.ts +0 -6
  46. package/dist/components/shared/player-preload.d.ts +4 -9
  47. package/dist/components/shared/section-player-card-context.d.ts +0 -3
  48. package/dist/components/shared/section-player-host-runtime.d.ts +0 -2
  49. package/dist/components/shared/section-player-view-state.d.ts +0 -1
  50. package/dist/controllers/SectionController.d.ts +20 -6
  51. package/dist/pie-section-player.js +11279 -11191
  52. package/package.json +11 -9
  53. package/dist/browser/chunks/ToolCoordinator-cc2dc319.js +0 -1
  54. package/dist/browser/chunks/runtime-wcU7KOFU-ac86d7b8.js +0 -8536
  55. package/dist/browser/chunks/tool-host-contract-b93b482c.js +0 -1
  56. package/dist/browser/chunks/tool-instance-id-2a92deb0.js +0 -1
  57. package/dist/browser/chunks/tts-runtime-config-a7ab1ad4.js +0 -194
  58. /package/dist/browser/chunks/{ItemToolBar-jx38w99s-58defccc.js → ItemToolBar-66hcwmfw-3bcb82a3.js} +0 -0
  59. /package/dist/chunks/{ItemToolBar-jx38w99s-1287ba31.js → ItemToolBar-66hcwmfw-1287ba31.js} +0 -0
@@ -306,20 +306,20 @@ var e = {
306
306
  textToSpeech: {
307
307
  name: "Voorlezen",
308
308
  description: "Inhoud laten voorlezen",
309
+ initFailed: "Voorlezen kon niet worden gestart. Probeer het opnieuw.",
309
310
  inline: {
310
311
  controlsA11y: "Voorleesknoppen",
311
312
  playbackSpeedA11y: "Voorleessnelheid",
312
313
  rewindA11y: "Terugspoelen",
313
314
  fastForwardA11y: "Vooruitspoelen",
314
315
  stopA11y: "Voorlezen stoppen",
315
- initializing: "Voorlezen wordt gestart",
316
- initFailed: "Voorlezen kon niet worden gestart. Probeer het opnieuw.",
317
316
  starting: "Voorlezen wordt gestart",
318
317
  started: "Voorlezen gestart",
319
318
  resumed: "Voorlezen hervat",
320
319
  pausedAnnouncement: "Voorlezen gepauzeerd",
321
320
  stopped: "Voorlezen gestopt",
322
321
  switchedSection: "Het voorlezen is naar een ander onderdeel gegaan",
322
+ nothingToRead: "Hier is niets om voor te lezen",
323
323
  startFailed: "Voorlezen kon niet worden gestart",
324
324
  skippedForward: "Vooruitgespoeld",
325
325
  skipForwardFailed: "Vooruitspoelen is niet gelukt",
@@ -399,6 +399,7 @@ var e = {
399
399
  pnp: {
400
400
  title: "PNP-profiel",
401
401
  noAssessmentBound: "Geen toets gekoppeld",
402
+ noAssessmentBoundBody: "Profiel-, district- en afnamebeleid hebben niets om te lezen, dus alleen de requiredTools van een item kunnen een voorziening toekennen. Geef de toets door aan de assessment-eigenschap van de toolkit, of roep updateAssessment(...) aan op de toolkit-coordinator.",
402
403
  determinationReadOnly: "Vaststelling (alleen lezen)",
403
404
  toolsEditor: "Hulpmiddelen bewerken",
404
405
  enforcement: "PNP-handhaving",
@@ -474,12 +475,39 @@ var e = {
474
475
  previewEnterText: "Voer eerst voorbeeldtekst in.",
475
476
  previewUnavailable: "Een voorbeeld is niet mogelijk zolang deze dienst niet beschikbaar is.",
476
477
  browserSynthesisUnavailable: "Spraaksynthese van de browser is niet beschikbaar.",
477
- browserSynthesisEndedEarly: "De spraaksynthese van de browser stopte voordat de audio begon. Start de browser opnieuw en probeer het nog eens.",
478
- browserSynthesisQueueFailed: "De spraaksynthese van de browser kon het voorbeeldfragment niet in de wachtrij zetten.",
479
- browserPreviewFailed: "Het voorbeeld van de browserstem kon niet worden afgespeeld.",
480
478
  ssmlWordTrackingDisabled: "Bij een Google SSML-voorbeeld blijft de SSML uit de bron intact, waardoor woordmarkering is uitgeschakeld.",
481
479
  applyUnavailable: "Instellingen toepassen is niet mogelijk zolang deze dienst niet beschikbaar is.",
482
- coordinatorUnavailable: "De toolkitcoördinator is niet beschikbaar voor voorleesinstellingen."
480
+ coordinatorUnavailable: "De toolkitcoördinator is niet beschikbaar voor voorleesinstellingen.",
481
+ customProviderNotRegistered: "Aangepaste provider '{id}' is niet geregistreerd.",
482
+ customProviderNoConfig: "Aangepaste provider '{id}' gaf geen configuratie om toe te passen.",
483
+ httpError: "HTTP {status}: {message}",
484
+ unknownError: "Onbekende fout",
485
+ previewRequestFailed: "Het voorbeeldverzoek is mislukt ({status}).",
486
+ notAvailable: "n.v.t.",
487
+ voiceLocal: "lokaal",
488
+ voiceRemote: "extern",
489
+ voiceBrowserDefault: "browserstandaard",
490
+ browserAvailable: {
491
+ one: "Browserspraak beschikbaar ({count} stem gevonden).",
492
+ other: "Browserspraak beschikbaar ({count} stemmen gevonden)."
493
+ },
494
+ pollyAvailable: {
495
+ one: "AWS Polly beschikbaar ({count} passende stem, engine {engine}).",
496
+ other: "AWS Polly beschikbaar ({count} passende stemmen, engine {engine})."
497
+ },
498
+ googleAvailable: {
499
+ one: "Google Cloud TTS beschikbaar ({count} passende stem).",
500
+ other: "Google Cloud TTS beschikbaar ({count} passende stemmen)."
501
+ },
502
+ headerRowReservation: "Rij in de itemkop gereserveerd: {state}",
503
+ speedOptionsHelp: "Vermenigvuldigers, gescheiden door komma's of puntkomma's. Neem 1 op voor Normaal; laat leeg om de snelheidsknoppen te verbergen.",
504
+ usingSelectedVoice: "Gekozen stem: {voice}",
505
+ autoVoice: "Beste beschikbare stem (automatisch): {voice}",
506
+ autoVoiceWaiting: "Beste beschikbare stem (automatisch): wachten op de stemmen van de browser.",
507
+ previewHintBrowserSsml: "SSML wordt niet ondersteund in het browservoorbeeld.",
508
+ previewHintGoogleSsml: "SSML blijft intact. Markering uitgeschakeld.",
509
+ previewHintCustom: "Markering actief wanneer de provider spraakmarkeringen teruggeeft.",
510
+ previewHintTracking: "Markering actief tijdens het afspelen van het voorbeeld."
483
511
  }
484
512
  }
485
513
  };
@@ -1,4 +1,4 @@
1
- import { n as t } from "./ItemToolBar-jx38w99s-1287ba31.js";
1
+ import { n as t } from "./ItemToolBar-66hcwmfw-1287ba31.js";
2
2
  import * as a from "speech-rule-engine";
3
3
  var r = a.default ?? a;
4
4
  r.setupEngine(t());
@@ -1,7 +1,5 @@
1
- export type ComponentModuleLoader = () => Promise<unknown>;
2
1
  export interface ComponentDefinition {
3
2
  tagName: string;
4
- ensureDefined?: ComponentModuleLoader;
5
3
  attributes?: Record<string, string>;
6
4
  props?: Record<string, unknown>;
7
5
  }
@@ -4,10 +4,9 @@
4
4
  *
5
5
  * Sizing only. Which capability fills the region, and whether it has anything to
6
6
  * show, belongs to the capability: the card asks the registry for whatever is
7
- * registered on the surface below and knows nothing else about it. The
8
- * signed-alternate resolution that used to live here moved to
9
- * `@pie-players/pie-tool-sign-language` behind that capability's own
10
- * `requiresAuthoredContent`.
7
+ * registered on the surface below and knows nothing else about it.
8
+ * Signed-alternate resolution lives in `@pie-players/pie-tool-sign-language`,
9
+ * behind that capability's own `requiresAuthoredContent`.
11
10
  */
12
11
  /**
13
12
  * Host slot for media docked beside a card's content.
@@ -1,10 +1,12 @@
1
1
  import { FrameworkErrorModel } from '@pie-players/pie-assessment-toolkit';
2
+ import { CohortKey } from '@pie-players/pie-assessment-toolkit/runtime/engine';
2
3
  /**
3
4
  * The section player's readiness error latch. A non-recoverable framework error
4
5
  * latches the scope its report site set: a `cohort` error fails the section it
5
6
  * was reported for and clears when the cohort rolls; a `runtime` error fails
6
7
  * every later section, since they run on the same coordinator. A recoverable
7
- * error latches nothing.
8
+ * error latches nothing, and neither does a `cohort` error that names another
9
+ * section: that section failed after the learner left it.
8
10
  *
9
11
  * A toolkit bootstrap failure is a runtime error held against the coordinator
10
12
  * the toolkit had announced when it was reported. It clears when the toolkit
@@ -25,7 +27,7 @@ export type FrameworkErrorLatch = {
25
27
  } | null;
26
28
  };
27
29
  export declare const CLEAR_FRAMEWORK_ERROR_LATCH: FrameworkErrorLatch;
28
- export declare function latchFrameworkError(latch: FrameworkErrorLatch, detail: Pick<FrameworkErrorModel, "recoverable" | "scope" | "kind"> | null | undefined, coordinator: unknown): FrameworkErrorLatch;
30
+ export declare function latchFrameworkError(latch: FrameworkErrorLatch, detail: Pick<FrameworkErrorModel, "recoverable" | "scope" | "kind" | "cohort"> | null | undefined, coordinator: unknown, current: CohortKey | null): FrameworkErrorLatch;
29
31
  export declare function rollFrameworkErrorLatch(latch: FrameworkErrorLatch): FrameworkErrorLatch;
30
32
  /** Applied on each `toolkit-ready`, with the coordinator it announces. */
31
33
  export declare function announceToolkitCoordinator(latch: FrameworkErrorLatch, coordinator: unknown): FrameworkErrorLatch;
@@ -1,10 +1,4 @@
1
1
  import { ToolkitCoordinatorApi, ToolRegistry } from '@pie-players/pie-assessment-toolkit';
2
- /**
3
- * Warn once per placed tool whose registration carries a provider the coordinator
4
- * has not registered under the tool's id. Reads the coordinator's current
5
- * placement and providers, so call it only once the coordinator reports ready.
6
- */
7
- export declare function reportMissingToolProviders(coordinator: ToolkitCoordinatorApi, toolRegistry: ToolRegistry): void;
8
2
  /**
9
3
  * Check `coordinator` once it reports ready, and again whenever readiness or its
10
4
  * policy inputs change, since placement can. Its providers have registered by
@@ -46,16 +46,11 @@ export declare class PreloadStageError extends Error {
46
46
  constructor(stage: PreloadStage, cause: unknown);
47
47
  }
48
48
  export declare function getPreloadLogger(componentTag: string): import('@pie-players/pie-players-shared').PieLogger;
49
- /** The element view the item players render, which pre-warm has to match. */
50
- export declare function getLoaderView(props: Record<string, unknown>, env: Record<string, unknown>): string;
51
49
  /**
52
- * Stable string signature of a list of renderables, used as a react-key
53
- * hint for the composition snapshot plumbed through the layout tree.
54
- *
55
- * The signature is *not* used for preload dedup anymore — the deep
56
- * `ElementLoader` primitive handles that internally. It is retained only
57
- * because downstream template props still pass a string identifier
58
- * through the customElement boundary.
50
+ * Stable string signature of a list of renderables: id, version and element
51
+ * set of each entry's `entity`. The layout composition snapshot carries it,
52
+ * and the kernel matches the items pane's warmup report against it, so a
53
+ * report counts only for the composition it was made for.
59
54
  */
60
55
  export declare function getRenderablesSignature(renderables: unknown[]): string;
61
56
  export declare function formatElementLoadError(stage: string, error: unknown): string;
@@ -5,9 +5,6 @@ export type SectionPlayerCardRenderContext = {
5
5
  playerAction: (node: HTMLElement, params: PlayerElementParams) => unknown;
6
6
  cardTitleFormatter?: SectionPlayerCardTitleFormatter;
7
7
  };
8
- export declare const sectionPlayerCardRenderContext: {
9
- __context__: SectionPlayerCardRenderContext;
10
- };
11
8
  export declare function connectSectionPlayerCardRenderContext(host: HTMLElement, onValue: (value: SectionPlayerCardRenderContext) => void): () => void;
12
9
  /**
13
10
  * A card that subscribes before this provider connects is answered through the
@@ -14,7 +14,6 @@ export declare function resolvePlayerRuntime(args: {
14
14
  env: Record<string, unknown> | null;
15
15
  }): {
16
16
  effectivePlayerType: string;
17
- resolvedPlayerDefinition: import('../../component-definitions.js').ComponentDefinition;
18
17
  resolvedPlayerTag: string;
19
18
  resolvedPlayerAttributes: Record<string, string>;
20
19
  resolvedPlayerProps: {
@@ -78,7 +77,6 @@ export declare function resolveSectionPlayerRuntimeState(args: RuntimeInputs): {
78
77
  };
79
78
  playerRuntime: {
80
79
  effectivePlayerType: string;
81
- resolvedPlayerDefinition: import('../../component-definitions.js').ComponentDefinition;
82
80
  resolvedPlayerTag: string;
83
81
  resolvedPlayerAttributes: Record<string, string>;
84
82
  resolvedPlayerProps: {
@@ -42,7 +42,6 @@ export type LayoutCompositionSnapshot = {
42
42
  renderables: ItemEntity[];
43
43
  renderablesSignature: string;
44
44
  };
45
- export declare function getCompositionFromEvent(event: Event): SectionCompositionModel;
46
45
  export declare function deriveLayoutCompositionSnapshot(compositionModel: SectionCompositionModel): LayoutCompositionSnapshot;
47
46
  export declare function getCompositionSnapshotFromEvent(event: Event): LayoutCompositionSnapshot;
48
47
  export declare function getPassagePlayerParams(args: {
@@ -4,12 +4,19 @@ import { MediaTimeSource, TimedMediaSectionProjection } from '@pie-players/pie-p
4
4
  import { SectionControllerHandle, SectionSessionPersistenceConfig, SectionControllerRuntimeState, SectionControllerSessionState } from './toolkit-section-contracts.js';
5
5
  import { ItemEntity } from '@pie-players/pie-players-shared';
6
6
  import { NavigationResult, SectionControllerChangeListener, SectionCompositionModel, SectionNavigationState, SectionViewModel, SessionChangedResult } from './types.js';
7
+ /**
8
+ * Owns aggregate section state: item sessions and navigation, the renderable
9
+ * lifecycle, completion, formative delivery, and timed-media cue state with its
10
+ * Media Time Source port. Item-level controllers share contracts with it but
11
+ * are not composed here.
12
+ */
7
13
  export declare class SectionController implements SectionControllerHandle {
8
14
  private readonly contentService;
9
15
  private readonly sessionService;
10
16
  private readonly itemNavigationService;
11
17
  private sessionPersistence;
12
18
  private pendingSessionCommit;
19
+ private saveQueue;
13
20
  private state;
14
21
  private readonly listeners;
15
22
  private readonly trackedRenderables;
@@ -53,6 +60,12 @@ export declare class SectionController implements SectionControllerHandle {
53
60
  updateInput(input?: unknown): Promise<void>;
54
61
  configureSessionPersistence(config: SectionSessionPersistenceConfig): void;
55
62
  hydrate(): Promise<void>;
63
+ /**
64
+ * Saves run one at a time, in call order, so a slow older write can never
65
+ * land after a newer one. The snapshot is copied at the call, since
66
+ * `getSession()` shares the live session objects, and a failed save
67
+ * rejects only its own caller.
68
+ */
56
69
  persist(): Promise<void>;
57
70
  dispose(): void;
58
71
  getViewModel(): SectionViewModel;
@@ -242,12 +255,9 @@ export declare class SectionController implements SectionControllerHandle {
242
255
  */
243
256
  getRuntimeState(): SectionControllerRuntimeState | null;
244
257
  /**
245
- * Snapshot of currently-loaded renderables in registration order.
246
- *
247
- * Walks `trackedRenderables` (preserves insertion order) and emits an entry
248
- * for each entry whose key is in `loadedRenderableKeys`. Used by the
249
- * coordinator to replay `content-loaded` events to subscribers that
250
- * attach after a renderable has finished loading.
258
+ * Loaded renderables in registration order, which `trackedRenderables`
259
+ * preserves. The coordinator replays `content-loaded` from this to
260
+ * subscribers that attach after a renderable has finished loading.
251
261
  */
252
262
  private collectLoadedRenderableSnapshot;
253
263
  getCurrentItem(): ItemEntity | null;
@@ -315,6 +325,10 @@ export declare class SectionController implements SectionControllerHandle {
315
325
  private evaluateSectionLoadingState;
316
326
  private replayPendingAppliedSession;
317
327
  private normalizeApplySession;
328
+ /**
329
+ * Accepts a canonical entry (an `itemIdentifier` plus a `session` object) or
330
+ * a bare one: `{ session, complete? }`, or the item session itself.
331
+ */
318
332
  private normalizeItemSessionEntry;
319
333
  private applyNormalizedSessionToState;
320
334
  private cloneForRead;