publ-echo-test 0.0.190 → 0.0.192
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.
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
21
21
|
return t;
|
22
22
|
};
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import React, { useEffect, useRef, useState
|
24
|
+
import React, { useEffect, useRef, useState } from 'react';
|
25
25
|
import { DraggableCore } from '../Draggable';
|
26
26
|
import classNames from '../../external-lib/classnames';
|
27
27
|
import { calcGridColWidth, calcGridItemPosition, calcGridItemWHPx, calcWH, calcXY, clamp, resolveRowHeight, } from './utils/calculateUtils';
|
@@ -94,7 +94,6 @@ var GridItem = function (_a) {
|
|
94
94
|
h_1 = prevH;
|
95
95
|
}
|
96
96
|
var _b = getResizableXYPosition('e', w_1, h_1, prevW, prevH), newX = _b.newX, newY = _b.newY;
|
97
|
-
console.log(mutation);
|
98
97
|
if (!isCharacterChanged) {
|
99
98
|
return;
|
100
99
|
}
|
@@ -7,22 +7,30 @@ var OutsideClickHandler = function (_a) {
|
|
7
7
|
var _b = useState({
|
8
8
|
transform: '',
|
9
9
|
width: '0',
|
10
|
-
height: '0'
|
10
|
+
height: '0',
|
11
11
|
}), childDimensions = _b[0], setChildDimensions = _b[1];
|
12
12
|
var _c = useState(0), zIndex = _c[0], setZIndex = _c[1];
|
13
13
|
useEffect(function () {
|
14
14
|
var handleClickOutside = function (e) {
|
15
15
|
var target = e.target;
|
16
|
-
if (target.closest('.editable-grid-item') ||
|
16
|
+
if (target.closest('.editable-grid-item') ||
|
17
|
+
target.closest('.group') ||
|
18
|
+
target.closest('.placeholder')) {
|
17
19
|
return;
|
18
20
|
}
|
19
|
-
if (wrapperRef.current &&
|
21
|
+
if (wrapperRef.current &&
|
22
|
+
!wrapperRef.current.contains(e.target)) {
|
20
23
|
onOutsideClick();
|
21
24
|
}
|
22
25
|
};
|
23
|
-
document.
|
26
|
+
var selectedSection = document.querySelector('.editor-canvas');
|
27
|
+
if (selectedSection) {
|
28
|
+
selectedSection.addEventListener('dblclick', handleClickOutside);
|
29
|
+
}
|
24
30
|
return function () {
|
25
|
-
|
31
|
+
if (selectedSection) {
|
32
|
+
selectedSection.addEventListener('dblclick', handleClickOutside);
|
33
|
+
}
|
26
34
|
};
|
27
35
|
}, [onOutsideClick]);
|
28
36
|
// Find and set child dimensions when component mounts or children change
|
@@ -37,7 +45,7 @@ var OutsideClickHandler = function (_a) {
|
|
37
45
|
setChildDimensions({
|
38
46
|
transform: computedStyle.transform,
|
39
47
|
width: computedStyle.width,
|
40
|
-
height: computedStyle.height
|
48
|
+
height: computedStyle.height,
|
41
49
|
});
|
42
50
|
if (childElement.dataset['minZ']) {
|
43
51
|
setZIndex(Number(childElement.dataset['minZ']));
|
@@ -47,7 +55,7 @@ var OutsideClickHandler = function (_a) {
|
|
47
55
|
setChildDimensions({
|
48
56
|
transform: '',
|
49
57
|
width: '0',
|
50
|
-
height: '0'
|
58
|
+
height: '0',
|
51
59
|
});
|
52
60
|
setZIndex(0);
|
53
61
|
};
|
@@ -57,46 +65,46 @@ var OutsideClickHandler = function (_a) {
|
|
57
65
|
var height = parseFloat(childDimensions.height) || 0;
|
58
66
|
var borderThickness = 3; // 3px border thickness
|
59
67
|
var shadowOffset = 3; // Match the child's shadow (0 0 0 3px #027aff)
|
60
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: wrapperRef, className: 'outside-click-wrapper', children: children }), width > 0 && height > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className:
|
68
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: wrapperRef, className: 'outside-click-wrapper', children: children }), width > 0 && height > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: 'border-top', style: {
|
61
69
|
position: 'absolute',
|
62
70
|
transform: childDimensions.transform,
|
63
|
-
width: "".concat(width +
|
71
|
+
width: "".concat(width + shadowOffset * 2, "px"),
|
64
72
|
height: "".concat(borderThickness, "px"),
|
65
73
|
backgroundColor: '#027aff',
|
66
74
|
marginLeft: "-".concat(shadowOffset, "px"),
|
67
75
|
marginTop: "-".concat(shadowOffset, "px"),
|
68
76
|
pointerEvents: 'none',
|
69
|
-
zIndex: zIndexMap.EDITING_GROUP + zIndex
|
70
|
-
} }), _jsx("div", { className:
|
77
|
+
zIndex: zIndexMap.EDITING_GROUP + zIndex,
|
78
|
+
} }), _jsx("div", { className: 'border-right', style: {
|
71
79
|
position: 'absolute',
|
72
80
|
transform: childDimensions.transform,
|
73
81
|
width: "".concat(borderThickness, "px"),
|
74
|
-
height: "".concat(height +
|
82
|
+
height: "".concat(height + shadowOffset * 2, "px"),
|
75
83
|
backgroundColor: '#027aff',
|
76
84
|
marginLeft: "".concat(width + shadowOffset - borderThickness, "px"),
|
77
85
|
marginTop: "-".concat(shadowOffset, "px"),
|
78
86
|
pointerEvents: 'none',
|
79
|
-
zIndex: zIndexMap.EDITING_GROUP + zIndex
|
80
|
-
} }), _jsx("div", { className:
|
87
|
+
zIndex: zIndexMap.EDITING_GROUP + zIndex,
|
88
|
+
} }), _jsx("div", { className: 'border-bottom', style: {
|
81
89
|
position: 'absolute',
|
82
90
|
transform: childDimensions.transform,
|
83
|
-
width: "".concat(width +
|
91
|
+
width: "".concat(width + shadowOffset * 2, "px"),
|
84
92
|
height: "".concat(borderThickness, "px"),
|
85
93
|
backgroundColor: '#027aff',
|
86
94
|
marginLeft: "-".concat(shadowOffset, "px"),
|
87
95
|
marginTop: "".concat(height + shadowOffset - borderThickness, "px"),
|
88
96
|
pointerEvents: 'none',
|
89
|
-
zIndex: zIndexMap.EDITING_GROUP + zIndex
|
90
|
-
} }), _jsx("div", { className:
|
97
|
+
zIndex: zIndexMap.EDITING_GROUP + zIndex,
|
98
|
+
} }), _jsx("div", { className: 'border-left', style: {
|
91
99
|
position: 'absolute',
|
92
100
|
transform: childDimensions.transform,
|
93
101
|
width: "".concat(borderThickness, "px"),
|
94
|
-
height: "".concat(height +
|
102
|
+
height: "".concat(height + shadowOffset * 2, "px"),
|
95
103
|
backgroundColor: '#027aff',
|
96
104
|
marginLeft: "-".concat(shadowOffset, "px"),
|
97
105
|
marginTop: "-".concat(shadowOffset, "px"),
|
98
106
|
pointerEvents: 'none',
|
99
|
-
zIndex: zIndexMap.EDITING_GROUP + zIndex
|
107
|
+
zIndex: zIndexMap.EDITING_GROUP + zIndex,
|
100
108
|
} })] }))] }));
|
101
109
|
};
|
102
110
|
export default OutsideClickHandler;
|