@elementor/editor-editing-panel 4.2.0-929 → 4.2.0-931
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 +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +88 -96
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +24 -24
- package/src/components/style-sections/layout-section/display-field.tsx +1 -8
- package/src/components/style-sections/layout-section/layout-section.tsx +2 -4
- package/src/dynamics/dynamic-transformer.ts +12 -9
- package/src/dynamics/types.ts +2 -5
package/dist/index.mjs
CHANGED
|
@@ -1949,7 +1949,7 @@ var EditingPanelStickyPromotion = () => {
|
|
|
1949
1949
|
import { Fragment as Fragment9 } from "react";
|
|
1950
1950
|
import * as React90 from "react";
|
|
1951
1951
|
import { getWidgetsCache as getWidgetsCache2 } from "@elementor/editor-elements";
|
|
1952
|
-
import { isExperimentActive
|
|
1952
|
+
import { isExperimentActive } from "@elementor/editor-v1-adapters";
|
|
1953
1953
|
import { Divider as Divider6, Stack as Stack14, Tab, TabPanel, Tabs, useTabs } from "@elementor/ui";
|
|
1954
1954
|
import { __ as __63 } from "@wordpress/i18n";
|
|
1955
1955
|
|
|
@@ -3537,7 +3537,6 @@ var EffectsSection = () => {
|
|
|
3537
3537
|
import * as React61 from "react";
|
|
3538
3538
|
import { ControlFormLabel as ControlFormLabel2 } from "@elementor/editor-controls";
|
|
3539
3539
|
import { useParentElement } from "@elementor/editor-elements";
|
|
3540
|
-
import { isExperimentActive as isExperimentActive2 } from "@elementor/editor-v1-adapters";
|
|
3541
3540
|
import { __ as __37 } from "@wordpress/i18n";
|
|
3542
3541
|
|
|
3543
3542
|
// src/hooks/use-computed-style.ts
|
|
@@ -3939,9 +3938,7 @@ var getOptions2 = (parentStyleDirection) => {
|
|
|
3939
3938
|
|
|
3940
3939
|
// src/components/style-sections/layout-section/display-field.tsx
|
|
3941
3940
|
import * as React48 from "react";
|
|
3942
|
-
import { useMemo as useMemo9 } from "react";
|
|
3943
3941
|
import { ToggleControl as ToggleControl6 } from "@elementor/editor-controls";
|
|
3944
|
-
import { isExperimentActive } from "@elementor/editor-v1-adapters";
|
|
3945
3942
|
import { __ as __24 } from "@wordpress/i18n";
|
|
3946
3943
|
var DISPLAY_LABEL = __24("Display", "elementor");
|
|
3947
3944
|
var displayFieldItems = [
|
|
@@ -3984,12 +3981,7 @@ var displayFieldItems = [
|
|
|
3984
3981
|
];
|
|
3985
3982
|
var DisplayField = () => {
|
|
3986
3983
|
const placeholder = useDisplayPlaceholderValue();
|
|
3987
|
-
|
|
3988
|
-
const items3 = useMemo9(
|
|
3989
|
-
() => isGridActive ? displayFieldItems : displayFieldItems.filter((item) => item.value !== "grid"),
|
|
3990
|
-
[isGridActive]
|
|
3991
|
-
);
|
|
3992
|
-
return /* @__PURE__ */ React48.createElement(StylesField, { bind: "display", propDisplayName: DISPLAY_LABEL, placeholder }, /* @__PURE__ */ React48.createElement(StylesFieldLayout, { label: DISPLAY_LABEL, direction: "column" }, /* @__PURE__ */ React48.createElement(ToggleControl6, { options: items3, maxItems: 4, fullWidth: true })));
|
|
3984
|
+
return /* @__PURE__ */ React48.createElement(StylesField, { bind: "display", propDisplayName: DISPLAY_LABEL, placeholder }, /* @__PURE__ */ React48.createElement(StylesFieldLayout, { label: DISPLAY_LABEL, direction: "column" }, /* @__PURE__ */ React48.createElement(ToggleControl6, { options: displayFieldItems, maxItems: 4, fullWidth: true })));
|
|
3993
3985
|
};
|
|
3994
3986
|
var useDisplayPlaceholderValue = () => useStylesInheritanceChain(["display"])[0]?.value ?? void 0;
|
|
3995
3987
|
|
|
@@ -4038,7 +4030,7 @@ var FlexDirectionField = () => {
|
|
|
4038
4030
|
|
|
4039
4031
|
// src/components/style-sections/layout-section/flex-order-field.tsx
|
|
4040
4032
|
import * as React50 from "react";
|
|
4041
|
-
import { useEffect as useEffect5, useMemo as
|
|
4033
|
+
import { useEffect as useEffect5, useMemo as useMemo9, useState as useState7 } from "react";
|
|
4042
4034
|
import {
|
|
4043
4035
|
ControlToggleButtonGroup,
|
|
4044
4036
|
NumberControl as NumberControl2,
|
|
@@ -4090,7 +4082,7 @@ function FlexOrderFieldContent() {
|
|
|
4090
4082
|
});
|
|
4091
4083
|
const { placeholder } = useBoundProp2();
|
|
4092
4084
|
const placeholderValue = placeholder;
|
|
4093
|
-
const currentGroup =
|
|
4085
|
+
const currentGroup = useMemo9(() => getGroupControlValue(order?.value ?? null), [order]);
|
|
4094
4086
|
const [activeGroup, setActiveGroup] = useState7(currentGroup);
|
|
4095
4087
|
const [customLocked, setCustomLocked] = useState7(false);
|
|
4096
4088
|
useEffect5(() => {
|
|
@@ -4158,7 +4150,7 @@ var getGroupControlValue = (order) => {
|
|
|
4158
4150
|
|
|
4159
4151
|
// src/components/style-sections/layout-section/flex-size-field.tsx
|
|
4160
4152
|
import * as React51 from "react";
|
|
4161
|
-
import { useEffect as useEffect6, useMemo as
|
|
4153
|
+
import { useEffect as useEffect6, useMemo as useMemo10, useRef as useRef7, useState as useState8 } from "react";
|
|
4162
4154
|
import {
|
|
4163
4155
|
ControlToggleButtonGroup as ControlToggleButtonGroup2,
|
|
4164
4156
|
NumberControl as NumberControl3,
|
|
@@ -4201,7 +4193,7 @@ var FlexSizeFieldContent = () => {
|
|
|
4201
4193
|
});
|
|
4202
4194
|
const { placeholder } = useBoundProp3();
|
|
4203
4195
|
const flexValues = extractFlexValues(value);
|
|
4204
|
-
const currentGroup =
|
|
4196
|
+
const currentGroup = useMemo10(() => getActiveGroup(flexValues), [flexValues]);
|
|
4205
4197
|
const [activeGroup, setActiveGroup] = useState8(currentGroup);
|
|
4206
4198
|
const [customLocked, setCustomLocked] = useState8(false);
|
|
4207
4199
|
useEffect6(() => {
|
|
@@ -4732,7 +4724,6 @@ var LayoutSection = () => {
|
|
|
4732
4724
|
history: { propDisplayName: DISPLAY_LABEL2 }
|
|
4733
4725
|
});
|
|
4734
4726
|
const displayPlaceholder = useDisplayPlaceholderValue();
|
|
4735
|
-
const isGridExperimentActive = isExperimentActive2("e_css_grid");
|
|
4736
4727
|
const isDisplayFlex = shouldDisplayFlexFields(display, displayPlaceholder);
|
|
4737
4728
|
const isDisplayGrid = "grid" === (display?.value ?? displayPlaceholder?.value);
|
|
4738
4729
|
const { element } = useElement();
|
|
@@ -4747,7 +4738,7 @@ var LayoutSection = () => {
|
|
|
4747
4738
|
}
|
|
4748
4739
|
return DEFAULT_PARENT_FLOW_DIRECTION;
|
|
4749
4740
|
};
|
|
4750
|
-
return /* @__PURE__ */ React61.createElement(SectionContent, null, /* @__PURE__ */ React61.createElement(DisplayField, null), isDisplayFlex && /* @__PURE__ */ React61.createElement(FlexFields, null), "flex" === parentStyle?.display && /* @__PURE__ */ React61.createElement(FlexChildFields, { parentStyleDirection: getParentStyleDirection() }),
|
|
4741
|
+
return /* @__PURE__ */ React61.createElement(SectionContent, null, /* @__PURE__ */ React61.createElement(DisplayField, null), isDisplayFlex && /* @__PURE__ */ React61.createElement(FlexFields, null), "flex" === parentStyle?.display && /* @__PURE__ */ React61.createElement(FlexChildFields, { parentStyleDirection: getParentStyleDirection() }), isDisplayGrid && /* @__PURE__ */ React61.createElement(GridFields, null), "grid" === parentStyle?.display && /* @__PURE__ */ React61.createElement(GridChildFields, { parentStyleDirection: getParentStyleDirection() }));
|
|
4751
4742
|
};
|
|
4752
4743
|
var FlexFields = () => {
|
|
4753
4744
|
const { value: flexWrap } = useStylesField("flex-wrap", {
|
|
@@ -5645,7 +5636,7 @@ var PanelTabContent = () => {
|
|
|
5645
5636
|
const { element } = useElement();
|
|
5646
5637
|
const editorDefaults = useDefaultPanelSettings();
|
|
5647
5638
|
const defaultComponentTab = editorDefaults.defaultTab;
|
|
5648
|
-
const isInteractionsActive =
|
|
5639
|
+
const isInteractionsActive = isExperimentActive("e_interactions");
|
|
5649
5640
|
const isPromotedElement = !!getWidgetsCache2()?.[element.type]?.meta?.is_pro_promotion;
|
|
5650
5641
|
const [storedTab, setCurrentTab] = useStateByElement("tab", defaultComponentTab);
|
|
5651
5642
|
const currentTab = isPromotedElement && storedTab === "settings" ? "style" : storedTab;
|
|
@@ -6180,10 +6171,10 @@ import {
|
|
|
6180
6171
|
import { DatabaseIcon } from "@elementor/icons";
|
|
6181
6172
|
|
|
6182
6173
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
6183
|
-
import { useMemo as
|
|
6174
|
+
import { useMemo as useMemo12 } from "react";
|
|
6184
6175
|
|
|
6185
6176
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
6186
|
-
import { useMemo as
|
|
6177
|
+
import { useMemo as useMemo11 } from "react";
|
|
6187
6178
|
import { useBoundProp as useBoundProp7 } from "@elementor/editor-controls";
|
|
6188
6179
|
|
|
6189
6180
|
// src/dynamics/sync/get-atomic-dynamic-tags.ts
|
|
@@ -6277,7 +6268,7 @@ var usePropDynamicTagsInternal = (filterByLicense2) => {
|
|
|
6277
6268
|
categories = propDynamicType?.settings.categories || [];
|
|
6278
6269
|
}
|
|
6279
6270
|
const categoriesKey = categories.join();
|
|
6280
|
-
return
|
|
6271
|
+
return useMemo11(
|
|
6281
6272
|
() => getDynamicTagsByCategories(categories, filterByLicense2),
|
|
6282
6273
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6283
6274
|
[categoriesKey, filterByLicense2]
|
|
@@ -6311,7 +6302,7 @@ var getDynamicTagsByCategories = (categories, filterByLicense2) => {
|
|
|
6311
6302
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
6312
6303
|
var useDynamicTag = (tagName) => {
|
|
6313
6304
|
const dynamicTags = useAllPropDynamicTags();
|
|
6314
|
-
return
|
|
6305
|
+
return useMemo12(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
6315
6306
|
};
|
|
6316
6307
|
|
|
6317
6308
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
@@ -6373,7 +6364,7 @@ import { PropKeyProvider as PropKeyProvider5, PropProvider as PropProvider5, use
|
|
|
6373
6364
|
|
|
6374
6365
|
// src/dynamics/components/dynamic-conditional-control.tsx
|
|
6375
6366
|
import * as React95 from "react";
|
|
6376
|
-
import { useMemo as
|
|
6367
|
+
import { useMemo as useMemo13 } from "react";
|
|
6377
6368
|
import { isDependencyMet as isDependencyMet3 } from "@elementor/editor-props";
|
|
6378
6369
|
var DynamicConditionalControl = ({
|
|
6379
6370
|
children,
|
|
@@ -6381,7 +6372,7 @@ var DynamicConditionalControl = ({
|
|
|
6381
6372
|
propsSchema,
|
|
6382
6373
|
dynamicSettings
|
|
6383
6374
|
}) => {
|
|
6384
|
-
const defaults =
|
|
6375
|
+
const defaults = useMemo13(() => {
|
|
6385
6376
|
if (!propsSchema) {
|
|
6386
6377
|
return {};
|
|
6387
6378
|
}
|
|
@@ -6391,7 +6382,7 @@ var DynamicConditionalControl = ({
|
|
|
6391
6382
|
return result;
|
|
6392
6383
|
}, {});
|
|
6393
6384
|
}, [propsSchema]);
|
|
6394
|
-
const convertedSettings =
|
|
6385
|
+
const convertedSettings = useMemo13(() => {
|
|
6395
6386
|
if (!dynamicSettings) {
|
|
6396
6387
|
return {};
|
|
6397
6388
|
}
|
|
@@ -6410,7 +6401,7 @@ var DynamicConditionalControl = ({
|
|
|
6410
6401
|
{}
|
|
6411
6402
|
);
|
|
6412
6403
|
}, [dynamicSettings]);
|
|
6413
|
-
const effectiveSettings =
|
|
6404
|
+
const effectiveSettings = useMemo13(() => {
|
|
6414
6405
|
return { ...defaults, ...convertedSettings };
|
|
6415
6406
|
}, [defaults, convertedSettings]);
|
|
6416
6407
|
if (!propType?.dependencies?.terms.length) {
|
|
@@ -6804,11 +6795,12 @@ var DynamicTagsManagerNotFoundError = createError2({
|
|
|
6804
6795
|
});
|
|
6805
6796
|
|
|
6806
6797
|
// src/dynamics/dynamic-transformer.ts
|
|
6807
|
-
var dynamicTransformer = createTransformer((value, { propType }) => {
|
|
6798
|
+
var dynamicTransformer = createTransformer((value, { propType, renderContext }) => {
|
|
6808
6799
|
if (!value?.name || !isDynamicTagSupported(value.name)) {
|
|
6809
6800
|
return propType?.default ?? null;
|
|
6810
6801
|
}
|
|
6811
|
-
|
|
6802
|
+
const renderPostId = renderContext?.currentPostId;
|
|
6803
|
+
return getDynamicValue(value.name, simpleTransform(value?.settings ?? {}), renderPostId);
|
|
6812
6804
|
});
|
|
6813
6805
|
function simpleTransform(props) {
|
|
6814
6806
|
const transformed = Object.entries(props).map(([settingKey, settingValue]) => {
|
|
@@ -6817,7 +6809,7 @@ function simpleTransform(props) {
|
|
|
6817
6809
|
});
|
|
6818
6810
|
return Object.fromEntries(transformed);
|
|
6819
6811
|
}
|
|
6820
|
-
function getDynamicValue(name, settings) {
|
|
6812
|
+
function getDynamicValue(name, settings, renderPostId) {
|
|
6821
6813
|
const { dynamicTags } = window.elementor ?? {};
|
|
6822
6814
|
if (!dynamicTags) {
|
|
6823
6815
|
throw new DynamicTagsManagerNotFoundError();
|
|
@@ -6827,6 +6819,9 @@ function getDynamicValue(name, settings) {
|
|
|
6827
6819
|
if (!tag) {
|
|
6828
6820
|
return null;
|
|
6829
6821
|
}
|
|
6822
|
+
if (renderPostId) {
|
|
6823
|
+
tag.editorRenderPostId = renderPostId;
|
|
6824
|
+
}
|
|
6830
6825
|
return dynamicTags.loadTagDataFromCache(tag) ?? null;
|
|
6831
6826
|
};
|
|
6832
6827
|
const tagValue = getTagValue();
|
|
@@ -6834,12 +6829,9 @@ function getDynamicValue(name, settings) {
|
|
|
6834
6829
|
return tagValue;
|
|
6835
6830
|
}
|
|
6836
6831
|
return new Promise((resolve) => {
|
|
6837
|
-
dynamicTags.refreshCacheFromServer(
|
|
6838
|
-
()
|
|
6839
|
-
|
|
6840
|
-
},
|
|
6841
|
-
{ disableCache: true }
|
|
6842
|
-
);
|
|
6832
|
+
dynamicTags.refreshCacheFromServer(() => {
|
|
6833
|
+
resolve(getTagValue());
|
|
6834
|
+
});
|
|
6843
6835
|
});
|
|
6844
6836
|
}
|
|
6845
6837
|
|
|
@@ -6981,7 +6973,7 @@ import { __ as __75 } from "@wordpress/i18n";
|
|
|
6981
6973
|
|
|
6982
6974
|
// src/styles-inheritance/components/styles-inheritance-infotip.tsx
|
|
6983
6975
|
import * as React104 from "react";
|
|
6984
|
-
import { useMemo as
|
|
6976
|
+
import { useMemo as useMemo14, useRef as useRef20, useState as useState12 } from "react";
|
|
6985
6977
|
import {
|
|
6986
6978
|
createPropsResolver as createPropsResolver2,
|
|
6987
6979
|
stylesInheritanceTransformersRegistry
|
|
@@ -7202,7 +7194,7 @@ var StylesInheritanceInfotip = ({
|
|
|
7202
7194
|
};
|
|
7203
7195
|
const key = path.join(".");
|
|
7204
7196
|
const sectionWidth = useSectionWidth2();
|
|
7205
|
-
const resolve =
|
|
7197
|
+
const resolve = useMemo14(() => {
|
|
7206
7198
|
return createPropsResolver2({
|
|
7207
7199
|
transformers: stylesInheritanceTransformersRegistry,
|
|
7208
7200
|
schema: { [key]: propType }
|