@pie-players/pie-assessment-toolkit 0.2.7 → 0.2.10
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 +200 -67
- package/dist/attempt/TestSession.d.ts +23 -21
- package/dist/attempt/TestSession.d.ts.map +1 -1
- package/dist/attempt/TestSession.js +17 -15
- package/dist/attempt/TestSession.js.map +1 -1
- package/dist/attempt/adapters/activity-to-test-attempt-session.d.ts +50 -0
- package/dist/attempt/adapters/activity-to-test-attempt-session.d.ts.map +1 -0
- package/dist/attempt/adapters/activity-to-test-attempt-session.js +135 -0
- package/dist/attempt/adapters/activity-to-test-attempt-session.js.map +1 -0
- package/dist/components/ItemToolBar.custom-element.js +953 -0
- package/dist/components/PieAssessmentToolkit.custom-element.js +757 -0
- package/dist/components/SectionToolBar.custom-element.js +162 -0
- package/dist/components/item-toolbar-element.d.ts +3 -0
- package/dist/components/item-toolbar-element.d.ts.map +1 -0
- package/dist/components/item-toolbar-element.js +2 -0
- package/dist/components/item-toolbar-element.js.map +1 -0
- package/dist/components/pie-assessment-toolkit-element.d.ts +3 -0
- package/dist/components/pie-assessment-toolkit-element.d.ts.map +1 -0
- package/dist/components/pie-assessment-toolkit-element.js +2 -0
- package/dist/components/pie-assessment-toolkit-element.js.map +1 -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 +52 -0
- package/dist/context/assessment-toolkit-context.d.ts.map +1 -0
- package/dist/context/assessment-toolkit-context.js +6 -0
- package/dist/context/assessment-toolkit-context.js.map +1 -0
- package/dist/context/runtime-context-consumer.d.ts +14 -0
- package/dist/context/runtime-context-consumer.d.ts.map +1 -0
- package/dist/context/runtime-context-consumer.js +52 -0
- package/dist/context/runtime-context-consumer.js.map +1 -0
- package/dist/index.d.ts +19 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -11
- package/dist/index.js.map +1 -1
- package/dist/runtime/RuntimeRegistry.d.ts +13 -0
- package/dist/runtime/RuntimeRegistry.d.ts.map +1 -0
- package/dist/runtime/RuntimeRegistry.js +50 -0
- package/dist/runtime/RuntimeRegistry.js.map +1 -0
- package/dist/runtime/SectionRuntimeEngine.d.ts +45 -0
- package/dist/runtime/SectionRuntimeEngine.d.ts.map +1 -0
- package/dist/runtime/SectionRuntimeEngine.js +81 -0
- package/dist/runtime/SectionRuntimeEngine.js.map +1 -0
- package/dist/runtime/registration-events.d.ts +19 -0
- package/dist/runtime/registration-events.d.ts.map +1 -0
- package/dist/runtime/registration-events.js +4 -0
- package/dist/runtime/registration-events.js.map +1 -0
- package/dist/runtime/runtime-event-guards.d.ts +3 -0
- package/dist/runtime/runtime-event-guards.d.ts.map +1 -0
- package/dist/runtime/runtime-event-guards.js +9 -0
- package/dist/runtime/runtime-event-guards.js.map +1 -0
- package/dist/runtime/tool-host-contract.d.ts +30 -0
- package/dist/runtime/tool-host-contract.d.ts.map +1 -0
- package/dist/runtime/tool-host-contract.js +48 -0
- package/dist/runtime/tool-host-contract.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 +21 -1
- package/dist/services/TTSService.d.ts.map +1 -1
- package/dist/services/TTSService.js +356 -117
- package/dist/services/TTSService.js.map +1 -1
- package/dist/services/ThemeProvider.d.ts +1 -0
- package/dist/services/ThemeProvider.d.ts.map +1 -1
- package/dist/services/ThemeProvider.js +82 -46
- package/dist/services/ThemeProvider.js.map +1 -1
- package/dist/services/ToolConfigResolver.d.ts +1 -1
- package/dist/services/ToolConfigResolver.js +1 -1
- package/dist/services/ToolCoordinator.d.ts +1 -1
- package/dist/services/ToolCoordinator.d.ts.map +1 -1
- package/dist/services/ToolRegistry.d.ts +76 -67
- package/dist/services/ToolRegistry.d.ts.map +1 -1
- package/dist/services/ToolRegistry.js +73 -22
- package/dist/services/ToolRegistry.js.map +1 -1
- package/dist/services/ToolkitCoordinator.d.ts +126 -8
- package/dist/services/ToolkitCoordinator.d.ts.map +1 -1
- package/dist/services/ToolkitCoordinator.js +607 -72
- package/dist/services/ToolkitCoordinator.js.map +1 -1
- package/dist/services/createDefaultToolRegistry.d.ts +11 -12
- package/dist/services/createDefaultToolRegistry.d.ts.map +1 -1
- package/dist/services/createDefaultToolRegistry.js +9 -56
- package/dist/services/createDefaultToolRegistry.js.map +1 -1
- package/dist/services/defaultPersonalNeedsProfile.d.ts +4 -0
- package/dist/services/defaultPersonalNeedsProfile.d.ts.map +1 -0
- package/dist/services/defaultPersonalNeedsProfile.js +25 -0
- package/dist/services/defaultPersonalNeedsProfile.js.map +1 -0
- package/dist/services/interfaces.d.ts +62 -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 +3 -4
- package/dist/services/pnp-standard-features.d.ts.map +1 -1
- package/dist/services/pnp-standard-features.js +0 -3
- package/dist/services/pnp-standard-features.js.map +1 -1
- package/dist/services/section-controller-types.d.ts +37 -0
- package/dist/services/section-controller-types.d.ts.map +1 -0
- package/dist/services/section-controller-types.js +2 -0
- package/dist/services/section-controller-types.js.map +1 -0
- 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 +4 -4
- package/dist/services/tool-context.d.ts.map +1 -1
- package/dist/services/tool-context.js +156 -20
- package/dist/services/tool-context.js.map +1 -1
- package/dist/services/tool-instance-id.d.ts +15 -0
- package/dist/services/tool-instance-id.d.ts.map +1 -0
- package/dist/services/tool-instance-id.js +55 -0
- package/dist/services/tool-instance-id.js.map +1 -0
- package/dist/services/tool-providers/IToolProvider.d.ts +2 -3
- package/dist/services/tool-providers/IToolProvider.d.ts.map +1 -1
- package/dist/services/tool-providers/IToolProvider.js +1 -2
- package/dist/services/tool-providers/IToolProvider.js.map +1 -1
- package/dist/services/tool-providers/MathJsToolProvider.d.ts +25 -0
- package/dist/services/tool-providers/MathJsToolProvider.d.ts.map +1 -0
- package/dist/services/tool-providers/MathJsToolProvider.js +53 -0
- package/dist/services/tool-providers/MathJsToolProvider.js.map +1 -0
- package/dist/services/tool-providers/index.d.ts +2 -0
- package/dist/services/tool-providers/index.d.ts.map +1 -1
- package/dist/services/tool-providers/index.js +1 -0
- package/dist/services/tool-providers/index.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 +26 -0
- package/dist/services/tools-config-normalizer.d.ts.map +1 -0
- package/dist/services/tools-config-normalizer.js +62 -0
- package/dist/services/tools-config-normalizer.js.map +1 -0
- 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/calculators/ti-provider.d.ts.map +1 -1
- package/dist/tools/calculators/ti-provider.js +127 -4
- package/dist/tools/calculators/ti-provider.js.map +1 -1
- package/dist/tools/client.d.ts +2 -1
- package/dist/tools/client.d.ts.map +1 -1
- package/dist/tools/client.js +2 -1
- package/dist/tools/client.js.map +1 -1
- package/dist/tools/default-tool-module-loaders.d.ts +9 -0
- package/dist/tools/default-tool-module-loaders.d.ts.map +1 -0
- package/dist/tools/default-tool-module-loaders.js +11 -0
- package/dist/tools/default-tool-module-loaders.js.map +1 -0
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/library-loader.d.ts +1 -1
- package/dist/tools/library-loader.d.ts.map +1 -1
- package/dist/tools/library-loader.js +7 -2
- package/dist/tools/library-loader.js.map +1 -1
- package/dist/tools/registrations/accessibility-tools.d.ts +8 -11
- package/dist/tools/registrations/accessibility-tools.d.ts.map +1 -1
- package/dist/tools/registrations/accessibility-tools.js +108 -120
- package/dist/tools/registrations/accessibility-tools.js.map +1 -1
- package/dist/tools/registrations/calculator.d.ts +2 -2
- package/dist/tools/registrations/calculator.d.ts.map +1 -1
- package/dist/tools/registrations/calculator.js +42 -55
- 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 +77 -52
- package/dist/tools/registrations/interaction-tools.js.map +1 -1
- package/dist/tools/registrations/measurement-tools.d.ts.map +1 -1
- package/dist/tools/registrations/measurement-tools.js +63 -38
- package/dist/tools/registrations/measurement-tools.js.map +1 -1
- package/dist/tools/registrations/subject-specific-tools.d.ts.map +1 -1
- package/dist/tools/registrations/subject-specific-tools.js +63 -38
- package/dist/tools/registrations/subject-specific-tools.js.map +1 -1
- package/dist/tools/registrations/tts.d.ts +1 -1
- package/dist/tools/registrations/tts.d.ts.map +1 -1
- package/dist/tools/registrations/tts.js +171 -41
- package/dist/tools/registrations/tts.js.map +1 -1
- package/dist/tools/response-discovery.d.ts +12 -14
- package/dist/tools/response-discovery.d.ts.map +1 -1
- package/dist/tools/response-discovery.js +23 -80
- package/dist/tools/response-discovery.js.map +1 -1
- package/dist/tools/tool-tag-map.d.ts +3 -3
- package/dist/tools/tool-tag-map.d.ts.map +1 -1
- package/dist/tools/tool-tag-map.js +4 -4
- package/dist/tools/tool-tag-map.js.map +1 -1
- package/dist/tools/types.d.ts +3 -1
- package/dist/tools/types.d.ts.map +1 -1
- package/package.json +28 -27
- package/src/README.md +16 -32
- package/src/components/ItemToolBar.svelte +701 -0
- package/src/components/PieAssessmentToolkit.svelte +610 -0
- package/src/components/SectionToolBar.svelte +58 -0
- package/src/components/ToolButton.svelte +11 -11
- package/src/components/ToolButtonGroup.svelte +27 -11
- package/src/tools/README.md +6 -5
- package/src/tools/calculators/README.md +4 -4
- package/dist/player/AssessmentPlayer.d.ts +0 -397
- package/dist/player/AssessmentPlayer.d.ts.map +0 -1
- package/dist/player/AssessmentPlayer.js +0 -974
- package/dist/player/AssessmentPlayer.js.map +0 -1
- package/dist/player/index.d.ts +0 -17
- package/dist/player/index.d.ts.map +0 -1
- package/dist/player/index.js +0 -15
- package/dist/player/index.js.map +0 -1
- package/dist/player/navigation-types.d.ts +0 -63
- package/dist/player/navigation-types.d.ts.map +0 -1
- package/dist/player/navigation-types.js +0 -7
- package/dist/player/navigation-types.js.map +0 -1
- package/dist/player/qti-navigation.d.ts +0 -29
- package/dist/player/qti-navigation.d.ts.map +0 -1
- package/dist/player/qti-navigation.js +0 -160
- package/dist/player/qti-navigation.js.map +0 -1
- package/dist/reference-layout/index.d.ts +0 -19
- package/dist/reference-layout/index.d.ts.map +0 -1
- package/dist/reference-layout/index.js +0 -20
- package/dist/reference-layout/index.js.map +0 -1
- package/dist/services/AnnotationToolbarConfig.d.ts +0 -134
- package/dist/services/AnnotationToolbarConfig.d.ts.map +0 -1
- package/dist/services/AnnotationToolbarConfig.js +0 -100
- package/dist/services/AnnotationToolbarConfig.js.map +0 -1
- package/dist/services/AssessmentAuthoringService.d.ts +0 -60
- package/dist/services/AssessmentAuthoringService.d.ts.map +0 -1
- package/dist/services/AssessmentAuthoringService.js +0 -183
- package/dist/services/AssessmentAuthoringService.js.map +0 -1
- package/dist/services/PNPMapper.d.ts +0 -81
- package/dist/services/PNPMapper.d.ts.map +0 -1
- package/dist/services/PNPMapper.js +0 -108
- package/dist/services/PNPMapper.js.map +0 -1
- 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/PNPProfileTester.example.svelte +0 -188
- package/src/components/PNPProfileTester.svelte +0 -397
- package/src/components/PNPProvenanceViewer.svelte +0 -260
- package/src/components/QuestionToolBar.svelte +0 -483
- package/src/player/AssessmentLayout.svelte +0 -68
- package/src/player/README.md +0 -154
- package/src/reference-layout/README.md +0 -135
- package/src/reference-layout/ReferenceLayout.svelte +0 -201
- package/src/reference-layout/components/AssessmentContent.svelte +0 -259
- package/src/reference-layout/components/AssessmentFooter.svelte +0 -89
- package/src/reference-layout/components/AssessmentHeader.svelte +0 -250
- package/src/reference-layout/components/AssessmentNavigation.svelte +0 -134
- package/src/reference-layout/components/AssessmentToolsBar.svelte +0 -176
- package/src/reference-layout/components/ItemPanel.svelte +0 -200
- package/src/reference-layout/components/NotesPanel.svelte +0 -179
- package/src/reference-layout/components/PassagePanel.svelte +0 -76
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TTS Provider Interfaces
|
|
3
|
-
*
|
|
4
|
-
* Defines the contract for text-to-speech providers.
|
|
5
|
-
* Providers are stateless factories that create configured TTS implementations.
|
|
6
|
-
*
|
|
7
|
-
* Part of PIE Assessment Toolkit.
|
|
8
|
-
*/
|
|
9
|
-
import type { TTSConfig } from "../TTSService.js";
|
|
10
|
-
/**
|
|
11
|
-
* TTS Provider interface
|
|
12
|
-
*
|
|
13
|
-
* Providers are stateless factories that create TTS implementations.
|
|
14
|
-
* They describe capabilities and create configured instances.
|
|
15
|
-
*/
|
|
16
|
-
export interface ITTSProvider {
|
|
17
|
-
/**
|
|
18
|
-
* Unique identifier for this provider
|
|
19
|
-
*/
|
|
20
|
-
readonly providerId: string;
|
|
21
|
-
/**
|
|
22
|
-
* Human-readable provider name
|
|
23
|
-
*/
|
|
24
|
-
readonly providerName: string;
|
|
25
|
-
/**
|
|
26
|
-
* Provider version
|
|
27
|
-
*/
|
|
28
|
-
readonly version: string;
|
|
29
|
-
/**
|
|
30
|
-
* Initialize and create a configured TTS implementation
|
|
31
|
-
*/
|
|
32
|
-
initialize(config: TTSConfig): Promise<ITTSProviderImplementation>;
|
|
33
|
-
/**
|
|
34
|
-
* Check if a specific feature is supported
|
|
35
|
-
*/
|
|
36
|
-
supportsFeature(feature: TTSFeature): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Get provider capabilities
|
|
39
|
-
*/
|
|
40
|
-
getCapabilities(): TTSProviderCapabilities;
|
|
41
|
-
/**
|
|
42
|
-
* Clean up provider resources
|
|
43
|
-
*/
|
|
44
|
-
destroy(): void;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* TTS Provider Implementation interface
|
|
48
|
-
*
|
|
49
|
-
* The actual TTS implementation that handles playback.
|
|
50
|
-
* Created by ITTSProvider.initialize()
|
|
51
|
-
*/
|
|
52
|
-
export interface ITTSProviderImplementation {
|
|
53
|
-
/**
|
|
54
|
-
* Speak text
|
|
55
|
-
*/
|
|
56
|
-
speak(text: string): Promise<void>;
|
|
57
|
-
/**
|
|
58
|
-
* Pause playback
|
|
59
|
-
*/
|
|
60
|
-
pause(): void;
|
|
61
|
-
/**
|
|
62
|
-
* Resume playback
|
|
63
|
-
*/
|
|
64
|
-
resume(): void;
|
|
65
|
-
/**
|
|
66
|
-
* Stop playback
|
|
67
|
-
*/
|
|
68
|
-
stop(): void;
|
|
69
|
-
/**
|
|
70
|
-
* Check if currently playing
|
|
71
|
-
*/
|
|
72
|
-
isPlaying(): boolean;
|
|
73
|
-
/**
|
|
74
|
-
* Check if paused
|
|
75
|
-
*/
|
|
76
|
-
isPaused(): boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Update settings dynamically (optional)
|
|
79
|
-
* Allows changing rate, pitch, and voice without full reinitialization.
|
|
80
|
-
* Changes take effect on the next speak() call.
|
|
81
|
-
*/
|
|
82
|
-
updateSettings?(settings: Partial<TTSConfig>): void | Promise<void>;
|
|
83
|
-
/**
|
|
84
|
-
* Word boundary callback (optional)
|
|
85
|
-
* Called during speech for word highlighting
|
|
86
|
-
* @param word - The word being spoken (may be empty for server providers)
|
|
87
|
-
* @param position - Character position in the text
|
|
88
|
-
* @param length - Optional word length (for server providers with speech marks)
|
|
89
|
-
*/
|
|
90
|
-
onWordBoundary?: (word: string, position: number, length?: number) => void;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* TTS Provider capabilities
|
|
94
|
-
*
|
|
95
|
-
* Describes which features a provider supports
|
|
96
|
-
*/
|
|
97
|
-
export interface TTSProviderCapabilities {
|
|
98
|
-
/**
|
|
99
|
-
* Supports pause/resume
|
|
100
|
-
*/
|
|
101
|
-
supportsPause: boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Supports resume after pause
|
|
104
|
-
*/
|
|
105
|
-
supportsResume: boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Supports word boundary events for highlighting
|
|
108
|
-
*/
|
|
109
|
-
supportsWordBoundary: boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Supports voice selection
|
|
112
|
-
*/
|
|
113
|
-
supportsVoiceSelection: boolean;
|
|
114
|
-
/**
|
|
115
|
-
* Supports rate control (speed)
|
|
116
|
-
*/
|
|
117
|
-
supportsRateControl: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Supports pitch control
|
|
120
|
-
*/
|
|
121
|
-
supportsPitchControl: boolean;
|
|
122
|
-
/**
|
|
123
|
-
* Maximum text length (if limited)
|
|
124
|
-
*/
|
|
125
|
-
maxTextLength?: number;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* TTS features for capability checking
|
|
129
|
-
*/
|
|
130
|
-
export type TTSFeature = "pause" | "resume" | "wordBoundary" | "voiceSelection" | "rateControl" | "pitchControl";
|
|
131
|
-
//# sourceMappingURL=provider-interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider-interface.d.ts","sourceRoot":"","sources":["../../../src/services/tts/provider-interface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAEnE;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC;IAE9C;;OAEG;IACH,eAAe,IAAI,uBAAuB,CAAC;IAE3C;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IAC1C;;OAEG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnC;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;OAEG;IACH,MAAM,IAAI,IAAI,CAAC;IAEf;;OAEG;IACH,IAAI,IAAI,IAAI,CAAC;IAEb;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC;IAErB;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC;IAEpB;;;;OAIG;IACH,cAAc,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpE;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3E;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACvC;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GACnB,OAAO,GACP,QAAQ,GACR,cAAc,GACd,gBAAgB,GAChB,aAAa,GACb,cAAc,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TTS Provider Interfaces
|
|
3
|
-
*
|
|
4
|
-
* Defines the contract for text-to-speech providers.
|
|
5
|
-
* Providers are stateless factories that create configured TTS implementations.
|
|
6
|
-
*
|
|
7
|
-
* Part of PIE Assessment Toolkit.
|
|
8
|
-
*/
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=provider-interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider-interface.js","sourceRoot":"","sources":["../../../src/services/tts/provider-interface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Example usage of PNPProfileTester component
|
|
4
|
-
*
|
|
5
|
-
* This demonstrates how to use the PNP Profile Tester for development and testing.
|
|
6
|
-
* Shows integration with PNPToolResolver and PNPProvenanceViewer.
|
|
7
|
-
*/
|
|
8
|
-
import PNPProfileTester from './PNPProfileTester.svelte';
|
|
9
|
-
import PNPProvenanceViewer from './PNPProvenanceViewer.svelte';
|
|
10
|
-
import { PNPToolResolver } from '../services/PNPToolResolver';
|
|
11
|
-
import { createDefaultToolRegistry } from '../services/createDefaultToolRegistry';
|
|
12
|
-
import type { PersonalNeedsProfile } from '@pie-players/pie-players-shared/types';
|
|
13
|
-
import type { PNPResolutionProvenance } from '../services/pnp-provenance';
|
|
14
|
-
|
|
15
|
-
// Mock assessment for testing
|
|
16
|
-
const mockAssessment = {
|
|
17
|
-
id: 'test-assessment-1',
|
|
18
|
-
name: 'Example Assessment',
|
|
19
|
-
personalNeedsProfile: undefined as PersonalNeedsProfile | undefined,
|
|
20
|
-
settings: {
|
|
21
|
-
// Example district policy
|
|
22
|
-
districtPolicy: {
|
|
23
|
-
blockedTools: [], // No blocks in this example
|
|
24
|
-
requiredTools: [], // No requirements in this example
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// Create resolver with default tool registry
|
|
30
|
-
const toolRegistry = createDefaultToolRegistry();
|
|
31
|
-
const resolver = new PNPToolResolver(toolRegistry, true);
|
|
32
|
-
|
|
33
|
-
// State
|
|
34
|
-
let currentProfile = $state<PersonalNeedsProfile | null>(null);
|
|
35
|
-
let resolutionResult = $state<{
|
|
36
|
-
toolIds: string[];
|
|
37
|
-
provenance: PNPResolutionProvenance;
|
|
38
|
-
} | null>(null);
|
|
39
|
-
let showProvenance = $state(true);
|
|
40
|
-
|
|
41
|
-
// Update resolution when profile changes
|
|
42
|
-
function handleProfileChange(profile: PersonalNeedsProfile | null) {
|
|
43
|
-
currentProfile = profile;
|
|
44
|
-
|
|
45
|
-
// Use the override method to test with this profile
|
|
46
|
-
const result = resolver.resolveWithOverride(mockAssessment as any, profile);
|
|
47
|
-
|
|
48
|
-
resolutionResult = {
|
|
49
|
-
toolIds: result.tools.filter((t) => t.enabled).map((t) => t.id),
|
|
50
|
-
provenance: result.provenance,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
</script>
|
|
54
|
-
|
|
55
|
-
<div class="container mx-auto p-4 max-w-6xl">
|
|
56
|
-
<div class="prose mb-6">
|
|
57
|
-
<h1>PNP Profile Tester - Example</h1>
|
|
58
|
-
<p>
|
|
59
|
-
This component allows developers and testers to experiment with different PNP
|
|
60
|
-
(Personal Needs Profile) configurations in real-time.
|
|
61
|
-
</p>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4">
|
|
65
|
-
<!-- Left: Profile Tester -->
|
|
66
|
-
<div>
|
|
67
|
-
<PNPProfileTester onProfileChange={handleProfileChange} />
|
|
68
|
-
</div>
|
|
69
|
-
|
|
70
|
-
<!-- Right: Resolution Results -->
|
|
71
|
-
<div class="space-y-4">
|
|
72
|
-
<!-- Enabled Tools -->
|
|
73
|
-
<div class="card bg-base-100 shadow-sm">
|
|
74
|
-
<div class="card-body">
|
|
75
|
-
<h3 class="card-title text-sm">Resolved Tools</h3>
|
|
76
|
-
{#if resolutionResult && resolutionResult.toolIds.length > 0}
|
|
77
|
-
<div class="space-y-2">
|
|
78
|
-
{#each resolutionResult.toolIds as toolId}
|
|
79
|
-
<div class="badge badge-primary">{toolId}</div>
|
|
80
|
-
{/each}
|
|
81
|
-
</div>
|
|
82
|
-
{:else}
|
|
83
|
-
<p class="text-sm text-base-content/50">
|
|
84
|
-
No tools enabled. Select a profile or add features to see results.
|
|
85
|
-
</p>
|
|
86
|
-
{/if}
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
|
|
90
|
-
<!-- Profile JSON -->
|
|
91
|
-
<div class="card bg-base-100 shadow-sm">
|
|
92
|
-
<div class="card-body">
|
|
93
|
-
<h3 class="card-title text-sm">Current Profile JSON</h3>
|
|
94
|
-
<div class="mockup-code">
|
|
95
|
-
<pre><code>{JSON.stringify(currentProfile, null, 2)}</code></pre>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
|
|
100
|
-
<!-- Provenance Toggle -->
|
|
101
|
-
<div class="form-control">
|
|
102
|
-
<label class="label cursor-pointer">
|
|
103
|
-
<span class="label-text">Show Provenance</span>
|
|
104
|
-
<input
|
|
105
|
-
type="checkbox"
|
|
106
|
-
class="toggle toggle-primary"
|
|
107
|
-
bind:checked={showProvenance}
|
|
108
|
-
/>
|
|
109
|
-
</label>
|
|
110
|
-
</div>
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
|
|
114
|
-
<!-- Full-width Provenance Viewer -->
|
|
115
|
-
{#if showProvenance && resolutionResult}
|
|
116
|
-
<div class="mt-6">
|
|
117
|
-
<PNPProvenanceViewer provenance={resolutionResult.provenance} />
|
|
118
|
-
</div>
|
|
119
|
-
{/if}
|
|
120
|
-
|
|
121
|
-
<!-- Usage Examples -->
|
|
122
|
-
<div class="prose mt-8">
|
|
123
|
-
<h2>Integration Examples</h2>
|
|
124
|
-
|
|
125
|
-
<h3>Basic Usage</h3>
|
|
126
|
-
<pre><code>{`<script>
|
|
127
|
-
import { PNPProfileTester } from '@pie-players/pie-assessment-toolkit/components';
|
|
128
|
-
|
|
129
|
-
let currentProfile;
|
|
130
|
-
</script>
|
|
131
|
-
|
|
132
|
-
<PNPProfileTester
|
|
133
|
-
onProfileChange={(profile) => {
|
|
134
|
-
currentProfile = profile;
|
|
135
|
-
// Apply to your assessment player
|
|
136
|
-
}}
|
|
137
|
-
/>`}</code></pre>
|
|
138
|
-
|
|
139
|
-
<h3>With PNPToolResolver Override</h3>
|
|
140
|
-
<pre><code>{`<script>
|
|
141
|
-
import { PNPProfileTester } from '@pie-players/pie-assessment-toolkit/components';
|
|
142
|
-
import { PNPToolResolver, createDefaultToolRegistry } from '@pie-players/pie-assessment-toolkit';
|
|
143
|
-
|
|
144
|
-
const registry = createDefaultToolRegistry();
|
|
145
|
-
const resolver = new PNPToolResolver(registry);
|
|
146
|
-
|
|
147
|
-
function handleProfileChange(profile) {
|
|
148
|
-
// Test with override profile
|
|
149
|
-
const result = resolver.resolveWithOverride(assessment, profile);
|
|
150
|
-
|
|
151
|
-
// Use resolved tools
|
|
152
|
-
const toolIds = result.tools.filter(t => t.enabled).map(t => t.id);
|
|
153
|
-
|
|
154
|
-
// Show provenance
|
|
155
|
-
console.log(result.provenance);
|
|
156
|
-
}
|
|
157
|
-
</script>
|
|
158
|
-
|
|
159
|
-
<PNPProfileTester onProfileChange={handleProfileChange} />`}</code></pre>
|
|
160
|
-
|
|
161
|
-
<h3>Compact Mode in Sidebar</h3>
|
|
162
|
-
<pre><code>{`<PNPProfileTester compact={true} onProfileChange={handleProfileChange} />`}</code></pre>
|
|
163
|
-
|
|
164
|
-
<h3>Without Custom Features</h3>
|
|
165
|
-
<pre><code>{`<PNPProfileTester
|
|
166
|
-
allowCustomFeatures={false}
|
|
167
|
-
onProfileChange={handleProfileChange}
|
|
168
|
-
/>`}</code></pre>
|
|
169
|
-
</div>
|
|
170
|
-
</div>
|
|
171
|
-
|
|
172
|
-
<style>
|
|
173
|
-
.prose {
|
|
174
|
-
max-width: 100%;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.prose code {
|
|
178
|
-
background-color: hsl(var(--b2));
|
|
179
|
-
padding: 0.125rem 0.375rem;
|
|
180
|
-
border-radius: 0.25rem;
|
|
181
|
-
font-size: 0.875em;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.prose pre code {
|
|
185
|
-
background-color: transparent;
|
|
186
|
-
padding: 0;
|
|
187
|
-
}
|
|
188
|
-
</style>
|