@pie-element/math-inline 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.
- package/dist/author/configure.d.ts +23 -13
- package/dist/author/configure.js +37 -47
- package/dist/author/defaults.d.ts +60 -58
- package/dist/author/index.d.ts +15 -43
- package/dist/author/index.js +12 -4
- package/dist/author/utils.d.ts +35 -4
- package/dist/browser/author/index.js +19 -23
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +13 -13
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +19 -23
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js +13 -13
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +19 -18
- package/dist/controller/index.d.ts +102 -7
- package/dist/controller/index.js +13 -13
- package/dist/controller/utils.d.ts +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +385 -0
- package/dist/schemas/model.schema.json +719 -0
- package/dist/schemas/session.schema.json +44 -0
- package/dist/types.d.ts +236 -0
- package/package.json +21 -17
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
import type { DeleteDone, ImageHandler, SoundHandler } from '@pie-element/shared-configure-events';
|
|
3
|
+
import type { MathInlineValidationErrors } from '../controller/index.js';
|
|
4
|
+
import type { ComplexFeedback, MathInlineConfiguration, MathInlineModel } from '../types.js';
|
|
5
|
+
/** The model the author edits; the host sets `errors` from the controller's `validate()`. */
|
|
6
|
+
export type AuthorModel = Partial<MathInlineModel> & {
|
|
7
|
+
errors?: MathInlineValidationErrors;
|
|
8
|
+
};
|
|
9
|
+
type MediaSupport<Handler> = {
|
|
10
|
+
add: (handler: Handler) => void;
|
|
11
|
+
delete: (src: string, done: DeleteDone) => void;
|
|
12
|
+
};
|
|
13
|
+
export type ConfigureProps = {
|
|
14
|
+
model: AuthorModel;
|
|
15
|
+
configuration: MathInlineConfiguration;
|
|
16
|
+
onModelChanged: (model: AuthorModel) => void;
|
|
17
|
+
onConfigurationChanged: (configuration: MathInlineConfiguration) => void;
|
|
18
|
+
imageSupport?: MediaSupport<ImageHandler>;
|
|
19
|
+
uploadSoundSupport?: MediaSupport<SoundHandler>;
|
|
20
|
+
};
|
|
21
|
+
export declare class Configure extends React.Component<ConfigureProps> {
|
|
22
|
+
onChange: (model: AuthorModel) => void;
|
|
23
|
+
changeTeacherInstructions: (teacherInstructions: string) => void;
|
|
24
|
+
onFeedbackChange: (feedback: ComplexFeedback) => void;
|
|
15
25
|
render(): React.JSX.Element;
|
|
16
26
|
}
|
|
17
27
|
export default Configure;
|
package/dist/author/configure.js
CHANGED
|
@@ -2,29 +2,20 @@ import { ResponseTypes as e, getPluginProps as t } from "./utils.js";
|
|
|
2
2
|
import n from "./general-config-block.js";
|
|
3
3
|
import r from "react";
|
|
4
4
|
import i from "debug";
|
|
5
|
-
import a from "
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import p from "@pie-lib/editable-html-tip-tap";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { styled as s } from "@mui/material/styles";
|
|
7
|
+
import { FeedbackConfig as c, InputContainer as l, layout as u, settings as d } from "@pie-lib/config-ui";
|
|
8
|
+
import f from "@pie-lib/editable-html-tip-tap";
|
|
10
9
|
//#region src/author/configure.tsx
|
|
11
|
-
var
|
|
10
|
+
var p = i("@pie-element:math-inline:configure"), { Panel: m, toggle: h, radio: g, dropdown: _ } = d, v = s(l)(({ theme: e }) => ({
|
|
12
11
|
width: "100%",
|
|
13
12
|
paddingTop: e.spacing(2),
|
|
14
13
|
marginBottom: e.spacing(2)
|
|
15
|
-
})),
|
|
14
|
+
})), y = s("div")(({ theme: e }) => ({
|
|
16
15
|
fontSize: e.typography.fontSize - 2,
|
|
17
16
|
color: e.palette.error.main,
|
|
18
17
|
paddingTop: e.spacing(1)
|
|
19
|
-
})),
|
|
20
|
-
static propTypes = {
|
|
21
|
-
onModelChanged: a.func,
|
|
22
|
-
onConfigurationChanged: a.func,
|
|
23
|
-
model: a.object.isRequired,
|
|
24
|
-
configuration: a.object.isRequired,
|
|
25
|
-
imageSupport: a.object,
|
|
26
|
-
uploadSoundSupport: a.object
|
|
27
|
-
};
|
|
18
|
+
})), b = class extends r.Component {
|
|
28
19
|
onChange = (e) => {
|
|
29
20
|
this.props.onModelChanged(e);
|
|
30
21
|
};
|
|
@@ -39,42 +30,42 @@ var m = i("@pie-element:math-inline:configure"), { Panel: h, toggle: g, radio: _
|
|
|
39
30
|
t.feedback = e, n(t);
|
|
40
31
|
};
|
|
41
32
|
render() {
|
|
42
|
-
let { model: r, imageSupport: i, onModelChanged:
|
|
43
|
-
|
|
33
|
+
let { model: r, imageSupport: i, onModelChanged: s, configuration: l, onConfigurationChanged: d, uploadSoundSupport: b } = this.props, { allowTrailingZeros: x = {}, baseInputConfiguration: S = {}, contentDimensions: C = {}, feedback: w = {}, ignoreOrder: T = {}, maxImageWidth: E = {}, maxImageHeight: D = {}, prompt: O = {}, rationale: k = {}, responseType: A = {}, scoringType: j = {}, settingsPanelDisabled: M, spellCheck: N = {}, studentInstructions: P = {}, teacherInstructions: F = {}, withRubric: I = {}, mathMlOptions: L = {}, language: R = {}, languageChoices: z = {} } = l || {}, { errors: B = {}, extraCSSRules: V, feedbackEnabled: H, promptEnabled: U, rationaleEnabled: W, spellCheckEnabled: G, teacherInstructionsEnabled: K, toolbarEditorPosition: q } = r || {}, { teacherInstructions: J } = B;
|
|
34
|
+
p("[render] model", r);
|
|
44
35
|
let Y = { position: q === "top" ? "top" : "bottom" }, X = E && E.prompt, Z = D && D.prompt, Q = {
|
|
45
|
-
responseType: A.settings &&
|
|
46
|
-
feedbackEnabled: w.settings &&
|
|
47
|
-
promptEnabled: O.settings &&
|
|
48
|
-
"language.enabled": R.settings &&
|
|
49
|
-
language: R.settings && R.enabled &&
|
|
36
|
+
responseType: A.settings && g(A.label, [e.simple, e.advanced]),
|
|
37
|
+
feedbackEnabled: w.settings && h(w.label),
|
|
38
|
+
promptEnabled: O.settings && h(O.label),
|
|
39
|
+
"language.enabled": R.settings && h(R.label, !0),
|
|
40
|
+
language: R.settings && R.enabled && _(z.label, z.options)
|
|
50
41
|
}, $ = {
|
|
51
|
-
teacherInstructionsEnabled: F.settings &&
|
|
52
|
-
studentInstructionsEnabled: P.settings &&
|
|
53
|
-
rationaleEnabled: k.settings &&
|
|
54
|
-
spellCheckEnabled: N.settings &&
|
|
55
|
-
scoringType: j.settings &&
|
|
56
|
-
"ignoreOrder.enabled": T.settings &&
|
|
57
|
-
"allowTrailingZeros.enabled": x.settings &&
|
|
58
|
-
rubricEnabled: I?.settings &&
|
|
42
|
+
teacherInstructionsEnabled: F.settings && h(F.label),
|
|
43
|
+
studentInstructionsEnabled: P.settings && h(P.label),
|
|
44
|
+
rationaleEnabled: k.settings && h(k.label),
|
|
45
|
+
spellCheckEnabled: N.settings && h(N.label),
|
|
46
|
+
scoringType: j.settings && g(j.label, ["auto", "rubric"]),
|
|
47
|
+
"ignoreOrder.enabled": T.settings && h(T.label),
|
|
48
|
+
"allowTrailingZeros.enabled": x.settings && h(x.label),
|
|
49
|
+
rubricEnabled: I?.settings && h(I?.label)
|
|
59
50
|
};
|
|
60
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ o(u.ConfigLayout, {
|
|
61
52
|
extraCSSRules: V,
|
|
62
53
|
dimensions: C,
|
|
63
54
|
hideSettings: M,
|
|
64
|
-
settings: /* @__PURE__ */
|
|
55
|
+
settings: /* @__PURE__ */ a(m, {
|
|
65
56
|
model: r,
|
|
66
|
-
configuration:
|
|
67
|
-
onChangeModel: (e) =>
|
|
68
|
-
onChangeConfiguration: (e) =>
|
|
57
|
+
configuration: l,
|
|
58
|
+
onChangeModel: (e) => s(e),
|
|
59
|
+
onChangeConfiguration: (e) => d(e),
|
|
69
60
|
groups: {
|
|
70
61
|
Settings: Q,
|
|
71
62
|
Properties: $
|
|
72
63
|
}
|
|
73
64
|
}),
|
|
74
65
|
children: [
|
|
75
|
-
K && /* @__PURE__ */
|
|
66
|
+
K && /* @__PURE__ */ o(v, {
|
|
76
67
|
label: F.label,
|
|
77
|
-
children: [/* @__PURE__ */
|
|
68
|
+
children: [/* @__PURE__ */ a(f, {
|
|
78
69
|
markup: r.teacherInstructions || "",
|
|
79
70
|
onChange: this.changeTeacherInstructions,
|
|
80
71
|
imageSupport: i,
|
|
@@ -85,23 +76,22 @@ var m = i("@pie-element:math-inline:configure"), { Panel: h, toggle: g, radio: _
|
|
|
85
76
|
spellCheck: G,
|
|
86
77
|
maxImageWidth: E && E.teacherInstructions || X,
|
|
87
78
|
maxImageHeight: D && D.teacherInstructions || Z,
|
|
88
|
-
uploadSoundSupport:
|
|
79
|
+
uploadSoundSupport: b,
|
|
89
80
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
90
81
|
mathMlOptions: L
|
|
91
|
-
}), J && /* @__PURE__ */
|
|
82
|
+
}), J && /* @__PURE__ */ a(y, { children: J })]
|
|
92
83
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ a(n, {
|
|
94
85
|
imageSupport: i,
|
|
95
|
-
uploadSoundSupport:
|
|
86
|
+
uploadSoundSupport: b,
|
|
96
87
|
model: r,
|
|
97
|
-
configuration:
|
|
88
|
+
configuration: l,
|
|
98
89
|
onChange: this.onChange,
|
|
99
90
|
rationaleEnabled: W,
|
|
100
91
|
promptEnabled: U,
|
|
101
|
-
toolbarOpts: Y
|
|
102
|
-
spellCheck: G
|
|
92
|
+
toolbarOpts: Y
|
|
103
93
|
}),
|
|
104
|
-
H && /* @__PURE__ */
|
|
94
|
+
H && /* @__PURE__ */ a(c, {
|
|
105
95
|
feedback: r.feedback,
|
|
106
96
|
onChange: this.onFeedbackChange,
|
|
107
97
|
toolbarOpts: Y
|
|
@@ -111,4 +101,4 @@ var m = i("@pie-element:math-inline:configure"), { Panel: h, toggle: g, radio: _
|
|
|
111
101
|
}
|
|
112
102
|
};
|
|
113
103
|
//#endregion
|
|
114
|
-
export {
|
|
104
|
+
export { b as Configure, b as default };
|
|
@@ -1,150 +1,152 @@
|
|
|
1
|
+
import type { ConfigureLanguageOptionsProp } from '@pie-element/shared-types';
|
|
2
|
+
import type { MathInlineResponse } from '../types.js';
|
|
1
3
|
/** NOTE: teacherInstructions, studentInstructions, rationale & scoringType
|
|
2
4
|
* functionalities are not defined yet - the value for those can belong to
|
|
3
5
|
* model or to configure
|
|
4
6
|
*/
|
|
5
7
|
declare const _default: {
|
|
6
8
|
model: {
|
|
7
|
-
allowTrailingZerosDefault:
|
|
8
|
-
customKeys:
|
|
9
|
-
equationEditor:
|
|
9
|
+
allowTrailingZerosDefault: false;
|
|
10
|
+
customKeys: string[];
|
|
11
|
+
equationEditor: "8";
|
|
10
12
|
expression: string;
|
|
11
13
|
feedback: {
|
|
12
14
|
correct: {
|
|
13
15
|
default: string;
|
|
14
|
-
type:
|
|
16
|
+
type: "none";
|
|
15
17
|
};
|
|
16
18
|
incorrect: {
|
|
17
19
|
default: string;
|
|
18
|
-
type:
|
|
20
|
+
type: "none";
|
|
19
21
|
};
|
|
20
22
|
partial: {
|
|
21
23
|
default: string;
|
|
22
|
-
type:
|
|
24
|
+
type: "none";
|
|
23
25
|
};
|
|
24
26
|
};
|
|
25
|
-
feedbackEnabled:
|
|
26
|
-
ignoreOrderDefault:
|
|
27
|
-
partialScoring:
|
|
27
|
+
feedbackEnabled: false;
|
|
28
|
+
ignoreOrderDefault: false;
|
|
29
|
+
partialScoring: true;
|
|
28
30
|
prompt: string;
|
|
29
|
-
promptEnabled:
|
|
31
|
+
promptEnabled: true;
|
|
30
32
|
rationale: string;
|
|
31
|
-
rationaleEnabled:
|
|
32
|
-
responseType:
|
|
33
|
-
responses:
|
|
34
|
-
scoringType:
|
|
35
|
-
studentInstructionsEnabled:
|
|
33
|
+
rationaleEnabled: true;
|
|
34
|
+
responseType: "Advanced Multi";
|
|
35
|
+
responses: MathInlineResponse[];
|
|
36
|
+
scoringType: "auto";
|
|
37
|
+
studentInstructionsEnabled: true;
|
|
36
38
|
teacherInstructions: string;
|
|
37
|
-
teacherInstructionsEnabled:
|
|
38
|
-
toolbarEditorPosition:
|
|
39
|
-
validationDefault:
|
|
39
|
+
teacherInstructionsEnabled: true;
|
|
40
|
+
toolbarEditorPosition: "bottom";
|
|
41
|
+
validationDefault: "literal";
|
|
40
42
|
};
|
|
41
43
|
configuration: {
|
|
42
44
|
baseInputConfiguration: {
|
|
43
45
|
h3: {
|
|
44
|
-
disabled:
|
|
46
|
+
disabled: true;
|
|
45
47
|
};
|
|
46
48
|
audio: {
|
|
47
|
-
disabled:
|
|
49
|
+
disabled: false;
|
|
48
50
|
};
|
|
49
51
|
video: {
|
|
50
|
-
disabled:
|
|
52
|
+
disabled: false;
|
|
51
53
|
};
|
|
52
54
|
image: {
|
|
53
|
-
disabled:
|
|
55
|
+
disabled: false;
|
|
54
56
|
};
|
|
55
57
|
textAlign: {
|
|
56
|
-
disabled:
|
|
58
|
+
disabled: true;
|
|
57
59
|
};
|
|
58
60
|
showParagraphs: {
|
|
59
|
-
disabled:
|
|
61
|
+
disabled: false;
|
|
60
62
|
};
|
|
61
63
|
separateParagraphs: {
|
|
62
|
-
disabled:
|
|
64
|
+
disabled: true;
|
|
63
65
|
};
|
|
64
66
|
};
|
|
65
67
|
prompt: {
|
|
66
|
-
settings:
|
|
68
|
+
settings: true;
|
|
67
69
|
label: string;
|
|
68
70
|
inputConfiguration: {
|
|
69
71
|
audio: {
|
|
70
|
-
disabled:
|
|
72
|
+
disabled: false;
|
|
71
73
|
};
|
|
72
74
|
video: {
|
|
73
|
-
disabled:
|
|
75
|
+
disabled: false;
|
|
74
76
|
};
|
|
75
77
|
image: {
|
|
76
|
-
disabled:
|
|
78
|
+
disabled: false;
|
|
77
79
|
};
|
|
78
80
|
};
|
|
79
|
-
required:
|
|
81
|
+
required: false;
|
|
80
82
|
};
|
|
81
83
|
feedback: {
|
|
82
|
-
settings:
|
|
84
|
+
settings: true;
|
|
83
85
|
label: string;
|
|
84
86
|
};
|
|
85
87
|
responseType: {
|
|
86
|
-
settings:
|
|
88
|
+
settings: true;
|
|
87
89
|
label: string;
|
|
88
90
|
};
|
|
89
91
|
rationale: {
|
|
90
|
-
settings:
|
|
92
|
+
settings: true;
|
|
91
93
|
label: string;
|
|
92
94
|
inputConfiguration: {
|
|
93
95
|
audio: {
|
|
94
|
-
disabled:
|
|
96
|
+
disabled: false;
|
|
95
97
|
};
|
|
96
98
|
video: {
|
|
97
|
-
disabled:
|
|
99
|
+
disabled: false;
|
|
98
100
|
};
|
|
99
101
|
image: {
|
|
100
|
-
disabled:
|
|
102
|
+
disabled: false;
|
|
101
103
|
};
|
|
102
104
|
};
|
|
103
|
-
required:
|
|
105
|
+
required: false;
|
|
104
106
|
};
|
|
105
|
-
settingsPanelDisabled:
|
|
107
|
+
settingsPanelDisabled: false;
|
|
106
108
|
spellCheck: {
|
|
107
109
|
label: string;
|
|
108
|
-
settings:
|
|
109
|
-
enabled:
|
|
110
|
+
settings: false;
|
|
111
|
+
enabled: true;
|
|
110
112
|
};
|
|
111
113
|
scoringType: {
|
|
112
|
-
settings:
|
|
114
|
+
settings: false;
|
|
113
115
|
label: string;
|
|
114
116
|
};
|
|
115
117
|
studentInstructions: {
|
|
116
|
-
settings:
|
|
118
|
+
settings: false;
|
|
117
119
|
label: string;
|
|
118
120
|
};
|
|
119
121
|
teacherInstructions: {
|
|
120
|
-
settings:
|
|
122
|
+
settings: true;
|
|
121
123
|
label: string;
|
|
122
124
|
inputConfiguration: {
|
|
123
125
|
audio: {
|
|
124
|
-
disabled:
|
|
126
|
+
disabled: false;
|
|
125
127
|
};
|
|
126
128
|
video: {
|
|
127
|
-
disabled:
|
|
129
|
+
disabled: false;
|
|
128
130
|
};
|
|
129
131
|
image: {
|
|
130
|
-
disabled:
|
|
132
|
+
disabled: false;
|
|
131
133
|
};
|
|
132
134
|
};
|
|
133
|
-
required:
|
|
135
|
+
required: false;
|
|
134
136
|
};
|
|
135
137
|
partialScoring: {
|
|
136
|
-
settings:
|
|
138
|
+
settings: false;
|
|
137
139
|
label: string;
|
|
138
140
|
};
|
|
139
141
|
ignoreOrder: {
|
|
140
|
-
settings:
|
|
142
|
+
settings: false;
|
|
141
143
|
label: string;
|
|
142
|
-
enabled:
|
|
144
|
+
enabled: true;
|
|
143
145
|
};
|
|
144
146
|
allowTrailingZeros: {
|
|
145
|
-
settings:
|
|
147
|
+
settings: false;
|
|
146
148
|
label: string;
|
|
147
|
-
enabled:
|
|
149
|
+
enabled: true;
|
|
148
150
|
};
|
|
149
151
|
maxImageWidth: {
|
|
150
152
|
teacherInstructions: number;
|
|
@@ -157,21 +159,21 @@ declare const _default: {
|
|
|
157
159
|
rationale: number;
|
|
158
160
|
};
|
|
159
161
|
withRubric: {
|
|
160
|
-
settings:
|
|
162
|
+
settings: false;
|
|
161
163
|
label: string;
|
|
162
164
|
};
|
|
163
165
|
mathMlOptions: {
|
|
164
|
-
mmlOutput:
|
|
165
|
-
mmlEditing:
|
|
166
|
+
mmlOutput: false;
|
|
167
|
+
mmlEditing: false;
|
|
166
168
|
};
|
|
167
169
|
language: {
|
|
168
|
-
settings:
|
|
170
|
+
settings: false;
|
|
169
171
|
label: string;
|
|
170
|
-
enabled:
|
|
172
|
+
enabled: false;
|
|
171
173
|
};
|
|
172
174
|
languageChoices: {
|
|
173
175
|
label: string;
|
|
174
|
-
options:
|
|
176
|
+
options: ConfigureLanguageOptionsProp[];
|
|
175
177
|
};
|
|
176
178
|
};
|
|
177
179
|
};
|
package/dist/author/index.d.ts
CHANGED
|
@@ -1,52 +1,24 @@
|
|
|
1
|
+
import { type AuthorModel } from './configure.js';
|
|
2
|
+
import { type DeleteDone, type ImageHandler, type SoundHandler } from '@pie-element/shared-configure-events';
|
|
3
|
+
import type { MathInlineConfiguration, MathInlineModel } from '../types.js';
|
|
1
4
|
export default class MathInlineConfigure extends HTMLElement {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
expression: string;
|
|
7
|
-
feedback: {
|
|
8
|
-
correct: {
|
|
9
|
-
default: string;
|
|
10
|
-
type: string;
|
|
11
|
-
};
|
|
12
|
-
incorrect: {
|
|
13
|
-
default: string;
|
|
14
|
-
type: string;
|
|
15
|
-
};
|
|
16
|
-
partial: {
|
|
17
|
-
default: string;
|
|
18
|
-
type: string;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
feedbackEnabled: boolean;
|
|
22
|
-
ignoreOrderDefault: boolean;
|
|
23
|
-
partialScoring: boolean;
|
|
24
|
-
prompt: string;
|
|
25
|
-
promptEnabled: boolean;
|
|
26
|
-
rationale: string;
|
|
27
|
-
rationaleEnabled: boolean;
|
|
28
|
-
responseType: string;
|
|
29
|
-
responses: never[];
|
|
30
|
-
scoringType: string;
|
|
31
|
-
studentInstructionsEnabled: boolean;
|
|
32
|
-
teacherInstructions: string;
|
|
33
|
-
teacherInstructionsEnabled: boolean;
|
|
34
|
-
toolbarEditorPosition: string;
|
|
35
|
-
validationDefault: string;
|
|
36
|
-
};
|
|
5
|
+
private _root;
|
|
6
|
+
private _model;
|
|
7
|
+
private _configuration;
|
|
8
|
+
static createDefaultModel: (model?: Partial<MathInlineModel>) => AuthorModel;
|
|
37
9
|
constructor();
|
|
38
|
-
set model(m:
|
|
39
|
-
set configuration(c:
|
|
40
|
-
onModelChanged(model:
|
|
41
|
-
onConfigurationChanged(c:
|
|
10
|
+
set model(m: Partial<MathInlineModel>);
|
|
11
|
+
set configuration(c: MathInlineConfiguration);
|
|
12
|
+
onModelChanged(model: AuthorModel): void;
|
|
13
|
+
onConfigurationChanged(c: MathInlineConfiguration): void;
|
|
42
14
|
/**
|
|
43
15
|
*
|
|
44
16
|
* @param {done, progress, file} handler
|
|
45
17
|
*/
|
|
46
|
-
insertImage(handler:
|
|
47
|
-
onDeleteImage(src:
|
|
48
|
-
insertSound(handler:
|
|
49
|
-
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;
|
|
50
22
|
_render(): void;
|
|
51
23
|
connectedCallback(): void;
|
|
52
24
|
disconnectedCallback(): void;
|
package/dist/author/index.js
CHANGED
|
@@ -7,6 +7,9 @@ import { isEmpty as a } from "@pie-element/shared-lodash";
|
|
|
7
7
|
import { DeleteImageEvent as o, DeleteSoundEvent as s, InsertImageEvent as c, InsertSoundEvent as l, ModelUpdatedEvent as u } from "@pie-element/shared-configure-events";
|
|
8
8
|
//#region src/author/index.ts
|
|
9
9
|
var d = i("pie-elements:math-inline:configure"), f = class i extends HTMLElement {
|
|
10
|
+
_root;
|
|
11
|
+
_model;
|
|
12
|
+
_configuration;
|
|
10
13
|
static createDefaultModel = (e = {}) => (a(e.responses) || (e.responses = e.responses.map((e) => ({
|
|
11
14
|
...e,
|
|
12
15
|
validation: e.validation || t.model.validationDefault,
|
|
@@ -27,10 +30,15 @@ var d = i("pie-elements:math-inline:configure"), f = class i extends HTMLElement
|
|
|
27
30
|
...t.configuration,
|
|
28
31
|
...e
|
|
29
32
|
};
|
|
30
|
-
this._configuration = n, n?.language?.enabled
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
if (this._configuration = n, n?.language?.enabled) n?.languageChoices?.options?.length && (this._model.language = n?.languageChoices.options[0].value);
|
|
34
|
+
else if (n.language.settings && this._model.language) {
|
|
35
|
+
let e = this._configuration.language, t = this._configuration.languageChoices, n = this._model.language;
|
|
36
|
+
e.enabled = !0, (!t.options || !t.options.length) && (t.options = []), t.options.find((e) => e.value === n) || t.options.push({
|
|
37
|
+
value: n,
|
|
38
|
+
label: n
|
|
39
|
+
});
|
|
40
|
+
} else delete this._model.language;
|
|
41
|
+
this._render();
|
|
34
42
|
}
|
|
35
43
|
onModelChanged(e) {
|
|
36
44
|
this._model = e, d("[onModelChanged]: ", this._model), this._render(), this.dispatchEvent(new u(this._model));
|
package/dist/author/utils.d.ts
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
|
+
import type { EditableHtmlConfigureProp } from '@pie-element/shared-types';
|
|
2
|
+
import type { MathInlineConfiguration, MathInlineModel } from '../types.js';
|
|
1
3
|
export declare const ResponseTypes: {
|
|
2
|
-
advanced:
|
|
3
|
-
simple:
|
|
4
|
+
readonly advanced: "Advanced Multi";
|
|
5
|
+
readonly simple: "Simple";
|
|
6
|
+
};
|
|
7
|
+
export declare const generateValidationMessage: (model?: Partial<MathInlineModel>, config?: MathInlineConfiguration) => string;
|
|
8
|
+
export declare const getPluginProps: (props?: EditableHtmlConfigureProp, baseInputConfiguration?: EditableHtmlConfigureProp) => {
|
|
9
|
+
math?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
10
|
+
audio?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
11
|
+
video?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
12
|
+
image?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
13
|
+
customPlugins?: import("@pie-element/shared-types").CustomPlugin[];
|
|
14
|
+
blockquote?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
15
|
+
h3?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
16
|
+
characters?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
17
|
+
bold?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
18
|
+
html?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
19
|
+
italic?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
20
|
+
ol_list?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
21
|
+
redo?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
22
|
+
strikethrough?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
23
|
+
sub?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
24
|
+
sup?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
25
|
+
table?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
26
|
+
ul_list?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
27
|
+
underline?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
28
|
+
undo?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
29
|
+
textAlign?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
30
|
+
showParagraphs?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
31
|
+
separateParagraphs?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
32
|
+
pasteFormatting?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
33
|
+
superscript?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
34
|
+
subscript?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
35
|
+
languageCharacters?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
36
|
+
responseArea?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
4
37
|
};
|
|
5
|
-
export declare const generateValidationMessage: (model?: {}, config?: {}) => string;
|
|
6
|
-
export declare const getPluginProps: (props?: {}, baseInputConfiguration?: {}) => {};
|
|
@@ -27848,15 +27848,12 @@ var PF = class extends F.Component {
|
|
|
27848
27848
|
}), RF = (e) => typeof e == "string" ? {
|
|
27849
27849
|
label: e,
|
|
27850
27850
|
value: e
|
|
27851
|
-
} : e, zF =
|
|
27852
|
-
|
|
27853
|
-
|
|
27854
|
-
|
|
27855
|
-
|
|
27856
|
-
|
|
27857
|
-
isConfigProperty: n
|
|
27858
|
-
};
|
|
27859
|
-
}, BF = (e, t, n = !1) => ({
|
|
27851
|
+
} : e, zF = (e, t, n = !1) => ({
|
|
27852
|
+
type: "radio",
|
|
27853
|
+
label: e,
|
|
27854
|
+
choices: t && t.map((e) => RF(e)),
|
|
27855
|
+
isConfigProperty: n
|
|
27856
|
+
}), BF = (e, t, n = !1) => ({
|
|
27860
27857
|
type: "dropdown",
|
|
27861
27858
|
label: e,
|
|
27862
27859
|
choices: t,
|
|
@@ -28502,14 +28499,6 @@ var MI = class extends P.Component {
|
|
|
28502
28499
|
color: e.palette.error.main,
|
|
28503
28500
|
paddingTop: e.spacing(1)
|
|
28504
28501
|
})), BI = class extends F.Component {
|
|
28505
|
-
static propTypes = {
|
|
28506
|
-
onModelChanged: z.default.func,
|
|
28507
|
-
onConfigurationChanged: z.default.func,
|
|
28508
|
-
model: z.default.object.isRequired,
|
|
28509
|
-
configuration: z.default.object.isRequired,
|
|
28510
|
-
imageSupport: z.default.object,
|
|
28511
|
-
uploadSoundSupport: z.default.object
|
|
28512
|
-
};
|
|
28513
28502
|
onChange = (e) => {
|
|
28514
28503
|
this.props.onModelChanged(e);
|
|
28515
28504
|
};
|
|
@@ -28583,8 +28572,7 @@ var MI = class extends P.Component {
|
|
|
28583
28572
|
onChange: this.onChange,
|
|
28584
28573
|
rationaleEnabled: ne,
|
|
28585
28574
|
promptEnabled: te,
|
|
28586
|
-
toolbarOpts: se
|
|
28587
|
-
spellCheck: re
|
|
28575
|
+
toolbarOpts: se
|
|
28588
28576
|
}),
|
|
28589
28577
|
E && /* @__PURE__ */ L(UN, {
|
|
28590
28578
|
feedback: e.feedback,
|
|
@@ -28794,6 +28782,9 @@ var MI = class extends P.Component {
|
|
|
28794
28782
|
}
|
|
28795
28783
|
}
|
|
28796
28784
|
}, qI = (0, Dt.default)("pie-elements:math-inline:configure"), JI = class e extends HTMLElement {
|
|
28785
|
+
_root;
|
|
28786
|
+
_model;
|
|
28787
|
+
_configuration;
|
|
28797
28788
|
static createDefaultModel = (e = {}) => (p(e.responses) || (e.responses = e.responses.map((e) => ({
|
|
28798
28789
|
...e,
|
|
28799
28790
|
validation: e.validation || KI.model.validationDefault,
|
|
@@ -28814,10 +28805,15 @@ var MI = class extends P.Component {
|
|
|
28814
28805
|
...KI.configuration,
|
|
28815
28806
|
...e
|
|
28816
28807
|
};
|
|
28817
|
-
this._configuration = t, t?.language?.enabled
|
|
28818
|
-
|
|
28819
|
-
|
|
28820
|
-
|
|
28808
|
+
if (this._configuration = t, t?.language?.enabled) t?.languageChoices?.options?.length && (this._model.language = t?.languageChoices.options[0].value);
|
|
28809
|
+
else if (t.language.settings && this._model.language) {
|
|
28810
|
+
let e = this._configuration.language, t = this._configuration.languageChoices, n = this._model.language;
|
|
28811
|
+
e.enabled = !0, (!t.options || !t.options.length) && (t.options = []), t.options.find((e) => e.value === n) || t.options.push({
|
|
28812
|
+
value: n,
|
|
28813
|
+
label: n
|
|
28814
|
+
});
|
|
28815
|
+
} else delete this._model.language;
|
|
28816
|
+
this._render();
|
|
28821
28817
|
}
|
|
28822
28818
|
onModelChanged(e) {
|
|
28823
28819
|
this._model = e, qI("[onModelChanged]: ", this._model), this._render(), this.dispatchEvent(new VI(this._model));
|