@elementor/editor-editing-panel 3.35.0-445 → 3.35.0-447
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 +3 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
- package/src/controls-registry/settings-field.tsx +3 -35
package/dist/index.js
CHANGED
|
@@ -2335,10 +2335,7 @@ var SettingsField = ({ bind, children, propDisplayName }) => {
|
|
|
2335
2335
|
elementType: { propsSchema, dependenciesPerTargetMapping = {} }
|
|
2336
2336
|
} = useElement();
|
|
2337
2337
|
const elementSettingValues = (0, import_editor_elements7.useElementSettings)(elementId, Object.keys(propsSchema));
|
|
2338
|
-
const
|
|
2339
|
-
return migratePropValues(elementSettingValues, propsSchema);
|
|
2340
|
-
}, [elementSettingValues, propsSchema]);
|
|
2341
|
-
const value = { [bind]: migratedValues?.[bind] ?? null };
|
|
2338
|
+
const value = { [bind]: elementSettingValues?.[bind] ?? null };
|
|
2342
2339
|
const propType = createTopLevelObjectType({ schema: propsSchema });
|
|
2343
2340
|
const undoableUpdateElementProp = useUndoableUpdateElementProp({
|
|
2344
2341
|
elementId,
|
|
@@ -2347,14 +2344,14 @@ var SettingsField = ({ bind, children, propDisplayName }) => {
|
|
|
2347
2344
|
const setValue = (newValue, _ = {}, meta) => {
|
|
2348
2345
|
const { withHistory = true } = meta ?? {};
|
|
2349
2346
|
const dependents = extractOrderedDependencies(dependenciesPerTargetMapping);
|
|
2350
|
-
const settings = getUpdatedValues(newValue, dependents, propsSchema,
|
|
2347
|
+
const settings = getUpdatedValues(newValue, dependents, propsSchema, elementSettingValues, elementId);
|
|
2351
2348
|
if (withHistory) {
|
|
2352
2349
|
undoableUpdateElementProp(settings);
|
|
2353
2350
|
} else {
|
|
2354
2351
|
(0, import_editor_elements7.updateElementSettings)({ id: elementId, props: settings, withHistory: false });
|
|
2355
2352
|
}
|
|
2356
2353
|
};
|
|
2357
|
-
const isDisabled = (prop) => !(0, import_editor_props6.isDependencyMet)(prop?.dependencies,
|
|
2354
|
+
const isDisabled = (prop) => !(0, import_editor_props6.isDependencyMet)(prop?.dependencies, elementSettingValues).isMet;
|
|
2358
2355
|
return /* @__PURE__ */ React22.createElement(import_editor_controls4.PropProvider, { propType, value, setValue, isDisabled }, /* @__PURE__ */ React22.createElement(import_editor_controls4.PropKeyProvider, { bind }, children));
|
|
2359
2356
|
};
|
|
2360
2357
|
function useUndoableUpdateElementProp({
|
|
@@ -2383,25 +2380,6 @@ function useUndoableUpdateElementProp({
|
|
|
2383
2380
|
);
|
|
2384
2381
|
}, [elementId, propDisplayName]);
|
|
2385
2382
|
}
|
|
2386
|
-
function migratePropValues(values, schema) {
|
|
2387
|
-
if (!values) {
|
|
2388
|
-
return values;
|
|
2389
|
-
}
|
|
2390
|
-
const migrated = {};
|
|
2391
|
-
for (const [key, value] of Object.entries(values)) {
|
|
2392
|
-
if (value === null || value === void 0) {
|
|
2393
|
-
migrated[key] = value;
|
|
2394
|
-
continue;
|
|
2395
|
-
}
|
|
2396
|
-
const propType = schema[key];
|
|
2397
|
-
if (!propType) {
|
|
2398
|
-
migrated[key] = value;
|
|
2399
|
-
continue;
|
|
2400
|
-
}
|
|
2401
|
-
migrated[key] = (0, import_editor_props6.migratePropValue)(value, propType);
|
|
2402
|
-
}
|
|
2403
|
-
return migrated;
|
|
2404
|
-
}
|
|
2405
2383
|
|
|
2406
2384
|
// src/field-indicators-registry.ts
|
|
2407
2385
|
var indicatorsRegistry = {
|