@elementor/editor-canvas 3.35.0-493 → 3.35.0
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 +230 -92
- package/dist/index.mjs +235 -97
- package/package.json +18 -18
- package/src/legacy/create-element-type.ts +7 -1
- package/src/legacy/replacements/inline-editing/canvas-inline-editor.tsx +215 -0
- package/src/legacy/replacements/inline-editing/inline-editing-elements.tsx +17 -83
- package/src/legacy/replacements/inline-editing/inline-editing-utils.ts +65 -12
package/dist/index.js
CHANGED
|
@@ -1498,8 +1498,8 @@ function escapeURL(value) {
|
|
|
1498
1498
|
|
|
1499
1499
|
// src/legacy/create-element-type.ts
|
|
1500
1500
|
function createElementType(type) {
|
|
1501
|
-
const
|
|
1502
|
-
return class extends
|
|
1501
|
+
const legacyWindow = window;
|
|
1502
|
+
return class extends legacyWindow.elementor.modules.elements.types.Widget {
|
|
1503
1503
|
getType() {
|
|
1504
1504
|
return type;
|
|
1505
1505
|
}
|
|
@@ -1509,8 +1509,8 @@ function createElementType(type) {
|
|
|
1509
1509
|
};
|
|
1510
1510
|
}
|
|
1511
1511
|
function createElementViewClassDeclaration() {
|
|
1512
|
-
const
|
|
1513
|
-
return class extends
|
|
1512
|
+
const legacyWindow = window;
|
|
1513
|
+
return class extends legacyWindow.elementor.modules.elements.views.Widget {
|
|
1514
1514
|
// Dispatch `render` event so the overlay layer will be updated
|
|
1515
1515
|
onRender(...args) {
|
|
1516
1516
|
super.onRender(...args);
|
|
@@ -1556,12 +1556,16 @@ function createElementViewClassDeclaration() {
|
|
|
1556
1556
|
);
|
|
1557
1557
|
}
|
|
1558
1558
|
#dispatchPreviewEvent(eventType) {
|
|
1559
|
-
|
|
1559
|
+
const element = this.getDomElement().get(0);
|
|
1560
|
+
if (!element) {
|
|
1561
|
+
return;
|
|
1562
|
+
}
|
|
1563
|
+
legacyWindow.elementor?.$preview?.[0]?.contentWindow.dispatchEvent(
|
|
1560
1564
|
new CustomEvent(eventType, {
|
|
1561
1565
|
detail: {
|
|
1562
1566
|
id: this.model.get("id"),
|
|
1563
1567
|
type: this.model.get("widgetType"),
|
|
1564
|
-
element
|
|
1568
|
+
element
|
|
1565
1569
|
}
|
|
1566
1570
|
})
|
|
1567
1571
|
);
|
|
@@ -1716,14 +1720,11 @@ function createTemplatedElementView({
|
|
|
1716
1720
|
}
|
|
1717
1721
|
|
|
1718
1722
|
// src/legacy/replacements/inline-editing/inline-editing-elements.tsx
|
|
1719
|
-
var
|
|
1720
|
-
var import_react11 = require("react");
|
|
1723
|
+
var React6 = __toESM(require("react"));
|
|
1721
1724
|
var import_client = require("react-dom/client");
|
|
1722
|
-
var import_editor_controls2 = require("@elementor/editor-controls");
|
|
1723
1725
|
var import_editor_elements3 = require("@elementor/editor-elements");
|
|
1724
1726
|
var import_editor_props4 = require("@elementor/editor-props");
|
|
1725
1727
|
var import_editor_v1_adapters8 = require("@elementor/editor-v1-adapters");
|
|
1726
|
-
var import_ui4 = require("@elementor/ui");
|
|
1727
1728
|
var import_i18n = require("@wordpress/i18n");
|
|
1728
1729
|
|
|
1729
1730
|
// src/legacy/replacements/base.ts
|
|
@@ -1764,6 +1765,207 @@ var ReplacementBase = class {
|
|
|
1764
1765
|
}
|
|
1765
1766
|
};
|
|
1766
1767
|
|
|
1768
|
+
// src/legacy/replacements/inline-editing/canvas-inline-editor.tsx
|
|
1769
|
+
var React5 = __toESM(require("react"));
|
|
1770
|
+
var import_react11 = require("react");
|
|
1771
|
+
var import_editor_controls2 = require("@elementor/editor-controls");
|
|
1772
|
+
var import_ui4 = require("@elementor/ui");
|
|
1773
|
+
var import_react12 = require("@floating-ui/react");
|
|
1774
|
+
|
|
1775
|
+
// src/legacy/replacements/inline-editing/inline-editing-utils.ts
|
|
1776
|
+
var INLINE_EDITING_PROPERTY_PER_TYPE = {
|
|
1777
|
+
"e-form-label": "text",
|
|
1778
|
+
"e-heading": "title",
|
|
1779
|
+
"e-paragraph": "paragraph"
|
|
1780
|
+
};
|
|
1781
|
+
var calcSelectionCenterOffsets = (view) => {
|
|
1782
|
+
const frameWindow = view.root?.defaultView;
|
|
1783
|
+
const selection = frameWindow?.getSelection();
|
|
1784
|
+
const editorContainer = view.dom;
|
|
1785
|
+
if (!selection || !editorContainer) {
|
|
1786
|
+
return null;
|
|
1787
|
+
}
|
|
1788
|
+
const range = selection.getRangeAt(0);
|
|
1789
|
+
const selectionRect = range.getBoundingClientRect();
|
|
1790
|
+
const editorContainerRect = editorContainer.getBoundingClientRect();
|
|
1791
|
+
if (!selectionRect || !editorContainerRect) {
|
|
1792
|
+
return null;
|
|
1793
|
+
}
|
|
1794
|
+
const verticalOffset = selectionRect.top - editorContainerRect.top;
|
|
1795
|
+
const selectionCenter = selectionRect?.left + selectionRect?.width / 2;
|
|
1796
|
+
const horizontalOffset = selectionCenter - editorContainerRect.left;
|
|
1797
|
+
return { left: horizontalOffset, top: verticalOffset };
|
|
1798
|
+
};
|
|
1799
|
+
var getComputedStyle = (styles, offsets) => {
|
|
1800
|
+
const transform = extractTransformValue(styles);
|
|
1801
|
+
return transform ? {
|
|
1802
|
+
...styles,
|
|
1803
|
+
marginLeft: `${offsets.left}px`,
|
|
1804
|
+
marginTop: `${offsets.top}px`,
|
|
1805
|
+
pointerEvents: "none"
|
|
1806
|
+
} : {
|
|
1807
|
+
display: "none"
|
|
1808
|
+
};
|
|
1809
|
+
};
|
|
1810
|
+
var extractTransformValue = (styles) => {
|
|
1811
|
+
const translateRegex = /translate\([^)]*\)\s?/g;
|
|
1812
|
+
const numericValuesRegex = /(-?\d+\.?\d*)/g;
|
|
1813
|
+
const translateValue = styles?.transform?.match(translateRegex)?.[0];
|
|
1814
|
+
const values = translateValue?.match(numericValuesRegex);
|
|
1815
|
+
if (!translateValue || !values) {
|
|
1816
|
+
return null;
|
|
1817
|
+
}
|
|
1818
|
+
const [numericX, numericY] = values.map(Number);
|
|
1819
|
+
if (!numericX || !numericY) {
|
|
1820
|
+
return null;
|
|
1821
|
+
}
|
|
1822
|
+
return styles.transform;
|
|
1823
|
+
};
|
|
1824
|
+
|
|
1825
|
+
// src/legacy/replacements/inline-editing/canvas-inline-editor.tsx
|
|
1826
|
+
var TOP_BAR_SELECTOR = "#elementor-editor-wrapper-v2";
|
|
1827
|
+
var NAVIGATOR_SELECTOR = "#elementor-navigator";
|
|
1828
|
+
var EDITING_PANEL = "#elementor-panel";
|
|
1829
|
+
var EDITOR_ELEMENTS_OUT_OF_IFRAME = [TOP_BAR_SELECTOR, NAVIGATOR_SELECTOR, EDITING_PANEL];
|
|
1830
|
+
var EDITOR_WRAPPER_SELECTOR = "inline-editor-wrapper";
|
|
1831
|
+
var CanvasInlineEditor = ({
|
|
1832
|
+
elementClasses,
|
|
1833
|
+
initialValue,
|
|
1834
|
+
expectedTag,
|
|
1835
|
+
rootElement,
|
|
1836
|
+
id,
|
|
1837
|
+
setValue,
|
|
1838
|
+
onBlur
|
|
1839
|
+
}) => {
|
|
1840
|
+
const [selectionOffsets, setSelectionOffsets] = (0, import_react11.useState)(null);
|
|
1841
|
+
const [editor, setEditor] = (0, import_react11.useState)(null);
|
|
1842
|
+
const onSelectionEnd = (view) => {
|
|
1843
|
+
const hasSelection = !view.state.selection.empty;
|
|
1844
|
+
setSelectionOffsets(hasSelection ? calcSelectionCenterOffsets(view) : null);
|
|
1845
|
+
};
|
|
1846
|
+
useOnClickOutsideIframe(onBlur);
|
|
1847
|
+
return /* @__PURE__ */ React5.createElement(import_ui4.ThemeProvider, null, /* @__PURE__ */ React5.createElement(InlineEditingOverlay, { expectedTag, rootElement, id }), /* @__PURE__ */ React5.createElement("style", null, `
|
|
1848
|
+
.${EDITOR_WRAPPER_SELECTOR}, .${EDITOR_WRAPPER_SELECTOR} > * {
|
|
1849
|
+
height: 100%;
|
|
1850
|
+
}
|
|
1851
|
+
.ProseMirror > * {
|
|
1852
|
+
height: 100%;
|
|
1853
|
+
}
|
|
1854
|
+
`), /* @__PURE__ */ React5.createElement(
|
|
1855
|
+
import_editor_controls2.InlineEditor,
|
|
1856
|
+
{
|
|
1857
|
+
onEditorCreate: setEditor,
|
|
1858
|
+
editorProps: {
|
|
1859
|
+
attributes: {
|
|
1860
|
+
style: "outline: none;overflow-wrap: normal;height:100%"
|
|
1861
|
+
}
|
|
1862
|
+
},
|
|
1863
|
+
elementClasses,
|
|
1864
|
+
value: initialValue,
|
|
1865
|
+
setValue,
|
|
1866
|
+
onBlur,
|
|
1867
|
+
autofocus: true,
|
|
1868
|
+
expectedTag,
|
|
1869
|
+
wrapperClassName: EDITOR_WRAPPER_SELECTOR,
|
|
1870
|
+
onSelectionEnd
|
|
1871
|
+
}
|
|
1872
|
+
), selectionOffsets && editor && /* @__PURE__ */ React5.createElement(
|
|
1873
|
+
InlineEditingToolbarWrapper,
|
|
1874
|
+
{
|
|
1875
|
+
expectedTag,
|
|
1876
|
+
editor,
|
|
1877
|
+
rootElement,
|
|
1878
|
+
id,
|
|
1879
|
+
selectionOffsets
|
|
1880
|
+
}
|
|
1881
|
+
));
|
|
1882
|
+
};
|
|
1883
|
+
var InlineEditingOverlay = ({
|
|
1884
|
+
expectedTag,
|
|
1885
|
+
rootElement,
|
|
1886
|
+
id
|
|
1887
|
+
}) => {
|
|
1888
|
+
const inlineEditedElement = getInlineEditorElement(rootElement, expectedTag);
|
|
1889
|
+
const [overlayRefElement, setOverlayElement] = (0, import_react11.useState)(inlineEditedElement);
|
|
1890
|
+
(0, import_react11.useEffect)(() => {
|
|
1891
|
+
setOverlayElement(getInlineEditorElement(rootElement, expectedTag));
|
|
1892
|
+
}, [expectedTag, rootElement]);
|
|
1893
|
+
return overlayRefElement ? /* @__PURE__ */ React5.createElement(OutlineOverlay, { element: overlayRefElement, id, isSelected: true }) : null;
|
|
1894
|
+
};
|
|
1895
|
+
var InlineEditingToolbarWrapper = ({
|
|
1896
|
+
expectedTag,
|
|
1897
|
+
editor,
|
|
1898
|
+
rootElement,
|
|
1899
|
+
id,
|
|
1900
|
+
selectionOffsets
|
|
1901
|
+
}) => {
|
|
1902
|
+
const [element, setElement] = (0, import_react11.useState)(null);
|
|
1903
|
+
(0, import_react11.useEffect)(() => {
|
|
1904
|
+
setElement(getInlineEditorElement(rootElement, expectedTag));
|
|
1905
|
+
}, [expectedTag, rootElement]);
|
|
1906
|
+
return element ? /* @__PURE__ */ React5.createElement(InlineEditingToolbar, { element, editor, id, selectionOffsets }) : null;
|
|
1907
|
+
};
|
|
1908
|
+
var InlineEditingToolbar = ({
|
|
1909
|
+
element,
|
|
1910
|
+
editor,
|
|
1911
|
+
id,
|
|
1912
|
+
selectionOffsets
|
|
1913
|
+
}) => {
|
|
1914
|
+
const { floating } = useFloatingOnElement({
|
|
1915
|
+
element,
|
|
1916
|
+
isSelected: true
|
|
1917
|
+
});
|
|
1918
|
+
const { getFloatingProps, getReferenceProps } = (0, import_react12.useInteractions)();
|
|
1919
|
+
const style = getComputedStyle(floating.styles, selectionOffsets);
|
|
1920
|
+
useBindReactPropsToElement(element, getReferenceProps);
|
|
1921
|
+
return /* @__PURE__ */ React5.createElement(import_react12.FloatingPortal, { id: CANVAS_WRAPPER_ID }, /* @__PURE__ */ React5.createElement(
|
|
1922
|
+
import_ui4.Box,
|
|
1923
|
+
{
|
|
1924
|
+
ref: floating.setRef,
|
|
1925
|
+
style: {
|
|
1926
|
+
...floating.styles,
|
|
1927
|
+
pointerEvents: "none"
|
|
1928
|
+
},
|
|
1929
|
+
role: "presentation",
|
|
1930
|
+
...getFloatingProps({ style })
|
|
1931
|
+
},
|
|
1932
|
+
floating.styles.transform && /* @__PURE__ */ React5.createElement(
|
|
1933
|
+
import_ui4.Box,
|
|
1934
|
+
{
|
|
1935
|
+
sx: {
|
|
1936
|
+
position: "relative",
|
|
1937
|
+
transform: "translateY(-100%)",
|
|
1938
|
+
height: "max-content"
|
|
1939
|
+
}
|
|
1940
|
+
},
|
|
1941
|
+
/* @__PURE__ */ React5.createElement(
|
|
1942
|
+
import_editor_controls2.InlineEditorToolbar,
|
|
1943
|
+
{
|
|
1944
|
+
editor,
|
|
1945
|
+
elementId: id,
|
|
1946
|
+
sx: {
|
|
1947
|
+
transform: "translateX(-50%)"
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
)
|
|
1951
|
+
)
|
|
1952
|
+
));
|
|
1953
|
+
};
|
|
1954
|
+
var getInlineEditorElement = (elementWrapper, expectedTag) => {
|
|
1955
|
+
return !expectedTag ? null : elementWrapper.querySelector(expectedTag);
|
|
1956
|
+
};
|
|
1957
|
+
var useOnClickOutsideIframe = (handleUnmount) => {
|
|
1958
|
+
const asyncUnmountInlineEditor = React5.useCallback(() => queueMicrotask(handleUnmount), [handleUnmount]);
|
|
1959
|
+
(0, import_react11.useEffect)(() => {
|
|
1960
|
+
EDITOR_ELEMENTS_OUT_OF_IFRAME.forEach(
|
|
1961
|
+
(selector) => document?.querySelector(selector)?.addEventListener("mousedown", asyncUnmountInlineEditor)
|
|
1962
|
+
);
|
|
1963
|
+
return () => EDITOR_ELEMENTS_OUT_OF_IFRAME.forEach(
|
|
1964
|
+
(selector) => document?.querySelector(selector)?.removeEventListener("mousedown", asyncUnmountInlineEditor)
|
|
1965
|
+
);
|
|
1966
|
+
}, []);
|
|
1967
|
+
};
|
|
1968
|
+
|
|
1767
1969
|
// src/legacy/replacements/inline-editing/inline-editing-eligibility.ts
|
|
1768
1970
|
var import_editor_props3 = require("@elementor/editor-props");
|
|
1769
1971
|
var hasKey = (propType) => {
|
|
@@ -1793,33 +1995,8 @@ var isInlineEditingAllowed = ({ rawValue, propTypeFromSchema }) => {
|
|
|
1793
1995
|
return import_editor_props3.htmlPropTypeUtil.isValid(rawValue) || import_editor_props3.stringPropTypeUtil.isValid(rawValue);
|
|
1794
1996
|
};
|
|
1795
1997
|
|
|
1796
|
-
// src/legacy/replacements/inline-editing/inline-editing-utils.ts
|
|
1797
|
-
var INLINE_EDITING_PROPERTY_PER_TYPE = {
|
|
1798
|
-
"e-form-label": "text",
|
|
1799
|
-
"e-heading": "title",
|
|
1800
|
-
"e-paragraph": "paragraph"
|
|
1801
|
-
};
|
|
1802
|
-
var legacyWindow = window;
|
|
1803
|
-
var getInitialPopoverPosition = () => {
|
|
1804
|
-
const positionFallback = { left: 0, top: 0 };
|
|
1805
|
-
const iFrameElement = legacyWindow?.elementor?.$preview?.get(0);
|
|
1806
|
-
const iFramePosition = iFrameElement?.getBoundingClientRect() ?? positionFallback;
|
|
1807
|
-
const previewElement = legacyWindow?.elementor?.$previewWrapper?.get(0);
|
|
1808
|
-
const previewPosition = previewElement ? { left: previewElement.scrollLeft, top: previewElement.scrollTop } : positionFallback;
|
|
1809
|
-
return {
|
|
1810
|
-
left: iFramePosition.left + previewPosition.left,
|
|
1811
|
-
top: iFramePosition.top + previewPosition.top
|
|
1812
|
-
};
|
|
1813
|
-
};
|
|
1814
|
-
|
|
1815
1998
|
// src/legacy/replacements/inline-editing/inline-editing-elements.tsx
|
|
1816
|
-
var EXPERIMENT_KEY = "v4-inline-text-editing";
|
|
1817
1999
|
var HISTORY_DEBOUNCE_WAIT = 800;
|
|
1818
|
-
var TOP_BAR_SELECTOR = "#elementor-editor-wrapper-v2";
|
|
1819
|
-
var NAVIGATOR_SELECTOR = "#elementor-navigator";
|
|
1820
|
-
var V4_EDITING_PANEL = "main.MuiBox-root";
|
|
1821
|
-
var V3_EDITING_PANEL = "#elementor-panel-content-wrapper";
|
|
1822
|
-
var BLUR_TRIGGERING_SELECTORS = [TOP_BAR_SELECTOR, NAVIGATOR_SELECTOR, V4_EDITING_PANEL, V3_EDITING_PANEL];
|
|
1823
2000
|
var InlineEditingReplacement = class extends ReplacementBase {
|
|
1824
2001
|
inlineEditorRoot = null;
|
|
1825
2002
|
handlerAttached = false;
|
|
@@ -1833,7 +2010,7 @@ var InlineEditingReplacement = class extends ReplacementBase {
|
|
|
1833
2010
|
return !!this.inlineEditorRoot;
|
|
1834
2011
|
}
|
|
1835
2012
|
shouldRenderReplacement() {
|
|
1836
|
-
return (0, import_editor_v1_adapters8.
|
|
2013
|
+
return this.isInlineEditingEligible() && (0, import_editor_v1_adapters8.getCurrentEditMode)() === "edit";
|
|
1837
2014
|
}
|
|
1838
2015
|
handleRenderInlineEditor = () => {
|
|
1839
2016
|
if (this.isEditingModeActive() || !this.isInlineEditingEligible()) {
|
|
@@ -1900,11 +2077,11 @@ var InlineEditingReplacement = class extends ReplacementBase {
|
|
|
1900
2077
|
}
|
|
1901
2078
|
getExtractedContentValue() {
|
|
1902
2079
|
const propValue = this.getInlineEditablePropValue();
|
|
1903
|
-
return import_editor_props4.htmlPropTypeUtil.extract(propValue) ??
|
|
2080
|
+
return import_editor_props4.htmlPropTypeUtil.extract(propValue) ?? "";
|
|
1904
2081
|
}
|
|
1905
2082
|
setContentValue(value) {
|
|
1906
2083
|
const settingKey = this.getInlineEditablePropertyName();
|
|
1907
|
-
const valueToSave =
|
|
2084
|
+
const valueToSave = import_editor_props4.htmlPropTypeUtil.create(value || "");
|
|
1908
2085
|
(0, import_editor_v1_adapters8.undoable)(
|
|
1909
2086
|
{
|
|
1910
2087
|
do: () => {
|
|
@@ -1979,65 +2156,26 @@ var InlineEditingReplacement = class extends ReplacementBase {
|
|
|
1979
2156
|
if (this.isEditingModeActive()) {
|
|
1980
2157
|
this.resetInlineEditorRoot();
|
|
1981
2158
|
}
|
|
1982
|
-
const InlineEditorApp = this.InlineEditorApp;
|
|
1983
|
-
const wrapperClasses = "elementor";
|
|
1984
2159
|
const elementClasses = this.element.children?.[0]?.classList.toString() ?? "";
|
|
2160
|
+
const propValue = this.getExtractedContentValue();
|
|
2161
|
+
const expectedTag = this.getExpectedTag();
|
|
1985
2162
|
this.element.innerHTML = "";
|
|
1986
2163
|
this.inlineEditorRoot = (0, import_client.createRoot)(this.element);
|
|
1987
2164
|
this.inlineEditorRoot.render(
|
|
1988
|
-
/* @__PURE__ */
|
|
1989
|
-
|
|
1990
|
-
}
|
|
1991
|
-
InlineEditorApp = ({ wrapperClasses, elementClasses }) => {
|
|
1992
|
-
const propValue = this.getExtractedContentValue();
|
|
1993
|
-
const expectedTag = this.getExpectedTag();
|
|
1994
|
-
const wrapperRef = (0, import_react11.useRef)(null);
|
|
1995
|
-
const [isWrapperRendered, setIsWrapperRendered] = (0, import_react11.useState)(false);
|
|
1996
|
-
(0, import_react11.useEffect)(() => {
|
|
1997
|
-
setIsWrapperRendered(!!wrapperRef.current);
|
|
1998
|
-
BLUR_TRIGGERING_SELECTORS.forEach(
|
|
1999
|
-
(selector) => document?.querySelector(selector)?.addEventListener("mousedown", asyncUnmountInlineEditor)
|
|
2000
|
-
);
|
|
2001
|
-
return () => BLUR_TRIGGERING_SELECTORS.forEach(
|
|
2002
|
-
(selector) => document?.querySelector(selector)?.removeEventListener("mousedown", asyncUnmountInlineEditor)
|
|
2003
|
-
);
|
|
2004
|
-
}, []);
|
|
2005
|
-
const asyncUnmountInlineEditor = React5.useCallback(
|
|
2006
|
-
() => queueMicrotask(this.unmountInlineEditor.bind(this)),
|
|
2007
|
-
[]
|
|
2008
|
-
);
|
|
2009
|
-
return /* @__PURE__ */ React5.createElement(import_ui4.ThemeProvider, null, /* @__PURE__ */ React5.createElement(
|
|
2010
|
-
import_ui4.Box,
|
|
2011
|
-
{
|
|
2012
|
-
ref: wrapperRef,
|
|
2013
|
-
sx: {
|
|
2014
|
-
"& .elementor-inline-editor-reset": {
|
|
2015
|
-
margin: 0,
|
|
2016
|
-
padding: 0
|
|
2017
|
-
}
|
|
2018
|
-
}
|
|
2019
|
-
},
|
|
2020
|
-
isWrapperRendered && /* @__PURE__ */ React5.createElement(OutlineOverlay, { element: wrapperRef.current, id: this.id, isSelected: true }),
|
|
2021
|
-
/* @__PURE__ */ React5.createElement(
|
|
2022
|
-
import_editor_controls2.InlineEditor,
|
|
2165
|
+
/* @__PURE__ */ React6.createElement(
|
|
2166
|
+
CanvasInlineEditor,
|
|
2023
2167
|
{
|
|
2024
|
-
attributes: {
|
|
2025
|
-
class: wrapperClasses,
|
|
2026
|
-
style: "outline: none;"
|
|
2027
|
-
},
|
|
2028
2168
|
elementClasses,
|
|
2029
|
-
|
|
2030
|
-
setValue: this.setContentValue.bind(this),
|
|
2031
|
-
onBlur: this.unmountInlineEditor.bind(this),
|
|
2032
|
-
autofocus: true,
|
|
2033
|
-
showToolbar: true,
|
|
2034
|
-
getInitialPopoverPosition,
|
|
2169
|
+
initialValue: propValue,
|
|
2035
2170
|
expectedTag,
|
|
2036
|
-
|
|
2171
|
+
rootElement: this.element,
|
|
2172
|
+
id: this.id,
|
|
2173
|
+
setValue: this.setContentValue.bind(this),
|
|
2174
|
+
onBlur: this.unmountInlineEditor.bind(this)
|
|
2037
2175
|
}
|
|
2038
2176
|
)
|
|
2039
|
-
)
|
|
2040
|
-
}
|
|
2177
|
+
);
|
|
2178
|
+
}
|
|
2041
2179
|
};
|
|
2042
2180
|
|
|
2043
2181
|
// src/legacy/replacements/manager.ts
|
|
@@ -2122,13 +2260,13 @@ var createTemplatedElementTypeWithReplacements = ({
|
|
|
2122
2260
|
renderer,
|
|
2123
2261
|
element
|
|
2124
2262
|
}) => {
|
|
2125
|
-
const
|
|
2263
|
+
const legacyWindow = window;
|
|
2126
2264
|
const view = createViewWithReplacements({
|
|
2127
2265
|
type,
|
|
2128
2266
|
renderer,
|
|
2129
2267
|
element
|
|
2130
2268
|
});
|
|
2131
|
-
return class extends
|
|
2269
|
+
return class extends legacyWindow.elementor.modules.elements.types.Widget {
|
|
2132
2270
|
getType() {
|
|
2133
2271
|
return type;
|
|
2134
2272
|
}
|
|
@@ -2146,7 +2284,7 @@ function registerElementType(type, elementTypeGenerator) {
|
|
|
2146
2284
|
function initLegacyViews() {
|
|
2147
2285
|
(0, import_editor_v1_adapters9.__privateListenTo)((0, import_editor_v1_adapters9.v1ReadyEvent)(), () => {
|
|
2148
2286
|
const config = (0, import_editor_elements4.getWidgetsCache)() ?? {};
|
|
2149
|
-
const
|
|
2287
|
+
const legacyWindow = window;
|
|
2150
2288
|
const renderer = createDomRenderer();
|
|
2151
2289
|
Object.entries(config).forEach(([type, element]) => {
|
|
2152
2290
|
if (!element.atomic) {
|
|
@@ -2160,7 +2298,7 @@ function initLegacyViews() {
|
|
|
2160
2298
|
} else {
|
|
2161
2299
|
ElementType = createElementType(type);
|
|
2162
2300
|
}
|
|
2163
|
-
|
|
2301
|
+
legacyWindow.elementor.elementsManager.registerElementType(new ElementType());
|
|
2164
2302
|
});
|
|
2165
2303
|
});
|
|
2166
2304
|
}
|