@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.
- package/README.md +862 -866
- package/custom-elements.json +3922 -0
- package/dist/browser/assets/{evaluation-worker-DkU_wGh3.js → evaluation-worker-0xRDVTJx.js} +98934 -88735
- package/dist/browser/chunks/PUA-tLuTiQ7--f2b27953.js +1 -1
- package/dist/browser/chunks/ToolCoordinator-0a6c4088.js +1 -0
- package/dist/browser/chunks/accents-BTUYmhn9-cafeb96e.js +1 -1
- package/dist/browser/chunks/accents-b-i-CngHZsLL-e0eb98fd.js +1 -1
- package/dist/browser/chunks/arabic-BzEHMVZD-30ac1ade.js +1 -1
- package/dist/browser/chunks/arrows-VjxlU-jv-2e17c192.js +1 -1
- package/dist/browser/chunks/attribute-coercion-b93b482c.js +1 -0
- package/dist/browser/chunks/braille-BeWC_Ruq-a3bb8ef9.js +1 -1
- package/dist/browser/chunks/braille-d-Dk6J96GO-d832bfbf.js +1 -1
- package/dist/browser/chunks/browser-a3c32178.js +17 -16
- package/dist/browser/chunks/calculator-element-271c142f.js +11 -8
- package/dist/browser/chunks/calligraphic-Cew9cU3x-04cf0735.js +1 -1
- 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 -1
- package/dist/browser/chunks/classPrivateFieldGet2-338e0179.js +1 -1
- package/dist/browser/chunks/classPrivateMethodInitSpec-563cd0a5.js +1 -0
- package/dist/browser/chunks/cyrillic-CfCDulXU-5550df0b.js +1 -1
- package/dist/browser/chunks/cyrillic-ss-lU7bNGG9-12eb0188.js +1 -1
- package/dist/browser/chunks/devanagari-CDIz2h-r-18c38725.js +1 -1
- package/dist/browser/chunks/dist-41b39e7f.js +1 -1
- package/dist/browser/chunks/dist-59132a53.js +1 -1
- package/dist/browser/chunks/dist-60d7afef.js +1 -1
- package/dist/browser/chunks/dist-ca9b9622.js +1 -1
- package/dist/browser/chunks/double-struck-BpJEQk8y-500ce8dd.js +1 -1
- package/dist/browser/chunks/focus-trap-44913bf3.js +1 -1
- package/dist/browser/chunks/fraktur-rLEq9DEH-44cc14d8.js +1 -1
- package/dist/browser/chunks/greek-BlraJTyL-90ce8924.js +1 -1
- package/dist/browser/chunks/greek-ss-D-EN2PK0-91610739.js +1 -1
- package/dist/browser/chunks/hebrew-GiQZeybp-b583f555.js +1 -1
- package/dist/browser/chunks/latin-b-BhEnC7R2-d13e06ff.js +1 -1
- package/dist/browser/chunks/latin-bi-DqiIKv3U-1dec8705.js +1 -1
- package/dist/browser/chunks/latin-i-B1xtwaE1-21637466.js +1 -1
- package/dist/browser/chunks/latin-xfWFlLkD-5bcea5cf.js +1 -1
- package/dist/browser/chunks/logger-8b07fb72.js +1 -1
- package/dist/browser/chunks/marrows-DD1NgMQi-15b63755.js +1 -1
- package/dist/browser/chunks/math-DpWn1mbG-38eeb914.js +1 -1
- package/dist/browser/chunks/math-rendering-ready-9a0fd90a.js +1 -1
- package/dist/browser/chunks/{mathjax-D2JHb_R_-64780dc5.js → mathjax-BKrHE4xs-3ca05bf6.js} +41 -41
- package/dist/browser/chunks/monospace-D116QD2a-98d484fd.js +1 -1
- package/dist/browser/chunks/monospace-ex-DcXpouKS-456b403c.js +1 -1
- package/dist/browser/chunks/monospace-l-Ct5wkMDs-f34a4a9e.js +1 -1
- package/dist/browser/chunks/mshapes-DCp86WSX-c0055952.js +1 -1
- package/dist/browser/chunks/nl-NL-364d61b9.js +1 -1
- package/dist/browser/chunks/nl-NL-8b7e6d4b.js +1 -1
- package/dist/browser/chunks/phonetics-BwOCw2Y9-d2e3af59.js +1 -1
- package/dist/browser/chunks/phonetics-ss-CRtMn02f-579b6135.js +1 -1
- package/dist/browser/chunks/pie-api-client-687c319a.js +1 -1
- package/dist/browser/chunks/provider-4c704118.js +1 -1
- package/dist/browser/chunks/runtime-YFqnU6ic-d5c0cb49.js +8605 -0
- package/dist/browser/chunks/sans-serif-BYPZKlE9-2efdbcd9.js +1 -1
- package/dist/browser/chunks/sans-serif-b-B0kRKiC--b5530dce.js +1 -1
- package/dist/browser/chunks/sans-serif-bi-DXWul6mu-5370dba4.js +1 -1
- package/dist/browser/chunks/sans-serif-ex-Boux1kMP-aa178f31.js +1 -1
- package/dist/browser/chunks/sans-serif-i-676RFaSO-2db54474.js +1 -1
- package/dist/browser/chunks/sans-serif-r-DrN9xdZt-0fc72eea.js +1 -1
- package/dist/browser/chunks/script-0ohehnXc-526904f4.js +1 -1
- package/dist/browser/chunks/shapes-BG47NodJ-d59b0eca.js +1 -1
- package/dist/browser/chunks/{src-BcptuNS5-ed25d7fd.js → src-D_1goyPT-8cca0246.js} +81 -82
- package/dist/browser/chunks/{sre-engine-wf9s43gg-f09289c5.js → sre-0162a7a9.js} +18 -18
- package/dist/browser/chunks/sre-engine-ace23548.js +1 -0
- package/dist/browser/chunks/sre-engine-bj997w4b-891a4cbe.js +1 -0
- package/dist/browser/chunks/sre-locales-112320af.js +1 -0
- package/dist/browser/chunks/symbols-BqnUxf_t-83087e87.js +1 -1
- package/dist/browser/chunks/symbols-b-i-eg9k5hmF-9c461ac2.js +1 -1
- package/dist/browser/chunks/term-lookup-632cf6b1.js +1 -0
- package/dist/browser/chunks/tool-annotation-toolbar-997438b4.js +7 -6
- package/dist/browser/chunks/tool-answer-eliminator-35483abd.js +6 -6
- package/dist/browser/chunks/tool-color-scheme-b7de5cdf.js +5 -5
- package/dist/browser/chunks/tool-dictionary-cecff3b4.js +3 -3
- package/dist/browser/chunks/tool-graph-cb0338e8.js +6 -6
- package/dist/browser/chunks/tool-host-contract-fae1c415.js +1 -0
- package/dist/browser/chunks/tool-instance-id-76ac45e2.js +1 -0
- package/dist/browser/chunks/tool-line-reader-f8ef3c6a.js +3 -3
- package/dist/browser/chunks/tool-periodic-table-43b133b8.js +13 -16
- package/dist/browser/chunks/tool-picture-dictionary-33721e91.js +3 -3
- package/dist/browser/chunks/tool-protractor-23f77028.js +6 -6
- package/dist/browser/chunks/tool-ruler-1d9a03a6.js +12 -9
- package/dist/browser/chunks/tool-tts-inline-98c2ce7a.js +27 -33
- package/dist/browser/chunks/toolbar-registration-helpers-a7ab1ad4.js +194 -0
- package/dist/browser/chunks/variants-2LRNhOUP-966fc49d.js +1 -1
- package/dist/browser/pie-section-player.js +210 -100
- package/dist/chunks/nl-NL-364d61b9.js +35 -30
- package/dist/chunks/{sre-engine-wf9s43gg-f09289c5.js → sre-engine-bj997w4b-891a4cbe.js} +1 -1
- package/dist/component-definitions.d.ts +0 -2
- package/dist/components/shared/card-media-region.d.ts +3 -4
- package/dist/components/shared/composition.d.ts +3 -1
- package/dist/components/shared/framework-error-latch.d.ts +34 -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 +12 -27
- package/dist/components/shared/missing-tool-providers.d.ts +6 -12
- package/dist/components/shared/player-preload.d.ts +4 -9
- package/dist/components/shared/section-player-backend-delivery.d.ts +1 -1
- package/dist/components/shared/section-player-card-context.d.ts +5 -4
- package/dist/components/shared/section-player-host-runtime.d.ts +32 -21
- 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 -2
- package/dist/components/shared/toolkit-ready-wait.d.ts +16 -0
- package/dist/contracts/host-hooks.d.ts +0 -7
- package/dist/contracts/runtime-host-contract.d.ts +0 -5
- package/dist/controllers/SectionController.d.ts +21 -6
- package/dist/controllers/types.d.ts +8 -1
- 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 +24965 -25463
- package/dist/policies/index.d.ts +1 -19
- package/dist/policies/index.js +6 -14
- package/dist/policies/types.d.ts +0 -4
- package/package.json +17 -55
- package/dist/browser/chunks/ToolCoordinator-cc2dc319.js +0 -1
- package/dist/browser/chunks/nds-icon-button-d602f784.js +0 -194
- package/dist/browser/chunks/pie-tool-calculator-cortex-0626bc24.js +0 -9
- package/dist/browser/chunks/pie-tool-calculator-geogebra-561236cb.js +0 -9
- package/dist/browser/chunks/runtime-C7H1jS4E-64772f5e.js +0 -8413
- package/dist/browser/chunks/tool-host-contract-b93b482c.js +0 -1
- 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-contract.js +0 -0
- package/dist/contracts/layout-parity-metadata.d.ts +0 -4
- package/dist/contracts/layout-parity-metadata.js +0 -87
- package/dist/contracts/public-events.d.ts +0 -92
- package/dist/contracts/public-events.js +0 -12
- package/dist/policies/guards.d.ts +0 -2
- /package/dist/browser/chunks/{ItemToolBar-wr2myaah-2ce4b643.js → ItemToolBar-66hcwmfw-3bcb82a3.js} +0 -0
- /package/dist/chunks/{ItemToolBar-wr2myaah-1287ba31.js → ItemToolBar-66hcwmfw-1287ba31.js} +0 -0
|
@@ -306,44 +306,20 @@ var e = {
|
|
|
306
306
|
textToSpeech: {
|
|
307
307
|
name: "Voorlezen",
|
|
308
308
|
description: "Inhoud laten voorlezen",
|
|
309
|
-
|
|
310
|
-
title: "Voorlezen",
|
|
311
|
-
initializing: "Wordt gestart…",
|
|
312
|
-
initFailed: "Voorlezen kon niet worden gestart.",
|
|
313
|
-
selectText: "Selecteer tekst op de pagina om die te laten voorlezen.",
|
|
314
|
-
speed: "Snelheid:",
|
|
315
|
-
play: "Voorlezen",
|
|
316
|
-
pause: "Pauzeren",
|
|
317
|
-
resume: "Hervatten",
|
|
318
|
-
stop: "Stoppen",
|
|
319
|
-
speaking: "Aan het voorlezen…",
|
|
320
|
-
paused: "Gepauzeerd",
|
|
321
|
-
charactersSelected: {
|
|
322
|
-
one: "{count} teken geselecteerd",
|
|
323
|
-
other: "{count} tekens geselecteerd"
|
|
324
|
-
},
|
|
325
|
-
rate: {
|
|
326
|
-
slow: "Langzaam",
|
|
327
|
-
slower: "Langzamer",
|
|
328
|
-
normal: "Normaal",
|
|
329
|
-
faster: "Sneller",
|
|
330
|
-
fast: "Snel",
|
|
331
|
-
veryFast: "Zeer snel"
|
|
332
|
-
},
|
|
309
|
+
initFailed: "Voorlezen kon niet worden gestart. Probeer het opnieuw.",
|
|
333
310
|
inline: {
|
|
334
311
|
controlsA11y: "Voorleesknoppen",
|
|
335
312
|
playbackSpeedA11y: "Voorleessnelheid",
|
|
336
313
|
rewindA11y: "Terugspoelen",
|
|
337
314
|
fastForwardA11y: "Vooruitspoelen",
|
|
338
315
|
stopA11y: "Voorlezen stoppen",
|
|
339
|
-
initializing: "Voorlezen wordt gestart",
|
|
340
|
-
initFailed: "Voorlezen kon niet worden gestart. Probeer het opnieuw.",
|
|
341
316
|
starting: "Voorlezen wordt gestart",
|
|
342
317
|
started: "Voorlezen gestart",
|
|
343
318
|
resumed: "Voorlezen hervat",
|
|
344
319
|
pausedAnnouncement: "Voorlezen gepauzeerd",
|
|
345
320
|
stopped: "Voorlezen gestopt",
|
|
346
321
|
switchedSection: "Het voorlezen is naar een ander onderdeel gegaan",
|
|
322
|
+
nothingToRead: "Hier is niets om voor te lezen",
|
|
347
323
|
startFailed: "Voorlezen kon niet worden gestart",
|
|
348
324
|
skippedForward: "Vooruitgespoeld",
|
|
349
325
|
skipForwardFailed: "Vooruitspoelen is niet gelukt",
|
|
@@ -423,6 +399,7 @@ var e = {
|
|
|
423
399
|
pnp: {
|
|
424
400
|
title: "PNP-profiel",
|
|
425
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.",
|
|
426
403
|
determinationReadOnly: "Vaststelling (alleen lezen)",
|
|
427
404
|
toolsEditor: "Hulpmiddelen bewerken",
|
|
428
405
|
enforcement: "PNP-handhaving",
|
|
@@ -435,6 +412,7 @@ var e = {
|
|
|
435
412
|
resolvedTools: "Toegekende hulpmiddelen (toolkit)",
|
|
436
413
|
provenanceSummary: "Overzicht van herkomst van het hulpmiddelenbeleid",
|
|
437
414
|
perToolDecisions: "Beslissingen per hulpmiddel",
|
|
415
|
+
policyDiagnostics: "Diagnose van het hulpmiddelenbeleid",
|
|
438
416
|
profileReadOnly: "PNP-profiel (alleen lezen)"
|
|
439
417
|
},
|
|
440
418
|
tts: {
|
|
@@ -497,12 +475,39 @@ var e = {
|
|
|
497
475
|
previewEnterText: "Voer eerst voorbeeldtekst in.",
|
|
498
476
|
previewUnavailable: "Een voorbeeld is niet mogelijk zolang deze dienst niet beschikbaar is.",
|
|
499
477
|
browserSynthesisUnavailable: "Spraaksynthese van de browser is niet beschikbaar.",
|
|
500
|
-
browserSynthesisEndedEarly: "De spraaksynthese van de browser stopte voordat de audio begon. Start de browser opnieuw en probeer het nog eens.",
|
|
501
|
-
browserSynthesisQueueFailed: "De spraaksynthese van de browser kon het voorbeeldfragment niet in de wachtrij zetten.",
|
|
502
|
-
browserPreviewFailed: "Het voorbeeld van de browserstem kon niet worden afgespeeld.",
|
|
503
478
|
ssmlWordTrackingDisabled: "Bij een Google SSML-voorbeeld blijft de SSML uit de bron intact, waardoor woordmarkering is uitgeschakeld.",
|
|
504
479
|
applyUnavailable: "Instellingen toepassen is niet mogelijk zolang deze dienst niet beschikbaar is.",
|
|
505
|
-
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."
|
|
506
511
|
}
|
|
507
512
|
}
|
|
508
513
|
};
|
|
@@ -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.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
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,7 +1,9 @@
|
|
|
1
|
-
import { ItemEntity } from '@pie-players/pie-players-shared/types';
|
|
1
|
+
import { ItemEntity, ItemSettings } from '@pie-players/pie-players-shared/types';
|
|
2
2
|
import { SectionCompositionModel } from '../../controllers/types.js';
|
|
3
3
|
export declare const EMPTY_ITEM_SESSION: Record<string, unknown>;
|
|
4
4
|
export declare const EMPTY_COMPOSITION: SectionCompositionModel;
|
|
5
5
|
export declare function getCanonicalItemIdForItem(compositionModel: SectionCompositionModel, item: ItemEntity): string;
|
|
6
|
+
/** The item's policy settings from its assessment item reference. */
|
|
7
|
+
export declare function getItemSettingsForItem(compositionModel: SectionCompositionModel, item: ItemEntity): ItemSettings | null;
|
|
6
8
|
export declare function getSessionForItem(compositionModel: SectionCompositionModel, item: ItemEntity): unknown;
|
|
7
9
|
export declare function getSessionForItemOrEmpty(compositionModel: SectionCompositionModel, item: ItemEntity): Record<string, unknown>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FrameworkErrorModel } from '@pie-players/pie-assessment-toolkit';
|
|
2
|
+
import { CohortKey } from '@pie-players/pie-assessment-toolkit/runtime/engine';
|
|
3
|
+
/**
|
|
4
|
+
* The section player's readiness error latch. A non-recoverable framework error
|
|
5
|
+
* latches the scope its report site set: a `cohort` error fails the section it
|
|
6
|
+
* was reported for and clears when the cohort rolls; a `runtime` error fails
|
|
7
|
+
* every later section, since they run on the same coordinator. A recoverable
|
|
8
|
+
* error latches nothing, and neither does a `cohort` error that names another
|
|
9
|
+
* section: that section failed after the learner left it.
|
|
10
|
+
*
|
|
11
|
+
* A toolkit bootstrap failure is a runtime error held against the coordinator
|
|
12
|
+
* the toolkit had announced when it was reported. It clears when the toolkit
|
|
13
|
+
* announces a different one, which it builds once the host corrects the input
|
|
14
|
+
* that failed: the coordinator the failure took down is no longer the one later
|
|
15
|
+
* sections run on.
|
|
16
|
+
*
|
|
17
|
+
* `element-preload` latches nothing either. The items pane reports its warmup
|
|
18
|
+
* outcome with the composition it was for, and the kernel reads that instead: a
|
|
19
|
+
* latched event cannot tell which section's warmup failed.
|
|
20
|
+
*/
|
|
21
|
+
export type FrameworkErrorLatch = {
|
|
22
|
+
readonly cohort: boolean;
|
|
23
|
+
readonly runtime: boolean;
|
|
24
|
+
/** The coordinator a bootstrap failure was reported under, while one is latched. */
|
|
25
|
+
readonly bootstrap: {
|
|
26
|
+
readonly coordinator: unknown;
|
|
27
|
+
} | null;
|
|
28
|
+
};
|
|
29
|
+
export declare const CLEAR_FRAMEWORK_ERROR_LATCH: FrameworkErrorLatch;
|
|
30
|
+
export declare function latchFrameworkError(latch: FrameworkErrorLatch, detail: Pick<FrameworkErrorModel, "recoverable" | "scope" | "kind" | "cohort"> | null | undefined, coordinator: unknown, current: CohortKey | null): FrameworkErrorLatch;
|
|
31
|
+
export declare function rollFrameworkErrorLatch(latch: FrameworkErrorLatch): FrameworkErrorLatch;
|
|
32
|
+
/** Applied on each `toolkit-ready`, with the coordinator it announces. */
|
|
33
|
+
export declare function announceToolkitCoordinator(latch: FrameworkErrorLatch, coordinator: unknown): FrameworkErrorLatch;
|
|
34
|
+
export declare function isFrameworkErrorLatched(latch: FrameworkErrorLatch): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The custom element a component renders into, reached from an anchor node at
|
|
3
|
+
* the top of its template.
|
|
4
|
+
*
|
|
5
|
+
* The anchor's parent node: the element itself under `shadow: "none"`, or its
|
|
6
|
+
* shadow root otherwise. The anchor's root node names the host only in the second
|
|
7
|
+
* case. A light-DOM element inside another component's shadow root shares that
|
|
8
|
+
* root, so resolving through `getRootNode()` returned the outer component.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getHostElementFromAnchor(anchor: HTMLElement | null): HTMLElement | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The kernel host's default body: its stock arrangement of the panes, present
|
|
3
|
+
* exactly while the host gives the element no element children of its own.
|
|
4
|
+
*
|
|
5
|
+
* Mounted into the element's light DOM, beside any children, where the player's
|
|
6
|
+
* item content renders in every layout: that is where page styles, the content
|
|
7
|
+
* stylesheet and the item players' own injected styles reach it. As fallback
|
|
8
|
+
* content of the shadow root's slot it would sit in the shadow tree, out of their
|
|
9
|
+
* reach, and stay mounted, hidden, beside a host's own panes.
|
|
10
|
+
*
|
|
11
|
+
* Text and comment children do not count, so markup whitespace and a framework's
|
|
12
|
+
* placeholder comments leave the default in place. Returns the teardown.
|
|
13
|
+
*/
|
|
14
|
+
export declare function attachKernelHostDefaultBody(host: HTMLElement, mountBody: (target: HTMLElement) => () => void): () => void;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import { SectionControllerHandle } from '@pie-players/pie-assessment-toolkit';
|
|
2
|
-
import {
|
|
3
|
-
export declare const BOOTSTRAP_READINESS: {
|
|
4
|
-
readonly phase: "bootstrapping";
|
|
5
|
-
readonly interactionReady: false;
|
|
6
|
-
readonly allLoadingComplete: false;
|
|
7
|
-
};
|
|
1
|
+
import { SectionControllerHandle, SectionControllerSessionState } from '@pie-players/pie-assessment-toolkit';
|
|
2
|
+
import { SectionPlayerSnapshot } from '../../contracts/runtime-host-contract.js';
|
|
8
3
|
export declare const BOOTSTRAP_SNAPSHOT: {
|
|
9
|
-
readonly readiness: {
|
|
10
|
-
readonly phase: "bootstrapping";
|
|
11
|
-
readonly interactionReady: false;
|
|
12
|
-
readonly allLoadingComplete: false;
|
|
13
|
-
};
|
|
14
4
|
readonly composition: {
|
|
15
5
|
readonly itemsCount: 0;
|
|
16
6
|
readonly passagesCount: 0;
|
|
@@ -22,29 +12,24 @@ export declare const BOOTSTRAP_SNAPSHOT: {
|
|
|
22
12
|
readonly canPrevious: false;
|
|
23
13
|
};
|
|
24
14
|
};
|
|
25
|
-
/** What each read returns before the component mounts. */
|
|
26
|
-
export type UnmountedReads = {
|
|
27
|
-
snapshot: SectionPlayerSnapshot | null;
|
|
28
|
-
composition: SectionPlayerSnapshot["composition"] | null;
|
|
29
|
-
navigation: SectionPlayerNavigationSnapshot | null;
|
|
30
|
-
readiness: SectionPlayerSnapshot["readiness"] | null;
|
|
31
|
-
};
|
|
32
|
-
export declare const NULL_READS: UnmountedReads;
|
|
33
|
-
export declare const BOOTSTRAP_READS: UnmountedReads;
|
|
34
15
|
/**
|
|
35
|
-
* For a layout element's `customElement.extend`. `
|
|
36
|
-
* element's
|
|
16
|
+
* For a layout element's `customElement.extend`. `unmountedSnapshot` is what
|
|
17
|
+
* that element's `getSnapshot` returns while its kernel is not bound.
|
|
37
18
|
*/
|
|
38
|
-
export declare function withHostMethods(
|
|
19
|
+
export declare function withHostMethods(unmountedSnapshot: SectionPlayerSnapshot | null): <Base extends CustomElementConstructor>(ElementClass: Base) => {
|
|
39
20
|
new (...params: any[]): {
|
|
40
21
|
getSnapshot(): SectionPlayerSnapshot | null;
|
|
41
|
-
selectComposition(): SectionPlayerSnapshot["composition"] | null;
|
|
42
|
-
selectNavigation(): SectionPlayerNavigationSnapshot | null;
|
|
43
|
-
selectReadiness(): SectionPlayerSnapshot["readiness"] | null;
|
|
44
22
|
navigateTo(index: number): boolean;
|
|
45
23
|
navigateNext(): boolean;
|
|
46
24
|
navigatePrevious(): boolean;
|
|
47
25
|
getSectionController(): SectionControllerHandle | null;
|
|
26
|
+
/**
|
|
27
|
+
* A fresh snapshot on each read once the controller is published. The
|
|
28
|
+
* item player instead returns the host's own object, kept current by
|
|
29
|
+
* projection; no host reads a section session by reference.
|
|
30
|
+
*/
|
|
31
|
+
get session(): SectionControllerSessionState | null;
|
|
32
|
+
set session(value: SectionControllerSessionState | null);
|
|
48
33
|
waitForSectionController(timeoutMs?: number): Promise<SectionControllerHandle | null>;
|
|
49
34
|
accessKey: string;
|
|
50
35
|
readonly accessKeyLabel: string;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { ToolkitCoordinatorApi, ToolRegistry } from '@pie-players/pie-assessment-toolkit';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* Check `coordinator` now and whenever its policy inputs change, since placement
|
|
10
|
-
* can. A check runs once the coordinator reports ready: its providers have
|
|
11
|
-
* registered by then, and a text-to-speech reconfiguration, which unregisters and
|
|
12
|
-
* re-registers that provider, holds readiness until it is back. Readiness is
|
|
13
|
-
* polled because `waitUntilReady()` would start initialization a lazy
|
|
14
|
-
* coordinator defers, and retry one that failed. Returns the teardown.
|
|
3
|
+
* Check `coordinator` once it reports ready, and again whenever readiness or its
|
|
4
|
+
* policy inputs change, since placement can. Its providers have registered by
|
|
5
|
+
* then, and a text-to-speech reconfiguration, which unregisters and re-registers
|
|
6
|
+
* that provider, holds readiness until it is back. `waitUntilReady()` is not
|
|
7
|
+
* awaited: it would start text-to-speech a lazy coordinator defers, and retry
|
|
8
|
+
* one that failed. Returns the teardown.
|
|
15
9
|
*/
|
|
16
10
|
export declare function watchMissingToolProviders(coordinator: ToolkitCoordinatorApi, toolRegistry: ToolRegistry): () => void;
|
|
@@ -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,
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BackendConfig } from '@pie-players/pie-item-player';
|
|
2
|
-
import { PlayerOverrides, RuntimeConfig } from '@pie-players/pie-assessment-toolkit/runtime/
|
|
2
|
+
import { PlayerOverrides, RuntimeConfig } from '@pie-players/pie-assessment-toolkit/runtime/engine';
|
|
3
3
|
import { ItemEntity } from '@pie-players/pie-players-shared/types';
|
|
4
4
|
export type SectionPlayerBackendResolverContext = {
|
|
5
5
|
itemId: string;
|
|
@@ -5,11 +5,12 @@ 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
|
-
export declare function getHostElementFromAnchor(anchor: HTMLElement | null): HTMLElement | null;
|
|
12
8
|
export declare function connectSectionPlayerCardRenderContext(host: HTMLElement, onValue: (value: SectionPlayerCardRenderContext) => void): () => void;
|
|
9
|
+
/**
|
|
10
|
+
* A card that subscribes before this provider connects is answered through the
|
|
11
|
+
* document's context root, which replays its request when the provider
|
|
12
|
+
* announces itself.
|
|
13
|
+
*/
|
|
13
14
|
export declare function createSectionPlayerCardRenderContextProvider(host: HTMLElement, initialValue: SectionPlayerCardRenderContext): {
|
|
14
15
|
setValue: (value: SectionPlayerCardRenderContext) => void;
|
|
15
16
|
disconnect: () => void;
|
|
@@ -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,
|
|
@@ -14,21 +14,22 @@ 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: {
|
|
21
20
|
loaderOptions: {
|
|
22
21
|
[x: string]: unknown;
|
|
23
22
|
};
|
|
24
|
-
loaderConfig?: import('@pie-players/pie-players-shared').LoaderConfig;
|
|
25
23
|
hosted: boolean;
|
|
24
|
+
loaderConfig?: import('@pie-players/pie-players-shared').LoaderConfig;
|
|
25
|
+
backend?: Record<string, unknown> | null;
|
|
26
26
|
} | {
|
|
27
27
|
loaderOptions: {
|
|
28
28
|
[x: string]: unknown;
|
|
29
29
|
};
|
|
30
|
+
hosted?: boolean;
|
|
30
31
|
loaderConfig?: import('@pie-players/pie-players-shared').LoaderConfig;
|
|
31
|
-
|
|
32
|
+
backend?: Record<string, unknown> | null;
|
|
32
33
|
};
|
|
33
34
|
resolvedPlayerEnv: Record<string, unknown>;
|
|
34
35
|
strategy: import('@pie-players/pie-players-shared').ItemPlayerStrategy;
|
|
@@ -51,39 +52,49 @@ export declare function mapRenderablesToItems(renderables: unknown[]): ItemEntit
|
|
|
51
52
|
*/
|
|
52
53
|
export declare function resolveSectionPlayerRuntimeState(args: RuntimeInputs): {
|
|
53
54
|
effectiveToolsConfig: unknown;
|
|
54
|
-
effectiveRuntime:
|
|
55
|
+
effectiveRuntime: {
|
|
56
|
+
playerType: string;
|
|
57
|
+
player: {
|
|
58
|
+
hosted?: boolean;
|
|
59
|
+
loaderConfig?: import('@pie-players/pie-players-shared').LoaderConfig;
|
|
60
|
+
loaderOptions?: Record<string, unknown>;
|
|
61
|
+
backend?: Record<string, unknown> | null;
|
|
62
|
+
} | null;
|
|
63
|
+
lazyInit: boolean;
|
|
64
|
+
accessibility: Record<string, unknown> | null;
|
|
65
|
+
coordinator: {} | null;
|
|
66
|
+
createSectionController: unknown;
|
|
67
|
+
isolation: string;
|
|
68
|
+
env: Record<string, unknown>;
|
|
69
|
+
toolConfigStrictness: import('@pie-players/pie-assessment-toolkit').ToolConfigStrictness;
|
|
70
|
+
tools: unknown;
|
|
71
|
+
assessmentId?: string;
|
|
72
|
+
toolContextResolvers?: Record<string, unknown> | null;
|
|
73
|
+
contentLanguage?: string;
|
|
74
|
+
onFrameworkError?: import('@pie-players/pie-assessment-toolkit/runtime/engine').FrameworkErrorHandler;
|
|
75
|
+
onStageChange?: import('@pie-players/pie-assessment-toolkit/runtime/engine').StageChangeHandler;
|
|
76
|
+
onLoadingComplete?: import('@pie-players/pie-assessment-toolkit/runtime/engine').LoadingCompleteHandler;
|
|
77
|
+
};
|
|
55
78
|
playerRuntime: {
|
|
56
79
|
effectivePlayerType: string;
|
|
57
|
-
resolvedPlayerDefinition: import('../../component-definitions.js').ComponentDefinition;
|
|
58
80
|
resolvedPlayerTag: string;
|
|
59
81
|
resolvedPlayerAttributes: Record<string, string>;
|
|
60
82
|
resolvedPlayerProps: {
|
|
61
83
|
loaderOptions: {
|
|
62
84
|
[x: string]: unknown;
|
|
63
85
|
};
|
|
64
|
-
loaderConfig?: import('@pie-players/pie-players-shared').LoaderConfig;
|
|
65
86
|
hosted: boolean;
|
|
87
|
+
loaderConfig?: import('@pie-players/pie-players-shared').LoaderConfig;
|
|
88
|
+
backend?: Record<string, unknown> | null;
|
|
66
89
|
} | {
|
|
67
90
|
loaderOptions: {
|
|
68
91
|
[x: string]: unknown;
|
|
69
92
|
};
|
|
93
|
+
hosted?: boolean;
|
|
70
94
|
loaderConfig?: import('@pie-players/pie-players-shared').LoaderConfig;
|
|
71
|
-
|
|
95
|
+
backend?: Record<string, unknown> | null;
|
|
72
96
|
};
|
|
73
97
|
resolvedPlayerEnv: Record<string, unknown>;
|
|
74
98
|
strategy: import('@pie-players/pie-players-shared').ItemPlayerStrategy;
|
|
75
99
|
};
|
|
76
100
|
};
|
|
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';
|
|
@@ -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: {
|
|
@@ -101,3 +100,8 @@ export declare function getCanonicalItemId(args: {
|
|
|
101
100
|
compositionModel: SectionCompositionModel;
|
|
102
101
|
item: ItemEntity;
|
|
103
102
|
}): string;
|
|
103
|
+
/** The policy settings the item's card registers through its item scope. */
|
|
104
|
+
export declare function getItemSettings(args: {
|
|
105
|
+
compositionModel: SectionCompositionModel;
|
|
106
|
+
item: ItemEntity;
|
|
107
|
+
}): 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>;
|
|
@@ -10,13 +10,6 @@ import { SectionPlayerCardTitleFormatter } from './card-title-formatters.js';
|
|
|
10
10
|
* Today the contract has a single member (`cardTitleFormatter`). The shape is
|
|
11
11
|
* intentionally a struct, not a single callback prop, so future host-supplied
|
|
12
12
|
* formatters / decorators can be added without renaming the surface.
|
|
13
|
-
*
|
|
14
|
-
* The naming/expansion of this contract is part of the
|
|
15
|
-
* "Coherent Options Surface" review; the broader expansion (additional hook
|
|
16
|
-
* fields produced as the section host runtime engine consolidates) is owned
|
|
17
|
-
* by the M7 follow-up plan in `coherent_options_surface_review_0133a7cd.plan.md`.
|
|
18
|
-
* Keeping the current name (`SectionPlayerHostHooks`) is deliberate so that
|
|
19
|
-
* additions there do not require a breaking rename across the layout CEs.
|
|
20
13
|
*/
|
|
21
14
|
export type SectionPlayerHostHooks = {
|
|
22
15
|
cardTitleFormatter?: SectionPlayerCardTitleFormatter;
|