@pie-players/pie-section-player 0.2.12 → 0.2.14
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 +28 -568
- package/dist/component-definitions.d.ts +0 -3
- package/dist/component-definitions.d.ts.map +1 -1
- package/dist/components/section-player-vertical-element.d.ts +2 -0
- package/dist/components/section-player-vertical-element.d.ts.map +1 -0
- package/dist/components/shared/composition.d.ts +9 -0
- package/dist/components/shared/composition.d.ts.map +1 -0
- package/dist/components/shared/player-action.d.ts +18 -0
- package/dist/components/shared/player-action.d.ts.map +1 -0
- package/dist/components/shared/player-preload.d.ts +37 -0
- package/dist/components/shared/player-preload.d.ts.map +1 -0
- package/dist/components/shared/section-player-runtime.d.ts +104 -0
- package/dist/components/shared/section-player-runtime.d.ts.map +1 -0
- package/dist/components/shared/section-player-view-state.d.ts +24 -0
- package/dist/components/shared/section-player-view-state.d.ts.map +1 -0
- package/dist/controllers/SectionContentService.d.ts +3 -0
- package/dist/controllers/SectionContentService.d.ts.map +1 -1
- package/dist/controllers/SectionController.d.ts +55 -1
- package/dist/controllers/SectionController.d.ts.map +1 -1
- package/dist/controllers/SectionSessionService.d.ts +0 -1
- package/dist/controllers/SectionSessionService.d.ts.map +1 -1
- package/dist/controllers/toolkit-section-contracts.d.ts +2 -28
- package/dist/controllers/toolkit-section-contracts.d.ts.map +1 -1
- package/dist/controllers/types.d.ts +97 -6
- package/dist/controllers/types.d.ts.map +1 -1
- package/dist/pie-item-player-q4jcP2lZ.js +6196 -0
- package/dist/pie-section-player.d.ts +0 -8
- package/dist/pie-section-player.d.ts.map +1 -1
- package/dist/pie-section-player.js +61631 -11
- package/dist/player-preload-CQVG0Bih.js +705 -0
- package/dist/utils/player-preload.d.ts +2 -0
- package/dist/utils/player-preload.d.ts.map +1 -0
- package/dist/utils/player-preload.js +8 -0
- package/package.json +24 -32
- package/src/components/ItemShellElement.svelte +119 -3
- package/src/components/PassageShellElement.svelte +49 -0
- package/src/components/PieSectionPlayerBaseElement.svelte +65 -78
- package/src/components/PieSectionPlayerSplitPaneElement.svelte +337 -296
- package/src/components/PieSectionPlayerVerticalElement.svelte +446 -0
- package/src/components/shared/SectionItemCard.svelte +92 -0
- package/src/components/shared/SectionPassageCard.svelte +88 -0
- package/dist/ItemRenderer-MsjF_Beu.js +0 -467
- package/dist/PieItemModeLayoutElement-D7oTzA9T.js +0 -316
- package/dist/PieSplitPanelLayoutElement-GUtJ_NlF.js +0 -246
- package/dist/PieVerticalLayoutElement-BoA3FO5g.js +0 -194
- package/dist/controllers/SectionToolkitService.d.ts +0 -24
- package/dist/controllers/SectionToolkitService.d.ts.map +0 -1
- package/dist/controllers/SessionPersistenceStrategy.d.ts +0 -15
- package/dist/controllers/SessionPersistenceStrategy.d.ts.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/pie-section-player-DJ5NcwdT.js +0 -17078
- package/dist/runtime/runtime-event-guards.d.ts +0 -4
- package/dist/runtime/runtime-event-guards.d.ts.map +0 -1
- package/src/PieSectionPlayer.svelte +0 -826
- package/src/components/ItemModeLayout.svelte +0 -172
- package/src/components/ItemNavigation.svelte +0 -96
- package/src/components/ItemPlayerBridge.svelte +0 -110
- package/src/components/ItemRenderer.svelte +0 -248
- package/src/components/ItemShell.svelte +0 -86
- package/src/components/layout-elements/PieItemModeLayoutElement.svelte +0 -47
- package/src/components/layout-elements/PieSplitPanelLayoutElement.svelte +0 -62
- package/src/components/layout-elements/PieVerticalLayoutElement.svelte +0 -41
- package/src/components/layouts/SplitPanelLayout.svelte +0 -385
- package/src/components/layouts/VerticalLayout.svelte +0 -193
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ItemEntity } from '@pie-players/pie-players-shared';
|
|
2
|
+
export declare const PRELOAD_TIMEOUT_MS = 15000;
|
|
3
|
+
export declare function getRenderablesSignature(renderables: unknown[]): string;
|
|
4
|
+
export declare function getLoaderView(env: Record<string, unknown>): "author" | "delivery";
|
|
5
|
+
export declare function buildPreloadSignature(args: {
|
|
6
|
+
strategy: string;
|
|
7
|
+
loaderView: string;
|
|
8
|
+
esmCdnUrl: string;
|
|
9
|
+
bundleHost: string;
|
|
10
|
+
renderablesSignature: string;
|
|
11
|
+
}): string;
|
|
12
|
+
export declare function preloadPlayerElements(args: {
|
|
13
|
+
strategy: string;
|
|
14
|
+
renderables: ItemEntity[];
|
|
15
|
+
loaderView: "author" | "delivery";
|
|
16
|
+
esmCdnUrl: string;
|
|
17
|
+
bundleHost: string;
|
|
18
|
+
onTimeout: () => void;
|
|
19
|
+
timeoutMs?: number;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
export type PlayerPreloadState = {
|
|
22
|
+
lastPreloadSignature: string;
|
|
23
|
+
preloadRunToken: number;
|
|
24
|
+
elementsLoaded: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare function orchestratePlayerElementPreload(args: {
|
|
27
|
+
componentTag: string;
|
|
28
|
+
strategy: string;
|
|
29
|
+
renderables: ItemEntity[];
|
|
30
|
+
renderablesSignature: string;
|
|
31
|
+
resolvedPlayerProps: Record<string, unknown>;
|
|
32
|
+
resolvedPlayerEnv: Record<string, unknown>;
|
|
33
|
+
iifeBundleHost?: string | null;
|
|
34
|
+
getState: () => PlayerPreloadState;
|
|
35
|
+
setState: (next: Partial<PlayerPreloadState>) => void;
|
|
36
|
+
}): void;
|
|
37
|
+
//# sourceMappingURL=player-preload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player-preload.d.ts","sourceRoot":"","sources":["../../../src/components/shared/player-preload.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,UAAU,EACf,MAAM,iCAAiC,CAAC;AAEzC,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAExC,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,MAAM,CAmBtE;AAED,wBAAgB,aAAa,CAC5B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO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
1
|
+
import { ItemEntity } from '@pie-players/pie-players-shared';
|
|
2
|
+
export declare const DEFAULT_ASSESSMENT_ID = "section-demo-direct";
|
|
3
|
+
export declare const DEFAULT_PLAYER_TYPE = "iife";
|
|
4
|
+
export declare const DEFAULT_LAZY_INIT = true;
|
|
5
|
+
export declare const DEFAULT_ISOLATION = "inherit";
|
|
6
|
+
export declare const DEFAULT_ENV: Record<string, unknown>;
|
|
7
|
+
export type RuntimeConfig = {
|
|
8
|
+
assessmentId?: string;
|
|
9
|
+
playerType?: string;
|
|
10
|
+
player?: Record<string, unknown> | null;
|
|
11
|
+
lazyInit?: boolean;
|
|
12
|
+
tools?: Record<string, unknown> | null;
|
|
13
|
+
accessibility?: Record<string, unknown> | null;
|
|
14
|
+
coordinator?: unknown;
|
|
15
|
+
createSectionController?: unknown;
|
|
16
|
+
isolation?: string;
|
|
17
|
+
env?: Record<string, unknown>;
|
|
18
|
+
};
|
|
19
|
+
export type RuntimeInputs = {
|
|
20
|
+
assessmentId?: string;
|
|
21
|
+
playerType?: string;
|
|
22
|
+
player?: Record<string, unknown> | null;
|
|
23
|
+
lazyInit?: boolean;
|
|
24
|
+
tools?: Record<string, unknown> | null;
|
|
25
|
+
accessibility?: Record<string, unknown> | null;
|
|
26
|
+
coordinator?: unknown;
|
|
27
|
+
createSectionController?: unknown;
|
|
28
|
+
isolation?: string;
|
|
29
|
+
env?: Record<string, unknown> | null;
|
|
30
|
+
runtime: RuntimeConfig | null;
|
|
31
|
+
enabledTools: string;
|
|
32
|
+
itemToolbarTools: string;
|
|
33
|
+
passageToolbarTools: string;
|
|
34
|
+
};
|
|
35
|
+
export declare function resolveToolsConfig(args: {
|
|
36
|
+
runtime: RuntimeConfig | null;
|
|
37
|
+
tools: Record<string, unknown> | null;
|
|
38
|
+
enabledTools: string;
|
|
39
|
+
itemToolbarTools: string;
|
|
40
|
+
passageToolbarTools: string;
|
|
41
|
+
}): import('@pie-players/pie-assessment-toolkit').CanonicalToolsConfig;
|
|
42
|
+
export declare function resolveRuntime(args: {
|
|
43
|
+
assessmentId: string;
|
|
44
|
+
playerType: string;
|
|
45
|
+
player: Record<string, unknown> | null;
|
|
46
|
+
lazyInit: boolean;
|
|
47
|
+
accessibility: Record<string, unknown> | null;
|
|
48
|
+
coordinator: unknown;
|
|
49
|
+
createSectionController: unknown;
|
|
50
|
+
isolation: string;
|
|
51
|
+
env: Record<string, unknown> | null;
|
|
52
|
+
runtime: RuntimeConfig | null;
|
|
53
|
+
effectiveToolsConfig: unknown;
|
|
54
|
+
}): {
|
|
55
|
+
env: Record<string, unknown>;
|
|
56
|
+
tools: unknown;
|
|
57
|
+
assessmentId: string;
|
|
58
|
+
playerType: string;
|
|
59
|
+
player: Record<string, unknown> | null;
|
|
60
|
+
lazyInit: boolean;
|
|
61
|
+
accessibility: Record<string, unknown> | null;
|
|
62
|
+
coordinator: unknown;
|
|
63
|
+
createSectionController: unknown;
|
|
64
|
+
isolation: string;
|
|
65
|
+
};
|
|
66
|
+
export declare function resolvePlayerRuntime(args: {
|
|
67
|
+
effectiveRuntime: Record<string, unknown>;
|
|
68
|
+
playerType: string;
|
|
69
|
+
env: Record<string, unknown> | null;
|
|
70
|
+
}): {
|
|
71
|
+
effectivePlayerType: string;
|
|
72
|
+
resolvedPlayerDefinition: import('../../component-definitions.js').ComponentDefinition;
|
|
73
|
+
resolvedPlayerTag: string;
|
|
74
|
+
resolvedPlayerAttributes: Record<string, string>;
|
|
75
|
+
resolvedPlayerProps: Record<string, unknown>;
|
|
76
|
+
resolvedPlayerEnv: Record<string, unknown>;
|
|
77
|
+
strategy: import('@pie-players/pie-players-shared').ItemPlayerStrategy;
|
|
78
|
+
};
|
|
79
|
+
export declare function mapRenderablesToItems(renderables: unknown[]): ItemEntity[];
|
|
80
|
+
export declare function resolveSectionPlayerRuntimeState(args: RuntimeInputs): {
|
|
81
|
+
effectiveToolsConfig: import('@pie-players/pie-assessment-toolkit').CanonicalToolsConfig;
|
|
82
|
+
effectiveRuntime: {
|
|
83
|
+
env: Record<string, unknown>;
|
|
84
|
+
tools: unknown;
|
|
85
|
+
assessmentId: string;
|
|
86
|
+
playerType: string;
|
|
87
|
+
player: Record<string, unknown> | null;
|
|
88
|
+
lazyInit: boolean;
|
|
89
|
+
accessibility: Record<string, unknown> | null;
|
|
90
|
+
coordinator: unknown;
|
|
91
|
+
createSectionController: unknown;
|
|
92
|
+
isolation: string;
|
|
93
|
+
};
|
|
94
|
+
playerRuntime: {
|
|
95
|
+
effectivePlayerType: string;
|
|
96
|
+
resolvedPlayerDefinition: import('../../component-definitions.js').ComponentDefinition;
|
|
97
|
+
resolvedPlayerTag: string;
|
|
98
|
+
resolvedPlayerAttributes: Record<string, string>;
|
|
99
|
+
resolvedPlayerProps: Record<string, unknown>;
|
|
100
|
+
resolvedPlayerEnv: Record<string, unknown>;
|
|
101
|
+
strategy: import('@pie-players/pie-players-shared').ItemPlayerStrategy;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=section-player-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-player-runtime.d.ts","sourceRoot":"","sources":["../../../src/components/shared/section-player-runtime.ts"],"names":[],"mappings":"AAIA,OAAO,EAEN,KAAK,UAAU,EACf,MAAM,iCAAiC,CAAC;AAGzC,eAAO,MAAM,qBAAqB,wBAAwB,CAAC;AAC3D,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAC1C,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,WAAW,EAA0C,MAAM,CACvE,MAAM,EACN,OAAO,CACP,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,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gBACV,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;kBAC5B,OAAO;uBAEF,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;qBAChC,OAAO;iCACK,OAAO;mBACrB,MAAM;;;;;;;;;;;EAoKlB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ItemEntity } from '../../../../players-shared/dist/types/index.d.ts';
|
|
2
|
+
import { SectionCompositionModel } from '../../controllers/types.js';
|
|
3
|
+
import { PlayerElementParams } from './player-action.js';
|
|
4
|
+
export declare function getCompositionFromEvent(event: Event): SectionCompositionModel;
|
|
5
|
+
export declare function getPassagePlayerParams(args: {
|
|
6
|
+
passage: any;
|
|
7
|
+
resolvedPlayerEnv: Record<string, unknown>;
|
|
8
|
+
resolvedPlayerAttributes: Record<string, string>;
|
|
9
|
+
resolvedPlayerProps: Record<string, unknown>;
|
|
10
|
+
playerStrategy: string;
|
|
11
|
+
}): PlayerElementParams;
|
|
12
|
+
export declare function getItemPlayerParams(args: {
|
|
13
|
+
item: ItemEntity;
|
|
14
|
+
compositionModel: SectionCompositionModel;
|
|
15
|
+
resolvedPlayerEnv: Record<string, unknown>;
|
|
16
|
+
resolvedPlayerAttributes: Record<string, string>;
|
|
17
|
+
resolvedPlayerProps: Record<string, unknown>;
|
|
18
|
+
playerStrategy: string;
|
|
19
|
+
}): PlayerElementParams;
|
|
20
|
+
export declare function getCanonicalItemId(args: {
|
|
21
|
+
compositionModel: SectionCompositionModel;
|
|
22
|
+
item: ItemEntity;
|
|
23
|
+
}): string;
|
|
24
|
+
//# sourceMappingURL=section-player-view-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-player-view-state.d.ts","sourceRoot":"","sources":["../../../src/components/shared/section-player-view-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAM1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,KAAK,GAAG,uBAAuB,CAI7E;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,GAAG,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,cAAc,EAAE,MAAM,CAAC;CACvB,GAAG,mBAAmB,CAUtB;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACzC,IAAI,EAAE,UAAU,CAAC;IACjB,gBAAgB,EAAE,uBAAuB,CAAC;IAC1C,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,cAAc,EAAE,MAAM,CAAC;CACvB,GAAG,mBAAmB,CAStB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACxC,gBAAgB,EAAE,uBAAuB,CAAC;IAC1C,IAAI,EAAE,UAAU,CAAC;CACjB,GAAG,MAAM,CAET"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { AssessmentSection } from '@pie-players/pie-players-shared';
|
|
2
2
|
import { SectionContentModel, SectionView } from './types.js';
|
|
3
3
|
export declare class SectionContentService {
|
|
4
|
+
private createUniqueId;
|
|
5
|
+
private resolvePassageBaseId;
|
|
6
|
+
private normalizePassageEntity;
|
|
4
7
|
build(section: AssessmentSection | null, view: SectionView): SectionContentModel;
|
|
5
8
|
}
|
|
6
9
|
//# sourceMappingURL=SectionContentService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionContentService.d.ts","sourceRoot":"","sources":["../../src/controllers/SectionContentService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iCAAiC,CAAC;AACxF,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"SectionContentService.d.ts","sourceRoot":"","sources":["../../src/controllers/SectionContentService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iCAAiC,CAAC;AACxF,OAAO,KAAK,EACX,mBAAmB,EAEnB,WAAW,EACX,MAAM,YAAY,CAAC;AAIpB,qBAAa,qBAAqB;IACjC,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,oBAAoB;IAc5B,OAAO,CAAC,sBAAsB;IAavB,KAAK,CACX,OAAO,EAAE,iBAAiB,GAAG,IAAI,EACjC,IAAI,EAAE,WAAW,GACf,mBAAmB;CA+HtB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TestAttemptSession } from '@pie-players/pie-assessment-toolkit';
|
|
2
2
|
import { SectionControllerContext, SectionControllerHandle, SectionControllerPersistenceStrategy } from './toolkit-section-contracts.js';
|
|
3
3
|
import { ItemEntity } from '@pie-players/pie-players-shared';
|
|
4
|
-
import { NavigationResult, SectionControllerChangeListener, SectionCompositionModel, SectionAttemptSessionSlice, SectionNavigationState, SectionSessionState, SectionViewModel, SessionChangedResult } from './types.js';
|
|
4
|
+
import { NavigationResult, SectionCanonicalItemViewModel, SectionCanonicalSectionViewModel, SectionCanonicalSessionViewModel, SectionControllerChangeListener, SectionCompositionModel, SectionAttemptSessionSlice, SectionNavigationState, SectionSessionState, SectionViewModel, SessionChangedResult } from './types.js';
|
|
5
5
|
export declare class SectionController implements SectionControllerHandle {
|
|
6
6
|
private readonly contentService;
|
|
7
7
|
private readonly sessionService;
|
|
@@ -10,6 +10,14 @@ export declare class SectionController implements SectionControllerHandle {
|
|
|
10
10
|
private persistenceContext;
|
|
11
11
|
private state;
|
|
12
12
|
private readonly listeners;
|
|
13
|
+
private readonly trackedRenderables;
|
|
14
|
+
private readonly loadedRenderableKeys;
|
|
15
|
+
private readonly itemCompletionByCanonicalId;
|
|
16
|
+
private sectionLoadingComplete;
|
|
17
|
+
private sectionLoadingSnapshot;
|
|
18
|
+
private sectionItemsCompleteSnapshot;
|
|
19
|
+
private lastItemSelectionSnapshot;
|
|
20
|
+
private lastSectionErrorSnapshot;
|
|
13
21
|
private emitChange;
|
|
14
22
|
subscribe(listener: SectionControllerChangeListener): () => void;
|
|
15
23
|
initialize(input?: unknown): Promise<void>;
|
|
@@ -22,6 +30,9 @@ export declare class SectionController implements SectionControllerHandle {
|
|
|
22
30
|
getSnapshot(): unknown;
|
|
23
31
|
getViewModel(): SectionViewModel;
|
|
24
32
|
getCompositionModel(): SectionCompositionModel;
|
|
33
|
+
getCanonicalItemViewModel(itemId: string): SectionCanonicalItemViewModel | null;
|
|
34
|
+
getCanonicalSectionViewModel(): SectionCanonicalSectionViewModel;
|
|
35
|
+
getCanonicalSessionViewModel(): SectionCanonicalSessionViewModel;
|
|
25
36
|
getInstructions(): import('@pie-players/pie-players-shared').RubricBlock[];
|
|
26
37
|
getSectionLoadedEventDetail(): {
|
|
27
38
|
sectionId: string;
|
|
@@ -32,6 +43,7 @@ export declare class SectionController implements SectionControllerHandle {
|
|
|
32
43
|
getResolvedItemSessions(): Record<string, any>;
|
|
33
44
|
getResolvedTestAttemptSession(): TestAttemptSession | null;
|
|
34
45
|
getCanonicalItemId(itemId: string): string;
|
|
46
|
+
private getItemViewModels;
|
|
35
47
|
getItemSessionsByItemId(): Record<string, any>;
|
|
36
48
|
/**
|
|
37
49
|
* Host-facing persistence shape.
|
|
@@ -55,5 +67,47 @@ export declare class SectionController implements SectionControllerHandle {
|
|
|
55
67
|
* Cross-section navigation belongs to the higher-level assessment player.
|
|
56
68
|
*/
|
|
57
69
|
navigateToItem(index: number): NavigationResult | null;
|
|
70
|
+
handleContentRegistered(args: {
|
|
71
|
+
itemId: string;
|
|
72
|
+
canonicalItemId?: string;
|
|
73
|
+
contentKind?: string;
|
|
74
|
+
}): void;
|
|
75
|
+
handleContentUnregistered(args: {
|
|
76
|
+
itemId: string;
|
|
77
|
+
canonicalItemId?: string;
|
|
78
|
+
contentKind?: string;
|
|
79
|
+
}): void;
|
|
80
|
+
handleContentLoaded(args: {
|
|
81
|
+
itemId: string;
|
|
82
|
+
canonicalItemId?: string;
|
|
83
|
+
contentKind?: string;
|
|
84
|
+
detail?: unknown;
|
|
85
|
+
timestamp?: number;
|
|
86
|
+
}): void;
|
|
87
|
+
handleItemPlayerError(args: {
|
|
88
|
+
itemId: string;
|
|
89
|
+
canonicalItemId?: string;
|
|
90
|
+
contentKind?: string;
|
|
91
|
+
error: unknown;
|
|
92
|
+
timestamp?: number;
|
|
93
|
+
}): void;
|
|
94
|
+
reportSectionError(args: {
|
|
95
|
+
source: "item-player" | "section-runtime" | "toolkit" | "controller";
|
|
96
|
+
error: unknown;
|
|
97
|
+
itemId?: string;
|
|
98
|
+
canonicalItemId?: string;
|
|
99
|
+
contentKind?: string;
|
|
100
|
+
timestamp?: number;
|
|
101
|
+
}): void;
|
|
102
|
+
private resetLifecycleTracking;
|
|
103
|
+
private toSectionContentKind;
|
|
104
|
+
private getRenderableKey;
|
|
105
|
+
private readCompleteFromSession;
|
|
106
|
+
private bootstrapCompletionFromSessions;
|
|
107
|
+
private updateItemCompleteState;
|
|
108
|
+
private emitSectionItemsCompleteIfChanged;
|
|
109
|
+
private evaluateSectionLoadingState;
|
|
110
|
+
private captureReplaySnapshot;
|
|
111
|
+
private buildReplayEvents;
|
|
58
112
|
}
|
|
59
113
|
//# sourceMappingURL=SectionController.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionController.d.ts","sourceRoot":"","sources":["../../src/controllers/SectionController.ts"],"names":[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AG,YAAY,CAAC;QACrE,KAAK,EAAE,OAAO,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,IAAI;IAgBR,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,uBAAuB;IAM/B,OAAO,CAAC,+BAA+B;IAavC,OAAO,CAAC,uBAAuB;IA0B/B,OAAO,CAAC,iCAAiC;IA+BzC,OAAO,CAAC,2BAA2B;IAiBnC,OAAO,CAAC,qBAAqB;IAe7B,OAAO,CAAC,iBAAiB;CA2EzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionSessionService.d.ts","sourceRoot":"","sources":["../../src/controllers/SectionSessionService.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,kBAAkB,EACvB,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"SectionSessionService.d.ts","sourceRoot":"","sources":["../../src/controllers/SectionSessionService.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,kBAAkB,EACvB,MAAM,qCAAqC,CAAC;AAK7C,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAE/E,qBAAa,qBAAqB;IACjC,OAAO,CAAC,2BAA2B;IAc5B,cAAc,CAAC,kBAAkB,EAAE,kBAAkB,GAAG;QAC9D,gBAAgB,EAAE,MAAM,CAAC;QACzB,sBAAsB,EAAE,MAAM,EAAE,CAAC;QACjC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACtC;IAUM,OAAO,CAAC,KAAK,EAAE,sBAAsB,GAAG;QAAE,eAAe,EAAE,GAAG,EAAE,CAAA;KAAE,GAAG;QAC3E,kBAAkB,EAAE,kBAAkB,CAAC;QACvC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAClC;IASM,uBAAuB,CAAC,IAAI,EAAE;QACpC,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,EAAE,GAAG,CAAC;QACnB,kBAAkB,EAAE,kBAAkB,CAAC;QACvC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAClC,GAAG,oBAAoB;CAkDxB"}
|
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
import { ToolkitCoordinator } from '@pie-players/pie-assessment-toolkit';
|
|
2
|
-
export
|
|
3
|
-
assessmentId: string;
|
|
4
|
-
sectionId: string;
|
|
5
|
-
attemptId?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface SectionControllerContext {
|
|
8
|
-
key: SectionControllerKey;
|
|
9
|
-
coordinator: unknown;
|
|
10
|
-
input?: unknown;
|
|
11
|
-
}
|
|
12
|
-
export interface SectionControllerPersistenceStrategy {
|
|
13
|
-
load(context: SectionControllerContext): unknown | Promise<unknown>;
|
|
14
|
-
save(context: SectionControllerContext, snapshot: unknown): void | Promise<void>;
|
|
15
|
-
clear?(context: SectionControllerContext): void | Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
export interface SectionControllerHandle {
|
|
18
|
-
initialize?(input?: unknown): void | Promise<void>;
|
|
19
|
-
updateInput?(input?: unknown): void | Promise<void>;
|
|
20
|
-
hydrate?(): void | Promise<void>;
|
|
21
|
-
persist?(): void | Promise<void>;
|
|
22
|
-
dispose?(): void | Promise<void>;
|
|
23
|
-
subscribe?(listener: (event: unknown) => void): () => void;
|
|
24
|
-
getSnapshot?(): unknown;
|
|
25
|
-
getCurrentSectionAttemptSlice?(): unknown;
|
|
26
|
-
setPersistenceContext?(context: SectionControllerContext): void | Promise<void>;
|
|
27
|
-
setPersistenceStrategy?(strategy: SectionControllerPersistenceStrategy): void | Promise<void>;
|
|
28
|
-
}
|
|
1
|
+
import { ToolkitCoordinator, SectionControllerHandle } from '@pie-players/pie-assessment-toolkit';
|
|
2
|
+
export type { SectionControllerContext, SectionControllerHandle, SectionControllerKey, SectionControllerPersistenceStrategy, } from '@pie-players/pie-assessment-toolkit';
|
|
29
3
|
export type CoordinatorWithSectionControllers = ToolkitCoordinator & {
|
|
30
4
|
getOrCreateSectionController(args: {
|
|
31
5
|
sectionId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolkit-section-contracts.d.ts","sourceRoot":"","sources":["../../src/controllers/toolkit-section-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"toolkit-section-contracts.d.ts","sourceRoot":"","sources":["../../src/controllers/toolkit-section-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AACnF,YAAY,EACX,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,oCAAoC,GACpC,MAAM,qCAAqC,CAAC;AAE7C,MAAM,MAAM,iCAAiC,GAAG,kBAAkB,GAAG;IACpE,4BAA4B,CAAC,IAAI,EAAE;QAClC,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,uBAAuB,EAAE,MACtB,uBAAuB,GACvB,OAAO,CAAC,uBAAuB,CAAC,CAAC;KACpC,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACrC,wBAAwB,CAAC,IAAI,EAAE;QAC9B,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC3B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { TestAttemptSession } from '@pie-players/pie-assessment-toolkit';
|
|
2
|
-
import { AssessmentItemRef, AssessmentSection, ItemEntity, PassageEntity, RubricBlock } from '@pie-players/pie-players-shared';
|
|
2
|
+
import { ItemSessionUpdateIntent, AssessmentItemRef, AssessmentSection, ItemEntity, PassageEntity, RubricBlock } from '@pie-players/pie-players-shared';
|
|
3
|
+
import { ConfigContainerEntity } from '../../../players-shared/dist/types/index.d.ts';
|
|
3
4
|
export type SectionView = "candidate" | "scorer" | "author" | "proctor" | "testConstructor" | "tutor";
|
|
4
5
|
export interface SectionContentModel {
|
|
5
6
|
passages: PassageEntity[];
|
|
6
7
|
items: ItemEntity[];
|
|
7
8
|
rubricBlocks: RubricBlock[];
|
|
8
9
|
instructions: RubricBlock[];
|
|
10
|
+
renderables: SectionRenderable[];
|
|
9
11
|
adapterItemRefs: Array<{
|
|
10
12
|
identifier: string;
|
|
11
13
|
item: {
|
|
@@ -14,6 +16,11 @@ export interface SectionContentModel {
|
|
|
14
16
|
};
|
|
15
17
|
}>;
|
|
16
18
|
}
|
|
19
|
+
export type SectionRenderableFlavor = "item" | "passage" | "rubric";
|
|
20
|
+
export interface SectionRenderable {
|
|
21
|
+
flavor: SectionRenderableFlavor;
|
|
22
|
+
entity: ConfigContainerEntity;
|
|
23
|
+
}
|
|
17
24
|
export interface SectionControllerInput {
|
|
18
25
|
section: AssessmentSection | null;
|
|
19
26
|
view: SectionView;
|
|
@@ -36,11 +43,30 @@ export interface SectionCompositionModel {
|
|
|
36
43
|
items: ItemEntity[];
|
|
37
44
|
rubricBlocks: RubricBlock[];
|
|
38
45
|
instructions: RubricBlock[];
|
|
46
|
+
renderables: SectionRenderable[];
|
|
39
47
|
currentItemIndex: number;
|
|
40
48
|
currentItem: ItemEntity | null;
|
|
41
49
|
isPageMode: boolean;
|
|
42
50
|
itemSessionsByItemId: Record<string, unknown>;
|
|
43
51
|
testAttemptSession: TestAttemptSession | null;
|
|
52
|
+
itemViewModels: SectionCanonicalItemViewModel[];
|
|
53
|
+
}
|
|
54
|
+
export interface SectionCanonicalItemViewModel {
|
|
55
|
+
item: ItemEntity;
|
|
56
|
+
itemId: string;
|
|
57
|
+
canonicalItemId: string;
|
|
58
|
+
index: number;
|
|
59
|
+
isCurrent: boolean;
|
|
60
|
+
session: unknown;
|
|
61
|
+
}
|
|
62
|
+
export interface SectionCanonicalSectionViewModel {
|
|
63
|
+
sectionId: string;
|
|
64
|
+
currentItemIndex: number;
|
|
65
|
+
items: SectionCanonicalItemViewModel[];
|
|
66
|
+
}
|
|
67
|
+
export interface SectionCanonicalSessionViewModel {
|
|
68
|
+
currentItemIndex: number;
|
|
69
|
+
itemSessionsByCanonicalId: Record<string, unknown>;
|
|
44
70
|
}
|
|
45
71
|
export interface SectionAttemptSessionSlice {
|
|
46
72
|
sectionId: string;
|
|
@@ -58,8 +84,7 @@ export interface SessionChangedResult {
|
|
|
58
84
|
eventDetail: {
|
|
59
85
|
itemId: string;
|
|
60
86
|
session: unknown;
|
|
61
|
-
|
|
62
|
-
itemSessions: Record<string, unknown>;
|
|
87
|
+
intent?: ItemSessionUpdateIntent;
|
|
63
88
|
complete?: boolean;
|
|
64
89
|
component?: string;
|
|
65
90
|
timestamp: number;
|
|
@@ -83,11 +108,77 @@ export interface SectionNavigationState {
|
|
|
83
108
|
canPrevious: boolean;
|
|
84
109
|
isLoading: boolean;
|
|
85
110
|
}
|
|
86
|
-
export
|
|
87
|
-
|
|
88
|
-
|
|
111
|
+
export type SectionContentKind = "item" | "passage" | "rubric" | "unknown";
|
|
112
|
+
interface SectionControllerEventBase {
|
|
113
|
+
type: "item-session-data-changed" | "item-session-meta-changed" | "item-selected" | "content-loaded" | "item-player-error" | "item-complete-changed" | "section-loading-complete" | "section-items-complete-changed" | "section-error";
|
|
89
114
|
currentItemIndex: number;
|
|
90
115
|
timestamp: number;
|
|
116
|
+
replayed?: boolean;
|
|
117
|
+
}
|
|
118
|
+
export interface ItemSessionDataChangedEvent extends SectionControllerEventBase {
|
|
119
|
+
type: "item-session-data-changed";
|
|
120
|
+
itemId: string;
|
|
121
|
+
canonicalItemId: string;
|
|
122
|
+
session: unknown;
|
|
123
|
+
intent?: ItemSessionUpdateIntent;
|
|
124
|
+
complete?: boolean;
|
|
125
|
+
component?: string;
|
|
126
|
+
}
|
|
127
|
+
export interface ItemSessionMetaChangedEvent extends SectionControllerEventBase {
|
|
128
|
+
type: "item-session-meta-changed";
|
|
129
|
+
itemId: string;
|
|
130
|
+
canonicalItemId: string;
|
|
131
|
+
complete?: boolean;
|
|
132
|
+
component?: string;
|
|
133
|
+
}
|
|
134
|
+
export interface ItemSelectedEvent extends SectionControllerEventBase {
|
|
135
|
+
type: "item-selected";
|
|
136
|
+
previousItemId: string;
|
|
137
|
+
currentItemId: string;
|
|
138
|
+
itemIndex: number;
|
|
139
|
+
totalItems: number;
|
|
140
|
+
}
|
|
141
|
+
export interface ContentLoadedEvent extends SectionControllerEventBase {
|
|
142
|
+
type: "content-loaded";
|
|
143
|
+
contentKind: SectionContentKind;
|
|
144
|
+
itemId: string;
|
|
145
|
+
canonicalItemId: string;
|
|
146
|
+
detail?: unknown;
|
|
147
|
+
}
|
|
148
|
+
export interface ItemPlayerErrorEvent extends SectionControllerEventBase {
|
|
149
|
+
type: "item-player-error";
|
|
150
|
+
contentKind: SectionContentKind;
|
|
151
|
+
itemId: string;
|
|
152
|
+
canonicalItemId: string;
|
|
153
|
+
error: unknown;
|
|
154
|
+
}
|
|
155
|
+
export interface ItemCompleteChangedEvent extends SectionControllerEventBase {
|
|
156
|
+
type: "item-complete-changed";
|
|
157
|
+
itemId: string;
|
|
158
|
+
canonicalItemId: string;
|
|
159
|
+
complete: boolean;
|
|
160
|
+
previousComplete: boolean;
|
|
161
|
+
}
|
|
162
|
+
export interface SectionLoadingCompleteEvent extends SectionControllerEventBase {
|
|
163
|
+
type: "section-loading-complete";
|
|
164
|
+
totalRegistered: number;
|
|
165
|
+
totalLoaded: number;
|
|
166
|
+
}
|
|
167
|
+
export interface SectionItemsCompleteChangedEvent extends SectionControllerEventBase {
|
|
168
|
+
type: "section-items-complete-changed";
|
|
169
|
+
complete: boolean;
|
|
170
|
+
completedCount: number;
|
|
171
|
+
totalItems: number;
|
|
172
|
+
}
|
|
173
|
+
export interface SectionErrorEvent extends SectionControllerEventBase {
|
|
174
|
+
type: "section-error";
|
|
175
|
+
source: "item-player" | "section-runtime" | "toolkit" | "controller";
|
|
176
|
+
error: unknown;
|
|
177
|
+
itemId?: string;
|
|
178
|
+
canonicalItemId?: string;
|
|
179
|
+
contentKind?: SectionContentKind;
|
|
91
180
|
}
|
|
181
|
+
export type SectionControllerChangeEvent = ItemSessionDataChangedEvent | ItemSessionMetaChangedEvent | ItemSelectedEvent | ContentLoadedEvent | ItemPlayerErrorEvent | ItemCompleteChangedEvent | SectionLoadingCompleteEvent | SectionItemsCompleteChangedEvent | SectionErrorEvent;
|
|
92
182
|
export type SectionControllerChangeListener = (event: SectionControllerChangeEvent) => void;
|
|
183
|
+
export {};
|
|
93
184
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/controllers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/controllers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EACX,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,WAAW,EACX,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,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