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

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 CHANGED
@@ -4258,7 +4258,7 @@ var directionOptions = [
4258
4258
  ];
4259
4259
  var parseAutoFlow = (value) => {
4260
4260
  if (!value) {
4261
- return { direction: "row", dense: false };
4261
+ return { direction: null, dense: false };
4262
4262
  }
4263
4263
  const dense = value.includes("dense");
4264
4264
  const direction = value.replace(/\s*dense\s*/, "").trim();
@@ -4268,27 +4268,33 @@ var composeAutoFlow = (direction, dense) => {
4268
4268
  return dense ? `${direction} dense` : direction;
4269
4269
  };
4270
4270
  var GridAutoFlowFieldContent = () => {
4271
- const { value, setValue } = useStylesField("grid-auto-flow", {
4271
+ const { value, setValue, canEdit } = useStylesField("grid-auto-flow", {
4272
4272
  history: { propDisplayName: AUTO_FLOW_LABEL }
4273
4273
  });
4274
+ const { placeholder } = (0, import_editor_controls24.useBoundProp)();
4274
4275
  const { direction, dense } = parseAutoFlow(value?.value ?? null);
4276
+ const directionPlaceholder = parseAutoFlow(placeholder?.value ?? null).direction;
4275
4277
  const handleDirectionChange = (newDirection) => {
4276
4278
  if (!newDirection) {
4279
+ setValue(null);
4277
4280
  return;
4278
4281
  }
4279
4282
  setValue({ $$type: "string", value: composeAutoFlow(newDirection, dense) });
4280
4283
  };
4281
4284
  const handleDenseToggle = () => {
4282
- setValue({ $$type: "string", value: composeAutoFlow(direction, !dense) });
4285
+ const nextDirection = direction ?? "row";
4286
+ setValue({ $$type: "string", value: composeAutoFlow(nextDirection, !dense) });
4283
4287
  };
4284
4288
  return /* @__PURE__ */ React53.createElement(StylesFieldLayout, { label: AUTO_FLOW_LABEL }, /* @__PURE__ */ React53.createElement(import_ui30.Grid, { container: true, gap: 1, flexWrap: "nowrap", alignItems: "center", justifyContent: "flex-end" }, /* @__PURE__ */ React53.createElement(import_ui30.Grid, { item: true, sx: { width: 64, maxWidth: "100%" } }, /* @__PURE__ */ React53.createElement(
4285
4289
  import_editor_controls24.ControlToggleButtonGroup,
4286
4290
  {
4287
4291
  items: directionOptions,
4288
4292
  value: direction,
4293
+ placeholder: directionPlaceholder,
4289
4294
  onChange: handleDirectionChange,
4290
4295
  exclusive: true,
4291
- fullWidth: true
4296
+ fullWidth: true,
4297
+ disabled: !canEdit
4292
4298
  }
4293
4299
  )), /* @__PURE__ */ React53.createElement(import_ui30.Grid, { item: true }, /* @__PURE__ */ React53.createElement(import_ui30.Tooltip, { title: DENSE_LABEL, placement: "top" }, /* @__PURE__ */ React53.createElement(
4294
4300
  import_ui30.ToggleButton,
@@ -4297,7 +4303,8 @@ var GridAutoFlowFieldContent = () => {
4297
4303
  selected: dense,
4298
4304
  onChange: handleDenseToggle,
4299
4305
  size: "tiny",
4300
- "aria-label": DENSE_LABEL
4306
+ "aria-label": DENSE_LABEL,
4307
+ disabled: !canEdit
4301
4308
  },
4302
4309
  /* @__PURE__ */ React53.createElement(import_icons14.LayoutDashboardIcon, { fontSize: "tiny" })
4303
4310
  )))));