@pie-element/match 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,183 @@
1
+ import type { ConfigureLanguageOptions, ConfigureMathMLProp, ConfigureMaxImageDimensionsProp, ConfigureProp, ConfigurePropWithEnabled, ContentDimensions, EditableHtmlConfigureProp, EditableHtmlPluginConfigure, EditableHtmlPluginConfigureRequired, ExtraCSSRules, PieModel } from '@pie-element/shared-types';
2
+ /**
3
+ * One row in the match list.
4
+ */
5
+ export interface MatchRow {
6
+ /** Identifier for a row */
7
+ id: string | number;
8
+ /** Title that will be displayed for the row */
9
+ title: string;
10
+ /** Array of boolean values indicating which columns are selected in the row */
11
+ values: boolean[];
12
+ }
13
+ /** Feedback configuration for one correctness level */
14
+ export interface MatchFeedbackLevel {
15
+ /** Indicates the feedback type */
16
+ type: 'default' | 'custom' | 'none';
17
+ /** Indicates the feedback value */
18
+ default?: string;
19
+ /** Indicates the feedback custom value */
20
+ custom?: string;
21
+ }
22
+ export interface MatchFeedback {
23
+ /** Indicates the configuration for feedback when answer is correct */
24
+ correct?: MatchFeedbackLevel;
25
+ /** Indicates the configuration for feedback when answer is incorrect */
26
+ incorrect?: MatchFeedbackLevel;
27
+ /** Indicates the configuration for feedback when answer is partially correct */
28
+ partial?: MatchFeedbackLevel;
29
+ }
30
+ /** Model for the `@pie-element/match` Interaction */
31
+ export interface MatchModel extends PieModel {
32
+ /** Feedback for student responses */
33
+ feedback?: MatchFeedback;
34
+ /** Array of strings for column headers; the first heads the question column */
35
+ headers: string[];
36
+ /** The number of columns to be presented, the question column included */
37
+ layout?: number;
38
+ /** Indicates if the order of the rows should be randomly sorted on render */
39
+ lockChoiceOrder?: boolean;
40
+ /** Indicates if partial scoring should be used */
41
+ partialScoring?: boolean;
42
+ /** Indicates if the control for responses should be single (radio) or multiple (checkbox) */
43
+ choiceMode?: 'radio' | 'checkbox';
44
+ /** The question prompt or item stem */
45
+ prompt?: string;
46
+ /** Determines if prompt should show */
47
+ promptEnabled?: boolean;
48
+ /** The rows of choices to be presented. */
49
+ rows: MatchRow[];
50
+ /** Indicates value for rationale */
51
+ rationale?: string;
52
+ /** Indicates scoring type */
53
+ scoringType?: 'auto' | 'rubric';
54
+ /** Not read by this element */
55
+ studentInstructions?: string;
56
+ /** Indicates teacher instructions */
57
+ teacherInstructions?: string;
58
+ /** Indicates if Feedback is enabled */
59
+ feedbackEnabled?: boolean;
60
+ /** Indicates if Rationale are enabled */
61
+ rationaleEnabled?: boolean;
62
+ /** Indicates if spellcheck is enabled for the author. Default value is true */
63
+ spellCheckEnabled?: boolean;
64
+ /** Indicates if Student Instructions are enabled */
65
+ studentInstructionsEnabled?: boolean;
66
+ /** Indicates if Teacher Instructions are enabled */
67
+ teacherInstructionsEnabled?: boolean;
68
+ /**
69
+ * Indicates the editor's toolbar position which can be 'bottom' or 'top'
70
+ * @default "bottom"
71
+ */
72
+ toolbarEditorPosition?: 'bottom' | 'top';
73
+ /** Indicates if Rubric is enabled */
74
+ rubricEnabled?: boolean;
75
+ /**
76
+ * Indicates the language of the component
77
+ * Supported options: en, es, en_US, en-US, es_ES, es-ES, es_MX, es-MX
78
+ */
79
+ language?: string;
80
+ /** Host-supplied CSS scoped to the element */
81
+ extraCSSRules?: ExtraCSSRules;
82
+ /**
83
+ * Enables images in row titles when the host's configuration sets no `rows.inputConfiguration`.
84
+ * @deprecated Use the configuration's `rows.inputConfiguration`.
85
+ */
86
+ enableImages?: boolean;
87
+ /**
88
+ * The delivery merges these keys over the model.
89
+ * @deprecated Set the keys on the model itself.
90
+ */
91
+ config?: Record<string, unknown>;
92
+ }
93
+ export interface MatchMaxImageDimensions extends ConfigureMaxImageDimensionsProp {
94
+ /** Indicates the max dimension for images in row labels */
95
+ rowTitles?: number;
96
+ }
97
+ /** Config Object for `@pie-element/match` */
98
+ export interface MatchConfiguration {
99
+ /**
100
+ * Base editable html input configuration regarding plugins that are enabled/disabled
101
+ * E.g. audio, video, image
102
+ */
103
+ baseInputConfiguration?: EditableHtmlConfigureProp;
104
+ /**
105
+ * Configuration for html input configuration regarding plugins that are enabled/disabled
106
+ * on each question row
107
+ * E.g. audio, video, image
108
+ */
109
+ rows?: EditableHtmlPluginConfigure;
110
+ /** Configuration for feedback; `enabled` is not read */
111
+ feedback?: ConfigurePropWithEnabled;
112
+ /** Configuration for headers */
113
+ headers?: EditableHtmlPluginConfigure;
114
+ /** Configuration for layout */
115
+ layout?: ConfigureProp;
116
+ /** Configuration for lock choice order */
117
+ lockChoiceOrder?: ConfigureProp;
118
+ /** Configuration for partial scoring */
119
+ partialScoring?: ConfigureProp;
120
+ /** Configuration for choice mode */
121
+ choiceMode?: ConfigureProp;
122
+ /** Configuration for the prompt */
123
+ prompt?: EditableHtmlPluginConfigureRequired;
124
+ /** Indicates if the settings panel is not available */
125
+ settingsPanelDisabled?: boolean;
126
+ /** Configuration for the author's spellcheck; `enabled` is not read, the model's `spellCheckEnabled` turns it on */
127
+ spellCheck?: ConfigurePropWithEnabled;
128
+ /** Rationale configuration */
129
+ rationale?: EditableHtmlPluginConfigureRequired;
130
+ /** Scoring Type configuration */
131
+ scoringType?: ConfigureProp;
132
+ /** Student Instructions configuration */
133
+ studentInstructions?: ConfigureProp;
134
+ /** Teacher Instructions configuration */
135
+ teacherInstructions?: EditableHtmlPluginConfigureRequired;
136
+ /** Maximum image width for input fields */
137
+ maxImageWidth?: MatchMaxImageDimensions;
138
+ /** Maximum image height for input fields */
139
+ maxImageHeight?: MatchMaxImageDimensions;
140
+ /** Rubric configuration - only relevant in environments that use pie-player-components */
141
+ withRubric?: ConfigureProp;
142
+ /** Indicates the minimum number of question rows */
143
+ minQuestions?: number;
144
+ /** Indicates the maximum number of question rows */
145
+ maxQuestions?: number;
146
+ /** Indicates the maximum length of question rows headings */
147
+ maxLengthQuestionsHeading?: number;
148
+ /** Indicates the maximum number of answer columns */
149
+ maxAnswers?: number;
150
+ /** Indicates the maximum length of answer columns headings */
151
+ maxLengthAnswers?: number;
152
+ /** Indicates the maximum length of first column headings */
153
+ maxLengthFirstColumnHeading?: number;
154
+ /** Width of the authoring rows table, as a CSS length; the table scrolls when set */
155
+ width?: string;
156
+ /** Configuration for editable-html */
157
+ mathMlOptions?: ConfigureMathMLProp;
158
+ /** Language configuration */
159
+ language?: ConfigurePropWithEnabled;
160
+ /**
161
+ * Language choices configuration
162
+ * Only available if language is enabled
163
+ */
164
+ languageChoices?: ConfigureLanguageOptions;
165
+ /** Dimensions of the authoring container */
166
+ contentDimensions?: ContentDimensions;
167
+ /** Not read by this element: the model's `promptEnabled` shows the prompt */
168
+ showPrompt?: boolean;
169
+ /** Not read by this element: `prompt.label` labels the prompt */
170
+ promptLabel?: string;
171
+ /** Not read by this element: `partialScoring.settings` shows the partial scoring control */
172
+ settingsPartialScoring?: boolean;
173
+ }
174
+ export interface MatchSession {
175
+ /** Identifier of the session */
176
+ id?: string;
177
+ /** The element the session belongs to */
178
+ element?: string;
179
+ /** For each row id, which answer columns the learner selected */
180
+ answers?: Record<string, boolean[]>;
181
+ /** Row ids in the order they were shuffled for this learner, when row order is not locked */
182
+ shuffledValues?: (string | number)[];
183
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/match",
3
- "version": "13.0.4-next.20261011174919",
3
+ "version": "13.0.4",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,25 +11,26 @@
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/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-element/shared-utils": "0.1.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
20
  "clsx": "^2.1.1",
21
- "@pie-element/shared-lodash": "0.1.3-next.20261006160832",
22
- "@pie-lib/editable-html-tip-tap": "3.0.4-next.20261009061152",
23
- "@pie-lib/drag": "5.0.4-next.20261009061152",
24
- "@pie-lib/config-ui": "14.0.4-next.20261011174919",
25
- "@pie-element/shared-configure-events": "0.1.2-next.20261002215153",
21
+ "@pie-element/shared-lodash": "0.1.2",
22
+ "@pie-lib/editable-html-tip-tap": "3.0.4",
23
+ "@pie-lib/drag": "5.0.4",
24
+ "@pie-lib/config-ui": "14.0.4",
25
+ "@pie-element/shared-configure-events": "0.1.1",
26
26
  "@dnd-kit/core": "^6.3.1",
27
- "@pie-element/shared-feedback": "0.1.3-next.20261006160832",
28
- "@pie-element/shared-controller-utils": "0.1.2-next.20261002215153",
29
- "@pie-element/shared-player-events": "0.1.2-next.20261002215153",
30
- "@pie-element/shared-math-rendering-mathjax": "0.1.5-next.20261009061152",
27
+ "@pie-element/shared-feedback": "0.1.2",
28
+ "@pie-element/shared-controller-utils": "0.1.2",
29
+ "@pie-element/shared-player-events": "0.1.1",
30
+ "@pie-element/shared-math-rendering-mathjax": "0.1.5",
31
31
  "react": "^18.2.0",
32
- "react-dom": "^18.2.0"
32
+ "react-dom": "^18.2.0",
33
+ "@pie-element/shared-types": "0.2.1"
33
34
  },
34
35
  "exports": {
35
36
  ".": {
@@ -72,6 +73,9 @@
72
73
  "types": "./dist/runtime-support.d.ts",
73
74
  "default": "./dist/runtime-support.js"
74
75
  },
76
+ "./schemas/model.schema.json": "./dist/schemas/model.schema.json",
77
+ "./schemas/configuration.schema.json": "./dist/schemas/configuration.schema.json",
78
+ "./schemas/session.schema.json": "./dist/schemas/session.schema.json",
75
79
  "./package.json": "./package.json"
76
80
  },
77
81
  "type": "module",
@@ -85,7 +89,7 @@
85
89
  ],
86
90
  "sideEffects": false,
87
91
  "scripts": {
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",
92
+ "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",
89
93
  "dev": "bun x vite",
90
94
  "demo": "bun x vite --mode demo",
91
95
  "test": "bun x vitest run"
@@ -99,7 +103,7 @@
99
103
  },
100
104
  "browserEditorRuntime": {
101
105
  "name": "@pie-element/shared-editor-runtime",
102
- "version": "0.1.3-next.20261006160832",
106
+ "version": "0.1.2",
103
107
  "views": {
104
108
  "delivery": "editor-runtime/delivery",
105
109
  "author": "editor-runtime/author",