@elementor/editor-canvas 3.35.0-367 → 3.35.0-368

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 CHANGED
@@ -1799,30 +1799,40 @@ var InlineEditingReplacement = class extends ReplacementBase {
1799
1799
  return import_editor_props3.stringPropTypeUtil.extract(this.getSetting(tagSettingKey) ?? null) ?? import_editor_props3.stringPropTypeUtil.extract(propsSchema.tag.default ?? null) ?? null;
1800
1800
  }
1801
1801
  renderInlineEditor() {
1802
- const propValue = this.getContentValue();
1802
+ const InlineEditorApp = this.InlineEditorApp;
1803
1803
  const classes = (this.element.children?.[0]?.classList.toString() ?? "") + " strip-styles";
1804
- const expectedTag = this.getExpectedTag();
1805
1804
  this.element.innerHTML = "";
1806
1805
  if (this.inlineEditorRoot) {
1807
1806
  this.resetInlineEditorRoot();
1808
1807
  }
1809
1808
  this.inlineEditorRoot = (0, import_client.createRoot)(this.element);
1810
- this.inlineEditorRoot.render(
1811
- /* @__PURE__ */ React5.createElement(import_ui4.ThemeProvider, null, /* @__PURE__ */ React5.createElement(
1812
- import_editor_controls2.InlineEditor,
1813
- {
1814
- attributes: { class: classes },
1815
- value: propValue,
1816
- setValue: this.setContentValue.bind(this),
1817
- onBlur: this.handleUnmountInlineEditor.bind(this),
1818
- autofocus: true,
1819
- showToolbar: true,
1820
- getInitialPopoverPosition,
1821
- expectedTag
1822
- }
1823
- ))
1824
- );
1809
+ this.inlineEditorRoot.render(/* @__PURE__ */ React5.createElement(InlineEditorApp, { classes }));
1825
1810
  }
1811
+ InlineEditorApp = ({ classes }) => {
1812
+ const propValue = this.getContentValue();
1813
+ const expectedTag = this.getExpectedTag();
1814
+ const wrapperRef = React5.useRef(null);
1815
+ const [isWrapperRendered, setIsWrapperRendered] = React5.useState(false);
1816
+ React5.useEffect(() => {
1817
+ setIsWrapperRendered(!!wrapperRef.current);
1818
+ }, []);
1819
+ return /* @__PURE__ */ React5.createElement(import_ui4.ThemeProvider, null, /* @__PURE__ */ React5.createElement(import_ui4.Box, { ref: wrapperRef }, isWrapperRendered && /* @__PURE__ */ React5.createElement(OutlineOverlay, { element: wrapperRef.current, id: this.id, isSelected: true }), /* @__PURE__ */ React5.createElement(
1820
+ import_editor_controls2.InlineEditor,
1821
+ {
1822
+ attributes: {
1823
+ class: classes,
1824
+ style: "outline: none;"
1825
+ },
1826
+ value: propValue,
1827
+ setValue: this.setContentValue.bind(this),
1828
+ onBlur: this.handleUnmountInlineEditor.bind(this),
1829
+ autofocus: true,
1830
+ showToolbar: true,
1831
+ getInitialPopoverPosition,
1832
+ expectedTag
1833
+ }
1834
+ )));
1835
+ };
1826
1836
  };
1827
1837
 
1828
1838
  // src/legacy/replacements/manager.ts
package/dist/index.mjs CHANGED
@@ -1627,7 +1627,7 @@ import {
1627
1627
  stringPropTypeUtil
1628
1628
  } from "@elementor/editor-props";
1629
1629
  import { isExperimentActive } from "@elementor/editor-v1-adapters";
1630
- import { ThemeProvider } from "@elementor/ui";
1630
+ import { Box as Box2, ThemeProvider } from "@elementor/ui";
1631
1631
 
1632
1632
  // src/legacy/replacements/base.ts
1633
1633
  var ReplacementBase = class {
@@ -1761,30 +1761,40 @@ var InlineEditingReplacement = class extends ReplacementBase {
1761
1761
  return stringPropTypeUtil.extract(this.getSetting(tagSettingKey) ?? null) ?? stringPropTypeUtil.extract(propsSchema.tag.default ?? null) ?? null;
1762
1762
  }
1763
1763
  renderInlineEditor() {
1764
- const propValue = this.getContentValue();
1764
+ const InlineEditorApp = this.InlineEditorApp;
1765
1765
  const classes = (this.element.children?.[0]?.classList.toString() ?? "") + " strip-styles";
1766
- const expectedTag = this.getExpectedTag();
1767
1766
  this.element.innerHTML = "";
1768
1767
  if (this.inlineEditorRoot) {
1769
1768
  this.resetInlineEditorRoot();
1770
1769
  }
1771
1770
  this.inlineEditorRoot = createRoot(this.element);
1772
- this.inlineEditorRoot.render(
1773
- /* @__PURE__ */ React5.createElement(ThemeProvider, null, /* @__PURE__ */ React5.createElement(
1774
- InlineEditor,
1775
- {
1776
- attributes: { class: classes },
1777
- value: propValue,
1778
- setValue: this.setContentValue.bind(this),
1779
- onBlur: this.handleUnmountInlineEditor.bind(this),
1780
- autofocus: true,
1781
- showToolbar: true,
1782
- getInitialPopoverPosition,
1783
- expectedTag
1784
- }
1785
- ))
1786
- );
1771
+ this.inlineEditorRoot.render(/* @__PURE__ */ React5.createElement(InlineEditorApp, { classes }));
1787
1772
  }
1773
+ InlineEditorApp = ({ classes }) => {
1774
+ const propValue = this.getContentValue();
1775
+ const expectedTag = this.getExpectedTag();
1776
+ const wrapperRef = React5.useRef(null);
1777
+ const [isWrapperRendered, setIsWrapperRendered] = React5.useState(false);
1778
+ React5.useEffect(() => {
1779
+ setIsWrapperRendered(!!wrapperRef.current);
1780
+ }, []);
1781
+ return /* @__PURE__ */ React5.createElement(ThemeProvider, null, /* @__PURE__ */ React5.createElement(Box2, { ref: wrapperRef }, isWrapperRendered && /* @__PURE__ */ React5.createElement(OutlineOverlay, { element: wrapperRef.current, id: this.id, isSelected: true }), /* @__PURE__ */ React5.createElement(
1782
+ InlineEditor,
1783
+ {
1784
+ attributes: {
1785
+ class: classes,
1786
+ style: "outline: none;"
1787
+ },
1788
+ value: propValue,
1789
+ setValue: this.setContentValue.bind(this),
1790
+ onBlur: this.handleUnmountInlineEditor.bind(this),
1791
+ autofocus: true,
1792
+ showToolbar: true,
1793
+ getInitialPopoverPosition,
1794
+ expectedTag
1795
+ }
1796
+ )));
1797
+ };
1788
1798
  };
1789
1799
 
1790
1800
  // src/legacy/replacements/manager.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-canvas",
3
3
  "description": "Elementor Editor Canvas",
4
- "version": "3.35.0-367",
4
+ "version": "3.35.0-368",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -37,24 +37,24 @@
37
37
  "react-dom": "^18.3.1"
38
38
  },
39
39
  "dependencies": {
40
- "@elementor/editor": "3.35.0-367",
41
- "@elementor/editor-controls": "3.35.0-367",
42
- "@elementor/editor-documents": "3.35.0-367",
43
- "@elementor/editor-elements": "3.35.0-367",
44
- "@elementor/editor-interactions": "3.35.0-367",
45
- "@elementor/editor-mcp": "3.35.0-367",
46
- "@elementor/editor-notifications": "3.35.0-367",
47
- "@elementor/editor-props": "3.35.0-367",
48
- "@elementor/editor-responsive": "3.35.0-367",
49
- "@elementor/editor-styles": "3.35.0-367",
50
- "@elementor/editor-styles-repository": "3.35.0-367",
51
- "@elementor/editor-ui": "3.35.0-367",
52
- "@elementor/editor-v1-adapters": "3.35.0-367",
53
- "@elementor/schema": "3.35.0-367",
54
- "@elementor/twing": "3.35.0-367",
40
+ "@elementor/editor": "3.35.0-368",
41
+ "@elementor/editor-controls": "3.35.0-368",
42
+ "@elementor/editor-documents": "3.35.0-368",
43
+ "@elementor/editor-elements": "3.35.0-368",
44
+ "@elementor/editor-interactions": "3.35.0-368",
45
+ "@elementor/editor-mcp": "3.35.0-368",
46
+ "@elementor/editor-notifications": "3.35.0-368",
47
+ "@elementor/editor-props": "3.35.0-368",
48
+ "@elementor/editor-responsive": "3.35.0-368",
49
+ "@elementor/editor-styles": "3.35.0-368",
50
+ "@elementor/editor-styles-repository": "3.35.0-368",
51
+ "@elementor/editor-ui": "3.35.0-368",
52
+ "@elementor/editor-v1-adapters": "3.35.0-368",
53
+ "@elementor/schema": "3.35.0-368",
54
+ "@elementor/twing": "3.35.0-368",
55
55
  "@elementor/ui": "1.36.17",
56
- "@elementor/utils": "3.35.0-367",
57
- "@elementor/wp-media": "3.35.0-367",
56
+ "@elementor/utils": "3.35.0-368",
57
+ "@elementor/wp-media": "3.35.0-368",
58
58
  "@floating-ui/react": "^0.27.5",
59
59
  "@wordpress/i18n": "^5.13.0"
60
60
  },
@@ -9,8 +9,9 @@ import {
9
9
  type TransformablePropValue,
10
10
  } from '@elementor/editor-props';
11
11
  import { isExperimentActive } from '@elementor/editor-v1-adapters';
12
- import { ThemeProvider } from '@elementor/ui';
12
+ import { Box, ThemeProvider } from '@elementor/ui';
13
13
 
14
+ import { OutlineOverlay } from '../../../components/outline-overlay';
14
15
  import ReplacementBase from '../base';
15
16
  import { getInitialPopoverPosition, INLINE_EDITING_PROPERTY_PER_TYPE } from './inline-editing-utils';
16
17
 
@@ -131,9 +132,8 @@ export default class InlineEditingReplacement extends ReplacementBase {
131
132
  }
132
133
 
133
134
  renderInlineEditor() {
134
- const propValue = this.getContentValue();
135
+ const InlineEditorApp = this.InlineEditorApp;
135
136
  const classes = ( this.element.children?.[ 0 ]?.classList.toString() ?? '' ) + ' strip-styles';
136
- const expectedTag = this.getExpectedTag();
137
137
 
138
138
  this.element.innerHTML = '';
139
139
 
@@ -142,20 +142,40 @@ export default class InlineEditingReplacement extends ReplacementBase {
142
142
  }
143
143
 
144
144
  this.inlineEditorRoot = createRoot( this.element );
145
+ this.inlineEditorRoot.render( <InlineEditorApp classes={ classes } /> );
146
+ }
147
+
148
+ InlineEditorApp = ( { classes }: { classes: string } ) => {
149
+ const propValue = this.getContentValue();
150
+ const expectedTag = this.getExpectedTag();
151
+ const wrapperRef = React.useRef< HTMLDivElement | null >( null );
152
+ const [ isWrapperRendered, setIsWrapperRendered ] = React.useState( false );
153
+
154
+ React.useEffect( () => {
155
+ setIsWrapperRendered( !! wrapperRef.current );
156
+ }, [] );
145
157
 
146
- this.inlineEditorRoot.render(
158
+ return (
147
159
  <ThemeProvider>
148
- <InlineEditor
149
- attributes={ { class: classes } }
150
- value={ propValue }
151
- setValue={ this.setContentValue.bind( this ) }
152
- onBlur={ this.handleUnmountInlineEditor.bind( this ) }
153
- autofocus
154
- showToolbar
155
- getInitialPopoverPosition={ getInitialPopoverPosition }
156
- expectedTag={ expectedTag }
157
- />
160
+ <Box ref={ wrapperRef }>
161
+ { isWrapperRendered && (
162
+ <OutlineOverlay element={ wrapperRef.current as HTMLDivElement } id={ this.id } isSelected />
163
+ ) }
164
+ <InlineEditor
165
+ attributes={ {
166
+ class: classes,
167
+ style: 'outline: none;',
168
+ } }
169
+ value={ propValue }
170
+ setValue={ this.setContentValue.bind( this ) }
171
+ onBlur={ this.handleUnmountInlineEditor.bind( this ) }
172
+ autofocus
173
+ showToolbar
174
+ getInitialPopoverPosition={ getInitialPopoverPosition }
175
+ expectedTag={ expectedTag }
176
+ />
177
+ </Box>
158
178
  </ThemeProvider>
159
179
  );
160
- }
180
+ };
161
181
  }