@pie-element/passage 8.0.4-next.20261011174919 → 8.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/controller/defaults.ts","../../../../src/controller/index.ts"],"sourcesContent":["// @ts-nocheck\n\n// TODO: also update '../../configure/src/defaults.js' and '../../src/print.js' when updating defaults\nexport default {\n authorEnabled: false, // TODO: should be set to true when all Studio content is updated\n passages: [\n {\n teacherInstructions: '',\n title: '',\n subtitle: '',\n author: '',\n text: '',\n },\n ],\n subtitleEnabled: true,\n teacherInstructionsEnabled: true,\n textEnabled: true,\n titleEnabled: true,\n};\n","// @ts-nocheck\n\nimport { isEmpty } from '@pie-element/shared-lodash';\n\nimport defaults from './defaults.js';\n\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nconst checkNullish = (value) => value !== null && value !== undefined;\n\nconst isEnabled = (value, defaultValue) => (checkNullish(value) ? value : defaultValue);\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => {\n resolve({ ...defaults, ...model });\n });\n}\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\nconst normalizeTeacherInstructions = (instructions, env) => {\n const { role, mode } = env;\n\n if (role === 'instructor' && (mode === 'view' || mode === 'evaluate')) {\n return instructions || '';\n }\n\n return '';\n};\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n\n const normalizedPassages = normalizedQuestion.passages.map((passage, index) => ({\n teacherInstructions: isEnabled(passage.teacherInstructionsEnabled, normalizedQuestion.teacherInstructionsEnabled)\n ? normalizeTeacherInstructions(passage.teacherInstructions, env)\n : '',\n label: getContent(passage.title) ? passage.title : `Passage ${index + 1}`,\n title: isEnabled(passage.titleEnabled, normalizedQuestion.titleEnabled) ? passage.title || '' : '',\n subtitle: isEnabled(passage.subtitleEnabled, normalizedQuestion.subtitleEnabled) ? passage.subtitle || '' : '',\n author: isEnabled(passage.authorEnabled, normalizedQuestion.authorEnabled) ? passage.author || '' : '',\n text: isEnabled(passage.textEnabled, normalizedQuestion.textEnabled) ? passage.text || '' : '',\n }));\n\n return {\n ...normalizedQuestion,\n passages: normalizedPassages,\n };\n}\n\nexport const validate = (model = {}, config = {}) => {\n const errors = {};\n const passagesErrors = {};\n\n (model.passages || []).forEach((passage, index) => {\n const err = {};\n\n ['teacherInstructions', 'title', 'subtitle', 'author', 'text'].forEach((field) => {\n if (config[field]?.required && !getContent(passage[field])) {\n err[field] = 'This field is required.';\n }\n });\n\n if (!isEmpty(err)) {\n passagesErrors[index] = err;\n }\n });\n\n if (!isEmpty(passagesErrors)) {\n errors.passages = passagesErrors;\n }\n\n return errors;\n};\n"],"mappings":";;AAGA,IAAA,IAAe;CACb,eAAe;CACf,UAAU,CACR;EACE,qBAAqB;EACrB,OAAO;EACP,UAAU;EACV,QAAQ;EACR,MAAM;CACR,CACF;CACA,iBAAiB;CACjB,4BAA4B;CAC5B,aAAa;CACb,cAAc;AAChB,GCZM,KAAc,OAAU,KAAQ,GAAA,CAAI,QAAQ,sCAAsC,EAAE,GAEpF,KAAgB,MAAU,KAAU,MAEpC,KAAa,GAAO,MAAkB,EAAa,CAAK,IAAI,IAAQ;AAE1E,SAAgB,EAAmB,IAAQ,CAAC,GAAG;CAC7C,OAAO,IAAI,SAAS,MAAY;EAC9B,EAAQ;GAAE,GAAG;GAAU,GAAG;EAAM,CAAC;CACnC,CAAC;AACH;AAEA,IAAa,KAAa,OAAc;CAAE,GAAG;CAAU,GAAG;AAAS,IAE7D,KAAgC,GAAc,MAAQ;CAC1D,IAAM,EAAE,SAAM,YAAS;CAMvB,OAJI,MAAS,iBAAiB,MAAS,UAAU,MAAS,eACjD,KAGF;AACT;AAQA,eAAsB,EAAM,GAAU,GAAS,GAAK;CAClD,IAAM,IAAqB,EAAU,CAAQ,GAEvC,IAAqB,EAAmB,SAAS,KAAK,GAAS,OAAW;EAC9E,qBAAqB,EAAU,EAAQ,4BAA4B,EAAmB,0BAA0B,IAC5G,EAA6B,EAAQ,qBAAqB,CAAG,IAC7D;EACJ,OAAO,EAAW,EAAQ,KAAK,IAAI,EAAQ,QAAQ,WAAW,IAAQ;EACtE,OAAO,EAAU,EAAQ,cAAc,EAAmB,YAAY,KAAI,EAAQ,SAAc;EAChG,UAAU,EAAU,EAAQ,iBAAiB,EAAmB,eAAe,KAAI,EAAQ,YAAiB;EAC5G,QAAQ,EAAU,EAAQ,eAAe,EAAmB,aAAa,KAAI,EAAQ,UAAe;EACpG,MAAM,EAAU,EAAQ,aAAa,EAAmB,WAAW,KAAI,EAAQ,QAAa;CAC9F,EAAE;CAEF,OAAO;EACL,GAAG;EACH,UAAU;CACZ;AACF;AAEA,IAAa,KAAY,IAAQ,CAAC,GAAG,IAAS,CAAC,MAAM;CACnD,IAAM,IAAS,CAAC,GACV,IAAiB,CAAC;CAoBxB,QAlBC,EAAM,YAAY,CAAC,EAAA,CAAG,SAAS,GAAS,MAAU;EACjD,IAAM,IAAM,CAAC;EAQb,AANA;GAAC;GAAuB;GAAS;GAAY;GAAU;EAAM,CAAC,CAAC,SAAS,MAAU;GAChF,AAAI,EAAO,EAAM,EAAE,YAAY,CAAC,EAAW,EAAQ,EAAM,MACvD,EAAI,KAAS;EAEjB,CAAC,GAEI,EAAQ,CAAG,MACd,EAAe,KAAS;CAE5B,CAAC,GAEI,EAAQ,CAAc,MACzB,EAAO,WAAW,IAGb;AACT"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/controller/defaults.ts","../../../../src/controller/index.ts"],"sourcesContent":["import type { PassageModel } from '../types.js';\n\n// TODO: also update '../../configure/src/defaults.js' and '../../src/print.js' when updating defaults\nexport default {\n authorEnabled: false, // TODO: should be set to true when all Studio content is updated\n passages: [\n {\n teacherInstructions: '',\n title: '',\n subtitle: '',\n author: '',\n text: '',\n },\n ],\n subtitleEnabled: true,\n teacherInstructionsEnabled: true,\n textEnabled: true,\n titleEnabled: true,\n} satisfies Omit<PassageModel, 'id' | 'element'>;\n","import { isEmpty } from '@pie-element/shared-lodash';\nimport type { PieEnvironment } from '@pie-element/shared-types';\n\nimport defaults from './defaults.js';\nimport type { PassageConfiguration, PassageModel, PassageSession } from '../types.js';\n\n/** A passage as the delivery renders it: each field is empty when disabled */\nexport interface PassageView {\n teacherInstructions: string;\n label: string;\n title: string;\n subtitle: string;\n author: string;\n text: string;\n}\n\nexport type ModelView = Omit<PassageModel, 'passages'> & { passages: PassageView[] };\n\ntype PassageField = 'teacherInstructions' | 'title' | 'subtitle' | 'author' | 'text';\n\nexport type PassageFieldErrors = Partial<Record<PassageField, string>>;\n\n/** Errors from `validate()`, keyed by passage index */\nexport type PassageValidationErrors = {\n passages?: Record<number, PassageFieldErrors>;\n};\n\nconst getContent = (html: string | undefined) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nconst checkNullish = (value: boolean | undefined) => value !== null && value !== undefined;\n\nconst isEnabled = (value: boolean | undefined, defaultValue: boolean | undefined) => (checkNullish(value) ? value : defaultValue);\n\nexport function createDefaultModel(model: Partial<PassageModel> = {}) {\n return new Promise<Omit<PassageModel, 'id' | 'element'> & Partial<PassageModel>>((resolve) => {\n resolve({ ...defaults, ...model });\n });\n}\n\nexport const normalize = (question: PassageModel) => ({ ...defaults, ...question });\n\nconst normalizeTeacherInstructions = (instructions: string | undefined, env: PieEnvironment) => {\n const { role, mode } = env;\n\n if (role === 'instructor' && (mode === 'view' || mode === 'evaluate')) {\n return instructions || '';\n }\n\n return '';\n};\n\nexport async function model(\n question: PassageModel,\n _session: PassageSession | undefined,\n env: PieEnvironment\n): Promise<ModelView> {\n const normalizedQuestion = normalize(question);\n\n const normalizedPassages = normalizedQuestion.passages.map((passage, index): PassageView => ({\n teacherInstructions: isEnabled(passage.teacherInstructionsEnabled, normalizedQuestion.teacherInstructionsEnabled)\n ? normalizeTeacherInstructions(passage.teacherInstructions, env)\n : '',\n label: getContent(passage.title) ? passage.title! : `Passage ${index + 1}`,\n title: isEnabled(passage.titleEnabled, normalizedQuestion.titleEnabled) ? passage.title || '' : '',\n subtitle: isEnabled(passage.subtitleEnabled, normalizedQuestion.subtitleEnabled) ? passage.subtitle || '' : '',\n author: isEnabled(passage.authorEnabled, normalizedQuestion.authorEnabled) ? passage.author || '' : '',\n text: isEnabled(passage.textEnabled, normalizedQuestion.textEnabled) ? passage.text || '' : '',\n }));\n\n return {\n ...normalizedQuestion,\n passages: normalizedPassages,\n };\n}\n\nexport const validate = (\n model: Partial<PassageModel> = {},\n config: PassageConfiguration = {}\n): PassageValidationErrors => {\n const errors: PassageValidationErrors = {};\n const passagesErrors: Record<number, PassageFieldErrors> = {};\n\n (model.passages || []).forEach((passage, index) => {\n const err: PassageFieldErrors = {};\n\n (['teacherInstructions', 'title', 'subtitle', 'author', 'text'] as const).forEach((field) => {\n if (config[field]?.required && !getContent(passage[field])) {\n err[field] = 'This field is required.';\n }\n });\n\n if (!isEmpty(err)) {\n passagesErrors[index] = err;\n }\n });\n\n if (!isEmpty(passagesErrors)) {\n errors.passages = passagesErrors;\n }\n\n return errors;\n};\n"],"mappings":";;AAGA,IAAA,IAAe;CACb,eAAe;CACf,UAAU,CACR;EACE,qBAAqB;EACrB,OAAO;EACP,UAAU;EACV,QAAQ;EACR,MAAM;CACR,CACF;CACA,iBAAiB;CACjB,4BAA4B;CAC5B,aAAa;CACb,cAAc;AAChB,GCSM,KAAc,OAA8B,KAAQ,GAAA,CAAI,QAAQ,sCAAsC,EAAE,GAExG,KAAgB,MAA+B,KAAU,MAEzD,KAAa,GAA4B,MAAuC,EAAa,CAAK,IAAI,IAAQ;AAEpH,SAAgB,EAAmB,IAA+B,CAAC,GAAG;CACpE,OAAO,IAAI,SAAuE,MAAY;EAC5F,EAAQ;GAAE,GAAG;GAAU,GAAG;EAAM,CAAC;CACnC,CAAC;AACH;AAEA,IAAa,KAAa,OAA4B;CAAE,GAAG;CAAU,GAAG;AAAS,IAE3E,KAAgC,GAAkC,MAAwB;CAC9F,IAAM,EAAE,SAAM,YAAS;CAMvB,OAJI,MAAS,iBAAiB,MAAS,UAAU,MAAS,eACjD,KAGF;AACT;AAEA,eAAsB,EACpB,GACA,GACA,GACoB;CACpB,IAAM,IAAqB,EAAU,CAAQ,GAEvC,IAAqB,EAAmB,SAAS,KAAK,GAAS,OAAwB;EAC3F,qBAAqB,EAAU,EAAQ,4BAA4B,EAAmB,0BAA0B,IAC5G,EAA6B,EAAQ,qBAAqB,CAAG,IAC7D;EACJ,OAAO,EAAW,EAAQ,KAAK,IAAI,EAAQ,QAAS,WAAW,IAAQ;EACvE,OAAO,EAAU,EAAQ,cAAc,EAAmB,YAAY,KAAI,EAAQ,SAAc;EAChG,UAAU,EAAU,EAAQ,iBAAiB,EAAmB,eAAe,KAAI,EAAQ,YAAiB;EAC5G,QAAQ,EAAU,EAAQ,eAAe,EAAmB,aAAa,KAAI,EAAQ,UAAe;EACpG,MAAM,EAAU,EAAQ,aAAa,EAAmB,WAAW,KAAI,EAAQ,QAAa;CAC9F,EAAE;CAEF,OAAO;EACL,GAAG;EACH,UAAU;CACZ;AACF;AAEA,IAAa,KACX,IAA+B,CAAC,GAChC,IAA+B,CAAC,MACJ;CAC5B,IAAM,IAAkC,CAAC,GACnC,IAAqD,CAAC;CAoB5D,QAlBC,EAAM,YAAY,CAAC,EAAA,CAAG,SAAS,GAAS,MAAU;EACjD,IAAM,IAA0B,CAAC;EAQjC,AANA;GAAE;GAAuB;GAAS;GAAY;GAAU;EAAM,CAAC,CAAW,SAAS,MAAU;GAC3F,AAAI,EAAO,EAAM,EAAE,YAAY,CAAC,EAAW,EAAQ,EAAM,MACvD,EAAI,KAAS;EAEjB,CAAC,GAEI,EAAQ,CAAG,MACd,EAAe,KAAS;CAE5B,CAAC,GAEI,EAAQ,CAAc,MACzB,EAAO,WAAW,IAGb;AACT"}
@@ -1,5 +1,5 @@
1
1
  declare const _default: {
2
- authorEnabled: boolean;
2
+ authorEnabled: false;
3
3
  passages: {
4
4
  teacherInstructions: string;
5
5
  title: string;
@@ -7,9 +7,9 @@ declare const _default: {
7
7
  author: string;
8
8
  text: string;
9
9
  }[];
10
- subtitleEnabled: boolean;
11
- teacherInstructionsEnabled: boolean;
12
- textEnabled: boolean;
13
- titleEnabled: boolean;
10
+ subtitleEnabled: true;
11
+ teacherInstructionsEnabled: true;
12
+ textEnabled: true;
13
+ titleEnabled: true;
14
14
  };
15
15
  export default _default;
@@ -1,10 +1,37 @@
1
- export declare function createDefaultModel(model?: {}): Promise<unknown>;
2
- export declare const normalize: (question: any) => any;
3
- /**
4
- *
5
- * @param {*} question
6
- * @param {*} session
7
- * @param {*} env
8
- */
9
- export declare function model(question: any, session: any, env: any): Promise<any>;
10
- export declare const validate: (model?: {}, config?: {}) => {};
1
+ import type { PieEnvironment } from '@pie-element/shared-types';
2
+ import type { PassageConfiguration, PassageModel, PassageSession } from '../types.js';
3
+ /** A passage as the delivery renders it: each field is empty when disabled */
4
+ export interface PassageView {
5
+ teacherInstructions: string;
6
+ label: string;
7
+ title: string;
8
+ subtitle: string;
9
+ author: string;
10
+ text: string;
11
+ }
12
+ export type ModelView = Omit<PassageModel, 'passages'> & {
13
+ passages: PassageView[];
14
+ };
15
+ type PassageField = 'teacherInstructions' | 'title' | 'subtitle' | 'author' | 'text';
16
+ export type PassageFieldErrors = Partial<Record<PassageField, string>>;
17
+ /** Errors from `validate()`, keyed by passage index */
18
+ export type PassageValidationErrors = {
19
+ passages?: Record<number, PassageFieldErrors>;
20
+ };
21
+ export declare function createDefaultModel(model?: Partial<PassageModel>): Promise<Omit<PassageModel, "id" | "element"> & Partial<PassageModel>>;
22
+ export declare const normalize: (question: PassageModel) => {
23
+ passages: import("../types.js").PassageEntry[];
24
+ teacherInstructionsEnabled: boolean;
25
+ titleEnabled: boolean;
26
+ subtitleEnabled: boolean;
27
+ textEnabled: boolean;
28
+ authorEnabled: boolean;
29
+ language?: string;
30
+ extraCSSRules?: import("@pie-element/shared-types").ExtraCSSRules;
31
+ id: string;
32
+ element: string;
33
+ accessibilityCatalogs?: import("@pie-element/shared-types").AccessibilityCatalog[];
34
+ };
35
+ export declare function model(question: PassageModel, _session: PassageSession | undefined, env: PieEnvironment): Promise<ModelView>;
36
+ export declare const validate: (model?: Partial<PassageModel>, config?: PassageConfiguration) => PassageValidationErrors;
37
+ export {};
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { default } from './delivery/index.js';
2
+ export type * from './types.js';
@@ -0,0 +1,301 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://cdn.jsdelivr.net/npm/@pie-element/passage@8.0.4/dist/schemas/configuration.schema.json",
4
+ "type": "object",
5
+ "properties": {
6
+ "settingsPanelDisabled": {
7
+ "type": "boolean",
8
+ "description": "Indicates if the settings panel is not available"
9
+ },
10
+ "title": {
11
+ "$ref": "#/definitions/EditableHtmlPluginConfigureRequired",
12
+ "description": "Title configuration"
13
+ },
14
+ "subtitle": {
15
+ "$ref": "#/definitions/EditableHtmlPluginConfigureRequired",
16
+ "description": "Subtitle configuration"
17
+ },
18
+ "author": {
19
+ "$ref": "#/definitions/EditableHtmlPluginConfigureRequired",
20
+ "description": "Author configuration"
21
+ },
22
+ "text": {
23
+ "$ref": "#/definitions/EditableHtmlPluginConfigureRequired",
24
+ "description": "Text configuration"
25
+ },
26
+ "teacherInstructions": {
27
+ "$ref": "#/definitions/EditableHtmlPluginConfigureRequired",
28
+ "description": "Teacher Instructions configuration"
29
+ },
30
+ "maxImageWidth": {
31
+ "$ref": "#/definitions/PassageMaxImageDimensionsProp",
32
+ "description": "Maximum image width for input fields"
33
+ },
34
+ "maxImageHeight": {
35
+ "$ref": "#/definitions/PassageMaxImageDimensionsProp",
36
+ "description": "Maximum image height for input fields"
37
+ },
38
+ "mathMlOptions": {
39
+ "$ref": "#/definitions/ConfigureMathMLProp",
40
+ "description": "Configuration for editable-html"
41
+ },
42
+ "baseInputConfiguration": {
43
+ "$ref": "#/definitions/EditableHtmlConfigureProp",
44
+ "description": "Base editable html input configuration regarding plugins that are enabled/disabled E.g. audio, video, image"
45
+ },
46
+ "language": {
47
+ "$ref": "#/definitions/ConfigurePropWithEnabled",
48
+ "description": "Language configuration"
49
+ },
50
+ "languageChoices": {
51
+ "$ref": "#/definitions/ConfigureLanguageOptions",
52
+ "description": "Language choices configuration Only available if language is enabled"
53
+ },
54
+ "additionalPassage": {
55
+ "$ref": "#/definitions/ConfigurePropWithEnabled",
56
+ "description": "ability to include a second passage"
57
+ }
58
+ },
59
+ "description": "Config Object for `@pie-element/passage`",
60
+ "definitions": {
61
+ "EditableHtmlPluginConfigureRequired": {
62
+ "type": "object",
63
+ "properties": {
64
+ "settings": {
65
+ "type": "boolean",
66
+ "description": "Indicates if the item has to be displayed in the Settings Panel"
67
+ },
68
+ "label": {
69
+ "type": "string",
70
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel"
71
+ },
72
+ "inputConfiguration": {
73
+ "$ref": "#/definitions/EditableHtmlConfigureProp",
74
+ "description": "Configuration for editable-html"
75
+ },
76
+ "required": {
77
+ "type": "boolean",
78
+ "description": "Indicates if the item is required and the value cannot be empty"
79
+ }
80
+ }
81
+ },
82
+ "EditableHtmlConfigureProp": {
83
+ "type": "object",
84
+ "properties": {
85
+ "math": {
86
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
87
+ },
88
+ "audio": {
89
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
90
+ },
91
+ "video": {
92
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
93
+ },
94
+ "image": {
95
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
96
+ },
97
+ "customPlugins": {
98
+ "type": "array",
99
+ "items": {
100
+ "$ref": "#/definitions/CustomPlugin"
101
+ },
102
+ "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)."
103
+ },
104
+ "blockquote": {
105
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
106
+ },
107
+ "h3": {
108
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
109
+ },
110
+ "characters": {
111
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
112
+ },
113
+ "bold": {
114
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
115
+ },
116
+ "html": {
117
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
118
+ },
119
+ "italic": {
120
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
121
+ },
122
+ "ol_list": {
123
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
124
+ },
125
+ "redo": {
126
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
127
+ },
128
+ "strikethrough": {
129
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
130
+ },
131
+ "sub": {
132
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
133
+ },
134
+ "sup": {
135
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
136
+ },
137
+ "table": {
138
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
139
+ },
140
+ "ul_list": {
141
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
142
+ },
143
+ "underline": {
144
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
145
+ },
146
+ "undo": {
147
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
148
+ },
149
+ "textAlign": {
150
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
151
+ },
152
+ "showParagraphs": {
153
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
154
+ },
155
+ "separateParagraphs": {
156
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
157
+ },
158
+ "pasteFormatting": {
159
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
160
+ },
161
+ "superscript": {
162
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
163
+ },
164
+ "subscript": {
165
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
166
+ },
167
+ "languageCharacters": {
168
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
169
+ },
170
+ "responseArea": {
171
+ "$ref": "#/definitions/EditableHtmlButtonConfigure"
172
+ }
173
+ },
174
+ "description": "Toolbar plugins of an editable-html field, keyed by plugin name."
175
+ },
176
+ "EditableHtmlButtonConfigure": {
177
+ "type": "object",
178
+ "properties": {
179
+ "disabled": {
180
+ "type": "boolean",
181
+ "description": "Indicates if the plugin is disabled or not"
182
+ }
183
+ }
184
+ },
185
+ "CustomPlugin": {
186
+ "type": "object",
187
+ "properties": {
188
+ "event": {
189
+ "type": "string",
190
+ "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."
191
+ },
192
+ "iconAlt": {
193
+ "type": "string",
194
+ "description": "The alt for the custom button icon"
195
+ },
196
+ "iconType": {
197
+ "type": "string",
198
+ "description": "The icon type. Currently, only \"SVG\" is supported."
199
+ },
200
+ "icon": {
201
+ "type": "string",
202
+ "description": "The icon string. Currently, only SVG is supported, so it needs to be a valid svg."
203
+ }
204
+ },
205
+ "required": [
206
+ "event",
207
+ "iconAlt",
208
+ "iconType",
209
+ "icon"
210
+ ]
211
+ },
212
+ "PassageMaxImageDimensionsProp": {
213
+ "type": "object",
214
+ "properties": {
215
+ "teacherInstructions": {
216
+ "type": "number",
217
+ "description": "Indicates the max dimension for images in teacher instructions"
218
+ },
219
+ "prompt": {
220
+ "type": "number",
221
+ "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"
222
+ },
223
+ "rationale": {
224
+ "type": "number",
225
+ "description": "Indicates the max dimension for images in rationale"
226
+ },
227
+ "text": {
228
+ "type": "number",
229
+ "description": "Indicates the max dimension for images in the passage text"
230
+ }
231
+ },
232
+ "description": "Maximum image dimensions for the passage's editable fields"
233
+ },
234
+ "ConfigureMathMLProp": {
235
+ "type": "object",
236
+ "properties": {
237
+ "mmlOutput": {
238
+ "type": "boolean",
239
+ "description": "Indicates if model should have mathML output instead of latex"
240
+ },
241
+ "mmlEditing": {
242
+ "type": "boolean",
243
+ "description": "Indicates if mathML that's already in model should be editable"
244
+ }
245
+ }
246
+ },
247
+ "ConfigurePropWithEnabled": {
248
+ "type": "object",
249
+ "properties": {
250
+ "settings": {
251
+ "type": "boolean",
252
+ "description": "Indicates if the item has to be displayed in the Settings Panel"
253
+ },
254
+ "label": {
255
+ "type": "string",
256
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel"
257
+ },
258
+ "enabled": {
259
+ "type": "boolean",
260
+ "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)"
261
+ }
262
+ }
263
+ },
264
+ "ConfigureLanguageOptions": {
265
+ "type": "object",
266
+ "properties": {
267
+ "label": {
268
+ "type": "string"
269
+ },
270
+ "options": {
271
+ "type": "array",
272
+ "items": {
273
+ "$ref": "#/definitions/ConfigureLanguageOptionsProp"
274
+ }
275
+ }
276
+ },
277
+ "required": [
278
+ "label",
279
+ "options"
280
+ ]
281
+ },
282
+ "ConfigureLanguageOptionsProp": {
283
+ "type": "object",
284
+ "properties": {
285
+ "value": {
286
+ "type": "string",
287
+ "description": "Value of the language option"
288
+ },
289
+ "label": {
290
+ "type": "string",
291
+ "description": "Label of the language option"
292
+ }
293
+ },
294
+ "required": [
295
+ "value",
296
+ "label"
297
+ ]
298
+ }
299
+ },
300
+ "additionalProperties": false
301
+ }