@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 +0,0 @@
1
- import{t as r}from"./defineProperty-a20a667d.js";function d(t,e=!1){if(typeof t=="boolean")return t;if(t==null)return e;const s=String(t).trim().toLowerCase();return s===""?e:["false","0","off","no"].includes(s)?!1:["true","1","on","yes"].includes(s)?!0:!!s}function v(t){return t!==null&&d(t,!0)}var f=(t,e)=>{const s=t.$$p_d;return s?Object.entries(s).some(([n,o])=>o.type==="Boolean"&&(o.attribute??n.toLowerCase())===e):!1};function _(t){const e=t.prototype.attributeChangedCallback;return class extends t{attributeChangedCallback(s,n,o){const i=o!==null&&f(this,s)&&!v(o)?null:o;e?.call(this,s,n,i)}}}var b=class extends Event{constructor(t,e,s,n){super("context-request",{bubbles:!0,composed:!0}),r(this,"context",void 0),r(this,"contextTarget",void 0),r(this,"callback",void 0),r(this,"subscribe",void 0),this.context=t,this.contextTarget=e,this.callback=s,this.subscribe=n??!1}},A=class extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),r(this,"context",void 0),r(this,"contextTarget",void 0),this.context=t,this.contextTarget=e}},x=class{constructor(t,e){r(this,"host",void 0),r(this,"context",void 0),r(this,"subscribe",void 0),r(this,"onValue",void 0),r(this,"isConnected",!1),r(this,"unsubscribe",void 0),r(this,"currentValue",void 0),r(this,"handleValue",(s,n)=>{n!==this.unsubscribe&&(this.unsubscribe?.(),this.unsubscribe=n),!this.subscribe&&this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0),this.currentValue=s,this.onValue?.(s)}),this.host=t,this.context=e.context,this.subscribe=e.subscribe??!0,this.onValue=e.onValue}connect(){this.isConnected||(this.isConnected=!0,this.requestValue())}disconnect(){this.isConnected&&(this.isConnected=!1,this.unsubscribe?.(),this.unsubscribe=void 0)}get value(){return this.currentValue}requestValue(){this.host.dispatchEvent(new b(this.context,this.host,this.handleValue,this.subscribe))}},B=(t,e)=>{let s;return t.dispatchEvent(new b(e,t,n=>{s=n},!1)),s},C=50,m=200,a=(t,e,s)=>{let n=!1;const o=new x(t,{context:e,subscribe:!0,onValue:c=>{n=!0,s(c)}});o.connect();const i=c=>{c.context===e&&o.requestValue()};t.addEventListener("context-provider",i);let l=0;const h=globalThis.setInterval(()=>{if(n||l>=m){globalThis.clearInterval(h);return}l+=1,o.requestValue()},C);return()=>{globalThis.clearInterval(h),t.removeEventListener("context-provider",i),o.disconnect()}},u=t=>t,T=u(Symbol.for("pie.assessmentToolkit.runtimeContext")),q=u(Symbol.for("pie.assessmentToolkit.hostRuntimeContext")),p=u(Symbol.for("pie.assessmentToolkit.shellContext")),R=u(Symbol.for("pie.assessmentToolkit.regionScopeContext"));function g(t,e){return a(t,T,e)}function E(t,e){return a(t,p,e)}function k(t,e){return a(t,R,e)}var V={bubbles:!0,composed:!0,cancelable:!1};function S(t,e,s={}){return new CustomEvent(t,{detail:e,...V,...s})}function I(t,e,s,n={}){return t.dispatchEvent(S(e,s,n))}function P(t,e){return g(t,e)}function L(t,e){return E(t,e)}function O(t,e){return k(t,e)}function w(t,e){let s=null;function n(){s?.coordinator.unregisterTool(s.toolId),s=null}return{sync(o,i){!o||!i||s?.coordinator===o&&s.toolId===i||(n(),o.registerTool(i,t,void 0,e),s={coordinator:o,toolId:i})},release:n}}export{d as _,I as a,E as c,u as d,a as f,_ as g,b as h,w as i,R as l,A as m,P as n,k as o,B as p,L as r,g as s,O as t,p as u};
@@ -1 +0,0 @@
1
- export {};
@@ -1,55 +0,0 @@
1
- /**
2
- * Registration dispatch for the item and passage shells.
3
- *
4
- * Registration is a statement of fact to the runtime, and the runtime takes it
5
- * literally: a `pie-register` makes the toolkit unregister and re-register the
6
- * content's accessibility catalogs, re-run `sectionEngine.register`, and
7
- * re-notify the section controller. Both shells used to dispatch it from the
8
- * same effect that attached their listeners, with `pie-unregister` in that
9
- * effect's cleanup — so every re-run announced a teardown and a rebuild of state
10
- * that had not moved, and between the two the content had no catalogs at all.
11
- *
12
- * Those effects re-run on prop changes, and a shell's props are re-applied
13
- * whenever its parent card's template updates. That made the dispatch the far
14
- * half of a cycle: a reader that re-renders in response to a catalog change
15
- * re-applies a shell's props, which re-registers, which changes catalogs again.
16
- * It shipped once at roughly a thousand rounds per item, ending in Svelte
17
- * abandoning the update at its depth limit with the DOM half-applied — and every
18
- * assertion about the rendered output passed while it was happening, because the
19
- * elements were all present.
20
- *
21
- * So the dispatcher keeps the last identity it announced and says nothing when
22
- * the next one matches.
23
- */
24
- export type ShellRegistrationIdentity = {
25
- kind: "item" | "passage";
26
- host: HTMLElement;
27
- itemId: string;
28
- canonicalItemId: string;
29
- contentKind: string;
30
- item: unknown;
31
- };
32
- export type ShellRegistrationDispatcher = {
33
- /**
34
- * Announce `identity` if it says anything new, and retire the live
35
- * registration when there is nothing left to describe — a shell without a host
36
- * or an id no longer stands for content, and leaving its registration behind
37
- * would strand it in the runtime.
38
- *
39
- * Never dispatches `pie-unregister` before a re-register: both registration
40
- * paths in the toolkit are keyed by element and replace what is there, so the
41
- * unregister only ever created the gap.
42
- */
43
- sync: (identity: ShellRegistrationIdentity | null) => void;
44
- /**
45
- * Retire the live registration, replaying the identity it was made under
46
- * rather than whatever the props say now — by the time a registration is
47
- * retired the props may already describe its replacement, and unregistering
48
- * under the new identity would leave the old one live.
49
- *
50
- * Belongs in a teardown that runs on teardown only. Attaching it to an effect
51
- * that re-runs on prop changes is what made the churn.
52
- */
53
- retire: () => void;
54
- };
55
- export declare function createShellRegistrationDispatcher(): ShellRegistrationDispatcher;
@@ -1,17 +0,0 @@
1
- import { SectionPlayerPublicEventName } from './public-events.js';
2
- export type SectionPlayerLayoutName = "splitpane" | "vertical" | "tabbed";
3
- export type SectionPlayerLayoutCapability = "items-pane" | "passages-pane" | "section-toolbar" | "item-toolbar" | "passage-toolbar" | "readiness-events" | "navigation-events";
4
- export type SectionPlayerBasicPropName = "assessmentId" | "section" | "sectionId" | "attemptId" | "debug" | "showToolbar" | "toolbarPosition" | "narrowLayoutBreakpoint" | "contentMaxWidthNoPassage" | "contentMaxWidthWithPassage" | "splitPaneMinRegionWidth" | "splitPaneInitialPassageWidth" | "splitPaneCollapseStrategy";
5
- export type SectionPlayerAdvancedPropName = "runtime" | "iifeBundleHost" | "toolRegistry" | "sectionHostButtons" | "itemHostButtons" | "passageHostButtons" | "policies" | "toolConfigStrictness" | "hooks" | "onFrameworkError" | "onStageChange" | "onLoadingComplete";
6
- export type SectionPlayerLayoutPropName = SectionPlayerBasicPropName | SectionPlayerAdvancedPropName;
7
- export type SectionPlayerLayoutCommandName = "getSnapshot" | "selectComposition" | "selectNavigation" | "selectReadiness" | "navigateTo" | "navigateNext" | "navigatePrevious" | "getSectionController" | "waitForSectionController";
8
- export type SectionPlayerLayoutContract = {
9
- version: 1;
10
- layout: SectionPlayerLayoutName;
11
- props: readonly SectionPlayerLayoutPropName[];
12
- recommendedBasicProps: readonly SectionPlayerBasicPropName[];
13
- advancedEscapeHatchProps: readonly SectionPlayerAdvancedPropName[];
14
- events: readonly SectionPlayerPublicEventName[];
15
- commands: readonly SectionPlayerLayoutCommandName[];
16
- capabilities: readonly SectionPlayerLayoutCapability[];
17
- };
File without changes
@@ -1,4 +0,0 @@
1
- import { SectionPlayerLayoutContract } from './layout-contract.js';
2
- export declare const SPLITPANE_LAYOUT_CONTRACT: SectionPlayerLayoutContract;
3
- export declare const VERTICAL_LAYOUT_CONTRACT: SectionPlayerLayoutContract;
4
- export declare const TABBED_LAYOUT_CONTRACT: SectionPlayerLayoutContract;
@@ -1,87 +0,0 @@
1
- import { SECTION_PLAYER_PUBLIC_EVENTS as e } from "./public-events.js";
2
- var a = [
3
- "assessmentId",
4
- "section",
5
- "sectionId",
6
- "attemptId",
7
- "debug",
8
- "showToolbar",
9
- "toolbarPosition",
10
- "narrowLayoutBreakpoint",
11
- "contentMaxWidthNoPassage",
12
- "contentMaxWidthWithPassage",
13
- "splitPaneMinRegionWidth",
14
- "splitPaneInitialPassageWidth",
15
- "splitPaneCollapseStrategy"
16
- ], o = [
17
- "runtime",
18
- "iifeBundleHost",
19
- "toolRegistry",
20
- "sectionHostButtons",
21
- "itemHostButtons",
22
- "passageHostButtons",
23
- "policies",
24
- "toolConfigStrictness",
25
- "hooks",
26
- "onFrameworkError",
27
- "onStageChange",
28
- "onLoadingComplete"
29
- ], t = [...a, ...o], s = [
30
- e.runtimeOwned,
31
- e.runtimeInherited,
32
- e.frameworkError,
33
- e.compositionChanged,
34
- e.sessionChanged,
35
- e.stageChange,
36
- e.loadingComplete
37
- ], n = [
38
- "getSnapshot",
39
- "selectComposition",
40
- "selectNavigation",
41
- "selectReadiness",
42
- "navigateTo",
43
- "navigateNext",
44
- "navigatePrevious",
45
- "getSectionController",
46
- "waitForSectionController"
47
- ], i = [
48
- "items-pane",
49
- "passages-pane",
50
- "section-toolbar",
51
- "item-toolbar",
52
- "passage-toolbar",
53
- "readiness-events",
54
- "navigation-events"
55
- ], p = {
56
- version: 1,
57
- layout: "splitpane",
58
- props: t,
59
- recommendedBasicProps: a,
60
- advancedEscapeHatchProps: o,
61
- events: s,
62
- commands: n,
63
- capabilities: i
64
- }, c = {
65
- version: 1,
66
- layout: "vertical",
67
- props: t,
68
- recommendedBasicProps: a,
69
- advancedEscapeHatchProps: o,
70
- events: s,
71
- commands: n,
72
- capabilities: i
73
- }, d = {
74
- version: 1,
75
- layout: "tabbed",
76
- props: t,
77
- recommendedBasicProps: a,
78
- advancedEscapeHatchProps: o,
79
- events: s,
80
- commands: n,
81
- capabilities: i
82
- };
83
- export {
84
- p as SPLITPANE_LAYOUT_CONTRACT,
85
- d as TABBED_LAYOUT_CONTRACT,
86
- c as VERTICAL_LAYOUT_CONTRACT
87
- };
@@ -1,92 +0,0 @@
1
- /**
2
- * Section-player layout-CE public DOM event vocabulary.
3
- *
4
- * **Engine routing (M7).** The *stage / loading-complete /
5
- * framework-error* family is dispatched on the layout CE host by the
6
- * section runtime engine
7
- * (`@pie-players/pie-assessment-toolkit/runtime/engine`) — not by an
8
- * in-CE `$effect` cluster. The kernel attaches the engine to the host
9
- * (`engine.attachHost({ host, sourceCe, frameworkErrorBus })`), and
10
- * the engine's DOM-event bridge dispatches `pie-stage-change`,
11
- * `pie-loading-complete`, and `framework-error`.
12
- *
13
- * **Toolkit events (not engine-routed).** The composition / session /
14
- * runtime-tier family (`composition-changed`, `session-changed`,
15
- * `runtime-owned`, `runtime-inherited`) is dispatched by
16
- * `<pie-assessment-toolkit>` and bubbles through the layout CE host to
17
- * `document`; no section-player component re-dispatches it, so each
18
- * listener receives each dispatch once. It does not flow through the
19
- * engine: the engine owns lifecycle and error reporting, and has no
20
- * opinion on composition or session shape.
21
- *
22
- * **`framework-error` single-emit on the layout host.**
23
- * `<pie-assessment-toolkit>` nested inside a layout CE still
24
- * dispatches its own `framework-error` (with `bubbles: true,
25
- * composed: true`) so direct toolkit consumers keep working. The
26
- * kernel's `handleFrameworkError` listener intercepts that bubbled
27
- * emit at `<pie-section-player-base>` and calls
28
- * `event.stopPropagation()`, leaving the engine-bridge emit on the
29
- * layout host as the single canonical DOM surface for
30
- * section-player consumers. `tests/section-player-event-delivery.spec.ts`
31
- * pins one delivery per error on the layout host and none on
32
- * `document`.
33
- *
34
- * Lifecycle should be consumed through canonical events:
35
- * - `readiness-change` → `pie-stage-change` (the readiness phase
36
- * is also reachable via `selectReadiness()` /
37
- * `getSnapshot().readiness`).
38
- * - `interaction-ready` → `pie-stage-change` filtered on
39
- * `detail.stage === "interactive"`.
40
- * - `ready` → `pie-loading-complete`.
41
- *
42
- * Controller readiness is available through
43
- * `waitForSectionController(timeoutMs)` / `getSectionController()` on the
44
- * layout CE, or by filtering `pie-stage-change` for
45
- * `detail.stage === "engine-ready"`.
46
- *
47
- * Source of truth for the names: `players-shared/src/pie/stages.ts`
48
- * and the `SectionEngineOutput` discriminator in
49
- * `assessment-toolkit/src/runtime/core/engine-output.ts`.
50
- */
51
- export declare const SECTION_PLAYER_PUBLIC_EVENTS: {
52
- readonly runtimeOwned: "runtime-owned";
53
- readonly runtimeInherited: "runtime-inherited";
54
- /**
55
- * Engine-routed (M7). Dispatched by
56
- * `framework-error-bridge.ts` on the layout CE host whenever the
57
- * engine receives a `framework-error` input. See class doc on
58
- * `FrameworkErrorBus` for the back-pressure / fan-out semantics.
59
- */
60
- readonly frameworkError: "framework-error";
61
- readonly compositionChanged: "composition-changed";
62
- readonly sessionChanged: "session-changed";
63
- /**
64
- * Engine-routed (M7). One DOM event family carries every stage
65
- * transition (`composed` → `engine-ready` → `interactive` →
66
- * `disposed`) with the discriminator in `event.detail.stage`.
67
- * Dispatched by the engine's `dom-event-bridge.ts` on each
68
- * `SectionEngineOutput` of kind `stage-change`. See
69
- * `packages/players-shared/src/pie/stages.ts`.
70
- */
71
- readonly stageChange: "pie-stage-change";
72
- /**
73
- * Engine-routed (M7). Companion to `stageChange`. Fires once per
74
- * cohort, once the section controller is ready and the section's
75
- * element pre-warm has resolved for the current items: the same
76
- * condition that moves a layout element to `interactive`.
77
- */
78
- readonly loadingComplete: "pie-loading-complete";
79
- };
80
- export type SectionPlayerPublicEventName = (typeof SECTION_PLAYER_PUBLIC_EVENTS)[keyof typeof SECTION_PLAYER_PUBLIC_EVENTS];
81
- /**
82
- * Readiness phase reported by the engine's readiness derivation. The
83
- * type preserves the readiness payload shape used by
84
- * `selectReadiness()`.
85
- */
86
- export type SectionPlayerReadinessPhase = "bootstrapping" | "interaction-ready" | "loading" | "ready" | "error";
87
- export type SectionPlayerReadinessChangeDetail = {
88
- phase: SectionPlayerReadinessPhase;
89
- interactionReady: boolean;
90
- allLoadingComplete: boolean;
91
- reason?: string;
92
- };
@@ -1,12 +0,0 @@
1
- var e = {
2
- runtimeOwned: "runtime-owned",
3
- runtimeInherited: "runtime-inherited",
4
- frameworkError: "framework-error",
5
- compositionChanged: "composition-changed",
6
- sessionChanged: "session-changed",
7
- stageChange: "pie-stage-change",
8
- loadingComplete: "pie-loading-complete"
9
- };
10
- export {
11
- e as SECTION_PLAYER_PUBLIC_EVENTS
12
- };
@@ -1,2 +0,0 @@
1
- import { SectionPlayerPublicEventName } from '../contracts/public-events.js';
2
- export declare function assertPublicEventName(eventName: string): asserts eventName is SectionPlayerPublicEventName;