@pie-element/hotspot 12.0.4-next.20261011174919 → 12.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 +47 -45
- package/dist/author/hotspot-container.d.ts +20 -1
- package/dist/author/hotspot-palette.d.ts +9 -1
- package/dist/author/index.d.ts +24 -39
- package/dist/author/index.js +5 -2
- package/dist/author/root.d.ts +31 -3
- package/dist/author/root.js +55 -77
- package/dist/browser/author/index.js +12 -36
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +11 -8
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +12 -36
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js +11 -8
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +11 -10
- package/dist/controller/index.d.ts +21 -7
- package/dist/controller/index.js +11 -8
- package/dist/controller/utils.d.ts +3 -2
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +378 -0
- package/dist/schemas/model.schema.json +612 -0
- package/dist/schemas/session.schema.json +57 -0
- package/dist/types.d.ts +208 -0
- package/package.json +18 -14
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ConfigureLanguageOptionsProp } from '@pie-element/shared-types';
|
|
2
|
+
import type { Circle, Polygon, Rectangle } from '../types.js';
|
|
1
3
|
declare const _default: {
|
|
2
4
|
model: {
|
|
3
5
|
dimensions: {
|
|
@@ -7,113 +9,113 @@ declare const _default: {
|
|
|
7
9
|
hotspotColor: string;
|
|
8
10
|
hotspotList: string[];
|
|
9
11
|
imageUrl: string;
|
|
10
|
-
multipleCorrect:
|
|
12
|
+
multipleCorrect: true;
|
|
11
13
|
outlineColor: string;
|
|
12
14
|
outlineList: string[];
|
|
13
|
-
partialScoring:
|
|
15
|
+
partialScoring: false;
|
|
14
16
|
prompt: string;
|
|
15
|
-
promptEnabled:
|
|
16
|
-
rationaleEnabled:
|
|
17
|
+
promptEnabled: true;
|
|
18
|
+
rationaleEnabled: true;
|
|
17
19
|
shapes: {
|
|
18
|
-
rectangles:
|
|
19
|
-
polygons:
|
|
20
|
-
circles:
|
|
20
|
+
rectangles: Rectangle[];
|
|
21
|
+
polygons: Polygon[];
|
|
22
|
+
circles: Circle[];
|
|
21
23
|
};
|
|
22
24
|
strokeWidth: number;
|
|
23
|
-
studentInstructionsEnabled:
|
|
25
|
+
studentInstructionsEnabled: true;
|
|
24
26
|
teacherInstructions: string;
|
|
25
|
-
teacherInstructionsEnabled:
|
|
26
|
-
toolbarEditorPosition:
|
|
27
|
+
teacherInstructionsEnabled: true;
|
|
28
|
+
toolbarEditorPosition: "bottom";
|
|
27
29
|
};
|
|
28
30
|
configuration: {
|
|
29
31
|
baseInputConfiguration: {
|
|
30
32
|
h3: {
|
|
31
|
-
disabled:
|
|
33
|
+
disabled: true;
|
|
32
34
|
};
|
|
33
35
|
audio: {
|
|
34
|
-
disabled:
|
|
36
|
+
disabled: false;
|
|
35
37
|
};
|
|
36
38
|
video: {
|
|
37
|
-
disabled:
|
|
39
|
+
disabled: false;
|
|
38
40
|
};
|
|
39
41
|
image: {
|
|
40
|
-
disabled:
|
|
42
|
+
disabled: false;
|
|
41
43
|
};
|
|
42
44
|
textAlign: {
|
|
43
|
-
disabled:
|
|
45
|
+
disabled: true;
|
|
44
46
|
};
|
|
45
47
|
showParagraphs: {
|
|
46
|
-
disabled:
|
|
48
|
+
disabled: false;
|
|
47
49
|
};
|
|
48
50
|
separateParagraphs: {
|
|
49
|
-
disabled:
|
|
51
|
+
disabled: true;
|
|
50
52
|
};
|
|
51
53
|
};
|
|
52
54
|
multipleCorrect: {
|
|
53
|
-
settings:
|
|
55
|
+
settings: true;
|
|
54
56
|
label: string;
|
|
55
57
|
};
|
|
56
58
|
partialScoring: {
|
|
57
|
-
settings:
|
|
59
|
+
settings: false;
|
|
58
60
|
label: string;
|
|
59
61
|
};
|
|
60
62
|
rationale: {
|
|
61
|
-
settings:
|
|
63
|
+
settings: true;
|
|
62
64
|
label: string;
|
|
63
65
|
inputConfiguration: {
|
|
64
66
|
audio: {
|
|
65
|
-
disabled:
|
|
67
|
+
disabled: false;
|
|
66
68
|
};
|
|
67
69
|
video: {
|
|
68
|
-
disabled:
|
|
70
|
+
disabled: false;
|
|
69
71
|
};
|
|
70
72
|
image: {
|
|
71
|
-
disabled:
|
|
73
|
+
disabled: false;
|
|
72
74
|
};
|
|
73
75
|
};
|
|
74
|
-
required:
|
|
76
|
+
required: false;
|
|
75
77
|
};
|
|
76
78
|
prompt: {
|
|
77
|
-
settings:
|
|
79
|
+
settings: true;
|
|
78
80
|
label: string;
|
|
79
81
|
inputConfiguration: {
|
|
80
82
|
audio: {
|
|
81
|
-
disabled:
|
|
83
|
+
disabled: false;
|
|
82
84
|
};
|
|
83
85
|
video: {
|
|
84
|
-
disabled:
|
|
86
|
+
disabled: false;
|
|
85
87
|
};
|
|
86
88
|
image: {
|
|
87
|
-
disabled:
|
|
89
|
+
disabled: false;
|
|
88
90
|
};
|
|
89
91
|
};
|
|
90
|
-
required:
|
|
92
|
+
required: false;
|
|
91
93
|
};
|
|
92
|
-
settingsPanelDisabled:
|
|
94
|
+
settingsPanelDisabled: false;
|
|
93
95
|
spellCheck: {
|
|
94
96
|
label: string;
|
|
95
|
-
settings:
|
|
96
|
-
enabled:
|
|
97
|
+
settings: false;
|
|
98
|
+
enabled: true;
|
|
97
99
|
};
|
|
98
100
|
teacherInstructions: {
|
|
99
|
-
settings:
|
|
101
|
+
settings: true;
|
|
100
102
|
label: string;
|
|
101
103
|
inputConfiguration: {
|
|
102
104
|
audio: {
|
|
103
|
-
disabled:
|
|
105
|
+
disabled: false;
|
|
104
106
|
};
|
|
105
107
|
video: {
|
|
106
|
-
disabled:
|
|
108
|
+
disabled: false;
|
|
107
109
|
};
|
|
108
110
|
image: {
|
|
109
|
-
disabled:
|
|
111
|
+
disabled: false;
|
|
110
112
|
};
|
|
111
113
|
};
|
|
112
|
-
required:
|
|
114
|
+
required: false;
|
|
113
115
|
};
|
|
114
116
|
preserveAspectRatio: {
|
|
115
|
-
settings:
|
|
116
|
-
enabled:
|
|
117
|
+
settings: false;
|
|
118
|
+
enabled: true;
|
|
117
119
|
label: string;
|
|
118
120
|
};
|
|
119
121
|
minShapes: number;
|
|
@@ -128,21 +130,21 @@ declare const _default: {
|
|
|
128
130
|
rationale: number;
|
|
129
131
|
};
|
|
130
132
|
withRubric: {
|
|
131
|
-
settings:
|
|
133
|
+
settings: false;
|
|
132
134
|
label: string;
|
|
133
135
|
};
|
|
134
136
|
mathMlOptions: {
|
|
135
|
-
mmlOutput:
|
|
136
|
-
mmlEditing:
|
|
137
|
+
mmlOutput: false;
|
|
138
|
+
mmlEditing: false;
|
|
137
139
|
};
|
|
138
140
|
language: {
|
|
139
|
-
settings:
|
|
141
|
+
settings: false;
|
|
140
142
|
label: string;
|
|
141
|
-
enabled:
|
|
143
|
+
enabled: false;
|
|
142
144
|
};
|
|
143
145
|
languageChoices: {
|
|
144
146
|
label: string;
|
|
145
|
-
options:
|
|
147
|
+
options: ConfigureLanguageOptionsProp[];
|
|
146
148
|
};
|
|
147
149
|
};
|
|
148
150
|
};
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
|
|
2
|
+
import type { ImageHandler } from '@pie-element/shared-configure-events';
|
|
3
|
+
import type { Dimensions, Shapes } from '../types.js';
|
|
4
|
+
type ContainerProps = {
|
|
5
|
+
dimensions?: Dimensions;
|
|
6
|
+
imageUrl?: string;
|
|
7
|
+
hotspotColor?: string;
|
|
8
|
+
selectedHotspotColor?: string;
|
|
9
|
+
hoverOutlineColor?: string;
|
|
10
|
+
multipleCorrect?: boolean;
|
|
11
|
+
onImageUpload: (imageUrl: string) => void;
|
|
12
|
+
onUpdateImageDimension: (dimensions: Dimensions) => void;
|
|
13
|
+
insertImage?: (handler: ImageHandler) => void;
|
|
14
|
+
onUpdateShapes: (shapes: Shapes) => void;
|
|
15
|
+
outlineColor?: string;
|
|
16
|
+
shapes: Shapes;
|
|
17
|
+
strokeWidth?: number;
|
|
18
|
+
preserveAspectRatioEnabled?: boolean;
|
|
19
|
+
hasErrors?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare class Container extends Component<ContainerProps> {
|
|
3
22
|
static getDerivedStateFromProps(nextProps: any, prevState: any): any;
|
|
4
23
|
constructor(props: any);
|
|
5
24
|
handleFileRead: any;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
type PaletteProps = {
|
|
3
|
+
hotspotColor?: string;
|
|
4
|
+
hotspotList?: string[];
|
|
5
|
+
onHotspotColorChange: (color: string) => void;
|
|
6
|
+
onOutlineColorChange: (color: string) => void;
|
|
7
|
+
outlineColor?: string;
|
|
8
|
+
outlineList?: string[];
|
|
9
|
+
};
|
|
10
|
+
declare class Palette extends React.Component<PaletteProps> {
|
|
3
11
|
onChange: (name: any) => (event: any) => void;
|
|
4
12
|
render(): React.JSX.Element;
|
|
5
13
|
}
|
package/dist/author/index.d.ts
CHANGED
|
@@ -1,44 +1,29 @@
|
|
|
1
|
+
import { type DeleteDone, type ImageHandler, type SoundHandler } from '@pie-element/shared-configure-events';
|
|
2
|
+
import { type AuthorModel } from './root.js';
|
|
3
|
+
import type { Dimensions, HotspotConfiguration, HotspotModel, Shapes } from '../types.js';
|
|
1
4
|
export default class HotspotConfigure extends HTMLElement {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
dimensions: {
|
|
7
|
-
height: number;
|
|
8
|
-
width: number;
|
|
9
|
-
};
|
|
10
|
-
hotspotColor: string;
|
|
11
|
-
imageUrl: string;
|
|
12
|
-
multipleCorrect: boolean;
|
|
13
|
-
outlineColor: string;
|
|
14
|
-
partialScoring: boolean;
|
|
15
|
-
prompt: string;
|
|
16
|
-
promptEnabled: boolean;
|
|
17
|
-
rationaleEnabled: boolean;
|
|
18
|
-
strokeWidth: number;
|
|
19
|
-
studentInstructionsEnabled: boolean;
|
|
20
|
-
teacherInstructions: string;
|
|
21
|
-
teacherInstructionsEnabled: boolean;
|
|
22
|
-
toolbarEditorPosition: string;
|
|
23
|
-
};
|
|
5
|
+
private _root;
|
|
6
|
+
private _model;
|
|
7
|
+
private _configuration;
|
|
8
|
+
static createDefaultModel: (model?: Partial<HotspotModel>) => AuthorModel;
|
|
24
9
|
constructor();
|
|
25
|
-
set model(s:
|
|
26
|
-
set configuration(c:
|
|
27
|
-
dispatchModelUpdated(reset
|
|
28
|
-
onModelChanged(m:
|
|
29
|
-
onConfigurationChanged:
|
|
30
|
-
onModelChangedByConfig:
|
|
31
|
-
onColorChanged:
|
|
32
|
-
onPromptChanged:
|
|
33
|
-
onRationaleChanged:
|
|
34
|
-
onTeacherInstructionsChanged:
|
|
35
|
-
onUpdateImageDimension:
|
|
36
|
-
onUpdateShapes:
|
|
37
|
-
onImageUpload:
|
|
38
|
-
insertImage:
|
|
39
|
-
onDeleteImage:
|
|
40
|
-
insertSound(handler:
|
|
41
|
-
onDeleteSound(src:
|
|
10
|
+
set model(s: Partial<HotspotModel>);
|
|
11
|
+
set configuration(c: HotspotConfiguration);
|
|
12
|
+
dispatchModelUpdated(reset?: boolean): void;
|
|
13
|
+
onModelChanged(m: AuthorModel, reset?: boolean): void;
|
|
14
|
+
onConfigurationChanged: (c: HotspotConfiguration) => void;
|
|
15
|
+
onModelChangedByConfig: (m: AuthorModel, propertyType?: string) => void;
|
|
16
|
+
onColorChanged: (colorType: "hotspotColor" | "outlineColor", color: string) => void;
|
|
17
|
+
onPromptChanged: (prompt: string) => void;
|
|
18
|
+
onRationaleChanged: (rationale: string) => void;
|
|
19
|
+
onTeacherInstructionsChanged: (teacherInstructions: string) => void;
|
|
20
|
+
onUpdateImageDimension: (dimensions: Dimensions) => void;
|
|
21
|
+
onUpdateShapes: (shapes: Shapes) => void;
|
|
22
|
+
onImageUpload: (imageUrl: string) => void;
|
|
23
|
+
insertImage: (handler: ImageHandler) => void;
|
|
24
|
+
onDeleteImage: (src: string, done: DeleteDone) => void;
|
|
25
|
+
insertSound(handler: SoundHandler): void;
|
|
26
|
+
onDeleteSound(src: string, done: DeleteDone): void;
|
|
42
27
|
_render(): void;
|
|
43
28
|
connectedCallback(): void;
|
|
44
29
|
disconnectedCallback(): void;
|
package/dist/author/index.js
CHANGED
|
@@ -6,12 +6,15 @@ 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 = {}) => ({
|
|
10
13
|
...t.model,
|
|
11
14
|
...e,
|
|
12
15
|
hotspotList: e.hotspotList || [e.hotspotColor],
|
|
13
16
|
outlineList: e.outlineList || [e.outlineColor],
|
|
14
|
-
shapes: e.shapes || t.model.shapes
|
|
17
|
+
shapes: e.shapes || t.model.shapes
|
|
15
18
|
});
|
|
16
19
|
constructor() {
|
|
17
20
|
super(), this._root = null, this._model = i.createDefaultModel(), this._configuration = t.configuration, this.onModelChanged = this.onModelChanged.bind(this);
|
|
@@ -24,7 +27,7 @@ var u = i("hotspot:configure"), d = class i extends HTMLElement {
|
|
|
24
27
|
...t.configuration,
|
|
25
28
|
...e
|
|
26
29
|
};
|
|
27
|
-
this._configuration = n, n?.language?.enabled ? n?.languageChoices?.options?.length && (this._model.language = n?.languageChoices.options[0].value) : n.language.settings && this._model.language ? (
|
|
30
|
+
this._configuration = n, 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({
|
|
28
31
|
value: this._model.language,
|
|
29
32
|
label: this._model.language
|
|
30
33
|
})) : delete this._model.language, this._render();
|
package/dist/author/root.d.ts
CHANGED
|
@@ -1,7 +1,35 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { DeleteDone, ImageHandler, SoundHandler } from '@pie-element/shared-configure-events';
|
|
3
|
+
import type { HotspotValidationErrors } from '../controller/index.js';
|
|
4
|
+
import type { Dimensions, HotspotConfiguration, HotspotModel, Shapes } from '../types.js';
|
|
5
|
+
/** The model the author edits; the host sets `errors` from the controller's `validate()`. */
|
|
6
|
+
export type AuthorModel = Partial<HotspotModel> & {
|
|
7
|
+
shapes: Shapes;
|
|
8
|
+
dimensions: Dimensions;
|
|
9
|
+
errors?: HotspotValidationErrors;
|
|
10
|
+
};
|
|
11
|
+
type MediaSupport<Handler> = {
|
|
12
|
+
add: (handler: Handler) => void;
|
|
13
|
+
delete: (src: string, done: DeleteDone) => void;
|
|
14
|
+
};
|
|
15
|
+
export type RootProps = {
|
|
16
|
+
configuration: HotspotConfiguration;
|
|
17
|
+
model: AuthorModel;
|
|
18
|
+
imageSupport?: MediaSupport<ImageHandler>;
|
|
19
|
+
uploadSoundSupport?: MediaSupport<SoundHandler>;
|
|
20
|
+
onImageUpload: (imageUrl: string) => void;
|
|
21
|
+
onColorChanged: (colorType: 'hotspotColor' | 'outlineColor', color: string) => void;
|
|
22
|
+
onPromptChanged: (prompt: string) => void;
|
|
23
|
+
onUpdateImageDimension: (dimensions: Dimensions) => void;
|
|
24
|
+
onUpdateShapes: (shapes: Shapes) => void;
|
|
25
|
+
onModelChangedByConfig: (model: AuthorModel, propertyType?: string) => void;
|
|
26
|
+
onRationaleChanged: (rationale: string) => void;
|
|
27
|
+
onConfigurationChanged: (configuration: HotspotConfiguration) => void;
|
|
28
|
+
onTeacherInstructionsChanged: (teacherInstructions: string) => void;
|
|
29
|
+
};
|
|
30
|
+
export declare class Root extends React.Component<RootProps> {
|
|
31
|
+
handleColorChange: (fieldType: "hotspot" | "outline", color: string) => void;
|
|
32
|
+
handleOnUpdateImageDimensions: (value: number, resizeType: "width" | "height") => void;
|
|
5
33
|
render(): React.JSX.Element;
|
|
6
34
|
}
|
|
7
35
|
export default Root;
|
package/dist/author/root.js
CHANGED
|
@@ -2,38 +2,37 @@ import e from "./hotspot-palette.js";
|
|
|
2
2
|
import { generateValidationMessage as t, getAllShapes as n, getUpdatedShapes as r, groupShapes as i, updateImageDimensions as a } from "./utils.js";
|
|
3
3
|
import { Container as o } from "./hotspot-container.js";
|
|
4
4
|
import s from "react";
|
|
5
|
-
import c from "
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import g from "@
|
|
10
|
-
import _ from "@mui/material/Typography";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
import { styled as u } from "@mui/material/styles";
|
|
7
|
+
import { InputContainer as d, NumberTextField as f, layout as p, settings as m } from "@pie-lib/config-ui";
|
|
8
|
+
import h from "@pie-lib/editable-html-tip-tap";
|
|
9
|
+
import g from "@mui/material/Typography";
|
|
11
10
|
import ee from "@mui/icons-material/Info";
|
|
12
|
-
import
|
|
11
|
+
import _ from "@mui/material/Tooltip";
|
|
13
12
|
//#region src/author/root.tsx
|
|
14
|
-
var { Panel: te, toggle:
|
|
13
|
+
var { Panel: te, toggle: v, dropdown: y } = m, b = (e) => e != null, ne = u("div")(({ theme: e }) => ({
|
|
15
14
|
display: "flex",
|
|
16
15
|
marginBottom: e.spacing(1.5)
|
|
17
|
-
})), x =
|
|
16
|
+
})), x = u("div")({
|
|
18
17
|
flex: 1,
|
|
19
18
|
width: "90%"
|
|
20
|
-
}), S = d
|
|
19
|
+
}), S = u(d)(({ theme: e }) => ({
|
|
21
20
|
paddingTop: e.spacing(1),
|
|
22
21
|
marginTop: e.spacing(2),
|
|
23
22
|
marginBottom: e.spacing(2),
|
|
24
23
|
width: "100%"
|
|
25
|
-
})),
|
|
24
|
+
})), C = u(g)(({ theme: e }) => ({ marginRight: e.spacing(1) })), re = u("div")({
|
|
26
25
|
display: "flex",
|
|
27
26
|
alignItems: "center"
|
|
28
|
-
}),
|
|
27
|
+
}), ie = u(_)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
|
|
29
28
|
fontSize: e.typography.fontSize - 2,
|
|
30
29
|
whiteSpace: "pre",
|
|
31
30
|
maxWidth: "500px"
|
|
32
|
-
} })),
|
|
31
|
+
} })), w = u("div")(({ theme: e }) => ({
|
|
33
32
|
fontSize: e.typography.fontSize - 2,
|
|
34
33
|
color: e.palette.error.main,
|
|
35
34
|
paddingTop: e.spacing(1)
|
|
36
|
-
})),
|
|
35
|
+
})), T = class extends s.Component {
|
|
37
36
|
handleColorChange = (e, t) => {
|
|
38
37
|
let { onColorChanged: n } = this.props;
|
|
39
38
|
n(`${e}Color`, t);
|
|
@@ -46,41 +45,41 @@ var { Panel: te, toggle: y, dropdown: b } = h, ne = (e) => e != null, re = d("di
|
|
|
46
45
|
u(i(r(o, d, n(s)))), l(d);
|
|
47
46
|
};
|
|
48
47
|
render() {
|
|
49
|
-
let { configuration: n, model: r, imageSupport: i, uploadSoundSupport: a, onConfigurationChanged:
|
|
50
|
-
multipleCorrect: O.settings &&
|
|
51
|
-
partialScoring: k.settings &&
|
|
52
|
-
promptEnabled: j.settings &&
|
|
53
|
-
"language.enabled": R.settings &&
|
|
54
|
-
language: R.settings && R.enabled &&
|
|
48
|
+
let { configuration: n, model: r, imageSupport: i, uploadSoundSupport: a, onConfigurationChanged: u, onImageUpload: d, onModelChangedByConfig: m, onPromptChanged: _, onRationaleChanged: T, onUpdateImageDimension: ae, onTeacherInstructionsChanged: oe, onUpdateShapes: se } = this.props, { baseInputConfiguration: ce = {}, contentDimensions: le = {}, maxImageWidth: E = {}, maxImageHeight: D = {}, multipleCorrect: O = {}, partialScoring: k = {}, preserveAspectRatio: A = {}, prompt: j = {}, rationale: M = {}, settingsPanelDisabled: N, spellCheck: P = {}, teacherInstructions: F = {}, withRubric: I = {}, mathMlOptions: L = {}, language: R = {}, languageChoices: z = {} } = n || {}, { errors: B, extraCSSRules: V, promptEnabled: H, rationaleEnabled: U, spellCheckEnabled: W, teacherInstructionsEnabled: ue, toolbarEditorPosition: de } = r || {}, { prompt: G, rationale: K, shapes: q, selections: J, teacherInstructions: Y } = B || {}, fe = t(n), X = E && E.prompt, Z = D && D.prompt, Q = { position: de === "top" ? "top" : "bottom" }, pe = {
|
|
49
|
+
multipleCorrect: O.settings && v(O.label),
|
|
50
|
+
partialScoring: k.settings && v(k.label),
|
|
51
|
+
promptEnabled: j.settings && v(j.label),
|
|
52
|
+
"language.enabled": R.settings && v(R.label, !0),
|
|
53
|
+
language: R.settings && R.enabled && y(z.label, z.options)
|
|
55
54
|
}, me = {
|
|
56
|
-
teacherInstructionsEnabled: F.settings &&
|
|
57
|
-
rationaleEnabled: M.settings &&
|
|
58
|
-
spellCheckEnabled: P.settings &&
|
|
59
|
-
rubricEnabled: I?.settings &&
|
|
55
|
+
teacherInstructionsEnabled: F.settings && v(F.label),
|
|
56
|
+
rationaleEnabled: M.settings && v(M.label),
|
|
57
|
+
spellCheckEnabled: P.settings && v(P.label),
|
|
58
|
+
rubricEnabled: I?.settings && v(I?.label)
|
|
60
59
|
}, $ = (e = {}) => ({
|
|
61
|
-
...
|
|
60
|
+
...ce,
|
|
62
61
|
...e
|
|
63
62
|
});
|
|
64
|
-
return /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ l(p.ConfigLayout, {
|
|
65
64
|
extraCSSRules: V,
|
|
66
|
-
dimensions:
|
|
65
|
+
dimensions: le,
|
|
67
66
|
hideSettings: N,
|
|
68
|
-
settings: /* @__PURE__ */
|
|
67
|
+
settings: /* @__PURE__ */ c(te, {
|
|
69
68
|
model: r,
|
|
70
|
-
onChangeModel:
|
|
69
|
+
onChangeModel: m,
|
|
71
70
|
configuration: n,
|
|
72
|
-
onChangeConfiguration:
|
|
71
|
+
onChangeConfiguration: u,
|
|
73
72
|
groups: {
|
|
74
73
|
Settings: pe,
|
|
75
74
|
Properties: me
|
|
76
75
|
}
|
|
77
76
|
}),
|
|
78
77
|
children: [
|
|
79
|
-
ue && /* @__PURE__ */
|
|
78
|
+
ue && /* @__PURE__ */ l(S, {
|
|
80
79
|
label: F.label,
|
|
81
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ c(h, {
|
|
82
81
|
markup: r.teacherInstructions || "",
|
|
83
|
-
onChange:
|
|
82
|
+
onChange: oe,
|
|
84
83
|
imageSupport: i,
|
|
85
84
|
nonEmpty: !1,
|
|
86
85
|
error: Y,
|
|
@@ -92,13 +91,13 @@ var { Panel: te, toggle: y, dropdown: b } = h, ne = (e) => e != null, re = d("di
|
|
|
92
91
|
uploadSoundSupport: a,
|
|
93
92
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
94
93
|
mathMlOptions: L
|
|
95
|
-
}), Y && /* @__PURE__ */
|
|
94
|
+
}), Y && /* @__PURE__ */ c(w, { children: Y })]
|
|
96
95
|
}),
|
|
97
|
-
H && /* @__PURE__ */
|
|
96
|
+
H && /* @__PURE__ */ l(S, {
|
|
98
97
|
label: j.label,
|
|
99
|
-
children: [/* @__PURE__ */
|
|
98
|
+
children: [/* @__PURE__ */ c(h, {
|
|
100
99
|
markup: r.prompt || "",
|
|
101
|
-
onChange:
|
|
100
|
+
onChange: _,
|
|
102
101
|
imageSupport: i,
|
|
103
102
|
nonEmpty: !1,
|
|
104
103
|
error: G,
|
|
@@ -110,23 +109,23 @@ var { Panel: te, toggle: y, dropdown: b } = h, ne = (e) => e != null, re = d("di
|
|
|
110
109
|
uploadSoundSupport: a,
|
|
111
110
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
112
111
|
mathMlOptions: L
|
|
113
|
-
}), G && /* @__PURE__ */
|
|
112
|
+
}), G && /* @__PURE__ */ c(w, { children: G })]
|
|
114
113
|
}),
|
|
115
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ l(re, { children: [/* @__PURE__ */ c(C, {
|
|
116
115
|
variant: "h6",
|
|
117
116
|
children: "Define Hotspot"
|
|
118
|
-
}), /* @__PURE__ */
|
|
117
|
+
}), /* @__PURE__ */ c(ie, {
|
|
119
118
|
disableFocusListener: !0,
|
|
120
119
|
disableTouchListener: !0,
|
|
121
120
|
placement: "left",
|
|
122
121
|
title: fe,
|
|
123
|
-
children: /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ c(ee, {
|
|
124
123
|
fontSize: "small",
|
|
125
124
|
color: "primary",
|
|
126
125
|
style: { float: "right" }
|
|
127
126
|
})
|
|
128
127
|
})] }),
|
|
129
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ c(e, {
|
|
130
129
|
hotspotColor: r.hotspotColor,
|
|
131
130
|
hotspotList: r.hotspotList,
|
|
132
131
|
outlineColor: r.outlineColor,
|
|
@@ -134,7 +133,7 @@ var { Panel: te, toggle: y, dropdown: b } = h, ne = (e) => e != null, re = d("di
|
|
|
134
133
|
onHotspotColorChange: (e) => this.handleColorChange("hotspot", e),
|
|
135
134
|
onOutlineColorChange: (e) => this.handleColorChange("outline", e)
|
|
136
135
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ c(o, {
|
|
138
137
|
dimensions: r.dimensions,
|
|
139
138
|
imageUrl: r.imageUrl,
|
|
140
139
|
multipleCorrect: r.multipleCorrect,
|
|
@@ -142,38 +141,38 @@ var { Panel: te, toggle: y, dropdown: b } = h, ne = (e) => e != null, re = d("di
|
|
|
142
141
|
hotspotColor: r.hotspotColor,
|
|
143
142
|
outlineColor: r.outlineColor,
|
|
144
143
|
selectedHotspotColor: r.selectedHotspotColor,
|
|
145
|
-
hoverOutlineColor:
|
|
146
|
-
onUpdateImageDimension:
|
|
147
|
-
onUpdateShapes:
|
|
144
|
+
hoverOutlineColor: b(r.hoverOutlineColor) ? r.hoverOutlineColor : "black",
|
|
145
|
+
onUpdateImageDimension: ae,
|
|
146
|
+
onUpdateShapes: se,
|
|
148
147
|
onImageUpload: d,
|
|
149
148
|
shapes: r.shapes,
|
|
150
149
|
strokeWidth: r.strokeWidth,
|
|
151
150
|
preserveAspectRatioEnabled: A.enabled,
|
|
152
151
|
insertImage: i && i.add
|
|
153
152
|
}),
|
|
154
|
-
q && /* @__PURE__ */
|
|
155
|
-
J && /* @__PURE__ */
|
|
156
|
-
r.imageUrl && /* @__PURE__ */
|
|
153
|
+
q && /* @__PURE__ */ c(w, { children: q }),
|
|
154
|
+
J && /* @__PURE__ */ c(w, { children: J }),
|
|
155
|
+
r.imageUrl && /* @__PURE__ */ l(s.Fragment, { children: [/* @__PURE__ */ c(g, {
|
|
157
156
|
variant: "h6",
|
|
158
157
|
children: "Image Dimensions"
|
|
159
|
-
}), /* @__PURE__ */
|
|
158
|
+
}), /* @__PURE__ */ l(ne, { children: [/* @__PURE__ */ c(x, { children: /* @__PURE__ */ c(f, {
|
|
160
159
|
label: "Width",
|
|
161
160
|
value: r.dimensions.width,
|
|
162
161
|
min: 0,
|
|
163
162
|
onChange: (e, t) => this.handleOnUpdateImageDimensions(t, "width"),
|
|
164
163
|
showErrorWhenOutsideRange: !0
|
|
165
|
-
}, "hotspot-manual-width") }), /* @__PURE__ */
|
|
164
|
+
}, "hotspot-manual-width") }), /* @__PURE__ */ c(x, { children: /* @__PURE__ */ c(f, {
|
|
166
165
|
label: "Height",
|
|
167
166
|
value: r.dimensions.height,
|
|
168
167
|
min: 0,
|
|
169
168
|
onChange: (e, t) => this.handleOnUpdateImageDimensions(t, "height"),
|
|
170
169
|
showErrorWhenOutsideRange: !0
|
|
171
170
|
}, "hotspot-manual-height") })] })] }),
|
|
172
|
-
U && /* @__PURE__ */
|
|
171
|
+
U && /* @__PURE__ */ l(S, {
|
|
173
172
|
label: M.label,
|
|
174
|
-
children: [/* @__PURE__ */
|
|
173
|
+
children: [/* @__PURE__ */ c(h, {
|
|
175
174
|
markup: r.rationale || "",
|
|
176
|
-
onChange:
|
|
175
|
+
onChange: T,
|
|
177
176
|
imageSupport: i,
|
|
178
177
|
error: K,
|
|
179
178
|
toolbarOpts: Q,
|
|
@@ -184,32 +183,11 @@ var { Panel: te, toggle: y, dropdown: b } = h, ne = (e) => e != null, re = d("di
|
|
|
184
183
|
uploadSoundSupport: a,
|
|
185
184
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
186
185
|
mathMlOptions: L
|
|
187
|
-
}), K && /* @__PURE__ */
|
|
186
|
+
}), K && /* @__PURE__ */ c(w, { children: K })]
|
|
188
187
|
})
|
|
189
188
|
]
|
|
190
189
|
});
|
|
191
190
|
}
|
|
192
191
|
};
|
|
193
|
-
w.propTypes = {
|
|
194
|
-
configuration: c.object,
|
|
195
|
-
model: c.object.isRequired,
|
|
196
|
-
imageSupport: c.shape({
|
|
197
|
-
add: c.func,
|
|
198
|
-
delete: c.func
|
|
199
|
-
}),
|
|
200
|
-
uploadSoundSupport: c.shape({
|
|
201
|
-
add: c.func,
|
|
202
|
-
delete: c.func
|
|
203
|
-
}),
|
|
204
|
-
onImageUpload: c.func.isRequired,
|
|
205
|
-
onColorChanged: c.func.isRequired,
|
|
206
|
-
onPromptChanged: c.func.isRequired,
|
|
207
|
-
onUpdateImageDimension: c.func.isRequired,
|
|
208
|
-
onUpdateShapes: c.func.isRequired,
|
|
209
|
-
onModelChangedByConfig: c.func.isRequired,
|
|
210
|
-
onRationaleChanged: c.func.isRequired,
|
|
211
|
-
onConfigurationChanged: c.func.isRequired,
|
|
212
|
-
onTeacherInstructionsChanged: c.func.isRequired
|
|
213
|
-
};
|
|
214
192
|
//#endregion
|
|
215
|
-
export {
|
|
193
|
+
export { T as Root, T as default };
|