@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.mjs
CHANGED
|
@@ -2183,8 +2183,7 @@ import {
|
|
|
2183
2183
|
useElementSettings
|
|
2184
2184
|
} from "@elementor/editor-elements";
|
|
2185
2185
|
import {
|
|
2186
|
-
isDependencyMet as isDependencyMet2
|
|
2187
|
-
migratePropValue
|
|
2186
|
+
isDependencyMet as isDependencyMet2
|
|
2188
2187
|
} from "@elementor/editor-props";
|
|
2189
2188
|
import { undoable as undoable4 } from "@elementor/editor-v1-adapters";
|
|
2190
2189
|
import { __ as __8 } from "@wordpress/i18n";
|
|
@@ -2343,10 +2342,7 @@ var SettingsField = ({ bind, children, propDisplayName }) => {
|
|
|
2343
2342
|
elementType: { propsSchema, dependenciesPerTargetMapping = {} }
|
|
2344
2343
|
} = useElement();
|
|
2345
2344
|
const elementSettingValues = useElementSettings(elementId, Object.keys(propsSchema));
|
|
2346
|
-
const
|
|
2347
|
-
return migratePropValues(elementSettingValues, propsSchema);
|
|
2348
|
-
}, [elementSettingValues, propsSchema]);
|
|
2349
|
-
const value = { [bind]: migratedValues?.[bind] ?? null };
|
|
2345
|
+
const value = { [bind]: elementSettingValues?.[bind] ?? null };
|
|
2350
2346
|
const propType = createTopLevelObjectType({ schema: propsSchema });
|
|
2351
2347
|
const undoableUpdateElementProp = useUndoableUpdateElementProp({
|
|
2352
2348
|
elementId,
|
|
@@ -2355,14 +2351,14 @@ var SettingsField = ({ bind, children, propDisplayName }) => {
|
|
|
2355
2351
|
const setValue = (newValue, _ = {}, meta) => {
|
|
2356
2352
|
const { withHistory = true } = meta ?? {};
|
|
2357
2353
|
const dependents = extractOrderedDependencies(dependenciesPerTargetMapping);
|
|
2358
|
-
const settings = getUpdatedValues(newValue, dependents, propsSchema,
|
|
2354
|
+
const settings = getUpdatedValues(newValue, dependents, propsSchema, elementSettingValues, elementId);
|
|
2359
2355
|
if (withHistory) {
|
|
2360
2356
|
undoableUpdateElementProp(settings);
|
|
2361
2357
|
} else {
|
|
2362
2358
|
updateElementSettings3({ id: elementId, props: settings, withHistory: false });
|
|
2363
2359
|
}
|
|
2364
2360
|
};
|
|
2365
|
-
const isDisabled = (prop) => !isDependencyMet2(prop?.dependencies,
|
|
2361
|
+
const isDisabled = (prop) => !isDependencyMet2(prop?.dependencies, elementSettingValues).isMet;
|
|
2366
2362
|
return /* @__PURE__ */ React22.createElement(PropProvider, { propType, value, setValue, isDisabled }, /* @__PURE__ */ React22.createElement(PropKeyProvider, { bind }, children));
|
|
2367
2363
|
};
|
|
2368
2364
|
function useUndoableUpdateElementProp({
|
|
@@ -2391,25 +2387,6 @@ function useUndoableUpdateElementProp({
|
|
|
2391
2387
|
);
|
|
2392
2388
|
}, [elementId, propDisplayName]);
|
|
2393
2389
|
}
|
|
2394
|
-
function migratePropValues(values, schema) {
|
|
2395
|
-
if (!values) {
|
|
2396
|
-
return values;
|
|
2397
|
-
}
|
|
2398
|
-
const migrated = {};
|
|
2399
|
-
for (const [key, value] of Object.entries(values)) {
|
|
2400
|
-
if (value === null || value === void 0) {
|
|
2401
|
-
migrated[key] = value;
|
|
2402
|
-
continue;
|
|
2403
|
-
}
|
|
2404
|
-
const propType = schema[key];
|
|
2405
|
-
if (!propType) {
|
|
2406
|
-
migrated[key] = value;
|
|
2407
|
-
continue;
|
|
2408
|
-
}
|
|
2409
|
-
migrated[key] = migratePropValue(value, propType);
|
|
2410
|
-
}
|
|
2411
|
-
return migrated;
|
|
2412
|
-
}
|
|
2413
2390
|
|
|
2414
2391
|
// src/field-indicators-registry.ts
|
|
2415
2392
|
var indicatorsRegistry = {
|