@pie-element/charting 13.0.4-next.20261011174919 → 13.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,333 @@
1
+ import type { ConfigureLanguageOptions, ConfigureMathMLProp, ConfigureMaxImageDimensionsProp, ConfigureProp, ConfigurePropWithEnabled, ContentDimensions, EditableHtmlConfigureProp, EditableHtmlPluginConfigureRequired, ExtraCSSRules, PieModel } from '@pie-element/shared-types';
2
+ /** The chart types the element renders */
3
+ export type ChartingChartType = 'bar' | 'histogram' | 'lineDot' | 'lineCross' | 'dotPlot' | 'linePlot';
4
+ /** Whether a category's value or label matches the correct answer; the controller sets it when scoring */
5
+ export interface ChartingCategoryCorrectness {
6
+ value: 'correct' | 'incorrect';
7
+ label: 'correct' | 'incorrect';
8
+ }
9
+ /** A category on the chart: a bar, a point on a line or a column of a plot */
10
+ export interface ChartingCategory {
11
+ /** Indicates category label */
12
+ label: string;
13
+ /** Indicates category value */
14
+ value: number;
15
+ /** Indicates if category value is interactive */
16
+ interactive?: boolean;
17
+ /** Indicates if category label is editable */
18
+ editable?: boolean;
19
+ /** Indicates if category is deletable */
20
+ deletable?: boolean;
21
+ /** Position of the category in the author's chart; scoring reports it with each correct category */
22
+ index?: number;
23
+ /** Indicates correctness for a category */
24
+ correctness?: ChartingCategoryCorrectness;
25
+ }
26
+ /** Marks that are set as answers */
27
+ export interface ChartingCorrectAnswer {
28
+ /** Indicates name of answer; the author keys the correct-response chart by it */
29
+ name?: string;
30
+ /** Indicates marks for the answer */
31
+ data?: ChartingCategory[];
32
+ }
33
+ /** Settings for the category axis */
34
+ export interface ChartingDomain {
35
+ /** Axis label */
36
+ label?: string;
37
+ /** Not read by this element: the chart fixes the category axis to 0–1 */
38
+ min?: number;
39
+ /** Not read by this element: the chart fixes the category axis to 0–1 */
40
+ max?: number;
41
+ /** Not read by this element: the chart fixes the category axis step to 1 */
42
+ step?: number;
43
+ /** Not read by this element: the chart fixes the category axis label step to 1 */
44
+ labelStep?: number;
45
+ /** Not read by this element: `label` labels the axis */
46
+ axisLabel?: string;
47
+ }
48
+ /** Settings for the value axis */
49
+ export interface ChartingRange {
50
+ /** Axis label */
51
+ label?: string;
52
+ /**
53
+ * Min value
54
+ * @default 0
55
+ */
56
+ min?: number;
57
+ /**
58
+ * Max value
59
+ * @default 1
60
+ */
61
+ max?: number;
62
+ /** Step value; `labelStep` applies when absent */
63
+ step?: number;
64
+ /**
65
+ * Label step value
66
+ * @default 1
67
+ */
68
+ labelStep?: number;
69
+ /** Not read by this element: `label` labels the axis */
70
+ axisLabel?: string;
71
+ }
72
+ /** Size of the chart */
73
+ export interface ChartingGraph {
74
+ /** Width for chart representation */
75
+ width: number;
76
+ /** Height for chart representation */
77
+ height: number;
78
+ }
79
+ /** Placeholder messages for the chart */
80
+ export interface ChartingPlaceholderMessages {
81
+ /** Indicates placeholder message if title is not defined */
82
+ title?: string;
83
+ /** Indicates placeholder message if labels for range or domain are not defined */
84
+ labels?: string;
85
+ }
86
+ /** Model Object for `@pie-element/charting` */
87
+ export interface ChartingModel extends PieModel {
88
+ /**
89
+ * Indicates if user can add more categories
90
+ * @default true
91
+ */
92
+ addCategoryEnabled?: boolean;
93
+ /**
94
+ * Indicates the chart type
95
+ * @default "lineCross"
96
+ */
97
+ chartType?: ChartingChartType;
98
+ /** Indicates marks that are set as answers */
99
+ correctAnswer?: ChartingCorrectAnswer;
100
+ /** Indicates default categories for the answer */
101
+ data?: ChartingCategory[];
102
+ /** Indicates domain settings for the chart */
103
+ domain?: ChartingDomain;
104
+ /** Indicates the chart line model; 480 by 480 when absent */
105
+ graph?: ChartingGraph;
106
+ /** Indicates prompt value */
107
+ prompt?: string;
108
+ /**
109
+ * Indicates if the prompt is enabled
110
+ * @default true
111
+ */
112
+ promptEnabled?: boolean;
113
+ /** Indicates range settings for the chart */
114
+ range?: ChartingRange;
115
+ /** Indicates rationale for the answer */
116
+ rationale?: string;
117
+ /**
118
+ * Indicates if Rationale are enabled
119
+ * @default true
120
+ */
121
+ rationaleEnabled?: boolean;
122
+ /**
123
+ * Indicates scoring type. `model()` applies the default when absent; `outcome()` scores an absent
124
+ * value as partial scoring unless the environment turns partial scoring off.
125
+ * @default "all or nothing"
126
+ */
127
+ scoringType?: 'all or nothing' | 'partial scoring';
128
+ /** Not read by this element: it has no student instructions */
129
+ studentInstructions?: string;
130
+ /**
131
+ * Indicates if Student Instructions are enabled. Not read by this element: it has no student instructions.
132
+ * @default true
133
+ */
134
+ studentInstructionsEnabled?: boolean;
135
+ /** Indicates teacher instructions */
136
+ teacherInstructions?: string;
137
+ /**
138
+ * Indicates if Teacher Instructions are enabled
139
+ * @default true
140
+ */
141
+ teacherInstructionsEnabled?: boolean;
142
+ /** Indicates chart title */
143
+ title?: string;
144
+ /** Not read by this element: the configuration's `titlePlaceholder` and `labelsPlaceholders` set the placeholders */
145
+ placeholderMessages?: ChartingPlaceholderMessages;
146
+ /** Indicates if spellcheck is enabled for the author. Default value is true */
147
+ spellCheckEnabled?: boolean;
148
+ /** Indicates if Rubric is enabled. Not read by this element: the settings panel sets it when `withRubric.settings` is on. */
149
+ rubricEnabled?: boolean;
150
+ /**
151
+ * Indicates if teacher can enable/disable data[]:interactive
152
+ * @default false
153
+ */
154
+ changeInteractiveEnabled?: boolean;
155
+ /**
156
+ * Indicates if teacher can enable/disable data[]:editable
157
+ * @default false
158
+ */
159
+ changeEditableEnabled?: boolean;
160
+ /**
161
+ * Indicates if teacher can enable/disable addCategoryEnabled
162
+ * @default false
163
+ */
164
+ changeAddCategoryEnabled?: boolean;
165
+ /**
166
+ * Label for new category in correct response and player's chart
167
+ * @default "New Category"
168
+ */
169
+ studentNewCategoryDefaultLabel?: string;
170
+ /**
171
+ * Indicates the language of the component
172
+ * Supported options: en, es, en_US, en-US, es_ES, es-ES, es_MX, es-MX
173
+ */
174
+ language?: string;
175
+ /** Host-supplied CSS scoped to the element */
176
+ extraCSSRules?: ExtraCSSRules;
177
+ }
178
+ export interface ChartingSession {
179
+ /** Identifier of the session */
180
+ id?: string;
181
+ /** The element the session belongs to */
182
+ element?: string;
183
+ /** The student's categories; the initial chart is scored when absent */
184
+ answer?: ChartingCategory[];
185
+ }
186
+ /** Range of a chart dimension the author can set */
187
+ export interface ChartingDimensionConstraints {
188
+ /** Smallest value the author can set */
189
+ min?: number;
190
+ /** Largest value the author can set */
191
+ max?: number;
192
+ /** Step of the control; values under 1 count as 20 */
193
+ step?: number;
194
+ }
195
+ /** Chart dimensions the author can set */
196
+ export interface ChartingDimensions {
197
+ /** Not read by this element */
198
+ settings?: boolean;
199
+ /** Not read by this element */
200
+ label?: string;
201
+ /** Shows the chart width and height controls */
202
+ showInConfigPanel?: boolean;
203
+ /** Width the author can set: `min` at least 50, `max` at most 700, `step` at most 200; 50, 700 and 20 when absent */
204
+ width?: ChartingDimensionConstraints;
205
+ /** Height the author can set: `min` at least 400, `max` at most 700, `step` at most 200; 400, 700 and 20 when absent */
206
+ height?: ChartingDimensionConstraints;
207
+ }
208
+ export interface ChartingAuthorNewCategoryDefaults {
209
+ /** Not read by this element */
210
+ settings?: boolean;
211
+ /** Indicates the label for the new category */
212
+ label?: string;
213
+ /** Indicates if new category is interactive */
214
+ interactive?: boolean;
215
+ /** Indicates if new category is editable */
216
+ editable?: boolean;
217
+ }
218
+ /** Indicates the chart types that are available and the label used for each; a type without a label is not offered */
219
+ export interface ChartingAvailableChartTypes {
220
+ /** Indicates if bar chart is available and the label used for it. */
221
+ bar?: string;
222
+ /** Indicates if histogram is available and the label used for it. */
223
+ histogram?: string;
224
+ /** Indicates if line chart with dots is available and the label used for it. */
225
+ lineDot?: string;
226
+ /** Indicates if line chart with crosses is available and the label used for it. */
227
+ lineCross?: string;
228
+ /** Indicates if dot plot is available and the label used for it. */
229
+ dotPlot?: string;
230
+ /** Indicates if line plot is available and the label used for it. */
231
+ linePlot?: string;
232
+ }
233
+ export interface ChartingLabelsPlaceholders {
234
+ /** Not read by this element */
235
+ settings?: boolean;
236
+ /** Not read by this element */
237
+ label?: string;
238
+ /** Not read by this element */
239
+ enabled?: boolean;
240
+ /** This value is empty for charting. The property exist in order to be consistent with graphing configuration. */
241
+ top?: string;
242
+ /** This value is empty for charting. The property exist in order to be consistent with graphing configuration. */
243
+ right?: string;
244
+ /** Indicates the placeholder for the bottom label */
245
+ bottom?: string;
246
+ /** Indicates the placeholder for the left label */
247
+ left?: string;
248
+ }
249
+ export interface ChartingOption {
250
+ /** Indicates if the item has to be displayed in the Settings Panel */
251
+ settings?: boolean;
252
+ /** Indicates the label for the option */
253
+ authoringLabel?: string;
254
+ /** Indicates the label for the item that has to be displayed in the Settings Panel */
255
+ settingsLabel?: string;
256
+ }
257
+ export interface ChartingOptions {
258
+ /** Indicates if teacher can enable/disable data[]:interactive */
259
+ changeInteractive?: ChartingOption;
260
+ /** Indicates if teacher can enable/disable data[]:editable */
261
+ changeEditable?: ChartingOption;
262
+ /** Indicates if teacher can enable/disable addCategoryEnabled */
263
+ addCategory?: ChartingOption;
264
+ /** Not read by this element: the configuration's top-level `mathMlOptions` applies */
265
+ mathMlOptions?: ConfigureMathMLProp;
266
+ }
267
+ /** Config Object for `@pie-element/charting` */
268
+ export interface ChartingConfiguration {
269
+ /**
270
+ * Base editable html input configuration regarding plugins that are enabled/disabled
271
+ * E.g. audio, video, image
272
+ */
273
+ baseInputConfiguration?: EditableHtmlConfigureProp;
274
+ /** Prompt configuration */
275
+ prompt?: EditableHtmlPluginConfigureRequired;
276
+ /** Rationale configuration */
277
+ rationale?: EditableHtmlPluginConfigureRequired;
278
+ /** Configuration for the author's spellcheck */
279
+ spellCheck?: ConfigurePropWithEnabled;
280
+ /** Configuration for the title's placeholder */
281
+ titlePlaceholder?: ConfigureProp;
282
+ /** Labels Placeholder configuration */
283
+ labelsPlaceholders?: ChartingLabelsPlaceholders;
284
+ /** Scoring Type configuration */
285
+ scoringType?: ConfigureProp;
286
+ /** Indicates if the settings panel is not available */
287
+ settingsPanelDisabled?: boolean;
288
+ /** Student Instructions configuration */
289
+ studentInstructions?: ConfigureProp;
290
+ /** Teacher Instructions configuration */
291
+ teacherInstructions?: EditableHtmlPluginConfigureRequired;
292
+ /** Chart title configuration. Not read by this element: `titlePlaceholder` sets the title's placeholder. */
293
+ title?: ConfigurePropWithEnabled;
294
+ /** Author instruction to build a new chart; `label` is the text shown above the form */
295
+ instruction?: ConfigureProp;
296
+ /** Configuration for new category in define chart */
297
+ authorNewCategoryDefaults?: ChartingAuthorNewCategoryDefaults;
298
+ /** Chart dimensions the author can set */
299
+ chartDimensions?: ChartingDimensions;
300
+ /** Not read by this element: the model's `studentNewCategoryDefaultLabel` labels the categories students add */
301
+ studentNewCategoryDefaultLabel?: ConfigureProp;
302
+ /** Configuration for editable-html */
303
+ mathMlOptions?: ConfigureMathMLProp;
304
+ /** Maximum image width for input fields */
305
+ maxImageWidth?: ConfigureMaxImageDimensionsProp;
306
+ /** Maximum image height for input fields */
307
+ maxImageHeight?: ConfigureMaxImageDimensionsProp;
308
+ /** Rubric configuration - only relevant in environments that use pie-player-components */
309
+ withRubric?: ConfigureProp;
310
+ /** Authoring view settings for Charting */
311
+ chartingOptions?: ChartingOptions;
312
+ /** Indicates the chart types that are available */
313
+ availableChartTypes?: ChartingAvailableChartTypes;
314
+ /** Indicates the label for the chart type */
315
+ chartTypeLabel?: string;
316
+ /** Language configuration */
317
+ language?: ConfigurePropWithEnabled;
318
+ /** Indicates the maximum character limit for X and Y axis labels */
319
+ labelsCharactersLimit?: number;
320
+ /**
321
+ * Language choices configuration
322
+ * Only available if language is enabled
323
+ */
324
+ languageChoices?: ConfigureLanguageOptions;
325
+ /** Dimensions of the authoring container */
326
+ contentDimensions?: ContentDimensions;
327
+ /** Not read by this element: the model's `promptEnabled` shows the prompt */
328
+ showPrompt?: boolean;
329
+ /** Not read by this element: `prompt.label` labels the prompt */
330
+ promptLabel?: string;
331
+ /** Not read by this element: `scoringType.settings` shows the scoring control */
332
+ settingsPartialScoring?: boolean;
333
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/charting",
3
- "version": "13.0.4-next.20261011174919",
3
+ "version": "13.0.4",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,21 +11,22 @@
11
11
  "@emotion/react": "^11.14.0",
12
12
  "@mui/icons-material": "^7.3.4",
13
13
  "@mui/material": "^7.3.4",
14
- "@pie-lib/charting": "8.0.4-next.20261011174919",
15
- "@pie-lib/correct-answer-toggle": "5.0.4-next.20261011174919",
16
- "@pie-lib/render-ui": "8.0.4-next.20261009061152",
17
- "@pie-lib/translator": "5.0.2-next.20261006160832",
14
+ "@pie-lib/charting": "8.0.4",
15
+ "@pie-lib/correct-answer-toggle": "5.0.4",
16
+ "@pie-lib/render-ui": "8.0.4",
17
+ "@pie-lib/translator": "5.0.1",
18
18
  "debug": "^4.1.1",
19
19
  "prop-types": "^15.8.1",
20
- "@pie-lib/config-ui": "14.0.4-next.20261011174919",
21
- "@pie-lib/editable-html-tip-tap": "3.0.4-next.20261009061152",
22
- "@pie-element/shared-lodash": "0.1.3-next.20261006160832",
23
- "@pie-element/shared-configure-events": "0.1.2-next.20261002215153",
24
- "@pie-element/shared-math-rendering-mathjax": "0.1.5-next.20261009061152",
25
- "@pie-element/shared-controller-utils": "0.1.2-next.20261002215153",
26
- "@pie-element/shared-player-events": "0.1.2-next.20261002215153",
20
+ "@pie-lib/config-ui": "14.0.4",
21
+ "@pie-lib/editable-html-tip-tap": "3.0.4",
22
+ "@pie-element/shared-lodash": "0.1.2",
23
+ "@pie-element/shared-configure-events": "0.1.1",
24
+ "@pie-element/shared-math-rendering-mathjax": "0.1.5",
25
+ "@pie-element/shared-controller-utils": "0.1.2",
26
+ "@pie-element/shared-player-events": "0.1.1",
27
27
  "react": "^18.2.0",
28
- "react-dom": "^18.2.0"
28
+ "react-dom": "^18.2.0",
29
+ "@pie-element/shared-types": "0.2.1"
29
30
  },
30
31
  "exports": {
31
32
  ".": {
@@ -68,6 +69,9 @@
68
69
  "types": "./dist/runtime-support.d.ts",
69
70
  "default": "./dist/runtime-support.js"
70
71
  },
72
+ "./schemas/model.schema.json": "./dist/schemas/model.schema.json",
73
+ "./schemas/configuration.schema.json": "./dist/schemas/configuration.schema.json",
74
+ "./schemas/session.schema.json": "./dist/schemas/session.schema.json",
71
75
  "./package.json": "./package.json"
72
76
  },
73
77
  "type": "module",
@@ -81,7 +85,7 @@
81
85
  ],
82
86
  "sideEffects": false,
83
87
  "scripts": {
84
- "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 vite.config.iife.ts && bun x tsc --emitDeclarationOnly",
88
+ "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 vite.config.iife.ts && bun x tsc --emitDeclarationOnly && bun ../../../tools/schemas/build.ts",
85
89
  "dev": "bun x vite",
86
90
  "demo": "bun x vite --mode demo",
87
91
  "test": "bun x vitest run"
@@ -95,7 +99,7 @@
95
99
  },
96
100
  "browserEditorRuntime": {
97
101
  "name": "@pie-element/shared-editor-runtime",
98
- "version": "0.1.3-next.20261006160832",
102
+ "version": "0.1.2",
99
103
  "views": {
100
104
  "delivery": "editor-runtime/delivery",
101
105
  "author": "editor-runtime/author",