@pie-players/pie-assessment-toolkit 0.3.67 → 0.3.69
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 +81 -9
- package/dist/attempt/AssessmentSession.d.ts +7 -27
- 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-pe5szfyx.js +46 -0
- package/dist/components/chunks/ItemToolBar-rd7te9r0.js +51 -0
- package/dist/components/item-toolbar-element.js +1 -0
- package/dist/components/pie-assessment-toolkit-element.js +1 -0
- package/dist/components/section-toolbar-element.js +1 -0
- package/dist/context/assessment-toolkit-context.d.ts +28 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.js +4 -2
- package/dist/policy/core/compose-decision.js +14 -0
- package/dist/policy/core/decision-types.d.ts +1 -1
- package/dist/policy/sources/PnpPolicySource.d.ts +8 -0
- package/dist/policy/sources/PnpPolicySource.js +19 -10
- package/dist/runtime/SectionRuntimeEngine.d.ts +56 -0
- package/dist/runtime/SectionRuntimeEngine.js +66 -1
- package/dist/runtime/core/engine-resolver.d.ts +25 -1
- package/dist/runtime/registration-events.d.ts +52 -0
- package/dist/runtime/registration-events.js +2 -0
- package/dist/services/AccessibilityCatalogResolver.js +21 -5
- package/dist/services/I18nService.d.ts +28 -100
- package/dist/services/I18nService.js +43 -233
- package/dist/services/TTSService.d.ts +12 -0
- package/dist/services/TTSService.js +18 -17
- package/dist/services/ToolRegistry.d.ts +120 -2
- package/dist/services/ToolRegistry.js +64 -0
- package/dist/services/ToolkitCoordinator.d.ts +39 -37
- package/dist/services/ToolkitCoordinator.js +40 -0
- package/dist/services/audio-handoff.d.ts +39 -0
- package/dist/services/audio-handoff.js +58 -0
- package/dist/services/catalog-media.d.ts +35 -4
- package/dist/services/catalog-media.js +92 -3
- package/dist/services/framework-error.d.ts +15 -1
- package/dist/services/interfaces.d.ts +28 -0
- package/dist/services/pnp-standard-features.d.ts +1 -1
- package/dist/services/section-controller-types.d.ts +218 -7
- package/dist/services/selection-action.d.ts +49 -0
- package/dist/services/selection-action.js +10 -0
- package/dist/services/spoken-audio-cards.js +5 -1
- package/dist/services/tool-context.d.ts +6 -5
- package/dist/services/tool-context.js +205 -155
- package/dist/services/tool-icons.d.ts +18 -0
- package/dist/services/tool-icons.js +31 -0
- package/dist/services/tool-providers/CortexToolProvider.d.ts +18 -0
- package/dist/services/tool-providers/CortexToolProvider.js +32 -0
- package/dist/services/tool-providers/DesmosToolProvider.d.ts +13 -101
- package/dist/services/tool-providers/DesmosToolProvider.js +14 -145
- package/dist/services/tool-providers/GeoGebraToolProvider.d.ts +21 -0
- package/dist/services/tool-providers/GeoGebraToolProvider.js +32 -0
- package/dist/services/tool-providers/LazyCalculatorToolProvider.d.ts +35 -0
- package/dist/services/tool-providers/LazyCalculatorToolProvider.js +95 -0
- package/dist/services/tool-providers/index.d.ts +4 -0
- package/dist/services/tool-providers/index.js +2 -0
- package/dist/services/tool-request.d.ts +106 -0
- package/dist/services/tool-request.js +127 -0
- package/dist/services/toolbar-items.d.ts +6 -0
- package/dist/tools/client.d.ts +0 -2
- package/dist/tools/client.js +0 -4
- package/dist/tools/internal.d.ts +7 -1
- package/dist/tools/internal.js +8 -1
- package/dist/tools/tool-surface-host.d.ts +57 -0
- package/dist/tools/tool-surface-host.js +610 -0
- package/dist/tools/types.d.ts +1 -66
- package/package.json +22 -12
- package/dist/components/chunks/ItemToolBar-8jgdz50p.js +0 -51
- package/dist/components/chunks/ItemToolBar-cvs646j3.js +0 -36
- package/dist/tools/calculators/desmos-provider.d.ts +0 -46
- package/dist/tools/calculators/desmos-provider.js +0 -393
- package/dist/tools/library-loader.d.ts +0 -62
- package/dist/tools/library-loader.js +0 -261
package/README.md
CHANGED
|
@@ -417,7 +417,11 @@ tools: {
|
|
|
417
417
|
rubric: []
|
|
418
418
|
},
|
|
419
419
|
providers: {
|
|
420
|
-
calculator: {
|
|
420
|
+
calculator: {
|
|
421
|
+
provider: {
|
|
422
|
+
runtime: { authFetcher: async () => ({ apiKey: '...' }) }
|
|
423
|
+
}
|
|
424
|
+
},
|
|
421
425
|
textToSpeech: { enabled: true, backend: 'browser' }
|
|
422
426
|
}
|
|
423
427
|
}
|
|
@@ -478,7 +482,9 @@ tools: {
|
|
|
478
482
|
providers: {
|
|
479
483
|
calculator: {
|
|
480
484
|
enabled: true,
|
|
481
|
-
|
|
485
|
+
provider: {
|
|
486
|
+
runtime: { authFetcher: async () => { /* ... */ } }
|
|
487
|
+
}
|
|
482
488
|
}
|
|
483
489
|
}
|
|
484
490
|
}
|
|
@@ -536,9 +542,13 @@ const coordinator = new ToolkitCoordinator({
|
|
|
536
542
|
providers: {
|
|
537
543
|
calculator: {
|
|
538
544
|
enabled: true,
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
545
|
+
provider: {
|
|
546
|
+
runtime: {
|
|
547
|
+
authFetcher: async () => {
|
|
548
|
+
const response = await fetch('/api/tools/desmos/auth');
|
|
549
|
+
return response.json();
|
|
550
|
+
}
|
|
551
|
+
}
|
|
542
552
|
}
|
|
543
553
|
},
|
|
544
554
|
textToSpeech: { enabled: true, backend: 'browser' }
|
|
@@ -565,14 +575,50 @@ const coordinator = new ToolkitCoordinator({
|
|
|
565
575
|
passage: ['textToSpeech']
|
|
566
576
|
},
|
|
567
577
|
providers: {
|
|
568
|
-
calculator: {
|
|
578
|
+
calculator: {
|
|
579
|
+
enabled: true,
|
|
580
|
+
provider: {
|
|
581
|
+
runtime: { authFetcher: fetchLicensedDesmosApiKey }
|
|
582
|
+
}
|
|
583
|
+
},
|
|
569
584
|
textToSpeech: { enabled: true, backend: 'browser' }
|
|
570
585
|
}
|
|
571
586
|
}
|
|
572
587
|
});
|
|
573
588
|
```
|
|
574
589
|
|
|
575
|
-
The ToolkitCoordinator handles
|
|
590
|
+
The ToolkitCoordinator handles service initialization, provider management, and
|
|
591
|
+
state coordination. With no calculator provider configuration, the existing
|
|
592
|
+
Desmos implementation remains the default and preserves its legacy unkeyed load.
|
|
593
|
+
That fallback is for client compatibility; it does not grant a Desmos license.
|
|
594
|
+
Licensed deployments can supply `provider.init.apiKey` or
|
|
595
|
+
`provider.runtime.authFetcher`. Runtime key delivery avoids committing the key
|
|
596
|
+
but does not hide it from the browser's Desmos script request.
|
|
597
|
+
|
|
598
|
+
Select the separate GeoGebra implementation explicitly without changing the
|
|
599
|
+
calculator capability, placement, or item policy:
|
|
600
|
+
|
|
601
|
+
```typescript
|
|
602
|
+
providers: {
|
|
603
|
+
calculator: {
|
|
604
|
+
provider: { id: 'calculator-geogebra' },
|
|
605
|
+
settings: { showResetIcon: true }
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
Select the bundled open-source implementation in the same way. It uses no API
|
|
611
|
+
key or runtime network request and supports basic, scientific, and focused
|
|
612
|
+
graphing modes:
|
|
613
|
+
|
|
614
|
+
```typescript
|
|
615
|
+
providers: {
|
|
616
|
+
calculator: {
|
|
617
|
+
provider: { id: 'calculator-cortex' },
|
|
618
|
+
settings: { angleMode: 'degree', evaluationTimeLimitMs: 1000 }
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
```
|
|
576
622
|
|
|
577
623
|
### Minimal Server-Backed TTS Config
|
|
578
624
|
|
|
@@ -834,7 +880,15 @@ export interface ToolkitCoordinatorConfig {
|
|
|
834
880
|
};
|
|
835
881
|
calculator?: {
|
|
836
882
|
enabled?: boolean;
|
|
837
|
-
|
|
883
|
+
provider?: {
|
|
884
|
+
id?: 'calculator-desmos' | 'calculator-geogebra' | 'calculator-cortex';
|
|
885
|
+
init?: Record<string, unknown>;
|
|
886
|
+
runtime?: {
|
|
887
|
+
authFetcher?: () => Promise<Record<string, unknown>>;
|
|
888
|
+
};
|
|
889
|
+
};
|
|
890
|
+
settings?: Record<string, unknown>;
|
|
891
|
+
restrictedMode?: boolean;
|
|
838
892
|
};
|
|
839
893
|
};
|
|
840
894
|
};
|
|
@@ -1026,6 +1080,24 @@ const id = highlightCoordinator.addAnnotation(range, 'yellow');
|
|
|
1026
1080
|
highlightCoordinator.removeAnnotation(id);
|
|
1027
1081
|
```
|
|
1028
1082
|
|
|
1083
|
+
Reading highlights resolve through five `component-public` tokens registered in
|
|
1084
|
+
`packages/theme/src/token-registry.json`:
|
|
1085
|
+
|
|
1086
|
+
| Custom property | Default | Description |
|
|
1087
|
+
| --- | --- | --- |
|
|
1088
|
+
| `--pie-tts-word-highlight` | `--pie-missing` at 68% | Fill behind the current word |
|
|
1089
|
+
| `--pie-tts-sentence-highlight` | `--pie-missing` at 38% | Fill behind the current sentence |
|
|
1090
|
+
| `--pie-tts-line-highlight` | `--pie-tts-sentence-highlight` | Fill behind the current line |
|
|
1091
|
+
| `--pie-tts-word-underline` | `--pie-text` at 70% | Underline marking the current word |
|
|
1092
|
+
| `--pie-tts-word-shadow` | `--pie-text` at 35% | Shadow carrying the word over its fill |
|
|
1093
|
+
|
|
1094
|
+
The coordinator derives all five from the active theme's accent, text and
|
|
1095
|
+
background — opacities clamped to a legible band, and the underline colour picked
|
|
1096
|
+
by background luminance so the cue survives a dark scheme — then writes them
|
|
1097
|
+
inline on the document element. Inline styles outrank any author selector, so a
|
|
1098
|
+
host override takes `!important` and owns the contrast the derivation was
|
|
1099
|
+
maintaining, across every scheme it ships.
|
|
1100
|
+
|
|
1029
1101
|
### AccessibilityCatalogResolver
|
|
1030
1102
|
|
|
1031
1103
|
```typescript
|
|
@@ -1486,7 +1558,7 @@ The toolkit enforces a clear separation between ephemeral tool state and persist
|
|
|
1486
1558
|
"answerEliminator": {
|
|
1487
1559
|
"eliminatedChoices": ["choice-b", "choice-d"]
|
|
1488
1560
|
},
|
|
1489
|
-
"
|
|
1561
|
+
"annotationToolbar": {
|
|
1490
1562
|
"annotations": [...]
|
|
1491
1563
|
}
|
|
1492
1564
|
}
|
|
@@ -1,31 +1,11 @@
|
|
|
1
|
-
import type { SectionControllerSessionState } from "
|
|
1
|
+
import type { AssessmentSession, AssessmentSectionSessionState, AssessmentSessionNavigationState, AssessmentSessionRealization, SectionControllerSessionState } from "@pie-players/pie-players-shared/types";
|
|
2
2
|
import type { StorageLike } from "./TestSession.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
seed: string;
|
|
10
|
-
sectionIdentifiers: string[];
|
|
11
|
-
}
|
|
12
|
-
export interface AssessmentSectionSessionState {
|
|
13
|
-
sectionIdentifier: string;
|
|
14
|
-
updatedAt: string;
|
|
15
|
-
session: SectionControllerSessionState | null;
|
|
16
|
-
}
|
|
17
|
-
export interface AssessmentSession {
|
|
18
|
-
version: 1;
|
|
19
|
-
assessmentAttemptSessionIdentifier: string;
|
|
20
|
-
assessmentId: string;
|
|
21
|
-
startedAt: string;
|
|
22
|
-
updatedAt: string;
|
|
23
|
-
completedAt?: string;
|
|
24
|
-
navigationState: AssessmentSessionNavigationState;
|
|
25
|
-
realization: AssessmentSessionRealization;
|
|
26
|
-
sectionSessions: Record<string, AssessmentSectionSessionState>;
|
|
27
|
-
contextVariables?: Record<string, unknown>;
|
|
28
|
-
}
|
|
3
|
+
/**
|
|
4
|
+
* Re-exported so every existing import site keeps its specifier. These shapes are
|
|
5
|
+
* canonical in `@pie-players/pie-players-shared/types`; this module owns the
|
|
6
|
+
* storage helpers over them, not the shapes.
|
|
7
|
+
*/
|
|
8
|
+
export type { AssessmentSession, AssessmentSectionSessionState, AssessmentSessionNavigationState, AssessmentSessionRealization, };
|
|
29
9
|
export declare function getAssessmentSessionStorageKey(assessmentAttemptSessionIdentifier: string): string;
|
|
30
10
|
export declare function loadAssessmentSession(storage: StorageLike, assessmentAttemptSessionIdentifier: string): AssessmentSession | null;
|
|
31
11
|
export declare function saveAssessmentSession(storage: StorageLike, session: AssessmentSession): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunks/ItemToolBar-
|
|
1
|
+
import{a}from"./chunks/ItemToolBar-pe5szfyx.js";import"./chunks/ItemToolBar-rd7te9r0.js";export{a as default};
|