@elementor/editor-components 3.35.0-414 → 3.35.0-416
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 +85 -67
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -22
- package/src/components/overridable-props/overridable-prop-control.tsx +5 -1
- package/src/utils/expand-navigator.ts +5 -0
- package/src/utils/switch-to-component.ts +13 -2
package/dist/index.mjs
CHANGED
|
@@ -367,16 +367,31 @@ import { getV1DocumentsManager as getV1DocumentsManager2 } from "@elementor/edit
|
|
|
367
367
|
import { __useSelector as useSelector2 } from "@elementor/store";
|
|
368
368
|
|
|
369
369
|
// src/utils/switch-to-component.ts
|
|
370
|
+
import { getCurrentDocumentContainer, selectElement } from "@elementor/editor-elements";
|
|
371
|
+
import { __privateRunCommand as runCommand2 } from "@elementor/editor-v1-adapters";
|
|
372
|
+
|
|
373
|
+
// src/utils/expand-navigator.ts
|
|
370
374
|
import { __privateRunCommand as runCommand } from "@elementor/editor-v1-adapters";
|
|
371
|
-
function
|
|
375
|
+
async function expandNavigator() {
|
|
376
|
+
await runCommand("navigator/expand-all");
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// src/utils/switch-to-component.ts
|
|
380
|
+
async function switchToComponent(componentId, componentInstanceId, element) {
|
|
372
381
|
const selector = getSelector(element, componentInstanceId);
|
|
373
|
-
|
|
382
|
+
await runCommand2("editor/documents/switch", {
|
|
374
383
|
id: componentId,
|
|
375
384
|
selector,
|
|
376
385
|
mode: "autosave",
|
|
377
386
|
setAsInitial: false,
|
|
378
387
|
shouldScroll: false
|
|
379
388
|
});
|
|
389
|
+
const currentDocumentContainer = getCurrentDocumentContainer();
|
|
390
|
+
const topLevelElement = currentDocumentContainer?.children?.[0];
|
|
391
|
+
if (topLevelElement) {
|
|
392
|
+
selectElement(topLevelElement.id);
|
|
393
|
+
expandNavigator();
|
|
394
|
+
}
|
|
380
395
|
}
|
|
381
396
|
function getSelector(element, componentInstanceId) {
|
|
382
397
|
if (element) {
|
|
@@ -2124,11 +2139,11 @@ function validateComponentName(label) {
|
|
|
2124
2139
|
// src/utils/get-container-for-new-element.ts
|
|
2125
2140
|
import {
|
|
2126
2141
|
getContainer as getContainer2,
|
|
2127
|
-
getCurrentDocumentContainer,
|
|
2142
|
+
getCurrentDocumentContainer as getCurrentDocumentContainer2,
|
|
2128
2143
|
getSelectedElements
|
|
2129
2144
|
} from "@elementor/editor-elements";
|
|
2130
2145
|
var getContainerForNewElement = () => {
|
|
2131
|
-
const currentDocumentContainer =
|
|
2146
|
+
const currentDocumentContainer = getCurrentDocumentContainer2();
|
|
2132
2147
|
const selectedElement = getSelectedElementContainer();
|
|
2133
2148
|
let container, options;
|
|
2134
2149
|
if (selectedElement) {
|
|
@@ -2645,7 +2660,7 @@ function findNonAtomicElementsInElement(element) {
|
|
|
2645
2660
|
}
|
|
2646
2661
|
|
|
2647
2662
|
// src/store/actions/create-unpublished-component.ts
|
|
2648
|
-
import { __privateRunCommand as
|
|
2663
|
+
import { __privateRunCommand as runCommand3 } from "@elementor/editor-v1-adapters";
|
|
2649
2664
|
import { __dispatch as dispatch11 } from "@elementor/store";
|
|
2650
2665
|
import { generateUniqueId as generateUniqueId3 } from "@elementor/utils";
|
|
2651
2666
|
function createUnpublishedComponent(name, element, eventData, overridableProps, uid) {
|
|
@@ -2665,7 +2680,7 @@ function createUnpublishedComponent(name, element, eventData, overridableProps,
|
|
|
2665
2680
|
component_name: name,
|
|
2666
2681
|
...eventData
|
|
2667
2682
|
});
|
|
2668
|
-
|
|
2683
|
+
runCommand3("document/save/auto");
|
|
2669
2684
|
return generatedUid;
|
|
2670
2685
|
}
|
|
2671
2686
|
|
|
@@ -3623,7 +3638,10 @@ function OverridablePropControl({
|
|
|
3623
3638
|
origin_value: newValue[bind]
|
|
3624
3639
|
};
|
|
3625
3640
|
setValue(propValue2);
|
|
3626
|
-
|
|
3641
|
+
if (!isComponentInstance2) {
|
|
3642
|
+
const existingProp = overridableProps?.props?.[propValue2.override_key];
|
|
3643
|
+
updateOverridableProp(componentId, propValue2, existingProp?.originPropFields);
|
|
3644
|
+
}
|
|
3627
3645
|
};
|
|
3628
3646
|
const defaultPropType = elementType.propsSchema[bind];
|
|
3629
3647
|
const propType = createTopLevelObjectType2({
|