@pie-element/fraction-model 7.0.4-next.20261011174919 → 7.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 +37 -32
- package/dist/author/index.d.ts +19 -21
- package/dist/author/index.js +13 -6
- package/dist/author/main.d.ts +34 -12
- package/dist/author/main.js +30 -38
- package/dist/browser/author/index.js +13 -13
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +13 -13
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js +1 -1
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +5 -4
- package/dist/controller/index.d.ts +47 -8
- package/dist/controller/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +389 -0
- package/dist/schemas/model.schema.json +372 -0
- package/dist/schemas/session.schema.json +79 -0
- package/dist/types.d.ts +169 -0
- package/package.json +17 -13
|
@@ -1,67 +1,69 @@
|
|
|
1
|
+
import type { ConfigureLanguageOptionsProp } from '@pie-element/shared-types';
|
|
2
|
+
import type { FractionModelResponse } from '../types.js';
|
|
1
3
|
declare const _default: {
|
|
2
4
|
model: {
|
|
3
|
-
correctResponse:
|
|
5
|
+
correctResponse: FractionModelResponse[];
|
|
4
6
|
title: string;
|
|
5
7
|
prompt: string;
|
|
6
|
-
modelTypeSelected:
|
|
8
|
+
modelTypeSelected: "bar";
|
|
7
9
|
maxModelSelected: number;
|
|
8
10
|
partsPerModel: number;
|
|
9
|
-
allowedStudentConfig:
|
|
10
|
-
showGraphLabels:
|
|
11
|
+
allowedStudentConfig: false;
|
|
12
|
+
showGraphLabels: false;
|
|
11
13
|
};
|
|
12
14
|
configuration: {
|
|
13
15
|
baseInputConfiguration: {
|
|
14
16
|
h3: {
|
|
15
|
-
disabled:
|
|
17
|
+
disabled: true;
|
|
16
18
|
};
|
|
17
19
|
audio: {
|
|
18
|
-
disabled:
|
|
20
|
+
disabled: false;
|
|
19
21
|
};
|
|
20
22
|
video: {
|
|
21
|
-
disabled:
|
|
23
|
+
disabled: false;
|
|
22
24
|
};
|
|
23
25
|
image: {
|
|
24
|
-
disabled:
|
|
26
|
+
disabled: false;
|
|
25
27
|
};
|
|
26
28
|
textAlign: {
|
|
27
|
-
disabled:
|
|
29
|
+
disabled: true;
|
|
28
30
|
};
|
|
29
31
|
showParagraphs: {
|
|
30
|
-
disabled:
|
|
32
|
+
disabled: false;
|
|
31
33
|
};
|
|
32
34
|
separateParagraphs: {
|
|
33
|
-
disabled:
|
|
35
|
+
disabled: true;
|
|
34
36
|
};
|
|
35
37
|
};
|
|
36
38
|
title: {
|
|
37
39
|
label: string;
|
|
38
|
-
settings:
|
|
39
|
-
enabled:
|
|
40
|
+
settings: true;
|
|
41
|
+
enabled: true;
|
|
40
42
|
inputConfiguration: {
|
|
41
43
|
audio: {
|
|
42
|
-
disabled:
|
|
44
|
+
disabled: false;
|
|
43
45
|
};
|
|
44
46
|
video: {
|
|
45
|
-
disabled:
|
|
47
|
+
disabled: false;
|
|
46
48
|
};
|
|
47
49
|
image: {
|
|
48
|
-
disabled:
|
|
50
|
+
disabled: false;
|
|
49
51
|
};
|
|
50
52
|
};
|
|
51
53
|
};
|
|
52
54
|
prompt: {
|
|
53
55
|
label: string;
|
|
54
|
-
settings:
|
|
55
|
-
enabled:
|
|
56
|
+
settings: true;
|
|
57
|
+
enabled: true;
|
|
56
58
|
inputConfiguration: {
|
|
57
59
|
audio: {
|
|
58
|
-
disabled:
|
|
60
|
+
disabled: false;
|
|
59
61
|
};
|
|
60
62
|
video: {
|
|
61
|
-
disabled:
|
|
63
|
+
disabled: false;
|
|
62
64
|
};
|
|
63
65
|
image: {
|
|
64
|
-
disabled:
|
|
66
|
+
disabled: false;
|
|
65
67
|
};
|
|
66
68
|
};
|
|
67
69
|
};
|
|
@@ -76,30 +78,33 @@ declare const _default: {
|
|
|
76
78
|
max: number;
|
|
77
79
|
default: number;
|
|
78
80
|
};
|
|
79
|
-
modelTypeChoices: {
|
|
80
|
-
value:
|
|
81
|
+
modelTypeChoices: ({
|
|
82
|
+
value: "bar";
|
|
81
83
|
label: string;
|
|
82
|
-
}
|
|
84
|
+
} | {
|
|
85
|
+
value: "pie";
|
|
86
|
+
label: string;
|
|
87
|
+
})[];
|
|
83
88
|
};
|
|
84
89
|
mathMlOptions: {
|
|
85
|
-
mmlOutput:
|
|
86
|
-
mmlEditing:
|
|
90
|
+
mmlOutput: false;
|
|
91
|
+
mmlEditing: false;
|
|
87
92
|
};
|
|
88
93
|
language: {
|
|
89
|
-
settings:
|
|
94
|
+
settings: false;
|
|
90
95
|
label: string;
|
|
91
|
-
enabled:
|
|
96
|
+
enabled: false;
|
|
92
97
|
};
|
|
93
98
|
languageChoices: {
|
|
94
99
|
label: string;
|
|
95
|
-
options:
|
|
100
|
+
options: ConfigureLanguageOptionsProp[];
|
|
96
101
|
};
|
|
97
102
|
spellCheck: {
|
|
98
103
|
label: string;
|
|
99
|
-
settings:
|
|
100
|
-
enabled:
|
|
104
|
+
settings: false;
|
|
105
|
+
enabled: true;
|
|
101
106
|
};
|
|
102
|
-
settingsPanelDisabled:
|
|
107
|
+
settingsPanelDisabled: true;
|
|
103
108
|
};
|
|
104
109
|
};
|
|
105
110
|
export default _default;
|
package/dist/author/index.d.ts
CHANGED
|
@@ -1,36 +1,34 @@
|
|
|
1
|
+
import { type AuthorModel } from './main.js';
|
|
2
|
+
import { type DeleteDone, type ImageHandler, type SoundHandler } from '@pie-element/shared-configure-events';
|
|
3
|
+
import type { FractionModelConfiguration, FractionModelModel } from '../types.js';
|
|
1
4
|
export default class FractionModelConfigure extends HTMLElement {
|
|
5
|
+
private _root;
|
|
6
|
+
private _model;
|
|
7
|
+
private _configuration;
|
|
8
|
+
private _modelCopy?;
|
|
9
|
+
hasPlayerAsParent?: boolean;
|
|
2
10
|
/**
|
|
3
11
|
* This function makes sure you set the default values on the model
|
|
4
12
|
* @param model
|
|
5
13
|
* @returns model
|
|
6
14
|
*/
|
|
7
|
-
static createDefaultModel: (model?:
|
|
8
|
-
language: any;
|
|
9
|
-
correctResponse: never[];
|
|
10
|
-
title: string;
|
|
11
|
-
prompt: string;
|
|
12
|
-
modelTypeSelected: string;
|
|
13
|
-
maxModelSelected: number;
|
|
14
|
-
partsPerModel: number;
|
|
15
|
-
allowedStudentConfig: boolean;
|
|
16
|
-
showGraphLabels: boolean;
|
|
17
|
-
};
|
|
15
|
+
static createDefaultModel: (model?: Partial<FractionModelModel>) => AuthorModel;
|
|
18
16
|
constructor();
|
|
19
|
-
set model(m:
|
|
20
|
-
set configuration(c:
|
|
21
|
-
resetModelAfterConfigurationIsSet:
|
|
17
|
+
set model(m: Partial<FractionModelModel>);
|
|
18
|
+
set configuration(c: FractionModelConfiguration);
|
|
19
|
+
resetModelAfterConfigurationIsSet: () => void;
|
|
22
20
|
connectedCallback(): void;
|
|
23
|
-
modelChanged(m:
|
|
24
|
-
onChange:
|
|
25
|
-
onConfigurationChanged(c:
|
|
21
|
+
modelChanged(m: AuthorModel): void;
|
|
22
|
+
onChange: (o: Partial<AuthorModel>) => void;
|
|
23
|
+
onConfigurationChanged(c: FractionModelConfiguration): void;
|
|
26
24
|
/**
|
|
27
25
|
*
|
|
28
26
|
* @param {done, progress, file} handler
|
|
29
27
|
*/
|
|
30
|
-
insertImage(handler:
|
|
31
|
-
onDeleteImage(src:
|
|
32
|
-
insertSound(handler:
|
|
33
|
-
onDeleteSound(src:
|
|
28
|
+
insertImage(handler: ImageHandler): void;
|
|
29
|
+
onDeleteImage(src: string, done: DeleteDone): void;
|
|
30
|
+
insertSound(handler: SoundHandler): void;
|
|
31
|
+
onDeleteSound(src: string, done: DeleteDone): void;
|
|
34
32
|
render(): void;
|
|
35
33
|
disconnectedCallback(): void;
|
|
36
34
|
}
|
package/dist/author/index.js
CHANGED
|
@@ -5,6 +5,9 @@ import { createRoot as r } from "react-dom/client";
|
|
|
5
5
|
import { DeleteImageEvent as i, DeleteSoundEvent as a, InsertImageEvent as o, InsertSoundEvent as s, ModelUpdatedEvent as c } from "@pie-element/shared-configure-events";
|
|
6
6
|
//#region src/author/index.ts
|
|
7
7
|
var l = class l extends HTMLElement {
|
|
8
|
+
_root;
|
|
9
|
+
_model;
|
|
10
|
+
_configuration;
|
|
8
11
|
static createDefaultModel = (e = {}) => {
|
|
9
12
|
let n = t.configuration, r = e.language || "";
|
|
10
13
|
return !r && n.language && n.language.enabled && n.languageChoices?.options?.length && (r = n.languageChoices.options[0].value), {
|
|
@@ -24,10 +27,15 @@ var l = class l extends HTMLElement {
|
|
|
24
27
|
...t.configuration,
|
|
25
28
|
...e
|
|
26
29
|
};
|
|
27
|
-
this._configuration = n, this.resetModelAfterConfigurationIsSet(), n?.language?.enabled
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
if (this._configuration = n, this.resetModelAfterConfigurationIsSet(), n?.language?.enabled) n?.languageChoices?.options?.length && (this._model.language = n?.languageChoices.options[0].value);
|
|
31
|
+
else if (n.language.settings && this._model.language) {
|
|
32
|
+
let e = this._model.language, t = this._configuration.languageChoices;
|
|
33
|
+
this._configuration.language.enabled = !0, (!t.options || !t.options.length) && (t.options = []), t.options.find((t) => t.value === e) || t.options.push({
|
|
34
|
+
value: e,
|
|
35
|
+
label: e
|
|
36
|
+
});
|
|
37
|
+
} else delete this._model.language;
|
|
38
|
+
this.render();
|
|
31
39
|
}
|
|
32
40
|
resetModelAfterConfigurationIsSet = () => {
|
|
33
41
|
let e = document.querySelectorAll("pie-author");
|
|
@@ -37,7 +45,7 @@ var l = class l extends HTMLElement {
|
|
|
37
45
|
this.render();
|
|
38
46
|
}
|
|
39
47
|
modelChanged(e) {
|
|
40
|
-
this._model = e, this.dispatchEvent(new c(this._model)
|
|
48
|
+
this._model = e, this.dispatchEvent(new c(this._model)), this.render();
|
|
41
49
|
}
|
|
42
50
|
onChange = (e) => {
|
|
43
51
|
this._model = {
|
|
@@ -63,7 +71,6 @@ var l = class l extends HTMLElement {
|
|
|
63
71
|
render() {
|
|
64
72
|
if (this._model) {
|
|
65
73
|
let t = n.createElement(e, {
|
|
66
|
-
classes: {},
|
|
67
74
|
model: this._model,
|
|
68
75
|
configuration: this._configuration,
|
|
69
76
|
onConfigurationChanged: this.onConfigurationChanged,
|
package/dist/author/main.d.ts
CHANGED
|
@@ -1,17 +1,39 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import type { DeleteDone, ImageHandler, SoundHandler } from '@pie-element/shared-configure-events';
|
|
3
|
+
import type { FractionModelValidationErrors } from '../controller/index.js';
|
|
4
|
+
import type { FractionModelConfiguration, FractionModelModel, FractionModelResponse } from '../types.js';
|
|
5
|
+
/** The model the author edits; `createDefaultModel()` fills it from the defaults, and the host sets `errors` from the controller's `validate()`. */
|
|
6
|
+
export type AuthorModel = Partial<FractionModelModel> & {
|
|
7
|
+
correctResponse: FractionModelResponse[];
|
|
8
|
+
errors?: FractionModelValidationErrors;
|
|
9
|
+
};
|
|
10
|
+
type MediaSupport<Handler> = {
|
|
11
|
+
add: (handler: Handler) => void;
|
|
12
|
+
delete: (src: string, done: DeleteDone) => void;
|
|
13
|
+
};
|
|
14
|
+
export type MainProps = {
|
|
15
|
+
model: AuthorModel;
|
|
16
|
+
configuration: FractionModelConfiguration;
|
|
17
|
+
onConfigurationChanged: (configuration: FractionModelConfiguration) => void;
|
|
18
|
+
/** Merges the update into the model */
|
|
19
|
+
onChange: (update: Partial<AuthorModel>) => void;
|
|
20
|
+
imageSupport: MediaSupport<ImageHandler>;
|
|
21
|
+
uploadSoundSupport: MediaSupport<SoundHandler>;
|
|
22
|
+
};
|
|
23
|
+
type State = {
|
|
24
|
+
/** The warning shown before a change to the model options clears the correct answer */
|
|
25
|
+
correctAnswerChangeDialog: {
|
|
26
|
+
open: boolean;
|
|
27
|
+
text?: string;
|
|
28
|
+
oldModel?: AuthorModel;
|
|
29
|
+
newModel?: AuthorModel;
|
|
10
30
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
31
|
+
};
|
|
32
|
+
export declare class Main extends React.Component<MainProps, State> {
|
|
33
|
+
constructor(props: MainProps);
|
|
34
|
+
onCorrectAnswerChange: (correctResponse: FractionModelResponse[]) => void;
|
|
35
|
+
onModelOptionsChange: (oldModel: AuthorModel, newModel: AuthorModel, showDiag: boolean) => void;
|
|
36
|
+
generateRandomKey: () => number;
|
|
15
37
|
render(): React.JSX.Element;
|
|
16
38
|
}
|
|
17
39
|
export default Main;
|
package/dist/author/main.js
CHANGED
|
@@ -2,30 +2,22 @@ import e from "../delivery/fraction-model-chart.js";
|
|
|
2
2
|
import t from "./card-bar.js";
|
|
3
3
|
import { ModelOptions as n } from "./model-options.js";
|
|
4
4
|
import r from "react";
|
|
5
|
-
import i from "
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import d from "@
|
|
10
|
-
import f from "@mui/material/
|
|
11
|
-
import p from "@mui/icons-material/Info";
|
|
5
|
+
import { styled as i } from "@mui/material/styles";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { AlertDialog as s, FormSection as c, layout as l } from "@pie-lib/config-ui";
|
|
8
|
+
import u from "@pie-lib/editable-html-tip-tap";
|
|
9
|
+
import d from "@mui/material/Tooltip";
|
|
10
|
+
import f from "@mui/icons-material/Info";
|
|
12
11
|
//#region src/author/main.tsx
|
|
13
|
-
var
|
|
12
|
+
var p = i(c)(({ theme: e }) => ({ marginBottom: e.spacing(4) })), m = i(d)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
|
|
14
13
|
fontSize: e.typography.fontSize - 2,
|
|
15
14
|
whiteSpace: "pre",
|
|
16
15
|
maxWidth: "500px"
|
|
17
|
-
} })),
|
|
16
|
+
} })), h = i("div")(({ theme: e }) => ({
|
|
18
17
|
fontSize: e.typography.fontSize - 2,
|
|
19
18
|
color: e.palette.error.main,
|
|
20
19
|
marginTop: e.spacing(1)
|
|
21
|
-
})),
|
|
22
|
-
static propTypes = {
|
|
23
|
-
model: i.object.isRequired,
|
|
24
|
-
configuration: i.object.isRequired,
|
|
25
|
-
onConfigurationChanged: i.func.isRequired,
|
|
26
|
-
onChange: i.func.isRequired,
|
|
27
|
-
uploadSoundSupport: i.object.isRequired
|
|
28
|
-
};
|
|
20
|
+
})), g = i("div")(({ theme: e, hasError: t }) => ({ ...t && { border: `2px solid ${e.palette.error.main}` } })), _ = i("label")(({ theme: e }) => ({ marginBottom: e.spacing(4) })), v = class extends r.Component {
|
|
29
21
|
constructor(e) {
|
|
30
22
|
super(e), this.state = { correctAnswerChangeDialog: {
|
|
31
23
|
open: !1,
|
|
@@ -47,19 +39,19 @@ var m = a(l)(({ theme: e }) => ({ marginBottom: e.spacing(4) })), h = a(f)(({ th
|
|
|
47
39
|
};
|
|
48
40
|
generateRandomKey = () => Math.floor(Math.random() * 1e4);
|
|
49
41
|
render() {
|
|
50
|
-
let { model: r, onChange: i, configuration:
|
|
42
|
+
let { model: r, onChange: i, configuration: d, imageSupport: v, uploadSoundSupport: y } = this.props, { baseInputConfiguration: b = {}, contentDimensions: x = {}, title: S = {}, prompt: C = {}, modelOptions: w = {}, mathMlOptions: T = {} } = d || {}, { errors: E = {}, extraCSSRules: D, spellCheckEnabled: O, toolbarEditorPosition: k } = r || {}, { correctAnswerChangeDialog: A } = this.state, j = { position: k === "top" ? "top" : "bottom" }, M = (e = {}) => ({
|
|
51
43
|
...b,
|
|
52
44
|
...e
|
|
53
45
|
}), N = this.generateRandomKey();
|
|
54
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ o(l.ConfigLayout, {
|
|
55
47
|
extraCSSRules: D,
|
|
56
48
|
dimensions: x,
|
|
57
49
|
hideSettings: !0,
|
|
58
50
|
children: [
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ a(t, { header: "Set Up" }),
|
|
52
|
+
/* @__PURE__ */ a(p, {
|
|
61
53
|
label: S?.label || "Title",
|
|
62
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ a(u, {
|
|
63
55
|
markup: r.title || "",
|
|
64
56
|
onChange: (e) => i({ title: e }),
|
|
65
57
|
toolbarOpts: j,
|
|
@@ -81,9 +73,9 @@ var m = a(l)(({ theme: e }) => ({ marginBottom: e.spacing(4) })), h = a(f)(({ th
|
|
|
81
73
|
mathMlOptions: T
|
|
82
74
|
})
|
|
83
75
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ a(p, {
|
|
85
77
|
label: C?.label || "Question",
|
|
86
|
-
children: /* @__PURE__ */
|
|
78
|
+
children: /* @__PURE__ */ a(u, {
|
|
87
79
|
markup: r.prompt || "",
|
|
88
80
|
minHeight: 60,
|
|
89
81
|
onChange: (e) => i({ prompt: e }),
|
|
@@ -91,38 +83,38 @@ var m = a(l)(({ theme: e }) => ({ marginBottom: e.spacing(4) })), h = a(f)(({ th
|
|
|
91
83
|
pluginProps: M(C?.inputConfiguration),
|
|
92
84
|
spellCheck: O,
|
|
93
85
|
uploadSoundSupport: y,
|
|
94
|
-
imageSupport:
|
|
86
|
+
imageSupport: v,
|
|
95
87
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
96
88
|
mathMlOptions: T
|
|
97
89
|
})
|
|
98
90
|
}),
|
|
99
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ a(c, { children: /* @__PURE__ */ a(n, {
|
|
100
92
|
model: r,
|
|
101
93
|
onChange: this.onModelOptionsChange,
|
|
102
94
|
modelOptions: w
|
|
103
95
|
}) }),
|
|
104
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ o(c, { children: [
|
|
105
97
|
" ",
|
|
106
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ a(t, {
|
|
107
99
|
header: "Correct Answer",
|
|
108
|
-
info: /* @__PURE__ */
|
|
100
|
+
info: /* @__PURE__ */ a(m, {
|
|
109
101
|
disableFocusListener: !0,
|
|
110
102
|
disableTouchListener: !0,
|
|
111
103
|
placement: "right",
|
|
112
104
|
title: "The correct answer should include no more than one partially-filled model",
|
|
113
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ a(f, {
|
|
114
106
|
fontSize: "small",
|
|
115
107
|
color: "primary",
|
|
116
108
|
style: { marginLeft: "8px" }
|
|
117
109
|
})
|
|
118
110
|
})
|
|
119
111
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ a("br", {}),
|
|
113
|
+
/* @__PURE__ */ a(_, { children: "Click/touch the number of parts to represent the correct fraction model" }),
|
|
114
|
+
/* @__PURE__ */ a("br", {}),
|
|
115
|
+
/* @__PURE__ */ a(g, {
|
|
124
116
|
hasError: !!E.correctResponse,
|
|
125
|
-
children: /* @__PURE__ */
|
|
117
|
+
children: /* @__PURE__ */ a(e, {
|
|
126
118
|
value: r.correctResponse,
|
|
127
119
|
modelType: r.modelTypeSelected,
|
|
128
120
|
noOfModels: r.maxModelSelected,
|
|
@@ -131,9 +123,9 @@ var m = a(l)(({ theme: e }) => ({ marginBottom: e.spacing(4) })), h = a(f)(({ th
|
|
|
131
123
|
onChange: this.onCorrectAnswerChange
|
|
132
124
|
}, N)
|
|
133
125
|
}),
|
|
134
|
-
E.correctResponse && /* @__PURE__ */
|
|
126
|
+
E.correctResponse && /* @__PURE__ */ a(h, { children: E.correctResponse })
|
|
135
127
|
] }),
|
|
136
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ a(s, {
|
|
137
129
|
open: A.open,
|
|
138
130
|
title: "Warning",
|
|
139
131
|
text: A.text,
|
|
@@ -153,4 +145,4 @@ var m = a(l)(({ theme: e }) => ({ marginBottom: e.spacing(4) })), h = a(f)(({ th
|
|
|
153
145
|
}
|
|
154
146
|
};
|
|
155
147
|
//#endregion
|
|
156
|
-
export {
|
|
148
|
+
export { v as Main, v as default };
|
|
@@ -32368,13 +32368,6 @@ var tV = it.forwardRef((e, t) => /* @__PURE__ */ A(eV, {
|
|
|
32368
32368
|
color: e.palette.error.main,
|
|
32369
32369
|
marginTop: e.spacing(1)
|
|
32370
32370
|
})), fV = D("div")(({ theme: e, hasError: t }) => ({ ...t && { border: `2px solid ${e.palette.error.main}` } })), pV = D("label")(({ theme: e }) => ({ marginBottom: e.spacing(4) })), mV = class extends it.Component {
|
|
32371
|
-
static propTypes = {
|
|
32372
|
-
model: z.default.object.isRequired,
|
|
32373
|
-
configuration: z.default.object.isRequired,
|
|
32374
|
-
onConfigurationChanged: z.default.func.isRequired,
|
|
32375
|
-
onChange: z.default.func.isRequired,
|
|
32376
|
-
uploadSoundSupport: z.default.object.isRequired
|
|
32377
|
-
};
|
|
32378
32371
|
constructor(e) {
|
|
32379
32372
|
super(e), this.state = { correctAnswerChangeDialog: {
|
|
32380
32373
|
open: !1,
|
|
@@ -32640,6 +32633,9 @@ var tV = it.forwardRef((e, t) => /* @__PURE__ */ A(eV, {
|
|
|
32640
32633
|
settingsPanelDisabled: !0
|
|
32641
32634
|
}
|
|
32642
32635
|
}, xV = class e extends HTMLElement {
|
|
32636
|
+
_root;
|
|
32637
|
+
_model;
|
|
32638
|
+
_configuration;
|
|
32643
32639
|
static createDefaultModel = (e = {}) => {
|
|
32644
32640
|
let t = bV.configuration, n = e.language || "";
|
|
32645
32641
|
return !n && t.language && t.language.enabled && t.languageChoices?.options?.length && (n = t.languageChoices.options[0].value), {
|
|
@@ -32659,10 +32655,15 @@ var tV = it.forwardRef((e, t) => /* @__PURE__ */ A(eV, {
|
|
|
32659
32655
|
...bV.configuration,
|
|
32660
32656
|
...e
|
|
32661
32657
|
};
|
|
32662
|
-
this._configuration = t, this.resetModelAfterConfigurationIsSet(), t?.language?.enabled
|
|
32663
|
-
|
|
32664
|
-
|
|
32665
|
-
|
|
32658
|
+
if (this._configuration = t, this.resetModelAfterConfigurationIsSet(), t?.language?.enabled) t?.languageChoices?.options?.length && (this._model.language = t?.languageChoices.options[0].value);
|
|
32659
|
+
else if (t.language.settings && this._model.language) {
|
|
32660
|
+
let e = this._model.language, t = this._configuration.languageChoices;
|
|
32661
|
+
this._configuration.language.enabled = !0, (!t.options || !t.options.length) && (t.options = []), t.options.find((t) => t.value === e) || t.options.push({
|
|
32662
|
+
value: e,
|
|
32663
|
+
label: e
|
|
32664
|
+
});
|
|
32665
|
+
} else delete this._model.language;
|
|
32666
|
+
this.render();
|
|
32666
32667
|
}
|
|
32667
32668
|
resetModelAfterConfigurationIsSet = () => {
|
|
32668
32669
|
let e = document.querySelectorAll("pie-author");
|
|
@@ -32672,7 +32673,7 @@ var tV = it.forwardRef((e, t) => /* @__PURE__ */ A(eV, {
|
|
|
32672
32673
|
this.render();
|
|
32673
32674
|
}
|
|
32674
32675
|
modelChanged(e) {
|
|
32675
|
-
this._model = e, this.dispatchEvent(new hV(this._model)
|
|
32676
|
+
this._model = e, this.dispatchEvent(new hV(this._model)), this.render();
|
|
32676
32677
|
}
|
|
32677
32678
|
onChange = (e) => {
|
|
32678
32679
|
this._model = {
|
|
@@ -32698,7 +32699,6 @@ var tV = it.forwardRef((e, t) => /* @__PURE__ */ A(eV, {
|
|
|
32698
32699
|
render() {
|
|
32699
32700
|
if (this._model) {
|
|
32700
32701
|
let e = it.createElement(mV, {
|
|
32701
|
-
classes: {},
|
|
32702
32702
|
model: this._model,
|
|
32703
32703
|
configuration: this._configuration,
|
|
32704
32704
|
onConfigurationChanged: this.onConfigurationChanged,
|