@elementor/editor-editing-panel 0.12.0 → 0.13.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.mjs CHANGED
@@ -2,8 +2,8 @@
2
2
  import { __createPanel as createPanel } from "@elementor/editor-panels";
3
3
 
4
4
  // src/components/editing-panel.tsx
5
- import * as React15 from "react";
6
- import { __ as __4 } from "@wordpress/i18n";
5
+ import * as React18 from "react";
6
+ import { __ as __6 } from "@wordpress/i18n";
7
7
 
8
8
  // src/hooks/use-selected-elements.ts
9
9
  import { __privateUseListenTo as useListenTo, commandEndEvent } from "@elementor/editor-v1-adapters";
@@ -83,16 +83,16 @@ function useElementContext() {
83
83
  }
84
84
 
85
85
  // src/components/editing-panel-tabs.tsx
86
- import { Stack as Stack7, Tabs, Tab, TabPanel, useTabs } from "@elementor/ui";
87
- import * as React14 from "react";
88
- import { __ as __3 } from "@wordpress/i18n";
86
+ import { Stack as Stack9, Tabs, Tab, TabPanel, useTabs } from "@elementor/ui";
87
+ import * as React17 from "react";
88
+ import { __ as __5 } from "@wordpress/i18n";
89
89
 
90
90
  // src/components/settings-tab.tsx
91
- import * as React8 from "react";
91
+ import * as React9 from "react";
92
92
  import { Stack as Stack3 } from "@elementor/ui";
93
93
 
94
94
  // src/controls/settings-control.tsx
95
- import * as React2 from "react";
95
+ import * as React3 from "react";
96
96
 
97
97
  // src/controls/control-context.tsx
98
98
  import { createContext as createContext2, useContext as useContext2 } from "react";
@@ -106,7 +106,7 @@ function useControl(defaultValue) {
106
106
  }
107
107
 
108
108
  // src/controls/settings-control.tsx
109
- import { Stack, styled, Typography } from "@elementor/ui";
109
+ import { Stack, styled } from "@elementor/ui";
110
110
 
111
111
  // src/hooks/use-widget-settings.ts
112
112
  import { commandEndEvent as commandEndEvent3, __privateUseListenTo as useListenTo3 } from "@elementor/editor-v1-adapters";
@@ -143,6 +143,13 @@ var updateSettings = ({ id, props }) => {
143
143
  });
144
144
  };
145
145
 
146
+ // src/components/control-label.tsx
147
+ import * as React2 from "react";
148
+ import { Typography } from "@elementor/ui";
149
+ var ControlLabel = ({ children }) => {
150
+ return /* @__PURE__ */ React2.createElement(Typography, { component: "label", variant: "caption", color: "text.secondary" }, children);
151
+ };
152
+
146
153
  // src/controls/settings-control.tsx
147
154
  var SettingsControlProvider = ({ bind, children }) => {
148
155
  const { element } = useElementContext();
@@ -155,9 +162,9 @@ var SettingsControlProvider = ({ bind, children }) => {
155
162
  }
156
163
  });
157
164
  };
158
- return /* @__PURE__ */ React2.createElement(ControlContext.Provider, { value: { setValue, value, bind } }, children);
165
+ return /* @__PURE__ */ React3.createElement(ControlContext.Provider, { value: { setValue, value, bind } }, children);
159
166
  };
160
- var SettingsControl = ({ children, bind }) => /* @__PURE__ */ React2.createElement(SettingsControlProvider, { bind }, /* @__PURE__ */ React2.createElement(StyledStack, { gap: 1, direction: "row", alignItems: "center", justifyContent: "space-between", flexWrap: "wrap" }, children));
167
+ var SettingsControl = ({ children, bind }) => /* @__PURE__ */ React3.createElement(SettingsControlProvider, { bind }, /* @__PURE__ */ React3.createElement(StyledStack, { gap: 1, direction: "row", alignItems: "center", justifyContent: "space-between", flexWrap: "wrap" }, children));
161
168
  var StyledStack = styled(Stack)`
162
169
  & > * {
163
170
  flex-grow: 1;
@@ -167,42 +174,39 @@ var StyledStack = styled(Stack)`
167
174
  min-width: 50%;
168
175
  }
169
176
  `;
170
- var Label = ({ children }) => {
171
- return /* @__PURE__ */ React2.createElement(Typography, { component: "label", variant: "caption", color: "text.secondary" }, children);
172
- };
173
- SettingsControl.Label = Label;
177
+ SettingsControl.Label = ControlLabel;
174
178
 
175
179
  // src/components/collapsible-section.tsx
176
- import * as React3 from "react";
180
+ import * as React4 from "react";
177
181
  import { useId } from "react";
178
182
  import { Accordion, AccordionSummary, AccordionDetails, AccordionSummaryText, Stack as Stack2 } from "@elementor/ui";
179
183
  var CollapsibleSection = ({ title, children }) => {
180
184
  const uid = useId();
181
185
  const labelId = `label-${uid}`;
182
186
  const contentId = `content-${uid}`;
183
- return /* @__PURE__ */ React3.createElement(Accordion, { disableGutters: true, defaultExpanded: true }, /* @__PURE__ */ React3.createElement(AccordionSummary, { "aria-controls": contentId, id: labelId }, /* @__PURE__ */ React3.createElement(AccordionSummaryText, { primaryTypographyProps: { variant: "caption" } }, title)), /* @__PURE__ */ React3.createElement(AccordionDetails, { id: contentId, "aria-labelledby": labelId }, /* @__PURE__ */ React3.createElement(Stack2, { gap: 2.5 }, children)));
187
+ return /* @__PURE__ */ React4.createElement(Accordion, { disableGutters: true, defaultExpanded: true }, /* @__PURE__ */ React4.createElement(AccordionSummary, { "aria-controls": contentId, id: labelId }, /* @__PURE__ */ React4.createElement(AccordionSummaryText, { primaryTypographyProps: { variant: "caption" } }, title)), /* @__PURE__ */ React4.createElement(AccordionDetails, { id: contentId, "aria-labelledby": labelId }, /* @__PURE__ */ React4.createElement(Stack2, { gap: 2.5 }, children)));
184
188
  };
185
189
 
186
190
  // src/controls/control-types/select-control.tsx
187
- import * as React4 from "react";
191
+ import * as React5 from "react";
188
192
  import { MenuItem, Select } from "@elementor/ui";
189
193
  var SelectControl = ({ options }) => {
190
194
  const { value, setValue } = useControl();
191
195
  const handleChange = (event) => {
192
196
  setValue(event.target.value);
193
197
  };
194
- return /* @__PURE__ */ React4.createElement(Select, { size: "tiny", value: value ?? "", onChange: handleChange }, options.map(({ label, ...props }) => /* @__PURE__ */ React4.createElement(MenuItem, { key: props.value, ...props }, label)));
198
+ return /* @__PURE__ */ React5.createElement(Select, { size: "tiny", value: value ?? "", onChange: handleChange }, options.map(({ label, ...props }) => /* @__PURE__ */ React5.createElement(MenuItem, { key: props.value, ...props }, label)));
195
199
  };
196
200
 
197
201
  // src/controls/control-types/text-area-control.tsx
198
- import * as React5 from "react";
202
+ import * as React6 from "react";
199
203
  import { TextField } from "@elementor/ui";
200
204
  var TextAreaControl = ({ placeholder }) => {
201
205
  const { value, setValue } = useControl("");
202
206
  const handleChange = (event) => {
203
207
  setValue(event.target.value);
204
208
  };
205
- return /* @__PURE__ */ React5.createElement(
209
+ return /* @__PURE__ */ React6.createElement(
206
210
  TextField,
207
211
  {
208
212
  size: "tiny",
@@ -217,16 +221,16 @@ var TextAreaControl = ({ placeholder }) => {
217
221
  };
218
222
 
219
223
  // src/controls/control-types/text-control.tsx
220
- import * as React6 from "react";
224
+ import * as React7 from "react";
221
225
  import { TextField as TextField2 } from "@elementor/ui";
222
226
  var TextControl = ({ placeholder }) => {
223
227
  const { value, setValue } = useControl("");
224
228
  const handleChange = (event) => setValue(event.target.value);
225
- return /* @__PURE__ */ React6.createElement(TextField2, { type: "text", size: "tiny", value, onChange: handleChange, placeholder });
229
+ return /* @__PURE__ */ React7.createElement(TextField2, { type: "text", size: "tiny", value, onChange: handleChange, placeholder });
226
230
  };
227
231
 
228
232
  // src/controls/control-types/image-control.tsx
229
- import * as React7 from "react";
233
+ import * as React8 from "react";
230
234
  import { Button, Card, CardMedia, CardOverlay } from "@elementor/ui";
231
235
  import { UploadIcon } from "@elementor/icons";
232
236
  import { __ } from "@wordpress/i18n";
@@ -259,7 +263,7 @@ var ImageControl = () => {
259
263
  });
260
264
  }
261
265
  });
262
- return /* @__PURE__ */ React7.createElement(Card, { variant: "outlined" }, /* @__PURE__ */ React7.createElement(CardMedia, { image: getImageSrc(), sx: { height: 150 } }), /* @__PURE__ */ React7.createElement(CardOverlay, null, /* @__PURE__ */ React7.createElement(
266
+ return /* @__PURE__ */ React8.createElement(Card, { variant: "outlined" }, /* @__PURE__ */ React8.createElement(CardMedia, { image: getImageSrc(), sx: { height: 150 } }), /* @__PURE__ */ React8.createElement(CardOverlay, null, /* @__PURE__ */ React8.createElement(
263
267
  Button,
264
268
  {
265
269
  color: "inherit",
@@ -270,13 +274,13 @@ var ImageControl = () => {
270
274
  }
271
275
  },
272
276
  __("Select Image", "elementor")
273
- ), /* @__PURE__ */ React7.createElement(
277
+ ), /* @__PURE__ */ React8.createElement(
274
278
  Button,
275
279
  {
276
280
  color: "inherit",
277
281
  size: "small",
278
282
  variant: "text",
279
- startIcon: /* @__PURE__ */ React7.createElement(UploadIcon, null),
283
+ startIcon: /* @__PURE__ */ React8.createElement(UploadIcon, null),
280
284
  onClick: () => {
281
285
  open({ mode: "upload" });
282
286
  }
@@ -303,14 +307,14 @@ var SettingsTab = () => {
303
307
  if (!elementType) {
304
308
  return null;
305
309
  }
306
- return /* @__PURE__ */ React8.createElement(Stack3, null, elementType.controls.map(({ type, value }, index) => {
310
+ return /* @__PURE__ */ React9.createElement(Stack3, null, elementType.controls.map(({ type, value }, index) => {
307
311
  if (type === "control") {
308
- return /* @__PURE__ */ React8.createElement(Control, { key: value.bind, control: value });
312
+ return /* @__PURE__ */ React9.createElement(Control, { key: value.bind, control: value });
309
313
  }
310
314
  if (type === "section") {
311
- return /* @__PURE__ */ React8.createElement(CollapsibleSection, { key: type + "." + index, title: value.label }, value.items?.map((item) => {
315
+ return /* @__PURE__ */ React9.createElement(CollapsibleSection, { key: type + "." + index, title: value.label }, value.items?.map((item) => {
312
316
  if (item.type === "control") {
313
- return /* @__PURE__ */ React8.createElement(Control, { key: item.value.bind, control: item.value });
317
+ return /* @__PURE__ */ React9.createElement(Control, { key: item.value.bind, control: item.value });
314
318
  }
315
319
  return null;
316
320
  }));
@@ -323,7 +327,7 @@ var Control = ({ control }) => {
323
327
  if (!ControlComponent) {
324
328
  return null;
325
329
  }
326
- return /* @__PURE__ */ React8.createElement(SettingsControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React8.createElement(SettingsControl.Label, null, control.label) : null, /* @__PURE__ */ React8.createElement(
330
+ return /* @__PURE__ */ React9.createElement(SettingsControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React9.createElement(SettingsControl.Label, null, control.label) : null, /* @__PURE__ */ React9.createElement(
327
331
  ControlComponent,
328
332
  {
329
333
  ...control.props
@@ -332,17 +336,17 @@ var Control = ({ control }) => {
332
336
  };
333
337
 
334
338
  // src/components/style-tab.tsx
335
- import * as React13 from "react";
339
+ import * as React16 from "react";
336
340
 
337
341
  // src/contexts/style-context.tsx
338
- import * as React9 from "react";
342
+ import * as React10 from "react";
339
343
  import { createContext as createContext3, useContext as useContext3 } from "react";
340
344
  import { useActiveBreakpoint } from "@elementor/editor-responsive";
341
345
  var Context2 = createContext3(null);
342
346
  function StyleContext({ children, selectedStyleDef }) {
343
347
  const breakpoint = useActiveBreakpoint();
344
348
  const selectedMeta = { breakpoint, state: null };
345
- return /* @__PURE__ */ React9.createElement(Context2.Provider, { value: { selectedStyleDef, selectedMeta } }, children);
349
+ return /* @__PURE__ */ React10.createElement(Context2.Provider, { value: { selectedStyleDef, selectedMeta } }, children);
346
350
  }
347
351
  function useStyleContext() {
348
352
  const context = useContext3(Context2);
@@ -373,26 +377,13 @@ var useElementStyles = (elementID) => {
373
377
  };
374
378
 
375
379
  // src/components/style-tab.tsx
376
- import { Stack as Stack6 } from "@elementor/ui";
380
+ import { Stack as Stack8 } from "@elementor/ui";
377
381
 
378
382
  // src/components/style-sections/size-section.tsx
379
- import * as React12 from "react";
383
+ import * as React13 from "react";
380
384
 
381
385
  // src/controls/style-control.tsx
382
- import * as React10 from "react";
383
-
384
- // src/sync/update-style.ts
385
- import { __privateRunCommand as runCommand2 } from "@elementor/editor-v1-adapters";
386
- var updateStyle = ({ elementID, styleDefID, meta, props, bind = "classes" }) => {
387
- const container = getContainer(elementID);
388
- runCommand2("document/atomic-widgets/styles", {
389
- container,
390
- styleDefID,
391
- bind,
392
- meta,
393
- props
394
- });
395
- };
386
+ import * as React11 from "react";
396
387
 
397
388
  // src/hooks/use-element-style-prop.ts
398
389
  import { commandEndEvent as commandEndEvent5, __privateUseListenTo as useListenTo5 } from "@elementor/editor-v1-adapters";
@@ -424,34 +415,49 @@ function getVariantByMeta(styleDef, meta) {
424
415
  });
425
416
  }
426
417
 
427
- // src/controls/style-control.tsx
428
- import { Typography as Typography2 } from "@elementor/ui";
429
- var StyleControl = ({ bind, children }) => {
418
+ // src/sync/update-style.ts
419
+ import { __privateRunCommand as runCommand2 } from "@elementor/editor-v1-adapters";
420
+ var updateStyle = ({ elementID, styleDefID, meta, props, bind = "classes" }) => {
421
+ const container = getContainer(elementID);
422
+ runCommand2("document/atomic-widgets/styles", {
423
+ container,
424
+ styleDefID,
425
+ bind,
426
+ meta,
427
+ props
428
+ });
429
+ };
430
+
431
+ // src/controls/hooks/use-style-control.ts
432
+ var useStyleControl = (propName) => {
430
433
  const { element } = useElementContext();
431
434
  const { selectedStyleDef, selectedMeta } = useStyleContext();
435
+ const value = useElementStyleProp({
436
+ elementID: element.id,
437
+ styleDefID: selectedStyleDef?.id,
438
+ meta: selectedMeta,
439
+ propName
440
+ });
432
441
  const setValue = (newValue) => {
433
442
  updateStyle({
434
443
  elementID: element.id,
435
444
  styleDefID: selectedStyleDef?.id,
436
- props: { [bind]: newValue },
445
+ props: { [propName]: newValue },
437
446
  meta: selectedMeta
438
447
  });
439
448
  };
440
- const value = useElementStyleProp({
441
- elementID: element.id,
442
- styleDefID: selectedStyleDef?.id,
443
- meta: selectedMeta,
444
- propName: bind
445
- });
446
- return /* @__PURE__ */ React10.createElement(ControlContext.Provider, { value: { bind, value, setValue } }, children);
449
+ return [value, setValue];
447
450
  };
448
- var Label2 = ({ children }) => {
449
- return /* @__PURE__ */ React10.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary" }, children);
451
+
452
+ // src/controls/style-control.tsx
453
+ var StyleControl = ({ bind, children }) => {
454
+ const [value, setValue] = useStyleControl(bind);
455
+ return /* @__PURE__ */ React11.createElement(ControlContext.Provider, { value: { bind, value, setValue } }, children);
450
456
  };
451
- StyleControl.Label = Label2;
457
+ StyleControl.Label = ControlLabel;
452
458
 
453
459
  // src/controls/control-types/size-control.tsx
454
- import * as React11 from "react";
460
+ import * as React12 from "react";
455
461
  import { MenuItem as MenuItem2, Select as Select2, Stack as Stack4, TextField as TextField3 } from "@elementor/ui";
456
462
 
457
463
  // src/controls/hooks/use-sync-external-state.tsx
@@ -519,7 +525,7 @@ var SizeControl = ({ units: units2, placeholder }) => {
519
525
  }
520
526
  }));
521
527
  };
522
- return /* @__PURE__ */ React11.createElement(Stack4, { direction: "row" }, /* @__PURE__ */ React11.createElement(
528
+ return /* @__PURE__ */ React12.createElement(Stack4, { direction: "row" }, /* @__PURE__ */ React12.createElement(
523
529
  TextField3,
524
530
  {
525
531
  size: "tiny",
@@ -528,7 +534,7 @@ var SizeControl = ({ units: units2, placeholder }) => {
528
534
  onChange: handleSizeChange,
529
535
  placeholder
530
536
  }
531
- ), /* @__PURE__ */ React11.createElement(
537
+ ), /* @__PURE__ */ React12.createElement(
532
538
  Select2,
533
539
  {
534
540
  size: "tiny",
@@ -539,7 +545,7 @@ var SizeControl = ({ units: units2, placeholder }) => {
539
545
  transformOrigin: { vertical: "top", horizontal: "right" }
540
546
  }
541
547
  },
542
- units2.map((unit) => /* @__PURE__ */ React11.createElement(MenuItem2, { key: unit, value: unit }, unit.toUpperCase()))
548
+ units2.map((unit) => /* @__PURE__ */ React12.createElement(MenuItem2, { key: unit, value: unit }, unit.toUpperCase()))
543
549
  ));
544
550
  };
545
551
 
@@ -547,11 +553,82 @@ var SizeControl = ({ units: units2, placeholder }) => {
547
553
  import { Stack as Stack5 } from "@elementor/ui";
548
554
  import { __ as __2 } from "@wordpress/i18n";
549
555
  var SizeSection = () => {
550
- return /* @__PURE__ */ React12.createElement(CollapsibleSection, { title: __2("Size", "elementor") }, /* @__PURE__ */ React12.createElement(Stack5, { gap: 1.5 }, /* @__PURE__ */ React12.createElement(Stack5, { direction: "row", gap: 2 }, /* @__PURE__ */ React12.createElement(Control2, { bind: "width", label: __2("Width", "elementor") }), /* @__PURE__ */ React12.createElement(Control2, { bind: "height", label: __2("Height", "elementor") })), /* @__PURE__ */ React12.createElement(Stack5, { direction: "row", gap: 2 }, /* @__PURE__ */ React12.createElement(Control2, { bind: "min-width", label: __2("Min. Width", "elementor") }), /* @__PURE__ */ React12.createElement(Control2, { bind: "min-height", label: __2("Min. Height", "elementor") })), /* @__PURE__ */ React12.createElement(Stack5, { direction: "row", gap: 2 }, /* @__PURE__ */ React12.createElement(Control2, { bind: "max-width", label: __2("Max. Width", "elementor") }), /* @__PURE__ */ React12.createElement(Control2, { bind: "max-height", label: __2("Max. Height", "elementor") }))));
556
+ return /* @__PURE__ */ React13.createElement(CollapsibleSection, { title: __2("Size", "elementor") }, /* @__PURE__ */ React13.createElement(Stack5, { gap: 1.5 }, /* @__PURE__ */ React13.createElement(Stack5, { direction: "row", gap: 2 }, /* @__PURE__ */ React13.createElement(Control2, { bind: "width", label: __2("Width", "elementor") }), /* @__PURE__ */ React13.createElement(Control2, { bind: "height", label: __2("Height", "elementor") })), /* @__PURE__ */ React13.createElement(Stack5, { direction: "row", gap: 2 }, /* @__PURE__ */ React13.createElement(Control2, { bind: "minWidth", label: __2("Min. Width", "elementor") }), /* @__PURE__ */ React13.createElement(Control2, { bind: "minHeight", label: __2("Min. Height", "elementor") })), /* @__PURE__ */ React13.createElement(Stack5, { direction: "row", gap: 2 }, /* @__PURE__ */ React13.createElement(Control2, { bind: "maxWidth", label: __2("Max. Width", "elementor") }), /* @__PURE__ */ React13.createElement(Control2, { bind: "maxHeight", label: __2("Max. Height", "elementor") }))));
551
557
  };
552
558
  var units = ["px", "%", "em", "rem", "vw"];
553
559
  var Control2 = ({ label, bind }) => {
554
- return /* @__PURE__ */ React12.createElement(StyleControl, { bind }, /* @__PURE__ */ React12.createElement(Stack5, { gap: 1, sx: { flex: "0 1 50%" } }, /* @__PURE__ */ React12.createElement(StyleControl.Label, null, label), /* @__PURE__ */ React12.createElement(SizeControl, { units })));
560
+ return /* @__PURE__ */ React13.createElement(StyleControl, { bind }, /* @__PURE__ */ React13.createElement(Stack5, { gap: 1, sx: { flex: "0 1 50%" } }, /* @__PURE__ */ React13.createElement(StyleControl.Label, null, label), /* @__PURE__ */ React13.createElement(SizeControl, { units })));
561
+ };
562
+
563
+ // src/components/style-sections/typography-section.tsx
564
+ import * as React15 from "react";
565
+ import { Stack as Stack7 } from "@elementor/ui";
566
+
567
+ // src/controls/control-types/text-style-control.tsx
568
+ import * as React14 from "react";
569
+ import { Stack as Stack6, ToggleButton as ToggleButtonBase, ToggleButtonGroup } from "@elementor/ui";
570
+ import { __ as __3 } from "@wordpress/i18n";
571
+ var TextStyleControl = () => {
572
+ const [fontStyle, setFontStyle] = useStyleControl("fontStyle");
573
+ const [textDecoration, setTextDecoration] = useStyleControl("textDecoration");
574
+ const formats = [fontStyle, ...(textDecoration || "").split(" ")];
575
+ return /* @__PURE__ */ React14.createElement(Stack6, { direction: "row", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React14.createElement(ControlLabel, null, __3("Style", "elementor")), /* @__PURE__ */ React14.createElement(ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React14.createElement(
576
+ ToggleButton,
577
+ {
578
+ value: "italic",
579
+ onChange: (v) => setFontStyle(fontStyle === v ? null : v),
580
+ "aria-label": "italic"
581
+ },
582
+ /* @__PURE__ */ React14.createElement("span", { style: { fontStyle: "italic", fontSize: "12px" } }, "I")
583
+ ), /* @__PURE__ */ React14.createElement(
584
+ ShorthandControl,
585
+ {
586
+ value: "line-through",
587
+ currentValues: textDecoration || "",
588
+ updateValues: setTextDecoration,
589
+ "aria-label": "line-through"
590
+ },
591
+ /* @__PURE__ */ React14.createElement("span", { style: { textDecoration: "line-through", fontSize: "12px" } }, "S")
592
+ ), /* @__PURE__ */ React14.createElement(
593
+ ShorthandControl,
594
+ {
595
+ value: "underline",
596
+ currentValues: textDecoration || "",
597
+ updateValues: setTextDecoration,
598
+ "aria-label": "underline"
599
+ },
600
+ /* @__PURE__ */ React14.createElement("span", { style: { textDecoration: "underline", fontSize: "12px" } }, "U")
601
+ )));
602
+ };
603
+ var ShorthandControl = ({
604
+ children,
605
+ value,
606
+ currentValues,
607
+ updateValues,
608
+ "aria-label": ariaLabel
609
+ }) => {
610
+ const valuesArr = currentValues.split(" ").filter(Boolean);
611
+ const selected = valuesArr.includes(value);
612
+ const toggleValue = (newValue) => {
613
+ if (selected) {
614
+ updateValues(valuesArr.filter((v) => v !== newValue).join(" ") || null);
615
+ } else {
616
+ updateValues([...valuesArr, newValue].join(" "));
617
+ }
618
+ };
619
+ return /* @__PURE__ */ React14.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
620
+ };
621
+ var ToggleButton = ({ onChange, ...props }) => {
622
+ const handleChange = (_e, newValue) => {
623
+ onChange(newValue);
624
+ };
625
+ return /* @__PURE__ */ React14.createElement(ToggleButtonBase, { ...props, onChange: handleChange, size: "tiny", sx: { px: 1.5 } });
626
+ };
627
+
628
+ // src/components/style-sections/typography-section.tsx
629
+ import { __ as __4 } from "@wordpress/i18n";
630
+ var TypographySection = () => {
631
+ return /* @__PURE__ */ React15.createElement(CollapsibleSection, { title: __4("Typography", "elementor") }, /* @__PURE__ */ React15.createElement(Stack7, { gap: 1.5 }, /* @__PURE__ */ React15.createElement(TextStyleControl, null)));
555
632
  };
556
633
 
557
634
  // src/components/style-tab.tsx
@@ -559,13 +636,13 @@ var StyleTab = () => {
559
636
  const { element } = useElementContext();
560
637
  const elementStyles = useElementStyles(element.id);
561
638
  const [selectedStyleDef = null] = Object.values(elementStyles || {});
562
- return /* @__PURE__ */ React13.createElement(StyleContext, { selectedStyleDef }, /* @__PURE__ */ React13.createElement(Stack6, null, /* @__PURE__ */ React13.createElement(SizeSection, null)));
639
+ return /* @__PURE__ */ React16.createElement(StyleContext, { selectedStyleDef }, /* @__PURE__ */ React16.createElement(Stack8, null, /* @__PURE__ */ React16.createElement(SizeSection, null), /* @__PURE__ */ React16.createElement(TypographySection, null)));
563
640
  };
564
641
 
565
642
  // src/components/editing-panel-tabs.tsx
566
643
  var EditingPanelTabs = () => {
567
644
  const { getTabProps, getTabPanelProps, getTabsProps } = useTabs("settings");
568
- return /* @__PURE__ */ React14.createElement(Stack7, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React14.createElement(Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React14.createElement(Tab, { label: __3("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React14.createElement(Tab, { label: __3("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React14.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React14.createElement(SettingsTab, null)), /* @__PURE__ */ React14.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React14.createElement(StyleTab, null)));
645
+ return /* @__PURE__ */ React17.createElement(Stack9, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React17.createElement(Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React17.createElement(Tab, { label: __5("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React17.createElement(Tab, { label: __5("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React17.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React17.createElement(SettingsTab, null)), /* @__PURE__ */ React17.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React17.createElement(StyleTab, null)));
569
646
  };
570
647
 
571
648
  // src/components/editing-panel.tsx
@@ -576,8 +653,8 @@ var EditingPanel = () => {
576
653
  if (elements.length !== 1 || !elementType) {
577
654
  return null;
578
655
  }
579
- const panelTitle = __4("Edit %s", "elementor").replace("%s", elementType.title);
580
- return /* @__PURE__ */ React15.createElement(Panel, null, /* @__PURE__ */ React15.createElement(PanelHeader, null, /* @__PURE__ */ React15.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React15.createElement(PanelBody, null, /* @__PURE__ */ React15.createElement(ElementContext, { element: selectedElement }, /* @__PURE__ */ React15.createElement(EditingPanelTabs, null))));
656
+ const panelTitle = __6("Edit %s", "elementor").replace("%s", elementType.title);
657
+ return /* @__PURE__ */ React18.createElement(Panel, null, /* @__PURE__ */ React18.createElement(PanelHeader, null, /* @__PURE__ */ React18.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React18.createElement(PanelBody, null, /* @__PURE__ */ React18.createElement(ElementContext, { element: selectedElement }, /* @__PURE__ */ React18.createElement(EditingPanelTabs, null))));
581
658
  };
582
659
 
583
660
  // src/panel.ts