@pie-element/mc-populated-blank 0.2.13 → 0.3.0-next.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.
Files changed (67) hide show
  1. package/README.md +8 -5
  2. package/author.js +2 -0
  3. package/configure.js +2 -0
  4. package/dist/author/defaults.d.ts +74 -0
  5. package/dist/author/index.d.ts +0 -1
  6. package/dist/author/index.js +1732 -1553
  7. package/dist/author/index.js.map +1 -1
  8. package/dist/browser/author/index.js +41 -0
  9. package/dist/browser/author/index.js.map +1 -0
  10. package/dist/browser/client-6I83eQqA.js +2396 -0
  11. package/dist/browser/client-6I83eQqA.js.map +1 -0
  12. package/dist/browser/controller/index.js +209 -0
  13. package/dist/browser/controller/index.js.map +1 -0
  14. package/dist/browser/delivery/index.js +1131 -0
  15. package/dist/browser/delivery/index.js.map +1 -0
  16. package/dist/browser/i18n-CQZqUmjk.js +1542 -0
  17. package/dist/browser/i18n-CQZqUmjk.js.map +1 -0
  18. package/dist/browser/layoutLimits-Bp17YP2V.js +42 -0
  19. package/dist/browser/layoutLimits-Bp17YP2V.js.map +1 -0
  20. package/dist/browser/print/index.js +151 -0
  21. package/dist/browser/print/index.js.map +1 -0
  22. package/dist/controller/defaults.d.ts +8 -30
  23. package/dist/controller/index.d.ts +79 -63
  24. package/dist/controller/index.js +108 -85
  25. package/dist/controller/index.js.map +1 -1
  26. package/dist/delivery/computeAudioMode.d.ts +0 -1
  27. package/dist/delivery/computeChoiceCorrectness.d.ts +0 -1
  28. package/dist/delivery/computeDisplayState.d.ts +7 -8
  29. package/dist/delivery/computeLayoutProfile.d.ts +0 -1
  30. package/dist/delivery/computeLayoutStyle.d.ts +0 -2
  31. package/dist/delivery/i18n.d.ts +8 -0
  32. package/dist/delivery/index.d.ts +22 -1
  33. package/dist/delivery/index.js +5742 -3222
  34. package/dist/delivery/index.js.map +1 -1
  35. package/dist/delivery/variant-css-map.d.ts +15 -2
  36. package/dist/index.d.ts +0 -1
  37. package/dist/index.iife.d.ts +0 -156
  38. package/dist/index.iife.js +139 -38
  39. package/dist/index.js +5742 -3222
  40. package/dist/index.js.map +1 -1
  41. package/dist/print/index.d.ts +4 -1
  42. package/dist/print/index.js +5418 -2879
  43. package/dist/print/index.js.map +1 -1
  44. package/dist/runtime-support.d.ts +12 -0
  45. package/dist/runtime-support.js +14 -0
  46. package/dist/runtime-support.js.map +1 -0
  47. package/dist/shared/layoutLimits.d.ts +1 -2
  48. package/dist/shared/types.d.ts +20 -19
  49. package/module/print.js +3883 -0
  50. package/module/print.js.map +1 -0
  51. package/package.json +42 -13
  52. package/print.js +2 -0
  53. package/dist/author/index.d.ts.map +0 -1
  54. package/dist/controller/defaults.d.ts.map +0 -1
  55. package/dist/controller/index.d.ts.map +0 -1
  56. package/dist/delivery/computeAudioMode.d.ts.map +0 -1
  57. package/dist/delivery/computeChoiceCorrectness.d.ts.map +0 -1
  58. package/dist/delivery/computeDisplayState.d.ts.map +0 -1
  59. package/dist/delivery/computeLayoutProfile.d.ts.map +0 -1
  60. package/dist/delivery/computeLayoutStyle.d.ts.map +0 -1
  61. package/dist/delivery/index.d.ts.map +0 -1
  62. package/dist/delivery/variant-css-map.d.ts.map +0 -1
  63. package/dist/index.d.ts.map +0 -1
  64. package/dist/index.iife.d.ts.map +0 -1
  65. package/dist/print/index.d.ts.map +0 -1
  66. package/dist/shared/layoutLimits.d.ts.map +0 -1
  67. package/dist/shared/types.d.ts.map +0 -1
package/README.md CHANGED
@@ -56,12 +56,14 @@ Notes:
56
56
  - **`correctChoiceId`**
57
57
  - **`hasAudio`**, **`audioUrl`**, **`audioTranscript`** (`audioUrl` required when `hasAudio=true`)
58
58
  - **`autoplayAudioEnabled`**, **`completeAudioEnabled`** (optional integration flags)
59
- - **`showVisibleTranscript`** (optional): profile-driven default; override when transcript should always show/hide
60
59
  - **`layoutLimits`** (optional): numeric visual constraints; defaults are based on current CQT parity behavior and can be overridden per item
61
60
  - **`layoutProfilePresets`** (optional): named preset map by `layoutProfile`; use profile as a template and override with `layoutLimits`
62
61
  - **`audioButtonSkin`** / **`audioButtonSkinsByLocale`** (optional): override listen-button skin URLs
63
- - **`uiText`** (optional): override labels/messages (show/hide correct, answer choices, autoplay prompt, transcript label, missing-audio message)
62
+ - **`language`** (optional): the language of the learner-facing strings (`en_US`, `es_ES`, …), which come from `@pie-lib/translator` as in the React elements; `locale` stands in when it is unset
64
63
  - **`choiceGroupLabel`** (optional): accessibility label used when no visible prompt is present
64
+ - **`lockChoiceOrder`** (optional): `false` shuffles the choices for a student, as in multiple-choice; `shuffle: true` is the older spelling and counts only when `lockChoiceOrder` is unset
65
+ - **`teacherInstructions`** and **`teacherInstructionsEnabled`** (optional): shown to instructors in view and evaluate mode, and in an instructor's printout; unset `teacherInstructionsEnabled` shows them
66
+ - **`printAnswerKey`** (optional): `false` leaves the answer key out of an instructor's printout; a student's printout never has it
65
67
 
66
68
  ### `layoutLimits` keys (all optional, positive numbers)
67
69
 
@@ -73,8 +75,8 @@ Notes:
73
75
  - `horizontalChoiceWidthVw`
74
76
  - `horizontalChoiceTileMinHeightRem`
75
77
  - `horizontalChoiceContentMinHeightRem`
76
- - `selectedImageMaxHeightRem`
77
78
  - `choiceImageMaxHeightRem`
79
+ - `choiceImageMaxWidthRem` (shared by the choice tile image and the selected-answer image inside the cloze blank, so they always render at the same size)
78
80
  - `listenButtonSizePx`
79
81
  - `stimulusMinColumnPx`
80
82
  - `textMinColumnPx`
@@ -113,9 +115,10 @@ Notes:
113
115
  - **Layout limits are model-driven:** delivery reads `model.layoutLimits` (blank widths/underline widths, choice tile sizing, image max heights, listen button size, layout column minimums); defaults are CQT-informed but overrideable.
114
116
  - **Responsive parity controls:** `audioInstructionsMaxWidthPx` and `narrowHorizontalChoiceMaxWidthPx` are explicitly configurable to tune desktop vs narrow-width CQT behavior.
115
117
  - **Evaluate mode behavior:** when evaluate/correct-answer mode is enabled, delivery can render `correctChoiceId` in the blank/choice state.
116
- - **Audio error behavior:** no TTS fallback is used; when `hasAudio=true` and no playable `audioUrl` is provided, delivery shows an explicit error message (configurable via `uiText.audioResourceUnavailable`).
118
+ - **Audio error behavior:** no TTS fallback is used; when `hasAudio=true` and no playable `audioUrl` is provided, delivery shows an explicit error message.
117
119
  - **Prompt-off accessibility:** when `prompt` is empty, delivery uses `choiceGroupLabel` (or fallback UI text) as the radiogroup accessible name.
118
120
  - **Print parity:** print view mirrors prompt/template/choice presentation with the same blank-token contract.
121
+ - **Delivery renders no transcript:** it is an accessibility-catalog alternate, so on `pie-section-player` the assessment toolkit resolves the `transcript` card against the learner's personal needs profile and renders it in a labelled region above this element (PIE-902) — the same path signing takes. `model.audioTranscript` stays on the model for the print view, which has no toolkit, and as the source the Learnosity import writes the card from. A host that wants a transcript delivers the toolkit; there is no element-specific CSS class to apply.
119
122
 
120
123
  ## Theming hooks (`pie-*` classes)
121
124
 
@@ -137,7 +140,7 @@ To avoid runtime dependency on cross-origin Learnosity stylesheet loading, this
137
140
  - Variant mapping: `src/delivery/variant-css-map.ts`
138
141
  - Applied by `model.customType` (for example `sel_r1-_plusggg`)
139
142
 
140
- Each variant CSS file is intentionally scoped with `.mc-populated-blank-root.variant-*` selectors so styles only apply to this element instance and do not leak into other PIE elements.
143
+ Every selector in a variant CSS file starts at `.mc-populated-blank-root` (`variant-css-scope.test.ts` enforces it), so the styles cannot leak into other PIE elements. At injection each root selector is narrowed to roots whose `data-mpb-css` carries a hash of this build's sheets, so two versions of the element on one page style only their own instances. The sheets go into the document head, or into the shadow root the element renders in.
141
144
 
142
145
  ### Maintenance workflow
143
146
 
package/author.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './dist/author/index.js';
2
+ export * from './dist/author/index.js';
package/configure.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './dist/author/index.js';
2
+ export * from './dist/author/index.js';
@@ -0,0 +1,74 @@
1
+ /** The model a new item starts from: a valid question an author edits in place. */
2
+ declare const _default: {
3
+ model: {
4
+ prompt: string;
5
+ template: string;
6
+ choices: {
7
+ id: string;
8
+ labelHtml: string;
9
+ }[];
10
+ correctChoiceId: string;
11
+ promptEnabled: boolean;
12
+ interactionMode: "populate_blank";
13
+ layoutProfile: string;
14
+ choiceLayout: string;
15
+ layoutProfilePresets: {};
16
+ layoutLimits: {
17
+ blankStandaloneWidthRem: number;
18
+ blankWideWidthRem: number;
19
+ blankUnderlineWidthPx: number;
20
+ blankUnderlineWideWidthPx: number;
21
+ horizontalChoiceWidthPx: number;
22
+ horizontalChoiceWidthVw: number;
23
+ horizontalChoiceTileMinHeightRem: number;
24
+ horizontalChoiceContentMinHeightRem: number;
25
+ choiceImageMaxHeightRem: number;
26
+ choiceImageMaxWidthRem: number;
27
+ listenButtonSizePx: number;
28
+ stimulusMinColumnPx: number;
29
+ textMinColumnPx: number;
30
+ legendMaxChars: number;
31
+ choiceGroupGapRem: number;
32
+ choiceRowGapRem: number;
33
+ toggleButtonGapRem: number;
34
+ horizontalChoiceRadioTopMarginRem: number;
35
+ audioBlankTemplateMarginTopRem: number;
36
+ audioBlankTemplateMarginBottomRem: number;
37
+ audioInstructionsMaxWidthPx: number;
38
+ narrowHorizontalChoiceMaxWidthPx: number;
39
+ stimulusGridColumnGapRem: number;
40
+ stimulusGridRowGapRem: number;
41
+ stimulusSentenceMarginTopRem: number;
42
+ stimulusChoicesMarginTopRem: number;
43
+ tokenGridColumnGapRem: number;
44
+ tokenGridRowGapRem: number;
45
+ tokenTemplateMarginTopRem: number;
46
+ tokenInlineTokenGapRem: number;
47
+ tokenChoicesMarginTopRem: number;
48
+ inlineGridColumnGapRem: number;
49
+ inlineGridRowGapRem: number;
50
+ inlineTemplateMarginTopRem: number;
51
+ inlineChoicesMarginTopRem: number;
52
+ };
53
+ audioButtonSkin: null;
54
+ audioButtonSkinsByLocale: {};
55
+ sentenceHtml: string;
56
+ choiceMode: "text";
57
+ choiceGroupLabel: string;
58
+ hasAudio: boolean;
59
+ autoplayAudioEnabled: boolean;
60
+ completeAudioEnabled: boolean;
61
+ audioUrl: string;
62
+ audioTranscript: string;
63
+ locale: string;
64
+ teacherInstructions: string;
65
+ teacherInstructionsEnabled: boolean;
66
+ };
67
+ configuration: {
68
+ prompt: {
69
+ label: string;
70
+ settings: boolean;
71
+ };
72
+ };
73
+ };
74
+ export default _default;
@@ -8,4 +8,3 @@ declare class McPopulatedBlankAuthor extends SvelteElementClass {
8
8
  get onChange(): (model: any) => void;
9
9
  }
10
10
  export default McPopulatedBlankAuthor;
11
- //# sourceMappingURL=index.d.ts.map