@elementor/editor-controls 3.35.0-373 → 3.35.0-375
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.js
CHANGED
|
@@ -6237,6 +6237,21 @@ var calcSelectionCenter = (view, container) => {
|
|
|
6237
6237
|
const top = Math.min(start.top, end.top) - container.top;
|
|
6238
6238
|
return { left, top };
|
|
6239
6239
|
};
|
|
6240
|
+
var Wrapper = ({ children, containerRef, editor, sx, onBlur }) => {
|
|
6241
|
+
const wrappedChildren = /* @__PURE__ */ React101.createElement(import_ui87.Box, { ref: containerRef, ...sx }, children);
|
|
6242
|
+
return onBlur ? /* @__PURE__ */ React101.createElement(
|
|
6243
|
+
import_ui87.ClickAwayListener,
|
|
6244
|
+
{
|
|
6245
|
+
onClickAway: (event) => {
|
|
6246
|
+
if (containerRef.current?.contains(event.target) || editor.view.dom.contains(event.target)) {
|
|
6247
|
+
return;
|
|
6248
|
+
}
|
|
6249
|
+
onBlur?.(event);
|
|
6250
|
+
}
|
|
6251
|
+
},
|
|
6252
|
+
wrappedChildren
|
|
6253
|
+
) : /* @__PURE__ */ React101.createElement(React101.Fragment, null, wrappedChildren);
|
|
6254
|
+
};
|
|
6240
6255
|
var InlineEditor = React101.forwardRef(
|
|
6241
6256
|
({
|
|
6242
6257
|
value,
|
|
@@ -6353,22 +6368,7 @@ var InlineEditor = React101.forwardRef(
|
|
|
6353
6368
|
top: container.top + selectionRect.top + initial.top
|
|
6354
6369
|
};
|
|
6355
6370
|
};
|
|
6356
|
-
|
|
6357
|
-
const wrappedChildren = /* @__PURE__ */ React101.createElement(import_ui87.Box, { ref: containerRef, ...sx }, children);
|
|
6358
|
-
return onBlur ? /* @__PURE__ */ React101.createElement(
|
|
6359
|
-
import_ui87.ClickAwayListener,
|
|
6360
|
-
{
|
|
6361
|
-
onClickAway: (event) => {
|
|
6362
|
-
if (containerRef.current?.contains(event.target) || editor.view.dom.contains(event.target)) {
|
|
6363
|
-
return;
|
|
6364
|
-
}
|
|
6365
|
-
onBlur?.(event);
|
|
6366
|
-
}
|
|
6367
|
-
},
|
|
6368
|
-
wrappedChildren
|
|
6369
|
-
) : /* @__PURE__ */ React101.createElement(React101.Fragment, null, wrappedChildren);
|
|
6370
|
-
};
|
|
6371
|
-
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(Wrapper, null, /* @__PURE__ */ React101.createElement(import_react56.EditorContent, { ref, editor })), showToolbar && containerRef.current && /* @__PURE__ */ React101.createElement(
|
|
6371
|
+
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(Wrapper, { containerRef, editor, sx, onBlur }, /* @__PURE__ */ React101.createElement(import_react56.EditorContent, { ref, editor })), showToolbar && containerRef.current && /* @__PURE__ */ React101.createElement(
|
|
6372
6372
|
import_ui87.Popover,
|
|
6373
6373
|
{
|
|
6374
6374
|
slotProps: {
|