@pie-element/select-text 14.0.4-next.20261011174919 → 14.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/defaultConfiguration.d.ts +54 -52
- package/dist/author/design.d.ts +36 -24
- package/dist/author/design.js +66 -78
- package/dist/author/index.d.ts +15 -9
- package/dist/author/index.js +6 -3
- package/dist/browser/author/index.js +12 -23
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +2 -2
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +12 -23
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js +2 -2
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +12 -11
- package/dist/controller/index.d.ts +84 -10
- package/dist/controller/index.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +410 -0
- package/dist/schemas/model.schema.json +487 -0
- package/dist/schemas/session.schema.json +58 -0
- package/dist/types.d.ts +203 -0
- package/package.json +21 -17
|
@@ -1,141 +1,143 @@
|
|
|
1
|
+
import type { ConfigureLanguageOptionsProp } from '@pie-element/shared-types';
|
|
2
|
+
import type { TextToken } from '../types.js';
|
|
1
3
|
declare const _default: {
|
|
2
4
|
model: {
|
|
3
|
-
feedbackEnabled:
|
|
4
|
-
highlightChoices:
|
|
5
|
+
feedbackEnabled: false;
|
|
6
|
+
highlightChoices: false;
|
|
5
7
|
maxSelections: number;
|
|
6
|
-
mode:
|
|
7
|
-
partialScoring:
|
|
8
|
+
mode: "sentence";
|
|
9
|
+
partialScoring: false;
|
|
8
10
|
prompt: string;
|
|
9
|
-
promptEnabled:
|
|
11
|
+
promptEnabled: true;
|
|
10
12
|
rationale: string;
|
|
11
|
-
rationaleEnabled:
|
|
12
|
-
scoringType:
|
|
13
|
-
studentInstructionsEnabled:
|
|
13
|
+
rationaleEnabled: true;
|
|
14
|
+
scoringType: "auto";
|
|
15
|
+
studentInstructionsEnabled: true;
|
|
14
16
|
teacherInstructions: string;
|
|
15
|
-
teacherInstructionsEnabled:
|
|
17
|
+
teacherInstructionsEnabled: true;
|
|
16
18
|
text: string;
|
|
17
|
-
tokens:
|
|
18
|
-
toolbarEditorPosition:
|
|
19
|
+
tokens: TextToken[];
|
|
20
|
+
toolbarEditorPosition: "bottom";
|
|
19
21
|
};
|
|
20
22
|
configuration: {
|
|
21
23
|
baseInputConfiguration: {
|
|
22
24
|
h3: {
|
|
23
|
-
disabled:
|
|
25
|
+
disabled: true;
|
|
24
26
|
};
|
|
25
27
|
audio: {
|
|
26
|
-
disabled:
|
|
28
|
+
disabled: false;
|
|
27
29
|
};
|
|
28
30
|
video: {
|
|
29
|
-
disabled:
|
|
31
|
+
disabled: false;
|
|
30
32
|
};
|
|
31
33
|
image: {
|
|
32
|
-
disabled:
|
|
34
|
+
disabled: false;
|
|
33
35
|
};
|
|
34
36
|
textAlign: {
|
|
35
|
-
disabled:
|
|
37
|
+
disabled: true;
|
|
36
38
|
};
|
|
37
39
|
showParagraphs: {
|
|
38
|
-
disabled:
|
|
40
|
+
disabled: false;
|
|
39
41
|
};
|
|
40
42
|
separateParagraphs: {
|
|
41
|
-
disabled:
|
|
43
|
+
disabled: true;
|
|
42
44
|
};
|
|
43
45
|
};
|
|
44
46
|
selectionCount: {
|
|
45
|
-
settings:
|
|
47
|
+
settings: true;
|
|
46
48
|
label: string;
|
|
47
49
|
};
|
|
48
50
|
correctAnswer: {
|
|
49
|
-
settings:
|
|
51
|
+
settings: true;
|
|
50
52
|
label: string;
|
|
51
53
|
};
|
|
52
54
|
selections: {
|
|
53
|
-
settings:
|
|
55
|
+
settings: true;
|
|
54
56
|
label: string;
|
|
55
57
|
};
|
|
56
58
|
highlightChoices: {
|
|
57
|
-
settings:
|
|
59
|
+
settings: true;
|
|
58
60
|
label: string;
|
|
59
61
|
};
|
|
60
62
|
rationale: {
|
|
61
|
-
settings:
|
|
63
|
+
settings: true;
|
|
62
64
|
label: string;
|
|
63
65
|
inputConfiguration: {
|
|
64
66
|
audio: {
|
|
65
|
-
disabled:
|
|
67
|
+
disabled: false;
|
|
66
68
|
};
|
|
67
69
|
video: {
|
|
68
|
-
disabled:
|
|
70
|
+
disabled: false;
|
|
69
71
|
};
|
|
70
72
|
image: {
|
|
71
|
-
disabled:
|
|
73
|
+
disabled: false;
|
|
72
74
|
};
|
|
73
75
|
};
|
|
74
|
-
required:
|
|
76
|
+
required: false;
|
|
75
77
|
};
|
|
76
78
|
scoringType: {
|
|
77
|
-
settings:
|
|
79
|
+
settings: false;
|
|
78
80
|
label: string;
|
|
79
81
|
};
|
|
80
82
|
studentInstructions: {
|
|
81
|
-
settings:
|
|
83
|
+
settings: false;
|
|
82
84
|
label: string;
|
|
83
85
|
};
|
|
84
86
|
teacherInstructions: {
|
|
85
|
-
settings:
|
|
87
|
+
settings: true;
|
|
86
88
|
label: string;
|
|
87
89
|
inputConfiguration: {
|
|
88
90
|
audio: {
|
|
89
|
-
disabled:
|
|
91
|
+
disabled: false;
|
|
90
92
|
};
|
|
91
93
|
video: {
|
|
92
|
-
disabled:
|
|
94
|
+
disabled: false;
|
|
93
95
|
};
|
|
94
96
|
image: {
|
|
95
|
-
disabled:
|
|
97
|
+
disabled: false;
|
|
96
98
|
};
|
|
97
99
|
};
|
|
98
|
-
required:
|
|
100
|
+
required: false;
|
|
99
101
|
};
|
|
100
102
|
prompt: {
|
|
101
103
|
label: string;
|
|
102
|
-
settings:
|
|
104
|
+
settings: true;
|
|
103
105
|
inputConfiguration: {
|
|
104
106
|
audio: {
|
|
105
|
-
disabled:
|
|
107
|
+
disabled: false;
|
|
106
108
|
};
|
|
107
109
|
video: {
|
|
108
|
-
disabled:
|
|
110
|
+
disabled: false;
|
|
109
111
|
};
|
|
110
112
|
image: {
|
|
111
|
-
disabled:
|
|
113
|
+
disabled: false;
|
|
112
114
|
};
|
|
113
115
|
};
|
|
114
|
-
required:
|
|
116
|
+
required: false;
|
|
115
117
|
};
|
|
116
118
|
text: {
|
|
117
|
-
settings:
|
|
119
|
+
settings: true;
|
|
118
120
|
label: string;
|
|
119
121
|
};
|
|
120
122
|
tokens: {
|
|
121
|
-
settings:
|
|
123
|
+
settings: true;
|
|
122
124
|
label: string;
|
|
123
125
|
};
|
|
124
126
|
feedback: {
|
|
125
|
-
settings:
|
|
127
|
+
settings: true;
|
|
126
128
|
label: string;
|
|
127
129
|
};
|
|
128
130
|
spellCheck: {
|
|
129
131
|
label: string;
|
|
130
|
-
settings:
|
|
131
|
-
enabled:
|
|
132
|
+
settings: false;
|
|
133
|
+
enabled: true;
|
|
132
134
|
};
|
|
133
135
|
partialScoring: {
|
|
134
|
-
settings:
|
|
136
|
+
settings: false;
|
|
135
137
|
label: string;
|
|
136
138
|
};
|
|
137
139
|
mode: {
|
|
138
|
-
settings:
|
|
140
|
+
settings: true;
|
|
139
141
|
label: string;
|
|
140
142
|
};
|
|
141
143
|
minTokens: number;
|
|
@@ -150,21 +152,21 @@ declare const _default: {
|
|
|
150
152
|
rationale: number;
|
|
151
153
|
};
|
|
152
154
|
withRubric: {
|
|
153
|
-
settings:
|
|
155
|
+
settings: false;
|
|
154
156
|
label: string;
|
|
155
157
|
};
|
|
156
158
|
mathMlOptions: {
|
|
157
|
-
mmlOutput:
|
|
158
|
-
mmlEditing:
|
|
159
|
+
mmlOutput: false;
|
|
160
|
+
mmlEditing: false;
|
|
159
161
|
};
|
|
160
162
|
language: {
|
|
161
|
-
settings:
|
|
163
|
+
settings: false;
|
|
162
164
|
label: string;
|
|
163
|
-
enabled:
|
|
165
|
+
enabled: false;
|
|
164
166
|
};
|
|
165
167
|
languageChoices: {
|
|
166
168
|
label: string;
|
|
167
|
-
options:
|
|
169
|
+
options: ConfigureLanguageOptionsProp[];
|
|
168
170
|
};
|
|
169
171
|
};
|
|
170
172
|
};
|
package/dist/author/design.d.ts
CHANGED
|
@@ -1,30 +1,42 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
import type { DeleteDone, ImageHandler, SoundHandler } from '@pie-element/shared-configure-events';
|
|
3
|
+
import type { SelectTextValidationErrors } from '../controller/index.js';
|
|
4
|
+
import type { ComplexFeedbackType, SelectTextConfiguration, SelectTextModel, TextToken } from '../types.js';
|
|
5
|
+
/** The model the author edits; the host sets `errors` from the controller's `validate()`. */
|
|
6
|
+
export type AuthorModel = Partial<SelectTextModel> & {
|
|
7
|
+
errors?: SelectTextValidationErrors;
|
|
8
|
+
};
|
|
9
|
+
export type DesignProps = {
|
|
10
|
+
model: AuthorModel;
|
|
11
|
+
configuration: SelectTextConfiguration;
|
|
12
|
+
onModelChanged: (model: AuthorModel) => void;
|
|
13
|
+
onConfigurationChanged: (configuration: SelectTextConfiguration) => void;
|
|
14
|
+
imageSupport?: {
|
|
15
|
+
add: (handler: ImageHandler) => void;
|
|
16
|
+
delete: (src: string, done: DeleteDone) => void;
|
|
14
17
|
};
|
|
18
|
+
uploadSoundSupport?: {
|
|
19
|
+
add: (handler: SoundHandler) => void;
|
|
20
|
+
delete: (src: string, done: DeleteDone) => void;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
type DesignState = {
|
|
24
|
+
text: string;
|
|
25
|
+
};
|
|
26
|
+
export declare class Design extends React.Component<DesignProps, DesignState> {
|
|
15
27
|
static defaultProps: {};
|
|
16
|
-
constructor(props:
|
|
17
|
-
UNSAFE_componentWillReceiveProps(nProps:
|
|
18
|
-
updateText: import("@pie-element/shared-lodash").CancelableFunction<(val:
|
|
19
|
-
changeText: (event:
|
|
20
|
-
changeTokens:
|
|
21
|
-
changeMaxSelections:
|
|
22
|
-
apply:
|
|
23
|
-
changeFeedback:
|
|
24
|
-
changePartialScoring:
|
|
25
|
-
onPromptChanged:
|
|
26
|
-
onTeacherInstructionsChanged:
|
|
27
|
-
onRationaleChanged:
|
|
28
|
+
constructor(props: DesignProps);
|
|
29
|
+
UNSAFE_componentWillReceiveProps(nProps: DesignProps): void;
|
|
30
|
+
updateText: import("@pie-element/shared-lodash").CancelableFunction<(val: string) => void>;
|
|
31
|
+
changeText: (event: React.ChangeEvent<HTMLInputElement>) => void | undefined;
|
|
32
|
+
changeTokens: (tokens: TextToken[], mode: SelectTextModel["mode"]) => void;
|
|
33
|
+
changeMaxSelections: (_event: unknown, max: number) => void;
|
|
34
|
+
apply: (fn: (update: AuthorModel) => void) => void;
|
|
35
|
+
changeFeedback: (feedback: ComplexFeedbackType) => void;
|
|
36
|
+
changePartialScoring: (partialScoring: boolean) => void;
|
|
37
|
+
onPromptChanged: (prompt: string) => void;
|
|
38
|
+
onTeacherInstructionsChanged: (teacherInstructions: string) => void;
|
|
39
|
+
onRationaleChanged: (rationale: string) => void;
|
|
28
40
|
render(): React.JSX.Element;
|
|
29
41
|
}
|
|
30
42
|
export default Design;
|
package/dist/author/design.js
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { generateValidationMessage as e } from "./utils.js";
|
|
2
2
|
import t from "react";
|
|
3
|
-
import n from "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import s from "
|
|
8
|
-
import
|
|
9
|
-
import u from "@
|
|
10
|
-
import
|
|
11
|
-
import h from "@mui/material/Chip";
|
|
3
|
+
import { Tokenizer as n } from "@pie-lib/text-select";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { styled as a } from "@mui/material/styles";
|
|
6
|
+
import o from "debug";
|
|
7
|
+
import { cloneDeep as s, debounce as c } from "@pie-element/shared-lodash";
|
|
8
|
+
import l from "@mui/material/TextField";
|
|
9
|
+
import { FeedbackConfig as ee, InputContainer as u, NumberTextField as d, layout as f, settings as p } from "@pie-lib/config-ui";
|
|
10
|
+
import m from "@mui/material/Chip";
|
|
12
11
|
import te from "@mui/icons-material/Info";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
12
|
+
import h from "@pie-lib/editable-html-tip-tap";
|
|
13
|
+
import g from "@mui/material/Tooltip";
|
|
15
14
|
//#region src/author/design.tsx
|
|
16
|
-
var { Panel: ne, toggle:
|
|
15
|
+
var { Panel: ne, toggle: _, radio: v, dropdown: y } = p, b = a(u)(({ theme: e }) => ({
|
|
17
16
|
width: "100%",
|
|
18
17
|
paddingTop: e.spacing(2),
|
|
19
18
|
marginBottom: e.spacing(2)
|
|
20
|
-
})), x =
|
|
19
|
+
})), x = a(h)({ width: "100%" }), S = a("div")(({ theme: e }) => ({
|
|
21
20
|
fontSize: e.typography.fontSize - 2,
|
|
22
21
|
color: e.palette.error.main,
|
|
23
22
|
paddingTop: e.spacing(1)
|
|
24
|
-
})),
|
|
23
|
+
})), re = a(l)({ width: "100%" }), ie = a(u)(({ theme: e }) => ({
|
|
25
24
|
paddingRight: 0,
|
|
26
25
|
marginRight: 0,
|
|
27
26
|
position: "relative",
|
|
@@ -35,33 +34,22 @@ var { Panel: ne, toggle: v, radio: y, dropdown: re } = m, b = o(d)(({ theme: e }
|
|
|
35
34
|
backgroundColor: e.palette.primary.main
|
|
36
35
|
},
|
|
37
36
|
marginBottom: e.spacing(1)
|
|
38
|
-
})),
|
|
37
|
+
})), ae = a(g)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
|
|
39
38
|
fontSize: e.typography.fontSize - 2,
|
|
40
39
|
whiteSpace: "pre",
|
|
41
40
|
maxWidth: "500px"
|
|
42
|
-
} })), oe =
|
|
41
|
+
} })), oe = a(n)(({ theme: e }) => ({ marginTop: e.spacing(2) })), C = a(m)(({ theme: e }) => ({
|
|
43
42
|
marginTop: e.spacing(.5),
|
|
44
43
|
marginRight: e.spacing(2)
|
|
45
|
-
})), se =
|
|
44
|
+
})), se = a("div")(({ theme: e }) => ({
|
|
46
45
|
display: "flex",
|
|
47
46
|
alignItems: "center",
|
|
48
47
|
flexWrap: "wrap",
|
|
49
48
|
marginBottom: e.spacing(2.5)
|
|
50
|
-
})), ce =
|
|
49
|
+
})), ce = a(d)(({ theme: e }) => ({
|
|
51
50
|
width: "180px",
|
|
52
51
|
margin: `${e.spacing(.5)} auto 0`
|
|
53
|
-
})), le =
|
|
54
|
-
static propTypes = {
|
|
55
|
-
model: n.object.isRequired,
|
|
56
|
-
configuration: n.object.isRequired,
|
|
57
|
-
onModelChanged: n.func.isRequired,
|
|
58
|
-
onConfigurationChanged: n.func.isRequired,
|
|
59
|
-
imageSupport: n.shape({
|
|
60
|
-
add: n.func.isRequired,
|
|
61
|
-
delete: n.func.isRequired
|
|
62
|
-
}),
|
|
63
|
-
uploadSoundSupport: n.object
|
|
64
|
-
};
|
|
52
|
+
})), le = o("@pie-element:select-text:configure"), w = class extends t.Component {
|
|
65
53
|
static defaultProps = {};
|
|
66
54
|
constructor(e) {
|
|
67
55
|
super(e);
|
|
@@ -72,7 +60,7 @@ var { Panel: ne, toggle: v, radio: y, dropdown: re } = m, b = o(d)(({ theme: e }
|
|
|
72
60
|
let { model: t } = e;
|
|
73
61
|
t && t.text && this.setState({ text: t.text });
|
|
74
62
|
}
|
|
75
|
-
updateText =
|
|
63
|
+
updateText = c((e) => {
|
|
76
64
|
this.apply((t) => {
|
|
77
65
|
t.text = e, t.tokens = [];
|
|
78
66
|
});
|
|
@@ -89,22 +77,22 @@ var { Panel: ne, toggle: v, radio: y, dropdown: re } = m, b = o(d)(({ theme: e }
|
|
|
89
77
|
this.apply((e) => e.maxSelections = t);
|
|
90
78
|
};
|
|
91
79
|
apply = (e) => {
|
|
92
|
-
let { onModelChanged: t, model: n } = this.props, r =
|
|
80
|
+
let { onModelChanged: t, model: n } = this.props, r = s(n);
|
|
93
81
|
e(r), t(r);
|
|
94
82
|
};
|
|
95
83
|
changeFeedback = (e) => {
|
|
96
84
|
this.apply((t) => t.feedback = e);
|
|
97
85
|
};
|
|
98
86
|
changePartialScoring = (e) => {
|
|
99
|
-
let { onModelChanged: t, model: n } = this.props, r =
|
|
87
|
+
let { onModelChanged: t, model: n } = this.props, r = s(n);
|
|
100
88
|
r.partialScoring = e, t(r);
|
|
101
89
|
};
|
|
102
90
|
onPromptChanged = (e) => {
|
|
103
|
-
let { onModelChanged: t, model: n } = this.props, r =
|
|
91
|
+
let { onModelChanged: t, model: n } = this.props, r = s(n);
|
|
104
92
|
r.prompt = e, t(r);
|
|
105
93
|
};
|
|
106
94
|
onTeacherInstructionsChanged = (e) => {
|
|
107
|
-
let { onModelChanged: t, model: n } = this.props, r =
|
|
95
|
+
let { onModelChanged: t, model: n } = this.props, r = s(n);
|
|
108
96
|
r.teacherInstructions = e, t(r);
|
|
109
97
|
};
|
|
110
98
|
onRationaleChanged = (e) => {
|
|
@@ -115,33 +103,33 @@ var { Panel: ne, toggle: v, radio: y, dropdown: re } = m, b = o(d)(({ theme: e }
|
|
|
115
103
|
});
|
|
116
104
|
};
|
|
117
105
|
render() {
|
|
118
|
-
let { text: t } = this.state, { configuration: n, imageSupport:
|
|
106
|
+
let { text: t } = this.state, { configuration: n, imageSupport: a, model: o, onConfigurationChanged: s, onModelChanged: c, uploadSoundSupport: l } = this.props, { baseInputConfiguration: u = {}, correctAnswer: d = {}, contentDimensions: p = {}, feedback: m = {}, highlightChoices: h = {}, mode: g = {}, partialScoring: w = {}, prompt: T = {}, rationale: E = {}, selectionCount: D = {}, selections: O = {}, settingsPanelDisabled: ue, scoringType: k = {}, spellCheck: A = {}, studentInstructions: j = {}, teacherInstructions: M = {}, text: N = {}, tokens: P = {}, maxImageWidth: F = {}, maxImageHeight: I = {}, withRubric: L = {}, mathMlOptions: R = {}, language: z = {}, languageChoices: B = {} } = n || {}, { errors: V, extraCSSRules: H, feedbackEnabled: de, promptEnabled: fe, rationaleEnabled: pe, spellCheckEnabled: U, teacherInstructionsEnabled: me, toolbarEditorPosition: he } = o || {}, { prompt: W, rationale: G, selectionsError: K, teacherInstructions: q, tokensError: J } = V || {}, ge = e(n), Y = F && F.prompt, X = I && I.prompt, { tokens: Z } = o;
|
|
119
107
|
Z ||= [];
|
|
120
108
|
let Q = { position: he === "top" ? "top" : "bottom" };
|
|
121
109
|
le("[render] maxSelections:", o.maxSelections);
|
|
122
110
|
let _e = {
|
|
123
|
-
partialScoring:
|
|
124
|
-
highlightChoices: h.settings &&
|
|
125
|
-
feedbackEnabled: m.settings &&
|
|
126
|
-
"language.enabled": z.settings &&
|
|
127
|
-
language: z.settings && z.enabled &&
|
|
111
|
+
partialScoring: w.settings && _(w.label),
|
|
112
|
+
highlightChoices: h.settings && _(h.label),
|
|
113
|
+
feedbackEnabled: m.settings && _(m.label),
|
|
114
|
+
"language.enabled": z.settings && _(z.label, !0),
|
|
115
|
+
language: z.settings && z.enabled && y(B.label, B.options)
|
|
128
116
|
}, ve = {
|
|
129
|
-
teacherInstructionsEnabled: M.settings &&
|
|
130
|
-
studentInstructionsEnabled: j.settings &&
|
|
131
|
-
promptEnabled: T.settings &&
|
|
132
|
-
rationaleEnabled: E.settings &&
|
|
133
|
-
spellCheckEnabled: A.settings &&
|
|
134
|
-
scoringType: k.settings &&
|
|
135
|
-
rubricEnabled: L?.settings &&
|
|
117
|
+
teacherInstructionsEnabled: M.settings && _(M.label),
|
|
118
|
+
studentInstructionsEnabled: j.settings && _(j.label),
|
|
119
|
+
promptEnabled: T.settings && _(T.label),
|
|
120
|
+
rationaleEnabled: E.settings && _(E.label),
|
|
121
|
+
spellCheckEnabled: A.settings && _(A.label),
|
|
122
|
+
scoringType: k.settings && v(k.label, ["auto", "rubric"]),
|
|
123
|
+
rubricEnabled: L?.settings && _(L?.label)
|
|
136
124
|
}, $ = (e = {}) => ({
|
|
137
125
|
...u,
|
|
138
126
|
...e
|
|
139
127
|
});
|
|
140
|
-
return /* @__PURE__ */
|
|
128
|
+
return /* @__PURE__ */ i(f.ConfigLayout, {
|
|
141
129
|
extraCSSRules: H,
|
|
142
|
-
dimensions:
|
|
130
|
+
dimensions: p,
|
|
143
131
|
hideSettings: ue,
|
|
144
|
-
settings: /* @__PURE__ */
|
|
132
|
+
settings: /* @__PURE__ */ r(ne, {
|
|
145
133
|
model: o,
|
|
146
134
|
configuration: n,
|
|
147
135
|
onChangeModel: (e) => c(e),
|
|
@@ -152,12 +140,12 @@ var { Panel: ne, toggle: v, radio: y, dropdown: re } = m, b = o(d)(({ theme: e }
|
|
|
152
140
|
}
|
|
153
141
|
}),
|
|
154
142
|
children: [
|
|
155
|
-
me && /* @__PURE__ */
|
|
143
|
+
me && /* @__PURE__ */ i(b, {
|
|
156
144
|
label: M.label,
|
|
157
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ r(x, {
|
|
158
146
|
markup: o.teacherInstructions || "",
|
|
159
147
|
onChange: this.onTeacherInstructionsChanged,
|
|
160
|
-
imageSupport:
|
|
148
|
+
imageSupport: a,
|
|
161
149
|
nonEmpty: !1,
|
|
162
150
|
error: q,
|
|
163
151
|
toolbarOpts: Q,
|
|
@@ -168,14 +156,14 @@ var { Panel: ne, toggle: v, radio: y, dropdown: re } = m, b = o(d)(({ theme: e }
|
|
|
168
156
|
uploadSoundSupport: l,
|
|
169
157
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
170
158
|
mathMlOptions: R
|
|
171
|
-
}), q && /* @__PURE__ */
|
|
159
|
+
}), q && /* @__PURE__ */ r(S, { children: q })]
|
|
172
160
|
}),
|
|
173
|
-
fe && /* @__PURE__ */
|
|
161
|
+
fe && /* @__PURE__ */ i(b, {
|
|
174
162
|
label: T.label || "",
|
|
175
|
-
children: [/* @__PURE__ */
|
|
163
|
+
children: [/* @__PURE__ */ r(x, {
|
|
176
164
|
markup: o.prompt,
|
|
177
165
|
onChange: this.onPromptChanged,
|
|
178
|
-
imageSupport:
|
|
166
|
+
imageSupport: a,
|
|
179
167
|
error: W,
|
|
180
168
|
toolbarOpts: Q,
|
|
181
169
|
pluginProps: $(n?.prompt?.inputConfiguration),
|
|
@@ -185,11 +173,11 @@ var { Panel: ne, toggle: v, radio: y, dropdown: re } = m, b = o(d)(({ theme: e }
|
|
|
185
173
|
uploadSoundSupport: l,
|
|
186
174
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
187
175
|
mathMlOptions: R
|
|
188
|
-
}), W && /* @__PURE__ */
|
|
176
|
+
}), W && /* @__PURE__ */ r(S, { children: W })]
|
|
189
177
|
}),
|
|
190
|
-
N.settings && /* @__PURE__ */
|
|
178
|
+
N.settings && /* @__PURE__ */ r(b, {
|
|
191
179
|
label: N.label || "",
|
|
192
|
-
children: /* @__PURE__ */
|
|
180
|
+
children: /* @__PURE__ */ r(re, {
|
|
193
181
|
variant: "standard",
|
|
194
182
|
multiline: !0,
|
|
195
183
|
defaultValue: t,
|
|
@@ -197,14 +185,14 @@ var { Panel: ne, toggle: v, radio: y, dropdown: re } = m, b = o(d)(({ theme: e }
|
|
|
197
185
|
spellCheck: U
|
|
198
186
|
})
|
|
199
187
|
}),
|
|
200
|
-
P.settings && /* @__PURE__ */
|
|
188
|
+
P.settings && /* @__PURE__ */ i(ie, {
|
|
201
189
|
label: P.label || "",
|
|
202
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ r(ae, {
|
|
203
191
|
disableFocusListener: !0,
|
|
204
192
|
disableTouchListener: !0,
|
|
205
193
|
placement: "right",
|
|
206
194
|
title: ge,
|
|
207
|
-
children: /* @__PURE__ */
|
|
195
|
+
children: /* @__PURE__ */ r(te, {
|
|
208
196
|
fontSize: "small",
|
|
209
197
|
color: "primary",
|
|
210
198
|
style: {
|
|
@@ -213,19 +201,19 @@ var { Panel: ne, toggle: v, radio: y, dropdown: re } = m, b = o(d)(({ theme: e }
|
|
|
213
201
|
top: "-3px"
|
|
214
202
|
}
|
|
215
203
|
})
|
|
216
|
-
}), /* @__PURE__ */
|
|
204
|
+
}), /* @__PURE__ */ r(oe, {
|
|
217
205
|
text: o.text,
|
|
218
206
|
tokens: Z,
|
|
219
207
|
onChange: this.changeTokens
|
|
220
208
|
})]
|
|
221
209
|
}),
|
|
222
|
-
J && /* @__PURE__ */
|
|
223
|
-
K && /* @__PURE__ */
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
g.settings && /* @__PURE__ */
|
|
226
|
-
O.settings && /* @__PURE__ */
|
|
227
|
-
d.settings && /* @__PURE__ */
|
|
228
|
-
D.settings && /* @__PURE__ */
|
|
210
|
+
J && /* @__PURE__ */ r(S, { children: J }),
|
|
211
|
+
K && /* @__PURE__ */ r(S, { children: K }),
|
|
212
|
+
/* @__PURE__ */ i(se, { children: [
|
|
213
|
+
g.settings && /* @__PURE__ */ r(C, { label: `${g.label}: ${o.mode ? o.mode : "None"}` }),
|
|
214
|
+
O.settings && /* @__PURE__ */ r(C, { label: `${O.label}: ${Z.length}` }),
|
|
215
|
+
d.settings && /* @__PURE__ */ r(C, { label: `${d.label}: ${Z.filter((e) => e.correct).length}` }),
|
|
216
|
+
D.settings && /* @__PURE__ */ r(ce, {
|
|
229
217
|
min: Z.filter((e) => e.correct).length || 0,
|
|
230
218
|
label: `${D.label} (0:any)`,
|
|
231
219
|
max: Z.length,
|
|
@@ -233,12 +221,12 @@ var { Panel: ne, toggle: v, radio: y, dropdown: re } = m, b = o(d)(({ theme: e }
|
|
|
233
221
|
onChange: this.changeMaxSelections
|
|
234
222
|
})
|
|
235
223
|
] }),
|
|
236
|
-
pe && /* @__PURE__ */
|
|
224
|
+
pe && /* @__PURE__ */ i(b, {
|
|
237
225
|
label: E.label || "",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ r(x, {
|
|
239
227
|
markup: o.rationale || "",
|
|
240
228
|
onChange: this.onRationaleChanged,
|
|
241
|
-
imageSupport:
|
|
229
|
+
imageSupport: a,
|
|
242
230
|
error: G,
|
|
243
231
|
toolbarOpts: Q,
|
|
244
232
|
pluginProps: $(n?.rationale?.inputConfiguration),
|
|
@@ -248,9 +236,9 @@ var { Panel: ne, toggle: v, radio: y, dropdown: re } = m, b = o(d)(({ theme: e }
|
|
|
248
236
|
uploadSoundSupport: l,
|
|
249
237
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
250
238
|
mathMlOptions: R
|
|
251
|
-
}), G && /* @__PURE__ */
|
|
239
|
+
}), G && /* @__PURE__ */ r(S, { children: G })]
|
|
252
240
|
}),
|
|
253
|
-
de && /* @__PURE__ */
|
|
241
|
+
de && /* @__PURE__ */ r(ee, {
|
|
254
242
|
feedback: o.feedback,
|
|
255
243
|
onChange: this.changeFeedback,
|
|
256
244
|
toolbarOpts: Q
|
|
@@ -260,4 +248,4 @@ var { Panel: ne, toggle: v, radio: y, dropdown: re } = m, b = o(d)(({ theme: e }
|
|
|
260
248
|
}
|
|
261
249
|
};
|
|
262
250
|
//#endregion
|
|
263
|
-
export {
|
|
251
|
+
export { w as Design, w as default };
|
package/dist/author/index.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
|
+
import { type AuthorModel } from './design.js';
|
|
2
|
+
import { type DeleteDone, type ImageHandler, type SoundHandler } from '@pie-element/shared-configure-events';
|
|
3
|
+
import type { SelectTextConfiguration, SelectTextModel } from '../types.js';
|
|
1
4
|
export default class SelectTextConfigure extends HTMLElement {
|
|
2
|
-
|
|
5
|
+
private _root;
|
|
6
|
+
private _model;
|
|
7
|
+
private _configuration;
|
|
8
|
+
static createDefaultModel: (model?: Partial<SelectTextModel>) => AuthorModel;
|
|
3
9
|
constructor();
|
|
4
|
-
set model(m:
|
|
5
|
-
set configuration(c:
|
|
10
|
+
set model(m: Partial<SelectTextModel>);
|
|
11
|
+
set configuration(c: SelectTextConfiguration);
|
|
6
12
|
connectedCallback(): void;
|
|
7
|
-
modelChanged(m:
|
|
8
|
-
onConfigurationChanged(c:
|
|
13
|
+
modelChanged(m: AuthorModel): void;
|
|
14
|
+
onConfigurationChanged(c: SelectTextConfiguration): void;
|
|
9
15
|
/**
|
|
10
16
|
*
|
|
11
17
|
* @param {done, progress, file} handler
|
|
12
18
|
*/
|
|
13
|
-
insertImage(handler:
|
|
14
|
-
onDeleteImage(src:
|
|
15
|
-
insertSound(handler:
|
|
16
|
-
onDeleteSound(src:
|
|
19
|
+
insertImage(handler: ImageHandler): void;
|
|
20
|
+
onDeleteImage(src: string, done: DeleteDone): void;
|
|
21
|
+
insertSound(handler: SoundHandler): void;
|
|
22
|
+
onDeleteSound(src: string, done: DeleteDone): void;
|
|
17
23
|
render(): void;
|
|
18
24
|
disconnectedCallback(): void;
|
|
19
25
|
}
|
package/dist/author/index.js
CHANGED
|
@@ -6,6 +6,9 @@ import { createRoot as i } from "react-dom/client";
|
|
|
6
6
|
import { DeleteImageEvent as a, DeleteSoundEvent as o, InsertImageEvent as s, InsertSoundEvent as c, ModelUpdatedEvent as l } from "@pie-element/shared-configure-events";
|
|
7
7
|
//#region src/author/index.ts
|
|
8
8
|
var u = class u extends HTMLElement {
|
|
9
|
+
_root;
|
|
10
|
+
_model;
|
|
11
|
+
_configuration;
|
|
9
12
|
static createDefaultModel = (t = {}) => e({
|
|
10
13
|
...n.model,
|
|
11
14
|
...t
|
|
@@ -21,7 +24,7 @@ var u = class u extends HTMLElement {
|
|
|
21
24
|
...n.configuration,
|
|
22
25
|
...e
|
|
23
26
|
};
|
|
24
|
-
this._configuration = t, t?.language?.enabled ? t?.languageChoices?.options?.length && (this._model.language = t?.languageChoices.options[0].value) : t.language.settings && this._model.language ? (
|
|
27
|
+
this._configuration = t, t?.language?.enabled ? t?.languageChoices?.options?.length && (this._model.language = t?.languageChoices.options[0].value) : t.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({
|
|
25
28
|
value: this._model.language,
|
|
26
29
|
label: this._model.language
|
|
27
30
|
})) : delete this._model.language, this.render();
|
|
@@ -30,10 +33,10 @@ var u = class u extends HTMLElement {
|
|
|
30
33
|
this.render();
|
|
31
34
|
}
|
|
32
35
|
modelChanged(e) {
|
|
33
|
-
this._model = e, this.dispatchEvent(new l(this._model)
|
|
36
|
+
this._model = e, this.dispatchEvent(new l(this._model)), this.render();
|
|
34
37
|
}
|
|
35
38
|
onConfigurationChanged(e) {
|
|
36
|
-
this._configuration = e, this._model && this.dispatchEvent(new l(this._model)
|
|
39
|
+
this._configuration = e, this._model && this.dispatchEvent(new l(this._model)), this.render();
|
|
37
40
|
}
|
|
38
41
|
insertImage(e) {
|
|
39
42
|
this.dispatchEvent(new s(e));
|