@elementor/editor-editing-panel 3.35.0-325 → 3.35.0-326
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.d.mts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +9 -43
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -43
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
- package/src/controls-registry/settings-field.tsx +1 -6
- package/src/dynamics/components/dynamic-selection.tsx +3 -2
- package/src/dynamics/dynamic-control.tsx +2 -1
- package/src/dynamics/utils.ts +1 -0
- package/src/utils/prop-dependency-utils.ts +7 -51
package/dist/index.d.mts
CHANGED
|
@@ -722,35 +722,44 @@ declare const controlTypes: {
|
|
|
722
722
|
extract: (prop: unknown) => {
|
|
723
723
|
destination?: any;
|
|
724
724
|
isTargetBlank?: any;
|
|
725
|
+
tag?: any;
|
|
725
726
|
} | null;
|
|
726
727
|
isValid: (prop: unknown) => prop is _elementor_editor_props.TransformablePropValue<"link", {
|
|
727
728
|
destination?: any;
|
|
728
729
|
isTargetBlank?: any;
|
|
730
|
+
tag?: any;
|
|
729
731
|
}>;
|
|
730
732
|
create: {
|
|
731
733
|
(value: {
|
|
732
734
|
destination?: any;
|
|
733
735
|
isTargetBlank?: any;
|
|
736
|
+
tag?: any;
|
|
734
737
|
}): _elementor_editor_props.TransformablePropValue<"link", {
|
|
735
738
|
destination?: any;
|
|
736
739
|
isTargetBlank?: any;
|
|
740
|
+
tag?: any;
|
|
737
741
|
}>;
|
|
738
742
|
(value: {
|
|
739
743
|
destination?: any;
|
|
740
744
|
isTargetBlank?: any;
|
|
745
|
+
tag?: any;
|
|
741
746
|
}, createOptions?: _elementor_editor_props.CreateOptions): _elementor_editor_props.TransformablePropValue<"link", {
|
|
742
747
|
destination?: any;
|
|
743
748
|
isTargetBlank?: any;
|
|
749
|
+
tag?: any;
|
|
744
750
|
}>;
|
|
745
751
|
(value: (prev?: {
|
|
746
752
|
destination?: any;
|
|
747
753
|
isTargetBlank?: any;
|
|
754
|
+
tag?: any;
|
|
748
755
|
} | undefined) => {
|
|
749
756
|
destination?: any;
|
|
750
757
|
isTargetBlank?: any;
|
|
758
|
+
tag?: any;
|
|
751
759
|
}, createOptions: _elementor_editor_props.CreateOptions): _elementor_editor_props.TransformablePropValue<"link", {
|
|
752
760
|
destination?: any;
|
|
753
761
|
isTargetBlank?: any;
|
|
762
|
+
tag?: any;
|
|
754
763
|
}>;
|
|
755
764
|
};
|
|
756
765
|
schema: zod.ZodObject<{
|
|
@@ -758,9 +767,11 @@ declare const controlTypes: {
|
|
|
758
767
|
value: zod.ZodType<{
|
|
759
768
|
destination?: any;
|
|
760
769
|
isTargetBlank?: any;
|
|
770
|
+
tag?: any;
|
|
761
771
|
}, zod.ZodTypeDef, {
|
|
762
772
|
destination?: any;
|
|
763
773
|
isTargetBlank?: any;
|
|
774
|
+
tag?: any;
|
|
764
775
|
}>;
|
|
765
776
|
disabled: zod.ZodOptional<zod.ZodBoolean>;
|
|
766
777
|
}, "strict", zod.ZodTypeAny, {
|
|
@@ -768,6 +779,7 @@ declare const controlTypes: {
|
|
|
768
779
|
value: {
|
|
769
780
|
destination?: any;
|
|
770
781
|
isTargetBlank?: any;
|
|
782
|
+
tag?: any;
|
|
771
783
|
};
|
|
772
784
|
disabled?: boolean | undefined;
|
|
773
785
|
}, {
|
|
@@ -775,6 +787,7 @@ declare const controlTypes: {
|
|
|
775
787
|
value: {
|
|
776
788
|
destination?: any;
|
|
777
789
|
isTargetBlank?: any;
|
|
790
|
+
tag?: any;
|
|
778
791
|
};
|
|
779
792
|
disabled?: boolean | undefined;
|
|
780
793
|
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -722,35 +722,44 @@ declare const controlTypes: {
|
|
|
722
722
|
extract: (prop: unknown) => {
|
|
723
723
|
destination?: any;
|
|
724
724
|
isTargetBlank?: any;
|
|
725
|
+
tag?: any;
|
|
725
726
|
} | null;
|
|
726
727
|
isValid: (prop: unknown) => prop is _elementor_editor_props.TransformablePropValue<"link", {
|
|
727
728
|
destination?: any;
|
|
728
729
|
isTargetBlank?: any;
|
|
730
|
+
tag?: any;
|
|
729
731
|
}>;
|
|
730
732
|
create: {
|
|
731
733
|
(value: {
|
|
732
734
|
destination?: any;
|
|
733
735
|
isTargetBlank?: any;
|
|
736
|
+
tag?: any;
|
|
734
737
|
}): _elementor_editor_props.TransformablePropValue<"link", {
|
|
735
738
|
destination?: any;
|
|
736
739
|
isTargetBlank?: any;
|
|
740
|
+
tag?: any;
|
|
737
741
|
}>;
|
|
738
742
|
(value: {
|
|
739
743
|
destination?: any;
|
|
740
744
|
isTargetBlank?: any;
|
|
745
|
+
tag?: any;
|
|
741
746
|
}, createOptions?: _elementor_editor_props.CreateOptions): _elementor_editor_props.TransformablePropValue<"link", {
|
|
742
747
|
destination?: any;
|
|
743
748
|
isTargetBlank?: any;
|
|
749
|
+
tag?: any;
|
|
744
750
|
}>;
|
|
745
751
|
(value: (prev?: {
|
|
746
752
|
destination?: any;
|
|
747
753
|
isTargetBlank?: any;
|
|
754
|
+
tag?: any;
|
|
748
755
|
} | undefined) => {
|
|
749
756
|
destination?: any;
|
|
750
757
|
isTargetBlank?: any;
|
|
758
|
+
tag?: any;
|
|
751
759
|
}, createOptions: _elementor_editor_props.CreateOptions): _elementor_editor_props.TransformablePropValue<"link", {
|
|
752
760
|
destination?: any;
|
|
753
761
|
isTargetBlank?: any;
|
|
762
|
+
tag?: any;
|
|
754
763
|
}>;
|
|
755
764
|
};
|
|
756
765
|
schema: zod.ZodObject<{
|
|
@@ -758,9 +767,11 @@ declare const controlTypes: {
|
|
|
758
767
|
value: zod.ZodType<{
|
|
759
768
|
destination?: any;
|
|
760
769
|
isTargetBlank?: any;
|
|
770
|
+
tag?: any;
|
|
761
771
|
}, zod.ZodTypeDef, {
|
|
762
772
|
destination?: any;
|
|
763
773
|
isTargetBlank?: any;
|
|
774
|
+
tag?: any;
|
|
764
775
|
}>;
|
|
765
776
|
disabled: zod.ZodOptional<zod.ZodBoolean>;
|
|
766
777
|
}, "strict", zod.ZodTypeAny, {
|
|
@@ -768,6 +779,7 @@ declare const controlTypes: {
|
|
|
768
779
|
value: {
|
|
769
780
|
destination?: any;
|
|
770
781
|
isTargetBlank?: any;
|
|
782
|
+
tag?: any;
|
|
771
783
|
};
|
|
772
784
|
disabled?: boolean | undefined;
|
|
773
785
|
}, {
|
|
@@ -775,6 +787,7 @@ declare const controlTypes: {
|
|
|
775
787
|
value: {
|
|
776
788
|
destination?: any;
|
|
777
789
|
isTargetBlank?: any;
|
|
790
|
+
tag?: any;
|
|
778
791
|
};
|
|
779
792
|
disabled?: boolean | undefined;
|
|
780
793
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -2169,39 +2169,8 @@ var import_i18n8 = require("@wordpress/i18n");
|
|
|
2169
2169
|
// src/utils/prop-dependency-utils.ts
|
|
2170
2170
|
var import_editor_props5 = require("@elementor/editor-props");
|
|
2171
2171
|
var import_session4 = require("@elementor/session");
|
|
2172
|
-
function extractOrderedDependencies(
|
|
2173
|
-
|
|
2174
|
-
if (!prop) {
|
|
2175
|
-
return [];
|
|
2176
|
-
}
|
|
2177
|
-
const dependencies = [];
|
|
2178
|
-
if ("object" === prop.kind) {
|
|
2179
|
-
dependencies.push(...Object.keys(prop.shape).map((key) => bind + "." + key));
|
|
2180
|
-
}
|
|
2181
|
-
const directDependencies = extractPropOrderedDependencies(bind, dependenciesPerTargetMapping);
|
|
2182
|
-
if (!dependencies.length) {
|
|
2183
|
-
return directDependencies;
|
|
2184
|
-
}
|
|
2185
|
-
return dependencies.reduce(
|
|
2186
|
-
(carry, dependency) => [
|
|
2187
|
-
...carry,
|
|
2188
|
-
...extractOrderedDependencies(dependency, propsSchema, elementValues, dependenciesPerTargetMapping)
|
|
2189
|
-
],
|
|
2190
|
-
directDependencies
|
|
2191
|
-
);
|
|
2192
|
-
}
|
|
2193
|
-
function extractPropOrderedDependencies(bind, dependenciesPerTargetMapping) {
|
|
2194
|
-
if (!dependenciesPerTargetMapping?.[bind]?.length) {
|
|
2195
|
-
return [];
|
|
2196
|
-
}
|
|
2197
|
-
return dependenciesPerTargetMapping[bind].reduce(
|
|
2198
|
-
(dependencies, dependency) => [
|
|
2199
|
-
...dependencies,
|
|
2200
|
-
dependency,
|
|
2201
|
-
...extractPropOrderedDependencies(dependency, dependenciesPerTargetMapping)
|
|
2202
|
-
],
|
|
2203
|
-
[]
|
|
2204
|
-
);
|
|
2172
|
+
function extractOrderedDependencies(dependenciesPerTargetMapping) {
|
|
2173
|
+
return Object.values(dependenciesPerTargetMapping).flat().filter((dependent, index, self) => self.indexOf(dependent) === index);
|
|
2205
2174
|
}
|
|
2206
2175
|
function getUpdatedValues(values, dependencies, propsSchema, elementValues, elementId) {
|
|
2207
2176
|
if (!dependencies.length) {
|
|
@@ -2210,8 +2179,8 @@ function getUpdatedValues(values, dependencies, propsSchema, elementValues, elem
|
|
|
2210
2179
|
return dependencies.reduce(
|
|
2211
2180
|
(newValues, dependency) => {
|
|
2212
2181
|
const path = dependency.split(".");
|
|
2213
|
-
const propType = getPropType(propsSchema, elementValues, path);
|
|
2214
2182
|
const combinedValues = { ...elementValues, ...newValues };
|
|
2183
|
+
const propType = getPropType(propsSchema, combinedValues, path);
|
|
2215
2184
|
if (!propType) {
|
|
2216
2185
|
return newValues;
|
|
2217
2186
|
}
|
|
@@ -2355,12 +2324,7 @@ var SettingsField = ({ bind, children, propDisplayName }) => {
|
|
|
2355
2324
|
propDisplayName
|
|
2356
2325
|
});
|
|
2357
2326
|
const setValue = (newValue) => {
|
|
2358
|
-
const dependents = extractOrderedDependencies(
|
|
2359
|
-
bind,
|
|
2360
|
-
propsSchema,
|
|
2361
|
-
elementSettingValues,
|
|
2362
|
-
dependenciesPerTargetMapping
|
|
2363
|
-
);
|
|
2327
|
+
const dependents = extractOrderedDependencies(dependenciesPerTargetMapping);
|
|
2364
2328
|
const settings = getUpdatedValues(newValue, dependents, propsSchema, elementSettingValues, elementId);
|
|
2365
2329
|
undoableUpdateElementProp(settings);
|
|
2366
2330
|
};
|
|
@@ -5344,6 +5308,7 @@ var dynamicPropTypeUtil = (0, import_editor_props17.createPropUtils)(
|
|
|
5344
5308
|
DYNAMIC_PROP_TYPE_KEY,
|
|
5345
5309
|
import_schema.z.strictObject({
|
|
5346
5310
|
name: import_schema.z.string(),
|
|
5311
|
+
group: import_schema.z.string(),
|
|
5347
5312
|
settings: import_schema.z.any().optional()
|
|
5348
5313
|
})
|
|
5349
5314
|
);
|
|
@@ -5477,7 +5442,7 @@ var DynamicConditionalControl = ({
|
|
|
5477
5442
|
// src/dynamics/dynamic-control.tsx
|
|
5478
5443
|
var DynamicControl = ({ bind, children }) => {
|
|
5479
5444
|
const { value, setValue } = (0, import_editor_controls56.useBoundProp)(dynamicPropTypeUtil);
|
|
5480
|
-
const { name = "", settings } = value ?? {};
|
|
5445
|
+
const { name = "", group = "", settings } = value ?? {};
|
|
5481
5446
|
const dynamicTag = useDynamicTag(name);
|
|
5482
5447
|
if (!dynamicTag) {
|
|
5483
5448
|
throw new Error(`Dynamic tag ${name} not found`);
|
|
@@ -5488,6 +5453,7 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
5488
5453
|
const setDynamicValue = (newValues) => {
|
|
5489
5454
|
setValue({
|
|
5490
5455
|
name,
|
|
5456
|
+
group,
|
|
5491
5457
|
settings: {
|
|
5492
5458
|
...settings,
|
|
5493
5459
|
...newValues
|
|
@@ -5533,7 +5499,7 @@ var DynamicSelection = ({ close: closePopover }) => {
|
|
|
5533
5499
|
updatePropValueHistory(anyValue);
|
|
5534
5500
|
}
|
|
5535
5501
|
const selectedOption = options12.flatMap(([, items3]) => items3).find((item) => item.value === value);
|
|
5536
|
-
setValue({ name: value, settings: { label: selectedOption?.label } });
|
|
5502
|
+
setValue({ name: value, group: selectedOption?.group ?? "", settings: { label: selectedOption?.label } });
|
|
5537
5503
|
closePopover();
|
|
5538
5504
|
};
|
|
5539
5505
|
const virtualizedItems = options12.flatMap(([category, items3]) => [
|
|
@@ -5614,7 +5580,7 @@ var useFilteredOptions = (searchValue) => {
|
|
|
5614
5580
|
if (!categories.has(group)) {
|
|
5615
5581
|
categories.set(group, []);
|
|
5616
5582
|
}
|
|
5617
|
-
categories.get(group)?.push({ label, value: name });
|
|
5583
|
+
categories.get(group)?.push({ label, group, value: name });
|
|
5618
5584
|
return categories;
|
|
5619
5585
|
}, /* @__PURE__ */ new Map());
|
|
5620
5586
|
return [...options12];
|