@pie-element/extended-text-entry 16.0.4-next.20261011174919 → 16.0.4
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/dist/author/defaults.d.ts +62 -58
- package/dist/author/index.d.ts +15 -36
- package/dist/author/index.js +7 -3
- package/dist/author/main.d.ts +28 -13
- package/dist/author/main.js +46 -55
- package/dist/browser/author/index.js +13 -20
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +13 -20
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +18 -14
- package/dist/controller/index.d.ts +86 -39
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +367 -0
- package/dist/schemas/model.schema.json +513 -0
- package/dist/schemas/session.schema.json +74 -0
- package/dist/types.d.ts +229 -0
- package/package.json +18 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../shared/feedback/dist/index.js","../../../../src/controller/defaults.ts","../../../../src/controller/index.ts"],"sourcesContent":["//#region src/defaults.ts\nvar e = {\n\tcorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Correct\",\n\t\tcustom: \"Correct\"\n\t},\n\tincorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Incorrect\",\n\t\tcustom: \"Incorrect\"\n\t},\n\tpartial: {\n\t\ttype: \"default\",\n\t\tdefault: \"Nearly\",\n\t\tcustom: \"Nearly\"\n\t},\n\tunanswered: {\n\t\ttype: \"default\",\n\t\tdefault: \"You have not entered a response\",\n\t\tcustom: \"You have not entered a response\"\n\t}\n};\n//#endregion\n//#region src/utils.ts\nfunction t(e) {\n\treturn e === \"partially-correct\" ? \"partial\" : e;\n}\n//#endregion\n//#region src/index.ts\nfunction n(n, r) {\n\tlet i = {\n\t\t...e,\n\t\t...r\n\t}, a = t(n), o = e[a] || {}, s = i[a] || o;\n\treturn {\n\t\tconfig: s,\n\t\tfallback: o[s.type || \"default\"]\n\t};\n}\nfunction r(e, t = {}) {\n\treturn new Promise((r) => {\n\t\tlet { config: a, fallback: o } = n(e, t);\n\t\ti(a, o).then(r);\n\t});\n}\nfunction i(e, t) {\n\treturn new Promise((n) => {\n\t\tif (!e || e.type === \"none\") {\n\t\t\tn(void 0);\n\t\t\treturn;\n\t\t}\n\t\tn(e[e.type] || t);\n\t});\n}\nfunction a(e, t = {}) {\n\tlet { config: r, fallback: i } = n(e, t);\n\treturn o(r, i);\n}\nfunction o(e, t) {\n\tif (!(!e || e.type === \"none\")) return e[e.type] || t;\n}\n//#endregion\nexport { e as defaultFeedback, o as getActualFeedback, a as getActualFeedbackForCorrectness, i as getFeedback, r as getFeedbackForCorrectness, t as normalizeCorrectness };\n","// @ts-nocheck\n\nexport default {\n annotationsEnabled: false,\n dimensions: { height: 100, width: 500 },\n equationEditor: 'Grade 8 - HS',\n feedbackEnabled: false,\n mathInput: false,\n playerPasteFormattingDisabled: false,\n playerSpellCheckDisabled: true,\n predefinedAnnotations: [\n { label: 'good', text: 'good', type: 'positive' },\n { label: '★', text: '★', type: 'positive' },\n { label: ':-)', text: ':-)', type: 'positive' },\n { label: 'creative', text: 'creative', type: 'positive' },\n { label: 'run-on', text: 'run-on', type: 'negative' },\n { label: 'frag', text: 'fragment', type: 'negative' },\n { label: 'tran', text: 'transition', type: 'negative' },\n { label: 'supp', text: 'support needed', type: 'negative' },\n { label: 'punc', text: 'punctuation', type: 'negative' },\n { label: 'agr', text: 'agreement wrong', type: 'negative' },\n { label: 'unclear', text: 'unclear', type: 'negative' },\n { label: 'cut', text: 'cut', type: 'negative' },\n { label: 'sp', text: 'spelling', type: 'negative' },\n { label: 'cap', text: 'capitalization', type: 'negative' },\n { label: 'inf', text: 'informal', type: 'negative' },\n { label: 'awk', text: 'awkward', type: 'negative' },\n ],\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n\nimport debug from 'debug';\nimport { getFeedback } from '@pie-element/shared-feedback';\nimport defaults from './defaults.js';\n\nconst log = debug('@pie-element:extended-text-entry:controller');\n\nexport async function createDefaultModel(model = {}) {\n log('[createDefaultModel]', model);\n\n return { ...defaults, ...model };\n}\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\nexport async function model(question, session, env) {\n log('[question]', question);\n const normalizedQuestion = normalize(question);\n\n const fb =\n env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled\n ? getFeedback(normalizedQuestion.feedback, 'Your answer has been submitted')\n : Promise.resolve(undefined);\n\n let teacherInstructions = null;\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;\n } else {\n teacherInstructions = null;\n }\n\n let equationEditor = normalizedQuestion.equationEditor || 'miscellaneous';\n\n switch (normalizedQuestion.equationEditor) {\n case 'Grade 1 - 2':\n equationEditor = 1;\n break;\n case 'Grade 3 - 5':\n equationEditor = 3;\n break;\n case 'Grade 6 - 7':\n equationEditor = 6;\n break;\n case 'Grade 8 - HS':\n equationEditor = 8;\n break;\n default:\n break;\n }\n\n const annotatorMode = normalizedQuestion.annotationsEnabled && (env.role === 'instructor' || env.mode === 'evaluate');\n\n return fb.then((feedback) => ({\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n dimensions: normalizedQuestion.dimensions,\n customKeys: normalizedQuestion.customKeys || [],\n id: normalizedQuestion.id,\n disabled: env.mode !== 'gather',\n feedback,\n teacherInstructions,\n language: normalizedQuestion.language,\n mathInput: normalizedQuestion.mathInput,\n spanishInput: normalizedQuestion.spanishInput,\n specialInput: normalizedQuestion.specialInput,\n equationEditor,\n // Spellcheck is off unless the author explicitly opted in: normalize's defaults cover a\n // missing key, but a key present as undefined/null overwrites them. See PIE-978.\n spellCheckEnabled: normalizedQuestion.playerSpellCheckDisabled === false,\n pasteFormattingDisabled: normalizedQuestion.playerPasteFormattingDisabled === true,\n playersToolbarPosition: normalizedQuestion.playersToolbarPosition || 'bottom',\n annotatorMode,\n disabledAnnotator: normalizedQuestion.annotationsEnabled ? env.role !== 'instructor' : true,\n predefinedAnnotations: normalizedQuestion.annotationsEnabled ? normalizedQuestion.predefinedAnnotations : [],\n extraCSSRules: normalizedQuestion.extraCSSRules,\n }));\n}\n\nexport async function outcome(/*question, session, env*/) {\n return {\n score: 0,\n completed: 'n/a',\n note: 'Requires manual scoring',\n };\n}\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const errors = {};\n\n ['teacherInstructions', 'prompt'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n return errors;\n};\n"],"mappings":";;;;AA8CA,SAAS,EAAE,GAAG,GAAG;CAChB,OAAO,IAAI,SAAS,MAAM;EACzB,IAAI,CAAC,KAAK,EAAE,SAAS,QAAQ;GAC5B,EAAE,KAAK,CAAC;GACR;EACD;EACA,EAAE,EAAE,EAAE,SAAS,CAAC;CACjB,CAAC;AACF;;;ACpDA,IAAA,IAAe;CACb,oBAAoB;CACpB,YAAY;EAAE,QAAQ;EAAK,OAAO;CAAI;CACtC,gBAAgB;CAChB,iBAAiB;CACjB,WAAW;CACX,+BAA+B;CAC/B,0BAA0B;CAC1B,uBAAuB;EACrB;GAAE,OAAO;GAAQ,MAAM;GAAQ,MAAM;EAAW;EAChD;GAAE,OAAO;GAAK,MAAM;GAAK,MAAM;EAAW;EAC1C;GAAE,OAAO;GAAO,MAAM;GAAO,MAA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3,"file":"index.js","names":[],"sources":["../../../../../../shared/feedback/dist/index.js","../../../../src/controller/defaults.ts","../../../../src/controller/index.ts"],"sourcesContent":["//#region src/defaults.ts\nvar e = {\n\tcorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Correct\",\n\t\tcustom: \"Correct\"\n\t},\n\tincorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Incorrect\",\n\t\tcustom: \"Incorrect\"\n\t},\n\tpartial: {\n\t\ttype: \"default\",\n\t\tdefault: \"Nearly\",\n\t\tcustom: \"Nearly\"\n\t},\n\tunanswered: {\n\t\ttype: \"default\",\n\t\tdefault: \"You have not entered a response\",\n\t\tcustom: \"You have not entered a response\"\n\t}\n};\n//#endregion\n//#region src/utils.ts\nfunction t(e) {\n\treturn e === \"partially-correct\" ? \"partial\" : e;\n}\n//#endregion\n//#region src/index.ts\nfunction n(n, r) {\n\tlet i = {\n\t\t...e,\n\t\t...r\n\t}, a = t(n), o = e[a] || {}, s = i[a] || o;\n\treturn {\n\t\tconfig: s,\n\t\tfallback: o[s.type || \"default\"]\n\t};\n}\nfunction r(e, t = {}) {\n\treturn new Promise((r) => {\n\t\tlet { config: a, fallback: o } = n(e, t);\n\t\ti(a, o).then(r);\n\t});\n}\nfunction i(e, t) {\n\treturn new Promise((n) => {\n\t\tif (!e || e.type === \"none\") {\n\t\t\tn(void 0);\n\t\t\treturn;\n\t\t}\n\t\tn(e[e.type] || t);\n\t});\n}\nfunction a(e, t = {}) {\n\tlet { config: r, fallback: i } = n(e, t);\n\treturn o(r, i);\n}\nfunction o(e, t) {\n\tif (!(!e || e.type === \"none\")) return e[e.type] || t;\n}\n//#endregion\nexport { e as defaultFeedback, o as getActualFeedback, a as getActualFeedbackForCorrectness, i as getFeedback, r as getFeedbackForCorrectness, t as normalizeCorrectness };\n","import type { ExtendedTextEntryModel } from '../types.js';\n\nexport default {\n annotationsEnabled: false,\n dimensions: { height: 100, width: 500 },\n equationEditor: 'Grade 8 - HS',\n feedbackEnabled: false,\n mathInput: false,\n playerPasteFormattingDisabled: false,\n playerSpellCheckDisabled: true,\n predefinedAnnotations: [\n { label: 'good', text: 'good', type: 'positive' },\n { label: '★', text: '★', type: 'positive' },\n { label: ':-)', text: ':-)', type: 'positive' },\n { label: 'creative', text: 'creative', type: 'positive' },\n { label: 'run-on', text: 'run-on', type: 'negative' },\n { label: 'frag', text: 'fragment', type: 'negative' },\n { label: 'tran', text: 'transition', type: 'negative' },\n { label: 'supp', text: 'support needed', type: 'negative' },\n { label: 'punc', text: 'punctuation', type: 'negative' },\n { label: 'agr', text: 'agreement wrong', type: 'negative' },\n { label: 'unclear', text: 'unclear', type: 'negative' },\n { label: 'cut', text: 'cut', type: 'negative' },\n { label: 'sp', text: 'spelling', type: 'negative' },\n { label: 'cap', text: 'capitalization', type: 'negative' },\n { label: 'inf', text: 'informal', type: 'negative' },\n { label: 'awk', text: 'awkward', type: 'negative' },\n ],\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n} satisfies Omit<ExtendedTextEntryModel, 'id' | 'element'>;\n","import debug from 'debug';\nimport { getFeedback, type FeedbackConfig } from '@pie-element/shared-feedback';\nimport type { ExtraCSSRules, PieEnvironment } from '@pie-element/shared-types';\nimport defaults from './defaults.js';\nimport type {\n ExtendedTextEntryConfiguration,\n ExtendedTextEntryDimensions,\n ExtendedTextEntryModel,\n ExtendedTextEntrySession,\n PredefinedAnnotation,\n} from '../types.js';\n\nconst log = debug('@pie-element:extended-text-entry:controller');\n\n/** The model the delivery renders. */\ntype ModelView = {\n prompt: string | null | undefined;\n dimensions: ExtendedTextEntryDimensions | undefined;\n customKeys: string[];\n id: string;\n disabled: boolean;\n feedback: string | undefined;\n teacherInstructions: string | null | undefined;\n language: string | undefined;\n mathInput: boolean | undefined;\n spanishInput: boolean | undefined;\n specialInput: boolean | undefined;\n equationEditor: string | number;\n spellCheckEnabled: boolean;\n pasteFormattingDisabled: boolean;\n playersToolbarPosition: 'bottom' | 'top';\n annotatorMode: boolean | undefined;\n disabledAnnotator: boolean;\n predefinedAnnotations: PredefinedAnnotation[] | undefined;\n extraCSSRules: ExtraCSSRules | undefined;\n};\n\nexport type ExtendedTextEntryValidationErrors = {\n teacherInstructions?: string;\n prompt?: string;\n};\n\nexport async function createDefaultModel(model: Partial<ExtendedTextEntryModel> = {}) {\n log('[createDefaultModel]', model);\n\n return { ...defaults, ...model };\n}\n\nexport const normalize = (question: ExtendedTextEntryModel) => ({ ...defaults, ...question });\n\nexport async function model(\n question: ExtendedTextEntryModel,\n _session: ExtendedTextEntrySession | undefined,\n env: PieEnvironment,\n): Promise<ModelView> {\n log('[question]', question);\n const normalizedQuestion = normalize(question);\n\n const fb =\n env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled\n ? getFeedback(normalizedQuestion.feedback as FeedbackConfig, 'Your answer has been submitted')\n : Promise.resolve(undefined);\n\n let teacherInstructions: string | null | undefined = null;\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;\n } else {\n teacherInstructions = null;\n }\n\n let equationEditor: string | number = normalizedQuestion.equationEditor || 'miscellaneous';\n\n switch (normalizedQuestion.equationEditor) {\n case 'Grade 1 - 2':\n equationEditor = 1;\n break;\n case 'Grade 3 - 5':\n equationEditor = 3;\n break;\n case 'Grade 6 - 7':\n equationEditor = 6;\n break;\n case 'Grade 8 - HS':\n equationEditor = 8;\n break;\n default:\n break;\n }\n\n const annotatorMode = normalizedQuestion.annotationsEnabled && (env.role === 'instructor' || env.mode === 'evaluate');\n\n return fb.then((feedback): ModelView => ({\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n dimensions: normalizedQuestion.dimensions,\n customKeys: normalizedQuestion.customKeys || [],\n id: normalizedQuestion.id,\n disabled: env.mode !== 'gather',\n feedback,\n teacherInstructions,\n language: normalizedQuestion.language,\n mathInput: normalizedQuestion.mathInput,\n spanishInput: normalizedQuestion.spanishInput,\n specialInput: normalizedQuestion.specialInput,\n equationEditor,\n // Spellcheck is off unless the author explicitly opted in: normalize's defaults cover a\n // missing key, but a key present as undefined/null overwrites them. See PIE-978.\n spellCheckEnabled: normalizedQuestion.playerSpellCheckDisabled === false,\n pasteFormattingDisabled: normalizedQuestion.playerPasteFormattingDisabled === true,\n playersToolbarPosition: normalizedQuestion.playersToolbarPosition || 'bottom',\n annotatorMode,\n disabledAnnotator: normalizedQuestion.annotationsEnabled ? env.role !== 'instructor' : true,\n predefinedAnnotations: normalizedQuestion.annotationsEnabled ? normalizedQuestion.predefinedAnnotations : [],\n extraCSSRules: normalizedQuestion.extraCSSRules,\n }));\n}\n\nexport async function outcome(/*question, session, env*/) {\n return {\n score: 0,\n completed: 'n/a',\n note: 'Requires manual scoring',\n };\n}\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html: string | undefined) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (\n model: Partial<ExtendedTextEntryModel> = {},\n config: ExtendedTextEntryConfiguration = {},\n): ExtendedTextEntryValidationErrors => {\n const errors: ExtendedTextEntryValidationErrors = {};\n\n (['teacherInstructions', 'prompt'] as const).forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n return errors;\n};\n"],"mappings":";;;;AA8CA,SAAS,EAAE,GAAG,GAAG;CAChB,OAAO,IAAI,SAAS,MAAM;EACzB,IAAI,CAAC,KAAK,EAAE,SAAS,QAAQ;GAC5B,EAAE,KAAK,CAAC;GACR;EACD;EACA,EAAE,EAAE,EAAE,SAAS,CAAC;CACjB,CAAC;AACF;;;ACpDA,IAAA,IAAe;CACb,oBAAoB;CACpB,YAAY;EAAE,QAAQ;EAAK,OAAO;CAAI;CACtC,gBAAgB;CAChB,iBAAiB;CAC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IAAM,IAA4C,CAAC;CAQnD,OANA,CAAE,uBAAuB,QAAQ,CAAC,CAAW,SAAS,MAAU;EAC9D,AAAI,EAAO,EAAM,EAAE,YAAY,CAAC,EAAW,EAAM,EAAM,MACrD,EAAO,KAAS;CAEpB,CAAC,GAEM;AACT"}
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
annotationsEnabled:
|
|
2
|
+
annotationsEnabled: false;
|
|
3
3
|
dimensions: {
|
|
4
4
|
height: number;
|
|
5
5
|
width: number;
|
|
6
6
|
};
|
|
7
|
-
equationEditor:
|
|
8
|
-
feedbackEnabled:
|
|
9
|
-
mathInput:
|
|
10
|
-
playerPasteFormattingDisabled:
|
|
11
|
-
playerSpellCheckDisabled:
|
|
12
|
-
predefinedAnnotations: {
|
|
7
|
+
equationEditor: "Grade 8 - HS";
|
|
8
|
+
feedbackEnabled: false;
|
|
9
|
+
mathInput: false;
|
|
10
|
+
playerPasteFormattingDisabled: false;
|
|
11
|
+
playerSpellCheckDisabled: true;
|
|
12
|
+
predefinedAnnotations: ({
|
|
13
13
|
label: string;
|
|
14
14
|
text: string;
|
|
15
|
-
type:
|
|
16
|
-
}
|
|
15
|
+
type: "positive";
|
|
16
|
+
} | {
|
|
17
|
+
label: string;
|
|
18
|
+
text: string;
|
|
19
|
+
type: "negative";
|
|
20
|
+
})[];
|
|
17
21
|
prompt: string;
|
|
18
|
-
promptEnabled:
|
|
22
|
+
promptEnabled: true;
|
|
19
23
|
rationale: string;
|
|
20
|
-
rationaleEnabled:
|
|
21
|
-
studentInstructionsEnabled:
|
|
24
|
+
rationaleEnabled: true;
|
|
25
|
+
studentInstructionsEnabled: true;
|
|
22
26
|
teacherInstructions: string;
|
|
23
|
-
teacherInstructionsEnabled:
|
|
24
|
-
toolbarEditorPosition:
|
|
27
|
+
teacherInstructionsEnabled: true;
|
|
28
|
+
toolbarEditorPosition: "bottom";
|
|
25
29
|
};
|
|
26
30
|
export default _default;
|
|
@@ -1,53 +1,100 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ExtraCSSRules, PieEnvironment } from '@pie-element/shared-types';
|
|
2
|
+
import type { ExtendedTextEntryConfiguration, ExtendedTextEntryDimensions, ExtendedTextEntryModel, ExtendedTextEntrySession, PredefinedAnnotation } from '../types.js';
|
|
3
|
+
/** The model the delivery renders. */
|
|
4
|
+
type ModelView = {
|
|
5
|
+
prompt: string | null | undefined;
|
|
6
|
+
dimensions: ExtendedTextEntryDimensions | undefined;
|
|
7
|
+
customKeys: string[];
|
|
8
|
+
id: string;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
feedback: string | undefined;
|
|
11
|
+
teacherInstructions: string | null | undefined;
|
|
12
|
+
language: string | undefined;
|
|
13
|
+
mathInput: boolean | undefined;
|
|
14
|
+
spanishInput: boolean | undefined;
|
|
15
|
+
specialInput: boolean | undefined;
|
|
16
|
+
equationEditor: string | number;
|
|
17
|
+
spellCheckEnabled: boolean;
|
|
18
|
+
pasteFormattingDisabled: boolean;
|
|
19
|
+
playersToolbarPosition: 'bottom' | 'top';
|
|
20
|
+
annotatorMode: boolean | undefined;
|
|
21
|
+
disabledAnnotator: boolean;
|
|
22
|
+
predefinedAnnotations: PredefinedAnnotation[] | undefined;
|
|
23
|
+
extraCSSRules: ExtraCSSRules | undefined;
|
|
24
|
+
};
|
|
25
|
+
export type ExtendedTextEntryValidationErrors = {
|
|
26
|
+
teacherInstructions?: string;
|
|
27
|
+
prompt?: string;
|
|
28
|
+
};
|
|
29
|
+
export declare function createDefaultModel(model?: Partial<ExtendedTextEntryModel>): Promise<{
|
|
30
|
+
dimensions: ExtendedTextEntryDimensions;
|
|
31
|
+
equationEditor: "miscellaneous" | "statistics" | "advanced-algebra" | "geometry" | "Grade 8 - HS" | "Grade 6 - 7" | "Grade 3 - 5" | "Grade 1 - 2" | "non-negative-integers" | "integers" | "decimals" | "fractions" | "item-authoring";
|
|
32
|
+
customKeys?: string[] | undefined;
|
|
33
|
+
feedback?: import("../types.js").ExtendedTextEntryFeedback | undefined;
|
|
34
|
+
mathInput: boolean;
|
|
35
|
+
spanishInput?: boolean | undefined;
|
|
36
|
+
specialInput?: boolean | undefined;
|
|
37
|
+
multiple?: boolean | undefined;
|
|
38
|
+
prompt: string;
|
|
39
|
+
promptEnabled: boolean;
|
|
40
|
+
studentInstructions?: string | undefined;
|
|
41
|
+
teacherInstructions: string;
|
|
2
42
|
annotationsEnabled: boolean;
|
|
3
|
-
dimensions: {
|
|
4
|
-
height: number;
|
|
5
|
-
width: number;
|
|
6
|
-
};
|
|
7
|
-
equationEditor: string;
|
|
8
43
|
feedbackEnabled: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
44
|
+
rationale: string;
|
|
45
|
+
rationaleEnabled: boolean;
|
|
46
|
+
spellCheckEnabled?: boolean | undefined;
|
|
11
47
|
playerSpellCheckDisabled: boolean;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
48
|
+
playerPasteFormattingDisabled: boolean;
|
|
49
|
+
studentInstructionsEnabled: boolean;
|
|
50
|
+
teacherInstructionsEnabled: boolean;
|
|
51
|
+
toolbarEditorPosition: "bottom" | "top";
|
|
52
|
+
predefinedAnnotations: PredefinedAnnotation[];
|
|
53
|
+
playersToolbarPosition?: "bottom" | "top" | undefined;
|
|
54
|
+
rubricEnabled?: boolean | undefined;
|
|
55
|
+
language?: string | undefined;
|
|
56
|
+
extraCSSRules?: ExtraCSSRules | undefined;
|
|
57
|
+
id?: string | undefined;
|
|
58
|
+
element?: string | undefined;
|
|
59
|
+
accessibilityCatalogs?: import("@pie-element/shared-types").AccessibilityCatalog[] | undefined;
|
|
60
|
+
}>;
|
|
61
|
+
export declare const normalize: (question: ExtendedTextEntryModel) => {
|
|
62
|
+
dimensions: ExtendedTextEntryDimensions;
|
|
63
|
+
equationEditor: "miscellaneous" | "statistics" | "advanced-algebra" | "geometry" | "Grade 8 - HS" | "Grade 6 - 7" | "Grade 3 - 5" | "Grade 1 - 2" | "non-negative-integers" | "integers" | "decimals" | "fractions" | "item-authoring";
|
|
64
|
+
customKeys?: string[];
|
|
65
|
+
feedback?: import("../types.js").ExtendedTextEntryFeedback;
|
|
66
|
+
mathInput: boolean;
|
|
67
|
+
spanishInput?: boolean;
|
|
68
|
+
specialInput?: boolean;
|
|
69
|
+
multiple?: boolean;
|
|
17
70
|
prompt: string;
|
|
18
71
|
promptEnabled: boolean;
|
|
72
|
+
studentInstructions?: string;
|
|
73
|
+
teacherInstructions: string;
|
|
74
|
+
annotationsEnabled: boolean;
|
|
75
|
+
feedbackEnabled: boolean;
|
|
19
76
|
rationale: string;
|
|
20
77
|
rationaleEnabled: boolean;
|
|
78
|
+
spellCheckEnabled?: boolean;
|
|
79
|
+
playerSpellCheckDisabled: boolean;
|
|
80
|
+
playerPasteFormattingDisabled: boolean;
|
|
21
81
|
studentInstructionsEnabled: boolean;
|
|
22
|
-
teacherInstructions: string;
|
|
23
82
|
teacherInstructionsEnabled: boolean;
|
|
24
|
-
toolbarEditorPosition:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
language: any;
|
|
36
|
-
mathInput: any;
|
|
37
|
-
spanishInput: any;
|
|
38
|
-
specialInput: any;
|
|
39
|
-
equationEditor: any;
|
|
40
|
-
spellCheckEnabled: boolean;
|
|
41
|
-
pasteFormattingDisabled: boolean;
|
|
42
|
-
playersToolbarPosition: any;
|
|
43
|
-
annotatorMode: any;
|
|
44
|
-
disabledAnnotator: boolean;
|
|
45
|
-
predefinedAnnotations: any;
|
|
46
|
-
extraCSSRules: any;
|
|
47
|
-
}>;
|
|
83
|
+
toolbarEditorPosition: "bottom" | "top";
|
|
84
|
+
predefinedAnnotations: PredefinedAnnotation[];
|
|
85
|
+
playersToolbarPosition?: "bottom" | "top";
|
|
86
|
+
rubricEnabled?: boolean;
|
|
87
|
+
language?: string;
|
|
88
|
+
extraCSSRules?: ExtraCSSRules;
|
|
89
|
+
id: string;
|
|
90
|
+
element: string;
|
|
91
|
+
accessibilityCatalogs?: import("@pie-element/shared-types").AccessibilityCatalog[];
|
|
92
|
+
};
|
|
93
|
+
export declare function model(question: ExtendedTextEntryModel, _session: ExtendedTextEntrySession | undefined, env: PieEnvironment): Promise<ModelView>;
|
|
48
94
|
export declare function outcome(): Promise<{
|
|
49
95
|
score: number;
|
|
50
96
|
completed: string;
|
|
51
97
|
note: string;
|
|
52
98
|
}>;
|
|
53
|
-
export declare const validate: (model?:
|
|
99
|
+
export declare const validate: (model?: Partial<ExtendedTextEntryModel>, config?: ExtendedTextEntryConfiguration) => ExtendedTextEntryValidationErrors;
|
|
100
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/@pie-element/extended-text-entry@16.0.4/dist/schemas/configuration.schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"annotations": {
|
|
7
|
+
"$ref": "#/definitions/ConfigureProp",
|
|
8
|
+
"description": "Annotations configuration"
|
|
9
|
+
},
|
|
10
|
+
"equationEditor": {
|
|
11
|
+
"$ref": "#/definitions/ConfigurePropWithEnabled",
|
|
12
|
+
"description": "Equation Editor configuration; `enabled` shows the equation editor choice"
|
|
13
|
+
},
|
|
14
|
+
"feedback": {
|
|
15
|
+
"$ref": "#/definitions/ConfigureProp",
|
|
16
|
+
"description": "Feedback configuration"
|
|
17
|
+
},
|
|
18
|
+
"mathInput": {
|
|
19
|
+
"$ref": "#/definitions/ConfigurePropWithEnabled",
|
|
20
|
+
"description": "Math Input configuration; `enabled` is not read"
|
|
21
|
+
},
|
|
22
|
+
"settingsPanelDisabled": {
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"description": "Indicates if the settings panel is not available"
|
|
25
|
+
},
|
|
26
|
+
"spanishInput": {
|
|
27
|
+
"$ref": "#/definitions/ConfigurePropWithEnabled",
|
|
28
|
+
"description": "Spanish Input configuration; `enabled` is not read"
|
|
29
|
+
},
|
|
30
|
+
"specialInput": {
|
|
31
|
+
"$ref": "#/definitions/ConfigurePropWithEnabled",
|
|
32
|
+
"description": "Special Input configuration; `enabled` is not read"
|
|
33
|
+
},
|
|
34
|
+
"multiple": {
|
|
35
|
+
"$ref": "#/definitions/ConfigurePropWithEnabled",
|
|
36
|
+
"description": "Multiple Parts configuration; the settings toggle writes `enabled`, which nothing else reads"
|
|
37
|
+
},
|
|
38
|
+
"studentInstructions": {
|
|
39
|
+
"$ref": "#/definitions/ConfigureProp",
|
|
40
|
+
"description": "Student Instructions configuration"
|
|
41
|
+
},
|
|
42
|
+
"teacherInstructions": {
|
|
43
|
+
"$ref": "#/definitions/EditableHtmlPluginConfigureRequired",
|
|
44
|
+
"description": "Teacher Instructions configuration"
|
|
45
|
+
},
|
|
46
|
+
"prompt": {
|
|
47
|
+
"$ref": "#/definitions/EditableHtmlPluginConfigureRequired",
|
|
48
|
+
"description": "Prompt configuration"
|
|
49
|
+
},
|
|
50
|
+
"spellCheck": {
|
|
51
|
+
"$ref": "#/definitions/ConfigurePropWithEnabled",
|
|
52
|
+
"description": "Configuration for the author's spellcheck; `enabled` is not read"
|
|
53
|
+
},
|
|
54
|
+
"playerSpellCheck": {
|
|
55
|
+
"$ref": "#/definitions/ConfigurePropWithEnabled",
|
|
56
|
+
"description": "Configuration for the player's spellcheck; `enabled` is not read"
|
|
57
|
+
},
|
|
58
|
+
"playerPasteFormatting": {
|
|
59
|
+
"$ref": "#/definitions/ConfigureProp",
|
|
60
|
+
"description": "Configuration for the player's plain-text paste"
|
|
61
|
+
},
|
|
62
|
+
"dimensions": {
|
|
63
|
+
"$ref": "#/definitions/ConfigureProp",
|
|
64
|
+
"description": "Dimensions configuration"
|
|
65
|
+
},
|
|
66
|
+
"maxImageWidth": {
|
|
67
|
+
"$ref": "#/definitions/ConfigureMaxImageDimensionsProp",
|
|
68
|
+
"description": "Maximum image width for input fields"
|
|
69
|
+
},
|
|
70
|
+
"maxImageHeight": {
|
|
71
|
+
"$ref": "#/definitions/ConfigureMaxImageDimensionsProp",
|
|
72
|
+
"description": "Maximum image height for input fields"
|
|
73
|
+
},
|
|
74
|
+
"withRubric": {
|
|
75
|
+
"$ref": "#/definitions/ConfigureWithForceProp",
|
|
76
|
+
"description": "Rubric configuration - only relevant in environments that use pie-player-components"
|
|
77
|
+
},
|
|
78
|
+
"mathMlOptions": {
|
|
79
|
+
"$ref": "#/definitions/ConfigureMathMLProp",
|
|
80
|
+
"description": "Configuration for editable-html"
|
|
81
|
+
},
|
|
82
|
+
"baseInputConfiguration": {
|
|
83
|
+
"$ref": "#/definitions/EditableHtmlConfigureProp",
|
|
84
|
+
"description": "Base editable html input configuration regarding plugins that are enabled/disabled E.g. audio, video, image"
|
|
85
|
+
},
|
|
86
|
+
"contentDimensions": {
|
|
87
|
+
"$ref": "#/definitions/ContentDimensions",
|
|
88
|
+
"description": "Dimensions of the authoring container"
|
|
89
|
+
},
|
|
90
|
+
"showPrompt": {
|
|
91
|
+
"type": "boolean",
|
|
92
|
+
"description": "Not read by this element: the model's `promptEnabled` shows the prompt"
|
|
93
|
+
},
|
|
94
|
+
"promptLabel": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "Not read by this element: `prompt.label` labels the prompt"
|
|
97
|
+
},
|
|
98
|
+
"settingsPartialScoring": {
|
|
99
|
+
"type": "boolean",
|
|
100
|
+
"description": "Not read by this element: it has no partial scoring"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"description": "Config Object for `@pie-element/extended-text-entry`",
|
|
104
|
+
"definitions": {
|
|
105
|
+
"ConfigureProp": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"properties": {
|
|
108
|
+
"settings": {
|
|
109
|
+
"type": "boolean",
|
|
110
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel"
|
|
111
|
+
},
|
|
112
|
+
"label": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"description": "Building blocks of an element's authoring configuration: the object a host passes to the `<tag>-config` custom element to decide which settings the author sees and how editors behave.\n\nEach element declares its own `<Name>Configuration` interface from these, and its JSON Schema is generated from that interface. Descriptions are carried over from the legacy `pie-elements` config schemas, so they appear in the generated schemas unchanged."
|
|
118
|
+
},
|
|
119
|
+
"ConfigurePropWithEnabled": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"properties": {
|
|
122
|
+
"settings": {
|
|
123
|
+
"type": "boolean",
|
|
124
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel"
|
|
125
|
+
},
|
|
126
|
+
"label": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel"
|
|
129
|
+
},
|
|
130
|
+
"enabled": {
|
|
131
|
+
"type": "boolean",
|
|
132
|
+
"description": "Indicates the value of the item if it affects config-ui (eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"EditableHtmlPluginConfigureRequired": {
|
|
137
|
+
"type": "object",
|
|
138
|
+
"properties": {
|
|
139
|
+
"settings": {
|
|
140
|
+
"type": "boolean",
|
|
141
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel"
|
|
142
|
+
},
|
|
143
|
+
"label": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel"
|
|
146
|
+
},
|
|
147
|
+
"inputConfiguration": {
|
|
148
|
+
"$ref": "#/definitions/EditableHtmlConfigureProp",
|
|
149
|
+
"description": "Configuration for editable-html"
|
|
150
|
+
},
|
|
151
|
+
"required": {
|
|
152
|
+
"type": "boolean",
|
|
153
|
+
"description": "Indicates if the item is required and the value cannot be empty"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"EditableHtmlConfigureProp": {
|
|
158
|
+
"type": "object",
|
|
159
|
+
"properties": {
|
|
160
|
+
"math": {
|
|
161
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
162
|
+
},
|
|
163
|
+
"audio": {
|
|
164
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
165
|
+
},
|
|
166
|
+
"video": {
|
|
167
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
168
|
+
},
|
|
169
|
+
"image": {
|
|
170
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
171
|
+
},
|
|
172
|
+
"customPlugins": {
|
|
173
|
+
"type": "array",
|
|
174
|
+
"items": {
|
|
175
|
+
"$ref": "#/definitions/CustomPlugin"
|
|
176
|
+
},
|
|
177
|
+
"description": "An array of objects that determine custom plugins. A custom plugin is an object which determines how the button will look like (icon) and the event name that will be triggered when the button gets pressed (event)."
|
|
178
|
+
},
|
|
179
|
+
"blockquote": {
|
|
180
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
181
|
+
},
|
|
182
|
+
"h3": {
|
|
183
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
184
|
+
},
|
|
185
|
+
"characters": {
|
|
186
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
187
|
+
},
|
|
188
|
+
"bold": {
|
|
189
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
190
|
+
},
|
|
191
|
+
"html": {
|
|
192
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
193
|
+
},
|
|
194
|
+
"italic": {
|
|
195
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
196
|
+
},
|
|
197
|
+
"ol_list": {
|
|
198
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
199
|
+
},
|
|
200
|
+
"redo": {
|
|
201
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
202
|
+
},
|
|
203
|
+
"strikethrough": {
|
|
204
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
205
|
+
},
|
|
206
|
+
"sub": {
|
|
207
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
208
|
+
},
|
|
209
|
+
"sup": {
|
|
210
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
211
|
+
},
|
|
212
|
+
"table": {
|
|
213
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
214
|
+
},
|
|
215
|
+
"ul_list": {
|
|
216
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
217
|
+
},
|
|
218
|
+
"underline": {
|
|
219
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
220
|
+
},
|
|
221
|
+
"undo": {
|
|
222
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
223
|
+
},
|
|
224
|
+
"textAlign": {
|
|
225
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
226
|
+
},
|
|
227
|
+
"showParagraphs": {
|
|
228
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
229
|
+
},
|
|
230
|
+
"separateParagraphs": {
|
|
231
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
232
|
+
},
|
|
233
|
+
"pasteFormatting": {
|
|
234
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
235
|
+
},
|
|
236
|
+
"superscript": {
|
|
237
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
238
|
+
},
|
|
239
|
+
"subscript": {
|
|
240
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
241
|
+
},
|
|
242
|
+
"languageCharacters": {
|
|
243
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
244
|
+
},
|
|
245
|
+
"responseArea": {
|
|
246
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"description": "Toolbar plugins of an editable-html field, keyed by plugin name."
|
|
250
|
+
},
|
|
251
|
+
"EditableHtmlButtonConfigure": {
|
|
252
|
+
"type": "object",
|
|
253
|
+
"properties": {
|
|
254
|
+
"disabled": {
|
|
255
|
+
"type": "boolean",
|
|
256
|
+
"description": "Indicates if the plugin is disabled or not"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"CustomPlugin": {
|
|
261
|
+
"type": "object",
|
|
262
|
+
"properties": {
|
|
263
|
+
"event": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"description": "The name of the custom event. It needs to be valid (only letters, numbers and \"_\" can be used). The event is emitted with the \"PIE-\" prefix."
|
|
266
|
+
},
|
|
267
|
+
"iconAlt": {
|
|
268
|
+
"type": "string",
|
|
269
|
+
"description": "The alt for the custom button icon"
|
|
270
|
+
},
|
|
271
|
+
"iconType": {
|
|
272
|
+
"type": "string",
|
|
273
|
+
"description": "The icon type. Currently, only \"SVG\" is supported."
|
|
274
|
+
},
|
|
275
|
+
"icon": {
|
|
276
|
+
"type": "string",
|
|
277
|
+
"description": "The icon string. Currently, only SVG is supported, so it needs to be a valid svg."
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
"required": [
|
|
281
|
+
"event",
|
|
282
|
+
"iconAlt",
|
|
283
|
+
"iconType",
|
|
284
|
+
"icon"
|
|
285
|
+
]
|
|
286
|
+
},
|
|
287
|
+
"ConfigureMaxImageDimensionsProp": {
|
|
288
|
+
"type": "object",
|
|
289
|
+
"properties": {
|
|
290
|
+
"teacherInstructions": {
|
|
291
|
+
"type": "number",
|
|
292
|
+
"description": "Indicates the max dimension for images in teacher instructions"
|
|
293
|
+
},
|
|
294
|
+
"prompt": {
|
|
295
|
+
"type": "number",
|
|
296
|
+
"description": "Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified"
|
|
297
|
+
},
|
|
298
|
+
"rationale": {
|
|
299
|
+
"type": "number",
|
|
300
|
+
"description": "Indicates the max dimension for images in rationale"
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"description": "Maximum image dimensions per editable field. Elements extend it with their own fields."
|
|
304
|
+
},
|
|
305
|
+
"ConfigureWithForceProp": {
|
|
306
|
+
"type": "object",
|
|
307
|
+
"properties": {
|
|
308
|
+
"settings": {
|
|
309
|
+
"type": "boolean",
|
|
310
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel"
|
|
311
|
+
},
|
|
312
|
+
"label": {
|
|
313
|
+
"type": "string",
|
|
314
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel"
|
|
315
|
+
},
|
|
316
|
+
"forceEnabled": {
|
|
317
|
+
"type": "boolean",
|
|
318
|
+
"description": "Indicates the value for the toggle; if true:\n- this property will not be visible in Settings Panel (settings will become automatically false)\n- the model property afferent to it will become automatically true"
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
"ConfigureMathMLProp": {
|
|
323
|
+
"type": "object",
|
|
324
|
+
"properties": {
|
|
325
|
+
"mmlOutput": {
|
|
326
|
+
"type": "boolean",
|
|
327
|
+
"description": "Indicates if model should have mathML output instead of latex"
|
|
328
|
+
},
|
|
329
|
+
"mmlEditing": {
|
|
330
|
+
"type": "boolean",
|
|
331
|
+
"description": "Indicates if mathML that's already in model should be editable"
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"ContentDimensions": {
|
|
336
|
+
"type": "object",
|
|
337
|
+
"properties": {
|
|
338
|
+
"maxHeight": {
|
|
339
|
+
"type": [
|
|
340
|
+
"string",
|
|
341
|
+
"number"
|
|
342
|
+
]
|
|
343
|
+
},
|
|
344
|
+
"maxWidth": {
|
|
345
|
+
"type": [
|
|
346
|
+
"string",
|
|
347
|
+
"number"
|
|
348
|
+
]
|
|
349
|
+
},
|
|
350
|
+
"minHeight": {
|
|
351
|
+
"type": [
|
|
352
|
+
"string",
|
|
353
|
+
"number"
|
|
354
|
+
]
|
|
355
|
+
},
|
|
356
|
+
"minWidth": {
|
|
357
|
+
"type": [
|
|
358
|
+
"string",
|
|
359
|
+
"number"
|
|
360
|
+
]
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
"description": "Indicates the dimensions configuration for the authoring container. Note: Some items have a default minimum width because of their content, but if a lower minWidth is provided, it will be used."
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
"additionalProperties": false
|
|
367
|
+
}
|