@elementor/editor-editing-panel 4.0.0-manual → 4.0.0
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 +44 -40
- package/dist/index.d.ts +44 -40
- package/dist/index.js +153 -111
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +138 -97
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -21
- package/src/components/promotions/custom-css.tsx +5 -1
- package/src/components/style-sections/position-section/position-section.tsx +58 -21
- package/src/controls-registry/settings-field.tsx +7 -14
- package/src/dynamics/components/dynamic-selection.tsx +21 -4
- package/src/index.ts +1 -0
- package/src/styles-inheritance/components/infotip/value-component.tsx +20 -17
- package/src/styles-inheritance/components/styles-inheritance-infotip.tsx +8 -10
- package/src/styles-inheritance/init-styles-inheritance-transformers.ts +1 -1
- package/src/styles-inheritance/transformers/array-transformer.tsx +13 -5
- package/src/styles-inheritance/transformers/box-shadow-transformer.tsx +5 -7
- package/src/styles-inheritance/transformers/repeater-to-items-transformer.tsx +2 -16
- package/src/utils/prop-dependency-utils.ts +12 -0
package/dist/index.mjs
CHANGED
|
@@ -2083,6 +2083,15 @@ import {
|
|
|
2083
2083
|
isDependencyMet
|
|
2084
2084
|
} from "@elementor/editor-props";
|
|
2085
2085
|
import { getSessionStorageItem as getSessionStorageItem2, removeSessionStorageItem, setSessionStorageItem as setSessionStorageItem2 } from "@elementor/session";
|
|
2086
|
+
function getElementSettingsWithDefaults(propsSchema, elementSettings) {
|
|
2087
|
+
const elementSettingsWithDefaults = { ...elementSettings };
|
|
2088
|
+
Object.keys(propsSchema).forEach((key) => {
|
|
2089
|
+
if (elementSettingsWithDefaults[key] === null && propsSchema[key].default !== null) {
|
|
2090
|
+
elementSettingsWithDefaults[key] = propsSchema[key].default;
|
|
2091
|
+
}
|
|
2092
|
+
});
|
|
2093
|
+
return elementSettingsWithDefaults;
|
|
2094
|
+
}
|
|
2086
2095
|
function extractOrderedDependencies(dependenciesPerTargetMapping) {
|
|
2087
2096
|
return Object.values(dependenciesPerTargetMapping).flat().filter((dependent, index, self) => self.indexOf(dependent) === index);
|
|
2088
2097
|
}
|
|
@@ -2228,19 +2237,8 @@ var createTopLevelObjectType = ({ schema }) => {
|
|
|
2228
2237
|
|
|
2229
2238
|
// src/controls-registry/settings-field.tsx
|
|
2230
2239
|
var HISTORY_DEBOUNCE_WAIT2 = 800;
|
|
2231
|
-
var getElementSettigsWithDefaults = (propsSchema, elementSettings) => {
|
|
2232
|
-
const elementSettingsWithDefaults = { ...elementSettings };
|
|
2233
|
-
Object.keys(propsSchema).forEach((key) => {
|
|
2234
|
-
if (!(key in elementSettingsWithDefaults)) {
|
|
2235
|
-
if (propsSchema[key].default !== null) {
|
|
2236
|
-
elementSettingsWithDefaults[key] = propsSchema[key].default;
|
|
2237
|
-
}
|
|
2238
|
-
}
|
|
2239
|
-
});
|
|
2240
|
-
return elementSettingsWithDefaults;
|
|
2241
|
-
};
|
|
2242
2240
|
var extractDependencyEffect = (bind, propsSchema, currentElementSettings) => {
|
|
2243
|
-
const elementSettingsForDepCheck =
|
|
2241
|
+
const elementSettingsForDepCheck = getElementSettingsWithDefaults(propsSchema, currentElementSettings);
|
|
2244
2242
|
const propType = propsSchema[bind];
|
|
2245
2243
|
const depCheck = isDependencyMet2(propType?.dependencies, elementSettingsForDepCheck);
|
|
2246
2244
|
const isHidden = !depCheck.isMet && !isDependency(depCheck.failingDependencies[0]) && depCheck.failingDependencies[0]?.effect === "hide";
|
|
@@ -3878,6 +3876,7 @@ var shouldDisplayFlexFields = (display, local) => {
|
|
|
3878
3876
|
|
|
3879
3877
|
// src/components/style-sections/position-section/position-section.tsx
|
|
3880
3878
|
import * as React54 from "react";
|
|
3879
|
+
import { useCallback as useCallback2, useEffect as useEffect6, useRef as useRef9 } from "react";
|
|
3881
3880
|
import { useSessionStorage as useSessionStorage3 } from "@elementor/session";
|
|
3882
3881
|
import { __ as __32 } from "@wordpress/i18n";
|
|
3883
3882
|
|
|
@@ -3969,42 +3968,65 @@ var ZIndexField = () => {
|
|
|
3969
3968
|
};
|
|
3970
3969
|
|
|
3971
3970
|
// src/components/style-sections/position-section/position-section.tsx
|
|
3971
|
+
var POSITION_STATIC = "static";
|
|
3972
3972
|
var POSITION_LABEL2 = __32("Position", "elementor");
|
|
3973
3973
|
var DIMENSIONS_LABEL = __32("Dimensions", "elementor");
|
|
3974
|
+
var POSITION_DEPENDENT_PROP_NAMES = [
|
|
3975
|
+
"inset-block-start",
|
|
3976
|
+
"inset-block-end",
|
|
3977
|
+
"inset-inline-start",
|
|
3978
|
+
"inset-inline-end",
|
|
3979
|
+
"z-index"
|
|
3980
|
+
];
|
|
3981
|
+
var CLEARED_POSITION_DEPENDENT_VALUES = {
|
|
3982
|
+
"inset-block-start": void 0,
|
|
3983
|
+
"inset-block-end": void 0,
|
|
3984
|
+
"inset-inline-start": void 0,
|
|
3985
|
+
"inset-inline-end": void 0,
|
|
3986
|
+
"z-index": void 0
|
|
3987
|
+
};
|
|
3974
3988
|
var PositionSection = () => {
|
|
3975
3989
|
const { value: positionValue } = useStylesField("position", {
|
|
3976
3990
|
history: { propDisplayName: POSITION_LABEL2 }
|
|
3977
3991
|
});
|
|
3978
|
-
const { values:
|
|
3979
|
-
"inset-block-start",
|
|
3980
|
-
"inset-block-end",
|
|
3981
|
-
"inset-inline-start",
|
|
3982
|
-
"inset-inline-end"
|
|
3983
|
-
]);
|
|
3992
|
+
const { values: positionDependentValues, setValues: setPositionDependentValues } = useStylesFields([...POSITION_DEPENDENT_PROP_NAMES]);
|
|
3984
3993
|
const [dimensionsValuesFromHistory, updateDimensionsHistory, clearDimensionsHistory] = usePersistDimensions();
|
|
3994
|
+
const clearPositionDependentProps = useCallback2(() => {
|
|
3995
|
+
const dimensions = {
|
|
3996
|
+
"inset-block-start": positionDependentValues?.["inset-block-start"],
|
|
3997
|
+
"inset-block-end": positionDependentValues?.["inset-block-end"],
|
|
3998
|
+
"inset-inline-start": positionDependentValues?.["inset-inline-start"],
|
|
3999
|
+
"inset-inline-end": positionDependentValues?.["inset-inline-end"]
|
|
4000
|
+
};
|
|
4001
|
+
const meta = { history: { propDisplayName: DIMENSIONS_LABEL } };
|
|
4002
|
+
const hasValuesToClear = Object.values(dimensions).some((v) => v !== null) || positionDependentValues?.["z-index"] !== null;
|
|
4003
|
+
if (hasValuesToClear) {
|
|
4004
|
+
updateDimensionsHistory(dimensions);
|
|
4005
|
+
setPositionDependentValues(CLEARED_POSITION_DEPENDENT_VALUES, meta);
|
|
4006
|
+
}
|
|
4007
|
+
}, [positionDependentValues, updateDimensionsHistory, setPositionDependentValues]);
|
|
4008
|
+
const clearPositionDependentPropsRef = useRef9(clearPositionDependentProps);
|
|
4009
|
+
clearPositionDependentPropsRef.current = clearPositionDependentProps;
|
|
4010
|
+
useEffect6(() => {
|
|
4011
|
+
if (positionValue?.value === POSITION_STATIC || positionValue === null) {
|
|
4012
|
+
clearPositionDependentPropsRef.current();
|
|
4013
|
+
}
|
|
4014
|
+
}, [positionValue]);
|
|
3985
4015
|
const onPositionChange = (newPosition, previousPosition) => {
|
|
3986
4016
|
const meta = { history: { propDisplayName: DIMENSIONS_LABEL } };
|
|
3987
|
-
if (newPosition ===
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
"inset-block-end": void 0,
|
|
3994
|
-
"inset-inline-start": void 0,
|
|
3995
|
-
"inset-inline-end": void 0
|
|
3996
|
-
},
|
|
4017
|
+
if (newPosition === POSITION_STATIC) {
|
|
4018
|
+
clearPositionDependentProps();
|
|
4019
|
+
} else if (previousPosition === POSITION_STATIC) {
|
|
4020
|
+
if (dimensionsValuesFromHistory) {
|
|
4021
|
+
setPositionDependentValues(
|
|
4022
|
+
{ ...dimensionsValuesFromHistory, "z-index": void 0 },
|
|
3997
4023
|
meta
|
|
3998
4024
|
);
|
|
3999
|
-
}
|
|
4000
|
-
} else if (previousPosition === "static") {
|
|
4001
|
-
if (dimensionsValuesFromHistory) {
|
|
4002
|
-
setDimensions(dimensionsValuesFromHistory, meta);
|
|
4003
4025
|
clearDimensionsHistory();
|
|
4004
4026
|
}
|
|
4005
4027
|
}
|
|
4006
4028
|
};
|
|
4007
|
-
const isNotStatic = positionValue && positionValue?.value !==
|
|
4029
|
+
const isNotStatic = positionValue && positionValue?.value !== POSITION_STATIC;
|
|
4008
4030
|
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));
|
|
4009
4031
|
};
|
|
4010
4032
|
var usePersistDimensions = () => {
|
|
@@ -4016,7 +4038,7 @@ var usePersistDimensions = () => {
|
|
|
4016
4038
|
|
|
4017
4039
|
// src/components/style-sections/size-section/size-section.tsx
|
|
4018
4040
|
import * as React59 from "react";
|
|
4019
|
-
import { useRef as
|
|
4041
|
+
import { useRef as useRef10 } from "react";
|
|
4020
4042
|
import { AspectRatioControl, PositionControl, SizeControl as SizeControl6 } from "@elementor/editor-controls";
|
|
4021
4043
|
import { Grid as Grid4, Stack as Stack10 } from "@elementor/ui";
|
|
4022
4044
|
import { __ as __36 } from "@wordpress/i18n";
|
|
@@ -4183,7 +4205,7 @@ var CssSizeProps = [
|
|
|
4183
4205
|
];
|
|
4184
4206
|
var ASPECT_RATIO_LABEL = __36("Aspect Ratio", "elementor");
|
|
4185
4207
|
var SizeSection = () => {
|
|
4186
|
-
const gridRowRefs = [
|
|
4208
|
+
const gridRowRefs = [useRef10(null), useRef10(null), useRef10(null)];
|
|
4187
4209
|
return /* @__PURE__ */ React59.createElement(SectionContent, null, CssSizeProps.map((row, rowIndex) => /* @__PURE__ */ React59.createElement(Grid4, { key: rowIndex, container: true, gap: 2, flexWrap: "nowrap", ref: gridRowRefs[rowIndex] }, row.map((props) => /* @__PURE__ */ React59.createElement(Grid4, { 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(Stack10, null, /* @__PURE__ */ React59.createElement(OverflowField, null)), /* @__PURE__ */ React59.createElement(StyleTabCollapsibleContent, { fields: ["aspect-ratio", "object-fit"] }, /* @__PURE__ */ React59.createElement(Stack10, { gap: 2, pt: 2 }, /* @__PURE__ */ React59.createElement(StylesField, { bind: "aspect-ratio", propDisplayName: ASPECT_RATIO_LABEL }, /* @__PURE__ */ React59.createElement(AspectRatioControl, { label: ASPECT_RATIO_LABEL })), /* @__PURE__ */ React59.createElement(PanelDivider, null), /* @__PURE__ */ React59.createElement(ObjectFitField, null), /* @__PURE__ */ React59.createElement(StylesField, { bind: "object-position", propDisplayName: __36("Object position", "elementor") }, /* @__PURE__ */ React59.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React59.createElement(PositionControl, null))))));
|
|
4188
4210
|
};
|
|
4189
4211
|
var SizeField = ({ label, bind, rowRef, extendedOptions }) => {
|
|
@@ -4223,12 +4245,12 @@ var ColumnCountField = () => {
|
|
|
4223
4245
|
|
|
4224
4246
|
// src/components/style-sections/typography-section/column-gap-field.tsx
|
|
4225
4247
|
import * as React62 from "react";
|
|
4226
|
-
import { useRef as
|
|
4248
|
+
import { useRef as useRef11 } from "react";
|
|
4227
4249
|
import { SizeControl as SizeControl7 } from "@elementor/editor-controls";
|
|
4228
4250
|
import { __ as __39 } from "@wordpress/i18n";
|
|
4229
4251
|
var COLUMN_GAP_LABEL = __39("Column gap", "elementor");
|
|
4230
4252
|
var ColumnGapField = () => {
|
|
4231
|
-
const rowRef =
|
|
4253
|
+
const rowRef = useRef11(null);
|
|
4232
4254
|
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(SizeControl7, { anchorRef: rowRef })));
|
|
4233
4255
|
};
|
|
4234
4256
|
|
|
@@ -4256,12 +4278,12 @@ var FontFamilyField = () => {
|
|
|
4256
4278
|
|
|
4257
4279
|
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
4258
4280
|
import * as React64 from "react";
|
|
4259
|
-
import { useRef as
|
|
4281
|
+
import { useRef as useRef12 } from "react";
|
|
4260
4282
|
import { SizeControl as SizeControl8 } from "@elementor/editor-controls";
|
|
4261
4283
|
import { __ as __41 } from "@wordpress/i18n";
|
|
4262
4284
|
var FONT_SIZE_LABEL = __41("Font size", "elementor");
|
|
4263
4285
|
var FontSizeField = () => {
|
|
4264
|
-
const rowRef =
|
|
4286
|
+
const rowRef = useRef12(null);
|
|
4265
4287
|
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(SizeControl8, { anchorRef: rowRef, ariaLabel: FONT_SIZE_LABEL })));
|
|
4266
4288
|
};
|
|
4267
4289
|
|
|
@@ -4311,23 +4333,23 @@ var FontWeightField = () => {
|
|
|
4311
4333
|
|
|
4312
4334
|
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
4313
4335
|
import * as React67 from "react";
|
|
4314
|
-
import { useRef as
|
|
4336
|
+
import { useRef as useRef13 } from "react";
|
|
4315
4337
|
import { SizeControl as SizeControl9 } from "@elementor/editor-controls";
|
|
4316
4338
|
import { __ as __44 } from "@wordpress/i18n";
|
|
4317
4339
|
var LETTER_SPACING_LABEL = __44("Letter spacing", "elementor");
|
|
4318
4340
|
var LetterSpacingField = () => {
|
|
4319
|
-
const rowRef =
|
|
4341
|
+
const rowRef = useRef13(null);
|
|
4320
4342
|
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(SizeControl9, { anchorRef: rowRef, min: -Number.MAX_SAFE_INTEGER })));
|
|
4321
4343
|
};
|
|
4322
4344
|
|
|
4323
4345
|
// src/components/style-sections/typography-section/line-height-field.tsx
|
|
4324
4346
|
import * as React68 from "react";
|
|
4325
|
-
import { useRef as
|
|
4347
|
+
import { useRef as useRef14 } from "react";
|
|
4326
4348
|
import { SizeControl as SizeControl10 } from "@elementor/editor-controls";
|
|
4327
4349
|
import { __ as __45 } from "@wordpress/i18n";
|
|
4328
4350
|
var LINE_HEIGHT_LABEL = __45("Line height", "elementor");
|
|
4329
4351
|
var LineHeightField = () => {
|
|
4330
|
-
const rowRef =
|
|
4352
|
+
const rowRef = useRef14(null);
|
|
4331
4353
|
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(SizeControl10, { anchorRef: rowRef })));
|
|
4332
4354
|
};
|
|
4333
4355
|
|
|
@@ -4549,12 +4571,12 @@ var TransformField = () => /* @__PURE__ */ React75.createElement(StylesField, {
|
|
|
4549
4571
|
|
|
4550
4572
|
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
4551
4573
|
import * as React76 from "react";
|
|
4552
|
-
import { useRef as
|
|
4574
|
+
import { useRef as useRef15 } from "react";
|
|
4553
4575
|
import { SizeControl as SizeControl11 } from "@elementor/editor-controls";
|
|
4554
4576
|
import { __ as __52 } from "@wordpress/i18n";
|
|
4555
4577
|
var WORD_SPACING_LABEL = __52("Word spacing", "elementor");
|
|
4556
4578
|
var WordSpacingField = () => {
|
|
4557
|
-
const rowRef =
|
|
4579
|
+
const rowRef = useRef15(null);
|
|
4558
4580
|
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(SizeControl11, { anchorRef: rowRef, min: -Number.MAX_SAFE_INTEGER })));
|
|
4559
4581
|
};
|
|
4560
4582
|
|
|
@@ -4827,7 +4849,7 @@ import { __registerPanel as registerPanel } from "@elementor/editor-panels";
|
|
|
4827
4849
|
import { blockCommand } from "@elementor/editor-v1-adapters";
|
|
4828
4850
|
|
|
4829
4851
|
// src/hooks/use-open-editor-panel.ts
|
|
4830
|
-
import { useEffect as
|
|
4852
|
+
import { useEffect as useEffect7 } from "react";
|
|
4831
4853
|
import { __privateListenTo as listenTo, commandStartEvent } from "@elementor/editor-v1-adapters";
|
|
4832
4854
|
|
|
4833
4855
|
// src/panel.ts
|
|
@@ -4851,7 +4873,7 @@ var isAtomicWidgetSelected = () => {
|
|
|
4851
4873
|
// src/hooks/use-open-editor-panel.ts
|
|
4852
4874
|
var useOpenEditorPanel = () => {
|
|
4853
4875
|
const { open } = usePanelActions();
|
|
4854
|
-
|
|
4876
|
+
useEffect7(() => {
|
|
4855
4877
|
return listenTo(commandStartEvent("panel/editor/open"), () => {
|
|
4856
4878
|
if (isAtomicWidgetSelected()) {
|
|
4857
4879
|
open();
|
|
@@ -4871,11 +4893,12 @@ import { AttributesControl, DisplayConditionsControl } from "@elementor/editor-c
|
|
|
4871
4893
|
|
|
4872
4894
|
// src/components/promotions/custom-css.tsx
|
|
4873
4895
|
import * as React82 from "react";
|
|
4874
|
-
import { useRef as
|
|
4896
|
+
import { useRef as useRef16 } from "react";
|
|
4875
4897
|
import { PromotionTrigger } from "@elementor/editor-controls";
|
|
4876
4898
|
import { __ as __56 } from "@wordpress/i18n";
|
|
4899
|
+
var TRACKING_DATA = { target_name: "custom_css", location_l2: "style" };
|
|
4877
4900
|
var CustomCssSection = () => {
|
|
4878
|
-
const triggerRef =
|
|
4901
|
+
const triggerRef = useRef16(null);
|
|
4879
4902
|
return /* @__PURE__ */ React82.createElement(
|
|
4880
4903
|
StyleTabSection,
|
|
4881
4904
|
{
|
|
@@ -4883,7 +4906,7 @@ var CustomCssSection = () => {
|
|
|
4883
4906
|
name: "Custom CSS",
|
|
4884
4907
|
title: __56("Custom CSS", "elementor"),
|
|
4885
4908
|
action: {
|
|
4886
|
-
component: /* @__PURE__ */ React82.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "customCss" }),
|
|
4909
|
+
component: /* @__PURE__ */ React82.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "customCss", trackingData: TRACKING_DATA }),
|
|
4887
4910
|
onClick: () => triggerRef.current?.toggle()
|
|
4888
4911
|
}
|
|
4889
4912
|
}
|
|
@@ -5586,9 +5609,9 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
5586
5609
|
};
|
|
5587
5610
|
|
|
5588
5611
|
// src/dynamics/components/dynamic-selection.tsx
|
|
5589
|
-
import { Fragment as Fragment13, useState as useState10 } from "react";
|
|
5590
5612
|
import * as React87 from "react";
|
|
5591
|
-
import {
|
|
5613
|
+
import { Fragment as Fragment14, useEffect as useEffect8, useState as useState10 } from "react";
|
|
5614
|
+
import { trackUpgradePromotionClick, trackViewPromotion, useBoundProp as useBoundProp9 } from "@elementor/editor-controls";
|
|
5592
5615
|
import { CtaButton, PopoverHeader, PopoverMenuList, SearchField, SectionPopoverBody } from "@elementor/editor-ui";
|
|
5593
5616
|
import { DatabaseIcon as DatabaseIcon2 } from "@elementor/icons";
|
|
5594
5617
|
import { Divider as Divider7, Link as Link2, Stack as Stack15, Typography as Typography5, useTheme as useTheme3 } from "@elementor/ui";
|
|
@@ -5607,6 +5630,13 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
|
5607
5630
|
const isCurrentValueDynamic = !!dynamicValue;
|
|
5608
5631
|
const options12 = useFilteredOptions(searchValue);
|
|
5609
5632
|
const hasNoDynamicTags = !options12.length && !searchValue.trim();
|
|
5633
|
+
useEffect8(() => {
|
|
5634
|
+
if (hasNoDynamicTags) {
|
|
5635
|
+
trackViewPromotion({ target_name: "dynamic_tags" });
|
|
5636
|
+
} else if (expired) {
|
|
5637
|
+
trackViewPromotion({ target_name: "dynamic_tags" });
|
|
5638
|
+
}
|
|
5639
|
+
}, [hasNoDynamicTags, expired]);
|
|
5610
5640
|
const handleSearch = (value) => {
|
|
5611
5641
|
setSearchValue(value);
|
|
5612
5642
|
};
|
|
@@ -5637,7 +5667,7 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
|
|
|
5637
5667
|
if (expired) {
|
|
5638
5668
|
return /* @__PURE__ */ React87.createElement(ExpiredDynamicTags, null);
|
|
5639
5669
|
}
|
|
5640
|
-
return /* @__PURE__ */ React87.createElement(
|
|
5670
|
+
return /* @__PURE__ */ React87.createElement(Fragment14, null, /* @__PURE__ */ React87.createElement(
|
|
5641
5671
|
SearchField,
|
|
5642
5672
|
{
|
|
5643
5673
|
value: searchValue,
|
|
@@ -5694,7 +5724,14 @@ var NoDynamicTags = () => /* @__PURE__ */ React87.createElement(React87.Fragment
|
|
|
5694
5724
|
/* @__PURE__ */ React87.createElement(DatabaseIcon2, { fontSize: "large" }),
|
|
5695
5725
|
/* @__PURE__ */ React87.createElement(Typography5, { align: "center", variant: "subtitle2" }, __59("Streamline your workflow with dynamic tags", "elementor")),
|
|
5696
5726
|
/* @__PURE__ */ React87.createElement(Typography5, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, __59("Upgrade now to display your content dynamically.", "elementor")),
|
|
5697
|
-
/* @__PURE__ */ React87.createElement(
|
|
5727
|
+
/* @__PURE__ */ React87.createElement(
|
|
5728
|
+
CtaButton,
|
|
5729
|
+
{
|
|
5730
|
+
size: "small",
|
|
5731
|
+
href: PRO_DYNAMIC_TAGS_URL,
|
|
5732
|
+
onClick: () => trackUpgradePromotionClick({ target_name: "dynamic_tags" })
|
|
5733
|
+
}
|
|
5734
|
+
)
|
|
5698
5735
|
));
|
|
5699
5736
|
var ExpiredDynamicTags = () => /* @__PURE__ */ React87.createElement(React87.Fragment, null, /* @__PURE__ */ React87.createElement(Divider7, null), /* @__PURE__ */ React87.createElement(
|
|
5700
5737
|
Stack15,
|
|
@@ -5710,7 +5747,15 @@ var ExpiredDynamicTags = () => /* @__PURE__ */ React87.createElement(React87.Fra
|
|
|
5710
5747
|
/* @__PURE__ */ React87.createElement(DatabaseIcon2, { fontSize: "large" }),
|
|
5711
5748
|
/* @__PURE__ */ React87.createElement(Typography5, { align: "center", variant: "subtitle2" }, __59("Unlock your Dynamic tags again", "elementor")),
|
|
5712
5749
|
/* @__PURE__ */ React87.createElement(Typography5, { align: "center", variant: "caption", width: PROMO_TEXT_WIDTH }, __59("Dynamic tags need Elementor Pro. Renew now to keep them active.", "elementor")),
|
|
5713
|
-
/* @__PURE__ */ React87.createElement(
|
|
5750
|
+
/* @__PURE__ */ React87.createElement(
|
|
5751
|
+
CtaButton,
|
|
5752
|
+
{
|
|
5753
|
+
size: "small",
|
|
5754
|
+
href: RENEW_DYNAMIC_TAGS_URL,
|
|
5755
|
+
onClick: () => trackUpgradePromotionClick({ target_name: "dynamic_tags" }),
|
|
5756
|
+
children: __59("Renew Now", "elementor")
|
|
5757
|
+
}
|
|
5758
|
+
)
|
|
5714
5759
|
));
|
|
5715
5760
|
var useFilteredOptions = (searchValue) => {
|
|
5716
5761
|
const dynamicTags = usePropDynamicTags();
|
|
@@ -6088,7 +6133,7 @@ import { __ as __66 } from "@wordpress/i18n";
|
|
|
6088
6133
|
|
|
6089
6134
|
// src/styles-inheritance/components/styles-inheritance-infotip.tsx
|
|
6090
6135
|
import * as React94 from "react";
|
|
6091
|
-
import { useMemo as useMemo13, useRef as
|
|
6136
|
+
import { useMemo as useMemo13, useRef as useRef17, useState as useState12 } from "react";
|
|
6092
6137
|
import {
|
|
6093
6138
|
createPropsResolver as createPropsResolver2,
|
|
6094
6139
|
stylesInheritanceTransformersRegistry
|
|
@@ -6103,12 +6148,12 @@ import {
|
|
|
6103
6148
|
IconButton as IconButton3,
|
|
6104
6149
|
Infotip as Infotip2,
|
|
6105
6150
|
Stack as Stack17,
|
|
6106
|
-
Tooltip as
|
|
6151
|
+
Tooltip as Tooltip5
|
|
6107
6152
|
} from "@elementor/ui";
|
|
6108
6153
|
import { __ as __65 } from "@wordpress/i18n";
|
|
6109
6154
|
|
|
6110
6155
|
// src/styles-inheritance/hooks/use-normalized-inheritance-chain-items.tsx
|
|
6111
|
-
import { isValidElement, useEffect as
|
|
6156
|
+
import { isValidElement, useEffect as useEffect9, useState as useState11 } from "react";
|
|
6112
6157
|
import { UnknownStyleStateError } from "@elementor/editor-canvas";
|
|
6113
6158
|
import {
|
|
6114
6159
|
isClassState as isClassState2,
|
|
@@ -6119,7 +6164,7 @@ import { __ as __63 } from "@wordpress/i18n";
|
|
|
6119
6164
|
var MAXIMUM_ITEMS = 2;
|
|
6120
6165
|
var useNormalizedInheritanceChainItems = (inheritanceChain, bind, resolve) => {
|
|
6121
6166
|
const [items3, setItems] = useState11([]);
|
|
6122
|
-
|
|
6167
|
+
useEffect9(() => {
|
|
6123
6168
|
(async () => {
|
|
6124
6169
|
const normalizedItems = await Promise.all(
|
|
6125
6170
|
inheritanceChain.filter(({ style }) => style).map((item, index) => normalizeInheritanceItem(item, index, bind, resolve))
|
|
@@ -6254,9 +6299,9 @@ var LabelChip = ({ displayLabel, provider }) => {
|
|
|
6254
6299
|
|
|
6255
6300
|
// src/styles-inheritance/components/infotip/value-component.tsx
|
|
6256
6301
|
import * as React92 from "react";
|
|
6257
|
-
import { Typography as Typography6 } from "@elementor/ui";
|
|
6302
|
+
import { Tooltip as Tooltip4, Typography as Typography6 } from "@elementor/ui";
|
|
6258
6303
|
var ValueComponent = ({ index, value }) => {
|
|
6259
|
-
return /* @__PURE__ */ React92.createElement(
|
|
6304
|
+
return /* @__PURE__ */ React92.createElement(Tooltip4, { title: value, placement: "top" }, /* @__PURE__ */ React92.createElement(
|
|
6260
6305
|
Typography6,
|
|
6261
6306
|
{
|
|
6262
6307
|
variant: "caption",
|
|
@@ -6265,15 +6310,16 @@ var ValueComponent = ({ index, value }) => {
|
|
|
6265
6310
|
mt: "1px",
|
|
6266
6311
|
textDecoration: index === 0 ? "none" : "line-through",
|
|
6267
6312
|
overflow: "hidden",
|
|
6268
|
-
|
|
6269
|
-
|
|
6313
|
+
display: "-webkit-box",
|
|
6314
|
+
WebkitLineClamp: 1,
|
|
6315
|
+
WebkitBoxOrient: "vertical",
|
|
6270
6316
|
pl: 2.5,
|
|
6271
6317
|
minWidth: 0,
|
|
6272
6318
|
maxWidth: "100%"
|
|
6273
6319
|
}
|
|
6274
6320
|
},
|
|
6275
6321
|
value
|
|
6276
|
-
);
|
|
6322
|
+
));
|
|
6277
6323
|
};
|
|
6278
6324
|
|
|
6279
6325
|
// src/styles-inheritance/components/infotip/action-icons.tsx
|
|
@@ -6300,7 +6346,7 @@ var StylesInheritanceInfotip = ({
|
|
|
6300
6346
|
isDisabled
|
|
6301
6347
|
}) => {
|
|
6302
6348
|
const [showInfotip, setShowInfotip] = useState12(false);
|
|
6303
|
-
const triggerRef =
|
|
6349
|
+
const triggerRef = useRef17(null);
|
|
6304
6350
|
const toggleInfotip = () => {
|
|
6305
6351
|
if (isDisabled) {
|
|
6306
6352
|
return;
|
|
@@ -6361,7 +6407,7 @@ var StylesInheritanceInfotip = ({
|
|
|
6361
6407
|
}
|
|
6362
6408
|
}
|
|
6363
6409
|
},
|
|
6364
|
-
/* @__PURE__ */ React94.createElement(Stack17, { gap: 1.5, sx: { pl:
|
|
6410
|
+
/* @__PURE__ */ React94.createElement(Stack17, { gap: 1.5, sx: { pl: 2, pr: 1, pt: 1.5, pb: 1.5 }, role: "list" }, items3.map((item, index) => {
|
|
6365
6411
|
return /* @__PURE__ */ React94.createElement(
|
|
6366
6412
|
Box8,
|
|
6367
6413
|
{
|
|
@@ -6456,21 +6502,19 @@ function TooltipOrInfotip({
|
|
|
6456
6502
|
sx: { mx: 2 }
|
|
6457
6503
|
}
|
|
6458
6504
|
},
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
]
|
|
6467
|
-
}
|
|
6505
|
+
PopperProps: {
|
|
6506
|
+
modifiers: [
|
|
6507
|
+
{
|
|
6508
|
+
name: "offset",
|
|
6509
|
+
options: { offset: [offsetX, 0] }
|
|
6510
|
+
}
|
|
6511
|
+
]
|
|
6468
6512
|
}
|
|
6469
6513
|
},
|
|
6470
6514
|
children
|
|
6471
6515
|
));
|
|
6472
6516
|
}
|
|
6473
|
-
return /* @__PURE__ */ React94.createElement(
|
|
6517
|
+
return /* @__PURE__ */ React94.createElement(Tooltip5, { title: __65("Style origin", "elementor"), placement: "top" }, children);
|
|
6474
6518
|
}
|
|
6475
6519
|
|
|
6476
6520
|
// src/styles-inheritance/components/styles-inheritance-indicator.tsx
|
|
@@ -6545,19 +6589,22 @@ var excludePropTypeTransformers = /* @__PURE__ */ new Set([
|
|
|
6545
6589
|
// src/styles-inheritance/transformers/array-transformer.tsx
|
|
6546
6590
|
import * as React96 from "react";
|
|
6547
6591
|
import { createTransformer as createTransformer2 } from "@elementor/editor-canvas";
|
|
6548
|
-
import { Stack as Stack18 } from "@elementor/ui";
|
|
6549
6592
|
var arrayTransformer = createTransformer2((values) => {
|
|
6550
6593
|
if (!values || values.length === 0) {
|
|
6551
6594
|
return null;
|
|
6552
6595
|
}
|
|
6553
|
-
|
|
6596
|
+
const allStrings = values.every((item) => typeof item === "string" || typeof item === "number");
|
|
6597
|
+
if (allStrings) {
|
|
6598
|
+
return values.join(" ");
|
|
6599
|
+
}
|
|
6600
|
+
return /* @__PURE__ */ React96.createElement(React96.Fragment, null, values.map((item, index) => /* @__PURE__ */ React96.createElement(React96.Fragment, { key: index }, index > 0 && " ", item)));
|
|
6554
6601
|
});
|
|
6555
6602
|
|
|
6556
6603
|
// src/styles-inheritance/transformers/background-color-overlay-transformer.tsx
|
|
6557
6604
|
import * as React97 from "react";
|
|
6558
6605
|
import { createTransformer as createTransformer3 } from "@elementor/editor-canvas";
|
|
6559
|
-
import { Stack as
|
|
6560
|
-
var backgroundColorOverlayTransformer = createTransformer3((value) => /* @__PURE__ */ React97.createElement(
|
|
6606
|
+
import { Stack as Stack18, styled as styled6, UnstableColorIndicator } from "@elementor/ui";
|
|
6607
|
+
var backgroundColorOverlayTransformer = createTransformer3((value) => /* @__PURE__ */ React97.createElement(Stack18, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React97.createElement(ItemLabelColor, { value })));
|
|
6561
6608
|
var ItemLabelColor = ({ value: { color } }) => {
|
|
6562
6609
|
return /* @__PURE__ */ React97.createElement("span", null, color);
|
|
6563
6610
|
};
|
|
@@ -6572,9 +6619,9 @@ var StyledUnstableColorIndicator = styled6(UnstableColorIndicator)(({ theme }) =
|
|
|
6572
6619
|
// src/styles-inheritance/transformers/background-gradient-overlay-transformer.tsx
|
|
6573
6620
|
import * as React98 from "react";
|
|
6574
6621
|
import { createTransformer as createTransformer4 } from "@elementor/editor-canvas";
|
|
6575
|
-
import { Stack as
|
|
6622
|
+
import { Stack as Stack19 } from "@elementor/ui";
|
|
6576
6623
|
import { __ as __67 } from "@wordpress/i18n";
|
|
6577
|
-
var backgroundGradientOverlayTransformer = createTransformer4((value) => /* @__PURE__ */ React98.createElement(
|
|
6624
|
+
var backgroundGradientOverlayTransformer = createTransformer4((value) => /* @__PURE__ */ React98.createElement(Stack19, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React98.createElement(ItemIconGradient, { value }), /* @__PURE__ */ React98.createElement(ItemLabelGradient, { value })));
|
|
6578
6625
|
var ItemIconGradient = ({ value }) => {
|
|
6579
6626
|
const gradient = getGradientValue(value);
|
|
6580
6627
|
return /* @__PURE__ */ React98.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
@@ -6597,9 +6644,9 @@ var getGradientValue = (gradient) => {
|
|
|
6597
6644
|
import * as React99 from "react";
|
|
6598
6645
|
import { createTransformer as createTransformer5 } from "@elementor/editor-canvas";
|
|
6599
6646
|
import { EllipsisWithTooltip as EllipsisWithTooltip2 } from "@elementor/editor-ui";
|
|
6600
|
-
import { CardMedia, Stack as
|
|
6647
|
+
import { CardMedia, Stack as Stack20 } from "@elementor/ui";
|
|
6601
6648
|
import { useWpMediaAttachment } from "@elementor/wp-media";
|
|
6602
|
-
var backgroundImageOverlayTransformer = createTransformer5((value) => /* @__PURE__ */ React99.createElement(
|
|
6649
|
+
var backgroundImageOverlayTransformer = createTransformer5((value) => /* @__PURE__ */ React99.createElement(Stack20, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React99.createElement(ItemIconImage, { value }), /* @__PURE__ */ React99.createElement(ItemLabelImage, { value })));
|
|
6603
6650
|
var ItemIconImage = ({ value }) => {
|
|
6604
6651
|
const { imageUrl } = useImage(value);
|
|
6605
6652
|
return /* @__PURE__ */ React99.createElement(
|
|
@@ -6645,7 +6692,6 @@ var getFileExtensionFromFilename = (filename) => {
|
|
|
6645
6692
|
// src/styles-inheritance/transformers/box-shadow-transformer.tsx
|
|
6646
6693
|
import * as React100 from "react";
|
|
6647
6694
|
import { createTransformer as createTransformer6 } from "@elementor/editor-canvas";
|
|
6648
|
-
import { Stack as Stack22 } from "@elementor/ui";
|
|
6649
6695
|
var boxShadowTransformer = createTransformer6((value) => {
|
|
6650
6696
|
if (!value) {
|
|
6651
6697
|
return null;
|
|
@@ -6654,13 +6700,13 @@ var boxShadowTransformer = createTransformer6((value) => {
|
|
|
6654
6700
|
const colorValue = color || "#000000";
|
|
6655
6701
|
const sizes = [hOffset || "0px", vOffset || "0px", blur || "10px", spread || "0px"].join(" ");
|
|
6656
6702
|
const positionValue = position || "outset";
|
|
6657
|
-
return /* @__PURE__ */ React100.createElement(
|
|
6703
|
+
return /* @__PURE__ */ React100.createElement(React100.Fragment, null, colorValue, " ", positionValue, ", ", sizes);
|
|
6658
6704
|
});
|
|
6659
6705
|
|
|
6660
6706
|
// src/styles-inheritance/transformers/color-transformer.tsx
|
|
6661
6707
|
import * as React101 from "react";
|
|
6662
6708
|
import { createTransformer as createTransformer7 } from "@elementor/editor-canvas";
|
|
6663
|
-
import { Stack as
|
|
6709
|
+
import { Stack as Stack21, styled as styled7, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
6664
6710
|
function isValidCSSColor(value) {
|
|
6665
6711
|
if (!value.trim()) {
|
|
6666
6712
|
return false;
|
|
@@ -6678,24 +6724,18 @@ var colorTransformer = createTransformer7((value) => {
|
|
|
6678
6724
|
if (!isValidCSSColor(value)) {
|
|
6679
6725
|
return value;
|
|
6680
6726
|
}
|
|
6681
|
-
return /* @__PURE__ */ React101.createElement(
|
|
6727
|
+
return /* @__PURE__ */ React101.createElement(Stack21, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React101.createElement(StyledColorIndicator, { size: "inherit", component: "span", value }), /* @__PURE__ */ React101.createElement("span", null, value));
|
|
6682
6728
|
});
|
|
6683
6729
|
|
|
6684
6730
|
// src/styles-inheritance/transformers/repeater-to-items-transformer.tsx
|
|
6685
|
-
import * as React102 from "react";
|
|
6686
6731
|
import { createTransformer as createTransformer8 } from "@elementor/editor-canvas";
|
|
6687
|
-
|
|
6688
|
-
var createRepeaterToItemsTransformer = (originalTransformer, separator = " ") => {
|
|
6732
|
+
var createRepeaterToItemsTransformer = (originalTransformer) => {
|
|
6689
6733
|
return createTransformer8((value, options12) => {
|
|
6690
6734
|
const stringResult = originalTransformer(value, options12);
|
|
6691
6735
|
if (!stringResult || typeof stringResult !== "string") {
|
|
6692
6736
|
return stringResult;
|
|
6693
6737
|
}
|
|
6694
|
-
|
|
6695
|
-
if (parts.length <= 1) {
|
|
6696
|
-
return stringResult;
|
|
6697
|
-
}
|
|
6698
|
-
return /* @__PURE__ */ React102.createElement(Stack24, { direction: "column", gap: 0.5 }, parts.map((part, index) => /* @__PURE__ */ React102.createElement(Stack24, { key: index }, part.trim())));
|
|
6738
|
+
return stringResult;
|
|
6699
6739
|
});
|
|
6700
6740
|
};
|
|
6701
6741
|
|
|
@@ -6734,7 +6774,7 @@ function registerCustomTransformers(originalStyleTransformers) {
|
|
|
6734
6774
|
);
|
|
6735
6775
|
stylesInheritanceTransformersRegistry2.register(
|
|
6736
6776
|
"transition",
|
|
6737
|
-
createRepeaterToItemsTransformer(originalStyleTransformers.transition
|
|
6777
|
+
createRepeaterToItemsTransformer(originalStyleTransformers.transition)
|
|
6738
6778
|
);
|
|
6739
6779
|
["background-overlay", "box-shadow", "transform-functions"].forEach(
|
|
6740
6780
|
(propType) => stylesInheritanceTransformersRegistry2.register(propType, arrayTransformer)
|
|
@@ -6774,6 +6814,7 @@ var blockV1Panel = () => {
|
|
|
6774
6814
|
};
|
|
6775
6815
|
export {
|
|
6776
6816
|
Control as BaseControl,
|
|
6817
|
+
ControlTypeContainer,
|
|
6777
6818
|
CustomCssIndicator,
|
|
6778
6819
|
ElementProvider,
|
|
6779
6820
|
FIELD_TYPE,
|