@pie-players/pie-assessment-toolkit 0.3.74 → 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 +349 -313
- package/dist/attempt/TestSession.d.ts +1 -20
- package/dist/attempt/TestSession.js +8 -99
- package/dist/components/ItemScope.custom-element.d.ts +1 -0
- package/dist/components/ItemScope.custom-element.js +1 -0
- package/dist/components/ItemToolBar.custom-element.js +1 -1
- package/dist/components/PieAssessmentToolkit.custom-element.js +14 -14
- package/dist/components/SectionToolBar.custom-element.js +1 -1
- package/dist/components/chunks/ItemToolBar-7tt7v2xp.js +4 -0
- package/dist/components/chunks/{ItemToolBar-gmrryv2v.js → ItemToolBar-97hx60z4.js} +1 -1
- package/dist/components/chunks/ItemToolBar-bxwyhr5p.js +2 -0
- package/dist/components/chunks/ItemToolBar-jx38w99s.js +2 -0
- package/dist/components/chunks/ItemToolBar-rd2bb4p6.js +40 -0
- package/dist/components/chunks/ItemToolBar-vdkyn9f3.js +2 -0
- package/dist/components/chunks/sre-engine-jd8cc08x.js +1 -0
- package/dist/components/item-scope-element.d.ts +2 -0
- package/dist/components/item-scope-element.js +2 -0
- package/dist/context/assessment-toolkit-context.d.ts +27 -6
- package/dist/index.d.ts +22 -47
- package/dist/index.js +12 -36
- package/dist/policy/core/PolicySource.d.ts +1 -1
- package/dist/policy/core/ToolPolicyEngine.d.ts +77 -32
- package/dist/policy/core/ToolPolicyEngine.js +136 -46
- package/dist/policy/core/compose-decision.d.ts +28 -7
- package/dist/policy/core/compose-decision.js +75 -54
- package/dist/policy/core/decision-types.d.ts +65 -34
- package/dist/policy/core/feature-decision.d.ts +16 -9
- package/dist/policy/core/feature-decision.js +14 -8
- package/dist/policy/core/pnp-policy-inputs.d.ts +24 -33
- package/dist/policy/core/pnp-policy-inputs.js +28 -56
- package/dist/policy/core/provenance.d.ts +9 -4
- package/dist/policy/core/provenance.js +1 -1
- package/dist/policy/engine.d.ts +7 -23
- package/dist/policy/engine.js +5 -20
- package/dist/policy/sources/PnpPolicySource.d.ts +44 -61
- package/dist/policy/sources/PnpPolicySource.js +117 -118
- package/dist/runtime/SectionControllerBinding.d.ts +279 -0
- package/dist/runtime/SectionControllerBinding.js +450 -0
- package/dist/runtime/SectionRuntimeEngine.d.ts +26 -289
- package/dist/runtime/SectionRuntimeEngine.js +30 -372
- package/dist/runtime/adapter/SectionEngineAdapter.d.ts +19 -80
- package/dist/runtime/adapter/SectionEngineAdapter.js +19 -92
- package/dist/runtime/adapter/dom-event-bridge.d.ts +15 -30
- package/dist/runtime/adapter/dom-event-bridge.js +17 -44
- package/dist/runtime/adapter/subscriber-fanout.d.ts +1 -2
- package/dist/runtime/adapter/subscriber-fanout.js +1 -2
- package/dist/runtime/catalog-context.d.ts +19 -0
- package/dist/runtime/catalog-context.js +28 -0
- package/dist/runtime/composition-emit-scheduler.d.ts +9 -15
- package/dist/runtime/composition-emit-scheduler.js +9 -15
- package/dist/runtime/content-language.d.ts +32 -0
- package/dist/runtime/content-language.js +46 -0
- package/dist/runtime/content-region.d.ts +17 -0
- package/dist/runtime/content-region.js +29 -0
- package/dist/runtime/content-registration.d.ts +13 -0
- package/dist/runtime/content-registration.js +25 -0
- package/dist/runtime/core/SectionEngineCore.d.ts +2 -2
- package/dist/runtime/core/SectionEngineCore.js +2 -2
- package/dist/runtime/core/cohort.d.ts +1 -1
- package/dist/runtime/core/cohort.js +1 -1
- package/dist/runtime/core/engine-input.d.ts +18 -30
- package/dist/runtime/core/engine-input.js +11 -12
- package/dist/runtime/core/engine-output.d.ts +16 -40
- package/dist/runtime/core/engine-output.js +9 -21
- package/dist/runtime/core/engine-readiness.d.ts +5 -37
- package/dist/runtime/core/engine-readiness.js +8 -41
- package/dist/runtime/core/engine-resolver.d.ts +46 -74
- package/dist/runtime/core/engine-resolver.js +18 -43
- package/dist/runtime/core/engine-state.d.ts +28 -36
- package/dist/runtime/core/engine-state.js +18 -21
- package/dist/runtime/core/engine-transition.d.ts +14 -19
- package/dist/runtime/core/engine-transition.js +71 -51
- package/dist/runtime/engine.d.ts +16 -19
- package/dist/runtime/engine.js +12 -19
- package/dist/runtime/page-warnings.d.ts +13 -0
- package/dist/runtime/page-warnings.js +22 -0
- package/dist/runtime/policy-input-forwarding.d.ts +25 -0
- package/dist/runtime/policy-input-forwarding.js +25 -0
- package/dist/runtime/registration-events.d.ts +11 -0
- package/dist/runtime/runtime-event-claim.d.ts +8 -0
- package/dist/runtime/runtime-event-claim.js +15 -0
- package/dist/runtime/shell-event-bridge.d.ts +45 -0
- package/dist/runtime/shell-event-bridge.js +127 -0
- package/dist/runtime/shell-registration.d.ts +73 -0
- package/dist/runtime/shell-registration.js +95 -0
- package/dist/runtime/shell-scope.d.ts +68 -0
- package/dist/runtime/shell-scope.js +188 -0
- package/dist/runtime/tool-host-contract.d.ts +8 -10
- package/dist/runtime/tool-host-contract.js +11 -11
- package/dist/runtime/unclaimed-registration-watch.d.ts +7 -0
- package/dist/runtime/unclaimed-registration-watch.js +23 -0
- package/dist/services/ElementToolStateStore.d.ts +14 -10
- package/dist/services/ElementToolStateStore.js +37 -13
- package/dist/services/HighlightCoordinator.d.ts +21 -21
- package/dist/services/HighlightCoordinator.js +431 -325
- package/dist/services/RangeSerializer.d.ts +10 -1
- package/dist/services/RangeSerializer.js +87 -14
- package/dist/services/TTSService.d.ts +117 -70
- package/dist/services/TTSService.js +668 -578
- package/dist/services/ToolCoordinator.d.ts +43 -60
- package/dist/services/ToolCoordinator.js +164 -206
- package/dist/services/ToolRegistry.d.ts +74 -57
- package/dist/services/ToolRegistry.js +104 -114
- package/dist/services/ToolkitCoordinator.d.ts +183 -189
- package/dist/services/ToolkitCoordinator.js +477 -431
- package/dist/services/audio-handoff.d.ts +6 -7
- package/dist/services/audio-handoff.js +20 -14
- package/dist/services/catalog-owner.d.ts +0 -1
- package/dist/services/framework-error-bus.d.ts +3 -6
- package/dist/services/framework-error-bus.js +3 -6
- package/dist/services/framework-error.d.ts +22 -7
- package/dist/services/framework-error.js +9 -7
- package/dist/services/interfaces.d.ts +158 -129
- package/dist/services/section-session-assignment.d.ts +21 -0
- package/dist/services/section-session-assignment.js +82 -0
- package/dist/services/spoken-audio-cards.d.ts +0 -2
- package/dist/services/spoken-audio-cards.js +0 -2
- package/dist/services/tool-config-defaults.d.ts +3 -3
- package/dist/services/tool-config-defaults.js +3 -3
- package/dist/services/tool-config-validation.d.ts +4 -5
- package/dist/services/tool-config-validation.js +36 -61
- package/dist/services/tool-context.d.ts +0 -8
- package/dist/services/tool-context.js +0 -12
- package/dist/services/tool-icons.d.ts +4 -3
- package/dist/services/tool-icons.js +4 -3
- package/dist/services/tool-instance-id.d.ts +0 -1
- package/dist/services/tool-instance-id.js +0 -6
- package/dist/services/tool-providers/TTSToolProvider.d.ts +18 -19
- package/dist/services/tool-providers/TTSToolProvider.js +37 -34
- package/dist/services/tool-providers/ToolProviderApi.d.ts +10 -4
- package/dist/services/tool-providers/ToolProviderRegistry.d.ts +30 -26
- package/dist/services/tool-providers/ToolProviderRegistry.js +119 -93
- package/dist/services/tool-request.d.ts +27 -12
- package/dist/services/tool-request.js +24 -14
- package/dist/services/toolbar-decided-tools.d.ts +15 -0
- package/dist/services/toolbar-decided-tools.js +28 -0
- package/dist/services/tools-config-normalizer.d.ts +17 -22
- package/dist/services/tools-config-normalizer.js +2 -10
- package/dist/services/tts/browser-provider.d.ts +38 -2
- package/dist/services/tts/browser-provider.js +276 -140
- package/dist/services/tts/flat-tree.d.ts +71 -0
- package/dist/services/tts/flat-tree.js +269 -0
- package/dist/services/tts/generated-speech/assemble-plan.d.ts +3 -1
- package/dist/services/tts/generated-speech/assemble-plan.js +3 -1
- package/dist/services/tts/generated-speech/dom/build-dom-plan.d.ts +2 -0
- package/dist/services/tts/generated-speech/dom/build-dom-plan.js +1 -1
- package/dist/services/tts/generated-speech/math-speech-cache.d.ts +3 -1
- package/dist/services/tts/generated-speech/math-speech-cache.js +5 -1
- package/dist/services/tts/highlight-pipeline/create-highlight-plan.js +12 -4
- package/dist/services/tts/highlight-pipeline/prose-boundary-resolver.js +6 -4
- package/dist/services/tts/highlight-pipeline/readable-region.js +3 -2
- package/dist/services/tts/highlight-pipeline/types.d.ts +5 -0
- package/dist/services/tts/highlight-pipeline/visible-map-range.d.ts +12 -0
- package/dist/services/tts/highlight-pipeline/visible-map-range.js +73 -7
- package/dist/services/tts/math-aware-text-processing.d.ts +5 -1
- package/dist/services/tts/math-aware-text-processing.js +32 -18
- package/dist/services/tts/math-control-names.d.ts +21 -0
- package/dist/services/tts/math-control-names.js +142 -0
- package/dist/services/tts/math-speech.d.ts +11 -0
- package/dist/services/tts/math-speech.js +51 -18
- package/dist/services/tts/provider-options.d.ts +41 -0
- package/dist/services/tts/provider-options.js +1 -0
- package/dist/services/tts/ssml/spoken-text.d.ts +2 -26
- package/dist/services/tts/ssml/spoken-text.js +29 -0
- package/dist/services/tts/start-failure.d.ts +11 -0
- package/dist/services/tts/start-failure.js +19 -0
- package/dist/services/tts/text-processing.d.ts +9 -0
- package/dist/services/tts/text-processing.js +46 -33
- package/dist/services/tts/text-segmentation.d.ts +7 -0
- package/dist/services/tts/text-segmentation.js +47 -0
- package/dist/services/tts-runtime-config.d.ts +25 -17
- package/dist/services/tts-runtime-config.js +16 -95
- package/dist/tools/content-capability-resolution.d.ts +7 -9
- package/dist/tools/content-capability-resolution.js +8 -45
- package/dist/tools/registration.d.ts +58 -0
- package/dist/tools/registration.js +54 -0
- package/dist/tools/registrations/toolbar-registration-helpers.js +2 -2
- package/dist/tools/tool-surface-host.d.ts +6 -10
- package/dist/tools/tool-surface-host.js +44 -42
- package/dist/tools/tool-tag-map.d.ts +5 -15
- package/dist/tools/tool-tag-map.js +6 -20
- package/dist/utils/structural-equality.d.ts +11 -0
- package/dist/utils/structural-equality.js +47 -0
- package/package.json +13 -29
- package/dist/attempt/adapters/activity-to-test-attempt-session.d.ts +0 -49
- package/dist/attempt/adapters/activity-to-test-attempt-session.js +0 -138
- package/dist/components/chunks/ItemToolBar-b9dz5jvd.js +0 -40
- package/dist/components/chunks/ItemToolBar-h4xap0t0.js +0 -4
- package/dist/components/chunks/ItemToolBar-wr2myaah.js +0 -2
- package/dist/components/chunks/sre-engine-wf9s43gg.js +0 -1
- package/dist/context/runtime-context-consumer.d.ts +0 -13
- package/dist/context/runtime-context-consumer.js +0 -18
- package/dist/item-loader.d.ts +0 -44
- package/dist/item-loader.js +0 -61
- package/dist/policy/core/engine-context.d.ts +0 -29
- package/dist/policy/core/engine-context.js +0 -27
- package/dist/policy/core/policy-source-tag.d.ts +0 -31
- package/dist/policy/core/policy-source-tag.js +0 -28
- package/dist/policy/internal.d.ts +0 -25
- package/dist/policy/internal.js +0 -25
- package/dist/runtime/adapter/coordinator-bridge.d.ts +0 -92
- package/dist/runtime/adapter/coordinator-bridge.js +0 -126
- package/dist/runtime/adapter/framework-error-bridge.d.ts +0 -36
- package/dist/runtime/adapter/framework-error-bridge.js +0 -46
- package/dist/runtime/adapter/instrumentation-bridge.d.ts +0 -31
- package/dist/runtime/adapter/instrumentation-bridge.js +0 -38
- package/dist/runtime/core/engine-stage-derivation.d.ts +0 -18
- package/dist/runtime/core/engine-stage-derivation.js +0 -29
- package/dist/runtime/engine-context.d.ts +0 -39
- package/dist/runtime/engine-context.js +0 -31
- package/dist/runtime/internal.d.ts +0 -43
- package/dist/runtime/internal.js +0 -45
- package/dist/runtime/section-runtime-engine-host-context.d.ts +0 -74
- package/dist/runtime/section-runtime-engine-host-context.js +0 -57
- package/dist/runtime/stage-emit-gate.d.ts +0 -92
- package/dist/runtime/stage-emit-gate.js +0 -82
- package/dist/services/I18nService.d.ts +0 -47
- package/dist/services/I18nService.js +0 -84
- package/dist/services/ThemeProvider.d.ts +0 -95
- package/dist/services/ThemeProvider.js +0 -334
- package/dist/services/defaultPersonalNeedsProfile.d.ts +0 -21
- package/dist/services/defaultPersonalNeedsProfile.js +0 -26
- package/dist/services/pnp-standard-features.d.ts +0 -238
- package/dist/services/pnp-standard-features.js +0 -338
- package/dist/tools/client.d.ts +0 -10
- package/dist/tools/client.js +0 -10
- package/dist/tools/internal.d.ts +0 -44
- package/dist/tools/internal.js +0 -39
|
@@ -1,77 +1,60 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ToolCoordinator
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* Prevents conflicts between calculator, ruler, protractor, etc.
|
|
4
|
+
* Holds the visibility state of floating tools and stacks their elements.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
6
|
+
* Visibility is state: the coordinator records it and notifies subscribers, and
|
|
7
|
+
* whoever renders a tool shows or hides it from that state. Stacking is the
|
|
8
|
+
* coordinator's alone: an element bound to a tool (`registerTool` with an
|
|
9
|
+
* element, or `updateToolElement`) takes a z-index in the tool's layer and comes
|
|
10
|
+
* to the front of that layer when shown or pressed.
|
|
12
11
|
*
|
|
13
12
|
* Part of PIE Assessment Toolkit.
|
|
14
13
|
*/
|
|
15
|
-
import type { ToolCoordinatorApi, ToolState } from "./interfaces.js";
|
|
14
|
+
import type { ToolCoordinatorApi, ToolState, ToolStateFilter } from "./interfaces.js";
|
|
16
15
|
/**
|
|
17
16
|
* Z-index layers for assessment components
|
|
18
17
|
*/
|
|
19
18
|
export declare enum ZIndexLayer {
|
|
20
19
|
BASE = 0,// PIE content, player chrome (0-999)
|
|
21
|
-
TOOL = 1000,//
|
|
22
|
-
MODAL = 2000,// Modal
|
|
20
|
+
TOOL = 1000,// Floating tools and their windows (1000-1999)
|
|
21
|
+
MODAL = 2000,// Modal tool surfaces (2000-2999)
|
|
23
22
|
CONTROL = 3000,// Drag handles, resize controls (3000-3999)
|
|
24
23
|
HIGHLIGHT = 4000
|
|
25
24
|
}
|
|
26
25
|
export declare class ToolCoordinator implements ToolCoordinatorApi {
|
|
27
26
|
private tools;
|
|
28
|
-
private layerCounters;
|
|
29
27
|
private listeners;
|
|
30
|
-
/**
|
|
31
|
-
* Activation (on/off) state keyed by tool id, kept independent of the
|
|
32
|
-
* element registration lifecycle. A tool's DOM element can be unregistered
|
|
33
|
-
* and re-registered as the item re-renders (e.g. a model change re-mounts
|
|
34
|
-
* the toolbar overlay); when that happens the on/off state must survive so
|
|
35
|
-
* that only an explicit toggle — the toolbar button — turns a tool off.
|
|
36
|
-
* Cleared on genuine teardown via {@link releaseTool}.
|
|
37
|
-
*/
|
|
38
|
-
private visibilityState;
|
|
39
|
-
constructor();
|
|
40
28
|
/**
|
|
41
29
|
* Subscribe to tool state changes
|
|
42
30
|
* Returns unsubscribe function
|
|
43
31
|
*/
|
|
44
32
|
subscribe(listener: () => void): () => void;
|
|
45
|
-
/**
|
|
46
|
-
* Notify all listeners of state change
|
|
47
|
-
*/
|
|
48
33
|
private notifyListeners;
|
|
49
34
|
/**
|
|
50
|
-
* Register a tool with the coordinator
|
|
35
|
+
* Register a tool with the coordinator. Registering a known id keeps its
|
|
36
|
+
* on/off state and takes the name, the element when one is given, and the
|
|
37
|
+
* layer when none was declared before.
|
|
51
38
|
*
|
|
52
39
|
* @param id Unique tool identifier
|
|
53
40
|
* @param name Display name
|
|
54
|
-
* @param element DOM element
|
|
55
|
-
* @param layer Z-index layer
|
|
41
|
+
* @param element DOM element to stack (optional)
|
|
42
|
+
* @param layer Z-index layer. Without one the tool stacks on TOOL until a
|
|
43
|
+
* registration names one.
|
|
56
44
|
*/
|
|
57
45
|
registerTool(id: string, name: string, element?: HTMLElement, layer?: ZIndexLayer): void;
|
|
58
46
|
/**
|
|
59
|
-
* Unregister a tool
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* preserves the tool's activation state in {@link visibilityState}, so a
|
|
63
|
-
* subsequent re-registration of the same id (e.g. after an item re-render)
|
|
64
|
-
* restores whether the tool was on or off. Use {@link releaseTool} to also
|
|
65
|
-
* discard the activation state on genuine teardown.
|
|
47
|
+
* Unregister a tool's element binding, keeping its on/off state so a
|
|
48
|
+
* re-registration of the same id (an item re-render) restores it. Use
|
|
49
|
+
* {@link releaseTool} on genuine teardown.
|
|
66
50
|
*
|
|
67
51
|
* @param id Tool identifier
|
|
68
52
|
*/
|
|
69
53
|
unregisterTool(id: string): void;
|
|
70
54
|
/**
|
|
71
|
-
* Fully release a tool: unregister its element binding
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* which keeps the on/off state alive across element re-registration.
|
|
55
|
+
* Fully release a tool: unregister its element binding and discard its
|
|
56
|
+
* on/off state. Call this on genuine teardown (leaving the item or section
|
|
57
|
+
* that owns the tool).
|
|
75
58
|
*
|
|
76
59
|
* @param id Tool identifier
|
|
77
60
|
*/
|
|
@@ -98,57 +81,57 @@ export declare class ToolCoordinator implements ToolCoordinatorApi {
|
|
|
98
81
|
* Check if tool is visible
|
|
99
82
|
*
|
|
100
83
|
* @param id Tool identifier
|
|
101
|
-
* @returns true if tool is visible
|
|
102
84
|
*/
|
|
103
85
|
isToolVisible(id: string): boolean;
|
|
104
86
|
/**
|
|
105
|
-
* Bring element to front of its layer
|
|
87
|
+
* Bring a bound element to the front of its tool's layer. An element no tool
|
|
88
|
+
* is bound to is left alone.
|
|
106
89
|
*
|
|
107
90
|
* @param element DOM element to bring forward
|
|
108
91
|
*/
|
|
109
92
|
bringToFront(element: HTMLElement): void;
|
|
110
93
|
/**
|
|
111
|
-
*
|
|
94
|
+
* Ids of the tools an element registration currently holds.
|
|
112
95
|
*/
|
|
113
96
|
getRegisteredTools(): string[];
|
|
114
97
|
/**
|
|
115
98
|
* Get tool element by ID
|
|
116
99
|
*/
|
|
117
100
|
getToolElement(id: string): HTMLElement | null;
|
|
101
|
+
private setVisible;
|
|
102
|
+
private detachElement;
|
|
118
103
|
/**
|
|
119
|
-
*
|
|
104
|
+
* Put `entry` in front of its layer. The layer is renumbered from its base on
|
|
105
|
+
* every move, so its z-indices stay within it however often tools are raised.
|
|
120
106
|
*/
|
|
121
|
-
private
|
|
107
|
+
private stackOnTop;
|
|
122
108
|
/**
|
|
123
|
-
*
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
*
|
|
128
|
-
|
|
129
|
-
resetZIndices(): void;
|
|
130
|
-
/**
|
|
131
|
-
* Update tool element reference
|
|
109
|
+
* Bind the element a tool stacks by. It takes the tool's z-index and comes to
|
|
110
|
+
* the front of the layer when pressed, and when bound while the tool is shown.
|
|
111
|
+
*
|
|
112
|
+
* The outermost element stacks: binding an element inside the bound one keeps
|
|
113
|
+
* the binding, so a tool rendered inside a toolbar's floating window stacks
|
|
114
|
+
* by that window whichever binds first.
|
|
132
115
|
*
|
|
133
116
|
* @param id Tool identifier
|
|
134
117
|
* @param element New DOM element
|
|
135
118
|
*/
|
|
136
119
|
updateToolElement(id: string, element: HTMLElement): void;
|
|
137
120
|
/**
|
|
138
|
-
* Hide
|
|
121
|
+
* Hide every visible tool, or every instance of one tool with
|
|
122
|
+
* `{ baseId }`, notifying subscribers once.
|
|
139
123
|
*/
|
|
140
|
-
hideAllTools(): void;
|
|
124
|
+
hideAllTools(filter?: ToolStateFilter): void;
|
|
141
125
|
/**
|
|
142
|
-
*
|
|
126
|
+
* State of a tool an element registration holds.
|
|
143
127
|
*
|
|
144
128
|
* @param id Tool identifier
|
|
145
|
-
* @returns Tool state or undefined
|
|
146
129
|
*/
|
|
147
130
|
getToolState(id: string): ToolState | undefined;
|
|
148
131
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* @
|
|
132
|
+
* Every visible tool, or every visible instance of one tool with
|
|
133
|
+
* `{ baseId }`. A tool shown while its element re-renders counts, as
|
|
134
|
+
* {@link isToolVisible} counts it.
|
|
152
135
|
*/
|
|
153
|
-
getVisibleTools(): ToolState[];
|
|
136
|
+
getVisibleTools(filter?: ToolStateFilter): ToolState[];
|
|
154
137
|
}
|