@elementor/editor-controls 3.35.0-374 → 3.35.0-376
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/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/inline-editor.tsx +35 -28
package/dist/index.mjs
CHANGED
|
@@ -6248,6 +6248,21 @@ var calcSelectionCenter = (view, container) => {
|
|
|
6248
6248
|
const top = Math.min(start.top, end.top) - container.top;
|
|
6249
6249
|
return { left, top };
|
|
6250
6250
|
};
|
|
6251
|
+
var Wrapper = ({ children, containerRef, editor, sx, onBlur }) => {
|
|
6252
|
+
const wrappedChildren = /* @__PURE__ */ React101.createElement(Box22, { ref: containerRef, ...sx }, children);
|
|
6253
|
+
return onBlur ? /* @__PURE__ */ React101.createElement(
|
|
6254
|
+
ClickAwayListener,
|
|
6255
|
+
{
|
|
6256
|
+
onClickAway: (event) => {
|
|
6257
|
+
if (containerRef.current?.contains(event.target) || editor.view.dom.contains(event.target)) {
|
|
6258
|
+
return;
|
|
6259
|
+
}
|
|
6260
|
+
onBlur?.(event);
|
|
6261
|
+
}
|
|
6262
|
+
},
|
|
6263
|
+
wrappedChildren
|
|
6264
|
+
) : /* @__PURE__ */ React101.createElement(React101.Fragment, null, wrappedChildren);
|
|
6265
|
+
};
|
|
6251
6266
|
var InlineEditor = React101.forwardRef(
|
|
6252
6267
|
({
|
|
6253
6268
|
value,
|
|
@@ -6364,22 +6379,7 @@ var InlineEditor = React101.forwardRef(
|
|
|
6364
6379
|
top: container.top + selectionRect.top + initial.top
|
|
6365
6380
|
};
|
|
6366
6381
|
};
|
|
6367
|
-
|
|
6368
|
-
const wrappedChildren = /* @__PURE__ */ React101.createElement(Box22, { ref: containerRef, ...sx }, children);
|
|
6369
|
-
return onBlur ? /* @__PURE__ */ React101.createElement(
|
|
6370
|
-
ClickAwayListener,
|
|
6371
|
-
{
|
|
6372
|
-
onClickAway: (event) => {
|
|
6373
|
-
if (containerRef.current?.contains(event.target) || editor.view.dom.contains(event.target)) {
|
|
6374
|
-
return;
|
|
6375
|
-
}
|
|
6376
|
-
onBlur?.(event);
|
|
6377
|
-
}
|
|
6378
|
-
},
|
|
6379
|
-
wrappedChildren
|
|
6380
|
-
) : /* @__PURE__ */ React101.createElement(React101.Fragment, null, wrappedChildren);
|
|
6381
|
-
};
|
|
6382
|
-
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(Wrapper, null, /* @__PURE__ */ React101.createElement(EditorContent, { ref, editor })), showToolbar && containerRef.current && /* @__PURE__ */ React101.createElement(
|
|
6382
|
+
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(Wrapper, { containerRef, editor, sx, onBlur }, /* @__PURE__ */ React101.createElement(EditorContent, { ref, editor })), showToolbar && containerRef.current && /* @__PURE__ */ React101.createElement(
|
|
6383
6383
|
Popover8,
|
|
6384
6384
|
{
|
|
6385
6385
|
slotProps: {
|