@pie-element/hotspot 11.1.2-next.1 → 11.1.2-next.10
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/hotspot-container.js +2 -2
- package/dist/author/hotspot-drawable.js +1 -1
- package/dist/author/hotspot-polygon.js +2 -2
- package/dist/author/index.d.ts +1 -0
- package/dist/author/index.js +5 -2
- package/dist/author/root.js +52 -52
- package/dist/author/utils.js +1 -1
- package/dist/browser/{ReactKonva-Z9-1H-UZ.js → ReactKonva-Cj44B3Ds.js} +3504 -3535
- package/dist/browser/ReactKonva-Cj44B3Ds.js.map +1 -0
- package/dist/browser/author/index.js +24273 -21426
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/{browser-CfnAFove.js → browser-D4gLESxz.js} +9 -2
- package/dist/browser/{browser-CfnAFove.js.map → browser-D4gLESxz.js.map} +1 -1
- package/dist/browser/controller/index.js +32 -32
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +628 -519
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/{dist-C78LDz6R.js → dist-CJeYAWp3.js} +6 -2
- package/dist/browser/dist-CJeYAWp3.js.map +1 -0
- package/dist/controller/index.js +36 -36
- package/dist/controller/utils.js +1 -1
- package/dist/delivery/hotspot/circle.d.ts +3 -0
- package/dist/delivery/hotspot/circle.js +40 -27
- package/dist/delivery/hotspot/container.d.ts +5 -0
- package/dist/delivery/hotspot/container.js +163 -96
- package/dist/delivery/hotspot/index.d.ts +1 -0
- package/dist/delivery/hotspot/index.js +41 -36
- package/dist/delivery/hotspot/polygon.d.ts +3 -0
- package/dist/delivery/hotspot/polygon.js +39 -26
- package/dist/delivery/hotspot/rectangle.d.ts +3 -0
- package/dist/delivery/hotspot/rectangle.js +40 -28
- package/dist/delivery/index.js +3 -3
- package/dist/index.iife.js +40 -40
- package/package.json +16 -17
- package/dist/browser/ReactKonva-Z9-1H-UZ.js.map +0 -1
- package/dist/browser/dist-C78LDz6R.js.map +0 -1
|
@@ -4,7 +4,7 @@ import { PolygonButton as n } from "./buttons/polygon.js";
|
|
|
4
4
|
import { RectangleButton as r } from "./buttons/rectangle.js";
|
|
5
5
|
import { SUPPORTED_SHAPES as i } from "./shapes/utils.js";
|
|
6
6
|
import { getAllShapes as a, groupShapes as o } from "./utils.js";
|
|
7
|
-
import s from "./hotspot-drawable.js";
|
|
7
|
+
import { Drawable as s } from "./hotspot-drawable.js";
|
|
8
8
|
import c from "./upload-control.js";
|
|
9
9
|
import { Component as l } from "react";
|
|
10
10
|
import u from "prop-types";
|
|
@@ -207,4 +207,4 @@ S.propTypes = {
|
|
|
207
207
|
hasErrors: u.bool
|
|
208
208
|
}, S.defaultProps = { strokeWidth: 5 };
|
|
209
209
|
//#endregion
|
|
210
|
-
export { S as default };
|
|
210
|
+
export { S as Container, S as default };
|
|
@@ -87,7 +87,7 @@ var d = u(a, "Circle"), f = u(s, "Line"), p = u(o, "Group"), m = "#00BFFF", h =
|
|
|
87
87
|
this.setState({
|
|
88
88
|
points: a,
|
|
89
89
|
...this.getOffset(a),
|
|
90
|
-
isDragging: t
|
|
90
|
+
isDragging: !t && this.state.isDragging
|
|
91
91
|
}), t && n(r, { points: a });
|
|
92
92
|
};
|
|
93
93
|
handleOnDragVertex = (e, t, n) => {
|
|
@@ -98,7 +98,7 @@ var d = u(a, "Circle"), f = u(s, "Line"), p = u(o, "Group"), m = "#00BFFF", h =
|
|
|
98
98
|
this.setState({
|
|
99
99
|
points: o,
|
|
100
100
|
...this.getOffset(o),
|
|
101
|
-
isDragging: n
|
|
101
|
+
isDragging: !n && this.state.isDragging
|
|
102
102
|
}), n && r(i, { points: o });
|
|
103
103
|
};
|
|
104
104
|
onDragStart = () => {
|
package/dist/author/index.d.ts
CHANGED
package/dist/author/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e from "./root.js";
|
|
1
|
+
import { Root as e } from "./root.js";
|
|
2
2
|
import t from "./defaults.js";
|
|
3
3
|
import n from "react";
|
|
4
4
|
import { createRoot as r } from "react-dom/client";
|
|
@@ -135,8 +135,11 @@ var u = i("hotspot:configure"), d = class i extends HTMLElement {
|
|
|
135
135
|
});
|
|
136
136
|
this._root ||= r(this), this._root.render(t);
|
|
137
137
|
}
|
|
138
|
+
connectedCallback() {
|
|
139
|
+
this._render();
|
|
140
|
+
}
|
|
138
141
|
disconnectedCallback() {
|
|
139
|
-
this._root
|
|
142
|
+
this._root &&= (this._root.unmount(), null);
|
|
140
143
|
}
|
|
141
144
|
};
|
|
142
145
|
//#endregion
|
package/dist/author/root.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
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
|
-
import o from "./hotspot-container.js";
|
|
3
|
+
import { Container as o } from "./hotspot-container.js";
|
|
4
4
|
import s from "react";
|
|
5
5
|
import c from "prop-types";
|
|
6
6
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
@@ -8,10 +8,10 @@ import { styled as d } from "@mui/material/styles";
|
|
|
8
8
|
import { InputContainer as f, NumberTextField as p, layout as m, settings as h } from "@pie-lib/config-ui";
|
|
9
9
|
import g from "@pie-lib/editable-html-tip-tap";
|
|
10
10
|
import _ from "@mui/material/Typography";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
11
|
+
import ee from "@mui/icons-material/Info";
|
|
12
|
+
import v from "@mui/material/Tooltip";
|
|
13
13
|
//#region src/author/root.tsx
|
|
14
|
-
var { Panel:
|
|
14
|
+
var { Panel: te, toggle: y, dropdown: b } = h, ne = (e) => e != null, re = d("div")(({ theme: e }) => ({
|
|
15
15
|
display: "flex",
|
|
16
16
|
marginBottom: e.spacing(1.5)
|
|
17
17
|
})), x = d("div")({
|
|
@@ -22,18 +22,18 @@ var { Panel: ee, toggle: b, dropdown: te } = h, ne = d("div")(({ theme: e }) =>
|
|
|
22
22
|
marginTop: e.spacing(2),
|
|
23
23
|
marginBottom: e.spacing(2),
|
|
24
24
|
width: "100%"
|
|
25
|
-
})),
|
|
25
|
+
})), ie = d(_)(({ theme: e }) => ({ marginRight: e.spacing(1) })), ae = d("div")({
|
|
26
26
|
display: "flex",
|
|
27
27
|
alignItems: "center"
|
|
28
|
-
}),
|
|
28
|
+
}), oe = d(v)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
|
|
29
29
|
fontSize: e.typography.fontSize - 2,
|
|
30
30
|
whiteSpace: "pre",
|
|
31
31
|
maxWidth: "500px"
|
|
32
|
-
} })),
|
|
32
|
+
} })), C = d("div")(({ theme: e }) => ({
|
|
33
33
|
fontSize: e.typography.fontSize - 2,
|
|
34
34
|
color: e.palette.error.main,
|
|
35
35
|
paddingTop: e.spacing(1)
|
|
36
|
-
})),
|
|
36
|
+
})), w = class extends s.Component {
|
|
37
37
|
handleColorChange = (e, t) => {
|
|
38
38
|
let { onColorChanged: n } = this.props;
|
|
39
39
|
n(`${e}Color`, t);
|
|
@@ -46,56 +46,56 @@ var { Panel: ee, toggle: b, dropdown: te } = h, ne = d("div")(({ theme: e }) =>
|
|
|
46
46
|
u(i(r(o, d, n(s)))), l(d);
|
|
47
47
|
};
|
|
48
48
|
render() {
|
|
49
|
-
let { configuration: n, model: r, imageSupport: i, uploadSoundSupport: a, onConfigurationChanged: c, onImageUpload: d, onModelChangedByConfig: f, onPromptChanged: h, onRationaleChanged:
|
|
50
|
-
multipleCorrect:
|
|
51
|
-
partialScoring:
|
|
52
|
-
promptEnabled:
|
|
53
|
-
"language.enabled": R.settings &&
|
|
54
|
-
language: R.settings && R.enabled &&
|
|
55
|
-
},
|
|
56
|
-
teacherInstructionsEnabled: F.settings &&
|
|
57
|
-
rationaleEnabled:
|
|
58
|
-
spellCheckEnabled: P.settings &&
|
|
59
|
-
rubricEnabled: I?.settings &&
|
|
49
|
+
let { configuration: n, model: r, imageSupport: i, uploadSoundSupport: a, onConfigurationChanged: c, onImageUpload: d, onModelChangedByConfig: f, onPromptChanged: h, onRationaleChanged: v, onUpdateImageDimension: w, onTeacherInstructionsChanged: se, onUpdateShapes: ce } = this.props, { baseInputConfiguration: le = {}, contentDimensions: T = {}, 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 = {
|
|
50
|
+
multipleCorrect: O.settings && y(O.label),
|
|
51
|
+
partialScoring: k.settings && y(k.label),
|
|
52
|
+
promptEnabled: j.settings && y(j.label),
|
|
53
|
+
"language.enabled": R.settings && y(R.label, !0),
|
|
54
|
+
language: R.settings && R.enabled && b(z.label, z.options)
|
|
55
|
+
}, me = {
|
|
56
|
+
teacherInstructionsEnabled: F.settings && y(F.label),
|
|
57
|
+
rationaleEnabled: M.settings && y(M.label),
|
|
58
|
+
spellCheckEnabled: P.settings && y(P.label),
|
|
59
|
+
rubricEnabled: I?.settings && y(I?.label)
|
|
60
60
|
}, $ = (e = {}) => ({
|
|
61
|
-
...
|
|
61
|
+
...le,
|
|
62
62
|
...e
|
|
63
63
|
});
|
|
64
64
|
return /* @__PURE__ */ u(m.ConfigLayout, {
|
|
65
65
|
extraCSSRules: V,
|
|
66
|
-
dimensions:
|
|
67
|
-
hideSettings:
|
|
68
|
-
settings: /* @__PURE__ */ l(
|
|
66
|
+
dimensions: T,
|
|
67
|
+
hideSettings: N,
|
|
68
|
+
settings: /* @__PURE__ */ l(te, {
|
|
69
69
|
model: r,
|
|
70
70
|
onChangeModel: f,
|
|
71
71
|
configuration: n,
|
|
72
72
|
onChangeConfiguration: c,
|
|
73
73
|
groups: {
|
|
74
|
-
Settings:
|
|
75
|
-
Properties:
|
|
74
|
+
Settings: pe,
|
|
75
|
+
Properties: me
|
|
76
76
|
}
|
|
77
77
|
}),
|
|
78
78
|
children: [
|
|
79
|
-
|
|
79
|
+
ue && /* @__PURE__ */ u(S, {
|
|
80
80
|
label: F.label,
|
|
81
81
|
children: [/* @__PURE__ */ l(g, {
|
|
82
82
|
markup: r.teacherInstructions || "",
|
|
83
|
-
onChange:
|
|
83
|
+
onChange: se,
|
|
84
84
|
imageSupport: i,
|
|
85
85
|
nonEmpty: !1,
|
|
86
86
|
error: Y,
|
|
87
87
|
toolbarOpts: Q,
|
|
88
88
|
pluginProps: $(F?.inputConfiguration),
|
|
89
89
|
spellCheck: W,
|
|
90
|
-
maxImageWidth:
|
|
91
|
-
maxImageHeight:
|
|
90
|
+
maxImageWidth: E && E.teacherInstructions || X,
|
|
91
|
+
maxImageHeight: D && D.teacherInstructions || Z,
|
|
92
92
|
uploadSoundSupport: a,
|
|
93
93
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
94
94
|
mathMlOptions: L
|
|
95
|
-
}), Y && /* @__PURE__ */ l(
|
|
95
|
+
}), Y && /* @__PURE__ */ l(C, { children: Y })]
|
|
96
96
|
}),
|
|
97
97
|
H && /* @__PURE__ */ u(S, {
|
|
98
|
-
label:
|
|
98
|
+
label: j.label,
|
|
99
99
|
children: [/* @__PURE__ */ l(g, {
|
|
100
100
|
markup: r.prompt || "",
|
|
101
101
|
onChange: h,
|
|
@@ -103,24 +103,24 @@ var { Panel: ee, toggle: b, dropdown: te } = h, ne = d("div")(({ theme: e }) =>
|
|
|
103
103
|
nonEmpty: !1,
|
|
104
104
|
error: G,
|
|
105
105
|
toolbarOpts: Q,
|
|
106
|
-
pluginProps: $(
|
|
106
|
+
pluginProps: $(j?.inputConfiguration),
|
|
107
107
|
spellCheck: W,
|
|
108
108
|
maxImageWidth: X,
|
|
109
109
|
maxImageHeight: Z,
|
|
110
110
|
uploadSoundSupport: a,
|
|
111
111
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
112
112
|
mathMlOptions: L
|
|
113
|
-
}), G && /* @__PURE__ */ l(
|
|
113
|
+
}), G && /* @__PURE__ */ l(C, { children: G })]
|
|
114
114
|
}),
|
|
115
|
-
/* @__PURE__ */ u(
|
|
115
|
+
/* @__PURE__ */ u(ae, { children: [/* @__PURE__ */ l(ie, {
|
|
116
116
|
variant: "h6",
|
|
117
117
|
children: "Define Hotspot"
|
|
118
|
-
}), /* @__PURE__ */ l(
|
|
118
|
+
}), /* @__PURE__ */ l(oe, {
|
|
119
119
|
disableFocusListener: !0,
|
|
120
120
|
disableTouchListener: !0,
|
|
121
121
|
placement: "left",
|
|
122
|
-
title:
|
|
123
|
-
children: /* @__PURE__ */ l(
|
|
122
|
+
title: fe,
|
|
123
|
+
children: /* @__PURE__ */ l(ee, {
|
|
124
124
|
fontSize: "small",
|
|
125
125
|
color: "primary",
|
|
126
126
|
style: { float: "right" }
|
|
@@ -142,21 +142,21 @@ var { Panel: ee, toggle: b, dropdown: te } = h, ne = d("div")(({ theme: e }) =>
|
|
|
142
142
|
hotspotColor: r.hotspotColor,
|
|
143
143
|
outlineColor: r.outlineColor,
|
|
144
144
|
selectedHotspotColor: r.selectedHotspotColor,
|
|
145
|
-
hoverOutlineColor: r.hoverOutlineColor,
|
|
146
|
-
onUpdateImageDimension:
|
|
147
|
-
onUpdateShapes:
|
|
145
|
+
hoverOutlineColor: ne(r.hoverOutlineColor) ? r.hoverOutlineColor : "black",
|
|
146
|
+
onUpdateImageDimension: w,
|
|
147
|
+
onUpdateShapes: ce,
|
|
148
148
|
onImageUpload: d,
|
|
149
149
|
shapes: r.shapes,
|
|
150
150
|
strokeWidth: r.strokeWidth,
|
|
151
|
-
preserveAspectRatioEnabled:
|
|
151
|
+
preserveAspectRatioEnabled: A.enabled,
|
|
152
152
|
insertImage: i && i.add
|
|
153
153
|
}),
|
|
154
|
-
q && /* @__PURE__ */ l(
|
|
155
|
-
J && /* @__PURE__ */ l(
|
|
154
|
+
q && /* @__PURE__ */ l(C, { children: q }),
|
|
155
|
+
J && /* @__PURE__ */ l(C, { children: J }),
|
|
156
156
|
r.imageUrl && /* @__PURE__ */ u(s.Fragment, { children: [/* @__PURE__ */ l(_, {
|
|
157
157
|
variant: "h6",
|
|
158
158
|
children: "Image Dimensions"
|
|
159
|
-
}), /* @__PURE__ */ u(
|
|
159
|
+
}), /* @__PURE__ */ u(re, { children: [/* @__PURE__ */ l(x, { children: /* @__PURE__ */ l(p, {
|
|
160
160
|
label: "Width",
|
|
161
161
|
value: r.dimensions.width,
|
|
162
162
|
min: 0,
|
|
@@ -170,27 +170,27 @@ var { Panel: ee, toggle: b, dropdown: te } = h, ne = d("div")(({ theme: e }) =>
|
|
|
170
170
|
showErrorWhenOutsideRange: !0
|
|
171
171
|
}, "hotspot-manual-height") })] })] }),
|
|
172
172
|
U && /* @__PURE__ */ u(S, {
|
|
173
|
-
label:
|
|
173
|
+
label: M.label,
|
|
174
174
|
children: [/* @__PURE__ */ l(g, {
|
|
175
175
|
markup: r.rationale || "",
|
|
176
|
-
onChange:
|
|
176
|
+
onChange: v,
|
|
177
177
|
imageSupport: i,
|
|
178
178
|
error: K,
|
|
179
179
|
toolbarOpts: Q,
|
|
180
|
-
pluginProps: $(
|
|
180
|
+
pluginProps: $(M?.inputConfiguration),
|
|
181
181
|
spellCheck: W,
|
|
182
|
-
maxImageWidth:
|
|
183
|
-
maxImageHeight:
|
|
182
|
+
maxImageWidth: E && E.rationale || X,
|
|
183
|
+
maxImageHeight: D && D.rationale || Z,
|
|
184
184
|
uploadSoundSupport: a,
|
|
185
185
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
186
186
|
mathMlOptions: L
|
|
187
|
-
}), K && /* @__PURE__ */ l(
|
|
187
|
+
}), K && /* @__PURE__ */ l(C, { children: K })]
|
|
188
188
|
})
|
|
189
189
|
]
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
};
|
|
193
|
-
|
|
193
|
+
w.propTypes = {
|
|
194
194
|
configuration: c.object,
|
|
195
195
|
model: c.object.isRequired,
|
|
196
196
|
imageSupport: c.shape({
|
|
@@ -212,4 +212,4 @@ T.propTypes = {
|
|
|
212
212
|
onTeacherInstructionsChanged: c.func.isRequired
|
|
213
213
|
};
|
|
214
214
|
//#endregion
|
|
215
|
-
export {
|
|
215
|
+
export { w as Root, w as default };
|
package/dist/author/utils.js
CHANGED
|
@@ -80,4 +80,4 @@ var n = (e, t, n, r) => {
|
|
|
80
80
|
return "Validation requirements:" + i + a;
|
|
81
81
|
};
|
|
82
82
|
//#endregion
|
|
83
|
-
export { d as calculate, f as generateValidationMessage, c as getAllShapes, s as getUpdatedShapes, l as groupShapes, n as updateImageDimensions };
|
|
83
|
+
export { d as calculate, f as generateValidationMessage, c as getAllShapes, o as getUpdatedPolygon, i as getUpdatedRectangle, s as getUpdatedShapes, l as groupShapes, u as isPointInsidePolygon, n as updateImageDimensions };
|