@pie-players/pie-assessment-toolkit 0.2.9 → 0.2.11
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/dist/components/ItemToolBar.custom-element.js +425 -93
- package/dist/components/PieAssessmentToolkit.custom-element.js +200 -46
- package/dist/components/SectionToolBar.custom-element.js +162 -0
- package/dist/components/section-toolbar-element.d.ts +3 -0
- package/dist/components/section-toolbar-element.d.ts.map +1 -0
- package/dist/components/section-toolbar-element.js +2 -0
- package/dist/components/section-toolbar-element.js.map +1 -0
- package/dist/context/assessment-toolkit-context.d.ts +1 -1
- package/dist/context/assessment-toolkit-context.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime/SectionRuntimeEngine.d.ts +57 -1
- package/dist/runtime/SectionRuntimeEngine.d.ts.map +1 -1
- package/dist/runtime/SectionRuntimeEngine.js +23 -0
- package/dist/runtime/SectionRuntimeEngine.js.map +1 -1
- package/dist/runtime/registration-events.d.ts +19 -0
- package/dist/runtime/registration-events.d.ts.map +1 -1
- package/dist/runtime/registration-events.js +3 -0
- package/dist/runtime/registration-events.js.map +1 -1
- package/dist/runtime/runtime-event-guards.d.ts +0 -1
- package/dist/runtime/runtime-event-guards.d.ts.map +1 -1
- package/dist/runtime/runtime-event-guards.js +0 -5
- package/dist/runtime/runtime-event-guards.js.map +1 -1
- package/dist/runtime/session-event-emitter-policy.d.ts +12 -0
- package/dist/runtime/session-event-emitter-policy.d.ts.map +1 -0
- package/dist/runtime/session-event-emitter-policy.js +57 -0
- package/dist/runtime/session-event-emitter-policy.js.map +1 -0
- package/dist/services/HighlightCoordinator.d.ts +9 -0
- package/dist/services/HighlightCoordinator.d.ts.map +1 -1
- package/dist/services/HighlightCoordinator.js +196 -55
- package/dist/services/HighlightCoordinator.js.map +1 -1
- package/dist/services/TTSService.d.ts +18 -0
- package/dist/services/TTSService.d.ts.map +1 -1
- package/dist/services/TTSService.js +343 -105
- package/dist/services/TTSService.js.map +1 -1
- package/dist/services/ToolRegistry.d.ts +40 -2
- package/dist/services/ToolRegistry.d.ts.map +1 -1
- package/dist/services/ToolRegistry.js +22 -1
- package/dist/services/ToolRegistry.js.map +1 -1
- package/dist/services/ToolkitCoordinator.d.ts +34 -1
- package/dist/services/ToolkitCoordinator.d.ts.map +1 -1
- package/dist/services/ToolkitCoordinator.js +203 -2
- package/dist/services/ToolkitCoordinator.js.map +1 -1
- package/dist/services/createDefaultToolRegistry.d.ts +5 -11
- package/dist/services/createDefaultToolRegistry.d.ts.map +1 -1
- package/dist/services/createDefaultToolRegistry.js +5 -48
- package/dist/services/createDefaultToolRegistry.js.map +1 -1
- package/dist/services/interfaces.d.ts +7 -2
- package/dist/services/interfaces.d.ts.map +1 -1
- package/dist/services/interfaces.js.map +1 -1
- package/dist/services/pnp-standard-features.d.ts +1 -1
- package/dist/services/section-controller-types.d.ts +5 -0
- package/dist/services/section-controller-types.d.ts.map +1 -1
- package/dist/services/tool-config-defaults.d.ts +14 -0
- package/dist/services/tool-config-defaults.d.ts.map +1 -0
- package/dist/services/tool-config-defaults.js +23 -0
- package/dist/services/tool-config-defaults.js.map +1 -0
- package/dist/services/tool-context.d.ts.map +1 -1
- package/dist/services/tool-context.js +50 -3
- package/dist/services/tool-context.js.map +1 -1
- package/dist/services/tool-instance-id.d.ts +1 -3
- package/dist/services/tool-instance-id.d.ts.map +1 -1
- package/dist/services/tool-instance-id.js +4 -10
- package/dist/services/tool-instance-id.js.map +1 -1
- package/dist/services/toolbar-items.d.ts +26 -0
- package/dist/services/toolbar-items.d.ts.map +1 -0
- package/dist/services/toolbar-items.js +10 -0
- package/dist/services/toolbar-items.js.map +1 -0
- package/dist/services/tools-config-normalizer.d.ts.map +1 -1
- package/dist/services/tools-config-normalizer.js +5 -6
- package/dist/services/tools-config-normalizer.js.map +1 -1
- package/dist/services/tts/browser-provider.d.ts.map +1 -1
- package/dist/services/tts/browser-provider.js +201 -34
- package/dist/services/tts/browser-provider.js.map +1 -1
- package/dist/services/tts/text-processing.d.ts +17 -0
- package/dist/services/tts/text-processing.d.ts.map +1 -0
- package/dist/services/tts/text-processing.js +144 -0
- package/dist/services/tts/text-processing.js.map +1 -0
- package/dist/tools/default-tool-module-loaders.d.ts.map +1 -1
- package/dist/tools/default-tool-module-loaders.js +1 -7
- package/dist/tools/default-tool-module-loaders.js.map +1 -1
- package/dist/tools/registrations/accessibility-tools.d.ts +7 -2
- package/dist/tools/registrations/accessibility-tools.d.ts.map +1 -1
- package/dist/tools/registrations/accessibility-tools.js +23 -15
- package/dist/tools/registrations/accessibility-tools.js.map +1 -1
- package/dist/tools/registrations/calculator.d.ts.map +1 -1
- package/dist/tools/registrations/calculator.js +18 -10
- package/dist/tools/registrations/calculator.js.map +1 -1
- package/dist/tools/registrations/interaction-tools.d.ts.map +1 -1
- package/dist/tools/registrations/interaction-tools.js +5 -4
- package/dist/tools/registrations/interaction-tools.js.map +1 -1
- package/dist/tools/registrations/measurement-tools.js +4 -4
- package/dist/tools/registrations/measurement-tools.js.map +1 -1
- package/dist/tools/registrations/subject-specific-tools.js +4 -4
- package/dist/tools/registrations/subject-specific-tools.js.map +1 -1
- package/dist/tools/registrations/tts.d.ts.map +1 -1
- package/dist/tools/registrations/tts.js +161 -17
- package/dist/tools/registrations/tts.js.map +1 -1
- package/dist/tools/tool-tag-map.d.ts.map +1 -1
- package/dist/tools/tool-tag-map.js +2 -1
- package/dist/tools/tool-tag-map.js.map +1 -1
- package/package.json +12 -8
- package/src/components/ItemToolBar.svelte +275 -47
- package/src/components/PieAssessmentToolkit.svelte +217 -53
- package/src/components/SectionToolBar.svelte +58 -0
- package/dist/services/tts/provider-interface.d.ts +0 -131
- package/dist/services/tts/provider-interface.d.ts.map +0 -1
- package/dist/services/tts/provider-interface.js +0 -10
- package/dist/services/tts/provider-interface.js.map +0 -1
- package/src/components/PNPProvenanceViewer.svelte +0 -270
|
@@ -12,14 +12,22 @@ import { connectAssessmentToolkitHostRuntimeContext } from "../context/runtime-c
|
|
|
12
12
|
import { ToolkitCoordinator } from "../services/ToolkitCoordinator.js";
|
|
13
13
|
|
|
14
14
|
import {
|
|
15
|
-
|
|
15
|
+
PIE_INTERNAL_CONTENT_LOADED_EVENT,
|
|
16
|
+
PIE_INTERNAL_ITEM_SESSION_CHANGED_EVENT,
|
|
17
|
+
PIE_INTERNAL_ITEM_PLAYER_ERROR_EVENT,
|
|
16
18
|
PIE_REGISTER_EVENT,
|
|
17
19
|
PIE_UNREGISTER_EVENT
|
|
18
20
|
} from "../runtime/registration-events.js";
|
|
19
21
|
|
|
20
22
|
import { dispatchCrossBoundaryEvent } from "../runtime/tool-host-contract.js";
|
|
21
23
|
import { SectionRuntimeEngine } from "../runtime/SectionRuntimeEngine.js";
|
|
22
|
-
import { createRuntimeId
|
|
24
|
+
import { createRuntimeId } from "../runtime/runtime-event-guards.js";
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
createSessionEmitPolicyState,
|
|
28
|
+
resetSessionEmitPolicyState,
|
|
29
|
+
shouldEmitCanonicalSessionEvent
|
|
30
|
+
} from "../runtime/session-event-emitter-policy.js";
|
|
23
31
|
|
|
24
32
|
var root = $.from_html(`<div class="pie-assessment-toolkit-anchor svelte-vpe4u2" aria-hidden="true"></div> <!>`, 1);
|
|
25
33
|
|
|
@@ -34,11 +42,12 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
34
42
|
|
|
35
43
|
const runtimeId = createRuntimeId("toolkit");
|
|
36
44
|
const sectionEngine = new SectionRuntimeEngine();
|
|
45
|
+
const DEFAULT_ENV = { mode: "gather", role: "student" };
|
|
37
46
|
|
|
38
47
|
const DEFAULT_ITEM_PLAYER_BY_TYPE = {
|
|
39
|
-
iife: "pie-
|
|
40
|
-
esm: "pie-
|
|
41
|
-
|
|
48
|
+
iife: "pie-item-player",
|
|
49
|
+
esm: "pie-item-player",
|
|
50
|
+
preloaded: "pie-item-player",
|
|
42
51
|
custom: ""
|
|
43
52
|
};
|
|
44
53
|
|
|
@@ -68,7 +77,11 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
68
77
|
let compositionVersion = $.state(0);
|
|
69
78
|
let compositionModel = $.state(null);
|
|
70
79
|
let runtimeError = $.state(null);
|
|
71
|
-
let
|
|
80
|
+
let lastCompositionRevisionKey = $.state("");
|
|
81
|
+
let pendingCompositionModel = null;
|
|
82
|
+
let pendingCompositionEmit = false;
|
|
83
|
+
let compositionEmitRaf = null;
|
|
84
|
+
const sessionEmitPolicyState = createSessionEmitPolicyState();
|
|
72
85
|
|
|
73
86
|
function getHostElement() {
|
|
74
87
|
if (!$.get(anchor)) return null;
|
|
@@ -90,8 +103,53 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
90
103
|
dispatchCrossBoundaryEvent($.get(host), name, detail);
|
|
91
104
|
}
|
|
92
105
|
|
|
106
|
+
function hashString(input) {
|
|
107
|
+
let hash = 5381;
|
|
108
|
+
|
|
109
|
+
for (let index = 0; index < input.length; index += 1) {
|
|
110
|
+
hash = (hash << 5) + hash ^ input.charCodeAt(index);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return (hash >>> 0).toString(36);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function getCompositionRevisionKey(model) {
|
|
117
|
+
const typed = model || {};
|
|
118
|
+
const sectionId = typed.section?.identifier || typed.sectionId || "";
|
|
119
|
+
const currentItemIndex = typeof typed.currentItemIndex === "number" ? typed.currentItemIndex : -1;
|
|
120
|
+
const renderables = Array.isArray(typed.renderables) ? typed.renderables : [];
|
|
121
|
+
|
|
122
|
+
const renderableSignature = renderables.map((entry, index) => {
|
|
123
|
+
const row = entry || {};
|
|
124
|
+
const entity = row.entity || {};
|
|
125
|
+
const entityId = typeof entity.id === "string" && entity.id || `renderable-${index}`;
|
|
126
|
+
const entityVersion = typeof entity.version === "string" && entity.version || (typeof entity.version === "number" ? String(entity.version) : "") || (typeof entity.config?.version === "string" ? entity.config.version : "");
|
|
127
|
+
|
|
128
|
+
return `${entityId}:${entityVersion}`;
|
|
129
|
+
}).join("|");
|
|
130
|
+
|
|
131
|
+
const sessionsByItem = typed.itemSessionsByItemId || {};
|
|
132
|
+
|
|
133
|
+
const itemSessionSignature = Object.keys(sessionsByItem).sort((left, right) => left.localeCompare(right)).map((itemId) => {
|
|
134
|
+
const session = sessionsByItem[itemId];
|
|
135
|
+
const sessionId = typeof session?.id === "string" && session.id || "";
|
|
136
|
+
const dataPayload = Array.isArray(session?.data) ? session.data : [];
|
|
137
|
+
let payloadSignature = "";
|
|
138
|
+
|
|
139
|
+
try {
|
|
140
|
+
payloadSignature = hashString(JSON.stringify(dataPayload));
|
|
141
|
+
} catch {
|
|
142
|
+
payloadSignature = String(dataPayload.length);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return `${itemId}:${sessionId}:${payloadSignature}`;
|
|
146
|
+
}).join("|");
|
|
147
|
+
|
|
148
|
+
return `${sectionId}|${currentItemIndex}|${renderableSignature}|${itemSessionSignature}`;
|
|
149
|
+
}
|
|
150
|
+
|
|
93
151
|
function isKnownPlayerType(value) {
|
|
94
|
-
return value === "iife" || value === "esm" || value === "
|
|
152
|
+
return value === "iife" || value === "esm" || value === "preloaded" || value === "custom";
|
|
95
153
|
}
|
|
96
154
|
|
|
97
155
|
function normalizeItemPlayerConfig(hostPlayer, hostPlayerType) {
|
|
@@ -124,6 +182,23 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
124
182
|
};
|
|
125
183
|
}
|
|
126
184
|
|
|
185
|
+
function normalizeEnv(input) {
|
|
186
|
+
const envValue = input || {} || {};
|
|
187
|
+
const mode = typeof envValue.mode === "string" && envValue.mode.trim() ? envValue.mode.trim() : DEFAULT_ENV.mode;
|
|
188
|
+
const role = typeof envValue.role === "string" && envValue.role.trim() ? envValue.role.trim() : DEFAULT_ENV.role;
|
|
189
|
+
|
|
190
|
+
return { mode, role };
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function resolveSectionViewFromEnv(input) {
|
|
194
|
+
const resolvedEnv = normalizeEnv(input);
|
|
195
|
+
|
|
196
|
+
if (resolvedEnv.mode === "author") return "author";
|
|
197
|
+
if (resolvedEnv.role === "instructor") return "scorer";
|
|
198
|
+
|
|
199
|
+
return "candidate";
|
|
200
|
+
}
|
|
201
|
+
|
|
127
202
|
async function createDefaultSectionController() {
|
|
128
203
|
if (createSectionController()) {
|
|
129
204
|
return createSectionController()();
|
|
@@ -175,6 +250,8 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
175
250
|
|
|
176
251
|
const effectiveAssessmentId = $.derived(() => assessmentId() || $.get(effectiveCoordinator)?.assessmentId || "");
|
|
177
252
|
const effectiveSectionId = $.derived(() => sectionId() || section()?.identifier || `section-${$.get(effectiveAssessmentId) || "default"}`);
|
|
253
|
+
const effectiveEnv = $.derived(() => normalizeEnv(env()));
|
|
254
|
+
const effectiveSectionView = $.derived(() => resolveSectionViewFromEnv($.get(effectiveEnv)));
|
|
178
255
|
const effectiveItemPlayer = $.derived(() => normalizeItemPlayerConfig(player(), playerType()));
|
|
179
256
|
|
|
180
257
|
const runtimeContextValue = $.derived(() => {
|
|
@@ -194,9 +271,8 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
194
271
|
itemPlayer: $.get(effectiveItemPlayer),
|
|
195
272
|
reportSessionChanged: (itemId, detail) => {
|
|
196
273
|
const result = sectionEngine.handleItemSessionChanged(itemId, detail);
|
|
197
|
-
const normalized = result?.eventDetail || detail;
|
|
198
274
|
|
|
199
|
-
|
|
275
|
+
emitNormalizedSessionChanged({ itemId, result, fallbackSession: detail });
|
|
200
276
|
}
|
|
201
277
|
};
|
|
202
278
|
});
|
|
@@ -207,33 +283,14 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
207
283
|
return { runtimeId, coordinator: $.get(effectiveCoordinator) };
|
|
208
284
|
});
|
|
209
285
|
|
|
210
|
-
function
|
|
211
|
-
const
|
|
212
|
-
const itemIds = Array.isArray(typed?.items) ? typed.items.map((item) => item?.id || "") : [];
|
|
213
|
-
const passageIds = Array.isArray(typed?.passages) ? typed.passages.map((item) => item?.id || "") : [];
|
|
214
|
-
|
|
215
|
-
const sessionByItem = typed?.itemSessionsByItemId
|
|
216
|
-
? Object.entries(typed.itemSessionsByItemId).sort(([left], [right]) => left.localeCompare(right)).map(([itemId, session]) => [itemId, JSON.stringify(session ?? null)])
|
|
217
|
-
: [];
|
|
218
|
-
|
|
219
|
-
return JSON.stringify({
|
|
220
|
-
sectionId: typed?.section?.identifier || typed?.sectionId || "",
|
|
221
|
-
currentItemIndex: typed?.currentItemIndex ?? -1,
|
|
222
|
-
itemIds,
|
|
223
|
-
passageIds,
|
|
224
|
-
sessionByItem
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
function emitCompositionChanged() {
|
|
229
|
-
const nextModel = sectionEngine.getCompositionModel();
|
|
230
|
-
const signature = getCompositionSignature(nextModel);
|
|
286
|
+
function flushCompositionChanged(nextModel) {
|
|
287
|
+
const nextRevisionKey = getCompositionRevisionKey(nextModel);
|
|
231
288
|
|
|
232
|
-
if (
|
|
289
|
+
if (nextRevisionKey === $.get(lastCompositionRevisionKey)) {
|
|
233
290
|
return;
|
|
234
291
|
}
|
|
235
292
|
|
|
236
|
-
$.set(
|
|
293
|
+
$.set(lastCompositionRevisionKey, nextRevisionKey, true);
|
|
237
294
|
$.set(compositionVersion, $.get(compositionVersion) + 1);
|
|
238
295
|
$.set(compositionModel, nextModel, true);
|
|
239
296
|
|
|
@@ -243,6 +300,45 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
243
300
|
});
|
|
244
301
|
}
|
|
245
302
|
|
|
303
|
+
function emitCompositionChanged(nextModel) {
|
|
304
|
+
pendingCompositionModel = nextModel ?? sectionEngine.getCompositionModel();
|
|
305
|
+
|
|
306
|
+
if (pendingCompositionEmit) return;
|
|
307
|
+
|
|
308
|
+
pendingCompositionEmit = true;
|
|
309
|
+
|
|
310
|
+
const flush = () => {
|
|
311
|
+
pendingCompositionEmit = false;
|
|
312
|
+
compositionEmitRaf = null;
|
|
313
|
+
flushCompositionChanged(pendingCompositionModel);
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
if (typeof window !== "undefined" && typeof window.requestAnimationFrame === "function") {
|
|
317
|
+
compositionEmitRaf = window.requestAnimationFrame(flush);
|
|
318
|
+
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
queueMicrotask(flush);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function emitNormalizedSessionChanged(args) {
|
|
326
|
+
const normalized = args.result?.eventDetail || args.fallbackSession;
|
|
327
|
+
|
|
328
|
+
const payload = {
|
|
329
|
+
...normalized,
|
|
330
|
+
itemId: args.itemId,
|
|
331
|
+
canonicalItemId: args.canonicalItemId || args.itemId,
|
|
332
|
+
sourceRuntimeId: runtimeId
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
if (!shouldEmitCanonicalSessionEvent({ state: sessionEmitPolicyState, itemId: args.itemId, payload })) {
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
emit("session-changed", payload);
|
|
340
|
+
}
|
|
341
|
+
|
|
246
342
|
function isLocalToCurrentRuntime(eventTarget) {
|
|
247
343
|
if (!(eventTarget instanceof HTMLElement)) return false;
|
|
248
344
|
|
|
@@ -279,6 +375,15 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
279
375
|
}
|
|
280
376
|
});
|
|
281
377
|
|
|
378
|
+
$.user_effect(() => {
|
|
379
|
+
const currentSectionId = $.get(effectiveSectionId);
|
|
380
|
+
const currentAttemptId = attemptId() || "";
|
|
381
|
+
|
|
382
|
+
void currentSectionId;
|
|
383
|
+
void currentAttemptId;
|
|
384
|
+
resetSessionEmitPolicyState(sessionEmitPolicyState);
|
|
385
|
+
});
|
|
386
|
+
|
|
282
387
|
$.user_effect(() => {
|
|
283
388
|
if (!$.get(host) || !$.get(hostRuntimeContextValue)) return;
|
|
284
389
|
|
|
@@ -310,8 +415,8 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
310
415
|
|
|
311
416
|
$.get(host).setAttribute("data-item-player-type", $.get(effectiveItemPlayer).type);
|
|
312
417
|
$.get(host).setAttribute("data-item-player-tag", $.get(effectiveItemPlayer).tagName);
|
|
313
|
-
$.get(host).setAttribute("data-env-mode", String(
|
|
314
|
-
$.get(host).setAttribute("data-env-role", String(
|
|
418
|
+
$.get(host).setAttribute("data-env-mode", String($.get(effectiveEnv)?.mode || ""));
|
|
419
|
+
$.get(host).setAttribute("data-env-role", String($.get(effectiveEnv)?.role || ""));
|
|
315
420
|
});
|
|
316
421
|
|
|
317
422
|
$.user_effect(() => {
|
|
@@ -351,13 +456,12 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
351
456
|
sectionId: $.get(effectiveSectionId),
|
|
352
457
|
assessmentId: $.get(effectiveAssessmentId),
|
|
353
458
|
attemptId: attemptId() || undefined,
|
|
354
|
-
view:
|
|
459
|
+
view: $.get(effectiveSectionView),
|
|
355
460
|
createDefaultController: createDefaultSectionController,
|
|
356
461
|
onCompositionChanged: (nextComposition) => {
|
|
357
462
|
if (cancelled) return;
|
|
358
463
|
|
|
359
|
-
|
|
360
|
-
emitCompositionChanged();
|
|
464
|
+
emitCompositionChanged(nextComposition);
|
|
361
465
|
}
|
|
362
466
|
}).then(() => {
|
|
363
467
|
if (cancelled) return;
|
|
@@ -366,12 +470,14 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
366
470
|
runtimeId,
|
|
367
471
|
assessmentId: $.get(effectiveAssessmentId),
|
|
368
472
|
sectionId: $.get(effectiveSectionId),
|
|
369
|
-
itemPlayer: $.get(effectiveItemPlayer)
|
|
473
|
+
itemPlayer: $.get(effectiveItemPlayer),
|
|
474
|
+
coordinator: $.get(effectiveCoordinator)
|
|
370
475
|
});
|
|
371
476
|
|
|
372
477
|
emit("section-ready", { sectionId: $.get(effectiveSectionId) });
|
|
373
478
|
}).catch((error) => {
|
|
374
479
|
$.set(runtimeError, error, true);
|
|
480
|
+
sectionEngine.reportSectionError({ source: "section-runtime", error, timestamp: Date.now() });
|
|
375
481
|
emit("runtime-error", { runtimeId, error });
|
|
376
482
|
});
|
|
377
483
|
|
|
@@ -394,6 +500,8 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
394
500
|
|
|
395
501
|
const changed = sectionEngine.register(detail);
|
|
396
502
|
|
|
503
|
+
sectionEngine.handleContentRegistered(detail);
|
|
504
|
+
|
|
397
505
|
if (changed) emitCompositionChanged();
|
|
398
506
|
};
|
|
399
507
|
|
|
@@ -401,8 +509,13 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
401
509
|
if (!isLocalToCurrentRuntime(event.target)) return;
|
|
402
510
|
|
|
403
511
|
const detail = event.detail;
|
|
512
|
+
|
|
513
|
+
if (!detail?.itemId) return;
|
|
514
|
+
|
|
404
515
|
const changed = detail?.element ? sectionEngine.unregister(detail.element) : false;
|
|
405
516
|
|
|
517
|
+
sectionEngine.handleContentUnregistered(detail);
|
|
518
|
+
|
|
406
519
|
if (changed) emitCompositionChanged();
|
|
407
520
|
};
|
|
408
521
|
|
|
@@ -412,27 +525,61 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
412
525
|
const detail = event.detail;
|
|
413
526
|
|
|
414
527
|
if (!detail?.itemId) return;
|
|
415
|
-
if (!shouldHandleBySourceRuntime(detail.sourceRuntimeId, runtimeId)) return;
|
|
416
528
|
|
|
417
529
|
const result = sectionEngine.handleItemSessionChanged(detail.itemId, detail.session);
|
|
418
|
-
const normalized = result?.eventDetail || detail.session;
|
|
419
530
|
|
|
420
|
-
|
|
421
|
-
|
|
531
|
+
emitNormalizedSessionChanged({
|
|
532
|
+
itemId: detail.itemId,
|
|
533
|
+
canonicalItemId: sectionEngine.getCanonicalItemId(detail.itemId),
|
|
534
|
+
result,
|
|
535
|
+
fallbackSession: detail.session
|
|
536
|
+
});
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
const onContentLoaded = (event) => {
|
|
540
|
+
if (!isLocalToCurrentRuntime(event.target)) return;
|
|
541
|
+
|
|
542
|
+
const detail = event.detail;
|
|
543
|
+
|
|
544
|
+
if (!detail?.itemId) return;
|
|
545
|
+
|
|
546
|
+
sectionEngine.handleContentLoaded({
|
|
547
|
+
itemId: detail.itemId,
|
|
548
|
+
canonicalItemId: detail.canonicalItemId,
|
|
549
|
+
contentKind: detail.contentKind,
|
|
550
|
+
detail: detail.detail,
|
|
551
|
+
timestamp: Date.now()
|
|
552
|
+
});
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
const onItemPlayerError = (event) => {
|
|
556
|
+
if (!isLocalToCurrentRuntime(event.target)) return;
|
|
557
|
+
|
|
558
|
+
const detail = event.detail;
|
|
559
|
+
|
|
560
|
+
if (!detail?.itemId) return;
|
|
561
|
+
|
|
562
|
+
sectionEngine.handleItemPlayerError({
|
|
422
563
|
itemId: detail.itemId,
|
|
423
|
-
canonicalItemId: detail.canonicalItemId
|
|
424
|
-
|
|
564
|
+
canonicalItemId: detail.canonicalItemId,
|
|
565
|
+
contentKind: detail.contentKind,
|
|
566
|
+
error: detail.error,
|
|
567
|
+
timestamp: Date.now()
|
|
425
568
|
});
|
|
426
569
|
};
|
|
427
570
|
|
|
428
571
|
localHost.addEventListener(PIE_REGISTER_EVENT, onRegister);
|
|
429
572
|
localHost.addEventListener(PIE_UNREGISTER_EVENT, onUnregister);
|
|
430
|
-
localHost.addEventListener(
|
|
573
|
+
localHost.addEventListener(PIE_INTERNAL_ITEM_SESSION_CHANGED_EVENT, onItemSessionChanged);
|
|
574
|
+
localHost.addEventListener(PIE_INTERNAL_CONTENT_LOADED_EVENT, onContentLoaded);
|
|
575
|
+
localHost.addEventListener(PIE_INTERNAL_ITEM_PLAYER_ERROR_EVENT, onItemPlayerError);
|
|
431
576
|
|
|
432
577
|
return () => {
|
|
433
578
|
localHost.removeEventListener(PIE_REGISTER_EVENT, onRegister);
|
|
434
579
|
localHost.removeEventListener(PIE_UNREGISTER_EVENT, onUnregister);
|
|
435
|
-
localHost.removeEventListener(
|
|
580
|
+
localHost.removeEventListener(PIE_INTERNAL_ITEM_SESSION_CHANGED_EVENT, onItemSessionChanged);
|
|
581
|
+
localHost.removeEventListener(PIE_INTERNAL_CONTENT_LOADED_EVENT, onContentLoaded);
|
|
582
|
+
localHost.removeEventListener(PIE_INTERNAL_ITEM_PLAYER_ERROR_EVENT, onItemPlayerError);
|
|
436
583
|
};
|
|
437
584
|
});
|
|
438
585
|
|
|
@@ -482,6 +629,13 @@ export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
|
482
629
|
|
|
483
630
|
$.user_effect(() => {
|
|
484
631
|
return () => {
|
|
632
|
+
if (compositionEmitRaf !== null && typeof window !== "undefined") {
|
|
633
|
+
window.cancelAnimationFrame(compositionEmitRaf);
|
|
634
|
+
compositionEmitRaf = null;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
pendingCompositionEmit = false;
|
|
638
|
+
|
|
485
639
|
void sectionEngine.dispose().catch((error) => {
|
|
486
640
|
$.set(runtimeError, error, true);
|
|
487
641
|
});
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import 'svelte/internal/disclose-version';
|
|
3
|
+
import * as $ from 'svelte/internal/client';
|
|
4
|
+
import "./item-toolbar-element.js";
|
|
5
|
+
|
|
6
|
+
var root = $.from_html(`<pie-item-toolbar></pie-item-toolbar>`, 2);
|
|
7
|
+
|
|
8
|
+
export default function SectionToolBar($$anchor, $$props) {
|
|
9
|
+
$.push($$props, true);
|
|
10
|
+
|
|
11
|
+
let enabledTools = $.prop($$props, 'enabledTools', 7, ""),
|
|
12
|
+
position = $.prop($$props, 'position', 7, "bottom"),
|
|
13
|
+
sectionId = $.prop($$props, 'sectionId', 7, ""),
|
|
14
|
+
size = $.prop($$props, 'size', 7, "md"),
|
|
15
|
+
language = $.prop($$props, 'language', 7, "en-US"),
|
|
16
|
+
toolRegistry = $.prop($$props, 'toolRegistry', 7, null),
|
|
17
|
+
pnpResolver = $.prop($$props, 'pnpResolver', 7, null),
|
|
18
|
+
assessment = $.prop($$props, 'assessment', 7, null),
|
|
19
|
+
itemRef = $.prop($$props, 'itemRef', 7, null),
|
|
20
|
+
item = $.prop($$props, 'item', 7, null),
|
|
21
|
+
hostButtons = $.prop($$props, 'hostButtons', 23, () => []);
|
|
22
|
+
|
|
23
|
+
var $$exports = {
|
|
24
|
+
get enabledTools() {
|
|
25
|
+
return enabledTools();
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
set enabledTools($$value) {
|
|
29
|
+
enabledTools($$value);
|
|
30
|
+
$.flush();
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
get position() {
|
|
34
|
+
return position();
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
set position($$value) {
|
|
38
|
+
position($$value);
|
|
39
|
+
$.flush();
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
get sectionId() {
|
|
43
|
+
return sectionId();
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
set sectionId($$value) {
|
|
47
|
+
sectionId($$value);
|
|
48
|
+
$.flush();
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
get size() {
|
|
52
|
+
return size();
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
set size($$value) {
|
|
56
|
+
size($$value);
|
|
57
|
+
$.flush();
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
get language() {
|
|
61
|
+
return language();
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
set language($$value) {
|
|
65
|
+
language($$value);
|
|
66
|
+
$.flush();
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
get toolRegistry() {
|
|
70
|
+
return toolRegistry();
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
set toolRegistry($$value) {
|
|
74
|
+
toolRegistry($$value);
|
|
75
|
+
$.flush();
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
get pnpResolver() {
|
|
79
|
+
return pnpResolver();
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
set pnpResolver($$value) {
|
|
83
|
+
pnpResolver($$value);
|
|
84
|
+
$.flush();
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
get assessment() {
|
|
88
|
+
return assessment();
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
set assessment($$value) {
|
|
92
|
+
assessment($$value);
|
|
93
|
+
$.flush();
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
get itemRef() {
|
|
97
|
+
return itemRef();
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
set itemRef($$value) {
|
|
101
|
+
itemRef($$value);
|
|
102
|
+
$.flush();
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
get item() {
|
|
106
|
+
return item();
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
set item($$value) {
|
|
110
|
+
item($$value);
|
|
111
|
+
$.flush();
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
get hostButtons() {
|
|
115
|
+
return hostButtons();
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
set hostButtons($$value) {
|
|
119
|
+
hostButtons($$value);
|
|
120
|
+
$.flush();
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
var pie_item_toolbar = root();
|
|
125
|
+
|
|
126
|
+
$.set_custom_element_data(pie_item_toolbar, 'level', 'section');
|
|
127
|
+
$.template_effect(() => $.set_custom_element_data(pie_item_toolbar, 'scope-id', sectionId()));
|
|
128
|
+
$.template_effect(() => $.set_custom_element_data(pie_item_toolbar, 'section-id', sectionId()));
|
|
129
|
+
$.template_effect(() => $.set_custom_element_data(pie_item_toolbar, 'tools', enabledTools()));
|
|
130
|
+
$.set_custom_element_data(pie_item_toolbar, 'content-kind', 'section');
|
|
131
|
+
$.template_effect(() => $.set_custom_element_data(pie_item_toolbar, 'position', position()));
|
|
132
|
+
$.template_effect(() => $.set_custom_element_data(pie_item_toolbar, 'size', size()));
|
|
133
|
+
$.template_effect(() => $.set_custom_element_data(pie_item_toolbar, 'language', language()));
|
|
134
|
+
$.template_effect(() => $.set_custom_element_data(pie_item_toolbar, 'toolRegistry', toolRegistry()));
|
|
135
|
+
$.template_effect(() => $.set_custom_element_data(pie_item_toolbar, 'pnpResolver', pnpResolver()));
|
|
136
|
+
$.template_effect(() => $.set_custom_element_data(pie_item_toolbar, 'assessment', assessment()));
|
|
137
|
+
$.template_effect(() => $.set_custom_element_data(pie_item_toolbar, 'itemRef', itemRef()));
|
|
138
|
+
$.template_effect(() => $.set_custom_element_data(pie_item_toolbar, 'item', item()));
|
|
139
|
+
$.template_effect(() => $.set_custom_element_data(pie_item_toolbar, 'hostButtons', hostButtons()));
|
|
140
|
+
$.append($$anchor, pie_item_toolbar);
|
|
141
|
+
|
|
142
|
+
return $.pop($$exports);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
customElements.define('pie-section-toolbar', $.create_custom_element(
|
|
146
|
+
SectionToolBar,
|
|
147
|
+
{
|
|
148
|
+
enabledTools: { attribute: 'enabled-tools', type: 'String' },
|
|
149
|
+
position: { attribute: 'position', type: 'String' },
|
|
150
|
+
sectionId: { attribute: 'section-id', type: 'String' },
|
|
151
|
+
size: { attribute: 'size', type: 'String' },
|
|
152
|
+
language: { attribute: 'language', type: 'String' },
|
|
153
|
+
toolRegistry: { type: 'Object' },
|
|
154
|
+
pnpResolver: { type: 'Object' },
|
|
155
|
+
assessment: { type: 'Object' },
|
|
156
|
+
itemRef: { type: 'Object' },
|
|
157
|
+
item: { type: 'Object' },
|
|
158
|
+
hostButtons: { type: 'Object' }
|
|
159
|
+
},
|
|
160
|
+
[],
|
|
161
|
+
[]
|
|
162
|
+
));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-toolbar-element.d.ts","sourceRoot":"","sources":["../../src/components/section-toolbar-element.ts"],"names":[],"mappings":"AAAA,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-toolbar-element.js","sourceRoot":"","sources":["../../src/components/section-toolbar-element.ts"],"names":[],"mappings":"AAAA,OAAO,oCAAoC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IAccessibilityCatalogResolver, IElementToolStateStore, IHighlightCoordinator, IToolCoordinator, IToolkitCoordinator, ITTSService } from "../services/interfaces.js";
|
|
2
|
-
export type ItemPlayerType = "iife" | "esm" | "
|
|
2
|
+
export type ItemPlayerType = "iife" | "esm" | "preloaded" | "custom";
|
|
3
3
|
export interface ItemPlayerConfig {
|
|
4
4
|
type: ItemPlayerType;
|
|
5
5
|
tagName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assessment-toolkit-context.d.ts","sourceRoot":"","sources":["../../src/context/assessment-toolkit-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,6BAA6B,EAC7B,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,MAAM,2BAA2B,CAAC;AAEnC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"assessment-toolkit-context.d.ts","sourceRoot":"","sources":["../../src/context/assessment-toolkit-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,6BAA6B,EAC7B,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,MAAM,2BAA2B,CAAC;AAEnC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,QAAQ,CAAC;AAErE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CAAC;CACjC;AAED,eAAO,MAAM,mCAAmC;;CAG9C,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { TypedEventBus } from "./core/TypedEventBus.js";
|
|
|
10
10
|
export type { AssessmentToolkitHostRuntimeContext, AssessmentToolkitRegionScopeContext, AssessmentToolkitRuntimeContext, AssessmentToolkitShellContext, ItemPlayerConfig, ItemPlayerType, ShellContextKind, } from "./context/assessment-toolkit-context.js";
|
|
11
11
|
export { assessmentToolkitHostRuntimeContext, assessmentToolkitRegionScopeContext, assessmentToolkitRuntimeContext, assessmentToolkitShellContext, } from "./context/assessment-toolkit-context.js";
|
|
12
12
|
export { connectAssessmentToolkitHostRuntimeContext, connectAssessmentToolkitRegionScopeContext, connectAssessmentToolkitRuntimeContext, connectAssessmentToolkitShellContext, } from "./context/runtime-context-consumer.js";
|
|
13
|
-
export { PIE_ITEM_SESSION_CHANGED_EVENT, PIE_REGISTER_EVENT, PIE_UNREGISTER_EVENT, type ItemSessionChangedDetail, type RuntimeRegistrationDetail, type RuntimeRegistrationKind, } from "./runtime/registration-events.js";
|
|
13
|
+
export { PIE_INTERNAL_CONTENT_LOADED_EVENT, PIE_INTERNAL_ITEM_SESSION_CHANGED_EVENT, PIE_INTERNAL_ITEM_PLAYER_ERROR_EVENT, PIE_ITEM_SESSION_CHANGED_EVENT, PIE_REGISTER_EVENT, PIE_UNREGISTER_EVENT, type InternalContentLoadedDetail, type InternalItemSessionChangedDetail, type InternalItemPlayerErrorDetail, type ItemSessionChangedDetail, type RuntimeRegistrationDetail, type RuntimeRegistrationKind, } from "./runtime/registration-events.js";
|
|
14
14
|
export { connectToolRegionScopeContext, connectToolRuntimeContext, connectToolShellContext, createCrossBoundaryEvent, dispatchCrossBoundaryEvent, isContextValueDefined, } from "./runtime/tool-host-contract.js";
|
|
15
15
|
export type { IAccessibilityCatalogResolver, IElementToolStateStore, IHighlightCoordinator, II18nService, IThemeProvider, IToolCoordinator, IToolkitCoordinator, ITTSService, ToolState, } from "./services/interfaces.js";
|
|
16
16
|
export type { CatalogLookupOptions, CatalogStatistics, CatalogType, ResolvedCatalog, } from "./services/AccessibilityCatalogResolver.js";
|
|
@@ -45,13 +45,15 @@ export { ToolCoordinator, ZIndexLayer } from "./services/ToolCoordinator.js";
|
|
|
45
45
|
export type { AnswerEliminatorToolConfig, ProviderLifecycleContext, SectionControllerContext, SectionControllerFactoryDefaults, SectionControllerHandle, SectionControllerKey, SectionControllerPersistenceStrategy, SectionPersistenceFactoryDefaults, ToolConfig, ToolkitCoordinatorConfig, ToolkitCoordinatorHooks, ToolkitErrorContext, ToolkitInitStatus, ToolkitServiceBundle, ToolkitToolsConfig, TTSToolConfig, } from "./services/ToolkitCoordinator.js";
|
|
46
46
|
export { ToolkitCoordinator } from "./services/ToolkitCoordinator.js";
|
|
47
47
|
export type { CanonicalToolsConfig, ToolPlacementConfig, ToolPlacementLevel, ToolPolicyConfig, ToolProvidersConfig, } from "./services/tools-config-normalizer.js";
|
|
48
|
+
export type { ToolbarButtonItem, ToolbarItem, ToolbarItemBase, ToolbarLinkItem, } from "./services/toolbar-items.js";
|
|
49
|
+
export { isExternalIconUrl, isInlineSvgIcon, isToolbarLinkItem, } from "./services/toolbar-items.js";
|
|
48
50
|
export { normalizeToolsConfig, normalizeToolAlias, normalizeToolList, parseToolList, resolveToolsForLevel, } from "./services/tools-config-normalizer.js";
|
|
49
|
-
export type { ParsedToolInstanceId,
|
|
51
|
+
export type { ParsedToolInstanceId, ToolScopeLevel, } from "./services/tool-instance-id.js";
|
|
50
52
|
export { createScopedToolId, parseScopedToolId, toOverlayToolId, } from "./services/tool-instance-id.js";
|
|
51
53
|
export type { TTSConfig } from "./services/TTSService.js";
|
|
52
54
|
export { PlaybackState, TTSService } from "./services/TTSService.js";
|
|
53
55
|
export { BrowserTTSProvider } from "./services/tts/browser-provider.js";
|
|
54
|
-
export type { ITTSProvider, ITTSProviderImplementation, TTSFeature, TTSProviderCapabilities, } from "
|
|
56
|
+
export type { ITTSProvider, ITTSProviderImplementation, TTSSpeechSegment, TTSFeature, TTSProviderCapabilities, } from "@pie-players/pie-tts";
|
|
55
57
|
export type { CreateLoadItemOptions, LoadItem, LoadItemOptions, } from "./item-loader.js";
|
|
56
58
|
export { createFetchItemLoader, createLoadItem, ItemLoadError, } from "./item-loader.js";
|
|
57
59
|
export type { StorageLike, TestAttemptItemSession, TestAttemptSession, TestAttemptSessionNavigationState, TestAttemptSessionRealization, } from "./attempt/TestSession.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,YAAY,EACX,mCAAmC,EACnC,mCAAmC,EACnC,+BAA+B,EAC/B,6BAA6B,EAC7B,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GAChB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACN,mCAAmC,EACnC,mCAAmC,EACnC,+BAA+B,EAC/B,6BAA6B,GAC7B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACN,0CAA0C,EAC1C,0CAA0C,EAC1C,sCAAsC,EACtC,oCAAoC,GACpC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACN,8BAA8B,EAC9B,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,GAC5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACN,6BAA6B,EAC7B,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,GACrB,MAAM,iCAAiC,CAAC;AAMzC,YAAY,EACX,6BAA6B,EAC7B,sBAAsB,EACtB,qBAAqB,EACrB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,SAA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,EACtB,4BAA4B,EAC5B,+BAA+B,EAC/B,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,EAClB,qCAAqC,EACrC,iBAAiB,GACjB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACX,2BAA2B,EAC3B,mCAAmC,EACnC,4BAA4B,EAC5B,yBAAyB,EACzB,yBAAyB,GACzB,MAAM,wDAAwD,CAAC;AAChE,OAAO,EACN,8BAA8B,EAC9B,+CAA+C,EAC/C,+BAA+B,EAC/B,oBAAoB,GACpB,MAAM,wDAAwD,CAAC;AAMhE,YAAY,EACX,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EAEtB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAEhB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,GACrB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
export { TypedEventBus } from "./core/TypedEventBus.js";
|
|
13
13
|
export { assessmentToolkitHostRuntimeContext, assessmentToolkitRegionScopeContext, assessmentToolkitRuntimeContext, assessmentToolkitShellContext, } from "./context/assessment-toolkit-context.js";
|
|
14
14
|
export { connectAssessmentToolkitHostRuntimeContext, connectAssessmentToolkitRegionScopeContext, connectAssessmentToolkitRuntimeContext, connectAssessmentToolkitShellContext, } from "./context/runtime-context-consumer.js";
|
|
15
|
-
export { PIE_ITEM_SESSION_CHANGED_EVENT, PIE_REGISTER_EVENT, PIE_UNREGISTER_EVENT, } from "./runtime/registration-events.js";
|
|
15
|
+
export { PIE_INTERNAL_CONTENT_LOADED_EVENT, PIE_INTERNAL_ITEM_SESSION_CHANGED_EVENT, PIE_INTERNAL_ITEM_PLAYER_ERROR_EVENT, PIE_ITEM_SESSION_CHANGED_EVENT, PIE_REGISTER_EVENT, PIE_UNREGISTER_EVENT, } from "./runtime/registration-events.js";
|
|
16
16
|
export { connectToolRegionScopeContext, connectToolRuntimeContext, connectToolShellContext, createCrossBoundaryEvent, dispatchCrossBoundaryEvent, isContextValueDefined, } from "./runtime/tool-host-contract.js";
|
|
17
17
|
export { AccessibilityCatalogResolver } from "./services/AccessibilityCatalogResolver.js";
|
|
18
18
|
// Context Variable Store (QTI 3.0 Context Declarations)
|
|
@@ -36,6 +36,7 @@ export { ThemeProvider } from "./services/ThemeProvider.js";
|
|
|
36
36
|
// Tool Coordinator
|
|
37
37
|
export { ToolCoordinator, ZIndexLayer } from "./services/ToolCoordinator.js";
|
|
38
38
|
export { ToolkitCoordinator } from "./services/ToolkitCoordinator.js";
|
|
39
|
+
export { isExternalIconUrl, isInlineSvgIcon, isToolbarLinkItem, } from "./services/toolbar-items.js";
|
|
39
40
|
export { normalizeToolsConfig, normalizeToolAlias, normalizeToolList, parseToolList, resolveToolsForLevel, } from "./services/tools-config-normalizer.js";
|
|
40
41
|
export { createScopedToolId, parseScopedToolId, toOverlayToolId, } from "./services/tool-instance-id.js";
|
|
41
42
|
export { PlaybackState, TTSService } from "./services/TTSService.js";
|