@pie-element/graphing 11.0.4-next.20261011174919 → 11.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 +84 -93
- package/dist/author/correct-response.d.ts +2 -0
- package/dist/author/correct-response.js +2 -0
- package/dist/author/defaults.d.ts +196 -80
- package/dist/author/graphing-config.d.ts +2 -0
- package/dist/author/graphing-config.js +2 -0
- package/dist/author/index.d.ts +18 -46
- package/dist/author/index.js +7 -2
- package/dist/browser/author/index.js +17 -19
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +125 -135
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +17 -19
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js +125 -135
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +18 -17
- package/dist/controller/index.d.ts +56 -16
- package/dist/controller/index.js +23 -20
- package/dist/controller/utils.d.ts +24 -28
- package/dist/controller/utils.js +77 -90
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +757 -0
- package/dist/schemas/model.schema.json +702 -0
- package/dist/schemas/session.schema.json +127 -0
- package/dist/types.d.ts +346 -0
- package/package.json +20 -16
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import type { DeleteDone, ImageHandler, SoundHandler } from '@pie-element/shared-configure-events';
|
|
3
|
+
import type { GraphingValidationErrors } from '../controller/index.js';
|
|
4
|
+
import type { GraphingConfiguration, GraphingModel } from '../types.js';
|
|
5
|
+
/** The model the author edits; the host sets `errors` from the controller's `validate()`. */
|
|
6
|
+
export type AuthorModel = Partial<GraphingModel> & {
|
|
7
|
+
errors?: GraphingValidationErrors;
|
|
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: GraphingConfiguration;
|
|
16
|
+
onModelChanged: (model: AuthorModel) => void;
|
|
17
|
+
onConfigurationChanged: (configuration: GraphingConfiguration) => void;
|
|
18
|
+
imageSupport?: MediaSupport<ImageHandler>;
|
|
19
|
+
uploadSoundSupport?: MediaSupport<SoundHandler>;
|
|
20
|
+
};
|
|
21
|
+
export declare class Configure extends React.Component<ConfigureProps> {
|
|
12
22
|
componentDidMount(): void;
|
|
13
|
-
onRationaleChange:
|
|
14
|
-
onPromptChange:
|
|
15
|
-
onTeacherInstructionsChange:
|
|
23
|
+
onRationaleChange: (rationale: string) => void;
|
|
24
|
+
onPromptChange: (prompt: string) => void;
|
|
25
|
+
onTeacherInstructionsChange: (teacherInstructions: string) => void;
|
|
16
26
|
render(): React.JSX.Element;
|
|
17
27
|
}
|
|
18
28
|
export default Configure;
|
package/dist/author/configure.js
CHANGED
|
@@ -1,34 +1,25 @@
|
|
|
1
1
|
import { GraphingConfig as e } from "./graphing-config.js";
|
|
2
2
|
import { CorrectResponse as t } from "./correct-response.js";
|
|
3
3
|
import n from "react";
|
|
4
|
-
import r from "
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import s from "
|
|
8
|
-
import
|
|
9
|
-
import l from "@
|
|
10
|
-
import
|
|
11
|
-
import p from "@pie-lib/editable-html-tip-tap";
|
|
4
|
+
import { styled as r } from "@mui/material/styles";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import o from "debug";
|
|
7
|
+
import { intersection as s } from "@pie-element/shared-lodash";
|
|
8
|
+
import c from "@mui/material/Typography";
|
|
9
|
+
import { InputContainer as l, layout as u, settings as d } from "@pie-lib/config-ui";
|
|
10
|
+
import f from "@pie-lib/editable-html-tip-tap";
|
|
12
11
|
//#region src/author/configure.tsx
|
|
13
|
-
var { Panel:
|
|
12
|
+
var { Panel: p, toggle: m, radio: ee, checkboxes: te, textField: ne, dropdown: re } = d, ie = o("@pie-element:graphing:configure"), h = r(l)(({ theme: e }) => ({
|
|
14
13
|
width: "100%",
|
|
15
14
|
paddingTop: e.spacing(2),
|
|
16
15
|
marginBottom: e.spacing(2)
|
|
17
|
-
})),
|
|
16
|
+
})), g = r(c)(({ theme: e }) => ({ marginBottom: e.spacing(2.5) })), _ = r("div")(({ theme: e }) => ({
|
|
18
17
|
fontSize: e.typography.fontSize - 2,
|
|
19
18
|
color: e.palette.error.main,
|
|
20
19
|
paddingTop: e.spacing(1)
|
|
21
20
|
})), v = class extends n.Component {
|
|
22
|
-
static propTypes = {
|
|
23
|
-
onModelChanged: r.func,
|
|
24
|
-
onConfigurationChanged: r.func,
|
|
25
|
-
imageSupport: r.object,
|
|
26
|
-
uploadSoundSupport: r.object,
|
|
27
|
-
model: r.object.isRequired,
|
|
28
|
-
configuration: r.object.isRequired
|
|
29
|
-
};
|
|
30
21
|
componentDidMount() {
|
|
31
|
-
let { configuration: e, onModelChanged: t, model: n } = this.props, { availableTools: r, title: i, graphDimensions: a } = e || {}, { arrows: o, titleEnabled:
|
|
22
|
+
let { configuration: e, onModelChanged: t, model: n } = this.props, { availableTools: r, title: i, graphDimensions: a } = e || {}, { arrows: o, titleEnabled: c, dimensionsEnabled: l } = n || {};
|
|
32
23
|
typeof o == "boolean" && (o = o ? {
|
|
33
24
|
left: !0,
|
|
34
25
|
right: !0,
|
|
@@ -40,7 +31,7 @@ var { Panel: ee, toggle: m, radio: h, checkboxes: te, textField: ne, dropdown: r
|
|
|
40
31
|
up: !1,
|
|
41
32
|
down: !1
|
|
42
33
|
});
|
|
43
|
-
let u =
|
|
34
|
+
let u = s(r || [], n.toolbarTools || []), d = c ?? i.enabled, f = l ?? a.enabled;
|
|
44
35
|
t && t({
|
|
45
36
|
...n,
|
|
46
37
|
arrows: o,
|
|
@@ -71,134 +62,134 @@ var { Panel: ee, toggle: m, radio: h, checkboxes: te, textField: ne, dropdown: r
|
|
|
71
62
|
});
|
|
72
63
|
};
|
|
73
64
|
render() {
|
|
74
|
-
let { model: n, configuration: r, onConfigurationChanged:
|
|
65
|
+
let { model: n, configuration: r, onConfigurationChanged: o, onModelChanged: s, imageSupport: c, uploadSoundSupport: l } = this.props, { arrows: d = {}, authoring: v = {}, availableTools: y = [], baseInputConfiguration: b = {}, coordinatesOnHover: x = {}, contentDimensions: ae = {}, gridConfigurations: oe = [], graphDimensions: S = {}, instruction: C = {}, labels: w = {}, padding: T = {}, prompt: E = {}, rationale: D = {}, scoringType: O = {}, settingsPanelDisabled: k, spellCheck: A = {}, studentInstructions: j = {}, teacherInstructions: M = {}, title: N = {}, maxImageWidth: P = {}, maxImageHeight: F = {}, withRubric: I = {}, language: L = {}, languageChoices: R = {}, mathMlOptions: z = {}, removeIncompleteTool: B = !1 } = r || {}, { errors: V = {}, extraCSSRules: H, labelsEnabled: U, dimensionsEnabled: W, promptEnabled: G, rationaleEnabled: K, spellCheckEnabled: q, teacherInstructionsEnabled: se, titleEnabled: ce } = n || {}, { prompt: J, rationale: Y, teacherInstructions: X } = V || {};
|
|
75
66
|
ie("[render] model", n);
|
|
76
|
-
let Z =
|
|
77
|
-
top:
|
|
78
|
-
right:
|
|
79
|
-
bottom:
|
|
80
|
-
left:
|
|
67
|
+
let Z = P && P.prompt, Q = F && F.prompt, le = {
|
|
68
|
+
top: w.top,
|
|
69
|
+
right: w.right,
|
|
70
|
+
bottom: w.bottom,
|
|
71
|
+
left: w.left
|
|
81
72
|
}, ue = {
|
|
82
|
-
arrows:
|
|
83
|
-
left:
|
|
84
|
-
right:
|
|
85
|
-
up:
|
|
86
|
-
down:
|
|
73
|
+
arrows: d.settings && te(d.label, {
|
|
74
|
+
left: d.left,
|
|
75
|
+
right: d.right,
|
|
76
|
+
up: d.up,
|
|
77
|
+
down: d.down
|
|
87
78
|
}),
|
|
88
|
-
titleEnabled:
|
|
89
|
-
padding:
|
|
90
|
-
labelsEnabled:
|
|
91
|
-
"language.enabled":
|
|
92
|
-
language:
|
|
93
|
-
dimensionsEnabled:
|
|
94
|
-
coordinatesOnHover:
|
|
79
|
+
titleEnabled: N.settings && m(N.label),
|
|
80
|
+
padding: T.settings && m(T.label),
|
|
81
|
+
labelsEnabled: w.settings && m(w.label),
|
|
82
|
+
"language.enabled": L.settings && m(L.label, !0),
|
|
83
|
+
language: L.settings && L.enabled && re(R.label, R.options),
|
|
84
|
+
dimensionsEnabled: S.settings && m(S.label),
|
|
85
|
+
coordinatesOnHover: x.settings && m(x.label)
|
|
95
86
|
}, de = {
|
|
96
|
-
"authoring.enabled":
|
|
97
|
-
teacherInstructionsEnabled:
|
|
98
|
-
studentInstructionsEnabled:
|
|
99
|
-
promptEnabled:
|
|
100
|
-
rationaleEnabled:
|
|
101
|
-
spellCheckEnabled:
|
|
102
|
-
scoringType:
|
|
103
|
-
rubricEnabled:
|
|
104
|
-
instruction:
|
|
87
|
+
"authoring.enabled": v.settings && m(v.label, !0),
|
|
88
|
+
teacherInstructionsEnabled: M.settings && m(M.label),
|
|
89
|
+
studentInstructionsEnabled: j.settings && m(j.label),
|
|
90
|
+
promptEnabled: E.settings && m(E.label),
|
|
91
|
+
rationaleEnabled: D.settings && m(D.label),
|
|
92
|
+
spellCheckEnabled: A.settings && m(A.label),
|
|
93
|
+
scoringType: O.settings && ee(O.label, ["dichotomous", "partial scoring"]),
|
|
94
|
+
rubricEnabled: I?.settings && m(I?.label),
|
|
95
|
+
instruction: C.settings && ne(C.label)
|
|
105
96
|
}, $ = (e = {}) => ({
|
|
106
|
-
...
|
|
97
|
+
...b,
|
|
107
98
|
...e
|
|
108
99
|
});
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
-
extraCSSRules:
|
|
111
|
-
dimensions:
|
|
112
|
-
hideSettings:
|
|
113
|
-
settings: /* @__PURE__ */
|
|
100
|
+
return /* @__PURE__ */ a(u.ConfigLayout, {
|
|
101
|
+
extraCSSRules: H,
|
|
102
|
+
dimensions: ae,
|
|
103
|
+
hideSettings: k,
|
|
104
|
+
settings: /* @__PURE__ */ i(p, {
|
|
114
105
|
model: n,
|
|
115
106
|
configuration: r,
|
|
116
107
|
onChangeModel: s,
|
|
117
|
-
onChangeConfiguration:
|
|
108
|
+
onChangeConfiguration: o,
|
|
118
109
|
groups: {
|
|
119
110
|
Settings: ue,
|
|
120
111
|
Properties: de
|
|
121
112
|
}
|
|
122
113
|
}),
|
|
123
114
|
children: [
|
|
124
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ i(g, {
|
|
125
116
|
component: "div",
|
|
126
117
|
variant: "body1",
|
|
127
|
-
children:
|
|
118
|
+
children: C?.label || ""
|
|
128
119
|
}),
|
|
129
|
-
se && /* @__PURE__ */
|
|
130
|
-
label:
|
|
131
|
-
children: [/* @__PURE__ */
|
|
120
|
+
se && /* @__PURE__ */ a(h, {
|
|
121
|
+
label: M.label,
|
|
122
|
+
children: [/* @__PURE__ */ i(f, {
|
|
132
123
|
markup: n.teacherInstructions || "",
|
|
133
124
|
onChange: this.onTeacherInstructionsChange,
|
|
134
125
|
imageSupport: c,
|
|
135
126
|
error: X,
|
|
136
127
|
nonEmpty: !1,
|
|
137
|
-
pluginProps: $(
|
|
128
|
+
pluginProps: $(M?.inputConfiguration),
|
|
138
129
|
spellCheck: q,
|
|
139
|
-
maxImageWidth:
|
|
140
|
-
maxImageHeight:
|
|
130
|
+
maxImageWidth: P && P.teacherInstructions || Z,
|
|
131
|
+
maxImageHeight: F && F.teacherInstructions || Q,
|
|
141
132
|
uploadSoundSupport: l,
|
|
142
133
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
143
|
-
mathMlOptions:
|
|
144
|
-
}), X && /* @__PURE__ */
|
|
134
|
+
mathMlOptions: z
|
|
135
|
+
}), X && /* @__PURE__ */ i(_, { children: X })]
|
|
145
136
|
}),
|
|
146
|
-
|
|
147
|
-
label:
|
|
148
|
-
children: [/* @__PURE__ */
|
|
137
|
+
G && /* @__PURE__ */ a(h, {
|
|
138
|
+
label: E.label,
|
|
139
|
+
children: [/* @__PURE__ */ i(f, {
|
|
149
140
|
markup: n.prompt,
|
|
150
141
|
onChange: this.onPromptChange,
|
|
151
142
|
imageSupport: c,
|
|
152
143
|
error: J,
|
|
153
144
|
nonEmpty: !1,
|
|
154
145
|
spellCheck: q,
|
|
155
|
-
pluginProps: $(
|
|
146
|
+
pluginProps: $(E?.inputConfiguration),
|
|
156
147
|
disableUnderline: !0,
|
|
157
148
|
maxImageWidth: Z,
|
|
158
149
|
maxImageHeight: Q,
|
|
159
150
|
uploadSoundSupport: l,
|
|
160
151
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
161
|
-
mathMlOptions:
|
|
162
|
-
}), J && /* @__PURE__ */
|
|
152
|
+
mathMlOptions: z
|
|
153
|
+
}), J && /* @__PURE__ */ i(_, { children: J })]
|
|
163
154
|
}),
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
authoring:
|
|
166
|
-
availableTools:
|
|
167
|
-
gridConfigurations:
|
|
168
|
-
graphDimensions:
|
|
155
|
+
/* @__PURE__ */ i(e, {
|
|
156
|
+
authoring: v,
|
|
157
|
+
availableTools: y,
|
|
158
|
+
gridConfigurations: oe,
|
|
159
|
+
graphDimensions: S,
|
|
169
160
|
labelsPlaceholders: le,
|
|
170
161
|
model: n,
|
|
171
|
-
showLabels:
|
|
172
|
-
dimensionsEnabled:
|
|
162
|
+
showLabels: U,
|
|
163
|
+
dimensionsEnabled: W,
|
|
173
164
|
showTitle: ce,
|
|
174
|
-
titlePlaceholder:
|
|
165
|
+
titlePlaceholder: N.placeholder,
|
|
175
166
|
onChange: this.props.onModelChanged,
|
|
176
|
-
mathMlOptions:
|
|
177
|
-
removeIncompleteTool:
|
|
167
|
+
mathMlOptions: z,
|
|
168
|
+
removeIncompleteTool: B
|
|
178
169
|
}),
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
availableTools:
|
|
181
|
-
errors:
|
|
170
|
+
/* @__PURE__ */ i(t, {
|
|
171
|
+
availableTools: y,
|
|
172
|
+
errors: V,
|
|
182
173
|
model: n,
|
|
183
174
|
onChange: this.props.onModelChanged,
|
|
184
|
-
mathMlOptions:
|
|
185
|
-
removeIncompleteTool:
|
|
175
|
+
mathMlOptions: z,
|
|
176
|
+
removeIncompleteTool: B
|
|
186
177
|
}),
|
|
187
|
-
|
|
188
|
-
label:
|
|
189
|
-
children: [/* @__PURE__ */
|
|
178
|
+
K && /* @__PURE__ */ a(h, {
|
|
179
|
+
label: D.label || "Rationale",
|
|
180
|
+
children: [/* @__PURE__ */ i(f, {
|
|
190
181
|
markup: n.rationale || "",
|
|
191
182
|
onChange: this.onRationaleChange,
|
|
192
183
|
imageSupport: c,
|
|
193
184
|
error: Y,
|
|
194
185
|
spellCheck: q,
|
|
195
|
-
pluginProps: $(
|
|
196
|
-
maxImageWidth:
|
|
197
|
-
maxImageHeight:
|
|
186
|
+
pluginProps: $(D?.inputConfiguration),
|
|
187
|
+
maxImageWidth: P && P.rationale || Z,
|
|
188
|
+
maxImageHeight: F && F.rationale || Q,
|
|
198
189
|
uploadSoundSupport: l,
|
|
199
190
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
200
|
-
mathMlOptions:
|
|
201
|
-
}), Y && /* @__PURE__ */
|
|
191
|
+
mathMlOptions: z
|
|
192
|
+
}), Y && /* @__PURE__ */ i(_, { children: Y })]
|
|
202
193
|
})
|
|
203
194
|
]
|
|
204
195
|
});
|
|
@@ -22,8 +22,10 @@ export declare class CorrectResponse extends React.Component {
|
|
|
22
22
|
static propTypes: {
|
|
23
23
|
availableTools: PropTypes.Requireable<any[]>;
|
|
24
24
|
errors: PropTypes.Requireable<object>;
|
|
25
|
+
mathMlOptions: PropTypes.Requireable<object>;
|
|
25
26
|
model: PropTypes.Validator<object>;
|
|
26
27
|
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
28
|
+
removeIncompleteTool: PropTypes.Requireable<boolean>;
|
|
27
29
|
toolbarTools: PropTypes.Requireable<unknown[]>;
|
|
28
30
|
};
|
|
29
31
|
state: {
|
|
@@ -104,8 +104,10 @@ var P = class extends e.Component {
|
|
|
104
104
|
static propTypes = {
|
|
105
105
|
availableTools: n.array,
|
|
106
106
|
errors: n.object,
|
|
107
|
+
mathMlOptions: n.object,
|
|
107
108
|
model: n.object.isRequired,
|
|
108
109
|
onChange: n.func.isRequired,
|
|
110
|
+
removeIncompleteTool: n.bool,
|
|
109
111
|
toolbarTools: n.arrayOf(n.String)
|
|
110
112
|
};
|
|
111
113
|
state = { dialog: { open: !1 } };
|