@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/dist/tools/internal.d.ts
CHANGED
|
@@ -20,9 +20,15 @@
|
|
|
20
20
|
*/
|
|
21
21
|
export type { HostedToolContext, HostedToolSize, ResolvedToolContext, ToolActivation, ToolContentDependency, ToolContentDependencyContext, ToolModuleLoader, ToolProviderDescriptor, ToolRegistration, ToolRenderElement, ToolSingletonScope, ToolSurfaceRenderContext, ToolSurfaceRenderResult, ToolSurfaceServices, ToolToolbarButtonDefinition, ToolToolbarRenderResult, ToolWindowShellConfig, ToolbarContext, } from "../services/ToolRegistry.js";
|
|
22
22
|
export { ToolRegistry } from "../services/ToolRegistry.js";
|
|
23
|
+
export { resolveToolRegistrationName } from "../services/ToolRegistry.js";
|
|
23
24
|
export type { CatalogOwnerCard, CatalogOwnerSnapshot, } from "../services/AccessibilityCatalogResolver.js";
|
|
25
|
+
export type { ToolSelectionAction, ToolSelectionContext, } from "../services/selection-action.js";
|
|
26
|
+
export type { ToolOpenRequest, ToolRequestTarget, } from "../services/tool-request.js";
|
|
27
|
+
export { resolveFallbackToolIcon, TOOL_FALLBACK_ICONS, } from "../services/tool-icons.js";
|
|
24
28
|
export type { ContentCapabilityPhase, ContentCapabilityPolicy, ResolveContentCapabilitiesArgs, ResolvedContentCapability, } from "./content-capability-resolution.js";
|
|
25
29
|
export { resolveContentCapabilities } from "./content-capability-resolution.js";
|
|
30
|
+
export type { ToolSurfaceHost, ToolSurfaceHostInput, ToolSurfaceHostOptions, ToolSurfaceHostSnapshot, ToolSurfaceScope, } from "./tool-surface-host.js";
|
|
31
|
+
export { createToolSurfaceHost } from "./tool-surface-host.js";
|
|
26
32
|
export type { ToolContext, ToolLevel } from "../services/tool-context.js";
|
|
27
33
|
export { hasChoiceInteraction, hasMathContent, hasReadableText, hasScienceContent, } from "../services/tool-context.js";
|
|
28
34
|
export { createScopedToolId } from "../services/tool-instance-id.js";
|
|
@@ -32,6 +38,6 @@ export { applyOverlaySurface, createScopedVisibilityBinding, syncButtonAndOverla
|
|
|
32
38
|
export type { ElementToolStateStoreApi, ToolCoordinatorApi, ToolkitCoordinatorApi, TtsServiceApi, } from "../services/interfaces.js";
|
|
33
39
|
export type { ToolPlacementConfig, ToolProviderConfig, } from "../services/tools-config-normalizer.js";
|
|
34
40
|
export type { ToolConfigDiagnostic } from "../services/tool-config-validation.js";
|
|
35
|
-
export { DesmosToolProvider, TTSToolProvider, } from "../services/tool-providers/index.js";
|
|
41
|
+
export { CortexToolProvider, DesmosToolProvider, GeoGebraToolProvider, TTSToolProvider, } from "../services/tool-providers/index.js";
|
|
36
42
|
export type { NormalizedTTSSpeedOption } from "../services/tts-runtime-config.js";
|
|
37
43
|
export { buildRuntimeTTSConfig, normalizeTTSLayoutMode, normalizeTTSSpeedControlOptions, resolveRuntimeProvider, resolveTTSBackend, resolveTTSHostToolbarLayout, resolveTTSLayoutMode, resolveTTSRuntimeSettings, resolveTransportMode, } from "../services/tts-runtime-config.js";
|
package/dist/tools/internal.js
CHANGED
|
@@ -19,7 +19,14 @@
|
|
|
19
19
|
* point — the mechanism is the same one our own registrations use.
|
|
20
20
|
*/
|
|
21
21
|
export { ToolRegistry } from "../services/ToolRegistry.js";
|
|
22
|
+
// A registration's own display name in the interface locale. A tool window's
|
|
23
|
+
// title is the registration's name, so the shell needs the same `nameKey`-then-
|
|
24
|
+
// `name` precedence the toolbar uses rather than the raw English field.
|
|
25
|
+
export { resolveToolRegistrationName } from "../services/ToolRegistry.js";
|
|
26
|
+
// So a gateway button and the toolbar button for the same tool draw one icon.
|
|
27
|
+
export { resolveFallbackToolIcon, TOOL_FALLBACK_ICONS, } from "../services/tool-icons.js";
|
|
22
28
|
export { resolveContentCapabilities } from "./content-capability-resolution.js";
|
|
29
|
+
export { createToolSurfaceHost } from "./tool-surface-host.js";
|
|
23
30
|
export { hasChoiceInteraction, hasMathContent, hasReadableText, hasScienceContent, } from "../services/tool-context.js";
|
|
24
31
|
// Scoped tool instance ids, so two placements of one tool do not share state.
|
|
25
32
|
export { createScopedToolId } from "../services/tool-instance-id.js";
|
|
@@ -30,5 +37,5 @@ export { applyOverlaySurface, createScopedVisibilityBinding, syncButtonAndOverla
|
|
|
30
37
|
// stay here rather than moving with the registrations because they are written
|
|
31
38
|
// against the `pie-calculator` and `pie-tts` contract packages, which the
|
|
32
39
|
// toolkit's own `TTSService` and provider registry also depend on.
|
|
33
|
-
export { DesmosToolProvider, TTSToolProvider, } from "../services/tool-providers/index.js";
|
|
40
|
+
export { CortexToolProvider, DesmosToolProvider, GeoGebraToolProvider, TTSToolProvider, } from "../services/tool-providers/index.js";
|
|
34
41
|
export { buildRuntimeTTSConfig, normalizeTTSLayoutMode, normalizeTTSSpeedControlOptions, resolveRuntimeProvider, resolveTTSBackend, resolveTTSHostToolbarLayout, resolveTTSLayoutMode, resolveTTSRuntimeSettings, resolveTransportMode, } from "../services/tts-runtime-config.js";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Headless host for capabilities that render into a renderer's surfaces.
|
|
3
|
+
*
|
|
4
|
+
* The interface deliberately exposes only current input, a two-boolean snapshot,
|
|
5
|
+
* and teardown. Discovery, policy/catalog invalidation, content resolution, lazy
|
|
6
|
+
* loading, DOM reconciliation, error isolation, and registry observation stay
|
|
7
|
+
* inside this module. Svelte callers are geometry adapters over this seam.
|
|
8
|
+
*
|
|
9
|
+
* It lives here rather than in `section-player`, where it was written, because a
|
|
10
|
+
* second renderer now opens a surface: the annotation toolbar hosts the
|
|
11
|
+
* capabilities that act on a text selection. Two copies of mount/reconcile/
|
|
12
|
+
* registry-observation would drift, and the drift would be invisible until one
|
|
13
|
+
* renderer stopped honouring the grant-AND-content rule. Nothing about the module
|
|
14
|
+
* was section-shaped — it already imported only from this package — so the move
|
|
15
|
+
* is a relocation, not a rewrite. The one thing that *was* section-shaped is the
|
|
16
|
+
* name it reported errors under, which is now {@link ToolSurfaceHostOptions.hostLabel}.
|
|
17
|
+
*/
|
|
18
|
+
import type { CatalogOwnerContext } from "../services/catalog-owner.js";
|
|
19
|
+
import type { ToolRegistry, ToolSurfaceServices } from "../services/ToolRegistry.js";
|
|
20
|
+
export type ToolSurfaceScope = {
|
|
21
|
+
kind: "content";
|
|
22
|
+
ownerContext: CatalogOwnerContext;
|
|
23
|
+
} | {
|
|
24
|
+
kind: "section";
|
|
25
|
+
assessmentId: string;
|
|
26
|
+
sectionId: string;
|
|
27
|
+
};
|
|
28
|
+
export interface ToolSurfaceHostInput {
|
|
29
|
+
anchor: HTMLElement | null;
|
|
30
|
+
surface: string;
|
|
31
|
+
registry: ToolRegistry | null;
|
|
32
|
+
services: ToolSurfaceServices;
|
|
33
|
+
scope: ToolSurfaceScope;
|
|
34
|
+
}
|
|
35
|
+
export interface ToolSurfaceHostSnapshot {
|
|
36
|
+
/** At least one capability is eligible, including one still loading. */
|
|
37
|
+
mountable: boolean;
|
|
38
|
+
/** At least one capability successfully mounted an element. */
|
|
39
|
+
occupied: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface ToolSurfaceHost {
|
|
42
|
+
update(input: ToolSurfaceHostInput): void;
|
|
43
|
+
destroy(): void;
|
|
44
|
+
}
|
|
45
|
+
export interface ToolSurfaceHostOptions {
|
|
46
|
+
/**
|
|
47
|
+
* Which renderer this host belongs to, for framework-error `source` and console
|
|
48
|
+
* warnings — `"pie-section-player"`, `"pie-tool-annotation-toolbar"`.
|
|
49
|
+
*
|
|
50
|
+
* A warning that named the module but not its renderer would be unactionable
|
|
51
|
+
* now that two of them mount surfaces: the same `render` failure on the same
|
|
52
|
+
* `toolId` means different things depending on which surface asked.
|
|
53
|
+
*/
|
|
54
|
+
hostLabel: string;
|
|
55
|
+
}
|
|
56
|
+
/** Create one lifecycle owner for one host surface anchor. */
|
|
57
|
+
export declare function createToolSurfaceHost(onSnapshot: (snapshot: ToolSurfaceHostSnapshot) => void, options: ToolSurfaceHostOptions): ToolSurfaceHost;
|