@pie-element/hotspot 11.1.2-next.5 → 11.1.2-next.7
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-CFo7dxdy.js → ReactKonva-Bvc_MS6V.js} +3831 -3871
- package/dist/browser/ReactKonva-Bvc_MS6V.js.map +1 -0
- package/dist/browser/author/index.js +23482 -26657
- 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-CeB-1djc.js → dist-CJeYAWp3.js} +2 -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 +14 -7
- package/dist/browser/ReactKonva-CFo7dxdy.js.map +0 -1
- package/dist/browser/dist-CeB-1djc.js.map +0 -1
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import e from "./container.js";
|
|
1
|
+
import { Container as e } from "./container.js";
|
|
2
2
|
import t from "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import l from "
|
|
6
|
-
import u from "
|
|
7
|
-
import
|
|
8
|
-
import
|
|
3
|
+
import { renderMath as n } from "@pie-element/shared-math-rendering-mathjax";
|
|
4
|
+
import * as r from "@pie-lib/render-ui";
|
|
5
|
+
import { Collapsible as i, PreviewPrompt as a, UiLayout as o, color as s, hasMedia as c, hasText as l } from "@pie-lib/render-ui";
|
|
6
|
+
import u from "react-dom";
|
|
7
|
+
import d from "prop-types";
|
|
8
|
+
import f from "@pie-lib/correct-answer-toggle";
|
|
9
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
|
+
import { styled as h } from "@mui/material/styles";
|
|
9
11
|
//#region src/delivery/hotspot/index.tsx
|
|
10
|
-
function
|
|
12
|
+
function g(e) {
|
|
11
13
|
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
12
14
|
}
|
|
13
|
-
function
|
|
14
|
-
return !e ||
|
|
15
|
+
function _(e, t) {
|
|
16
|
+
return !e || g(e) ? e : g(e.default) ? e.default : t && g(e[t]) ? e[t] : t && g(e[t]?.default) ? e[t].default : e;
|
|
15
17
|
}
|
|
16
|
-
var
|
|
17
|
-
color:
|
|
18
|
-
backgroundColor:
|
|
18
|
+
var v = _(o, "UiLayout") || _(C.UiLayout, "UiLayout"), y = _(a, "PreviewPrompt") || _(C.PreviewPrompt, "PreviewPrompt"), b = _(i, "Collapsible") || _(C.Collapsible, "Collapsible"), x = r, S = x.default, C = S && typeof S == "object" ? S : x, w = h(v)({
|
|
19
|
+
color: s.text(),
|
|
20
|
+
backgroundColor: s.background(),
|
|
19
21
|
position: "relative"
|
|
20
|
-
}),
|
|
22
|
+
}), T = h(b)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), E = class extends t.Component {
|
|
21
23
|
constructor(e) {
|
|
22
24
|
super(e), this.state = {
|
|
23
25
|
showCorrect: !1,
|
|
@@ -36,7 +38,10 @@ var g = h(a, "UiLayout") || h(x.UiLayout, "UiLayout"), _ = h(i, "PreviewPrompt")
|
|
|
36
38
|
e && this.observer.observe(e, {
|
|
37
39
|
attributes: !0,
|
|
38
40
|
attributeFilter: ["style"]
|
|
39
|
-
});
|
|
41
|
+
}), n(u.findDOMNode(this));
|
|
42
|
+
}
|
|
43
|
+
componentDidUpdate() {
|
|
44
|
+
n(u.findDOMNode(this));
|
|
40
45
|
}
|
|
41
46
|
componentWillUnmount() {
|
|
42
47
|
this.observer?.disconnect();
|
|
@@ -46,57 +51,57 @@ var g = h(a, "UiLayout") || h(x.UiLayout, "UiLayout"), _ = h(i, "PreviewPrompt")
|
|
|
46
51
|
this.setState({ showCorrect: !e });
|
|
47
52
|
};
|
|
48
53
|
render() {
|
|
49
|
-
let { session: t, model: { disabled: n, extraCSSRules: r, imageUrl: i, prompt: a, mode: o, multipleCorrect:
|
|
50
|
-
return /* @__PURE__ */
|
|
54
|
+
let { session: t, model: { disabled: n, extraCSSRules: r, imageUrl: i, prompt: a, mode: o, multipleCorrect: s, shapes: u, outlineColor: d, hotspotColor: h, hoverOutlineColor: g, selectedHotspotColor: _, dimensions: v, rationale: x, teacherInstructions: S, strokeWidth: C, responseCorrect: E, language: D, fontSizeFactor: O, autoplayAudioEnabled: k, customAudioButton: A }, onSelectChoice: j } = this.props, { showCorrect: M } = this.state, N = o === "evaluate", P = o === "gather", F = N && !E, I = x && (l(x) || c(x));
|
|
55
|
+
return /* @__PURE__ */ m(w, {
|
|
51
56
|
extraCSSRules: r,
|
|
52
57
|
id: "main-container",
|
|
53
58
|
fontSizeFactor: O,
|
|
54
59
|
children: [
|
|
55
|
-
|
|
60
|
+
S && (l(S) || c(S)) && /* @__PURE__ */ p(T, {
|
|
56
61
|
labels: {
|
|
57
62
|
hidden: "Show Teacher Instructions",
|
|
58
63
|
visible: "Hide Teacher Instructions"
|
|
59
64
|
},
|
|
60
|
-
children: /* @__PURE__ */
|
|
65
|
+
children: /* @__PURE__ */ p(y, {
|
|
61
66
|
className: "prompt",
|
|
62
|
-
prompt:
|
|
67
|
+
prompt: S
|
|
63
68
|
})
|
|
64
69
|
}),
|
|
65
|
-
a && /* @__PURE__ */
|
|
70
|
+
a && /* @__PURE__ */ p(y, {
|
|
66
71
|
className: "prompt",
|
|
67
72
|
prompt: a,
|
|
68
73
|
autoplayAudioEnabled: k,
|
|
69
74
|
customAudioButton: A
|
|
70
75
|
}),
|
|
71
|
-
F && /* @__PURE__ */
|
|
76
|
+
F && /* @__PURE__ */ p(f, {
|
|
72
77
|
show: F,
|
|
73
78
|
toggled: M,
|
|
74
79
|
onToggle: this.onToggle.bind(this),
|
|
75
80
|
language: D
|
|
76
81
|
}),
|
|
77
|
-
i ? /* @__PURE__ */
|
|
82
|
+
i ? /* @__PURE__ */ p(e, {
|
|
78
83
|
isEvaluateMode: N,
|
|
79
84
|
session: t,
|
|
80
|
-
dimensions:
|
|
85
|
+
dimensions: v,
|
|
81
86
|
imageUrl: i,
|
|
82
87
|
hotspotColor: h,
|
|
83
88
|
hoverOutlineColor: P ? g : void 0,
|
|
84
|
-
selectedHotspotColor:
|
|
85
|
-
multipleCorrect:
|
|
86
|
-
outlineColor:
|
|
89
|
+
selectedHotspotColor: _,
|
|
90
|
+
multipleCorrect: s,
|
|
91
|
+
outlineColor: d,
|
|
87
92
|
onSelectChoice: j,
|
|
88
|
-
shapes:
|
|
93
|
+
shapes: u,
|
|
89
94
|
disabled: n,
|
|
90
|
-
strokeWidth:
|
|
95
|
+
strokeWidth: C,
|
|
91
96
|
scale: this.state.scale,
|
|
92
97
|
showCorrect: M
|
|
93
98
|
}) : null,
|
|
94
|
-
I && /* @__PURE__ */
|
|
99
|
+
I && /* @__PURE__ */ p(b, {
|
|
95
100
|
labels: {
|
|
96
101
|
hidden: "Show Rationale",
|
|
97
102
|
visible: "Hide Rationale"
|
|
98
103
|
},
|
|
99
|
-
children: /* @__PURE__ */
|
|
104
|
+
children: /* @__PURE__ */ p(y, {
|
|
100
105
|
className: "prompt",
|
|
101
106
|
prompt: x
|
|
102
107
|
})
|
|
@@ -105,10 +110,10 @@ var g = h(a, "UiLayout") || h(x.UiLayout, "UiLayout"), _ = h(i, "PreviewPrompt")
|
|
|
105
110
|
});
|
|
106
111
|
}
|
|
107
112
|
};
|
|
108
|
-
|
|
109
|
-
model:
|
|
110
|
-
onSelectChoice:
|
|
111
|
-
session:
|
|
113
|
+
E.propTypes = {
|
|
114
|
+
model: d.object.isRequired,
|
|
115
|
+
onSelectChoice: d.func.isRequired,
|
|
116
|
+
session: d.object.isRequired
|
|
112
117
|
};
|
|
113
118
|
//#endregion
|
|
114
|
-
export {
|
|
119
|
+
export { E as default };
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
declare class PolygonComponent extends React.Component {
|
|
11
11
|
constructor(props: any);
|
|
12
|
+
componentDidMount(): void;
|
|
13
|
+
componentDidUpdate(prevProps: any): void;
|
|
14
|
+
moveGroupToTop: any;
|
|
12
15
|
getPolygonCenter: any;
|
|
13
16
|
parsePointsForKonva: any;
|
|
14
17
|
handleClick: any;
|
|
@@ -13,8 +13,17 @@ function d(e, t) {
|
|
|
13
13
|
}
|
|
14
14
|
var f = d(l, "Rect"), p = d(s, "Group"), m = d(c, "Line"), h = class extends r.Component {
|
|
15
15
|
constructor(e) {
|
|
16
|
-
super(e), this.state = { hovered: !1 };
|
|
16
|
+
super(e), this.state = { hovered: !1 }, this.groupRef = r.createRef();
|
|
17
17
|
}
|
|
18
|
+
componentDidMount() {
|
|
19
|
+
this.props.focused && this.moveGroupToTop();
|
|
20
|
+
}
|
|
21
|
+
componentDidUpdate(e) {
|
|
22
|
+
!e.focused && this.props.focused && this.moveGroupToTop();
|
|
23
|
+
}
|
|
24
|
+
moveGroupToTop = () => {
|
|
25
|
+
this.groupRef.current && this.groupRef.current.moveToTop();
|
|
26
|
+
};
|
|
18
27
|
getPolygonCenter = (e) => {
|
|
19
28
|
let t = e.map(({ x: e }) => e), n = e.map(({ y: e }) => e), r = Math.min.apply(null, t), i = Math.max.apply(null, t), a = Math.min.apply(null, n), o = Math.max.apply(null, n);
|
|
20
29
|
return [(r + i) / 2, (a + o) / 2];
|
|
@@ -35,7 +44,7 @@ var f = d(l, "Rect"), p = d(s, "Group"), m = d(c, "Line"), h = class extends r.C
|
|
|
35
44
|
};
|
|
36
45
|
handleMouseEnter = () => {
|
|
37
46
|
let { disabled: e } = this.props;
|
|
38
|
-
e || (document.body.style.cursor = "pointer"), this.setState({ hovered: !0 });
|
|
47
|
+
e || (document.body.style.cursor = "pointer"), this.setState({ hovered: !0 }), this.moveGroupToTop();
|
|
39
48
|
};
|
|
40
49
|
handleMouseLeave = () => {
|
|
41
50
|
document.body.style.cursor = "default", this.setState({ hovered: !1 });
|
|
@@ -43,40 +52,42 @@ var f = d(l, "Rect"), p = d(s, "Group"), m = d(c, "Line"), h = class extends r.C
|
|
|
43
52
|
getEvaluateOutlineColor = (e, t, n) => t ? "green" : e ? n : "red";
|
|
44
53
|
getOutlineWidth = (e, t, n, r) => n || !n && !e && t ? r : 0;
|
|
45
54
|
render() {
|
|
46
|
-
let { hotspotColor: r, isCorrect: i, isEvaluateMode: s, hoverOutlineColor: c, outlineColor: l, selected: u,
|
|
47
|
-
|
|
48
|
-
let
|
|
55
|
+
let { hotspotColor: r, isCorrect: i, isEvaluateMode: s, hoverOutlineColor: c, outlineColor: l, selected: u, focused: d, points: h, evaluateText: g, strokeWidth: _, scale: v, markAsCorrect: y, selectedHotspotColor: b, showCorrectEnabled: x } = this.props, { hovered: S } = this.state, C = s ? this.getEvaluateOutlineColor(i, y, l) : l, w = this.getOutlineWidth(x, u, y, _), T = this.parsePointsForKonva(h), E = this.getPolygonCenter(h), D = E[0], O = E[1], k;
|
|
56
|
+
x ? (u && i || !u && !i) && (k = t) : u ? k = i ? t : n : i || (k = n);
|
|
57
|
+
let A = (S || d) && c, j = T.filter((e, t) => t % 2 == 0), M = T.filter((e, t) => t % 2 != 0), N = Math.min(...j), P = Math.max(...j), F = Math.min(...M), I = Math.max(...M), L = N, R = F, z = P - N, B = I - F;
|
|
49
58
|
return /* @__PURE__ */ o(p, {
|
|
50
|
-
|
|
51
|
-
|
|
59
|
+
ref: this.groupRef,
|
|
60
|
+
scaleX: v,
|
|
61
|
+
scaleY: v,
|
|
62
|
+
onMouseEnter: this.handleMouseEnter,
|
|
63
|
+
onMouseLeave: this.handleMouseLeave,
|
|
52
64
|
children: [
|
|
53
|
-
k && /* @__PURE__ */ a(f, {
|
|
54
|
-
x: I,
|
|
55
|
-
y: L,
|
|
56
|
-
width: R,
|
|
57
|
-
height: z,
|
|
58
|
-
stroke: u ? "transparent" : c,
|
|
59
|
-
strokeWidth: g
|
|
60
|
-
}),
|
|
61
65
|
/* @__PURE__ */ a(m, {
|
|
62
|
-
points:
|
|
66
|
+
points: T,
|
|
63
67
|
closed: !0,
|
|
64
|
-
fill: u &&
|
|
68
|
+
fill: u && b ? b : r,
|
|
65
69
|
onClick: this.handleClick,
|
|
66
70
|
onTap: this.handleClick,
|
|
67
71
|
draggable: !1,
|
|
68
|
-
stroke:
|
|
69
|
-
strokeWidth:
|
|
70
|
-
onMouseLeave: this.handleMouseLeave,
|
|
71
|
-
onMouseEnter: this.handleMouseEnter,
|
|
72
|
+
stroke: A && !u ? "transparent" : C,
|
|
73
|
+
strokeWidth: A && !u ? 0 : w,
|
|
72
74
|
cursor: "pointer",
|
|
73
75
|
position: "relative"
|
|
74
76
|
}),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
A && /* @__PURE__ */ a(f, {
|
|
78
|
+
x: L,
|
|
79
|
+
y: R,
|
|
80
|
+
width: z,
|
|
81
|
+
height: B,
|
|
82
|
+
stroke: c,
|
|
83
|
+
strokeWidth: _,
|
|
84
|
+
listening: !1
|
|
85
|
+
}),
|
|
86
|
+
s && k ? /* @__PURE__ */ a(e, {
|
|
87
|
+
src: k,
|
|
88
|
+
x: D,
|
|
89
|
+
y: O,
|
|
90
|
+
tooltip: g
|
|
80
91
|
}) : null
|
|
81
92
|
]
|
|
82
93
|
});
|
|
@@ -89,6 +100,7 @@ h.propTypes = {
|
|
|
89
100
|
isEvaluateMode: i.bool.isRequired,
|
|
90
101
|
hoverOutlineColor: i.string,
|
|
91
102
|
disabled: i.bool.isRequired,
|
|
103
|
+
focused: i.bool,
|
|
92
104
|
onClick: i.func.isRequired,
|
|
93
105
|
outlineColor: i.string.isRequired,
|
|
94
106
|
points: i.array.isRequired,
|
|
@@ -101,6 +113,7 @@ h.propTypes = {
|
|
|
101
113
|
showCorrectEnabled: i.bool.isRequired
|
|
102
114
|
}, h.defaultProps = {
|
|
103
115
|
evaluateText: null,
|
|
116
|
+
focused: !1,
|
|
104
117
|
strokeWidth: 5,
|
|
105
118
|
scale: 1
|
|
106
119
|
};
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
declare class RectComponent extends React.Component {
|
|
11
11
|
constructor(props: any);
|
|
12
|
+
componentDidMount(): void;
|
|
13
|
+
componentDidUpdate(prevProps: any): void;
|
|
14
|
+
moveGroupToTop: any;
|
|
12
15
|
handleClick: any;
|
|
13
16
|
handleMouseEnter: any;
|
|
14
17
|
handleMouseLeave: any;
|
|
@@ -13,8 +13,17 @@ function u(e, t) {
|
|
|
13
13
|
}
|
|
14
14
|
var d = u(s, "Group"), f = u(c, "Rect"), p = class extends r.Component {
|
|
15
15
|
constructor(e) {
|
|
16
|
-
super(e), this.state = { hovered: !1 };
|
|
16
|
+
super(e), this.state = { hovered: !1 }, this.groupRef = r.createRef();
|
|
17
17
|
}
|
|
18
|
+
componentDidMount() {
|
|
19
|
+
this.props.focused && this.moveGroupToTop();
|
|
20
|
+
}
|
|
21
|
+
componentDidUpdate(e) {
|
|
22
|
+
!e.focused && this.props.focused && this.moveGroupToTop();
|
|
23
|
+
}
|
|
24
|
+
moveGroupToTop = () => {
|
|
25
|
+
this.groupRef.current && this.groupRef.current.moveToTop();
|
|
26
|
+
};
|
|
18
27
|
handleClick = (e) => {
|
|
19
28
|
let { onClick: t, id: n, selected: r, disabled: i } = this.props;
|
|
20
29
|
i || (e.cancelBubble = !0, t({
|
|
@@ -25,7 +34,7 @@ var d = u(s, "Group"), f = u(c, "Rect"), p = class extends r.Component {
|
|
|
25
34
|
};
|
|
26
35
|
handleMouseEnter = () => {
|
|
27
36
|
let { disabled: e } = this.props;
|
|
28
|
-
e || (document.body.style.cursor = "pointer"), this.setState({ hovered: !0 });
|
|
37
|
+
e || (document.body.style.cursor = "pointer"), this.setState({ hovered: !0 }), this.moveGroupToTop();
|
|
29
38
|
};
|
|
30
39
|
handleMouseLeave = () => {
|
|
31
40
|
document.body.style.cursor = "default", this.setState({ hovered: !1 });
|
|
@@ -33,42 +42,43 @@ var d = u(s, "Group"), f = u(c, "Rect"), p = class extends r.Component {
|
|
|
33
42
|
getEvaluateOutlineColor = (e, t, n) => t ? "green" : e ? n : "red";
|
|
34
43
|
getOutlineWidth = (e, t, n, r) => n || !n && !e && t ? r : 0;
|
|
35
44
|
render() {
|
|
36
|
-
let { height: r, hotspotColor: i, hoverOutlineColor: s, selectedHotspotColor: c, isCorrect: l, isEvaluateMode: u, outlineColor: p, selected: m,
|
|
37
|
-
|
|
38
|
-
let
|
|
45
|
+
let { height: r, hotspotColor: i, hoverOutlineColor: s, selectedHotspotColor: c, isCorrect: l, isEvaluateMode: u, outlineColor: p, selected: m, focused: h, width: g, x: _, y: v, evaluateText: y, strokeWidth: b, scale: x, markAsCorrect: S, showCorrectEnabled: C } = this.props, { hovered: w } = this.state, T = u ? this.getEvaluateOutlineColor(l, S, p) : p, E = this.getOutlineWidth(C, m, S, b), D = _ + g / 2 - 10, O = v + r / 2 - 10, k;
|
|
46
|
+
C ? (m && l || !m && !l) && (k = t) : m ? k = l ? t : n : l || (k = n);
|
|
47
|
+
let A = (w || h) && s;
|
|
39
48
|
return /* @__PURE__ */ o(d, {
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
ref: this.groupRef,
|
|
50
|
+
scaleX: x,
|
|
51
|
+
scaleY: x,
|
|
52
|
+
onMouseLeave: this.handleMouseLeave,
|
|
53
|
+
onMouseEnter: this.handleMouseEnter,
|
|
42
54
|
children: [
|
|
43
|
-
k && /* @__PURE__ */ a(f, {
|
|
44
|
-
x: g,
|
|
45
|
-
y: _,
|
|
46
|
-
width: h,
|
|
47
|
-
height: r,
|
|
48
|
-
stroke: m ? "transparent" : s,
|
|
49
|
-
strokeWidth: y,
|
|
50
|
-
listening: !1
|
|
51
|
-
}),
|
|
52
55
|
/* @__PURE__ */ a(f, {
|
|
53
|
-
x:
|
|
54
|
-
y:
|
|
55
|
-
width:
|
|
56
|
+
x: _,
|
|
57
|
+
y: v,
|
|
58
|
+
width: g,
|
|
56
59
|
height: r,
|
|
57
60
|
fill: m && c ? c : i,
|
|
58
61
|
onClick: this.handleClick,
|
|
59
62
|
onTap: this.handleClick,
|
|
60
63
|
draggable: !1,
|
|
61
|
-
stroke:
|
|
62
|
-
strokeWidth:
|
|
63
|
-
onMouseLeave: this.handleMouseLeave,
|
|
64
|
-
onMouseEnter: this.handleMouseEnter,
|
|
64
|
+
stroke: A && !m ? "transparent" : T,
|
|
65
|
+
strokeWidth: A && !m ? 0 : E,
|
|
65
66
|
cursor: "pointer"
|
|
66
67
|
}),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
A && /* @__PURE__ */ a(f, {
|
|
69
|
+
x: _,
|
|
70
|
+
y: v,
|
|
71
|
+
width: g,
|
|
72
|
+
height: r,
|
|
73
|
+
stroke: s,
|
|
74
|
+
strokeWidth: b,
|
|
75
|
+
listening: !1
|
|
76
|
+
}),
|
|
77
|
+
u && k ? /* @__PURE__ */ a(e, {
|
|
78
|
+
src: k,
|
|
79
|
+
x: D,
|
|
80
|
+
y: O,
|
|
81
|
+
tooltip: y
|
|
72
82
|
}) : null
|
|
73
83
|
]
|
|
74
84
|
});
|
|
@@ -82,6 +92,7 @@ p.propTypes = {
|
|
|
82
92
|
isEvaluateMode: i.bool.isRequired,
|
|
83
93
|
hoverOutlineColor: i.string,
|
|
84
94
|
disabled: i.bool.isRequired,
|
|
95
|
+
focused: i.bool,
|
|
85
96
|
onClick: i.func.isRequired,
|
|
86
97
|
outlineColor: i.string.isRequired,
|
|
87
98
|
selected: i.bool.isRequired,
|
|
@@ -97,6 +108,7 @@ p.propTypes = {
|
|
|
97
108
|
}, p.defaultProps = {
|
|
98
109
|
isCorrect: !1,
|
|
99
110
|
evaluateText: null,
|
|
111
|
+
focused: !1,
|
|
100
112
|
strokeWidth: 5,
|
|
101
113
|
scale: 1
|
|
102
114
|
};
|
package/dist/delivery/index.js
CHANGED
|
@@ -24,7 +24,7 @@ var f = d(s, "EnableAudioAutoplayImage") || d(h.EnableAudioAutoplayImage, "Enabl
|
|
|
24
24
|
if (!this._session || !this._session.answers) return !1;
|
|
25
25
|
let { autoplayAudioEnabled: e, completeAudioEnabled: t } = this._model || {}, n = this;
|
|
26
26
|
if (e && t && !this.audioComplete && n) {
|
|
27
|
-
let e = n.querySelector("audio"), t = e && e.closest("
|
|
27
|
+
let e = n.querySelector("audio"), t = e && e.closest(".preview-prompt");
|
|
28
28
|
if (e && t) return !1;
|
|
29
29
|
}
|
|
30
30
|
return Array.isArray(this._session.answers) ? this._session.answers.length > 0 : !1;
|
|
@@ -60,7 +60,7 @@ var f = d(s, "EnableAudioAutoplayImage") || d(h.EnableAudioAutoplayImage, "Enabl
|
|
|
60
60
|
e.forEach((e) => {
|
|
61
61
|
if (e.type === "childList") {
|
|
62
62
|
if (this._audioInitialized) return;
|
|
63
|
-
let e = this.querySelector("audio"), r = e && e.closest("
|
|
63
|
+
let e = this.querySelector("audio"), r = e && e.closest(".preview-prompt");
|
|
64
64
|
if (!this._model || !this._model.autoplayAudioEnabled || e && !r || !e) return;
|
|
65
65
|
let i = this._createAudioInfoToast(), a = this.querySelector("#main-container"), o = () => {
|
|
66
66
|
this.querySelector("#play-audio-info") && (e.play(), a.removeChild(i)), document.removeEventListener("click", o);
|
|
@@ -100,7 +100,7 @@ var f = d(s, "EnableAudioAutoplayImage") || d(h.EnableAudioAutoplayImage, "Enabl
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
disconnectedCallback() {
|
|
103
|
-
document.removeEventListener("click", this._enableAudio), this._audio &&= (this._audio.removeEventListener("playing", this._handlePlaying), this._audio.removeEventListener("ended", this._handleEnded), null), this._root
|
|
103
|
+
document.removeEventListener("click", this._enableAudio), this._audio &&= (this._audio.removeEventListener("playing", this._handlePlaying), this._audio.removeEventListener("ended", this._handleEnded), null), this._root &&= (this._root.unmount(), null);
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
//#endregion
|