@pie-element/drawing-response 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/defaults.d.ts +34 -33
- package/dist/author/image-container.d.ts +10 -1
- package/dist/author/index.d.ts +16 -24
- package/dist/author/index.js +7 -2
- package/dist/author/root.d.ts +24 -5
- package/dist/author/root.js +32 -47
- package/dist/browser/author/index.js +14 -29
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +4 -4
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +14 -29
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js +4 -4
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +6 -6
- package/dist/controller/index.d.ts +16 -5
- package/dist/controller/index.js +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +379 -0
- package/dist/schemas/model.schema.json +364 -0
- package/dist/schemas/session.schema.json +176 -0
- package/dist/types.d.ts +173 -0
- package/package.json +16 -12
|
@@ -1,84 +1,85 @@
|
|
|
1
|
+
import type { ConfigureLanguageOptionsProp } from '@pie-element/shared-types';
|
|
1
2
|
declare const _default: {
|
|
2
3
|
model: {
|
|
3
|
-
backgroundImageEnabled:
|
|
4
|
+
backgroundImageEnabled: true;
|
|
4
5
|
imageDimensions: {
|
|
5
6
|
height: number;
|
|
6
7
|
width: number;
|
|
7
8
|
};
|
|
8
9
|
imageUrl: string;
|
|
9
10
|
prompt: string;
|
|
10
|
-
promptEnabled:
|
|
11
|
-
spellCheckEnabled:
|
|
12
|
-
studentInstructionsEnabled:
|
|
11
|
+
promptEnabled: true;
|
|
12
|
+
spellCheckEnabled: true;
|
|
13
|
+
studentInstructionsEnabled: true;
|
|
13
14
|
teacherInstructions: string;
|
|
14
|
-
teacherInstructionsEnabled:
|
|
15
|
-
toolbarEditorPosition:
|
|
15
|
+
teacherInstructionsEnabled: true;
|
|
16
|
+
toolbarEditorPosition: "bottom";
|
|
16
17
|
};
|
|
17
18
|
configuration: {
|
|
18
19
|
baseInputConfiguration: {
|
|
19
20
|
h3: {
|
|
20
|
-
disabled:
|
|
21
|
+
disabled: true;
|
|
21
22
|
};
|
|
22
23
|
audio: {
|
|
23
|
-
disabled:
|
|
24
|
+
disabled: false;
|
|
24
25
|
};
|
|
25
26
|
video: {
|
|
26
|
-
disabled:
|
|
27
|
+
disabled: false;
|
|
27
28
|
};
|
|
28
29
|
image: {
|
|
29
|
-
disabled:
|
|
30
|
+
disabled: false;
|
|
30
31
|
};
|
|
31
32
|
textAlign: {
|
|
32
|
-
disabled:
|
|
33
|
+
disabled: true;
|
|
33
34
|
};
|
|
34
35
|
showParagraphs: {
|
|
35
|
-
disabled:
|
|
36
|
+
disabled: false;
|
|
36
37
|
};
|
|
37
38
|
separateParagraphs: {
|
|
38
|
-
disabled:
|
|
39
|
+
disabled: true;
|
|
39
40
|
};
|
|
40
41
|
};
|
|
41
42
|
spellCheck: {
|
|
42
43
|
label: string;
|
|
43
|
-
settings:
|
|
44
|
-
enabled:
|
|
44
|
+
settings: false;
|
|
45
|
+
enabled: true;
|
|
45
46
|
};
|
|
46
47
|
backgroundImage: {
|
|
47
|
-
settings:
|
|
48
|
+
settings: true;
|
|
48
49
|
label: string;
|
|
49
50
|
};
|
|
50
51
|
prompt: {
|
|
51
|
-
settings:
|
|
52
|
+
settings: true;
|
|
52
53
|
label: string;
|
|
53
54
|
inputConfiguration: {
|
|
54
55
|
audio: {
|
|
55
|
-
disabled:
|
|
56
|
+
disabled: false;
|
|
56
57
|
};
|
|
57
58
|
video: {
|
|
58
|
-
disabled:
|
|
59
|
+
disabled: false;
|
|
59
60
|
};
|
|
60
61
|
image: {
|
|
61
|
-
disabled:
|
|
62
|
+
disabled: false;
|
|
62
63
|
};
|
|
63
64
|
};
|
|
64
|
-
required:
|
|
65
|
+
required: false;
|
|
65
66
|
};
|
|
66
|
-
settingsPanelDisabled:
|
|
67
|
+
settingsPanelDisabled: false;
|
|
67
68
|
teacherInstructions: {
|
|
68
|
-
settings:
|
|
69
|
+
settings: true;
|
|
69
70
|
label: string;
|
|
70
71
|
inputConfiguration: {
|
|
71
72
|
audio: {
|
|
72
|
-
disabled:
|
|
73
|
+
disabled: false;
|
|
73
74
|
};
|
|
74
75
|
video: {
|
|
75
|
-
disabled:
|
|
76
|
+
disabled: false;
|
|
76
77
|
};
|
|
77
78
|
image: {
|
|
78
|
-
disabled:
|
|
79
|
+
disabled: false;
|
|
79
80
|
};
|
|
80
81
|
};
|
|
81
|
-
required:
|
|
82
|
+
required: false;
|
|
82
83
|
};
|
|
83
84
|
maxImageWidth: {
|
|
84
85
|
teacherInstructions: number;
|
|
@@ -89,21 +90,21 @@ declare const _default: {
|
|
|
89
90
|
prompt: number;
|
|
90
91
|
};
|
|
91
92
|
withRubric: {
|
|
92
|
-
settings:
|
|
93
|
+
settings: false;
|
|
93
94
|
label: string;
|
|
94
95
|
};
|
|
95
96
|
mathMlOptions: {
|
|
96
|
-
mmlOutput:
|
|
97
|
-
mmlEditing:
|
|
97
|
+
mmlOutput: false;
|
|
98
|
+
mmlEditing: false;
|
|
98
99
|
};
|
|
99
100
|
language: {
|
|
100
|
-
settings:
|
|
101
|
+
settings: false;
|
|
101
102
|
label: string;
|
|
102
|
-
enabled:
|
|
103
|
+
enabled: false;
|
|
103
104
|
};
|
|
104
105
|
languageChoices: {
|
|
105
106
|
label: string;
|
|
106
|
-
options:
|
|
107
|
+
options: ConfigureLanguageOptionsProp[];
|
|
107
108
|
};
|
|
108
109
|
};
|
|
109
110
|
};
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
3
|
+
import type { ImageHandler } from '@pie-element/shared-configure-events';
|
|
4
|
+
import type { Dimensions } from '../types.js';
|
|
5
|
+
type ImageContainerProps = {
|
|
6
|
+
imageDimensions?: Dimensions;
|
|
7
|
+
imageUrl?: string;
|
|
8
|
+
onImageUpload: (imageUrl: string) => void;
|
|
9
|
+
onUpdateImageDimension: (dimensions: Dimensions) => void;
|
|
10
|
+
insertImage?: (handler: ImageHandler) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare class ImageContainer extends Component<ImageContainerProps> {
|
|
4
13
|
static propTypes: {
|
|
5
14
|
imageDimensions: PropTypes.Requireable<object>;
|
|
6
15
|
};
|
package/dist/author/index.d.ts
CHANGED
|
@@ -1,29 +1,21 @@
|
|
|
1
|
+
import { type DeleteDone, type ImageHandler, type SoundHandler } from '@pie-element/shared-configure-events';
|
|
2
|
+
import { type AuthorModel } from './root.js';
|
|
3
|
+
import type { DrawingResponseConfiguration, DrawingResponseModel } from '../types.js';
|
|
1
4
|
export default class DrawableResponseConfigure extends HTMLElement {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
width: number;
|
|
7
|
-
};
|
|
8
|
-
imageUrl: string;
|
|
9
|
-
prompt: string;
|
|
10
|
-
promptEnabled: boolean;
|
|
11
|
-
spellCheckEnabled: boolean;
|
|
12
|
-
studentInstructionsEnabled: boolean;
|
|
13
|
-
teacherInstructions: string;
|
|
14
|
-
teacherInstructionsEnabled: boolean;
|
|
15
|
-
toolbarEditorPosition: string;
|
|
16
|
-
};
|
|
5
|
+
private _root;
|
|
6
|
+
private _model;
|
|
7
|
+
private _configuration;
|
|
8
|
+
static createDefaultModel: (model?: Partial<DrawingResponseModel>, config?: DrawingResponseConfiguration) => AuthorModel;
|
|
17
9
|
constructor();
|
|
18
|
-
set model(s:
|
|
19
|
-
set configuration(c:
|
|
20
|
-
dispatchModelUpdated(reset
|
|
21
|
-
onModelChanged:
|
|
22
|
-
onConfigurationChanged:
|
|
23
|
-
insertImage:
|
|
24
|
-
onDeleteImage:
|
|
25
|
-
insertSound(handler:
|
|
26
|
-
onDeleteSound(src:
|
|
10
|
+
set model(s: Partial<DrawingResponseModel>);
|
|
11
|
+
set configuration(c: DrawingResponseConfiguration);
|
|
12
|
+
dispatchModelUpdated(reset?: boolean): void;
|
|
13
|
+
onModelChanged: (m: AuthorModel, reset?: boolean) => void;
|
|
14
|
+
onConfigurationChanged: (c: DrawingResponseConfiguration) => void;
|
|
15
|
+
insertImage: (handler: ImageHandler) => void;
|
|
16
|
+
onDeleteImage: (src: string, done: DeleteDone) => void;
|
|
17
|
+
insertSound(handler: SoundHandler): void;
|
|
18
|
+
onDeleteSound(src: string, done: DeleteDone): void;
|
|
27
19
|
_render(): void;
|
|
28
20
|
connectedCallback(): void;
|
|
29
21
|
disconnectedCallback(): void;
|
package/dist/author/index.js
CHANGED
|
@@ -6,6 +6,9 @@ import i from "debug";
|
|
|
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 = i("hotspot:configure"), d = class i extends HTMLElement {
|
|
9
|
+
_root;
|
|
10
|
+
_model;
|
|
11
|
+
_configuration;
|
|
9
12
|
static createDefaultModel = (e = {}, n) => {
|
|
10
13
|
let r = {
|
|
11
14
|
...t.model,
|
|
@@ -14,7 +17,9 @@ var u = i("hotspot:configure"), d = class i extends HTMLElement {
|
|
|
14
17
|
return n?.withRubric?.forceEnabled && !r.rubricEnabled && (r.rubricEnabled = !0), r;
|
|
15
18
|
};
|
|
16
19
|
constructor() {
|
|
17
|
-
super(), this._root = null
|
|
20
|
+
super(), this._root = null;
|
|
21
|
+
let e = t.configuration;
|
|
22
|
+
this._configuration = e, e.withRubric?.forceEnabled && (e.withRubric.settings = !1), this._model = i.createDefaultModel({}, this._configuration), this.onModelChanged = this.onModelChanged.bind(this);
|
|
18
23
|
}
|
|
19
24
|
set model(e) {
|
|
20
25
|
this._model = i.createDefaultModel(e, this._configuration), this._render();
|
|
@@ -26,7 +31,7 @@ var u = i("hotspot:configure"), d = class i extends HTMLElement {
|
|
|
26
31
|
};
|
|
27
32
|
this._configuration = n;
|
|
28
33
|
let { withRubric: r = {} } = e || {};
|
|
29
|
-
r?.forceEnabled && (
|
|
34
|
+
r?.forceEnabled && (n.withRubric.settings = !1, this._model.rubricEnabled || (this._model.rubricEnabled = !0)), n?.language?.enabled ? n?.languageChoices?.options?.length && (this._model.language = n?.languageChoices.options[0].value) : n.language.settings && this._model.language ? (n.language.enabled = !0, (!n.languageChoices.options || !n.languageChoices.options.length) && (n.languageChoices.options = []), n.languageChoices.options.find((e) => e.value === this._model.language) || n.languageChoices.options.push({
|
|
30
35
|
value: this._model.language,
|
|
31
36
|
label: this._model.language
|
|
32
37
|
})) : delete this._model.language, this._render();
|
package/dist/author/root.d.ts
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import type { DeleteDone, ImageHandler, SoundHandler } from '@pie-element/shared-configure-events';
|
|
3
|
+
import type { DrawingResponseValidationErrors } from '../controller/index.js';
|
|
4
|
+
import type { Dimensions, DrawingResponseConfiguration, DrawingResponseModel } from '../types.js';
|
|
5
|
+
/** The model the author edits; the host sets `errors` from the controller's `validate()`. */
|
|
6
|
+
export type AuthorModel = Partial<DrawingResponseModel> & {
|
|
7
|
+
errors?: DrawingResponseValidationErrors;
|
|
8
|
+
};
|
|
9
|
+
type MediaSupport<Handler> = {
|
|
10
|
+
add: (handler: Handler) => void;
|
|
11
|
+
delete: (src: string, done: DeleteDone) => void;
|
|
12
|
+
};
|
|
13
|
+
export type RootProps = {
|
|
14
|
+
configuration: DrawingResponseConfiguration;
|
|
15
|
+
model: AuthorModel;
|
|
16
|
+
imageSupport?: MediaSupport<ImageHandler>;
|
|
17
|
+
uploadSoundSupport?: MediaSupport<SoundHandler>;
|
|
18
|
+
onModelChanged: (model: AuthorModel, reset?: boolean) => void;
|
|
19
|
+
onConfigurationChanged: (configuration: DrawingResponseConfiguration) => void;
|
|
20
|
+
};
|
|
21
|
+
export declare class Root extends React.Component<RootProps> {
|
|
22
|
+
onPromptChanged: (prompt: string) => void;
|
|
23
|
+
onTeacherInstructionsChanged: (teacherInstructions: string) => void;
|
|
24
|
+
onUpdateImageDimension: (dimensions: Dimensions) => void;
|
|
25
|
+
onImageUpload: (imageUrl: string) => void;
|
|
7
26
|
render(): React.JSX.Element;
|
|
8
27
|
}
|
|
9
28
|
export default Root;
|
package/dist/author/root.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { ImageContainer as e } from "./image-container.js";
|
|
2
2
|
import t from "react";
|
|
3
3
|
import { cloneDeep as n } from "@pie-element/shared-lodash";
|
|
4
|
-
import r from "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import u from "@
|
|
9
|
-
import d from "@mui/material/Typography";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { styled as a } from "@mui/material/styles";
|
|
6
|
+
import { InputContainer as o, layout as s, settings as c } from "@pie-lib/config-ui";
|
|
7
|
+
import l from "@pie-lib/editable-html-tip-tap";
|
|
8
|
+
import u from "@mui/material/Typography";
|
|
10
9
|
//#region src/author/root.tsx
|
|
11
|
-
var { Panel:
|
|
10
|
+
var { Panel: d, toggle: f, dropdown: p } = c, m = a(o)(({ theme: e }) => ({
|
|
12
11
|
paddingTop: e.spacing(1),
|
|
13
12
|
marginTop: e.spacing(2),
|
|
14
13
|
marginBottom: e.spacing(1),
|
|
15
14
|
width: "100%"
|
|
16
|
-
})),
|
|
15
|
+
})), h = a("div")(({ theme: e }) => ({
|
|
17
16
|
fontSize: e.typography.fontSize - 2,
|
|
18
17
|
color: e.palette.error.main,
|
|
19
18
|
paddingTop: e.spacing(1)
|
|
20
|
-
})),
|
|
19
|
+
})), g = class extends t.Component {
|
|
21
20
|
onPromptChanged = (e) => {
|
|
22
21
|
let { model: t, onModelChanged: r } = this.props;
|
|
23
22
|
r({
|
|
@@ -47,40 +46,40 @@ var { Panel: f, toggle: p, dropdown: m } = l, h = o(s)(({ theme: e }) => ({
|
|
|
47
46
|
});
|
|
48
47
|
};
|
|
49
48
|
render() {
|
|
50
|
-
let { configuration: n, imageSupport:
|
|
51
|
-
backgroundImageEnabled: y.settings &&
|
|
52
|
-
promptEnabled: C.settings &&
|
|
53
|
-
"language.enabled": O.settings &&
|
|
54
|
-
language: O.settings && O.enabled &&
|
|
49
|
+
let { configuration: n, imageSupport: a, model: o, onConfigurationChanged: c, onModelChanged: g, uploadSoundSupport: _ } = this.props, { baseInputConfiguration: v = {}, backgroundImage: y = {}, contentDimensions: b = {}, maxImageWidth: x = {}, maxImageHeight: S = {}, prompt: C = {}, settingsPanelDisabled: w, spellCheck: T = {}, teacherInstructions: E = {}, withRubric: D = {}, language: O = {}, languageChoices: k = {}, mathMlOptions: A = {} } = n || {}, { backgroundImageEnabled: j, errors: M = {}, extraCSSRules: N, promptEnabled: P, spellCheckEnabled: F, teacherInstructionsEnabled: I, toolbarEditorPosition: L } = o || {}, { prompt: R, teacherInstructions: z } = M, B = x && x.prompt, V = S && S.prompt, H = { position: L === "top" ? "top" : "bottom" }, U = {
|
|
50
|
+
backgroundImageEnabled: y.settings && f(y.label),
|
|
51
|
+
promptEnabled: C.settings && f(C.label),
|
|
52
|
+
"language.enabled": O.settings && f(O.label, !0),
|
|
53
|
+
language: O.settings && O.enabled && p(k.label, k.options)
|
|
55
54
|
}, W = {
|
|
56
|
-
teacherInstructionsEnabled: E.settings &&
|
|
57
|
-
spellCheckEnabled: T.settings &&
|
|
58
|
-
rubricEnabled: D?.settings &&
|
|
55
|
+
teacherInstructionsEnabled: E.settings && f(E.label),
|
|
56
|
+
spellCheckEnabled: T.settings && f(T.label),
|
|
57
|
+
rubricEnabled: D?.settings && f(D?.label)
|
|
59
58
|
}, G = (e = {}) => ({
|
|
60
59
|
...v,
|
|
61
60
|
...e
|
|
62
61
|
});
|
|
63
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ i(s.ConfigLayout, {
|
|
64
63
|
extraCSSRules: N,
|
|
65
64
|
dimensions: b,
|
|
66
65
|
hideSettings: w,
|
|
67
|
-
settings: /* @__PURE__ */
|
|
66
|
+
settings: /* @__PURE__ */ r(d, {
|
|
68
67
|
model: o,
|
|
69
|
-
onChangeModel:
|
|
68
|
+
onChangeModel: g,
|
|
70
69
|
configuration: n,
|
|
71
|
-
onChangeConfiguration:
|
|
70
|
+
onChangeConfiguration: c,
|
|
72
71
|
groups: {
|
|
73
72
|
Settings: U,
|
|
74
73
|
Properties: W
|
|
75
74
|
}
|
|
76
75
|
}),
|
|
77
76
|
children: [
|
|
78
|
-
I && /* @__PURE__ */
|
|
77
|
+
I && /* @__PURE__ */ i(m, {
|
|
79
78
|
label: E.label,
|
|
80
|
-
children: [/* @__PURE__ */
|
|
79
|
+
children: [/* @__PURE__ */ r(l, {
|
|
81
80
|
markup: o.teacherInstructions || "",
|
|
82
81
|
onChange: this.onTeacherInstructionsChanged,
|
|
83
|
-
imageSupport:
|
|
82
|
+
imageSupport: a,
|
|
84
83
|
nonEmpty: !1,
|
|
85
84
|
error: z,
|
|
86
85
|
toolbarOpts: H,
|
|
@@ -91,52 +90,38 @@ var { Panel: f, toggle: p, dropdown: m } = l, h = o(s)(({ theme: e }) => ({
|
|
|
91
90
|
uploadSoundSupport: _,
|
|
92
91
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
93
92
|
mathMlOptions: A
|
|
94
|
-
}), z && /* @__PURE__ */
|
|
93
|
+
}), z && /* @__PURE__ */ r(h, { children: z })]
|
|
95
94
|
}),
|
|
96
|
-
P && /* @__PURE__ */
|
|
95
|
+
P && /* @__PURE__ */ i(m, {
|
|
97
96
|
label: "Item Stem",
|
|
98
|
-
children: [/* @__PURE__ */
|
|
97
|
+
children: [/* @__PURE__ */ r(l, {
|
|
99
98
|
markup: o.prompt,
|
|
100
99
|
onChange: this.onPromptChanged,
|
|
101
100
|
error: R,
|
|
102
101
|
toolbarOpts: H,
|
|
103
102
|
spellCheck: F,
|
|
104
103
|
pluginProps: G(C?.inputConfiguration),
|
|
105
|
-
imageSupport:
|
|
104
|
+
imageSupport: a,
|
|
106
105
|
maxImageWidth: B,
|
|
107
106
|
maxImageHeight: V,
|
|
108
107
|
uploadSoundSupport: _,
|
|
109
108
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
110
109
|
mathMlOptions: A
|
|
111
|
-
}), R && /* @__PURE__ */
|
|
110
|
+
}), R && /* @__PURE__ */ r(h, { children: R })]
|
|
112
111
|
}),
|
|
113
|
-
j && /* @__PURE__ */
|
|
112
|
+
j && /* @__PURE__ */ i(t.Fragment, { children: [/* @__PURE__ */ r(u, {
|
|
114
113
|
variant: "h6",
|
|
115
114
|
children: "Define Background Image"
|
|
116
|
-
}), /* @__PURE__ */
|
|
115
|
+
}), /* @__PURE__ */ r(e, {
|
|
117
116
|
imageUrl: o.imageUrl,
|
|
118
117
|
onUpdateImageDimension: this.onUpdateImageDimension,
|
|
119
118
|
onImageUpload: this.onImageUpload,
|
|
120
119
|
imageDimensions: o.imageDimensions,
|
|
121
|
-
insertImage:
|
|
120
|
+
insertImage: a && a.add
|
|
122
121
|
})] })
|
|
123
122
|
]
|
|
124
123
|
});
|
|
125
124
|
}
|
|
126
125
|
};
|
|
127
|
-
_.propTypes = {
|
|
128
|
-
configuration: r.object,
|
|
129
|
-
model: r.object.isRequired,
|
|
130
|
-
imageSupport: r.shape({
|
|
131
|
-
add: r.func,
|
|
132
|
-
delete: r.func
|
|
133
|
-
}),
|
|
134
|
-
uploadSoundSupport: r.shape({
|
|
135
|
-
add: r.func,
|
|
136
|
-
delete: r.func
|
|
137
|
-
}),
|
|
138
|
-
onModelChanged: r.func.isRequired,
|
|
139
|
-
onConfigurationChanged: r.func.isRequired
|
|
140
|
-
};
|
|
141
126
|
//#endregion
|
|
142
|
-
export {
|
|
127
|
+
export { g as Root, g as default };
|
|
@@ -33306,15 +33306,12 @@ var jH = class extends rt.Component {
|
|
|
33306
33306
|
}), FH = (e) => typeof e == "string" ? {
|
|
33307
33307
|
label: e,
|
|
33308
33308
|
value: e
|
|
33309
|
-
} : e, IH =
|
|
33310
|
-
|
|
33311
|
-
|
|
33312
|
-
|
|
33313
|
-
|
|
33314
|
-
|
|
33315
|
-
isConfigProperty: n
|
|
33316
|
-
};
|
|
33317
|
-
}, LH = (e, t, n = !1) => ({
|
|
33309
|
+
} : e, IH = (e, t, n = !1) => ({
|
|
33310
|
+
type: "radio",
|
|
33311
|
+
label: e,
|
|
33312
|
+
choices: t && t.map((e) => FH(e)),
|
|
33313
|
+
isConfigProperty: n
|
|
33314
|
+
}), LH = (e, t, n = !1) => ({
|
|
33318
33315
|
type: "dropdown",
|
|
33319
33316
|
label: e,
|
|
33320
33317
|
choices: t,
|
|
@@ -33661,24 +33658,7 @@ var { Panel: sU, toggle: cU, dropdown: lU } = MH, uU = k(qH)(({ theme: e }) => (
|
|
|
33661
33658
|
]
|
|
33662
33659
|
});
|
|
33663
33660
|
}
|
|
33664
|
-
}
|
|
33665
|
-
fU.propTypes = {
|
|
33666
|
-
configuration: N.default.object,
|
|
33667
|
-
model: N.default.object.isRequired,
|
|
33668
|
-
imageSupport: N.default.shape({
|
|
33669
|
-
add: N.default.func,
|
|
33670
|
-
delete: N.default.func
|
|
33671
|
-
}),
|
|
33672
|
-
uploadSoundSupport: N.default.shape({
|
|
33673
|
-
add: N.default.func,
|
|
33674
|
-
delete: N.default.func
|
|
33675
|
-
}),
|
|
33676
|
-
onModelChanged: N.default.func.isRequired,
|
|
33677
|
-
onConfigurationChanged: N.default.func.isRequired
|
|
33678
|
-
};
|
|
33679
|
-
//#endregion
|
|
33680
|
-
//#region src/author/defaults.ts
|
|
33681
|
-
var pU = {
|
|
33661
|
+
}, pU = {
|
|
33682
33662
|
model: {
|
|
33683
33663
|
backgroundImageEnabled: !0,
|
|
33684
33664
|
imageDimensions: {
|
|
@@ -33761,6 +33741,9 @@ var pU = {
|
|
|
33761
33741
|
}
|
|
33762
33742
|
}
|
|
33763
33743
|
}, mU = (0, jo.default)("hotspot:configure"), hU = class e extends HTMLElement {
|
|
33744
|
+
_root;
|
|
33745
|
+
_model;
|
|
33746
|
+
_configuration;
|
|
33764
33747
|
static createDefaultModel = (e = {}, t) => {
|
|
33765
33748
|
let n = {
|
|
33766
33749
|
...pU.model,
|
|
@@ -33769,7 +33752,9 @@ var pU = {
|
|
|
33769
33752
|
return t?.withRubric?.forceEnabled && !n.rubricEnabled && (n.rubricEnabled = !0), n;
|
|
33770
33753
|
};
|
|
33771
33754
|
constructor() {
|
|
33772
|
-
super(), this._root = null
|
|
33755
|
+
super(), this._root = null;
|
|
33756
|
+
let t = pU.configuration;
|
|
33757
|
+
this._configuration = t, t.withRubric?.forceEnabled && (t.withRubric.settings = !1), this._model = e.createDefaultModel({}, this._configuration), this.onModelChanged = this.onModelChanged.bind(this);
|
|
33773
33758
|
}
|
|
33774
33759
|
set model(t) {
|
|
33775
33760
|
this._model = e.createDefaultModel(t, this._configuration), this._render();
|
|
@@ -33781,7 +33766,7 @@ var pU = {
|
|
|
33781
33766
|
};
|
|
33782
33767
|
this._configuration = t;
|
|
33783
33768
|
let { withRubric: n = {} } = e || {};
|
|
33784
|
-
n?.forceEnabled && (
|
|
33769
|
+
n?.forceEnabled && (t.withRubric.settings = !1, this._model.rubricEnabled || (this._model.rubricEnabled = !0)), 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({
|
|
33785
33770
|
value: this._model.language,
|
|
33786
33771
|
label: this._model.language
|
|
33787
33772
|
})) : delete this._model.language, this._render();
|