@pie-players/pie-section-player 0.3.74 → 1.0.0-beta.0

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 (134) hide show
  1. package/README.md +862 -866
  2. package/custom-elements.json +3922 -0
  3. package/dist/browser/assets/{evaluation-worker-DkU_wGh3.js → evaluation-worker-0xRDVTJx.js} +98934 -88735
  4. package/dist/browser/chunks/PUA-tLuTiQ7--f2b27953.js +1 -1
  5. package/dist/browser/chunks/ToolCoordinator-0a6c4088.js +1 -0
  6. package/dist/browser/chunks/accents-BTUYmhn9-cafeb96e.js +1 -1
  7. package/dist/browser/chunks/accents-b-i-CngHZsLL-e0eb98fd.js +1 -1
  8. package/dist/browser/chunks/arabic-BzEHMVZD-30ac1ade.js +1 -1
  9. package/dist/browser/chunks/arrows-VjxlU-jv-2e17c192.js +1 -1
  10. package/dist/browser/chunks/attribute-coercion-b93b482c.js +1 -0
  11. package/dist/browser/chunks/braille-BeWC_Ruq-a3bb8ef9.js +1 -1
  12. package/dist/browser/chunks/braille-d-Dk6J96GO-d832bfbf.js +1 -1
  13. package/dist/browser/chunks/browser-a3c32178.js +17 -16
  14. package/dist/browser/chunks/calculator-element-271c142f.js +11 -8
  15. package/dist/browser/chunks/calligraphic-Cew9cU3x-04cf0735.js +1 -1
  16. package/dist/browser/chunks/catalog-context-46d3e50e.js +1 -0
  17. package/dist/browser/chunks/catalog-owner-d602f784.js +1 -0
  18. package/dist/browser/chunks/cherokee-Cny3FYho-4da7d2f3.js +1 -1
  19. package/dist/browser/chunks/classPrivateFieldGet2-338e0179.js +1 -1
  20. package/dist/browser/chunks/classPrivateMethodInitSpec-563cd0a5.js +1 -0
  21. package/dist/browser/chunks/cyrillic-CfCDulXU-5550df0b.js +1 -1
  22. package/dist/browser/chunks/cyrillic-ss-lU7bNGG9-12eb0188.js +1 -1
  23. package/dist/browser/chunks/devanagari-CDIz2h-r-18c38725.js +1 -1
  24. package/dist/browser/chunks/dist-41b39e7f.js +1 -1
  25. package/dist/browser/chunks/dist-59132a53.js +1 -1
  26. package/dist/browser/chunks/dist-60d7afef.js +1 -1
  27. package/dist/browser/chunks/dist-ca9b9622.js +1 -1
  28. package/dist/browser/chunks/double-struck-BpJEQk8y-500ce8dd.js +1 -1
  29. package/dist/browser/chunks/focus-trap-44913bf3.js +1 -1
  30. package/dist/browser/chunks/fraktur-rLEq9DEH-44cc14d8.js +1 -1
  31. package/dist/browser/chunks/greek-BlraJTyL-90ce8924.js +1 -1
  32. package/dist/browser/chunks/greek-ss-D-EN2PK0-91610739.js +1 -1
  33. package/dist/browser/chunks/hebrew-GiQZeybp-b583f555.js +1 -1
  34. package/dist/browser/chunks/latin-b-BhEnC7R2-d13e06ff.js +1 -1
  35. package/dist/browser/chunks/latin-bi-DqiIKv3U-1dec8705.js +1 -1
  36. package/dist/browser/chunks/latin-i-B1xtwaE1-21637466.js +1 -1
  37. package/dist/browser/chunks/latin-xfWFlLkD-5bcea5cf.js +1 -1
  38. package/dist/browser/chunks/logger-8b07fb72.js +1 -1
  39. package/dist/browser/chunks/marrows-DD1NgMQi-15b63755.js +1 -1
  40. package/dist/browser/chunks/math-DpWn1mbG-38eeb914.js +1 -1
  41. package/dist/browser/chunks/math-rendering-ready-9a0fd90a.js +1 -1
  42. package/dist/browser/chunks/{mathjax-D2JHb_R_-64780dc5.js → mathjax-BKrHE4xs-3ca05bf6.js} +41 -41
  43. package/dist/browser/chunks/monospace-D116QD2a-98d484fd.js +1 -1
  44. package/dist/browser/chunks/monospace-ex-DcXpouKS-456b403c.js +1 -1
  45. package/dist/browser/chunks/monospace-l-Ct5wkMDs-f34a4a9e.js +1 -1
  46. package/dist/browser/chunks/mshapes-DCp86WSX-c0055952.js +1 -1
  47. package/dist/browser/chunks/nl-NL-364d61b9.js +1 -1
  48. package/dist/browser/chunks/nl-NL-8b7e6d4b.js +1 -1
  49. package/dist/browser/chunks/phonetics-BwOCw2Y9-d2e3af59.js +1 -1
  50. package/dist/browser/chunks/phonetics-ss-CRtMn02f-579b6135.js +1 -1
  51. package/dist/browser/chunks/pie-api-client-687c319a.js +1 -1
  52. package/dist/browser/chunks/provider-4c704118.js +1 -1
  53. package/dist/browser/chunks/runtime-YFqnU6ic-d5c0cb49.js +8605 -0
  54. package/dist/browser/chunks/sans-serif-BYPZKlE9-2efdbcd9.js +1 -1
  55. package/dist/browser/chunks/sans-serif-b-B0kRKiC--b5530dce.js +1 -1
  56. package/dist/browser/chunks/sans-serif-bi-DXWul6mu-5370dba4.js +1 -1
  57. package/dist/browser/chunks/sans-serif-ex-Boux1kMP-aa178f31.js +1 -1
  58. package/dist/browser/chunks/sans-serif-i-676RFaSO-2db54474.js +1 -1
  59. package/dist/browser/chunks/sans-serif-r-DrN9xdZt-0fc72eea.js +1 -1
  60. package/dist/browser/chunks/script-0ohehnXc-526904f4.js +1 -1
  61. package/dist/browser/chunks/shapes-BG47NodJ-d59b0eca.js +1 -1
  62. package/dist/browser/chunks/{src-BcptuNS5-ed25d7fd.js → src-D_1goyPT-8cca0246.js} +81 -82
  63. package/dist/browser/chunks/{sre-engine-wf9s43gg-f09289c5.js → sre-0162a7a9.js} +18 -18
  64. package/dist/browser/chunks/sre-engine-ace23548.js +1 -0
  65. package/dist/browser/chunks/sre-engine-bj997w4b-891a4cbe.js +1 -0
  66. package/dist/browser/chunks/sre-locales-112320af.js +1 -0
  67. package/dist/browser/chunks/symbols-BqnUxf_t-83087e87.js +1 -1
  68. package/dist/browser/chunks/symbols-b-i-eg9k5hmF-9c461ac2.js +1 -1
  69. package/dist/browser/chunks/term-lookup-632cf6b1.js +1 -0
  70. package/dist/browser/chunks/tool-annotation-toolbar-997438b4.js +7 -6
  71. package/dist/browser/chunks/tool-answer-eliminator-35483abd.js +6 -6
  72. package/dist/browser/chunks/tool-color-scheme-b7de5cdf.js +5 -5
  73. package/dist/browser/chunks/tool-dictionary-cecff3b4.js +3 -3
  74. package/dist/browser/chunks/tool-graph-cb0338e8.js +6 -6
  75. package/dist/browser/chunks/tool-host-contract-fae1c415.js +1 -0
  76. package/dist/browser/chunks/tool-instance-id-76ac45e2.js +1 -0
  77. package/dist/browser/chunks/tool-line-reader-f8ef3c6a.js +3 -3
  78. package/dist/browser/chunks/tool-periodic-table-43b133b8.js +13 -16
  79. package/dist/browser/chunks/tool-picture-dictionary-33721e91.js +3 -3
  80. package/dist/browser/chunks/tool-protractor-23f77028.js +6 -6
  81. package/dist/browser/chunks/tool-ruler-1d9a03a6.js +12 -9
  82. package/dist/browser/chunks/tool-tts-inline-98c2ce7a.js +27 -33
  83. package/dist/browser/chunks/toolbar-registration-helpers-a7ab1ad4.js +194 -0
  84. package/dist/browser/chunks/variants-2LRNhOUP-966fc49d.js +1 -1
  85. package/dist/browser/pie-section-player.js +210 -100
  86. package/dist/chunks/nl-NL-364d61b9.js +35 -30
  87. package/dist/chunks/{sre-engine-wf9s43gg-f09289c5.js → sre-engine-bj997w4b-891a4cbe.js} +1 -1
  88. package/dist/component-definitions.d.ts +0 -2
  89. package/dist/components/shared/card-media-region.d.ts +3 -4
  90. package/dist/components/shared/composition.d.ts +3 -1
  91. package/dist/components/shared/framework-error-latch.d.ts +34 -0
  92. package/dist/components/shared/host-element.d.ts +10 -0
  93. package/dist/components/shared/kernel-host-default-body.d.ts +14 -0
  94. package/dist/components/shared/layout-host-methods.d.ts +12 -27
  95. package/dist/components/shared/missing-tool-providers.d.ts +6 -12
  96. package/dist/components/shared/player-preload.d.ts +4 -9
  97. package/dist/components/shared/section-player-backend-delivery.d.ts +1 -1
  98. package/dist/components/shared/section-player-card-context.d.ts +5 -4
  99. package/dist/components/shared/section-player-host-runtime.d.ts +32 -21
  100. package/dist/components/shared/section-player-layout-context.d.ts +77 -0
  101. package/dist/components/shared/section-player-own-event.d.ts +10 -0
  102. package/dist/components/shared/section-player-runtime-callbacks.d.ts +1 -1
  103. package/dist/components/shared/section-player-shell-layout.svelte.d.ts +3 -11
  104. package/dist/components/shared/section-player-view-state.d.ts +6 -2
  105. package/dist/components/shared/toolkit-ready-wait.d.ts +16 -0
  106. package/dist/contracts/host-hooks.d.ts +0 -7
  107. package/dist/contracts/runtime-host-contract.d.ts +0 -5
  108. package/dist/controllers/SectionController.d.ts +21 -6
  109. package/dist/controllers/types.d.ts +8 -1
  110. package/dist/item-section/index.d.ts +22 -0
  111. package/dist/item-section/index.js +37 -0
  112. package/dist/pie-section-player.d.ts +4 -6
  113. package/dist/pie-section-player.js +24965 -25463
  114. package/dist/policies/index.d.ts +1 -19
  115. package/dist/policies/index.js +6 -14
  116. package/dist/policies/types.d.ts +0 -4
  117. package/package.json +17 -55
  118. package/dist/browser/chunks/ToolCoordinator-cc2dc319.js +0 -1
  119. package/dist/browser/chunks/nds-icon-button-d602f784.js +0 -194
  120. package/dist/browser/chunks/pie-tool-calculator-cortex-0626bc24.js +0 -9
  121. package/dist/browser/chunks/pie-tool-calculator-geogebra-561236cb.js +0 -9
  122. package/dist/browser/chunks/runtime-C7H1jS4E-64772f5e.js +0 -8413
  123. package/dist/browser/chunks/tool-host-contract-b93b482c.js +0 -1
  124. package/dist/components/item-shell-element.d.ts +0 -1
  125. package/dist/components/shared/shell-registration.d.ts +0 -55
  126. package/dist/contracts/layout-contract.d.ts +0 -17
  127. package/dist/contracts/layout-contract.js +0 -0
  128. package/dist/contracts/layout-parity-metadata.d.ts +0 -4
  129. package/dist/contracts/layout-parity-metadata.js +0 -87
  130. package/dist/contracts/public-events.d.ts +0 -92
  131. package/dist/contracts/public-events.js +0 -12
  132. package/dist/policies/guards.d.ts +0 -2
  133. /package/dist/browser/chunks/{ItemToolBar-wr2myaah-2ce4b643.js → ItemToolBar-66hcwmfw-3bcb82a3.js} +0 -0
  134. /package/dist/chunks/{ItemToolBar-wr2myaah-1287ba31.js → ItemToolBar-66hcwmfw-1287ba31.js} +0 -0
@@ -1,4 +1,3 @@
1
- import { SectionPlayerReadinessChangeDetail } from './public-events.js';
2
1
  import { SectionControllerHandle } from '@pie-players/pie-assessment-toolkit';
3
2
  export type SectionPlayerNavigationSnapshot = {
4
3
  currentIndex: number;
@@ -8,7 +7,6 @@ export type SectionPlayerNavigationSnapshot = {
8
7
  currentItemId?: string;
9
8
  };
10
9
  export type SectionPlayerSnapshot = {
11
- readiness: SectionPlayerReadinessChangeDetail;
12
10
  composition: {
13
11
  itemsCount: number;
14
12
  passagesCount: number;
@@ -17,9 +15,6 @@ export type SectionPlayerSnapshot = {
17
15
  };
18
16
  export interface SectionPlayerRuntimeHostContract {
19
17
  getSnapshot(): SectionPlayerSnapshot;
20
- selectComposition(): SectionPlayerSnapshot["composition"];
21
- selectNavigation(): SectionPlayerNavigationSnapshot;
22
- selectReadiness(): SectionPlayerReadinessChangeDetail;
23
18
  navigateTo(index: number): boolean;
24
19
  navigateNext(): boolean;
25
20
  navigatePrevious(): boolean;
@@ -4,16 +4,24 @@ 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;
16
23
  private readonly loadedRenderableKeys;
24
+ private readonly heldContentLoads;
17
25
  private readonly itemCompletionByCanonicalId;
18
26
  private readonly elementCompletionByCanonicalId;
19
27
  private readonly reportedCompletionIds;
@@ -52,6 +60,12 @@ export declare class SectionController implements SectionControllerHandle {
52
60
  updateInput(input?: unknown): Promise<void>;
53
61
  configureSessionPersistence(config: SectionSessionPersistenceConfig): void;
54
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
+ */
55
69
  persist(): Promise<void>;
56
70
  dispose(): void;
57
71
  getViewModel(): SectionViewModel;
@@ -241,12 +255,9 @@ export declare class SectionController implements SectionControllerHandle {
241
255
  */
242
256
  getRuntimeState(): SectionControllerRuntimeState | null;
243
257
  /**
244
- * Snapshot of currently-loaded renderables in registration order.
245
- *
246
- * Walks `trackedRenderables` (preserves insertion order) and emits an entry
247
- * for each entry whose key is in `loadedRenderableKeys`. Used by the
248
- * coordinator to replay `content-loaded` events to subscribers that
249
- * 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.
250
261
  */
251
262
  private collectLoadedRenderableSnapshot;
252
263
  getCurrentItem(): ItemEntity | null;
@@ -314,6 +325,10 @@ export declare class SectionController implements SectionControllerHandle {
314
325
  private evaluateSectionLoadingState;
315
326
  private replayPendingAppliedSession;
316
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
+ */
317
332
  private normalizeItemSessionEntry;
318
333
  private applyNormalizedSessionToState;
319
334
  private cloneForRead;
@@ -1,6 +1,6 @@
1
1
  import { TestAttemptSession } from '@pie-players/pie-assessment-toolkit';
2
2
  import { ItemSessionUpdateIntent, SessionCommitReason, AssessmentItemRef, AssessmentSection, ItemEntity, PassageEntity, RubricBlock } from '@pie-players/pie-players-shared';
3
- import { ConfigContainerEntity } from '@pie-players/pie-players-shared/types';
3
+ import { ConfigContainerEntity, ItemSettings } from '@pie-players/pie-players-shared/types';
4
4
  import { FormativeFeedbackReveal, FormativeItemPolicy, FormativeMasteryRollup, FormativeSectionProjection, FormativeSectionSlice, FormativeTryOutcome } from '@pie-players/pie-players-shared/formative';
5
5
  import { TimedMediaDegradation, TimedMediaSectionProjection, TimedMediaSectionSessionSlice, TimedMediaValidationError } from '@pie-players/pie-players-shared/timed-media';
6
6
  export type SectionView = "candidate" | "scorer" | "author" | "proctor" | "testConstructor" | "tutor";
@@ -23,6 +23,8 @@ export interface SectionContentModel {
23
23
  * that identifier, and two implementations of one mapping.
24
24
  */
25
25
  formative?: FormativeItemPolicy;
26
+ /** The item ref's policy settings, carried for the same reason. */
27
+ settings?: ItemSettings;
26
28
  }>;
27
29
  /**
28
30
  * How an authored `timedMedia.stimulusRef` resolves to a renderable.
@@ -119,6 +121,11 @@ export interface SectionCanonicalItemViewModel {
119
121
  index: number;
120
122
  isCurrent: boolean;
121
123
  session: unknown;
124
+ /**
125
+ * The item ref's policy settings, which the item's scope registers; they
126
+ * govern the item's own toolbar.
127
+ */
128
+ settings?: ItemSettings;
122
129
  }
123
130
  export interface SectionAttemptSessionSliceLoadedRenderable {
124
131
  itemId: string;
@@ -0,0 +1,22 @@
1
+ import { AssessmentSection, ItemConfig, SectionControllerSessionState } from '@pie-players/pie-players-shared/types';
2
+ export interface ItemSectionOptions {
3
+ /** Defaults to the item config's id. */
4
+ sectionId?: string;
5
+ itemVId?: string;
6
+ /** The item's session, in the shape `<pie-item-player session>` takes. */
7
+ session?: unknown;
8
+ }
9
+ export interface ItemSection {
10
+ section: AssessmentSection;
11
+ session: SectionControllerSessionState | null;
12
+ }
13
+ /**
14
+ * Build the `section` and `session` a section player layout takes from one item
15
+ * config and, optionally, its session.
16
+ *
17
+ * The item ref's `identifier` and the item's `id` are the config's `id`, so
18
+ * every `itemId` the section reports is the id the host already holds. The item
19
+ * and its passage carry no `baseId` or `version`. The host sets `section-id` to
20
+ * `section.identifier`.
21
+ */
22
+ export declare function sectionFromItem(config: ItemConfig, options?: ItemSectionOptions): ItemSection;
@@ -0,0 +1,37 @@
1
+ function d(e) {
2
+ return !!e.pie;
3
+ }
4
+ function r(e) {
5
+ const s = { ...e.pie };
6
+ e.instructorResources !== void 0 && s.instructorResources === void 0 && (s.instructorResources = e.instructorResources), e.defaultExtraModels !== void 0 && s.defaultExtraModels === void 0 && (s.defaultExtraModels = e.defaultExtraModels);
7
+ const t = {
8
+ id: e.id,
9
+ config: s
10
+ };
11
+ return e.passage && (t.passage = {
12
+ id: e.passage.id,
13
+ config: e.passage
14
+ }), t;
15
+ }
16
+ function n(e, s = {}) {
17
+ const t = d(e) ? r(e) : {
18
+ id: e.id,
19
+ config: e
20
+ }, i = {
21
+ identifier: e.id,
22
+ item: t
23
+ };
24
+ return s.itemVId !== void 0 && (i.itemVId = s.itemVId), {
25
+ section: {
26
+ identifier: s.sectionId ?? e.id,
27
+ assessmentItemRefs: [i]
28
+ },
29
+ session: s.session == null ? null : {
30
+ currentItemIndex: 0,
31
+ itemSessions: { [e.id]: s.session }
32
+ }
33
+ };
34
+ }
35
+ export {
36
+ n as sectionFromItem
37
+ };
@@ -1,10 +1,8 @@
1
- export type { SectionPlayerLayoutContract, SectionPlayerLayoutName, SectionPlayerLayoutCapability, SectionPlayerBasicPropName, SectionPlayerAdvancedPropName, SectionPlayerLayoutPropName, SectionPlayerLayoutCommandName, } from './contracts/layout-contract.js';
2
- export type { SectionPlayerPublicEventName, SectionPlayerReadinessPhase, SectionPlayerReadinessChangeDetail, } from './contracts/public-events.js';
3
- export { SECTION_PLAYER_PUBLIC_EVENTS } from './contracts/public-events.js';
4
1
  export type { SectionPlayerRuntimeHostContract, SectionPlayerNavigationSnapshot, SectionPlayerSnapshot, } from './contracts/runtime-host-contract.js';
5
- export { SPLITPANE_LAYOUT_CONTRACT, TABBED_LAYOUT_CONTRACT, VERTICAL_LAYOUT_CONTRACT, } from './contracts/layout-parity-metadata.js';
6
- export type { ReadinessPolicyAdapter, SectionPlayerPolicies, SectionPlayerReadinessPolicy, SectionPlayerPreloadPolicy, SectionPlayerTelemetryPolicy, } from './policies/types.js';
7
- export { DEFAULT_SECTION_PLAYER_POLICIES, isPreloadEnabled, isTelemetryEnabled, } from './policies/index.js';
2
+ export type { SectionPlayerPolicies, SectionPlayerReadinessPolicy, SectionPlayerPreloadPolicy, SectionPlayerTelemetryPolicy, } from './policies/types.js';
3
+ export { DEFAULT_SECTION_PLAYER_POLICIES } from './policies/index.js';
4
+ export { sectionFromItem } from './item-section/index.js';
5
+ export type { ItemSection, ItemSectionOptions } from './item-section/index.js';
8
6
  export type { SectionPlayerCardTitleContext, SectionPlayerCardTitleFormatter, SectionPlayerItemTitleContext, SectionPlayerPassageTitleContext, } from './contracts/card-title-formatters.js';
9
7
  export type { SectionPlayerHostHooks } from './contracts/host-hooks.js';
10
8
  export type { SectionPlayerBackendResolver, SectionPlayerBackendResolverContext, SectionPlayerRuntimeConfig, SectionPlayerRuntimePlayerConfig, } from './components/shared/section-player-backend-delivery.js';