@pie-players/pie-section-player 0.3.73 → 0.3.75
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 +395 -149
- package/dist/browser/assets/evaluation-worker-CORp9m0K.js +156459 -0
- package/dist/browser/chunks/ItemToolBar-jx38w99s-58defccc.js +1 -0
- package/dist/browser/chunks/PUA-tLuTiQ7--f2b27953.js +1 -0
- package/dist/browser/chunks/ToolCoordinator-cc2dc319.js +1 -0
- package/dist/browser/chunks/accents-BTUYmhn9-cafeb96e.js +1 -0
- package/dist/browser/chunks/accents-b-i-CngHZsLL-e0eb98fd.js +1 -0
- package/dist/browser/chunks/arabic-BzEHMVZD-30ac1ade.js +1 -0
- package/dist/browser/chunks/arrows-VjxlU-jv-2e17c192.js +1 -0
- package/dist/browser/chunks/base-dfd67c41.js +1 -0
- package/dist/browser/chunks/braille-BeWC_Ruq-a3bb8ef9.js +1 -0
- package/dist/browser/chunks/braille-d-Dk6J96GO-d832bfbf.js +1 -0
- package/dist/browser/chunks/browser-a3c32178.js +37 -0
- package/dist/browser/chunks/calculator-element-271c142f.js +13 -0
- package/dist/browser/chunks/calligraphic-Cew9cU3x-04cf0735.js +1 -0
- package/dist/browser/chunks/catalog-context-46d3e50e.js +1 -0
- package/dist/browser/chunks/catalog-owner-d602f784.js +1 -0
- package/dist/browser/chunks/cherokee-Cny3FYho-4da7d2f3.js +1 -0
- package/dist/browser/chunks/classPrivateFieldGet2-338e0179.js +1 -0
- package/dist/browser/chunks/cyrillic-CfCDulXU-5550df0b.js +1 -0
- package/dist/browser/chunks/cyrillic-ss-lU7bNGG9-12eb0188.js +1 -0
- package/dist/browser/chunks/defineProperty-a20a667d.js +1 -0
- package/dist/browser/chunks/devanagari-CDIz2h-r-18c38725.js +1 -0
- package/dist/browser/chunks/dist-41b39e7f.js +1 -0
- package/dist/browser/chunks/dist-59132a53.js +1 -0
- package/dist/browser/chunks/dist-60d7afef.js +1 -0
- package/dist/browser/chunks/dist-ca9b9622.js +1 -0
- package/dist/browser/chunks/double-struck-BpJEQk8y-500ce8dd.js +1 -0
- package/dist/browser/chunks/en-5ff22e17.js +1 -0
- package/dist/browser/chunks/es-a0ba6cb6.js +1 -0
- package/dist/browser/chunks/focus-trap-44913bf3.js +1 -0
- package/dist/browser/chunks/fraktur-rLEq9DEH-44cc14d8.js +1 -0
- package/dist/browser/chunks/greek-BlraJTyL-90ce8924.js +1 -0
- package/dist/browser/chunks/greek-ss-D-EN2PK0-91610739.js +1 -0
- package/dist/browser/chunks/hebrew-GiQZeybp-b583f555.js +1 -0
- package/dist/browser/chunks/latin-b-BhEnC7R2-d13e06ff.js +1 -0
- package/dist/browser/chunks/latin-bi-DqiIKv3U-1dec8705.js +1 -0
- package/dist/browser/chunks/latin-i-B1xtwaE1-21637466.js +1 -0
- package/dist/browser/chunks/latin-xfWFlLkD-5bcea5cf.js +1 -0
- package/dist/browser/chunks/logger-8b07fb72.js +1 -0
- package/dist/browser/chunks/marrows-DD1NgMQi-15b63755.js +1 -0
- package/dist/browser/chunks/math-DpWn1mbG-38eeb914.js +1 -0
- package/dist/browser/chunks/math-rendering-ready-9a0fd90a.js +1 -0
- package/dist/browser/chunks/mathjax-BKrHE4xs-3ca05bf6.js +232 -0
- package/dist/browser/chunks/module-0191e321.js +74 -0
- package/dist/browser/chunks/module-shim-58659a86.js +0 -0
- package/dist/browser/chunks/module-shim-b4470740.js +12 -0
- package/dist/browser/chunks/monospace-D116QD2a-98d484fd.js +1 -0
- package/dist/browser/chunks/monospace-ex-DcXpouKS-456b403c.js +1 -0
- package/dist/browser/chunks/monospace-l-Ct5wkMDs-f34a4a9e.js +1 -0
- package/dist/browser/chunks/mshapes-DCp86WSX-c0055952.js +1 -0
- package/dist/browser/chunks/nl-NL-364d61b9.js +1 -0
- package/dist/browser/chunks/nl-NL-8b7e6d4b.js +1 -0
- package/dist/browser/chunks/overlay-containment-edaaff13.js +1 -0
- package/dist/browser/chunks/overlay-placement-e8058232.js +1 -0
- package/dist/browser/chunks/phonetics-BwOCw2Y9-d2e3af59.js +1 -0
- package/dist/browser/chunks/phonetics-ss-CRtMn02f-579b6135.js +1 -0
- package/dist/browser/chunks/pie-api-client-687c319a.js +1 -0
- package/dist/browser/chunks/pointer-gesture-ce75f0a7.js +1 -0
- package/dist/browser/chunks/preload-helper-6ad28da3.js +1 -0
- package/dist/browser/chunks/provider-4c704118.js +1 -0
- package/dist/browser/chunks/rolldown-runtime-1287ba31.js +1 -0
- package/dist/browser/chunks/runtime-wcU7KOFU-ac86d7b8.js +8536 -0
- package/dist/browser/chunks/sanitize-svg-icon-b9082bba.js +3 -0
- package/dist/browser/chunks/sans-serif-BYPZKlE9-2efdbcd9.js +1 -0
- package/dist/browser/chunks/sans-serif-b-B0kRKiC--b5530dce.js +1 -0
- package/dist/browser/chunks/sans-serif-bi-DXWul6mu-5370dba4.js +1 -0
- package/dist/browser/chunks/sans-serif-ex-Boux1kMP-aa178f31.js +1 -0
- package/dist/browser/chunks/sans-serif-i-676RFaSO-2db54474.js +1 -0
- package/dist/browser/chunks/sans-serif-r-DrN9xdZt-0fc72eea.js +1 -0
- package/dist/browser/chunks/script-0ohehnXc-526904f4.js +1 -0
- package/dist/browser/chunks/shapes-BG47NodJ-d59b0eca.js +1 -0
- package/dist/browser/chunks/src-BcptuNS5-ed25d7fd.js +191 -0
- package/dist/browser/chunks/sre-0162a7a9.js +53 -0
- package/dist/browser/chunks/sre-engine-ace23548.js +1 -0
- package/dist/browser/chunks/sre-engine-jd8cc08x-42d270e5.js +1 -0
- package/dist/browser/chunks/sre-locales-112320af.js +1 -0
- package/dist/browser/chunks/symbols-BqnUxf_t-83087e87.js +1 -0
- package/dist/browser/chunks/symbols-b-i-eg9k5hmF-9c461ac2.js +1 -0
- package/dist/browser/chunks/tool-annotation-toolbar-997438b4.js +249 -0
- package/dist/browser/chunks/tool-answer-eliminator-35483abd.js +13 -0
- package/dist/browser/chunks/tool-color-scheme-b7de5cdf.js +26 -0
- package/dist/browser/chunks/tool-dictionary-cecff3b4.js +7 -0
- package/dist/browser/chunks/tool-graph-cb0338e8.js +11 -0
- package/dist/browser/chunks/tool-host-contract-b93b482c.js +1 -0
- package/dist/browser/chunks/tool-instance-id-2a92deb0.js +1 -0
- package/dist/browser/chunks/tool-line-reader-f8ef3c6a.js +62 -0
- package/dist/browser/chunks/tool-periodic-table-43b133b8.js +153 -0
- package/dist/browser/chunks/tool-picture-dictionary-33721e91.js +4 -0
- package/dist/browser/chunks/tool-protractor-23f77028.js +17 -0
- package/dist/browser/chunks/tool-ruler-1d9a03a6.js +15 -0
- package/dist/browser/chunks/tool-tts-inline-98c2ce7a.js +179 -0
- package/dist/browser/chunks/tts-runtime-config-a7ab1ad4.js +194 -0
- package/dist/browser/chunks/variants-2LRNhOUP-966fc49d.js +1 -0
- package/dist/browser/chunks/versioned-tag-54a76be9.js +1 -0
- package/dist/browser/pie-section-player.js +1727 -0
- package/dist/browser.d.ts +10 -0
- package/dist/chunks/ItemToolBar-jx38w99s-1287ba31.js +28 -0
- package/dist/chunks/module-shim-58659a86.js +2129 -0
- package/dist/chunks/{nl-NL-9312c316.js → nl-NL-364d61b9.js} +9 -26
- package/dist/chunks/sre-engine-jd8cc08x-42d270e5.js +8 -0
- package/dist/components/shared/composition.d.ts +3 -2
- package/dist/components/shared/framework-error-latch.d.ts +32 -0
- package/dist/components/shared/host-element.d.ts +10 -0
- package/dist/components/shared/kernel-host-default-body.d.ts +14 -0
- package/dist/components/shared/layout-host-methods.d.ts +385 -0
- package/dist/components/shared/missing-tool-providers.d.ts +16 -0
- package/dist/components/shared/player-preload.d.ts +14 -10
- package/dist/components/shared/section-player-backend-delivery.d.ts +1 -1
- package/dist/components/shared/section-player-card-context.d.ts +5 -1
- package/dist/components/shared/section-player-host-runtime.d.ts +32 -19
- package/dist/components/shared/section-player-layout-context.d.ts +77 -0
- package/dist/components/shared/section-player-own-event.d.ts +10 -0
- package/dist/components/shared/section-player-runtime-callbacks.d.ts +1 -1
- package/dist/components/shared/section-player-shell-layout.svelte.d.ts +3 -11
- package/dist/components/shared/section-player-view-state.d.ts +6 -1
- package/dist/components/shared/toolkit-ready-wait.d.ts +16 -0
- package/dist/contracts/host-hooks.d.ts +4 -12
- package/dist/contracts/host-hooks.js +0 -0
- package/dist/contracts/runtime-host-contract.d.ts +0 -5
- package/dist/contracts/runtime-host-contract.js +0 -0
- package/dist/controllers/SectionController.d.ts +14 -0
- package/dist/controllers/toolkit-section-contracts.d.ts +1 -17
- package/dist/controllers/types.d.ts +25 -11
- package/dist/item-section/index.d.ts +22 -0
- package/dist/item-section/index.js +37 -0
- package/dist/pie-section-player.d.ts +4 -6
- package/dist/pie-section-player.js +22006 -41076
- package/dist/policies/index.d.ts +5 -16
- package/dist/policies/index.js +17 -0
- package/dist/policies/types.d.ts +0 -4
- package/package.json +33 -68
- package/dist/chunks/module-a516757f.js +0 -73997
- package/dist/chunks/nl-NL-ef6dd604.js +0 -505
- package/dist/chunks/pie-api-client-22de9d9c.js +0 -168
- package/dist/chunks/rolldown-runtime-1287ba31.js +0 -20
- package/dist/chunks/sre-0162a7a9.js +0 -17637
- package/dist/components/item-shell-element.d.ts +0 -1
- package/dist/components/shared/shell-registration.d.ts +0 -55
- package/dist/contracts/layout-contract.d.ts +0 -17
- package/dist/contracts/layout-parity-metadata.d.ts +0 -4
- package/dist/contracts/public-events.d.ts +0 -93
- package/dist/contracts/stages.d.ts +0 -10
- package/dist/policies/guards.d.ts +0 -2
- package/dist/utils/z-index.d.ts +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RuntimeInputs } from '@pie-players/pie-assessment-toolkit/runtime/engine';
|
|
2
2
|
import { ItemEntity } from '@pie-players/pie-players-shared';
|
|
3
3
|
/**
|
|
4
4
|
* Resolve the player-runtime view (player tag, attributes, props,
|
|
@@ -21,14 +21,16 @@ export declare function resolvePlayerRuntime(args: {
|
|
|
21
21
|
loaderOptions: {
|
|
22
22
|
[x: string]: unknown;
|
|
23
23
|
};
|
|
24
|
-
loaderConfig?: import('@pie-players/pie-players-shared').LoaderConfig;
|
|
25
24
|
hosted: boolean;
|
|
25
|
+
loaderConfig?: import('@pie-players/pie-players-shared').LoaderConfig;
|
|
26
|
+
backend?: Record<string, unknown> | null;
|
|
26
27
|
} | {
|
|
27
28
|
loaderOptions: {
|
|
28
29
|
[x: string]: unknown;
|
|
29
30
|
};
|
|
31
|
+
hosted?: boolean;
|
|
30
32
|
loaderConfig?: import('@pie-players/pie-players-shared').LoaderConfig;
|
|
31
|
-
|
|
33
|
+
backend?: Record<string, unknown> | null;
|
|
32
34
|
};
|
|
33
35
|
resolvedPlayerEnv: Record<string, unknown>;
|
|
34
36
|
strategy: import('@pie-players/pie-players-shared').ItemPlayerStrategy;
|
|
@@ -51,7 +53,29 @@ export declare function mapRenderablesToItems(renderables: unknown[]): ItemEntit
|
|
|
51
53
|
*/
|
|
52
54
|
export declare function resolveSectionPlayerRuntimeState(args: RuntimeInputs): {
|
|
53
55
|
effectiveToolsConfig: unknown;
|
|
54
|
-
effectiveRuntime:
|
|
56
|
+
effectiveRuntime: {
|
|
57
|
+
playerType: string;
|
|
58
|
+
player: {
|
|
59
|
+
hosted?: boolean;
|
|
60
|
+
loaderConfig?: import('@pie-players/pie-players-shared').LoaderConfig;
|
|
61
|
+
loaderOptions?: Record<string, unknown>;
|
|
62
|
+
backend?: Record<string, unknown> | null;
|
|
63
|
+
} | null;
|
|
64
|
+
lazyInit: boolean;
|
|
65
|
+
accessibility: Record<string, unknown> | null;
|
|
66
|
+
coordinator: {} | null;
|
|
67
|
+
createSectionController: unknown;
|
|
68
|
+
isolation: string;
|
|
69
|
+
env: Record<string, unknown>;
|
|
70
|
+
toolConfigStrictness: import('@pie-players/pie-assessment-toolkit').ToolConfigStrictness;
|
|
71
|
+
tools: unknown;
|
|
72
|
+
assessmentId?: string;
|
|
73
|
+
toolContextResolvers?: Record<string, unknown> | null;
|
|
74
|
+
contentLanguage?: string;
|
|
75
|
+
onFrameworkError?: import('@pie-players/pie-assessment-toolkit/runtime/engine').FrameworkErrorHandler;
|
|
76
|
+
onStageChange?: import('@pie-players/pie-assessment-toolkit/runtime/engine').StageChangeHandler;
|
|
77
|
+
onLoadingComplete?: import('@pie-players/pie-assessment-toolkit/runtime/engine').LoadingCompleteHandler;
|
|
78
|
+
};
|
|
55
79
|
playerRuntime: {
|
|
56
80
|
effectivePlayerType: string;
|
|
57
81
|
resolvedPlayerDefinition: import('../../component-definitions.js').ComponentDefinition;
|
|
@@ -61,29 +85,18 @@ export declare function resolveSectionPlayerRuntimeState(args: RuntimeInputs): {
|
|
|
61
85
|
loaderOptions: {
|
|
62
86
|
[x: string]: unknown;
|
|
63
87
|
};
|
|
64
|
-
loaderConfig?: import('@pie-players/pie-players-shared').LoaderConfig;
|
|
65
88
|
hosted: boolean;
|
|
89
|
+
loaderConfig?: import('@pie-players/pie-players-shared').LoaderConfig;
|
|
90
|
+
backend?: Record<string, unknown> | null;
|
|
66
91
|
} | {
|
|
67
92
|
loaderOptions: {
|
|
68
93
|
[x: string]: unknown;
|
|
69
94
|
};
|
|
95
|
+
hosted?: boolean;
|
|
70
96
|
loaderConfig?: import('@pie-players/pie-players-shared').LoaderConfig;
|
|
71
|
-
|
|
97
|
+
backend?: Record<string, unknown> | null;
|
|
72
98
|
};
|
|
73
99
|
resolvedPlayerEnv: Record<string, unknown>;
|
|
74
100
|
strategy: import('@pie-players/pie-players-shared').ItemPlayerStrategy;
|
|
75
101
|
};
|
|
76
102
|
};
|
|
77
|
-
/**
|
|
78
|
-
* Fold a layout element's presentation convenience attributes — `nds-icons` and
|
|
79
|
-
* `locale` — into the `runtime` config handed to the kernel.
|
|
80
|
-
*
|
|
81
|
-
* Only injects an attribute that is explicitly set, so an unset one never
|
|
82
|
-
* clobbers a value the host put on `runtime`; when both are present, `runtime`
|
|
83
|
-
* wins (spread last). Returns the input unchanged when neither is set, which
|
|
84
|
-
* keeps `kernelRuntime` referentially stable for a host that supplies neither.
|
|
85
|
-
*/
|
|
86
|
-
export declare function mergeLayoutAttrsIntoRuntime(runtime: RuntimeConfig | null, attrs: {
|
|
87
|
-
ndsIcons?: boolean;
|
|
88
|
-
locale?: string;
|
|
89
|
-
}): RuntimeConfig | null;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ToolRegistry, ToolbarItem } from '@pie-players/pie-assessment-toolkit';
|
|
2
|
+
import { ItemEntity } from '@pie-players/pie-players-shared/types';
|
|
3
|
+
import { SectionCompositionModel } from '../../controllers/types.js';
|
|
4
|
+
import { ElementPreloadErrorDetail, ElementPreloadRetryDetail } from './player-preload.js';
|
|
5
|
+
import { HeadingLevel } from './section-player-view-state.js';
|
|
6
|
+
export type SectionPlayerPaneKind = "items" | "passages";
|
|
7
|
+
/** Where the items pane's element pre-warm stands. */
|
|
8
|
+
export type SectionPlayerPaneWarmup = "pending" | "loaded" | "failed";
|
|
9
|
+
export type SectionPlayerPaneReport = {
|
|
10
|
+
warmup: SectionPlayerPaneWarmup;
|
|
11
|
+
/** The renderables signature the report was made for. */
|
|
12
|
+
renderablesSignature: string;
|
|
13
|
+
};
|
|
14
|
+
export type SectionPlayerLayoutContext = {
|
|
15
|
+
/** The layout element's tag, which labels the items pane's preload reports. */
|
|
16
|
+
componentTag: string;
|
|
17
|
+
items: SectionCompositionModel["items"];
|
|
18
|
+
passages: SectionCompositionModel["passages"];
|
|
19
|
+
compositionModel: SectionCompositionModel;
|
|
20
|
+
preloadedRenderables: ItemEntity[];
|
|
21
|
+
preloadedRenderablesSignature: string;
|
|
22
|
+
preloadEnabled: boolean;
|
|
23
|
+
resolvedPlayerEnv: Record<string, unknown>;
|
|
24
|
+
resolvedPlayerAttributes: Record<string, string>;
|
|
25
|
+
resolvedPlayerProps: Record<string, unknown>;
|
|
26
|
+
playerStrategy: string;
|
|
27
|
+
baseHeadingLevel: HeadingLevel;
|
|
28
|
+
iifeBundleHost: string | null;
|
|
29
|
+
toolRegistry: ToolRegistry;
|
|
30
|
+
itemToolbarTools: string;
|
|
31
|
+
passageToolbarTools: string;
|
|
32
|
+
itemHostButtons: ToolbarItem[];
|
|
33
|
+
passageHostButtons: ToolbarItem[];
|
|
34
|
+
/**
|
|
35
|
+
* Whether the items pane's element pre-warm has resolved for the current
|
|
36
|
+
* composition; the passages pane shows its loading card until it has.
|
|
37
|
+
*/
|
|
38
|
+
elementsLoaded: boolean;
|
|
39
|
+
/** The pane of each kind that renders. */
|
|
40
|
+
activePanes: Readonly<Record<SectionPlayerPaneKind, Element | null>>;
|
|
41
|
+
/** Returns the unregister. */
|
|
42
|
+
registerPane: (kind: SectionPlayerPaneKind, pane: Element) => () => void;
|
|
43
|
+
/** Reports from any pane but the active items pane are ignored. */
|
|
44
|
+
reportWarmup: (pane: Element, report: SectionPlayerPaneReport) => void;
|
|
45
|
+
reportPreloadRetry: (pane: Element, detail: ElementPreloadRetryDetail) => void;
|
|
46
|
+
reportPreloadError: (pane: Element, detail: ElementPreloadErrorDetail) => void;
|
|
47
|
+
};
|
|
48
|
+
export declare const sectionPlayerLayoutContext: {
|
|
49
|
+
__context__: SectionPlayerLayoutContext;
|
|
50
|
+
};
|
|
51
|
+
export declare function connectSectionPlayerLayoutContext(host: HTMLElement, onValue: (value: SectionPlayerLayoutContext) => void): () => void;
|
|
52
|
+
/**
|
|
53
|
+
* A pane that subscribes before this provider connects is answered through the
|
|
54
|
+
* document's context root, which replays its request when the provider
|
|
55
|
+
* announces itself.
|
|
56
|
+
*/
|
|
57
|
+
export declare function createSectionPlayerLayoutContextProvider(host: HTMLElement, initialValue: SectionPlayerLayoutContext): {
|
|
58
|
+
setValue: (value: SectionPlayerLayoutContext) => void;
|
|
59
|
+
disconnect: () => void;
|
|
60
|
+
};
|
|
61
|
+
export type SectionPlayerPaneRegistry = {
|
|
62
|
+
register: (kind: SectionPlayerPaneKind, pane: Element) => () => void;
|
|
63
|
+
active: () => Record<SectionPlayerPaneKind, Element | null>;
|
|
64
|
+
dispose: () => void;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* The panes registered with one section player, in registration order.
|
|
68
|
+
*
|
|
69
|
+
* `onChange` receives the active pane of each kind after every change. A second
|
|
70
|
+
* pane of a kind still registered a task later is a layout that renders the
|
|
71
|
+
* kind twice, reported once per registry through `warn`; the deferral lets a
|
|
72
|
+
* layout replace a pane without being reported.
|
|
73
|
+
*/
|
|
74
|
+
export declare function createSectionPlayerPaneRegistry(options: {
|
|
75
|
+
onChange: (active: Record<SectionPlayerPaneKind, Element | null>) => void;
|
|
76
|
+
warn?: (message: string) => void;
|
|
77
|
+
}): SectionPlayerPaneRegistry;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether an event that reached a layout host belongs to that section player.
|
|
3
|
+
*
|
|
4
|
+
* The runtime engine dispatches its events on the host. The toolkit's
|
|
5
|
+
* `framework-error` bubbles out of the player's own `<pie-section-player-base>`,
|
|
6
|
+
* the first one in the host's render root: its light DOM, or the shadow root
|
|
7
|
+
* of a host that has one, where the event arrives retargeted to the host. An
|
|
8
|
+
* event from a player nested in an item reaches the host with another target.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isOwnSectionPlayerEvent(event: Event, host: Element): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LoadingCompleteHandler, StageChangeHandler } from '@pie-players/pie-assessment-toolkit/runtime/
|
|
1
|
+
import { LoadingCompleteHandler, StageChangeHandler } from '@pie-players/pie-assessment-toolkit/runtime/engine';
|
|
2
2
|
export type RuntimeCallbackBridgeChannel = "onStageChange" | "onLoadingComplete";
|
|
3
3
|
export interface RuntimeCallbackBridgeOptions {
|
|
4
4
|
/** Layout CE host element the engine dispatches DOM events on. */
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The three shells — vertical, tabbed, split-pane — differ in how they arrange
|
|
5
5
|
* panes and in nothing else at this level: each clamps the same host-configurable
|
|
6
|
-
* pixel values
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* pixel values and watches the same narrow-layout media query. That was copied
|
|
7
|
+
* three times, so a changed clamp bound reached whichever shells someone
|
|
8
|
+
* remembered.
|
|
9
9
|
*
|
|
10
10
|
* What cannot be shared, and is not this module's failure: the `props` map inside
|
|
11
11
|
* `<svelte:options customElement={{…}}>`. The Svelte compiler rejects anything but
|
|
@@ -35,14 +35,6 @@ export declare function resolveContentMaxWidths(contentMaxWidthNoPassage: unknow
|
|
|
35
35
|
noPassagePx: number | undefined;
|
|
36
36
|
withPassagePx: number | undefined;
|
|
37
37
|
};
|
|
38
|
-
/**
|
|
39
|
-
* The custom element hosting this shell, reached from the shell's anchor node.
|
|
40
|
-
*
|
|
41
|
-
* Through `getRootNode` so it works whether the shell renders into a shadow root
|
|
42
|
-
* or into light DOM, which these shells do (`shadow: "none"`, so item-player and
|
|
43
|
-
* runtime styles can cascade into rendered item content).
|
|
44
|
-
*/
|
|
45
|
-
export declare function getShellHostElement(anchor: HTMLElement | null): HTMLElement | null;
|
|
46
38
|
/**
|
|
47
39
|
* Track whether the viewport is below the shell's narrow-layout breakpoint.
|
|
48
40
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ItemEntity } from '@pie-players/pie-players-shared/types';
|
|
1
|
+
import { ItemEntity, ItemSettings } from '@pie-players/pie-players-shared/types';
|
|
2
2
|
import { FormativeItemView } from '@pie-players/pie-players-shared/formative';
|
|
3
3
|
import { SectionCompositionModel } from '../../controllers/types.js';
|
|
4
4
|
import { PlayerElementParams } from './player-action.js';
|
|
@@ -101,3 +101,8 @@ export declare function getCanonicalItemId(args: {
|
|
|
101
101
|
compositionModel: SectionCompositionModel;
|
|
102
102
|
item: ItemEntity;
|
|
103
103
|
}): string;
|
|
104
|
+
/** The policy settings the item's card registers through its item scope. */
|
|
105
|
+
export declare function getItemSettings(args: {
|
|
106
|
+
compositionModel: SectionCompositionModel;
|
|
107
|
+
item: ItemEntity;
|
|
108
|
+
}): ItemSettings | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The section controller lookups behind `waitForSectionController`.
|
|
3
|
+
*
|
|
4
|
+
* The toolkit emits `toolkit-ready` each time it initializes a section, once
|
|
5
|
+
* that section's controller has resolved: the first section, each switch and
|
|
6
|
+
* each update to the current one. The event bubbles, composed, through every
|
|
7
|
+
* element around it.
|
|
8
|
+
* A wait listens for it on `target` and looks the controller up again each time
|
|
9
|
+
* it arrives, then once more at the timeout.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Resolves with the first controller `lookup` returns after a `toolkit-ready`
|
|
13
|
+
* reaches `target`, or with what it returns at `timeoutMs`. A `timeoutMs` that
|
|
14
|
+
* is not finite, or too long for a timer, waits for the event alone.
|
|
15
|
+
*/
|
|
16
|
+
export declare function waitForToolkitReady<Controller>(target: EventTarget | null, lookup: (event?: Event) => Controller | null, timeoutMs: number): Promise<Controller | null>;
|
|
@@ -2,22 +2,14 @@ import { SectionPlayerCardTitleFormatter } from './card-title-formatters.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Host-extension hook contract for the section-player layout custom elements.
|
|
4
4
|
*
|
|
5
|
-
* Hosts pass a `SectionPlayerHostHooks` value
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* host. Each hook is optional; omitted hooks fall back to documented defaults.
|
|
5
|
+
* Hosts pass a `SectionPlayerHostHooks` value as the `hooks` JS property on
|
|
6
|
+
* `<pie-section-player-*>` to override formatter / decoration behavior that
|
|
7
|
+
* the engine intentionally leaves to the host. Each hook is optional; omitted
|
|
8
|
+
* hooks fall back to documented defaults.
|
|
10
9
|
*
|
|
11
10
|
* Today the contract has a single member (`cardTitleFormatter`). The shape is
|
|
12
11
|
* intentionally a struct, not a single callback prop, so future host-supplied
|
|
13
12
|
* formatters / decorators can be added without renaming the surface.
|
|
14
|
-
*
|
|
15
|
-
* The naming/expansion of this contract is part of the
|
|
16
|
-
* "Coherent Options Surface" review; the broader expansion (additional hook
|
|
17
|
-
* fields produced as the section host runtime engine consolidates) is owned
|
|
18
|
-
* by the M7 follow-up plan in `coherent_options_surface_review_0133a7cd.plan.md`.
|
|
19
|
-
* Keeping the current name (`SectionPlayerHostHooks`) is deliberate so that
|
|
20
|
-
* additions there do not require a breaking rename across the layout CEs.
|
|
21
13
|
*/
|
|
22
14
|
export type SectionPlayerHostHooks = {
|
|
23
15
|
cardTitleFormatter?: SectionPlayerCardTitleFormatter;
|
|
File without changes
|
|
@@ -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;
|
|
File without changes
|
|
@@ -14,7 +14,10 @@ export declare class SectionController implements SectionControllerHandle {
|
|
|
14
14
|
private readonly listeners;
|
|
15
15
|
private readonly trackedRenderables;
|
|
16
16
|
private readonly loadedRenderableKeys;
|
|
17
|
+
private readonly heldContentLoads;
|
|
17
18
|
private readonly itemCompletionByCanonicalId;
|
|
19
|
+
private readonly elementCompletionByCanonicalId;
|
|
20
|
+
private readonly reportedCompletionIds;
|
|
18
21
|
private sectionLoadingComplete;
|
|
19
22
|
private totalRegistered;
|
|
20
23
|
private totalLoaded;
|
|
@@ -254,6 +257,7 @@ export declare class SectionController implements SectionControllerHandle {
|
|
|
254
257
|
applySession(session: SectionControllerSessionState | null, options?: {
|
|
255
258
|
mode?: "replace" | "merge";
|
|
256
259
|
}): Promise<void>;
|
|
260
|
+
private applySessionState;
|
|
257
261
|
/**
|
|
258
262
|
* Move between items inside the current section only.
|
|
259
263
|
* Cross-section navigation belongs to the higher-level assessment player.
|
|
@@ -295,7 +299,17 @@ export declare class SectionController implements SectionControllerHandle {
|
|
|
295
299
|
private toSectionContentKind;
|
|
296
300
|
private getRenderableKey;
|
|
297
301
|
private readCompleteFromSession;
|
|
302
|
+
private sessionHoldsResponse;
|
|
303
|
+
/**
|
|
304
|
+
* `restored` names the items a host session was just applied to: what their
|
|
305
|
+
* elements reported before it describes the session the restore replaced.
|
|
306
|
+
*/
|
|
298
307
|
private bootstrapCompletionFromSessions;
|
|
308
|
+
/**
|
|
309
|
+
* The item's completion after one element reports its own. A report that
|
|
310
|
+
* names no element is the item's completion itself.
|
|
311
|
+
*/
|
|
312
|
+
private recordElementCompletion;
|
|
299
313
|
private updateItemCompleteState;
|
|
300
314
|
private emitSectionItemsCompleteIfChanged;
|
|
301
315
|
private evaluateSectionLoadingState;
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export type { SectionControllerContext, SectionControllerEvent, SectionControllerEventType, SectionControllerHandle, SectionControllerKey, SectionControllerLoadedRenderable, SectionSessionPersistenceConfig, SectionSessionPersistenceStrategy, SectionControllerRuntimeState, SectionControllerSessionState, } from '@pie-players/pie-assessment-toolkit';
|
|
3
|
-
export type CoordinatorWithSectionControllers = ToolkitCoordinator & {
|
|
4
|
-
getOrCreateSectionController(args: {
|
|
5
|
-
sectionId: string;
|
|
6
|
-
attemptId?: string;
|
|
7
|
-
input?: unknown;
|
|
8
|
-
updateExisting?: boolean;
|
|
9
|
-
createDefaultController: () => SectionControllerHandle | Promise<SectionControllerHandle>;
|
|
10
|
-
}): Promise<SectionControllerHandle>;
|
|
11
|
-
disposeSectionController(args: {
|
|
12
|
-
sectionId: string;
|
|
13
|
-
attemptId?: string;
|
|
14
|
-
persistBeforeDispose?: boolean;
|
|
15
|
-
clearPersistence?: boolean;
|
|
16
|
-
}): Promise<void>;
|
|
17
|
-
};
|
|
1
|
+
export type { SectionControllerHandle, SectionSessionPersistenceConfig, SectionControllerRuntimeState, SectionControllerSessionState, } from '@pie-players/pie-assessment-toolkit';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TestAttemptSession } from '@pie-players/pie-assessment-toolkit';
|
|
2
|
-
import { ItemSessionUpdateIntent, AssessmentItemRef, AssessmentSection, ItemEntity, PassageEntity, RubricBlock } from '@pie-players/pie-players-shared';
|
|
3
|
-
import { ConfigContainerEntity } from '@pie-players/pie-players-shared/types';
|
|
2
|
+
import { ItemSessionUpdateIntent, SessionCommitReason, AssessmentItemRef, AssessmentSection, ItemEntity, PassageEntity, RubricBlock } from '@pie-players/pie-players-shared';
|
|
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,15 +121,11 @@ export interface SectionCanonicalItemViewModel {
|
|
|
119
121
|
index: number;
|
|
120
122
|
isCurrent: boolean;
|
|
121
123
|
session: unknown;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
export interface SectionCanonicalSessionViewModel {
|
|
129
|
-
currentItemIndex: number;
|
|
130
|
-
itemSessionsByCanonicalId: Record<string, 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;
|
|
131
129
|
}
|
|
132
130
|
export interface SectionAttemptSessionSliceLoadedRenderable {
|
|
133
131
|
itemId: string;
|
|
@@ -160,6 +158,8 @@ export interface SessionChangedResult {
|
|
|
160
158
|
intent?: ItemSessionUpdateIntent;
|
|
161
159
|
complete?: boolean;
|
|
162
160
|
component?: string;
|
|
161
|
+
elementId?: string;
|
|
162
|
+
sessionCommitReason?: SessionCommitReason;
|
|
163
163
|
timestamp: number;
|
|
164
164
|
};
|
|
165
165
|
}
|
|
@@ -197,15 +197,29 @@ export interface ItemSessionDataChangedEvent extends ItemScopedControllerEventBa
|
|
|
197
197
|
canonicalItemId: string;
|
|
198
198
|
session: unknown;
|
|
199
199
|
intent?: ItemSessionUpdateIntent;
|
|
200
|
+
/** The reported completion: the element's own when `elementId` is set. */
|
|
200
201
|
complete?: boolean;
|
|
201
202
|
component?: string;
|
|
203
|
+
/** The id of the element that reported, when the change names one. */
|
|
204
|
+
elementId?: string;
|
|
205
|
+
/** The controller input's `sectionId`. */
|
|
206
|
+
sectionId?: string;
|
|
207
|
+
/** Set when the change is a commit at a teardown, navigation or page-hidden seam. */
|
|
208
|
+
sessionCommitReason?: SessionCommitReason;
|
|
202
209
|
}
|
|
203
210
|
export interface ItemSessionMetaChangedEvent extends ItemScopedControllerEventBase {
|
|
204
211
|
type: "item-session-meta-changed";
|
|
205
212
|
itemId: string;
|
|
206
213
|
canonicalItemId: string;
|
|
214
|
+
/** The reported completion: the element's own when `elementId` is set. */
|
|
207
215
|
complete?: boolean;
|
|
208
216
|
component?: string;
|
|
217
|
+
/** The id of the element that reported, when the change names one. */
|
|
218
|
+
elementId?: string;
|
|
219
|
+
/** The controller input's `sectionId`. */
|
|
220
|
+
sectionId?: string;
|
|
221
|
+
/** Set when the change is a commit at a teardown, navigation or page-hidden seam. */
|
|
222
|
+
sessionCommitReason?: SessionCommitReason;
|
|
209
223
|
}
|
|
210
224
|
export interface ItemSelectedEvent extends ItemScopedControllerEventBase {
|
|
211
225
|
type: "item-selected";
|
|
@@ -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 {
|
|
6
|
-
export
|
|
7
|
-
export {
|
|
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';
|