@elementor/editor-editing-panel 4.3.0-955 → 4.3.0-956

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.mjs CHANGED
@@ -4301,7 +4301,7 @@ var GapControlField = () => {
4301
4301
 
4302
4302
  // src/components/style-sections/layout-section/grid-auto-flow-field.tsx
4303
4303
  import * as React53 from "react";
4304
- import { ControlToggleButtonGroup as ControlToggleButtonGroup3 } from "@elementor/editor-controls";
4304
+ import { ControlToggleButtonGroup as ControlToggleButtonGroup3, useBoundProp as useBoundProp4 } from "@elementor/editor-controls";
4305
4305
  import { ArrowDownSmallIcon as ArrowDownSmallIcon3, ArrowRightIcon as ArrowRightIcon2, LayoutDashboardIcon } from "@elementor/icons";
4306
4306
  import { Grid as Grid3, ToggleButton, Tooltip as Tooltip3, withDirection as withDirection7 } from "@elementor/ui";
4307
4307
  import { __ as __29 } from "@wordpress/i18n";
@@ -4324,7 +4324,7 @@ var directionOptions = [
4324
4324
  ];
4325
4325
  var parseAutoFlow = (value) => {
4326
4326
  if (!value) {
4327
- return { direction: "row", dense: false };
4327
+ return { direction: null, dense: false };
4328
4328
  }
4329
4329
  const dense = value.includes("dense");
4330
4330
  const direction = value.replace(/\s*dense\s*/, "").trim();
@@ -4334,27 +4334,33 @@ var composeAutoFlow = (direction, dense) => {
4334
4334
  return dense ? `${direction} dense` : direction;
4335
4335
  };
4336
4336
  var GridAutoFlowFieldContent = () => {
4337
- const { value, setValue } = useStylesField("grid-auto-flow", {
4337
+ const { value, setValue, canEdit } = useStylesField("grid-auto-flow", {
4338
4338
  history: { propDisplayName: AUTO_FLOW_LABEL }
4339
4339
  });
4340
+ const { placeholder } = useBoundProp4();
4340
4341
  const { direction, dense } = parseAutoFlow(value?.value ?? null);
4342
+ const directionPlaceholder = parseAutoFlow(placeholder?.value ?? null).direction;
4341
4343
  const handleDirectionChange = (newDirection) => {
4342
4344
  if (!newDirection) {
4345
+ setValue(null);
4343
4346
  return;
4344
4347
  }
4345
4348
  setValue({ $$type: "string", value: composeAutoFlow(newDirection, dense) });
4346
4349
  };
4347
4350
  const handleDenseToggle = () => {
4348
- setValue({ $$type: "string", value: composeAutoFlow(direction, !dense) });
4351
+ const nextDirection = direction ?? "row";
4352
+ setValue({ $$type: "string", value: composeAutoFlow(nextDirection, !dense) });
4349
4353
  };
4350
4354
  return /* @__PURE__ */ React53.createElement(StylesFieldLayout, { label: AUTO_FLOW_LABEL }, /* @__PURE__ */ React53.createElement(Grid3, { container: true, gap: 1, flexWrap: "nowrap", alignItems: "center", justifyContent: "flex-end" }, /* @__PURE__ */ React53.createElement(Grid3, { item: true, sx: { width: 64, maxWidth: "100%" } }, /* @__PURE__ */ React53.createElement(
4351
4355
  ControlToggleButtonGroup3,
4352
4356
  {
4353
4357
  items: directionOptions,
4354
4358
  value: direction,
4359
+ placeholder: directionPlaceholder,
4355
4360
  onChange: handleDirectionChange,
4356
4361
  exclusive: true,
4357
- fullWidth: true
4362
+ fullWidth: true,
4363
+ disabled: !canEdit
4358
4364
  }
4359
4365
  )), /* @__PURE__ */ React53.createElement(Grid3, { item: true }, /* @__PURE__ */ React53.createElement(Tooltip3, { title: DENSE_LABEL, placement: "top" }, /* @__PURE__ */ React53.createElement(
4360
4366
  ToggleButton,
@@ -4363,7 +4369,8 @@ var GridAutoFlowFieldContent = () => {
4363
4369
  selected: dense,
4364
4370
  onChange: handleDenseToggle,
4365
4371
  size: "tiny",
4366
- "aria-label": DENSE_LABEL
4372
+ "aria-label": DENSE_LABEL,
4373
+ disabled: !canEdit
4367
4374
  },
4368
4375
  /* @__PURE__ */ React53.createElement(LayoutDashboardIcon, { fontSize: "tiny" })
4369
4376
  )))));
@@ -4470,7 +4477,7 @@ var GridOutlineField = () => {
4470
4477
  // src/components/style-sections/layout-section/grid-size-field.tsx
4471
4478
  import * as React57 from "react";
4472
4479
  import { useRef as useRef9 } from "react";
4473
- import { ControlActions, createControl, SizeComponent, useBoundProp as useBoundProp4 } from "@elementor/editor-controls";
4480
+ import { ControlActions, createControl, SizeComponent, useBoundProp as useBoundProp5 } from "@elementor/editor-controls";
4474
4481
  import { Grid as Grid4 } from "@elementor/ui";
4475
4482
  import { __ as __33 } from "@wordpress/i18n";
4476
4483
 
@@ -4589,7 +4596,7 @@ var GridTrackFieldContent = ({ cssProp, label }) => {
4589
4596
  const { value, setValue } = useStylesField(cssProp, {
4590
4597
  history: { propDisplayName: label }
4591
4598
  });
4592
- const { placeholder: inheritedPlaceholder } = useBoundProp4();
4599
+ const { placeholder: inheritedPlaceholder } = useBoundProp5();
4593
4600
  const anchorRef = useRef9(null);
4594
4601
  const local = parseValue(value);
4595
4602
  const inherited = parseValue(inheritedPlaceholder);
@@ -5769,7 +5776,7 @@ import * as React93 from "react";
5769
5776
  import {
5770
5777
  ControlFormLabel as ControlFormLabel3,
5771
5778
  Repeater,
5772
- useBoundProp as useBoundProp6
5779
+ useBoundProp as useBoundProp7
5773
5780
  } from "@elementor/editor-controls";
5774
5781
  import {
5775
5782
  updateElementEditorSettings,
@@ -5795,7 +5802,7 @@ var getElementByType = (elementId, type) => {
5795
5802
  };
5796
5803
 
5797
5804
  // src/controls-registry/element-controls/tabs-control/use-actions.ts
5798
- import { useBoundProp as useBoundProp5 } from "@elementor/editor-controls";
5805
+ import { useBoundProp as useBoundProp6 } from "@elementor/editor-controls";
5799
5806
  import {
5800
5807
  createElements,
5801
5808
  duplicateElements,
@@ -5808,7 +5815,7 @@ import { __ as __66 } from "@wordpress/i18n";
5808
5815
  var TAB_ELEMENT_TYPE = "e-tab";
5809
5816
  var TAB_CONTENT_ELEMENT_TYPE = "e-tab-content";
5810
5817
  var useActions = () => {
5811
- const { value, setValue: setDefaultActiveTab } = useBoundProp5(numberPropTypeUtil3);
5818
+ const { value, setValue: setDefaultActiveTab } = useBoundProp6(numberPropTypeUtil3);
5812
5819
  const defaultActiveTab = value ?? 0;
5813
5820
  const duplicateItem = ({
5814
5821
  items: items3,
@@ -6069,7 +6076,7 @@ var ItemLabel = ({ value, index }) => {
6069
6076
  return /* @__PURE__ */ React93.createElement(Stack15, { sx: { minHeight: 20 }, direction: "row", alignItems: "center", gap: 1.5 }, /* @__PURE__ */ React93.createElement("span", null, elementTitle), /* @__PURE__ */ React93.createElement(ItemDefaultTab, { index }));
6070
6077
  };
6071
6078
  var ItemDefaultTab = ({ index }) => {
6072
- const { value: defaultItem } = useBoundProp6(numberPropTypeUtil4);
6079
+ const { value: defaultItem } = useBoundProp7(numberPropTypeUtil4);
6073
6080
  const isDefault = defaultItem === index;
6074
6081
  if (!isDefault) {
6075
6082
  return null;
@@ -6083,7 +6090,7 @@ var ItemContent = ({ value, index }) => {
6083
6090
  return /* @__PURE__ */ React93.createElement(Stack15, { p: 2, gap: 1.5 }, /* @__PURE__ */ React93.createElement(TabLabelControl, { elementId: value.id }), /* @__PURE__ */ React93.createElement(SettingsField, { bind: "default-active-tab", propDisplayName: __67("Tabs", "elementor") }, /* @__PURE__ */ React93.createElement(DefaultTabControl, { tabIndex: index })));
6084
6091
  };
6085
6092
  var DefaultTabControl = ({ tabIndex }) => {
6086
- const { value, setValue } = useBoundProp6(numberPropTypeUtil4);
6093
+ const { value, setValue } = useBoundProp7(numberPropTypeUtil4);
6087
6094
  const isDefault = value === tabIndex;
6088
6095
  return /* @__PURE__ */ React93.createElement(Stack15, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 2 }, /* @__PURE__ */ React93.createElement(ControlFormLabel3, null, __67("Set as default tab", "elementor")), /* @__PURE__ */ React93.createElement(ConditionalTooltip, { showTooltip: isDefault, placement: "right" }, /* @__PURE__ */ React93.createElement(
6089
6096
  Switch,
@@ -6166,7 +6173,7 @@ import { controlActionsMenu as controlActionsMenu2 } from "@elementor/menus";
6166
6173
 
6167
6174
  // src/dynamics/components/background-control-dynamic-tag.tsx
6168
6175
  import * as React94 from "react";
6169
- import { PropKeyProvider as PropKeyProvider4, PropProvider as PropProvider4, useBoundProp as useBoundProp8 } from "@elementor/editor-controls";
6176
+ import { PropKeyProvider as PropKeyProvider4, PropProvider as PropProvider4, useBoundProp as useBoundProp9 } from "@elementor/editor-controls";
6170
6177
  import {
6171
6178
  backgroundImageOverlayPropTypeUtil
6172
6179
  } from "@elementor/editor-props";
@@ -6177,7 +6184,7 @@ import { useMemo as useMemo12 } from "react";
6177
6184
 
6178
6185
  // src/dynamics/hooks/use-prop-dynamic-tags.ts
6179
6186
  import { useMemo as useMemo11 } from "react";
6180
- import { useBoundProp as useBoundProp7 } from "@elementor/editor-controls";
6187
+ import { useBoundProp as useBoundProp8 } from "@elementor/editor-controls";
6181
6188
 
6182
6189
  // src/dynamics/sync/get-atomic-dynamic-tags.ts
6183
6190
  import { getElementorConfig } from "@elementor/editor-v1-adapters";
@@ -6264,7 +6271,7 @@ var useAllPropDynamicTags = () => {
6264
6271
  };
6265
6272
  var usePropDynamicTagsInternal = (filterByLicense2) => {
6266
6273
  let categories = [];
6267
- const { propType } = useBoundProp7();
6274
+ const { propType } = useBoundProp8();
6268
6275
  if (propType) {
6269
6276
  const propDynamicType = getDynamicPropType(propType);
6270
6277
  categories = propDynamicType?.settings.categories || [];
@@ -6310,11 +6317,11 @@ var useDynamicTag = (tagName) => {
6310
6317
  // src/dynamics/components/background-control-dynamic-tag.tsx
6311
6318
  var BackgroundControlDynamicTagIcon = () => /* @__PURE__ */ React94.createElement(DatabaseIcon, { fontSize: "tiny" });
6312
6319
  var BackgroundControlDynamicTagLabel = ({ value }) => {
6313
- const context = useBoundProp8(backgroundImageOverlayPropTypeUtil);
6320
+ const context = useBoundProp9(backgroundImageOverlayPropTypeUtil);
6314
6321
  return /* @__PURE__ */ React94.createElement(PropProvider4, { ...context, value: value.value }, /* @__PURE__ */ React94.createElement(PropKeyProvider4, { bind: "image" }, /* @__PURE__ */ React94.createElement(Wrapper2, { rawValue: value.value })));
6315
6322
  };
6316
6323
  var Wrapper2 = ({ rawValue }) => {
6317
- const { propType } = useBoundProp8();
6324
+ const { propType } = useBoundProp9();
6318
6325
  const imageOverlayPropType = propType.prop_types["background-image-overlay"];
6319
6326
  return /* @__PURE__ */ React94.createElement(PropProvider4, { propType: imageOverlayPropType.shape.image, value: rawValue, setValue: () => void 0 }, /* @__PURE__ */ React94.createElement(PropKeyProvider4, { bind: "src" }, /* @__PURE__ */ React94.createElement(Content, { rawValue: rawValue.image })));
6320
6327
  };
@@ -6330,7 +6337,7 @@ import {
6330
6337
  ControlFormLabel as ControlFormLabel4,
6331
6338
  PropKeyProvider as PropKeyProvider6,
6332
6339
  PropProvider as PropProvider6,
6333
- useBoundProp as useBoundProp11
6340
+ useBoundProp as useBoundProp12
6334
6341
  } from "@elementor/editor-controls";
6335
6342
  import { PopoverHeader as PopoverHeader2, SectionPopoverBody as SectionPopoverBody2 } from "@elementor/editor-ui";
6336
6343
  import { DatabaseIcon as DatabaseIcon3, SettingsIcon, XIcon } from "@elementor/icons";
@@ -6362,7 +6369,7 @@ var usePersistDynamicValue = (propKey) => {
6362
6369
 
6363
6370
  // src/dynamics/dynamic-control.tsx
6364
6371
  import * as React96 from "react";
6365
- import { PropKeyProvider as PropKeyProvider5, PropProvider as PropProvider5, useBoundProp as useBoundProp9 } from "@elementor/editor-controls";
6372
+ import { PropKeyProvider as PropKeyProvider5, PropProvider as PropProvider5, useBoundProp as useBoundProp10 } from "@elementor/editor-controls";
6366
6373
 
6367
6374
  // src/dynamics/components/dynamic-conditional-control.tsx
6368
6375
  import * as React95 from "react";
@@ -6415,7 +6422,7 @@ var DynamicConditionalControl = ({
6415
6422
 
6416
6423
  // src/dynamics/dynamic-control.tsx
6417
6424
  var DynamicControl = ({ bind, children }) => {
6418
- const { value, setValue } = useBoundProp9(dynamicPropTypeUtil);
6425
+ const { value, setValue } = useBoundProp10(dynamicPropTypeUtil);
6419
6426
  const { name = "", group = "", settings } = value ?? {};
6420
6427
  const dynamicTag = useDynamicTag(name);
6421
6428
  if (!dynamicTag) {
@@ -6449,7 +6456,7 @@ var DynamicControl = ({ bind, children }) => {
6449
6456
  // src/dynamics/components/dynamic-selection.tsx
6450
6457
  import * as React97 from "react";
6451
6458
  import { Fragment as Fragment14, useEffect as useEffect9, useState as useState10 } from "react";
6452
- import { trackUpgradePromotionClick, trackViewPromotion, useBoundProp as useBoundProp10 } from "@elementor/editor-controls";
6459
+ import { trackUpgradePromotionClick, trackViewPromotion, useBoundProp as useBoundProp11 } from "@elementor/editor-controls";
6453
6460
  import { CtaButton, PopoverHeader, PopoverMenuList, SearchField, SectionPopoverBody } from "@elementor/editor-ui";
6454
6461
  import { DatabaseIcon as DatabaseIcon2 } from "@elementor/icons";
6455
6462
  import { Divider as Divider7, Link as Link2, Stack as Stack16, Typography as Typography6, useTheme as useTheme3 } from "@elementor/ui";
@@ -6462,8 +6469,8 @@ var DynamicSelection = ({ close: closePopover, expired = false }) => {
6462
6469
  const [searchValue, setSearchValue] = useState10("");
6463
6470
  const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
6464
6471
  const theme = useTheme3();
6465
- const { value: anyValue } = useBoundProp10();
6466
- const { bind, value: dynamicValue, setValue } = useBoundProp10(dynamicPropTypeUtil);
6472
+ const { value: anyValue } = useBoundProp11();
6473
+ const { bind, value: dynamicValue, setValue } = useBoundProp11(dynamicPropTypeUtil);
6467
6474
  const [, updatePropValueHistory] = usePersistDynamicValue(bind);
6468
6475
  const isCurrentValueDynamic = !!dynamicValue;
6469
6476
  const options13 = useFilteredOptions(searchValue);
@@ -6615,8 +6622,8 @@ var useFilteredOptions = (searchValue) => {
6615
6622
  var SIZE3 = "tiny";
6616
6623
  var tagsWithoutTabs = ["popup"];
6617
6624
  var DynamicSelectionControl = ({ OriginalControl, ...props }) => {
6618
- const { setValue: setAnyValue, propType } = useBoundProp11();
6619
- const { bind, value } = useBoundProp11(dynamicPropTypeUtil);
6625
+ const { setValue: setAnyValue, propType } = useBoundProp12();
6626
+ const { bind, value } = useBoundProp12(dynamicPropTypeUtil);
6620
6627
  const { expired: readonly } = useLicenseConfig();
6621
6628
  const originalPropType = createTopLevelObjectType({
6622
6629
  schema: {
@@ -6839,11 +6846,11 @@ function getDynamicValue(name, settings, renderPostId) {
6839
6846
 
6840
6847
  // src/dynamics/hooks/use-prop-dynamic-action.tsx
6841
6848
  import * as React99 from "react";
6842
- import { useBoundProp as useBoundProp12 } from "@elementor/editor-controls";
6849
+ import { useBoundProp as useBoundProp13 } from "@elementor/editor-controls";
6843
6850
  import { DatabaseIcon as DatabaseIcon4 } from "@elementor/icons";
6844
6851
  import { __ as __70 } from "@wordpress/i18n";
6845
6852
  var usePropDynamicAction = () => {
6846
- const { propType } = useBoundProp12();
6853
+ const { propType } = useBoundProp13();
6847
6854
  const visible = !!propType && supportsDynamic(propType);
6848
6855
  return {
6849
6856
  visible,
@@ -6880,7 +6887,7 @@ var init2 = () => {
6880
6887
  };
6881
6888
 
6882
6889
  // src/reset-style-props.tsx
6883
- import { useBoundProp as useBoundProp13 } from "@elementor/editor-controls";
6890
+ import { useBoundProp as useBoundProp14 } from "@elementor/editor-controls";
6884
6891
  import { hasVariable as hasVariable2 } from "@elementor/editor-variables";
6885
6892
  import { BrushBigIcon } from "@elementor/icons";
6886
6893
  import { controlActionsMenu as controlActionsMenu3 } from "@elementor/menus";
@@ -6940,7 +6947,7 @@ function initResetStyleProps() {
6940
6947
  }
6941
6948
  function useResetStyleValueProps() {
6942
6949
  const isStyle = useIsStyle();
6943
- const { value, resetValue, propType } = useBoundProp13();
6950
+ const { value, resetValue, propType } = useBoundProp14();
6944
6951
  const hasValue = value !== null && value !== void 0;
6945
6952
  const hasInitial = propType.initial_value !== void 0 && propType.initial_value !== null;
6946
6953
  const isRequired = !!propType.settings?.required;
@@ -6968,7 +6975,7 @@ function useResetStyleValueProps() {
6968
6975
 
6969
6976
  // src/styles-inheritance/components/styles-inheritance-indicator.tsx
6970
6977
  import * as React105 from "react";
6971
- import { useBoundProp as useBoundProp14 } from "@elementor/editor-controls";
6978
+ import { useBoundProp as useBoundProp15 } from "@elementor/editor-controls";
6972
6979
  import { isEmpty as isEmpty3 } from "@elementor/editor-props";
6973
6980
  import { ELEMENTS_BASE_STYLES_PROVIDER_KEY as ELEMENTS_BASE_STYLES_PROVIDER_KEY4 } from "@elementor/editor-styles-repository";
6974
6981
  import { __ as __75 } from "@wordpress/i18n";
@@ -7334,7 +7341,7 @@ function TooltipOrInfotip({
7334
7341
  var StylesInheritanceIndicator = ({
7335
7342
  customContext
7336
7343
  }) => {
7337
- const context = useBoundProp14();
7344
+ const context = useBoundProp15();
7338
7345
  const { path, propType } = customContext || context;
7339
7346
  const inheritanceChain = useStylesInheritanceChain(path);
7340
7347
  if (!path || !inheritanceChain.length) {