@elementor/editor-canvas 3.35.0-415 → 3.35.0-417

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
@@ -1787,11 +1787,14 @@ var InlineEditingReplacement = class extends ReplacementBase {
1787
1787
  const propertyName = this.getInlineEditablePropertyName();
1788
1788
  return propSchema?.[propertyName] ?? null;
1789
1789
  }
1790
- getContentValue() {
1790
+ getHtmlPropValue() {
1791
1791
  const prop = this.getHtmlPropType();
1792
- const defaultValue = prop?.default?.value ?? "";
1793
1792
  const settingKey = this.getInlineEditablePropertyName();
1794
- return import_editor_props3.htmlPropTypeUtil.extract(this.getSetting(settingKey) ?? null) ?? import_editor_props3.stringPropTypeUtil.extract(this.getSetting(settingKey) ?? null) ?? import_editor_props3.htmlPropTypeUtil.extract(prop?.default ?? null) ?? defaultValue ?? "";
1793
+ return this.getSetting(settingKey) ?? prop?.default ?? null;
1794
+ }
1795
+ getExtractedContentValue() {
1796
+ const propValue = this.getHtmlPropValue();
1797
+ return import_editor_props3.htmlPropTypeUtil.extract(propValue) ?? import_editor_props3.stringPropTypeUtil.extract(propValue) ?? "";
1795
1798
  }
1796
1799
  setContentValue(value) {
1797
1800
  const settingKey = this.getInlineEditablePropertyName();
@@ -1799,11 +1802,11 @@ var InlineEditingReplacement = class extends ReplacementBase {
1799
1802
  (0, import_editor_v1_adapters8.undoable)(
1800
1803
  {
1801
1804
  do: () => {
1802
- const prevValue = this.getContentValue();
1805
+ const prevValue = this.getHtmlPropValue();
1803
1806
  this.runCommand(settingKey, valueToSave);
1804
1807
  return prevValue;
1805
1808
  },
1806
- undo: (prevValue) => {
1809
+ undo: (_, prevValue) => {
1807
1810
  this.runCommand(settingKey, prevValue ?? null);
1808
1811
  }
1809
1812
  },
@@ -1861,7 +1864,7 @@ var InlineEditingReplacement = class extends ReplacementBase {
1861
1864
  );
1862
1865
  }
1863
1866
  InlineEditorApp = ({ wrapperClasses, elementClasses }) => {
1864
- const propValue = this.getContentValue();
1867
+ const propValue = this.getExtractedContentValue();
1865
1868
  const expectedTag = this.getExpectedTag();
1866
1869
  const wrapperRef = (0, import_react11.useRef)(null);
1867
1870
  const [isWrapperRendered, setIsWrapperRendered] = (0, import_react11.useState)(false);
package/dist/index.mjs CHANGED
@@ -1748,11 +1748,14 @@ var InlineEditingReplacement = class extends ReplacementBase {
1748
1748
  const propertyName = this.getInlineEditablePropertyName();
1749
1749
  return propSchema?.[propertyName] ?? null;
1750
1750
  }
1751
- getContentValue() {
1751
+ getHtmlPropValue() {
1752
1752
  const prop = this.getHtmlPropType();
1753
- const defaultValue = prop?.default?.value ?? "";
1754
1753
  const settingKey = this.getInlineEditablePropertyName();
1755
- return htmlPropTypeUtil.extract(this.getSetting(settingKey) ?? null) ?? stringPropTypeUtil.extract(this.getSetting(settingKey) ?? null) ?? htmlPropTypeUtil.extract(prop?.default ?? null) ?? defaultValue ?? "";
1754
+ return this.getSetting(settingKey) ?? prop?.default ?? null;
1755
+ }
1756
+ getExtractedContentValue() {
1757
+ const propValue = this.getHtmlPropValue();
1758
+ return htmlPropTypeUtil.extract(propValue) ?? stringPropTypeUtil.extract(propValue) ?? "";
1756
1759
  }
1757
1760
  setContentValue(value) {
1758
1761
  const settingKey = this.getInlineEditablePropertyName();
@@ -1760,11 +1763,11 @@ var InlineEditingReplacement = class extends ReplacementBase {
1760
1763
  undoable(
1761
1764
  {
1762
1765
  do: () => {
1763
- const prevValue = this.getContentValue();
1766
+ const prevValue = this.getHtmlPropValue();
1764
1767
  this.runCommand(settingKey, valueToSave);
1765
1768
  return prevValue;
1766
1769
  },
1767
- undo: (prevValue) => {
1770
+ undo: (_, prevValue) => {
1768
1771
  this.runCommand(settingKey, prevValue ?? null);
1769
1772
  }
1770
1773
  },
@@ -1822,7 +1825,7 @@ var InlineEditingReplacement = class extends ReplacementBase {
1822
1825
  );
1823
1826
  }
1824
1827
  InlineEditorApp = ({ wrapperClasses, elementClasses }) => {
1825
- const propValue = this.getContentValue();
1828
+ const propValue = this.getExtractedContentValue();
1826
1829
  const expectedTag = this.getExpectedTag();
1827
1830
  const wrapperRef = useRef2(null);
1828
1831
  const [isWrapperRendered, setIsWrapperRendered] = useState4(false);
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-415",
4
+ "version": "3.35.0-417",
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-415",
41
- "@elementor/editor-controls": "3.35.0-415",
42
- "@elementor/editor-documents": "3.35.0-415",
43
- "@elementor/editor-elements": "3.35.0-415",
44
- "@elementor/editor-interactions": "3.35.0-415",
45
- "@elementor/editor-mcp": "3.35.0-415",
46
- "@elementor/editor-notifications": "3.35.0-415",
47
- "@elementor/editor-props": "3.35.0-415",
48
- "@elementor/editor-responsive": "3.35.0-415",
49
- "@elementor/editor-styles": "3.35.0-415",
50
- "@elementor/editor-styles-repository": "3.35.0-415",
51
- "@elementor/editor-ui": "3.35.0-415",
52
- "@elementor/editor-v1-adapters": "3.35.0-415",
53
- "@elementor/schema": "3.35.0-415",
54
- "@elementor/twing": "3.35.0-415",
40
+ "@elementor/editor": "3.35.0-417",
41
+ "@elementor/editor-controls": "3.35.0-417",
42
+ "@elementor/editor-documents": "3.35.0-417",
43
+ "@elementor/editor-elements": "3.35.0-417",
44
+ "@elementor/editor-interactions": "3.35.0-417",
45
+ "@elementor/editor-mcp": "3.35.0-417",
46
+ "@elementor/editor-notifications": "3.35.0-417",
47
+ "@elementor/editor-props": "3.35.0-417",
48
+ "@elementor/editor-responsive": "3.35.0-417",
49
+ "@elementor/editor-styles": "3.35.0-417",
50
+ "@elementor/editor-styles-repository": "3.35.0-417",
51
+ "@elementor/editor-ui": "3.35.0-417",
52
+ "@elementor/editor-v1-adapters": "3.35.0-417",
53
+ "@elementor/schema": "3.35.0-417",
54
+ "@elementor/twing": "3.35.0-417",
55
55
  "@elementor/ui": "1.36.17",
56
- "@elementor/utils": "3.35.0-415",
57
- "@elementor/wp-media": "3.35.0-415",
56
+ "@elementor/utils": "3.35.0-417",
57
+ "@elementor/wp-media": "3.35.0-417",
58
58
  "@floating-ui/react": "^0.27.5",
59
59
  "@wordpress/i18n": "^5.13.0"
60
60
  },
@@ -8,7 +8,6 @@ import {
8
8
  type HtmlPropValue,
9
9
  type PropType,
10
10
  stringPropTypeUtil,
11
- type StringPropValue,
12
11
  type TransformablePropValue,
13
12
  } from '@elementor/editor-props';
14
13
  import { __privateRunCommandSync as runCommandSync, isExperimentActive, undoable } from '@elementor/editor-v1-adapters';
@@ -130,18 +129,17 @@ export default class InlineEditingReplacement extends ReplacementBase {
130
129
  return propSchema?.[ propertyName ] ?? null;
131
130
  }
132
131
 
133
- getContentValue() {
132
+ getHtmlPropValue(): HtmlPropValue | null {
134
133
  const prop = this.getHtmlPropType();
135
- const defaultValue = ( prop?.default as StringPropValue | null )?.value ?? '';
136
134
  const settingKey = this.getInlineEditablePropertyName();
137
135
 
138
- return (
139
- htmlPropTypeUtil.extract( this.getSetting( settingKey ) ?? null ) ??
140
- stringPropTypeUtil.extract( this.getSetting( settingKey ) ?? null ) ??
141
- htmlPropTypeUtil.extract( prop?.default ?? null ) ??
142
- defaultValue ??
143
- ''
144
- );
136
+ return ( this.getSetting( settingKey ) ?? prop?.default ?? null ) as HtmlPropValue | null;
137
+ }
138
+
139
+ getExtractedContentValue() {
140
+ const propValue = this.getHtmlPropValue();
141
+
142
+ return htmlPropTypeUtil.extract( propValue ) ?? stringPropTypeUtil.extract( propValue ) ?? '';
145
143
  }
146
144
 
147
145
  setContentValue( value: string | null ) {
@@ -151,13 +149,13 @@ export default class InlineEditingReplacement extends ReplacementBase {
151
149
  undoable(
152
150
  {
153
151
  do: () => {
154
- const prevValue = this.getContentValue();
152
+ const prevValue = this.getHtmlPropValue();
155
153
 
156
154
  this.runCommand( settingKey, valueToSave );
157
155
 
158
156
  return prevValue;
159
157
  },
160
- undo: ( prevValue ) => {
158
+ undo: ( _, prevValue ) => {
161
159
  this.runCommand( settingKey, prevValue ?? null );
162
160
  },
163
161
  },
@@ -232,7 +230,7 @@ export default class InlineEditingReplacement extends ReplacementBase {
232
230
  }
233
231
 
234
232
  InlineEditorApp = ( { wrapperClasses, elementClasses }: { wrapperClasses: string; elementClasses: string } ) => {
235
- const propValue = this.getContentValue();
233
+ const propValue = this.getExtractedContentValue();
236
234
  const expectedTag = this.getExpectedTag();
237
235
  const wrapperRef = useRef< HTMLDivElement | null >( null );
238
236
  const [ isWrapperRendered, setIsWrapperRendered ] = useState( false );