@pie-players/pie-assessment-toolkit 0.3.62 → 0.3.64

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.
Files changed (38) hide show
  1. package/README.md +63 -0
  2. package/dist/components/ItemToolBar.custom-element.js +1 -1
  3. package/dist/components/PieAssessmentToolkit.custom-element.js +11 -11
  4. package/dist/components/SectionToolBar.custom-element.js +1 -1
  5. package/dist/components/chunks/{ItemToolBar-843902tp.js → ItemToolBar-3cppre9r.js} +26 -26
  6. package/dist/components/chunks/{ItemToolBar-84nv78dy.js → ItemToolBar-7rq2gj8b.js} +1 -1
  7. package/dist/index.d.ts +8 -3
  8. package/dist/index.js +5 -2
  9. package/dist/policy/core/ToolPolicyEngine.d.ts +21 -0
  10. package/dist/policy/core/ToolPolicyEngine.js +27 -0
  11. package/dist/policy/core/feature-decision.d.ts +57 -0
  12. package/dist/policy/core/feature-decision.js +40 -0
  13. package/dist/policy/engine.d.ts +1 -0
  14. package/dist/policy/sources/PnpPolicySource.d.ts +22 -0
  15. package/dist/policy/sources/PnpPolicySource.js +41 -11
  16. package/dist/runtime/catalog-registration.d.ts +56 -1
  17. package/dist/runtime/catalog-registration.js +64 -31
  18. package/dist/services/AccessibilityCatalogResolver.d.ts +100 -4
  19. package/dist/services/AccessibilityCatalogResolver.js +183 -58
  20. package/dist/services/SSMLExtractor.js +28 -18
  21. package/dist/services/TTSService.d.ts +25 -0
  22. package/dist/services/TTSService.js +241 -45
  23. package/dist/services/ToolkitCoordinator.d.ts +23 -2
  24. package/dist/services/ToolkitCoordinator.js +24 -0
  25. package/dist/services/catalog-media.d.ts +25 -0
  26. package/dist/services/catalog-media.js +101 -0
  27. package/dist/services/defaultPersonalNeedsProfile.d.ts +16 -0
  28. package/dist/services/defaultPersonalNeedsProfile.js +23 -0
  29. package/dist/services/interfaces.d.ts +29 -2
  30. package/dist/services/pnp-standard-features.d.ts +1 -1
  31. package/dist/services/sign-language-cards.d.ts +82 -0
  32. package/dist/services/sign-language-cards.js +133 -0
  33. package/dist/services/spoken-audio-cards.d.ts +54 -0
  34. package/dist/services/spoken-audio-cards.js +66 -0
  35. package/dist/services/tts/math-aware-text-processing.js +3 -3
  36. package/dist/services/tts/text-processing.d.ts +51 -0
  37. package/dist/services/tts/text-processing.js +117 -1
  38. package/package.json +9 -9
package/README.md CHANGED
@@ -1047,6 +1047,40 @@ const alternative = resolver.getAlternative('prompt-001', {
1047
1047
  resolver.clearItemCatalogs();
1048
1048
  ```
1049
1049
 
1050
+ A resolved card carries either a string `content` (SSML for `spoken`, text for
1051
+ `braille`) or a structured `payload`, decided by its `catalog` type — never both.
1052
+ Consumers select by type and then validate the form they expect; a card with no
1053
+ string form is not text content, and treating it as such would speak or render an
1054
+ empty string.
1055
+
1056
+ Catalogs registered for a rendered item or passage are filed under a
1057
+ `CatalogOwnerContext`, which the resolver matches field by field. Build lookup
1058
+ contexts with `catalogOwnerContextFor` rather than as a literal — it is the same
1059
+ function the runtime registers with, so the two cannot drift:
1060
+
1061
+ ```typescript
1062
+ import {
1063
+ catalogOwnerContextFor,
1064
+ collectEntityCatalogRegistrations,
1065
+ } from '@pie-players/pie-assessment-toolkit';
1066
+
1067
+ const context = catalogOwnerContextFor({
1068
+ kind: 'item',
1069
+ itemId: item.id,
1070
+ canonicalItemId,
1071
+ assessmentId,
1072
+ sectionId,
1073
+ });
1074
+
1075
+ // Every catalog an entity carries, paired with the scope it belongs in:
1076
+ // entity-level `accessibilityCatalogs`, `config.extractedCatalogs`, and each
1077
+ // model's own catalogs (filed under that `modelId`).
1078
+ const registrations = collectEntityCatalogRegistrations(item, {
1079
+ kind: 'item',
1080
+ itemId: item.id,
1081
+ });
1082
+ ```
1083
+
1050
1084
  ### SSMLExtractor
1051
1085
 
1052
1086
  ```typescript
@@ -1063,6 +1097,35 @@ item.config.extractedCatalogs = result.catalogs;
1063
1097
  catalogResolver.addItemCatalogs(result.catalogs);
1064
1098
  ```
1065
1099
 
1100
+ ### Sign-language cards
1101
+
1102
+ Signed alternates have no extractor and deliberately so: a `sign-language` card is
1103
+ authored or written by an importer, never lifted out of item markup at render
1104
+ time. One such lift existed and was removed — nothing produced the inline form,
1105
+ and a runtime that could not parse the markup left the video in the visible
1106
+ content, showing the accommodation to every learner regardless of eligibility.
1107
+
1108
+ Whether a card describes a playable signed alternate is decided in one place,
1109
+ `resolveSignLanguageMedia` — a payload with no usable source resolves to `null`
1110
+ rather than rendering an empty player, and source URLs are restricted to schemes
1111
+ a media element can actually fetch. `matchesRequestedSignLanguage` holds the
1112
+ deliberate strictness: there is no cross-sign-language substitution, since
1113
+ handing an ASL learner a BSL recording is worse than handing them nothing.
1114
+
1115
+ ### Feature policy without a placement
1116
+
1117
+ `ToolPolicyEngine.decideFeature(featureId)` (and
1118
+ `ToolkitCoordinator.decideFeaturePolicy(featureId)`) resolve one feature id
1119
+ through `PnpPolicySource`'s six-level precedence, independent of any toolbar
1120
+ placement. Use it for capabilities that are not toolbar surfaces — signing is the
1121
+ first — where a placement-scoped `decide(...)` would answer the wrong question:
1122
+ absent because it was never placed, rather than absent because policy said no.
1123
+
1124
+ `computeDefaultSupports()` excludes `ACCOMMODATION_ONLY_SUPPORT_IDS`, which lists
1125
+ `signLanguage`. The computed default profile derives from every registered tool's
1126
+ `pnpSupportIds`, which is right for universal features and wrong for an
1127
+ accommodation requiring a documented need.
1128
+
1066
1129
  ## Integration with Section Player
1067
1130
 
1068
1131
  The section player provides automatic ToolkitCoordinator integration:
@@ -1 +1 @@
1
- import{a}from"./chunks/ItemToolBar-84nv78dy.js";import"./chunks/ItemToolBar-843902tp.js";export{a as default};
1
+ import{a}from"./chunks/ItemToolBar-7rq2gj8b.js";import"./chunks/ItemToolBar-3cppre9r.js";export{a as default};