@elementor/editor-editing-panel 4.1.0-717 → 4.1.0-718
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 +83 -59
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +67 -43
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -21
- package/src/components/style-sections/position-section/position-section.tsx +58 -21
package/dist/index.js
CHANGED
|
@@ -1773,7 +1773,7 @@ function EditorPanelErrorFallback() {
|
|
|
1773
1773
|
}
|
|
1774
1774
|
|
|
1775
1775
|
// src/components/editing-panel-tabs.tsx
|
|
1776
|
-
var
|
|
1776
|
+
var import_react34 = require("react");
|
|
1777
1777
|
var React80 = __toESM(require("react"));
|
|
1778
1778
|
var import_editor_v1_adapters7 = require("@elementor/editor-v1-adapters");
|
|
1779
1779
|
var import_ui35 = require("@elementor/ui");
|
|
@@ -2405,7 +2405,7 @@ function isControl(control) {
|
|
|
2405
2405
|
|
|
2406
2406
|
// src/components/style-tab.tsx
|
|
2407
2407
|
var React79 = __toESM(require("react"));
|
|
2408
|
-
var
|
|
2408
|
+
var import_react33 = require("react");
|
|
2409
2409
|
var import_editor_props15 = require("@elementor/editor-props");
|
|
2410
2410
|
var import_editor_responsive3 = require("@elementor/editor-responsive");
|
|
2411
2411
|
var import_locations3 = require("@elementor/locations");
|
|
@@ -3860,6 +3860,7 @@ var shouldDisplayFlexFields = (display, local) => {
|
|
|
3860
3860
|
|
|
3861
3861
|
// src/components/style-sections/position-section/position-section.tsx
|
|
3862
3862
|
var React54 = __toESM(require("react"));
|
|
3863
|
+
var import_react26 = require("react");
|
|
3863
3864
|
var import_session6 = require("@elementor/session");
|
|
3864
3865
|
var import_i18n32 = require("@wordpress/i18n");
|
|
3865
3866
|
|
|
@@ -3951,42 +3952,65 @@ var ZIndexField = () => {
|
|
|
3951
3952
|
};
|
|
3952
3953
|
|
|
3953
3954
|
// src/components/style-sections/position-section/position-section.tsx
|
|
3955
|
+
var POSITION_STATIC = "static";
|
|
3954
3956
|
var POSITION_LABEL2 = (0, import_i18n32.__)("Position", "elementor");
|
|
3955
3957
|
var DIMENSIONS_LABEL = (0, import_i18n32.__)("Dimensions", "elementor");
|
|
3958
|
+
var POSITION_DEPENDENT_PROP_NAMES = [
|
|
3959
|
+
"inset-block-start",
|
|
3960
|
+
"inset-block-end",
|
|
3961
|
+
"inset-inline-start",
|
|
3962
|
+
"inset-inline-end",
|
|
3963
|
+
"z-index"
|
|
3964
|
+
];
|
|
3965
|
+
var CLEARED_POSITION_DEPENDENT_VALUES = {
|
|
3966
|
+
"inset-block-start": void 0,
|
|
3967
|
+
"inset-block-end": void 0,
|
|
3968
|
+
"inset-inline-start": void 0,
|
|
3969
|
+
"inset-inline-end": void 0,
|
|
3970
|
+
"z-index": void 0
|
|
3971
|
+
};
|
|
3956
3972
|
var PositionSection = () => {
|
|
3957
3973
|
const { value: positionValue } = useStylesField("position", {
|
|
3958
3974
|
history: { propDisplayName: POSITION_LABEL2 }
|
|
3959
3975
|
});
|
|
3960
|
-
const { values:
|
|
3961
|
-
"inset-block-start",
|
|
3962
|
-
"inset-block-end",
|
|
3963
|
-
"inset-inline-start",
|
|
3964
|
-
"inset-inline-end"
|
|
3965
|
-
]);
|
|
3976
|
+
const { values: positionDependentValues, setValues: setPositionDependentValues } = useStylesFields([...POSITION_DEPENDENT_PROP_NAMES]);
|
|
3966
3977
|
const [dimensionsValuesFromHistory, updateDimensionsHistory, clearDimensionsHistory] = usePersistDimensions();
|
|
3978
|
+
const clearPositionDependentProps = (0, import_react26.useCallback)(() => {
|
|
3979
|
+
const dimensions = {
|
|
3980
|
+
"inset-block-start": positionDependentValues?.["inset-block-start"],
|
|
3981
|
+
"inset-block-end": positionDependentValues?.["inset-block-end"],
|
|
3982
|
+
"inset-inline-start": positionDependentValues?.["inset-inline-start"],
|
|
3983
|
+
"inset-inline-end": positionDependentValues?.["inset-inline-end"]
|
|
3984
|
+
};
|
|
3985
|
+
const meta = { history: { propDisplayName: DIMENSIONS_LABEL } };
|
|
3986
|
+
const hasValuesToClear = Object.values(dimensions).some((v) => v !== null) || positionDependentValues?.["z-index"] !== null;
|
|
3987
|
+
if (hasValuesToClear) {
|
|
3988
|
+
updateDimensionsHistory(dimensions);
|
|
3989
|
+
setPositionDependentValues(CLEARED_POSITION_DEPENDENT_VALUES, meta);
|
|
3990
|
+
}
|
|
3991
|
+
}, [positionDependentValues, updateDimensionsHistory, setPositionDependentValues]);
|
|
3992
|
+
const clearPositionDependentPropsRef = (0, import_react26.useRef)(clearPositionDependentProps);
|
|
3993
|
+
clearPositionDependentPropsRef.current = clearPositionDependentProps;
|
|
3994
|
+
(0, import_react26.useEffect)(() => {
|
|
3995
|
+
if (positionValue?.value === POSITION_STATIC || positionValue === null) {
|
|
3996
|
+
clearPositionDependentPropsRef.current();
|
|
3997
|
+
}
|
|
3998
|
+
}, [positionValue]);
|
|
3967
3999
|
const onPositionChange = (newPosition, previousPosition) => {
|
|
3968
4000
|
const meta = { history: { propDisplayName: DIMENSIONS_LABEL } };
|
|
3969
|
-
if (newPosition ===
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
"inset-block-end": void 0,
|
|
3976
|
-
"inset-inline-start": void 0,
|
|
3977
|
-
"inset-inline-end": void 0
|
|
3978
|
-
},
|
|
4001
|
+
if (newPosition === POSITION_STATIC) {
|
|
4002
|
+
clearPositionDependentProps();
|
|
4003
|
+
} else if (previousPosition === POSITION_STATIC) {
|
|
4004
|
+
if (dimensionsValuesFromHistory) {
|
|
4005
|
+
setPositionDependentValues(
|
|
4006
|
+
{ ...dimensionsValuesFromHistory, "z-index": void 0 },
|
|
3979
4007
|
meta
|
|
3980
4008
|
);
|
|
3981
|
-
}
|
|
3982
|
-
} else if (previousPosition === "static") {
|
|
3983
|
-
if (dimensionsValuesFromHistory) {
|
|
3984
|
-
setDimensions(dimensionsValuesFromHistory, meta);
|
|
3985
4009
|
clearDimensionsHistory();
|
|
3986
4010
|
}
|
|
3987
4011
|
}
|
|
3988
4012
|
};
|
|
3989
|
-
const isNotStatic = positionValue && positionValue?.value !==
|
|
4013
|
+
const isNotStatic = positionValue && positionValue?.value !== POSITION_STATIC;
|
|
3990
4014
|
return /* @__PURE__ */ React54.createElement(SectionContent, null, /* @__PURE__ */ React54.createElement(PositionField, { onChange: onPositionChange }), isNotStatic ? /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(DimensionsField, null), /* @__PURE__ */ React54.createElement(ZIndexField, null)) : null, /* @__PURE__ */ React54.createElement(PanelDivider, null), /* @__PURE__ */ React54.createElement(OffsetField, null));
|
|
3991
4015
|
};
|
|
3992
4016
|
var usePersistDimensions = () => {
|
|
@@ -3998,7 +4022,7 @@ var usePersistDimensions = () => {
|
|
|
3998
4022
|
|
|
3999
4023
|
// src/components/style-sections/size-section/size-section.tsx
|
|
4000
4024
|
var React59 = __toESM(require("react"));
|
|
4001
|
-
var
|
|
4025
|
+
var import_react27 = require("react");
|
|
4002
4026
|
var import_editor_controls32 = require("@elementor/editor-controls");
|
|
4003
4027
|
var import_ui31 = require("@elementor/ui");
|
|
4004
4028
|
var import_i18n36 = require("@wordpress/i18n");
|
|
@@ -4165,7 +4189,7 @@ var CssSizeProps = [
|
|
|
4165
4189
|
];
|
|
4166
4190
|
var ASPECT_RATIO_LABEL = (0, import_i18n36.__)("Aspect Ratio", "elementor");
|
|
4167
4191
|
var SizeSection = () => {
|
|
4168
|
-
const gridRowRefs = [(0,
|
|
4192
|
+
const gridRowRefs = [(0, import_react27.useRef)(null), (0, import_react27.useRef)(null), (0, import_react27.useRef)(null)];
|
|
4169
4193
|
return /* @__PURE__ */ React59.createElement(SectionContent, null, CssSizeProps.map((row, rowIndex) => /* @__PURE__ */ React59.createElement(import_ui31.Grid, { key: rowIndex, container: true, gap: 2, flexWrap: "nowrap", ref: gridRowRefs[rowIndex] }, row.map((props) => /* @__PURE__ */ React59.createElement(import_ui31.Grid, { item: true, xs: 6, key: props.bind }, /* @__PURE__ */ React59.createElement(SizeField, { ...props, rowRef: gridRowRefs[rowIndex], extendedOptions: ["auto"] }))))), /* @__PURE__ */ React59.createElement(PanelDivider, null), /* @__PURE__ */ React59.createElement(import_ui31.Stack, null, /* @__PURE__ */ React59.createElement(OverflowField, null)), /* @__PURE__ */ React59.createElement(StyleTabCollapsibleContent, { fields: ["aspect-ratio", "object-fit"] }, /* @__PURE__ */ React59.createElement(import_ui31.Stack, { gap: 2, pt: 2 }, /* @__PURE__ */ React59.createElement(StylesField, { bind: "aspect-ratio", propDisplayName: ASPECT_RATIO_LABEL }, /* @__PURE__ */ React59.createElement(import_editor_controls32.AspectRatioControl, { label: ASPECT_RATIO_LABEL })), /* @__PURE__ */ React59.createElement(PanelDivider, null), /* @__PURE__ */ React59.createElement(ObjectFitField, null), /* @__PURE__ */ React59.createElement(StylesField, { bind: "object-position", propDisplayName: (0, import_i18n36.__)("Object position", "elementor") }, /* @__PURE__ */ React59.createElement(import_ui31.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React59.createElement(import_editor_controls32.PositionControl, null))))));
|
|
4170
4194
|
};
|
|
4171
4195
|
var SizeField = ({ label, bind, rowRef, extendedOptions }) => {
|
|
@@ -4205,12 +4229,12 @@ var ColumnCountField = () => {
|
|
|
4205
4229
|
|
|
4206
4230
|
// src/components/style-sections/typography-section/column-gap-field.tsx
|
|
4207
4231
|
var React62 = __toESM(require("react"));
|
|
4208
|
-
var
|
|
4232
|
+
var import_react28 = require("react");
|
|
4209
4233
|
var import_editor_controls35 = require("@elementor/editor-controls");
|
|
4210
4234
|
var import_i18n39 = require("@wordpress/i18n");
|
|
4211
4235
|
var COLUMN_GAP_LABEL = (0, import_i18n39.__)("Column gap", "elementor");
|
|
4212
4236
|
var ColumnGapField = () => {
|
|
4213
|
-
const rowRef = (0,
|
|
4237
|
+
const rowRef = (0, import_react28.useRef)(null);
|
|
4214
4238
|
return /* @__PURE__ */ React62.createElement(StylesField, { bind: "column-gap", propDisplayName: COLUMN_GAP_LABEL }, /* @__PURE__ */ React62.createElement(StylesFieldLayout, { label: COLUMN_GAP_LABEL, ref: rowRef }, /* @__PURE__ */ React62.createElement(import_editor_controls35.SizeControl, { anchorRef: rowRef })));
|
|
4215
4239
|
};
|
|
4216
4240
|
|
|
@@ -4238,12 +4262,12 @@ var FontFamilyField = () => {
|
|
|
4238
4262
|
|
|
4239
4263
|
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
4240
4264
|
var React64 = __toESM(require("react"));
|
|
4241
|
-
var
|
|
4265
|
+
var import_react29 = require("react");
|
|
4242
4266
|
var import_editor_controls37 = require("@elementor/editor-controls");
|
|
4243
4267
|
var import_i18n41 = require("@wordpress/i18n");
|
|
4244
4268
|
var FONT_SIZE_LABEL = (0, import_i18n41.__)("Font size", "elementor");
|
|
4245
4269
|
var FontSizeField = () => {
|
|
4246
|
-
const rowRef = (0,
|
|
4270
|
+
const rowRef = (0, import_react29.useRef)(null);
|
|
4247
4271
|
return /* @__PURE__ */ React64.createElement(StylesField, { bind: "font-size", propDisplayName: FONT_SIZE_LABEL }, /* @__PURE__ */ React64.createElement(StylesFieldLayout, { label: FONT_SIZE_LABEL, ref: rowRef }, /* @__PURE__ */ React64.createElement(import_editor_controls37.SizeControl, { anchorRef: rowRef, ariaLabel: FONT_SIZE_LABEL })));
|
|
4248
4272
|
};
|
|
4249
4273
|
|
|
@@ -4293,23 +4317,23 @@ var FontWeightField = () => {
|
|
|
4293
4317
|
|
|
4294
4318
|
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
4295
4319
|
var React67 = __toESM(require("react"));
|
|
4296
|
-
var
|
|
4320
|
+
var import_react30 = require("react");
|
|
4297
4321
|
var import_editor_controls40 = require("@elementor/editor-controls");
|
|
4298
4322
|
var import_i18n44 = require("@wordpress/i18n");
|
|
4299
4323
|
var LETTER_SPACING_LABEL = (0, import_i18n44.__)("Letter spacing", "elementor");
|
|
4300
4324
|
var LetterSpacingField = () => {
|
|
4301
|
-
const rowRef = (0,
|
|
4325
|
+
const rowRef = (0, import_react30.useRef)(null);
|
|
4302
4326
|
return /* @__PURE__ */ React67.createElement(StylesField, { bind: "letter-spacing", propDisplayName: LETTER_SPACING_LABEL }, /* @__PURE__ */ React67.createElement(StylesFieldLayout, { label: LETTER_SPACING_LABEL, ref: rowRef }, /* @__PURE__ */ React67.createElement(import_editor_controls40.SizeControl, { anchorRef: rowRef, min: -Number.MAX_SAFE_INTEGER })));
|
|
4303
4327
|
};
|
|
4304
4328
|
|
|
4305
4329
|
// src/components/style-sections/typography-section/line-height-field.tsx
|
|
4306
4330
|
var React68 = __toESM(require("react"));
|
|
4307
|
-
var
|
|
4331
|
+
var import_react31 = require("react");
|
|
4308
4332
|
var import_editor_controls41 = require("@elementor/editor-controls");
|
|
4309
4333
|
var import_i18n45 = require("@wordpress/i18n");
|
|
4310
4334
|
var LINE_HEIGHT_LABEL = (0, import_i18n45.__)("Line height", "elementor");
|
|
4311
4335
|
var LineHeightField = () => {
|
|
4312
|
-
const rowRef = (0,
|
|
4336
|
+
const rowRef = (0, import_react31.useRef)(null);
|
|
4313
4337
|
return /* @__PURE__ */ React68.createElement(StylesField, { bind: "line-height", propDisplayName: LINE_HEIGHT_LABEL }, /* @__PURE__ */ React68.createElement(StylesFieldLayout, { label: LINE_HEIGHT_LABEL, ref: rowRef }, /* @__PURE__ */ React68.createElement(import_editor_controls41.SizeControl, { anchorRef: rowRef })));
|
|
4314
4338
|
};
|
|
4315
4339
|
|
|
@@ -4531,12 +4555,12 @@ var TransformField = () => /* @__PURE__ */ React75.createElement(StylesField, {
|
|
|
4531
4555
|
|
|
4532
4556
|
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
4533
4557
|
var React76 = __toESM(require("react"));
|
|
4534
|
-
var
|
|
4558
|
+
var import_react32 = require("react");
|
|
4535
4559
|
var import_editor_controls48 = require("@elementor/editor-controls");
|
|
4536
4560
|
var import_i18n52 = require("@wordpress/i18n");
|
|
4537
4561
|
var WORD_SPACING_LABEL = (0, import_i18n52.__)("Word spacing", "elementor");
|
|
4538
4562
|
var WordSpacingField = () => {
|
|
4539
|
-
const rowRef = (0,
|
|
4563
|
+
const rowRef = (0, import_react32.useRef)(null);
|
|
4540
4564
|
return /* @__PURE__ */ React76.createElement(StylesField, { bind: "word-spacing", propDisplayName: WORD_SPACING_LABEL }, /* @__PURE__ */ React76.createElement(StylesFieldLayout, { label: WORD_SPACING_LABEL, ref: rowRef }, /* @__PURE__ */ React76.createElement(import_editor_controls48.SizeControl, { anchorRef: rowRef, min: -Number.MAX_SAFE_INTEGER })));
|
|
4541
4565
|
};
|
|
4542
4566
|
|
|
@@ -4594,7 +4618,7 @@ var stickyHeaderStyles = {
|
|
|
4594
4618
|
var StyleTab = () => {
|
|
4595
4619
|
const currentClassesProp = useCurrentClassesProp();
|
|
4596
4620
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp ?? "");
|
|
4597
|
-
const [activeStyleState, setActiveStyleState] = (0,
|
|
4621
|
+
const [activeStyleState, setActiveStyleState] = (0, import_react33.useState)(null);
|
|
4598
4622
|
const breakpoint = (0, import_editor_responsive3.useActiveBreakpoint)();
|
|
4599
4623
|
if (!currentClassesProp) {
|
|
4600
4624
|
return null;
|
|
@@ -4757,7 +4781,7 @@ var EditingPanelTabs = () => {
|
|
|
4757
4781
|
return (
|
|
4758
4782
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
4759
4783
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
4760
|
-
/* @__PURE__ */ React80.createElement(
|
|
4784
|
+
/* @__PURE__ */ React80.createElement(import_react34.Fragment, { key: element.id }, /* @__PURE__ */ React80.createElement(PanelTabContent, null))
|
|
4761
4785
|
);
|
|
4762
4786
|
};
|
|
4763
4787
|
var PanelTabContent = () => {
|
|
@@ -4809,7 +4833,7 @@ var import_editor_panels3 = require("@elementor/editor-panels");
|
|
|
4809
4833
|
var import_editor_v1_adapters11 = require("@elementor/editor-v1-adapters");
|
|
4810
4834
|
|
|
4811
4835
|
// src/hooks/use-open-editor-panel.ts
|
|
4812
|
-
var
|
|
4836
|
+
var import_react35 = require("react");
|
|
4813
4837
|
var import_editor_v1_adapters8 = require("@elementor/editor-v1-adapters");
|
|
4814
4838
|
|
|
4815
4839
|
// src/panel.ts
|
|
@@ -4833,7 +4857,7 @@ var isAtomicWidgetSelected = () => {
|
|
|
4833
4857
|
// src/hooks/use-open-editor-panel.ts
|
|
4834
4858
|
var useOpenEditorPanel = () => {
|
|
4835
4859
|
const { open } = usePanelActions();
|
|
4836
|
-
(0,
|
|
4860
|
+
(0, import_react35.useEffect)(() => {
|
|
4837
4861
|
return (0, import_editor_v1_adapters8.__privateListenTo)((0, import_editor_v1_adapters8.commandStartEvent)("panel/editor/open"), () => {
|
|
4838
4862
|
if (isAtomicWidgetSelected()) {
|
|
4839
4863
|
open();
|
|
@@ -4853,12 +4877,12 @@ var import_editor_controls51 = require("@elementor/editor-controls");
|
|
|
4853
4877
|
|
|
4854
4878
|
// src/components/promotions/custom-css.tsx
|
|
4855
4879
|
var React82 = __toESM(require("react"));
|
|
4856
|
-
var
|
|
4880
|
+
var import_react36 = require("react");
|
|
4857
4881
|
var import_editor_controls50 = require("@elementor/editor-controls");
|
|
4858
4882
|
var import_i18n56 = require("@wordpress/i18n");
|
|
4859
4883
|
var TRACKING_DATA = { target_name: "custom_css", location_l2: "style" };
|
|
4860
4884
|
var CustomCssSection = () => {
|
|
4861
|
-
const triggerRef = (0,
|
|
4885
|
+
const triggerRef = (0, import_react36.useRef)(null);
|
|
4862
4886
|
return /* @__PURE__ */ React82.createElement(
|
|
4863
4887
|
StyleTabSection,
|
|
4864
4888
|
{
|
|
@@ -5276,17 +5300,17 @@ var import_editor_props19 = require("@elementor/editor-props");
|
|
|
5276
5300
|
var import_icons23 = require("@elementor/icons");
|
|
5277
5301
|
|
|
5278
5302
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
5279
|
-
var
|
|
5303
|
+
var import_react39 = require("react");
|
|
5280
5304
|
|
|
5281
5305
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
5282
|
-
var
|
|
5306
|
+
var import_react38 = require("react");
|
|
5283
5307
|
var import_editor_controls54 = require("@elementor/editor-controls");
|
|
5284
5308
|
|
|
5285
5309
|
// src/dynamics/sync/get-atomic-dynamic-tags.ts
|
|
5286
5310
|
var import_editor_v1_adapters9 = require("@elementor/editor-v1-adapters");
|
|
5287
5311
|
|
|
5288
5312
|
// src/hooks/use-license-config.ts
|
|
5289
|
-
var
|
|
5313
|
+
var import_react37 = require("react");
|
|
5290
5314
|
var config = { expired: false };
|
|
5291
5315
|
var listeners = /* @__PURE__ */ new Set();
|
|
5292
5316
|
function setLicenseConfig(newConfig) {
|
|
@@ -5301,7 +5325,7 @@ function subscribe(listener) {
|
|
|
5301
5325
|
return () => listeners.delete(listener);
|
|
5302
5326
|
}
|
|
5303
5327
|
function useLicenseConfig() {
|
|
5304
|
-
return (0,
|
|
5328
|
+
return (0, import_react37.useSyncExternalStore)(subscribe, getLicenseConfig, getLicenseConfig);
|
|
5305
5329
|
}
|
|
5306
5330
|
|
|
5307
5331
|
// src/dynamics/sync/get-atomic-dynamic-tags.ts
|
|
@@ -5370,7 +5394,7 @@ var usePropDynamicTagsInternal = (filterByLicense2) => {
|
|
|
5370
5394
|
categories = propDynamicType?.settings.categories || [];
|
|
5371
5395
|
}
|
|
5372
5396
|
const categoriesKey = categories.join();
|
|
5373
|
-
return (0,
|
|
5397
|
+
return (0, import_react38.useMemo)(
|
|
5374
5398
|
() => getDynamicTagsByCategories(categories, filterByLicense2),
|
|
5375
5399
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5376
5400
|
[categoriesKey, filterByLicense2]
|
|
@@ -5404,7 +5428,7 @@ var getDynamicTagsByCategories = (categories, filterByLicense2) => {
|
|
|
5404
5428
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
5405
5429
|
var useDynamicTag = (tagName) => {
|
|
5406
5430
|
const dynamicTags = useAllPropDynamicTags();
|
|
5407
|
-
return (0,
|
|
5431
|
+
return (0, import_react39.useMemo)(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
5408
5432
|
};
|
|
5409
5433
|
|
|
5410
5434
|
// src/dynamics/components/background-control-dynamic-tag.tsx
|
|
@@ -5527,7 +5551,7 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
5527
5551
|
|
|
5528
5552
|
// src/dynamics/components/dynamic-selection.tsx
|
|
5529
5553
|
var React87 = __toESM(require("react"));
|
|
5530
|
-
var
|
|
5554
|
+
var import_react40 = require("react");
|
|
5531
5555
|
var import_editor_controls57 = require("@elementor/editor-controls");
|
|
5532
5556
|
var import_editor_ui8 = require("@elementor/editor-ui");
|
|
5533
5557
|
var import_icons24 = require("@elementor/icons");
|
|
@@ -5538,7 +5562,7 @@ var PROMO_TEXT_WIDTH = 170;
|
|
|
5538
5562
|
var PRO_DYNAMIC_TAGS_URL = "https://go.elementor.com/go-pro-dynamic-tags-modal/";
|
|
5539
5563
|
var RENEW_DYNAMIC_TAGS_URL = "https://go.elementor.com/go-pro-dynamic-tags-renew-modal/";
|
|
5540
5564
|
var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
5541
|
-
const [searchValue, setSearchValue] = (0,
|
|
5565
|
+
const [searchValue, setSearchValue] = (0, import_react40.useState)("");
|
|
5542
5566
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
5543
5567
|
const theme = (0, import_ui38.useTheme)();
|
|
5544
5568
|
const { value: anyValue } = (0, import_editor_controls57.useBoundProp)();
|
|
@@ -5547,7 +5571,7 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
|
5547
5571
|
const isCurrentValueDynamic = !!dynamicValue;
|
|
5548
5572
|
const options12 = useFilteredOptions(searchValue);
|
|
5549
5573
|
const hasNoDynamicTags = !options12.length && !searchValue.trim();
|
|
5550
|
-
(0,
|
|
5574
|
+
(0, import_react40.useEffect)(() => {
|
|
5551
5575
|
if (hasNoDynamicTags) {
|
|
5552
5576
|
(0, import_editor_controls57.trackViewPromotion)({ target_name: "dynamic_tags" });
|
|
5553
5577
|
} else if (expired) {
|
|
@@ -5584,7 +5608,7 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
|
5584
5608
|
if (expired) {
|
|
5585
5609
|
return /* @__PURE__ */ React87.createElement(ExpiredDynamicTags, null);
|
|
5586
5610
|
}
|
|
5587
|
-
return /* @__PURE__ */ React87.createElement(
|
|
5611
|
+
return /* @__PURE__ */ React87.createElement(import_react40.Fragment, null, /* @__PURE__ */ React87.createElement(
|
|
5588
5612
|
import_editor_ui8.SearchField,
|
|
5589
5613
|
{
|
|
5590
5614
|
value: searchValue,
|
|
@@ -6050,22 +6074,22 @@ var import_i18n66 = require("@wordpress/i18n");
|
|
|
6050
6074
|
|
|
6051
6075
|
// src/styles-inheritance/components/styles-inheritance-infotip.tsx
|
|
6052
6076
|
var React94 = __toESM(require("react"));
|
|
6053
|
-
var
|
|
6077
|
+
var import_react42 = require("react");
|
|
6054
6078
|
var import_editor_canvas5 = require("@elementor/editor-canvas");
|
|
6055
6079
|
var import_editor_ui10 = require("@elementor/editor-ui");
|
|
6056
6080
|
var import_ui44 = require("@elementor/ui");
|
|
6057
6081
|
var import_i18n65 = require("@wordpress/i18n");
|
|
6058
6082
|
|
|
6059
6083
|
// src/styles-inheritance/hooks/use-normalized-inheritance-chain-items.tsx
|
|
6060
|
-
var
|
|
6084
|
+
var import_react41 = require("react");
|
|
6061
6085
|
var import_editor_canvas4 = require("@elementor/editor-canvas");
|
|
6062
6086
|
var import_editor_styles8 = require("@elementor/editor-styles");
|
|
6063
6087
|
var import_editor_styles_repository14 = require("@elementor/editor-styles-repository");
|
|
6064
6088
|
var import_i18n63 = require("@wordpress/i18n");
|
|
6065
6089
|
var MAXIMUM_ITEMS = 2;
|
|
6066
6090
|
var useNormalizedInheritanceChainItems = (inheritanceChain, bind, resolve) => {
|
|
6067
|
-
const [items3, setItems] = (0,
|
|
6068
|
-
(0,
|
|
6091
|
+
const [items3, setItems] = (0, import_react41.useState)([]);
|
|
6092
|
+
(0, import_react41.useEffect)(() => {
|
|
6069
6093
|
(async () => {
|
|
6070
6094
|
const normalizedItems = await Promise.all(
|
|
6071
6095
|
inheritanceChain.filter(({ style }) => style).map((item, index) => normalizeInheritanceItem(item, index, bind, resolve))
|
|
@@ -6116,7 +6140,7 @@ var getTransformedValue = async (item, bind, resolve) => {
|
|
|
6116
6140
|
}
|
|
6117
6141
|
});
|
|
6118
6142
|
const value = result?.[bind] ?? result;
|
|
6119
|
-
if ((0,
|
|
6143
|
+
if ((0, import_react41.isValidElement)(value)) {
|
|
6120
6144
|
return value;
|
|
6121
6145
|
}
|
|
6122
6146
|
if (typeof value === "object") {
|
|
@@ -6237,8 +6261,8 @@ var StylesInheritanceInfotip = ({
|
|
|
6237
6261
|
children,
|
|
6238
6262
|
isDisabled
|
|
6239
6263
|
}) => {
|
|
6240
|
-
const [showInfotip, setShowInfotip] = (0,
|
|
6241
|
-
const triggerRef = (0,
|
|
6264
|
+
const [showInfotip, setShowInfotip] = (0, import_react42.useState)(false);
|
|
6265
|
+
const triggerRef = (0, import_react42.useRef)(null);
|
|
6242
6266
|
const toggleInfotip = () => {
|
|
6243
6267
|
if (isDisabled) {
|
|
6244
6268
|
return;
|
|
@@ -6253,7 +6277,7 @@ var StylesInheritanceInfotip = ({
|
|
|
6253
6277
|
};
|
|
6254
6278
|
const key = path.join(".");
|
|
6255
6279
|
const sectionWidth = (0, import_editor_ui10.useSectionWidth)();
|
|
6256
|
-
const resolve = (0,
|
|
6280
|
+
const resolve = (0, import_react42.useMemo)(() => {
|
|
6257
6281
|
return (0, import_editor_canvas5.createPropsResolver)({
|
|
6258
6282
|
transformers: import_editor_canvas5.stylesInheritanceTransformersRegistry,
|
|
6259
6283
|
schema: { [key]: propType }
|