@pie-element/matrix 5.0.4-next.20261011174919 → 5.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/Main.d.ts +27 -15
- package/dist/author/Main.js +39 -50
- package/dist/author/defaults.d.ts +24 -24
- package/dist/author/index.d.ts +16 -18
- package/dist/author/index.js +4 -0
- package/dist/browser/author/index.js +10 -19
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +10 -19
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +4 -4
- package/dist/controller/index.d.ts +22 -5
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +263 -0
- package/dist/schemas/model.schema.json +360 -0
- package/dist/schemas/session.schema.json +23 -0
- package/dist/types.d.ts +67 -0
- package/package.json +16 -12
package/dist/author/Main.d.ts
CHANGED
|
@@ -1,19 +1,31 @@
|
|
|
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 { MatrixValidationErrors } from '../controller/index.js';
|
|
4
|
+
import type { MatrixConfiguration, MatrixModel } from '../types.js';
|
|
5
|
+
/** The model the author edits; the host sets `errors` from the controller's `validate()`. */
|
|
6
|
+
export type AuthorModel = Partial<MatrixModel> & {
|
|
7
|
+
columnLabels: string[];
|
|
8
|
+
rowLabels: string[];
|
|
9
|
+
matrixValues: Record<string, number>;
|
|
10
|
+
errors?: MatrixValidationErrors;
|
|
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: MatrixConfiguration;
|
|
19
|
+
disableSidePanel?: boolean;
|
|
20
|
+
onModelChanged: (model: AuthorModel, reset?: boolean) => void;
|
|
21
|
+
onConfigurationChanged: (configuration: MatrixConfiguration) => void;
|
|
22
|
+
imageSupport?: MediaSupport<ImageHandler>;
|
|
23
|
+
uploadSoundSupport?: MediaSupport<SoundHandler>;
|
|
24
|
+
};
|
|
25
|
+
export declare class Main extends React.Component<MainProps> {
|
|
26
|
+
onPromptChanged: (prompt: string) => void;
|
|
27
|
+
onChangeModel: (data: Partial<AuthorModel>) => void;
|
|
28
|
+
onTeacherInstructionsChanged: (teacherInstructions: string) => void;
|
|
17
29
|
render(): React.JSX.Element;
|
|
18
30
|
}
|
|
19
31
|
export default Main;
|
package/dist/author/Main.js
CHANGED
|
@@ -3,106 +3,95 @@ import t from "./MatrixRowsSizeHeaderInput.js";
|
|
|
3
3
|
import n from "./MatrixLabelTypeHeaderInput.js";
|
|
4
4
|
import r from "./MatrixValues.js";
|
|
5
5
|
import i from "react";
|
|
6
|
-
import a from "
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import l from "@pie-lib/
|
|
10
|
-
import { InputContainer as u, layout as d, settings as f } from "@pie-lib/config-ui";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { styled as s } from "@mui/material/styles";
|
|
8
|
+
import c from "@pie-lib/editable-html-tip-tap";
|
|
9
|
+
import { InputContainer as l, layout as u, settings as d } from "@pie-lib/config-ui";
|
|
11
10
|
//#region src/author/Main.tsx
|
|
12
|
-
var { Panel:
|
|
11
|
+
var { Panel: f, toggle: p, radio: m } = d, h = s(l)(({ theme: e }) => ({
|
|
13
12
|
width: "100%",
|
|
14
13
|
paddingTop: e.spacing(1),
|
|
15
14
|
marginTop: e.spacing(2),
|
|
16
15
|
marginBottom: e.spacing(2)
|
|
17
|
-
})),
|
|
16
|
+
})), g = s("div")(({ theme: e }) => ({
|
|
18
17
|
display: "flex",
|
|
19
18
|
flexWrap: "wrap",
|
|
20
19
|
width: "100%",
|
|
21
20
|
paddingBottom: e.spacing(2.5),
|
|
22
21
|
justifyContent: "space-around"
|
|
23
|
-
})),
|
|
22
|
+
})), _ = s("div")(({ theme: e }) => ({
|
|
24
23
|
fontSize: e.typography.fontSize - 2,
|
|
25
24
|
color: e.palette.error.main,
|
|
26
25
|
paddingTop: e.spacing(1)
|
|
27
|
-
})),
|
|
28
|
-
let { model:
|
|
29
|
-
teacherInstructionsEnabled: k.settings &&
|
|
30
|
-
spellCheckEnabled: O.settings &&
|
|
31
|
-
scoringType: E.settings &&
|
|
26
|
+
})), v = (i) => {
|
|
27
|
+
let { model: s, configuration: l, onPromptChanged: d, imageSupport: v, uploadSoundSupport: y, onChangeModel: b, onConfigurationChanged: x, onTeacherInstructionsChanged: S } = i, { baseInputConfiguration: C = {}, contentDimensions: w = {}, prompt: T = {}, scoringType: E = {}, settingsPanelDisabled: D, spellCheck: O = {}, teacherInstructions: k = {} } = l || {}, { errors: A = {}, extraCSSRules: j, teacherInstructionsEnabled: M, spellCheckEnabled: N } = s || {}, { prompt: P, teacherInstructions: F } = A, I = {
|
|
28
|
+
teacherInstructionsEnabled: k.settings && p(k.label),
|
|
29
|
+
spellCheckEnabled: O.settings && p(O.label),
|
|
30
|
+
scoringType: E.settings && m(E.label, ["auto", "rubric"])
|
|
32
31
|
}, L = (e = {}) => ({
|
|
33
32
|
...C,
|
|
34
33
|
...e
|
|
35
34
|
});
|
|
36
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ o(u.ConfigLayout, {
|
|
37
36
|
extraCSSRules: j,
|
|
38
37
|
dimensions: w,
|
|
39
38
|
hideSettings: D,
|
|
40
|
-
settings: /* @__PURE__ */
|
|
41
|
-
model:
|
|
39
|
+
settings: /* @__PURE__ */ a(f, {
|
|
40
|
+
model: s,
|
|
42
41
|
onChangeModel: b,
|
|
43
|
-
configuration:
|
|
42
|
+
configuration: l,
|
|
44
43
|
onChangeConfiguration: x,
|
|
45
44
|
groups: { Properties: I }
|
|
46
45
|
}),
|
|
47
46
|
children: [
|
|
48
|
-
M && /* @__PURE__ */
|
|
47
|
+
M && /* @__PURE__ */ o(h, {
|
|
49
48
|
label: k.label,
|
|
50
|
-
children: [/* @__PURE__ */
|
|
51
|
-
markup:
|
|
49
|
+
children: [/* @__PURE__ */ a(c, {
|
|
50
|
+
markup: s.teacherInstructions || "",
|
|
52
51
|
onChange: S,
|
|
53
|
-
imageSupport:
|
|
52
|
+
imageSupport: v,
|
|
54
53
|
error: F,
|
|
55
54
|
pluginProps: L(k?.inputConfiguration),
|
|
56
55
|
nonEmpty: !1,
|
|
57
56
|
spellCheck: N,
|
|
58
57
|
uploadSoundSupport: y
|
|
59
|
-
}), F && /* @__PURE__ */
|
|
58
|
+
}), F && /* @__PURE__ */ a(_, { children: F })]
|
|
60
59
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ o(h, {
|
|
62
61
|
label: T.label,
|
|
63
|
-
children: [/* @__PURE__ */
|
|
64
|
-
markup:
|
|
65
|
-
onChange:
|
|
66
|
-
imageSupport:
|
|
62
|
+
children: [/* @__PURE__ */ a(c, {
|
|
63
|
+
markup: s.prompt,
|
|
64
|
+
onChange: d,
|
|
65
|
+
imageSupport: v,
|
|
67
66
|
error: P,
|
|
68
67
|
pluginProps: L(T?.inputConfiguration),
|
|
69
68
|
nonEmpty: !T.settings,
|
|
70
69
|
spellCheck: N,
|
|
71
70
|
uploadSoundSupport: y,
|
|
72
71
|
disableUnderline: !0
|
|
73
|
-
}), P && /* @__PURE__ */
|
|
72
|
+
}), P && /* @__PURE__ */ a(_, { children: P })]
|
|
74
73
|
}),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
model:
|
|
74
|
+
/* @__PURE__ */ o(g, { children: [
|
|
75
|
+
/* @__PURE__ */ a(t, {
|
|
76
|
+
model: s,
|
|
78
77
|
onChangeModel: b
|
|
79
78
|
}),
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
model:
|
|
79
|
+
/* @__PURE__ */ a(e, {
|
|
80
|
+
model: s,
|
|
82
81
|
onChangeModel: b
|
|
83
82
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
model:
|
|
83
|
+
/* @__PURE__ */ a(n, {
|
|
84
|
+
model: s,
|
|
86
85
|
onChangeModel: b
|
|
87
86
|
})
|
|
88
87
|
] }),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
model:
|
|
88
|
+
/* @__PURE__ */ a(r, {
|
|
89
|
+
model: s,
|
|
91
90
|
onChangeModel: b
|
|
92
91
|
})
|
|
93
92
|
]
|
|
94
93
|
});
|
|
95
|
-
},
|
|
96
|
-
static propTypes = {
|
|
97
|
-
model: a.object.isRequired,
|
|
98
|
-
disableSidePanel: a.bool,
|
|
99
|
-
onModelChanged: a.func.isRequired,
|
|
100
|
-
onConfigurationChanged: a.func.isRequired,
|
|
101
|
-
imageSupport: a.shape({
|
|
102
|
-
add: a.func.isRequired,
|
|
103
|
-
delete: a.func.isRequired
|
|
104
|
-
})
|
|
105
|
-
};
|
|
94
|
+
}, y = class extends i.Component {
|
|
106
95
|
onPromptChanged = (e) => {
|
|
107
96
|
this.props.onModelChanged({
|
|
108
97
|
...this.props.model,
|
|
@@ -122,7 +111,7 @@ var { Panel: p, toggle: m, radio: h } = f, g = c(u)(({ theme: e }) => ({
|
|
|
122
111
|
});
|
|
123
112
|
};
|
|
124
113
|
render() {
|
|
125
|
-
return /* @__PURE__ */
|
|
114
|
+
return /* @__PURE__ */ a(v, {
|
|
126
115
|
...this.props,
|
|
127
116
|
onChangeModel: this.props.onModelChanged,
|
|
128
117
|
onPromptChanged: this.onPromptChanged,
|
|
@@ -131,4 +120,4 @@ var { Panel: p, toggle: m, radio: h } = f, g = c(u)(({ theme: e }) => ({
|
|
|
131
120
|
}
|
|
132
121
|
};
|
|
133
122
|
//#endregion
|
|
134
|
-
export {
|
|
123
|
+
export { y as Main, y as default };
|
|
@@ -5,75 +5,75 @@
|
|
|
5
5
|
declare const _default: {
|
|
6
6
|
model: {
|
|
7
7
|
columnLabels: string[];
|
|
8
|
-
labelType:
|
|
9
|
-
matrixValues:
|
|
8
|
+
labelType: "agreement";
|
|
9
|
+
matrixValues: Record<string, number>;
|
|
10
10
|
prompt: string;
|
|
11
|
-
promptEnabled:
|
|
11
|
+
promptEnabled: true;
|
|
12
12
|
rowLabels: string[];
|
|
13
13
|
teacherInstructions: string;
|
|
14
|
-
teacherInstructionsEnabled:
|
|
14
|
+
teacherInstructionsEnabled: true;
|
|
15
15
|
};
|
|
16
16
|
configuration: {
|
|
17
17
|
baseInputConfiguration: {
|
|
18
18
|
h3: {
|
|
19
|
-
disabled:
|
|
19
|
+
disabled: true;
|
|
20
20
|
};
|
|
21
21
|
audio: {
|
|
22
|
-
disabled:
|
|
22
|
+
disabled: false;
|
|
23
23
|
};
|
|
24
24
|
video: {
|
|
25
|
-
disabled:
|
|
25
|
+
disabled: false;
|
|
26
26
|
};
|
|
27
27
|
image: {
|
|
28
|
-
disabled:
|
|
28
|
+
disabled: false;
|
|
29
29
|
};
|
|
30
30
|
textAlign: {
|
|
31
|
-
disabled:
|
|
31
|
+
disabled: true;
|
|
32
32
|
};
|
|
33
33
|
showParagraphs: {
|
|
34
|
-
disabled:
|
|
34
|
+
disabled: false;
|
|
35
35
|
};
|
|
36
36
|
separateParagraphs: {
|
|
37
|
-
disabled:
|
|
37
|
+
disabled: true;
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
prompt: {
|
|
41
|
-
settings:
|
|
41
|
+
settings: true;
|
|
42
42
|
label: string;
|
|
43
43
|
inputConfiguration: {
|
|
44
44
|
audio: {
|
|
45
|
-
disabled:
|
|
45
|
+
disabled: false;
|
|
46
46
|
};
|
|
47
47
|
video: {
|
|
48
|
-
disabled:
|
|
48
|
+
disabled: false;
|
|
49
49
|
};
|
|
50
50
|
image: {
|
|
51
|
-
disabled:
|
|
51
|
+
disabled: false;
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
|
-
required:
|
|
54
|
+
required: false;
|
|
55
55
|
};
|
|
56
|
-
settingsPanelDisabled:
|
|
56
|
+
settingsPanelDisabled: false;
|
|
57
57
|
spellCheck: {
|
|
58
58
|
label: string;
|
|
59
|
-
settings:
|
|
60
|
-
enabled:
|
|
59
|
+
settings: false;
|
|
60
|
+
enabled: true;
|
|
61
61
|
};
|
|
62
62
|
teacherInstructions: {
|
|
63
|
-
settings:
|
|
63
|
+
settings: true;
|
|
64
64
|
label: string;
|
|
65
65
|
inputConfiguration: {
|
|
66
66
|
audio: {
|
|
67
|
-
disabled:
|
|
67
|
+
disabled: false;
|
|
68
68
|
};
|
|
69
69
|
video: {
|
|
70
|
-
disabled:
|
|
70
|
+
disabled: false;
|
|
71
71
|
};
|
|
72
72
|
image: {
|
|
73
|
-
disabled:
|
|
73
|
+
disabled: false;
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
|
-
required:
|
|
76
|
+
required: false;
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
79
|
};
|
package/dist/author/index.d.ts
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
+
import { type DeleteDone, type SoundHandler } from '@pie-element/shared-configure-events';
|
|
2
|
+
import { type AuthorModel } from './Main.js';
|
|
3
|
+
import type { MatrixConfiguration, MatrixModel } from '../types.js';
|
|
1
4
|
export default class Matrix extends HTMLElement {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
promptEnabled: boolean;
|
|
8
|
-
rowLabels: string[];
|
|
9
|
-
teacherInstructions: string;
|
|
10
|
-
teacherInstructionsEnabled: boolean;
|
|
11
|
-
};
|
|
5
|
+
private _root;
|
|
6
|
+
private _model;
|
|
7
|
+
private _configuration;
|
|
8
|
+
private _disableSidePanel?;
|
|
9
|
+
static createDefaultModel: (model?: Partial<MatrixModel>) => AuthorModel;
|
|
12
10
|
constructor();
|
|
13
|
-
set model(s:
|
|
14
|
-
set configuration(c:
|
|
15
|
-
set disableSidePanel(s:
|
|
16
|
-
dispatchModelUpdated(reset
|
|
17
|
-
onModelChanged(m:
|
|
18
|
-
onConfigurationChanged(c:
|
|
19
|
-
insertSound(handler:
|
|
20
|
-
onDeleteSound(src:
|
|
11
|
+
set model(s: Partial<MatrixModel>);
|
|
12
|
+
set configuration(c: MatrixConfiguration);
|
|
13
|
+
set disableSidePanel(s: boolean);
|
|
14
|
+
dispatchModelUpdated(reset?: boolean): void;
|
|
15
|
+
onModelChanged(m: AuthorModel, reset?: boolean): void;
|
|
16
|
+
onConfigurationChanged(c: MatrixConfiguration): void;
|
|
17
|
+
insertSound(handler: SoundHandler): void;
|
|
18
|
+
onDeleteSound(src: string, done: DeleteDone): void;
|
|
21
19
|
_render(): void;
|
|
22
20
|
connectedCallback(): void;
|
|
23
21
|
disconnectedCallback(): void;
|
package/dist/author/index.js
CHANGED
|
@@ -10,6 +10,10 @@ var l = a("matrix:configure"), u = (e, n) => ({
|
|
|
10
10
|
configuration: i(e, t.configuration),
|
|
11
11
|
model: n
|
|
12
12
|
}), d = class i extends HTMLElement {
|
|
13
|
+
_root;
|
|
14
|
+
_model;
|
|
15
|
+
_configuration;
|
|
16
|
+
_disableSidePanel;
|
|
13
17
|
static createDefaultModel = (e = {}) => ({
|
|
14
18
|
...t.model,
|
|
15
19
|
...e
|
|
@@ -34890,15 +34890,12 @@ var rW = class extends mt.Component {
|
|
|
34890
34890
|
}), sW = (e) => typeof e == "string" ? {
|
|
34891
34891
|
label: e,
|
|
34892
34892
|
value: e
|
|
34893
|
-
} : e, cW =
|
|
34894
|
-
|
|
34895
|
-
|
|
34896
|
-
|
|
34897
|
-
|
|
34898
|
-
|
|
34899
|
-
isConfigProperty: n
|
|
34900
|
-
};
|
|
34901
|
-
}, lW = (e, t, n = !1) => ({
|
|
34893
|
+
} : e, cW = (e, t, n = !1) => ({
|
|
34894
|
+
type: "radio",
|
|
34895
|
+
label: e,
|
|
34896
|
+
choices: t && t.map((e) => sW(e)),
|
|
34897
|
+
isConfigProperty: n
|
|
34898
|
+
}), lW = (e, t, n = !1) => ({
|
|
34902
34899
|
type: "dropdown",
|
|
34903
34900
|
label: e,
|
|
34904
34901
|
choices: t,
|
|
@@ -35670,16 +35667,6 @@ var { Panel: kG, toggle: AG, radio: jG } = iW, MG = A(yW)(({ theme: e }) => ({
|
|
|
35670
35667
|
]
|
|
35671
35668
|
});
|
|
35672
35669
|
}, IG = class extends mt.Component {
|
|
35673
|
-
static propTypes = {
|
|
35674
|
-
model: V.default.object.isRequired,
|
|
35675
|
-
disableSidePanel: V.default.bool,
|
|
35676
|
-
onModelChanged: V.default.func.isRequired,
|
|
35677
|
-
onConfigurationChanged: V.default.func.isRequired,
|
|
35678
|
-
imageSupport: V.default.shape({
|
|
35679
|
-
add: V.default.func.isRequired,
|
|
35680
|
-
delete: V.default.func.isRequired
|
|
35681
|
-
})
|
|
35682
|
-
};
|
|
35683
35670
|
onPromptChanged = (e) => {
|
|
35684
35671
|
this.props.onModelChanged({
|
|
35685
35672
|
...this.props.model,
|
|
@@ -35762,6 +35749,10 @@ var { Panel: kG, toggle: AG, radio: jG } = iW, MG = A(yW)(({ theme: e }) => ({
|
|
|
35762
35749
|
configuration: dt(e, LG.configuration),
|
|
35763
35750
|
model: t
|
|
35764
35751
|
}), BG = class e extends HTMLElement {
|
|
35752
|
+
_root;
|
|
35753
|
+
_model;
|
|
35754
|
+
_configuration;
|
|
35755
|
+
_disableSidePanel;
|
|
35765
35756
|
static createDefaultModel = (e = {}) => ({
|
|
35766
35757
|
...LG.model,
|
|
35767
35758
|
...e
|