@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.
@@ -0,0 +1,229 @@
1
+ import type { ConfigureMathMLProp, ConfigureMaxImageDimensionsProp, ConfigureProp, ConfigurePropWithEnabled, ContentDimensions, EditableHtmlConfigureProp, EditableHtmlPluginConfigureRequired, ExtraCSSRules, PieModel } from '@pie-element/shared-types';
2
+ /** Dimensions the editor should take */
3
+ export interface ExtendedTextEntryDimensions {
4
+ /**
5
+ * Width the editor should take. USE CSS-style definition; the author writes a number of pixels.
6
+ */
7
+ width?: number | string;
8
+ /**
9
+ * Height the editor should take. USE CSS-style definition; the author writes a number of pixels.
10
+ */
11
+ height?: number | string;
12
+ }
13
+ export interface PredefinedAnnotation {
14
+ /** Indicates the value displayed in the annotation button */
15
+ label: string;
16
+ /** Indicates the annotation value */
17
+ text: string;
18
+ /** Indicates the type of the annotation */
19
+ type: 'positive' | 'negative';
20
+ }
21
+ /**
22
+ * Feedback shown when the response is submitted. The author's feedback selector changes `type` and keeps
23
+ * the other message, so a `custom` type can arrive without `custom` text, and then the default message
24
+ * shows.
25
+ */
26
+ export interface ExtendedTextEntryFeedback {
27
+ /** Indicates the feedback type */
28
+ type: 'default' | 'none' | 'custom';
29
+ /** Indicates the feedback value */
30
+ default?: string;
31
+ /** Indicates the feedback custom value */
32
+ custom?: string;
33
+ }
34
+ /** Model for the `@pie-element/extended-text-entry` Interaction */
35
+ export interface ExtendedTextEntryModel extends PieModel {
36
+ /**
37
+ * Dimensions the editor should take
38
+ * @default {"height":100,"width":500}
39
+ */
40
+ dimensions?: ExtendedTextEntryDimensions;
41
+ /**
42
+ * Indicates the math keypad the student gets when math input is enabled; the grade bands map to the
43
+ * keypad's grade modes
44
+ * @default "Grade 8 - HS"
45
+ */
46
+ 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';
47
+ /** Extra keys added to the math keypad */
48
+ customKeys?: string[];
49
+ /** Feedback configuration */
50
+ feedback?: ExtendedTextEntryFeedback;
51
+ /**
52
+ * Whether a control to allow insertion of math forumulas should be displayed
53
+ * @default false
54
+ */
55
+ mathInput?: boolean;
56
+ /**
57
+ * Whether a control to allow insertion of spanish characters should be displayed
58
+ * @default false
59
+ */
60
+ spanishInput?: boolean;
61
+ /**
62
+ * Whether a control to allow insertion of special characters should be displayed
63
+ * @default false
64
+ */
65
+ specialInput?: boolean;
66
+ /** Not read by this element: the author toggles multiple parts on the configuration's `multiple.enabled` */
67
+ multiple?: boolean;
68
+ /** The question prompt */
69
+ prompt?: string;
70
+ /**
71
+ * Indicates if the prompt is enabled
72
+ * @default true
73
+ */
74
+ promptEnabled?: boolean;
75
+ /** Not read by this element: it renders no student instructions */
76
+ studentInstructions?: string;
77
+ /** Indicates teacher instructions */
78
+ teacherInstructions?: string;
79
+ /**
80
+ * Indicates if the annotations are enabled
81
+ * @default false
82
+ */
83
+ annotationsEnabled?: boolean;
84
+ /**
85
+ * Indicates if Feedback is enabled
86
+ * @default false
87
+ */
88
+ feedbackEnabled?: boolean;
89
+ /** Not read by this element: the default models carry it, and nothing renders a rationale */
90
+ rationale?: string;
91
+ /**
92
+ * Not read by this element: the default models carry it, and nothing renders a rationale
93
+ * @default true
94
+ */
95
+ rationaleEnabled?: boolean;
96
+ /** Indicates if spellcheck is enabled for the author. Default value is true */
97
+ spellCheckEnabled?: boolean;
98
+ /**
99
+ * Indicates if spellcheck is disabled for the player; the player spellchecks only when this is false
100
+ * @default true
101
+ */
102
+ playerSpellCheckDisabled?: boolean;
103
+ /**
104
+ * Indicates if the player pastes plain text only
105
+ * @default false
106
+ */
107
+ playerPasteFormattingDisabled?: boolean;
108
+ /**
109
+ * Indicates if Student Instructions are enabled; the author shows the toggle, and nothing renders them
110
+ * @default true
111
+ */
112
+ studentInstructionsEnabled?: boolean;
113
+ /**
114
+ * Indicates if Teacher Instructions are enabled
115
+ * @default true
116
+ */
117
+ teacherInstructionsEnabled?: boolean;
118
+ /**
119
+ * Indicates the editor's toolbar position which can be 'bottom' or 'top'
120
+ * @default "bottom"
121
+ */
122
+ toolbarEditorPosition?: 'bottom' | 'top';
123
+ /** Indicates the predefined annotations for the annotation menu */
124
+ predefinedAnnotations?: PredefinedAnnotation[];
125
+ /**
126
+ * Indicates the editor's toolbar position for the player, which can be 'bottom' or 'top'
127
+ * @default "bottom"
128
+ */
129
+ playersToolbarPosition?: 'bottom' | 'top';
130
+ /** Indicates if Rubric is enabled */
131
+ rubricEnabled?: boolean;
132
+ /**
133
+ * Indicates the language of the component
134
+ * Supported options: en, es, en_US, en-US, es_ES, es-ES, es_MX, es-MX
135
+ */
136
+ language?: string;
137
+ /** Host-supplied CSS scoped to the element */
138
+ extraCSSRules?: ExtraCSSRules;
139
+ }
140
+ export interface ConfigureWithForceProp extends ConfigureProp {
141
+ /**
142
+ * Indicates the value for the toggle;
143
+ * if true:
144
+ * - this property will not be visible in Settings Panel (settings will become automatically false)
145
+ * - the model property afferent to it will become automatically true
146
+ */
147
+ forceEnabled?: boolean;
148
+ }
149
+ /** Config Object for `@pie-element/extended-text-entry` */
150
+ export interface ExtendedTextEntryConfiguration {
151
+ /** Annotations configuration */
152
+ annotations?: ConfigureProp;
153
+ /** Equation Editor configuration; `enabled` shows the equation editor choice */
154
+ equationEditor?: ConfigurePropWithEnabled;
155
+ /** Feedback configuration */
156
+ feedback?: ConfigureProp;
157
+ /** Math Input configuration; `enabled` is not read */
158
+ mathInput?: ConfigurePropWithEnabled;
159
+ /** Indicates if the settings panel is not available */
160
+ settingsPanelDisabled?: boolean;
161
+ /** Spanish Input configuration; `enabled` is not read */
162
+ spanishInput?: ConfigurePropWithEnabled;
163
+ /** Special Input configuration; `enabled` is not read */
164
+ specialInput?: ConfigurePropWithEnabled;
165
+ /** Multiple Parts configuration; the settings toggle writes `enabled`, which nothing else reads */
166
+ multiple?: ConfigurePropWithEnabled;
167
+ /** Student Instructions configuration */
168
+ studentInstructions?: ConfigureProp;
169
+ /** Teacher Instructions configuration */
170
+ teacherInstructions?: EditableHtmlPluginConfigureRequired;
171
+ /** Prompt configuration */
172
+ prompt?: EditableHtmlPluginConfigureRequired;
173
+ /** Configuration for the author's spellcheck; `enabled` is not read */
174
+ spellCheck?: ConfigurePropWithEnabled;
175
+ /** Configuration for the player's spellcheck; `enabled` is not read */
176
+ playerSpellCheck?: ConfigurePropWithEnabled;
177
+ /** Configuration for the player's plain-text paste */
178
+ playerPasteFormatting?: ConfigureProp;
179
+ /** Dimensions configuration */
180
+ dimensions?: ConfigureProp;
181
+ /** Maximum image width for input fields */
182
+ maxImageWidth?: ConfigureMaxImageDimensionsProp;
183
+ /** Maximum image height for input fields */
184
+ maxImageHeight?: ConfigureMaxImageDimensionsProp;
185
+ /** Rubric configuration - only relevant in environments that use pie-player-components */
186
+ withRubric?: ConfigureWithForceProp;
187
+ /** Configuration for editable-html */
188
+ mathMlOptions?: ConfigureMathMLProp;
189
+ /**
190
+ * Base editable html input configuration regarding plugins that are enabled/disabled
191
+ * E.g. audio, video, image
192
+ */
193
+ baseInputConfiguration?: EditableHtmlConfigureProp;
194
+ /** Dimensions of the authoring container */
195
+ contentDimensions?: ContentDimensions;
196
+ /** Not read by this element: the model's `promptEnabled` shows the prompt */
197
+ showPrompt?: boolean;
198
+ /** Not read by this element: `prompt.label` labels the prompt */
199
+ promptLabel?: string;
200
+ /** Not read by this element: it has no partial scoring */
201
+ settingsPartialScoring?: boolean;
202
+ }
203
+ /** An annotation an instructor placed on the student's response */
204
+ export interface ExtendedTextEntryAnnotation {
205
+ /** Identifier of the annotation */
206
+ id: string;
207
+ /** The annotation text shown beside the response */
208
+ label: string;
209
+ /** Indicates the type of the annotation */
210
+ type: 'positive' | 'negative';
211
+ /** The annotated text */
212
+ quote: string;
213
+ /** Start of the annotated text, as a character offset in the response's text content */
214
+ start: number;
215
+ /** End of the annotated text, as a character offset in the response's text content */
216
+ end: number;
217
+ }
218
+ export interface ExtendedTextEntrySession {
219
+ /** Identifier of the session */
220
+ id?: string;
221
+ /** The element the session belongs to */
222
+ element?: string;
223
+ /** The student's response, as HTML */
224
+ value?: string;
225
+ /** The instructor's annotations on the response */
226
+ annotations?: ExtendedTextEntryAnnotation[];
227
+ /** The instructor's overall comment on the response */
228
+ comment?: string;
229
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/extended-text-entry",
3
- "version": "16.0.4-next.20261011174919",
3
+ "version": "16.0.4",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,22 +11,23 @@
11
11
  "@emotion/react": "^11.14.0",
12
12
  "@mui/icons-material": "^7.3.4",
13
13
  "@mui/material": "^7.3.4",
14
- "@pie-element/shared-utils": "0.1.4-next.20261008072957",
15
- "@pie-lib/config-ui": "14.0.4-next.20261011174919",
16
- "@pie-lib/editable-html-tip-tap": "3.0.4-next.20261009061152",
17
- "@pie-lib/render-ui": "8.0.4-next.20261009061152",
18
- "@pie-lib/translator": "5.0.2-next.20261006160832",
14
+ "@pie-element/shared-utils": "0.1.4",
15
+ "@pie-lib/config-ui": "14.0.4",
16
+ "@pie-lib/editable-html-tip-tap": "3.0.4",
17
+ "@pie-lib/render-ui": "8.0.4",
18
+ "@pie-lib/translator": "5.0.1",
19
19
  "debug": "^4.1.1",
20
20
  "lodash.throttle": "^4.1.1",
21
21
  "prop-types": "^15.8.1",
22
- "@pie-element/shared-configure-events": "0.1.2-next.20261002215153",
23
- "@pie-element/shared-feedback": "0.1.3-next.20261006160832",
24
- "@pie-element/shared-math-rendering-mathjax": "0.1.5-next.20261009061152",
25
- "@pie-element/shared-player-events": "0.1.2-next.20261002215153",
26
- "@pie-element/shared-lodash": "0.1.3-next.20261006160832",
22
+ "@pie-element/shared-configure-events": "0.1.1",
23
+ "@pie-element/shared-feedback": "0.1.2",
24
+ "@pie-element/shared-math-rendering-mathjax": "0.1.5",
25
+ "@pie-element/shared-player-events": "0.1.1",
26
+ "@pie-element/shared-lodash": "0.1.2",
27
27
  "clsx": "^2.1.1",
28
28
  "react": "^18.2.0",
29
- "react-dom": "^18.2.0"
29
+ "react-dom": "^18.2.0",
30
+ "@pie-element/shared-types": "0.2.1"
30
31
  },
31
32
  "exports": {
32
33
  ".": {
@@ -81,6 +82,9 @@
81
82
  "types": "./dist/runtime-support.d.ts",
82
83
  "default": "./dist/runtime-support.js"
83
84
  },
85
+ "./schemas/model.schema.json": "./dist/schemas/model.schema.json",
86
+ "./schemas/configuration.schema.json": "./dist/schemas/configuration.schema.json",
87
+ "./schemas/session.schema.json": "./dist/schemas/session.schema.json",
84
88
  "./package.json": "./package.json"
85
89
  },
86
90
  "type": "module",
@@ -96,7 +100,7 @@
96
100
  ],
97
101
  "sideEffects": false,
98
102
  "scripts": {
99
- "build": "bun x vite build && bun x vite build --config ../../../tools/vite/element-browser.config.ts && bun x vite build --config ../../../tools/vite/element-browser-editor-runtime.config.ts && bun x vite build --config ../../../tools/vite/element-legacy-print.config.ts && bun x vite build --config vite.config.iife.ts && bun x tsc --emitDeclarationOnly",
103
+ "build": "bun x vite build && bun x vite build --config ../../../tools/vite/element-browser.config.ts && bun x vite build --config ../../../tools/vite/element-browser-editor-runtime.config.ts && bun x vite build --config ../../../tools/vite/element-legacy-print.config.ts && bun x vite build --config vite.config.iife.ts && bun x tsc --emitDeclarationOnly && bun ../../../tools/schemas/build.ts",
100
104
  "dev": "bun x vite",
101
105
  "demo": "bun x vite --mode demo",
102
106
  "test": "bun x vitest run"
@@ -110,7 +114,7 @@
110
114
  },
111
115
  "browserEditorRuntime": {
112
116
  "name": "@pie-element/shared-editor-runtime",
113
- "version": "0.1.3-next.20261006160832",
117
+ "version": "0.1.2",
114
118
  "views": {
115
119
  "delivery": "editor-runtime/delivery",
116
120
  "author": "editor-runtime/author",