@elementor/editor-editing-panel 1.33.1 → 1.34.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,26 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.34.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 71d9ffe: Added support for split items in toggle button group and an API for checking if an experiment is active
8
+ - 4a2569f: Replaced experiment status check to look for existing experiments
9
+ - 9f16dcb: Added an API to get experimental features' status
10
+ - b150c2b: Wrap font family with Control Action
11
+
12
+ ### Patch Changes
13
+
14
+ - 9a098c5: Add a general experiment for 3.30
15
+ - Updated dependencies [ebcf7cc]
16
+ - Updated dependencies [71d9ffe]
17
+ - Updated dependencies [b6131c3]
18
+ - Updated dependencies [810db8d]
19
+ - Updated dependencies [b150c2b]
20
+ - @elementor/editor-controls@0.29.0
21
+ - @elementor/editor-styles-repository@0.8.7
22
+ - @elementor/editor-canvas@0.21.1
23
+
3
24
  ## 1.33.1
4
25
 
5
26
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1590,10 +1590,24 @@ var import_editor_styles_repository7 = require("@elementor/editor-styles-reposit
1590
1590
  var import_ui16 = require("@elementor/ui");
1591
1591
  var import_i18n5 = require("@wordpress/i18n");
1592
1592
 
1593
- // src/sync/get-experiments-config.ts
1594
- var getExperimentsConfig = () => {
1593
+ // src/sync/get-elementor-globals.ts
1594
+ var getElementorConfig = () => {
1595
+ const extendedWindow = window;
1596
+ return extendedWindow.elementor?.config ?? {};
1597
+ };
1598
+ var getElementorFrontendConfig = () => {
1595
1599
  const extendedWindow = window;
1596
- return extendedWindow.elementorCommon?.config?.experimentalFeatures ?? {};
1600
+ return extendedWindow.elementorFrontend?.config ?? {};
1601
+ };
1602
+ var getElementorCommonConfig = () => {
1603
+ const extendedWindow = window;
1604
+ return extendedWindow.elementorCommon?.config ?? {};
1605
+ };
1606
+
1607
+ // src/sync/is-experiment-active.ts
1608
+ var isExperimentActive = (experiment) => {
1609
+ const allFeatures = getElementorCommonConfig()?.experimentalFeatures ?? {};
1610
+ return !!allFeatures?.[experiment];
1597
1611
  };
1598
1612
 
1599
1613
  // src/styles-inheritance/styles-inheritance-infotip.tsx
@@ -1680,7 +1694,7 @@ var StylesInheritanceIndicator = () => {
1680
1694
  const hasValue = value !== null && value !== void 0;
1681
1695
  const label = getLabel({ isFinalValue, hasValue });
1682
1696
  const variantType = getVariant({ isFinalValue, hasValue, currentStyleProvider });
1683
- const { e_indications_popover: eIndicationsPopover } = getExperimentsConfig();
1697
+ const eIndicationsPopover = isExperimentActive("e_indications_popover");
1684
1698
  if (!eIndicationsPopover) {
1685
1699
  return /* @__PURE__ */ React19.createElement(StyleIndicator, { variant: variantType, "aria-label": label });
1686
1700
  }
@@ -1846,8 +1860,8 @@ var import_i18n8 = require("@wordpress/i18n");
1846
1860
  // src/hooks/use-direction.ts
1847
1861
  var import_ui23 = require("@elementor/ui");
1848
1862
  function useDirection() {
1849
- const theme = (0, import_ui23.useTheme)(), extendedWindow = window;
1850
- const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!extendedWindow.elementorFrontend?.config?.is_rtl;
1863
+ const theme = (0, import_ui23.useTheme)();
1864
+ const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!getElementorFrontendConfig()?.is_rtl;
1851
1865
  return { isSiteRtl, isUiRtl };
1852
1866
  }
1853
1867
 
@@ -2244,7 +2258,7 @@ var React37 = __toESM(require("react"));
2244
2258
  var import_editor_controls17 = require("@elementor/editor-controls");
2245
2259
  var import_ui30 = require("@elementor/ui");
2246
2260
  var import_i18n14 = require("@wordpress/i18n");
2247
- var displayFieldOptions = [
2261
+ var displayFieldItems = [
2248
2262
  {
2249
2263
  value: "block",
2250
2264
  renderContent: () => (0, import_i18n14.__)("Block", "elementor"),
@@ -2262,17 +2276,27 @@ var displayFieldOptions = [
2262
2276
  renderContent: () => (0, import_i18n14.__)("In-blk", "elementor"),
2263
2277
  label: (0, import_i18n14.__)("Inline-block", "elementor"),
2264
2278
  showTooltip: true
2265
- },
2266
- {
2279
+ }
2280
+ ];
2281
+ var DisplayField = () => {
2282
+ const isDisplayNoneFeatureActive = isExperimentActive("e_v_3_30");
2283
+ const items3 = [...displayFieldItems];
2284
+ if (isDisplayNoneFeatureActive) {
2285
+ items3.push({
2286
+ value: "none",
2287
+ renderContent: () => (0, import_i18n14.__)("None", "elementor"),
2288
+ label: (0, import_i18n14.__)("None", "elementor"),
2289
+ showTooltip: true
2290
+ });
2291
+ }
2292
+ items3.push({
2267
2293
  value: "inline-flex",
2268
2294
  renderContent: () => (0, import_i18n14.__)("In-flx", "elementor"),
2269
2295
  label: (0, import_i18n14.__)("Inline-flex", "elementor"),
2270
2296
  showTooltip: true
2271
- }
2272
- ];
2273
- var DisplayField = () => {
2297
+ });
2274
2298
  const placeholder = useDisplayPlaceholderValue();
2275
- return /* @__PURE__ */ React37.createElement(StylesField, { bind: "display", placeholder }, /* @__PURE__ */ React37.createElement(import_ui30.Stack, { gap: 0.75 }, /* @__PURE__ */ React37.createElement(ControlLabel, null, (0, import_i18n14.__)("Display", "elementor")), /* @__PURE__ */ React37.createElement(import_editor_controls17.ToggleControl, { options: displayFieldOptions, fullWidth: true })));
2299
+ return /* @__PURE__ */ React37.createElement(StylesField, { bind: "display", placeholder }, /* @__PURE__ */ React37.createElement(import_ui30.Stack, { gap: 0.75 }, /* @__PURE__ */ React37.createElement(ControlLabel, null, (0, import_i18n14.__)("Display", "elementor")), /* @__PURE__ */ React37.createElement(import_editor_controls17.ToggleControl, { options: items3, maxItems: 4, fullWidth: true })));
2276
2300
  };
2277
2301
  var useDisplayPlaceholderValue = () => useStylesInheritanceField("display")[0]?.value ?? void 0;
2278
2302
 
@@ -2675,7 +2699,7 @@ var PositionSection = () => {
2675
2699
  "inset-inline-end"
2676
2700
  ]);
2677
2701
  const [dimensionsValuesFromHistory, updateDimensionsHistory, clearDimensionsHistory] = usePersistDimensions();
2678
- const { e_css_id: eCssId } = getExperimentsConfig();
2702
+ const isCssIdFeatureActive = isExperimentActive("e_v_3_30");
2679
2703
  const onPositionChange = (newPosition, previousPosition) => {
2680
2704
  if (newPosition === "static") {
2681
2705
  if (dimensionsValues) {
@@ -2695,7 +2719,7 @@ var PositionSection = () => {
2695
2719
  }
2696
2720
  };
2697
2721
  const isNotStatic = positionValue && positionValue?.value !== "static";
2698
- return /* @__PURE__ */ React49.createElement(SectionContent, null, /* @__PURE__ */ React49.createElement(PositionField, { onChange: onPositionChange }), isNotStatic ? /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(DimensionsField, null), /* @__PURE__ */ React49.createElement(ZIndexField, null)) : null, eCssId && /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(PanelDivider, null), /* @__PURE__ */ React49.createElement(OffsetField, null)));
2722
+ return /* @__PURE__ */ React49.createElement(SectionContent, null, /* @__PURE__ */ React49.createElement(PositionField, { onChange: onPositionChange }), isNotStatic ? /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(DimensionsField, null), /* @__PURE__ */ React49.createElement(ZIndexField, null)) : null, isCssIdFeatureActive && /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(PanelDivider, null), /* @__PURE__ */ React49.createElement(OffsetField, null)));
2699
2723
  };
2700
2724
  var usePersistDimensions = () => {
2701
2725
  const { id: styleDefID, meta } = useStyle();
@@ -2815,14 +2839,6 @@ var import_i18n31 = require("@wordpress/i18n");
2815
2839
  // src/components/style-sections/typography-section/hooks/use-font-families.ts
2816
2840
  var import_react22 = require("react");
2817
2841
  var import_i18n30 = require("@wordpress/i18n");
2818
-
2819
- // src/sync/get-elementor-config.ts
2820
- var getElementorConfig = () => {
2821
- const extendedWindow = window;
2822
- return extendedWindow.elementor?.config ?? {};
2823
- };
2824
-
2825
- // src/components/style-sections/typography-section/hooks/use-font-families.ts
2826
2842
  var supportedCategories = {
2827
2843
  system: (0, import_i18n30.__)("System", "elementor"),
2828
2844
  custom: (0, import_i18n30.__)("Custom Fonts", "elementor"),
@@ -2863,7 +2879,7 @@ var FontFamilyField = () => {
2863
2879
  if (fontFamilies.length === 0) {
2864
2880
  return null;
2865
2881
  }
2866
- return /* @__PURE__ */ React54.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React54.createElement(import_ui44.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(ControlLabel, null, (0, import_i18n31.__)("Font family", "elementor"))), /* @__PURE__ */ React54.createElement(import_ui44.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React54.createElement(import_editor_controls32.FontFamilyControl, { fontFamilies }))));
2882
+ return /* @__PURE__ */ React54.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React54.createElement(import_ui44.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(ControlLabel, null, (0, import_i18n31.__)("Font family", "elementor"))), /* @__PURE__ */ React54.createElement(import_ui44.Grid, { item: true, xs: 6, sx: { minWidth: 0 } }, /* @__PURE__ */ React54.createElement(import_editor_controls32.FontFamilyControl, { fontFamilies }))));
2867
2883
  };
2868
2884
 
2869
2885
  // src/components/style-sections/typography-section/font-size-field.tsx