@puckeditor/core 0.24.1-canary.e49fae89 → 0.24.1-canary.e4f43fef
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/{chunk-OA56LRDR.mjs → chunk-T2XFCN6B.mjs} +19 -13
- package/dist/index.js +18 -12
- package/dist/index.mjs +1 -1
- package/dist/no-external.js +18 -12
- package/dist/no-external.mjs +1 -1
- package/package.json +1 -1
|
@@ -13985,7 +13985,7 @@ init_react_import();
|
|
|
13985
13985
|
|
|
13986
13986
|
// components/Puck/components/ResizeHandle/index.tsx
|
|
13987
13987
|
init_react_import();
|
|
13988
|
-
import { useCallback as useCallback29, useRef as useRef19 } from "react";
|
|
13988
|
+
import { useCallback as useCallback29, useEffect as useEffect32, useRef as useRef19 } from "react";
|
|
13989
13989
|
|
|
13990
13990
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/ResizeHandle/styles.module.css#css-module
|
|
13991
13991
|
init_react_import();
|
|
@@ -14006,6 +14006,7 @@ var ResizeHandle = ({
|
|
|
14006
14006
|
const isDragging = useRef19(false);
|
|
14007
14007
|
const startX = useRef19(0);
|
|
14008
14008
|
const startWidth = useRef19(0);
|
|
14009
|
+
const endDrag = useRef19(null);
|
|
14009
14010
|
const handleMouseMove = useCallback29(
|
|
14010
14011
|
(e) => {
|
|
14011
14012
|
if (!isDragging.current) return;
|
|
@@ -14018,18 +14019,10 @@ var ResizeHandle = ({
|
|
|
14018
14019
|
[onResize, position]
|
|
14019
14020
|
);
|
|
14020
14021
|
const handleMouseUp = useCallback29(() => {
|
|
14021
|
-
var _a;
|
|
14022
|
+
var _a, _b;
|
|
14022
14023
|
if (!isDragging.current) return;
|
|
14023
|
-
|
|
14024
|
-
|
|
14025
|
-
document.body.style.userSelect = "";
|
|
14026
|
-
const overlay = document.getElementById("resize-overlay");
|
|
14027
|
-
if (overlay) {
|
|
14028
|
-
document.body.removeChild(overlay);
|
|
14029
|
-
}
|
|
14030
|
-
document.removeEventListener("mousemove", handleMouseMove);
|
|
14031
|
-
document.removeEventListener("mouseup", handleMouseUp);
|
|
14032
|
-
const finalWidth = ((_a = sidebarRef.current) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
|
|
14024
|
+
(_a = endDrag.current) == null ? void 0 : _a.call(endDrag);
|
|
14025
|
+
const finalWidth = ((_b = sidebarRef.current) == null ? void 0 : _b.getBoundingClientRect().width) || 0;
|
|
14033
14026
|
onResizeEnd(finalWidth);
|
|
14034
14027
|
resetAutoZoom();
|
|
14035
14028
|
}, [onResizeEnd]);
|
|
@@ -14047,10 +14040,23 @@ var ResizeHandle = ({
|
|
|
14047
14040
|
document.body.appendChild(overlay);
|
|
14048
14041
|
document.addEventListener("mousemove", handleMouseMove);
|
|
14049
14042
|
document.addEventListener("mouseup", handleMouseUp);
|
|
14043
|
+
endDrag.current = () => {
|
|
14044
|
+
isDragging.current = false;
|
|
14045
|
+
document.body.style.cursor = "";
|
|
14046
|
+
document.body.style.userSelect = "";
|
|
14047
|
+
overlay.remove();
|
|
14048
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
14049
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
14050
|
+
endDrag.current = null;
|
|
14051
|
+
};
|
|
14050
14052
|
e.preventDefault();
|
|
14051
14053
|
},
|
|
14052
14054
|
[position, handleMouseMove, handleMouseUp]
|
|
14053
14055
|
);
|
|
14056
|
+
useEffect32(() => () => {
|
|
14057
|
+
var _a;
|
|
14058
|
+
return (_a = endDrag.current) == null ? void 0 : _a.call(endDrag);
|
|
14059
|
+
}, []);
|
|
14054
14060
|
return /* @__PURE__ */ jsx69(
|
|
14055
14061
|
"div",
|
|
14056
14062
|
{
|
|
@@ -14085,7 +14091,7 @@ var Sidebar = ({
|
|
|
14085
14091
|
children
|
|
14086
14092
|
}
|
|
14087
14093
|
),
|
|
14088
|
-
/* @__PURE__ */ jsx70("div", { className: `${getClassName44("resizeHandle")}`, children: /* @__PURE__ */ jsx70(
|
|
14094
|
+
isVisible && /* @__PURE__ */ jsx70("div", { className: `${getClassName44("resizeHandle")}`, children: /* @__PURE__ */ jsx70(
|
|
14089
14095
|
ResizeHandle,
|
|
14090
14096
|
{
|
|
14091
14097
|
position,
|
package/dist/index.js
CHANGED
|
@@ -20321,6 +20321,7 @@ var ResizeHandle = ({
|
|
|
20321
20321
|
const isDragging = (0, import_react110.useRef)(false);
|
|
20322
20322
|
const startX = (0, import_react110.useRef)(0);
|
|
20323
20323
|
const startWidth = (0, import_react110.useRef)(0);
|
|
20324
|
+
const endDrag = (0, import_react110.useRef)(null);
|
|
20324
20325
|
const handleMouseMove = (0, import_react110.useCallback)(
|
|
20325
20326
|
(e) => {
|
|
20326
20327
|
if (!isDragging.current) return;
|
|
@@ -20333,18 +20334,10 @@ var ResizeHandle = ({
|
|
|
20333
20334
|
[onResize, position]
|
|
20334
20335
|
);
|
|
20335
20336
|
const handleMouseUp = (0, import_react110.useCallback)(() => {
|
|
20336
|
-
var _a;
|
|
20337
|
+
var _a, _b;
|
|
20337
20338
|
if (!isDragging.current) return;
|
|
20338
|
-
|
|
20339
|
-
|
|
20340
|
-
document.body.style.userSelect = "";
|
|
20341
|
-
const overlay = document.getElementById("resize-overlay");
|
|
20342
|
-
if (overlay) {
|
|
20343
|
-
document.body.removeChild(overlay);
|
|
20344
|
-
}
|
|
20345
|
-
document.removeEventListener("mousemove", handleMouseMove);
|
|
20346
|
-
document.removeEventListener("mouseup", handleMouseUp);
|
|
20347
|
-
const finalWidth = ((_a = sidebarRef.current) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
|
|
20339
|
+
(_a = endDrag.current) == null ? void 0 : _a.call(endDrag);
|
|
20340
|
+
const finalWidth = ((_b = sidebarRef.current) == null ? void 0 : _b.getBoundingClientRect().width) || 0;
|
|
20348
20341
|
onResizeEnd(finalWidth);
|
|
20349
20342
|
resetAutoZoom();
|
|
20350
20343
|
}, [onResizeEnd]);
|
|
@@ -20362,10 +20355,23 @@ var ResizeHandle = ({
|
|
|
20362
20355
|
document.body.appendChild(overlay);
|
|
20363
20356
|
document.addEventListener("mousemove", handleMouseMove);
|
|
20364
20357
|
document.addEventListener("mouseup", handleMouseUp);
|
|
20358
|
+
endDrag.current = () => {
|
|
20359
|
+
isDragging.current = false;
|
|
20360
|
+
document.body.style.cursor = "";
|
|
20361
|
+
document.body.style.userSelect = "";
|
|
20362
|
+
overlay.remove();
|
|
20363
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
20364
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
20365
|
+
endDrag.current = null;
|
|
20366
|
+
};
|
|
20365
20367
|
e.preventDefault();
|
|
20366
20368
|
},
|
|
20367
20369
|
[position, handleMouseMove, handleMouseUp]
|
|
20368
20370
|
);
|
|
20371
|
+
(0, import_react110.useEffect)(() => () => {
|
|
20372
|
+
var _a;
|
|
20373
|
+
return (_a = endDrag.current) == null ? void 0 : _a.call(endDrag);
|
|
20374
|
+
}, []);
|
|
20369
20375
|
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
20370
20376
|
"div",
|
|
20371
20377
|
{
|
|
@@ -20403,7 +20409,7 @@ var Sidebar = ({
|
|
|
20403
20409
|
children
|
|
20404
20410
|
}
|
|
20405
20411
|
),
|
|
20406
|
-
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: `${getClassName50("resizeHandle")}`, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
20412
|
+
isVisible && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: `${getClassName50("resizeHandle")}`, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
20407
20413
|
ResizeHandle,
|
|
20408
20414
|
{
|
|
20409
20415
|
position,
|
package/dist/index.mjs
CHANGED
package/dist/no-external.js
CHANGED
|
@@ -20321,6 +20321,7 @@ var ResizeHandle = ({
|
|
|
20321
20321
|
const isDragging = (0, import_react110.useRef)(false);
|
|
20322
20322
|
const startX = (0, import_react110.useRef)(0);
|
|
20323
20323
|
const startWidth = (0, import_react110.useRef)(0);
|
|
20324
|
+
const endDrag = (0, import_react110.useRef)(null);
|
|
20324
20325
|
const handleMouseMove = (0, import_react110.useCallback)(
|
|
20325
20326
|
(e) => {
|
|
20326
20327
|
if (!isDragging.current) return;
|
|
@@ -20333,18 +20334,10 @@ var ResizeHandle = ({
|
|
|
20333
20334
|
[onResize, position]
|
|
20334
20335
|
);
|
|
20335
20336
|
const handleMouseUp = (0, import_react110.useCallback)(() => {
|
|
20336
|
-
var _a;
|
|
20337
|
+
var _a, _b;
|
|
20337
20338
|
if (!isDragging.current) return;
|
|
20338
|
-
|
|
20339
|
-
|
|
20340
|
-
document.body.style.userSelect = "";
|
|
20341
|
-
const overlay = document.getElementById("resize-overlay");
|
|
20342
|
-
if (overlay) {
|
|
20343
|
-
document.body.removeChild(overlay);
|
|
20344
|
-
}
|
|
20345
|
-
document.removeEventListener("mousemove", handleMouseMove);
|
|
20346
|
-
document.removeEventListener("mouseup", handleMouseUp);
|
|
20347
|
-
const finalWidth = ((_a = sidebarRef.current) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
|
|
20339
|
+
(_a = endDrag.current) == null ? void 0 : _a.call(endDrag);
|
|
20340
|
+
const finalWidth = ((_b = sidebarRef.current) == null ? void 0 : _b.getBoundingClientRect().width) || 0;
|
|
20348
20341
|
onResizeEnd(finalWidth);
|
|
20349
20342
|
resetAutoZoom();
|
|
20350
20343
|
}, [onResizeEnd]);
|
|
@@ -20362,10 +20355,23 @@ var ResizeHandle = ({
|
|
|
20362
20355
|
document.body.appendChild(overlay);
|
|
20363
20356
|
document.addEventListener("mousemove", handleMouseMove);
|
|
20364
20357
|
document.addEventListener("mouseup", handleMouseUp);
|
|
20358
|
+
endDrag.current = () => {
|
|
20359
|
+
isDragging.current = false;
|
|
20360
|
+
document.body.style.cursor = "";
|
|
20361
|
+
document.body.style.userSelect = "";
|
|
20362
|
+
overlay.remove();
|
|
20363
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
20364
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
20365
|
+
endDrag.current = null;
|
|
20366
|
+
};
|
|
20365
20367
|
e.preventDefault();
|
|
20366
20368
|
},
|
|
20367
20369
|
[position, handleMouseMove, handleMouseUp]
|
|
20368
20370
|
);
|
|
20371
|
+
(0, import_react110.useEffect)(() => () => {
|
|
20372
|
+
var _a;
|
|
20373
|
+
return (_a = endDrag.current) == null ? void 0 : _a.call(endDrag);
|
|
20374
|
+
}, []);
|
|
20369
20375
|
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
20370
20376
|
"div",
|
|
20371
20377
|
{
|
|
@@ -20403,7 +20409,7 @@ var Sidebar = ({
|
|
|
20403
20409
|
children
|
|
20404
20410
|
}
|
|
20405
20411
|
),
|
|
20406
|
-
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: `${getClassName50("resizeHandle")}`, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
20412
|
+
isVisible && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: `${getClassName50("resizeHandle")}`, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
20407
20413
|
ResizeHandle,
|
|
20408
20414
|
{
|
|
20409
20415
|
position,
|
package/dist/no-external.mjs
CHANGED