@pie-element/hotspot 11.1.2-next.0 → 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 +120 -120
- 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 +10 -10
- 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 +24223 -22027
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/{browser-CfnAFove.js → browser-D4gLESxz.js} +22 -6
- 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-CJeYAWp3.js +100 -0
- package/dist/browser/dist-CJeYAWp3.js.map +1 -0
- package/dist/controller/index.js +51 -51
- package/dist/controller/utils.d.ts +1 -1
- package/dist/controller/utils.js +2 -3
- 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/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +20 -17
- package/dist/browser/ReactKonva-Z9-1H-UZ.js.map +0 -1
- package/dist/browser/isEqual-D3CTSc6W.js +0 -601
- package/dist/browser/isEqual-D3CTSc6W.js.map +0 -1
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
|
@@ -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
|