@pie-element/mc-populated-blank 0.2.0 → 0.2.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/mc-populated-blank",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Multiple-choice option populates an inline blank in a sentence template (Svelte 5 PIE element)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -43,6 +43,7 @@
43
43
  "clean": "rm -rf dist tsconfig.tsbuildinfo"
44
44
  },
45
45
  "dependencies": {
46
+ "@pie-lib-svelte/styling": "workspace:*",
46
47
  "lodash-es": "^4.17.21"
47
48
  },
48
49
  "peerDependencies": {
@@ -22,6 +22,8 @@ export const DEFAULT_LAYOUT_LIMITS = {
22
22
  horizontalChoiceRadioTopMarginRem: 0.5,
23
23
  audioBlankTemplateMarginTopRem: 0.8,
24
24
  audioBlankTemplateMarginBottomRem: 1.8,
25
+ audioInstructionsMaxWidthPx: 875,
26
+ narrowHorizontalChoiceMaxWidthPx: 230,
25
27
  stimulusGridColumnGapRem: 2,
26
28
  stimulusGridRowGapRem: 0.7,
27
29
  stimulusSentenceMarginTopRem: 0.2,
@@ -91,14 +91,14 @@ const shouldLockChoices = (question: any, env: any) => {
91
91
  return env?.role === 'instructor';
92
92
  };
93
93
 
94
- const shuffleArray = <T>(items: T[]): T[] => {
94
+ function shuffleArray<T>(items: T[]): T[] {
95
95
  const out = [...items];
96
96
  for (let i = out.length - 1; i > 0; i--) {
97
97
  const j = Math.floor(Math.random() * (i + 1));
98
98
  [out[i], out[j]] = [out[j], out[i]];
99
99
  }
100
100
  return out;
101
- };
101
+ }
102
102
 
103
103
  const getStoredShuffle = (session: any): string[] =>
104
104
  Array.isArray(session?.data?.shuffledValues)
@@ -163,10 +163,7 @@ export const model = async (question: any, session: any, env: any, updateSession
163
163
  typeof normalizedQuestion.layoutProfilePresets === 'object'
164
164
  ? normalizedQuestion.layoutProfilePresets
165
165
  : {},
166
- layoutLimits: {
167
- ...DEFAULT_LAYOUT_LIMITS,
168
- ...(normalizedQuestion.layoutLimits || {}),
169
- },
166
+ layoutLimits: normalizedQuestion.layoutLimits || { ...DEFAULT_LAYOUT_LIMITS },
170
167
  audioButtonSkin:
171
168
  normalizedQuestion.audioButtonSkin && typeof normalizedQuestion.audioButtonSkin === 'object'
172
169
  ? normalizedQuestion.audioButtonSkin
@@ -324,6 +321,8 @@ export const validate = (model: any = {}, _config: any = {}) => {
324
321
  'horizontalChoiceRadioTopMarginRem',
325
322
  'audioBlankTemplateMarginTopRem',
326
323
  'audioBlankTemplateMarginBottomRem',
324
+ 'audioInstructionsMaxWidthPx',
325
+ 'narrowHorizontalChoiceMaxWidthPx',
327
326
  'stimulusGridColumnGapRem',
328
327
  'stimulusGridRowGapRem',
329
328
  'stimulusSentenceMarginTopRem',