@pie-element/explicit-constructed-response 12.0.4-next.20261011174919 → 12.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 +56 -54
- package/dist/author/index.d.ts +18 -28
- package/dist/author/index.js +6 -1
- package/dist/author/main.d.ts +43 -25
- package/dist/author/main.js +98 -111
- package/dist/browser/author/index.js +19 -29
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +4 -4
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +19 -29
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js +4 -4
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +10 -9
- package/dist/controller/index.d.ts +83 -24
- package/dist/controller/index.js +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +426 -0
- package/dist/schemas/model.schema.json +605 -0
- package/dist/schemas/session.schema.json +23 -0
- package/dist/types.d.ts +186 -0
- package/package.json +20 -16
|
@@ -1,137 +1,139 @@
|
|
|
1
|
+
import type { ConfigureLanguageOptionsProp } from '@pie-element/shared-types';
|
|
2
|
+
import type { Choices } from '../types.js';
|
|
1
3
|
declare const _default: {
|
|
2
4
|
model: {
|
|
3
|
-
choices:
|
|
5
|
+
choices: Choices;
|
|
4
6
|
displayType: string;
|
|
5
7
|
markup: string;
|
|
6
|
-
maxLengthPerChoiceEnabled:
|
|
7
|
-
playerSpellCheckEnabled:
|
|
8
|
+
maxLengthPerChoiceEnabled: true;
|
|
9
|
+
playerSpellCheckEnabled: false;
|
|
8
10
|
prompt: string;
|
|
9
|
-
promptEnabled:
|
|
11
|
+
promptEnabled: true;
|
|
10
12
|
rationale: string;
|
|
11
|
-
rationaleEnabled:
|
|
12
|
-
spellCheckEnabled:
|
|
13
|
-
studentInstructionsEnabled:
|
|
13
|
+
rationaleEnabled: true;
|
|
14
|
+
spellCheckEnabled: true;
|
|
15
|
+
studentInstructionsEnabled: true;
|
|
14
16
|
teacherInstructions: string;
|
|
15
|
-
teacherInstructionsEnabled:
|
|
16
|
-
toolbarEditorPosition:
|
|
17
|
+
teacherInstructionsEnabled: true;
|
|
18
|
+
toolbarEditorPosition: "bottom";
|
|
17
19
|
responseAreaInputConfiguration: {};
|
|
18
20
|
};
|
|
19
21
|
configuration: {
|
|
20
22
|
baseInputConfiguration: {
|
|
21
23
|
h3: {
|
|
22
|
-
disabled:
|
|
24
|
+
disabled: true;
|
|
23
25
|
};
|
|
24
26
|
html: {
|
|
25
|
-
disabled:
|
|
27
|
+
disabled: true;
|
|
26
28
|
};
|
|
27
29
|
audio: {
|
|
28
|
-
disabled:
|
|
30
|
+
disabled: false;
|
|
29
31
|
};
|
|
30
32
|
video: {
|
|
31
|
-
disabled:
|
|
33
|
+
disabled: false;
|
|
32
34
|
};
|
|
33
35
|
image: {
|
|
34
|
-
disabled:
|
|
36
|
+
disabled: false;
|
|
35
37
|
};
|
|
36
38
|
textAlign: {
|
|
37
|
-
disabled:
|
|
39
|
+
disabled: true;
|
|
38
40
|
};
|
|
39
41
|
showParagraphs: {
|
|
40
|
-
disabled:
|
|
42
|
+
disabled: false;
|
|
41
43
|
};
|
|
42
44
|
separateParagraphs: {
|
|
43
|
-
disabled:
|
|
45
|
+
disabled: true;
|
|
44
46
|
};
|
|
45
47
|
};
|
|
46
48
|
prompt: {
|
|
47
|
-
settings:
|
|
49
|
+
settings: true;
|
|
48
50
|
label: string;
|
|
49
51
|
inputConfiguration: {
|
|
50
52
|
audio: {
|
|
51
|
-
disabled:
|
|
53
|
+
disabled: false;
|
|
52
54
|
};
|
|
53
55
|
video: {
|
|
54
|
-
disabled:
|
|
56
|
+
disabled: false;
|
|
55
57
|
};
|
|
56
58
|
image: {
|
|
57
|
-
disabled:
|
|
59
|
+
disabled: false;
|
|
58
60
|
};
|
|
59
61
|
};
|
|
60
|
-
required:
|
|
62
|
+
required: false;
|
|
61
63
|
};
|
|
62
64
|
partialScoring: {
|
|
63
|
-
settings:
|
|
65
|
+
settings: false;
|
|
64
66
|
label: string;
|
|
65
67
|
};
|
|
66
68
|
rationale: {
|
|
67
|
-
settings:
|
|
69
|
+
settings: true;
|
|
68
70
|
label: string;
|
|
69
71
|
inputConfiguration: {
|
|
70
72
|
audio: {
|
|
71
|
-
disabled:
|
|
73
|
+
disabled: false;
|
|
72
74
|
};
|
|
73
75
|
video: {
|
|
74
|
-
disabled:
|
|
76
|
+
disabled: false;
|
|
75
77
|
};
|
|
76
78
|
image: {
|
|
77
|
-
disabled:
|
|
79
|
+
disabled: false;
|
|
78
80
|
};
|
|
79
81
|
};
|
|
80
|
-
required:
|
|
82
|
+
required: false;
|
|
81
83
|
};
|
|
82
|
-
settingsPanelDisabled:
|
|
84
|
+
settingsPanelDisabled: false;
|
|
83
85
|
spellCheck: {
|
|
84
86
|
label: string;
|
|
85
|
-
settings:
|
|
86
|
-
enabled:
|
|
87
|
+
settings: false;
|
|
88
|
+
enabled: true;
|
|
87
89
|
};
|
|
88
90
|
editSource: {
|
|
89
91
|
label: string;
|
|
90
|
-
settings:
|
|
91
|
-
enabled:
|
|
92
|
+
settings: false;
|
|
93
|
+
enabled: false;
|
|
92
94
|
};
|
|
93
95
|
playerSpellCheck: {
|
|
94
96
|
label: string;
|
|
95
|
-
settings:
|
|
96
|
-
enabled:
|
|
97
|
+
settings: true;
|
|
98
|
+
enabled: true;
|
|
97
99
|
};
|
|
98
100
|
teacherInstructions: {
|
|
99
|
-
settings:
|
|
101
|
+
settings: true;
|
|
100
102
|
label: string;
|
|
101
103
|
inputConfiguration: {
|
|
102
104
|
audio: {
|
|
103
|
-
disabled:
|
|
105
|
+
disabled: false;
|
|
104
106
|
};
|
|
105
107
|
video: {
|
|
106
|
-
disabled:
|
|
108
|
+
disabled: false;
|
|
107
109
|
};
|
|
108
110
|
image: {
|
|
109
|
-
disabled:
|
|
111
|
+
disabled: false;
|
|
110
112
|
};
|
|
111
113
|
};
|
|
112
|
-
required:
|
|
114
|
+
required: false;
|
|
113
115
|
};
|
|
114
116
|
template: {
|
|
115
117
|
inputConfiguration: {
|
|
116
118
|
audio: {
|
|
117
|
-
disabled:
|
|
119
|
+
disabled: false;
|
|
118
120
|
};
|
|
119
121
|
video: {
|
|
120
|
-
disabled:
|
|
122
|
+
disabled: false;
|
|
121
123
|
};
|
|
122
124
|
image: {
|
|
123
|
-
disabled:
|
|
125
|
+
disabled: false;
|
|
124
126
|
};
|
|
125
127
|
h3: {
|
|
126
|
-
disabled:
|
|
128
|
+
disabled: true;
|
|
127
129
|
};
|
|
128
130
|
blockquote: {
|
|
129
|
-
disabled:
|
|
131
|
+
disabled: true;
|
|
130
132
|
};
|
|
131
133
|
};
|
|
132
134
|
};
|
|
133
135
|
maxLengthPerChoice: {
|
|
134
|
-
settings:
|
|
136
|
+
settings: true;
|
|
135
137
|
label: string;
|
|
136
138
|
};
|
|
137
139
|
maxResponseAreas: number;
|
|
@@ -146,31 +148,31 @@ declare const _default: {
|
|
|
146
148
|
rationale: number;
|
|
147
149
|
};
|
|
148
150
|
withRubric: {
|
|
149
|
-
settings:
|
|
151
|
+
settings: false;
|
|
150
152
|
label: string;
|
|
151
153
|
};
|
|
152
154
|
mathMlOptions: {
|
|
153
|
-
mmlOutput:
|
|
154
|
-
mmlEditing:
|
|
155
|
+
mmlOutput: false;
|
|
156
|
+
mmlEditing: false;
|
|
155
157
|
};
|
|
156
158
|
language: {
|
|
157
|
-
settings:
|
|
159
|
+
settings: false;
|
|
158
160
|
label: string;
|
|
159
|
-
enabled:
|
|
161
|
+
enabled: false;
|
|
160
162
|
};
|
|
161
163
|
languageChoices: {
|
|
162
164
|
label: string;
|
|
163
|
-
options:
|
|
165
|
+
options: ConfigureLanguageOptionsProp[];
|
|
164
166
|
};
|
|
165
167
|
responseAreaInputConfiguration: {
|
|
166
168
|
inputConfiguration: {
|
|
167
169
|
characters: {
|
|
168
|
-
disabled:
|
|
170
|
+
disabled: true;
|
|
169
171
|
};
|
|
170
172
|
};
|
|
171
173
|
};
|
|
172
174
|
spanishButton: {
|
|
173
|
-
settings:
|
|
175
|
+
settings: true;
|
|
174
176
|
label: string;
|
|
175
177
|
};
|
|
176
178
|
};
|
package/dist/author/index.d.ts
CHANGED
|
@@ -1,34 +1,24 @@
|
|
|
1
|
+
import { type DeleteDone, type ImageHandler, type SoundHandler } from '@pie-element/shared-configure-events';
|
|
2
|
+
import { type AuthorModel } from './main.js';
|
|
3
|
+
import type { ExplicitConstructedResponseConfiguration, ExplicitConstructedResponseModel } from '../types.js';
|
|
1
4
|
export default class ExplicitConstructedResponse extends HTMLElement {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
maxLengthPerChoiceEnabled: boolean;
|
|
8
|
-
playerSpellCheckEnabled: boolean;
|
|
9
|
-
prompt: string;
|
|
10
|
-
promptEnabled: boolean;
|
|
11
|
-
rationale: string;
|
|
12
|
-
rationaleEnabled: boolean;
|
|
13
|
-
spellCheckEnabled: boolean;
|
|
14
|
-
studentInstructionsEnabled: boolean;
|
|
15
|
-
teacherInstructions: string;
|
|
16
|
-
teacherInstructionsEnabled: boolean;
|
|
17
|
-
toolbarEditorPosition: string;
|
|
18
|
-
responseAreaInputConfiguration: {};
|
|
19
|
-
};
|
|
5
|
+
private _root;
|
|
6
|
+
private _model;
|
|
7
|
+
private _configuration;
|
|
8
|
+
private _disableSidePanel?;
|
|
9
|
+
static prepareModel: (model?: Partial<ExplicitConstructedResponseModel>) => AuthorModel;
|
|
20
10
|
constructor();
|
|
21
|
-
set model(s:
|
|
22
|
-
set configuration(c:
|
|
23
|
-
set disableSidePanel(s:
|
|
24
|
-
dispatchModelUpdated(reset
|
|
25
|
-
onModelChanged:
|
|
26
|
-
onConfigurationChanged:
|
|
11
|
+
set model(s: Partial<ExplicitConstructedResponseModel>);
|
|
12
|
+
set configuration(c: ExplicitConstructedResponseConfiguration);
|
|
13
|
+
set disableSidePanel(s: boolean);
|
|
14
|
+
dispatchModelUpdated(reset?: boolean): void;
|
|
15
|
+
onModelChanged: (m: Partial<AuthorModel>, reset?: boolean) => void;
|
|
16
|
+
onConfigurationChanged: (c: ExplicitConstructedResponseConfiguration) => void;
|
|
27
17
|
/** @param {done, progress, file} handler */
|
|
28
|
-
insertImage(handler:
|
|
29
|
-
onDeleteImage(src:
|
|
30
|
-
insertSound(handler:
|
|
31
|
-
onDeleteSound(src:
|
|
18
|
+
insertImage(handler: ImageHandler): void;
|
|
19
|
+
onDeleteImage(src: string, done: DeleteDone): void;
|
|
20
|
+
insertSound(handler: SoundHandler): void;
|
|
21
|
+
onDeleteSound(src: string, done: DeleteDone): void;
|
|
32
22
|
_render(): void;
|
|
33
23
|
connectedCallback(): void;
|
|
34
24
|
disconnectedCallback(): void;
|
package/dist/author/index.js
CHANGED
|
@@ -8,6 +8,10 @@ import c from "debug";
|
|
|
8
8
|
import { DeleteImageEvent as l, DeleteSoundEvent as u, InsertImageEvent as d, InsertSoundEvent as f, ModelUpdatedEvent as p } from "@pie-element/shared-configure-events";
|
|
9
9
|
//#region src/author/index.ts
|
|
10
10
|
var m = c("explicit-constructed-response:configure"), h = class c extends HTMLElement {
|
|
11
|
+
_root;
|
|
12
|
+
_model;
|
|
13
|
+
_configuration;
|
|
14
|
+
_disableSidePanel;
|
|
11
15
|
static prepareModel = (n = {}) => {
|
|
12
16
|
let i = {
|
|
13
17
|
...r.model,
|
|
@@ -31,7 +35,8 @@ var m = c("explicit-constructed-response:configure"), h = class c extends HTMLEl
|
|
|
31
35
|
this._model = c.prepareModel(e), this._model.responseAreaInputConfiguration && (this._model.responseAreaInputConfiguration = this._configuration.responseAreaInputConfiguration?.inputConfiguration), this._render();
|
|
32
36
|
}
|
|
33
37
|
set configuration(e) {
|
|
34
|
-
|
|
38
|
+
let t = o(e, r.configuration);
|
|
39
|
+
this._configuration = t, e.language?.enabled ? e.languageChoices?.options?.length && (this._model.language = e.languageChoices.options[0].value) : e.language.settings && this._model.language ? (t.language.enabled = !0, (!t.languageChoices.options || !t.languageChoices.options.length) && (t.languageChoices.options = []), t.languageChoices.options.find((e) => e.value === this._model.language) || t.languageChoices.options.push({
|
|
35
40
|
value: this._model.language,
|
|
36
41
|
label: this._model.language
|
|
37
42
|
})) : delete this._model.language, this._render();
|
package/dist/author/main.d.ts
CHANGED
|
@@ -1,30 +1,48 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
import type { DeleteDone, ImageHandler, SoundHandler } from '@pie-element/shared-configure-events';
|
|
3
|
+
import type { ExplicitConstructedResponseValidationErrors } from '../controller/index.js';
|
|
4
|
+
import type { Choices, ExplicitConstructedResponseConfiguration, ExplicitConstructedResponseModel } from '../types.js';
|
|
5
|
+
/** The model the author edits; the host sets `errors` from the controller's `validate()`. */
|
|
6
|
+
export type AuthorModel = Partial<ExplicitConstructedResponseModel> & {
|
|
7
|
+
choices: Choices;
|
|
8
|
+
markup: string;
|
|
9
|
+
slateMarkup: string;
|
|
10
|
+
errors?: ExplicitConstructedResponseValidationErrors;
|
|
11
|
+
};
|
|
12
|
+
type MediaSupport<Handler> = {
|
|
13
|
+
add: (handler: Handler) => void;
|
|
14
|
+
delete: (src: string, done: DeleteDone) => void;
|
|
15
|
+
};
|
|
16
|
+
export type MainProps = {
|
|
17
|
+
model: AuthorModel;
|
|
18
|
+
configuration: ExplicitConstructedResponseConfiguration;
|
|
19
|
+
disableSidePanel?: boolean;
|
|
20
|
+
onModelChanged: (model: Partial<AuthorModel>, reset?: boolean) => void;
|
|
21
|
+
onConfigurationChanged: (configuration: ExplicitConstructedResponseConfiguration, reset?: boolean) => void;
|
|
22
|
+
imageSupport?: MediaSupport<ImageHandler>;
|
|
23
|
+
uploadSoundSupport?: MediaSupport<SoundHandler>;
|
|
24
|
+
};
|
|
25
|
+
type State = {
|
|
26
|
+
/** The editor markup when the author mounted */
|
|
27
|
+
markup?: string;
|
|
28
|
+
/** Choices of response areas removed from the markup, kept so an undo restores them */
|
|
29
|
+
cachedChoices?: Choices;
|
|
30
|
+
};
|
|
31
|
+
export declare class Main extends React.Component<MainProps, State> {
|
|
32
|
+
state: State;
|
|
17
33
|
componentDidMount(): void;
|
|
18
|
-
onModelChange:
|
|
19
|
-
onPromptChanged:
|
|
20
|
-
onRationaleChanged:
|
|
21
|
-
onTeacherInstructionsChanged:
|
|
22
|
-
onMarkupChanged:
|
|
23
|
-
onResponsesChanged:
|
|
24
|
-
onLengthChanged:
|
|
25
|
-
onChangeResponse:
|
|
26
|
-
onChange:
|
|
27
|
-
onHandleAreaChange: import("@pie-element/shared-lodash").CancelableFunction<(nodes:
|
|
34
|
+
onModelChange: (newVal: Partial<AuthorModel>) => void;
|
|
35
|
+
onPromptChanged: (prompt: string) => void;
|
|
36
|
+
onRationaleChanged: (rationale: string) => void;
|
|
37
|
+
onTeacherInstructionsChanged: (teacherInstructions: string) => void;
|
|
38
|
+
onMarkupChanged: (slateMarkup: string) => void;
|
|
39
|
+
onResponsesChanged: (choices: Choices) => void;
|
|
40
|
+
onLengthChanged: (maxLengthPerChoice: number[]) => void;
|
|
41
|
+
onChangeResponse: (index: string, newVal: string) => void;
|
|
42
|
+
onChange: (markup: string) => void;
|
|
43
|
+
onHandleAreaChange: import("@pie-element/shared-lodash").CancelableFunction<(nodes: {
|
|
44
|
+
index: string;
|
|
45
|
+
}[] | undefined) => void>;
|
|
28
46
|
render(): React.JSX.Element;
|
|
29
47
|
}
|
|
30
48
|
export default Main;
|