@elementor/editor-editing-panel 1.41.0 → 1.42.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.42.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e732d81: Show Tooltip on hover and Infotip on click for style indicator.
8
+ - 8dca168: Prevent scrolling when the Indication Popover has been opened.
9
+
10
+ ### Patch Changes
11
+
12
+ - cd4c3fe: Remove duplicated object fit set value.
13
+ - b7369f2: Update the chip color inside the Indication Popover.
14
+ - Updated dependencies [8f3a61b]
15
+ - @elementor/editor-controls@0.34.1
16
+
3
17
  ## 1.41.0
4
18
 
5
19
  ### Minor Changes
package/dist/index.js CHANGED
@@ -1948,7 +1948,7 @@ var excludePropTypeTransformers = /* @__PURE__ */ new Set([
1948
1948
  "image",
1949
1949
  "background-overlay"
1950
1950
  ]);
1951
- var isUsingIndicatorPopover = () => (0, import_editor_v1_adapters5.isExperimentActive)("e_indications_popover");
1951
+ var isUsingIndicatorPopover = () => (0, import_editor_v1_adapters5.isExperimentActive)("e_v_3_30");
1952
1952
 
1953
1953
  // src/styles-inheritance/styles-inheritance-infotip.tsx
1954
1954
  var React25 = __toESM(require("react"));
@@ -2022,16 +2022,18 @@ var import_icons6 = require("@elementor/icons");
2022
2022
  var import_ui19 = require("@elementor/ui");
2023
2023
  var import_i18n6 = require("@wordpress/i18n");
2024
2024
  var SIZE4 = "tiny";
2025
- var LabelChip = ({ displayLabel, provider }) => {
2025
+ var LabelChip = ({ displayLabel, provider, chipColor }) => {
2026
+ const isBaseStyle = provider === import_editor_styles_repository7.ELEMENTS_BASE_STYLES_PROVIDER_KEY;
2027
+ const chipIcon = isBaseStyle ? /* @__PURE__ */ React22.createElement(import_ui19.Tooltip, { title: (0, import_i18n6.__)("Inherited from base styles", "elementor"), placement: "top" }, /* @__PURE__ */ React22.createElement(import_icons6.InfoCircleIcon, { fontSize: SIZE4 })) : void 0;
2026
2028
  return /* @__PURE__ */ React22.createElement(
2027
2029
  import_ui19.Chip,
2028
2030
  {
2029
2031
  label: displayLabel,
2030
2032
  size: SIZE4,
2031
- color: "global",
2033
+ color: chipColor,
2032
2034
  variant: "standard",
2033
2035
  state: "enabled",
2034
- icon: provider === import_editor_styles_repository7.ELEMENTS_BASE_STYLES_PROVIDER_KEY ? /* @__PURE__ */ React22.createElement(import_ui19.Tooltip, { title: (0, import_i18n6.__)("Inherited from base styles", "elementor"), placement: "top" }, /* @__PURE__ */ React22.createElement(import_icons6.InfoCircleIcon, { fontSize: SIZE4 })) : void 0,
2036
+ icon: chipIcon,
2035
2037
  sx: (theme) => ({
2036
2038
  lineHeight: 1,
2037
2039
  flexWrap: "nowrap",
@@ -2109,7 +2111,8 @@ var normalizeInheritanceItem = async (item, index, bind, resolve) => {
2109
2111
  provider: item.provider || "",
2110
2112
  breakpoint: breakpoint ?? DEFAULT_BREAKPOINT3,
2111
2113
  displayLabel,
2112
- value: await getTransformedValue(item, bind, resolve)
2114
+ value: await getTransformedValue(item, bind, resolve),
2115
+ chipColor: getChipColor(item)
2113
2116
  };
2114
2117
  };
2115
2118
  var getTransformedValue = async (item, bind, resolve) => {
@@ -2131,6 +2134,16 @@ var getTransformedValue = async (item, bind, resolve) => {
2131
2134
  return "";
2132
2135
  }
2133
2136
  };
2137
+ var getChipColor = (item) => {
2138
+ const { provider = "", style } = item;
2139
+ if (provider === import_editor_styles_repository8.ELEMENTS_BASE_STYLES_PROVIDER_KEY) {
2140
+ return "default";
2141
+ }
2142
+ if (style?.label === "local") {
2143
+ return "accent";
2144
+ }
2145
+ return "global";
2146
+ };
2134
2147
 
2135
2148
  // src/styles-inheritance/styles-inheritance-transformers-registry.tsx
2136
2149
  var import_editor_canvas = require("@elementor/editor-canvas");
@@ -2139,8 +2152,9 @@ var stylesInheritanceTransformersRegistry = (0, import_editor_canvas.createTrans
2139
2152
  // src/styles-inheritance/styles-inheritance-infotip.tsx
2140
2153
  var SIZE5 = "tiny";
2141
2154
  var StyleIndicatorInfotip = ({ inheritanceChain, propType, path, label, children }) => {
2142
- const [open, setOpen] = (0, import_react21.useState)(false);
2143
- const { isSiteRtl } = useDirection();
2155
+ const [showInfotip, setShowInfotip] = (0, import_react21.useState)(false);
2156
+ const toggleInfotip = () => setShowInfotip((prev) => !prev);
2157
+ const closeInfotip = () => setShowInfotip(false);
2144
2158
  const key = path.join(".");
2145
2159
  const sectionContentRef = useSectionContentRef();
2146
2160
  const sectionContentWidth = sectionContentRef?.current?.offsetWidth ?? 320;
@@ -2151,12 +2165,7 @@ var StyleIndicatorInfotip = ({ inheritanceChain, propType, path, label, children
2151
2165
  });
2152
2166
  }, [key, propType]);
2153
2167
  const items3 = useNormalizedInheritanceChainItems(inheritanceChain, key, resolve);
2154
- const toggleOpen = () => setOpen((prev) => !prev);
2155
- const closeInfotip = () => {
2156
- setOpen(false);
2157
- };
2158
- const forceInfotipAlignLeft = isSiteRtl ? 9999999 : -9999999;
2159
- const infotipContent = /* @__PURE__ */ React25.createElement(
2168
+ const infotipContent = /* @__PURE__ */ React25.createElement(import_ui22.ClickAwayListener, { onClickAway: closeInfotip }, /* @__PURE__ */ React25.createElement(
2160
2169
  import_ui22.Card,
2161
2170
  {
2162
2171
  elevation: 0,
@@ -2187,54 +2196,90 @@ var StyleIndicatorInfotip = ({ inheritanceChain, propType, path, label, children
2187
2196
  onClick: closeInfotip
2188
2197
  }
2189
2198
  )),
2190
- /* @__PURE__ */ React25.createElement(import_ui22.Stack, { gap: 1.5, sx: { pl: 2, pr: 1, pb: 2, overflowX: "hidden", overflowY: "auto" }, role: "list" }, items3.map((item, index) => {
2191
- return /* @__PURE__ */ React25.createElement(
2192
- import_ui22.Box,
2193
- {
2194
- key: item.id,
2195
- display: "flex",
2196
- gap: 0.5,
2197
- role: "listitem",
2198
- "aria-label": (0, import_i18n8.__)("Inheritance item: %s", "elementor").replace(
2199
- "%s",
2200
- item.displayLabel
2201
- )
2202
- },
2203
- /* @__PURE__ */ React25.createElement(import_ui22.Box, { display: "flex", gap: 0.5, sx: { flexWrap: "wrap", width: "100%" } }, /* @__PURE__ */ React25.createElement(BreakpointIcon, { breakpoint: item.breakpoint }), /* @__PURE__ */ React25.createElement(LabelChip, { displayLabel: item.displayLabel, provider: item.provider }), /* @__PURE__ */ React25.createElement(ValueComponent, { index, value: item.value })),
2204
- /* @__PURE__ */ React25.createElement(ActionIcons, null)
2205
- );
2206
- }))
2199
+ /* @__PURE__ */ React25.createElement(
2200
+ import_ui22.Stack,
2201
+ {
2202
+ gap: 1.5,
2203
+ sx: { pl: 2, pr: 1, pb: 2, overflowX: "hidden", overflowY: "auto" },
2204
+ role: "list"
2205
+ },
2206
+ items3.map((item, index) => {
2207
+ return /* @__PURE__ */ React25.createElement(
2208
+ import_ui22.Box,
2209
+ {
2210
+ key: item.id,
2211
+ display: "flex",
2212
+ gap: 0.5,
2213
+ role: "listitem",
2214
+ "aria-label": (0, import_i18n8.__)("Inheritance item: %s", "elementor").replace(
2215
+ "%s",
2216
+ item.displayLabel
2217
+ )
2218
+ },
2219
+ /* @__PURE__ */ React25.createElement(import_ui22.Box, { display: "flex", gap: 0.5, sx: { flexWrap: "wrap", width: "100%" } }, /* @__PURE__ */ React25.createElement(BreakpointIcon, { breakpoint: item.breakpoint }), /* @__PURE__ */ React25.createElement(
2220
+ LabelChip,
2221
+ {
2222
+ displayLabel: item.displayLabel,
2223
+ provider: item.provider,
2224
+ chipColor: item.chipColor
2225
+ }
2226
+ ), /* @__PURE__ */ React25.createElement(ValueComponent, { index, value: item.value })),
2227
+ /* @__PURE__ */ React25.createElement(ActionIcons, null)
2228
+ );
2229
+ })
2230
+ )
2207
2231
  )
2208
- );
2209
- return /* @__PURE__ */ React25.createElement(
2210
- import_ui22.Infotip,
2211
- {
2212
- placement: "top",
2213
- content: infotipContent,
2214
- open,
2215
- onClose: closeInfotip,
2216
- disableHoverListener: true,
2217
- componentsProps: {
2218
- tooltip: {
2219
- sx: {
2220
- mx: 2
2232
+ ));
2233
+ return /* @__PURE__ */ React25.createElement(TooltipOrInfotip, { showInfotip, onClose: closeInfotip, infotipContent }, /* @__PURE__ */ React25.createElement(import_ui22.IconButton, { onClick: toggleInfotip, "aria-label": label, sx: { my: "-1px" } }, children));
2234
+ };
2235
+ function TooltipOrInfotip({
2236
+ children,
2237
+ showInfotip,
2238
+ onClose,
2239
+ infotipContent
2240
+ }) {
2241
+ const { isSiteRtl } = useDirection();
2242
+ const forceInfotipAlignLeft = isSiteRtl ? 9999999 : -9999999;
2243
+ if (showInfotip) {
2244
+ return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(
2245
+ import_ui22.Backdrop,
2246
+ {
2247
+ open: showInfotip,
2248
+ onClick: onClose,
2249
+ sx: {
2250
+ backgroundColor: "transparent",
2251
+ zIndex: (theme) => theme.zIndex.modal - 1
2252
+ }
2253
+ }
2254
+ ), /* @__PURE__ */ React25.createElement(
2255
+ import_ui22.Infotip,
2256
+ {
2257
+ placement: "top",
2258
+ content: infotipContent,
2259
+ open: showInfotip,
2260
+ onClose,
2261
+ disableHoverListener: true,
2262
+ componentsProps: {
2263
+ tooltip: {
2264
+ sx: { mx: 2 }
2265
+ }
2266
+ },
2267
+ slotProps: {
2268
+ popper: {
2269
+ modifiers: [
2270
+ {
2271
+ name: "offset",
2272
+ options: { offset: [forceInfotipAlignLeft, 0] }
2273
+ }
2274
+ ]
2221
2275
  }
2222
2276
  }
2223
2277
  },
2224
- slotProps: {
2225
- popper: {
2226
- modifiers: [
2227
- {
2228
- name: "offset",
2229
- options: { offset: [forceInfotipAlignLeft, 0] }
2230
- }
2231
- ]
2232
- }
2233
- }
2234
- },
2235
- /* @__PURE__ */ React25.createElement(import_ui22.IconButton, { onClick: toggleOpen, "aria-label": label, sx: { my: "-1px" } }, children)
2236
- );
2237
- };
2278
+ children
2279
+ ));
2280
+ }
2281
+ return /* @__PURE__ */ React25.createElement(import_ui22.Tooltip, { title: (0, import_i18n8.__)("Style origin", "elementor"), placement: "top" }, children);
2282
+ }
2238
2283
 
2239
2284
  // src/styles-inheritance/styles-inheritance-indicator.tsx
2240
2285
  var StylesInheritanceIndicator = () => {
@@ -3340,8 +3385,8 @@ var positionOptions2 = [
3340
3385
  { label: (0, import_i18n31.__)("None", "elementor"), value: "none" },
3341
3386
  { label: (0, import_i18n31.__)("Scale down", "elementor"), value: "scale-down" }
3342
3387
  ];
3343
- var ObjectFitField = ({ onChange }) => {
3344
- return /* @__PURE__ */ React57.createElement(StylesField, { bind: "object-fit" }, /* @__PURE__ */ React57.createElement(import_ui47.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React57.createElement(import_ui47.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ControlLabel, null, (0, import_i18n31.__)("Object fit", "elementor"))), /* @__PURE__ */ React57.createElement(import_ui47.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React57.createElement(import_editor_controls29.SelectControl, { options: positionOptions2, onChange }))));
3388
+ var ObjectFitField = () => {
3389
+ return /* @__PURE__ */ React57.createElement(StylesField, { bind: "object-fit" }, /* @__PURE__ */ React57.createElement(import_ui47.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React57.createElement(import_ui47.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ControlLabel, null, (0, import_i18n31.__)("Object fit", "elementor"))), /* @__PURE__ */ React57.createElement(import_ui47.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React57.createElement(import_editor_controls29.SelectControl, { options: positionOptions2 }))));
3345
3390
  };
3346
3391
 
3347
3392
  // src/components/style-sections/size-section/object-position-field.tsx
@@ -3360,8 +3405,8 @@ var positionOptions3 = [
3360
3405
  { label: (0, import_i18n32.__)("Bottom left", "elementor"), value: "bottom left" },
3361
3406
  { label: (0, import_i18n32.__)("Bottom right", "elementor"), value: "bottom right" }
3362
3407
  ];
3363
- var ObjectPositionField = ({ onChange }) => {
3364
- return /* @__PURE__ */ React58.createElement(StylesField, { bind: "object-position" }, /* @__PURE__ */ React58.createElement(import_ui48.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(import_ui48.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React58.createElement(ControlLabel, null, (0, import_i18n32.__)("Object position", "elementor"))), /* @__PURE__ */ React58.createElement(import_ui48.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React58.createElement(import_editor_controls30.SelectControl, { options: positionOptions3, onChange }))));
3408
+ var ObjectPositionField = () => {
3409
+ return /* @__PURE__ */ React58.createElement(StylesField, { bind: "object-position" }, /* @__PURE__ */ React58.createElement(import_ui48.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(import_ui48.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React58.createElement(ControlLabel, null, (0, import_i18n32.__)("Object position", "elementor"))), /* @__PURE__ */ React58.createElement(import_ui48.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React58.createElement(import_editor_controls30.SelectControl, { options: positionOptions3 }))));
3365
3410
  };
3366
3411
 
3367
3412
  // src/components/style-sections/size-section/overflow-field.tsx
@@ -3396,16 +3441,8 @@ var OverflowField = () => {
3396
3441
 
3397
3442
  // src/components/style-sections/size-section/size-section.tsx
3398
3443
  var SizeSection = () => {
3399
- const [fitValue, setFitValue] = useStylesField("object-fit");
3444
+ const [fitValue] = useStylesField("object-fit");
3400
3445
  const isNotFill = fitValue && fitValue?.value !== "fill";
3401
- const onFitChange = (newFit, previousValue) => {
3402
- if (newFit && newFit !== previousValue) {
3403
- setFitValue({
3404
- value: newFit,
3405
- $$type: "string"
3406
- });
3407
- }
3408
- };
3409
3446
  const isVersion330Active = (0, import_editor_v1_adapters10.isExperimentActive)("e_v_3_30");
3410
3447
  return /* @__PURE__ */ React60.createElement(SectionContent, null, /* @__PURE__ */ React60.createElement(import_ui50.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(SizeField, { bind: "width", label: (0, import_i18n34.__)("Width", "elementor"), extendedValues: ["auto"] })), /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(SizeField, { bind: "height", label: (0, import_i18n34.__)("Height", "elementor"), extendedValues: ["auto"] }))), /* @__PURE__ */ React60.createElement(import_ui50.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(
3411
3448
  SizeField,
@@ -3421,7 +3458,7 @@ var SizeSection = () => {
3421
3458
  label: (0, import_i18n34.__)("Min height", "elementor"),
3422
3459
  extendedValues: ["auto"]
3423
3460
  }
3424
- ))), /* @__PURE__ */ React60.createElement(import_ui50.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(SizeField, { bind: "max-width", label: (0, import_i18n34.__)("Max width", "elementor") })), /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(SizeField, { bind: "max-height", label: (0, import_i18n34.__)("Max height", "elementor") }))), /* @__PURE__ */ React60.createElement(PanelDivider, null), /* @__PURE__ */ React60.createElement(import_ui50.Stack, null, /* @__PURE__ */ React60.createElement(OverflowField, null)), isVersion330Active && /* @__PURE__ */ React60.createElement(CollapsibleContent, null, /* @__PURE__ */ React60.createElement(import_ui50.Stack, { gap: 2 }, /* @__PURE__ */ React60.createElement(StylesField, { bind: "aspect-ratio" }, /* @__PURE__ */ React60.createElement(import_editor_controls32.AspectRatioControl, { label: (0, import_i18n34.__)("Aspect Ratio", "elementor") })), /* @__PURE__ */ React60.createElement(PanelDivider, null), /* @__PURE__ */ React60.createElement(ObjectFitField, { onChange: onFitChange }), isNotFill && /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(ObjectPositionField, null)))));
3461
+ ))), /* @__PURE__ */ React60.createElement(import_ui50.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(SizeField, { bind: "max-width", label: (0, import_i18n34.__)("Max width", "elementor") })), /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(SizeField, { bind: "max-height", label: (0, import_i18n34.__)("Max height", "elementor") }))), /* @__PURE__ */ React60.createElement(PanelDivider, null), /* @__PURE__ */ React60.createElement(import_ui50.Stack, null, /* @__PURE__ */ React60.createElement(OverflowField, null)), isVersion330Active && /* @__PURE__ */ React60.createElement(CollapsibleContent, null, /* @__PURE__ */ React60.createElement(import_ui50.Stack, { gap: 2 }, /* @__PURE__ */ React60.createElement(StylesField, { bind: "aspect-ratio" }, /* @__PURE__ */ React60.createElement(import_editor_controls32.AspectRatioControl, { label: (0, import_i18n34.__)("Aspect Ratio", "elementor") })), /* @__PURE__ */ React60.createElement(PanelDivider, null), /* @__PURE__ */ React60.createElement(ObjectFitField, null), isNotFill && /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(ObjectPositionField, null)))));
3425
3462
  };
3426
3463
  var SizeField = ({ label, bind, extendedValues }) => {
3427
3464
  return /* @__PURE__ */ React60.createElement(StylesField, { bind }, /* @__PURE__ */ React60.createElement(import_ui50.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React60.createElement(ControlLabel, null, label)), /* @__PURE__ */ React60.createElement(import_ui50.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React60.createElement(import_editor_controls32.SizeControl, { extendedValues }))));