@elementor/editor-editing-panel 1.0.0 → 1.2.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.
Files changed (120) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/dist/index.d.mts +10 -19
  3. package/dist/index.d.ts +10 -19
  4. package/dist/index.js +1539 -1754
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +1534 -1723
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +13 -13
  9. package/src/components/add-or-remove-content.tsx +3 -3
  10. package/src/components/collapse-icon.tsx +12 -0
  11. package/src/components/collapsible-content.tsx +5 -14
  12. package/src/components/collapsible-field.tsx +5 -3
  13. package/src/components/css-class-selector.tsx +131 -0
  14. package/src/components/editing-panel-hooks.tsx +2 -0
  15. package/src/components/editing-panel-tabs.tsx +23 -13
  16. package/src/components/editing-panel.tsx +9 -6
  17. package/src/components/multi-combobox/index.ts +3 -0
  18. package/src/components/multi-combobox/multi-combobox.tsx +122 -0
  19. package/src/components/multi-combobox/types.ts +28 -0
  20. package/src/components/multi-combobox/use-combobox-actions.ts +62 -0
  21. package/src/components/section.tsx +37 -0
  22. package/src/components/sections-list.tsx +6 -0
  23. package/src/components/settings-tab.tsx +11 -11
  24. package/src/components/style-sections/background-section/background-color-field.tsx +4 -4
  25. package/src/components/style-sections/background-section/background-section.tsx +9 -7
  26. package/src/components/style-sections/border-section/border-color-field.tsx +4 -4
  27. package/src/components/style-sections/border-section/border-field.tsx +4 -3
  28. package/src/components/style-sections/border-section/border-radius-field.tsx +4 -3
  29. package/src/components/style-sections/border-section/border-section.tsx +7 -10
  30. package/src/components/style-sections/border-section/border-style-field.tsx +4 -4
  31. package/src/components/style-sections/border-section/border-width-field.tsx +4 -3
  32. package/src/components/style-sections/effects-section/effects-section.tsx +7 -10
  33. package/src/components/style-sections/layout-section/align-items-field.tsx +92 -0
  34. package/src/components/style-sections/layout-section/display-field.tsx +32 -0
  35. package/src/components/style-sections/layout-section/flex-direction-field.tsx +64 -0
  36. package/src/components/style-sections/layout-section/flex-order-field.tsx +114 -0
  37. package/src/components/style-sections/layout-section/justify-content-field.tsx +109 -0
  38. package/src/components/style-sections/layout-section/layout-section.tsx +36 -0
  39. package/src/components/style-sections/layout-section/wrap-field.tsx +52 -0
  40. package/src/components/style-sections/position-section/dimensions-field.tsx +6 -6
  41. package/src/components/style-sections/position-section/position-field.tsx +4 -4
  42. package/src/components/style-sections/position-section/position-section.tsx +45 -15
  43. package/src/components/style-sections/position-section/z-index-field.tsx +4 -4
  44. package/src/components/style-sections/size-section/overflow-field.tsx +8 -8
  45. package/src/components/style-sections/size-section/size-section.tsx +33 -26
  46. package/src/components/style-sections/spacing-section/spacing-section.tsx +11 -13
  47. package/src/components/style-sections/typography-section/font-family-field.tsx +40 -0
  48. package/src/components/style-sections/typography-section/font-size-field.tsx +4 -4
  49. package/src/components/style-sections/typography-section/font-weight-field.tsx +4 -4
  50. package/src/components/style-sections/typography-section/letter-spacing-field.tsx +4 -4
  51. package/src/components/style-sections/typography-section/text-alignment-field.tsx +9 -9
  52. package/src/components/style-sections/typography-section/text-color-field.tsx +4 -4
  53. package/src/components/style-sections/typography-section/text-direction-field.tsx +7 -7
  54. package/src/components/style-sections/typography-section/text-stroke-field.tsx +42 -7
  55. package/src/components/style-sections/typography-section/text-style-field.tsx +5 -4
  56. package/src/components/style-sections/typography-section/transform-field.tsx +23 -9
  57. package/src/components/style-sections/typography-section/typography-section.tsx +26 -27
  58. package/src/components/style-sections/typography-section/word-spacing-field.tsx +4 -4
  59. package/src/components/style-tab.tsx +67 -31
  60. package/src/contexts/classes-prop-context.tsx +1 -1
  61. package/src/contexts/element-context.tsx +2 -2
  62. package/src/contexts/style-context.tsx +6 -5
  63. package/src/control-replacement.tsx +1 -1
  64. package/src/controls-actions.ts +3 -2
  65. package/src/controls-registry/control-type-container.tsx +3 -2
  66. package/src/controls-registry/control.tsx +2 -1
  67. package/src/controls-registry/controls-registry.tsx +8 -1
  68. package/src/controls-registry/settings-field.tsx +5 -4
  69. package/src/controls-registry/styles-field.tsx +3 -2
  70. package/src/dynamics/components/dynamic-selection-control.tsx +15 -14
  71. package/src/dynamics/components/dynamic-selection.tsx +9 -8
  72. package/src/dynamics/dynamic-control.tsx +4 -4
  73. package/src/dynamics/hooks/use-dynamic-tag.ts +3 -2
  74. package/src/dynamics/hooks/use-prop-dynamic-action.tsx +6 -5
  75. package/src/dynamics/hooks/use-prop-dynamic-tags.ts +3 -2
  76. package/src/dynamics/init.ts +5 -3
  77. package/src/dynamics/sync/get-elementor-config.ts +1 -1
  78. package/src/dynamics/types.ts +2 -2
  79. package/src/dynamics/utils.ts +3 -2
  80. package/src/hooks/use-close-editor-panel.ts +23 -0
  81. package/src/hooks/use-direction.ts +13 -0
  82. package/src/hooks/use-open-editor-panel.ts +4 -3
  83. package/src/hooks/use-prop-value-history.ts +45 -0
  84. package/src/hooks/use-style-prop-history.ts +75 -0
  85. package/src/hooks/use-styles-field.ts +25 -4
  86. package/src/index.ts +1 -1
  87. package/src/init.ts +5 -4
  88. package/src/panel.ts +1 -0
  89. package/src/popover-action.tsx +1 -1
  90. package/src/sync/enqueue-font.ts +7 -0
  91. package/src/sync/get-elementor-config.ts +7 -0
  92. package/src/sync/{should-use-v2-panel.ts → is-atomic-widget-selected.ts} +1 -1
  93. package/src/sync/types.ts +20 -21
  94. package/src/components/accordion-section.tsx +0 -26
  95. package/src/components/control-label.tsx +0 -10
  96. package/src/controls/bound-prop-context.tsx +0 -30
  97. package/src/controls/components/control-toggle-button-group.tsx +0 -68
  98. package/src/controls/components/repeater.tsx +0 -197
  99. package/src/controls/components/text-field-inner-selection.tsx +0 -75
  100. package/src/controls/control-actions/control-actions-context.tsx +0 -27
  101. package/src/controls/control-actions/control-actions-menu.ts +0 -7
  102. package/src/controls/control-actions/control-actions.tsx +0 -31
  103. package/src/controls/controls/box-shadow-repeater-control.tsx +0 -210
  104. package/src/controls/controls/color-control.tsx +0 -25
  105. package/src/controls/controls/equal-unequal-sizes-control.tsx +0 -196
  106. package/src/controls/controls/image-control.tsx +0 -58
  107. package/src/controls/controls/image-media-control.tsx +0 -64
  108. package/src/controls/controls/linked-dimensions-control.tsx +0 -139
  109. package/src/controls/controls/number-control.tsx +0 -29
  110. package/src/controls/controls/select-control.tsx +0 -30
  111. package/src/controls/controls/size-control.tsx +0 -71
  112. package/src/controls/controls/stroke-control.tsx +0 -105
  113. package/src/controls/controls/text-area-control.tsx +0 -31
  114. package/src/controls/controls/text-control.tsx +0 -17
  115. package/src/controls/controls/toggle-control.tsx +0 -26
  116. package/src/controls/create-control-replacement.tsx +0 -53
  117. package/src/controls/create-control.tsx +0 -40
  118. package/src/controls/hooks/use-sync-external-state.tsx +0 -51
  119. package/src/controls/index.ts +0 -24
  120. package/src/dynamics/hooks/use-prop-value-history.ts +0 -26
package/dist/index.mjs CHANGED
@@ -1,885 +1,121 @@
1
- // src/controls/controls/image-control.tsx
2
- import * as React9 from "react";
3
- import { __ as __2 } from "@wordpress/i18n";
4
-
5
- // src/controls/bound-prop-context.tsx
6
- import * as React from "react";
7
- import { createContext, useContext } from "react";
8
- var BoundPropContext = createContext(null);
9
- var BoundPropProvider = ({ children, value, setValue, bind }) => {
10
- return /* @__PURE__ */ React.createElement(BoundPropContext.Provider, { value: { value, setValue, bind } }, children);
11
- };
12
- function useBoundProp(defaultValue) {
13
- const boundPropContext = useContext(BoundPropContext);
14
- if (!boundPropContext) {
15
- throw new Error("useBoundProp must be used within a BoundPropContext");
16
- }
17
- return { ...boundPropContext, value: boundPropContext.value ?? defaultValue };
18
- }
1
+ // src/index.ts
2
+ import { useBoundProp as useBoundProp5 } from "@elementor/editor-controls";
19
3
 
20
- // src/controls/controls/image-control.tsx
21
- import { Grid, Stack as Stack2 } from "@elementor/ui";
4
+ // src/control-replacement.tsx
5
+ import { createControlReplacement } from "@elementor/editor-controls";
6
+ var { replaceControl, getControlReplacement } = createControlReplacement();
22
7
 
23
- // src/controls/controls/image-media-control.tsx
24
- import * as React6 from "react";
25
- import { __ } from "@wordpress/i18n";
26
- import { UploadIcon } from "@elementor/icons";
27
- import { Button, Card, CardMedia, CardOverlay, Stack } from "@elementor/ui";
28
- import { useWpMediaAttachment, useWpMediaFrame } from "@elementor/wp-media";
8
+ // src/init.ts
9
+ import { injectIntoLogic } from "@elementor/editor";
10
+ import { __registerPanel as registerPanel } from "@elementor/editor-panels";
11
+ import { __privateBlockDataCommand as blockDataCommand } from "@elementor/editor-v1-adapters";
29
12
 
30
- // src/controls/control-actions/control-actions.tsx
31
- import * as React3 from "react";
32
- import { styled, UnstableFloatingActionBar } from "@elementor/ui";
13
+ // src/hooks/use-close-editor-panel.ts
14
+ import { useEffect as useEffect2 } from "react";
15
+ import { getSelectedElements as getSelectedElements2, isElementInContainer } from "@elementor/editor-elements";
16
+ import { __privateListenTo as listenTo, commandStartEvent } from "@elementor/editor-v1-adapters";
33
17
 
34
- // src/controls/control-actions/control-actions-context.tsx
35
- import * as React2 from "react";
36
- import { createContext as createContext2, useContext as useContext2 } from "react";
37
- var Context = createContext2(null);
38
- var ControlActionsProvider = ({ children, items }) => /* @__PURE__ */ React2.createElement(Context.Provider, { value: { items } }, children);
39
- var useControlActions = () => {
40
- const context = useContext2(Context);
41
- if (!context) {
42
- throw new Error("useControlActions must be used within a ControlActionsProvider");
43
- }
44
- return context;
45
- };
18
+ // src/panel.ts
19
+ import { __createPanel as createPanel } from "@elementor/editor-panels";
46
20
 
47
- // src/controls/control-actions/control-actions.tsx
48
- var FloatingBarContainer = styled("span")`
49
- display: contents;
21
+ // src/components/editing-panel.tsx
22
+ import * as React54 from "react";
23
+ import { ControlActionsProvider, ControlReplacementProvider } from "@elementor/editor-controls";
24
+ import { useSelectedElement } from "@elementor/editor-elements";
25
+ import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
26
+ import { ErrorBoundary } from "@elementor/ui";
27
+ import { __ as __35 } from "@wordpress/i18n";
50
28
 
51
- .MuiFloatingActionBar-popper:has( .MuiFloatingActionBar-actions:empty ) {
52
- display: none;
53
- }
54
- `;
55
- function ControlActions({ children }) {
56
- const { items } = useControlActions();
57
- if (items.length === 0) {
58
- return children;
59
- }
60
- const menuItems = items.map(({ MenuItem: MenuItem4, id }) => /* @__PURE__ */ React3.createElement(MenuItem4, { key: id }));
61
- return /* @__PURE__ */ React3.createElement(FloatingBarContainer, null, /* @__PURE__ */ React3.createElement(UnstableFloatingActionBar, { actions: menuItems }, children));
29
+ // src/contexts/element-context.tsx
30
+ import * as React from "react";
31
+ import { createContext, useContext } from "react";
32
+ var Context = createContext(null);
33
+ function ElementProvider({ children, element, elementType }) {
34
+ return /* @__PURE__ */ React.createElement(Context.Provider, { value: { element, elementType } }, children);
62
35
  }
63
-
64
- // src/controls/create-control.tsx
65
- import * as React5 from "react";
66
-
67
- // src/controls/create-control-replacement.tsx
68
- import * as React4 from "react";
69
- import { createContext as createContext3, useContext as useContext3 } from "react";
70
- var ControlReplacementContext = createContext3(void 0);
71
- var ControlReplacementProvider = ({
72
- component,
73
- condition,
74
- children
75
- }) => {
76
- return /* @__PURE__ */ React4.createElement(ControlReplacementContext.Provider, { value: { component, condition } }, children);
77
- };
78
- var useControlReplacement = () => {
79
- const { value } = useBoundProp();
80
- const controlReplacement = useContext3(ControlReplacementContext);
81
- let shouldReplace = false;
82
- try {
83
- shouldReplace = !!controlReplacement?.condition({ value }) && !!controlReplacement.component;
84
- } catch {
85
- }
86
- return shouldReplace ? controlReplacement?.component : void 0;
87
- };
88
- var createControlReplacement = () => {
89
- let controlReplacement;
90
- function replaceControl2({ component, condition }) {
91
- controlReplacement = { component, condition };
92
- }
93
- function getControlReplacement2() {
94
- return controlReplacement;
36
+ function useElement() {
37
+ const context = useContext(Context);
38
+ if (!context) {
39
+ throw new Error("useElement must be used within a ElementProvider");
95
40
  }
96
- return { replaceControl: replaceControl2, getControlReplacement: getControlReplacement2 };
97
- };
98
-
99
- // src/controls/create-control.tsx
100
- import { ErrorBoundary } from "@elementor/ui";
101
- var brandSymbol = Symbol("control");
102
- function createControl(Component, { supportsReplacements = true } = {}) {
103
- return (props) => {
104
- const ControlReplacement = useControlReplacement();
105
- if (ControlReplacement && supportsReplacements) {
106
- return /* @__PURE__ */ React5.createElement(ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(ControlReplacement, { ...props }));
107
- }
108
- return /* @__PURE__ */ React5.createElement(ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(Component, { ...props }));
109
- };
41
+ return context;
110
42
  }
111
43
 
112
- // src/controls/controls/image-media-control.tsx
113
- var ImageMediaControl = createControl(() => {
114
- const { value, setValue } = useBoundProp();
115
- const { id, url } = value?.value ?? {};
116
- const { data: attachment } = useWpMediaAttachment(id?.value || null);
117
- const src = attachment?.url ?? url;
118
- const { open } = useWpMediaFrame({
119
- types: ["image"],
120
- multiple: false,
121
- selected: id?.value || null,
122
- onSelect: (selectedAttachment) => {
123
- setValue({
124
- $$type: "image-src",
125
- value: {
126
- id: {
127
- $$type: "image-attachment-id",
128
- value: selectedAttachment.id
129
- },
130
- url: null
131
- }
132
- });
133
- }
134
- });
135
- return /* @__PURE__ */ React6.createElement(Card, { variant: "outlined" }, /* @__PURE__ */ React6.createElement(CardMedia, { image: src, sx: { height: 150 } }), /* @__PURE__ */ React6.createElement(CardOverlay, null, /* @__PURE__ */ React6.createElement(ControlActions, null, /* @__PURE__ */ React6.createElement(Stack, { gap: 0.5 }, /* @__PURE__ */ React6.createElement(
136
- Button,
137
- {
138
- size: "tiny",
139
- color: "inherit",
140
- variant: "outlined",
141
- onClick: () => open({ mode: "browse" })
142
- },
143
- __("Select Image", "elementor")
144
- ), /* @__PURE__ */ React6.createElement(
145
- Button,
146
- {
147
- size: "tiny",
148
- variant: "text",
149
- color: "inherit",
150
- startIcon: /* @__PURE__ */ React6.createElement(UploadIcon, null),
151
- onClick: () => open({ mode: "upload" })
152
- },
153
- __("Upload Image", "elementor")
154
- )))));
155
- });
156
-
157
- // src/controls/controls/select-control.tsx
158
- import * as React7 from "react";
159
- import { MenuItem, Select } from "@elementor/ui";
160
- var SelectControl = createControl(({ options: options5 }) => {
161
- const { value, setValue } = useBoundProp();
162
- const handleChange = (event) => {
163
- setValue(event.target.value);
164
- };
165
- return /* @__PURE__ */ React7.createElement(ControlActions, null, /* @__PURE__ */ React7.createElement(Select, { displayEmpty: true, size: "tiny", value: value ?? "", onChange: handleChange, fullWidth: true }, options5.map(({ label, ...props }) => /* @__PURE__ */ React7.createElement(MenuItem, { key: props.value, ...props }, label))));
166
- });
167
-
168
- // src/components/control-label.tsx
169
- import * as React8 from "react";
170
- import { Typography } from "@elementor/ui";
171
- var ControlLabel = ({ children }) => {
172
- return /* @__PURE__ */ React8.createElement(Typography, { component: "label", variant: "caption", color: "text.secondary" }, children);
173
- };
174
-
175
- // src/controls/controls/image-control.tsx
176
- var ImageControl = createControl((props) => {
177
- const { value, setValue } = useBoundProp();
178
- const { src, size } = value?.value || {};
179
- const setImageSrc = (newValue) => {
180
- setValue({
181
- $$type: "image",
182
- value: {
183
- src: newValue,
184
- size
185
- }
186
- });
187
- };
188
- const setImageSize = (newValue) => {
189
- setValue({
190
- $$type: "image",
191
- value: {
192
- src,
193
- size: newValue
194
- }
195
- });
196
- };
197
- return /* @__PURE__ */ React9.createElement(Stack2, { gap: 2 }, /* @__PURE__ */ React9.createElement(BoundPropProvider, { value: src, setValue: setImageSrc, bind: "src" }, /* @__PURE__ */ React9.createElement(ImageMediaControl, null)), /* @__PURE__ */ React9.createElement(BoundPropProvider, { value: size, setValue: setImageSize, bind: "size" }, /* @__PURE__ */ React9.createElement(Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React9.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React9.createElement(ControlLabel, null, " ", __2("Image Resolution", "elementor"))), /* @__PURE__ */ React9.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React9.createElement(SelectControl, { options: props.sizes })))));
198
- });
199
-
200
- // src/controls/controls/text-control.tsx
201
- import * as React10 from "react";
202
- import { TextField } from "@elementor/ui";
203
- var TextControl = createControl(({ placeholder }) => {
204
- const { value, setValue } = useBoundProp("");
205
- const handleChange = (event) => setValue(event.target.value);
206
- return /* @__PURE__ */ React10.createElement(ControlActions, null, /* @__PURE__ */ React10.createElement(TextField, { type: "text", size: "tiny", value, onChange: handleChange, placeholder }));
207
- });
208
-
209
- // src/controls/controls/text-area-control.tsx
210
- import * as React11 from "react";
211
- import { TextField as TextField2 } from "@elementor/ui";
212
- var TextAreaControl = createControl(({ placeholder }) => {
213
- const { value, setValue } = useBoundProp();
214
- const handleChange = (event) => {
215
- setValue(event.target.value);
216
- };
217
- return /* @__PURE__ */ React11.createElement(ControlActions, null, /* @__PURE__ */ React11.createElement(
218
- TextField2,
219
- {
220
- size: "tiny",
221
- multiline: true,
222
- fullWidth: true,
223
- rows: 5,
224
- value,
225
- onChange: handleChange,
226
- placeholder
227
- }
228
- ));
229
- });
230
-
231
- // src/controls/controls/size-control.tsx
232
- import * as React13 from "react";
233
- import { InputAdornment as InputAdornment2 } from "@elementor/ui";
234
-
235
- // src/controls/hooks/use-sync-external-state.tsx
236
- import { useEffect, useState } from "react";
237
- var useSyncExternalState = ({
238
- external,
239
- setExternal,
240
- persistWhen,
241
- fallback
242
- }) => {
243
- function toExternal(internalValue) {
244
- if (persistWhen(internalValue)) {
245
- return internalValue;
246
- }
247
- return void 0;
248
- }
249
- function toInternal(externalValue, internalValue) {
250
- if (!externalValue) {
251
- return fallback(internalValue);
252
- }
253
- return externalValue;
254
- }
255
- const [internal, setInternal] = useState(toInternal(external, void 0));
256
- useEffect(() => {
257
- setInternal((prevInternal) => toInternal(external, prevInternal));
258
- }, [external]);
259
- const setInternalValue = (setter) => {
260
- const setterFn = typeof setter === "function" ? setter : () => setter;
261
- const updated = setterFn(internal);
262
- setInternal(updated);
263
- setExternal(toExternal(updated));
264
- };
265
- return [internal, setInternalValue];
266
- };
44
+ // src/controls-actions.ts
45
+ import { createMenu } from "@elementor/menus";
267
46
 
268
- // src/controls/components/text-field-inner-selection.tsx
269
- import * as React12 from "react";
270
- import { forwardRef, useId } from "react";
271
- import { bindMenu, bindTrigger, Button as Button2, InputAdornment, Menu, MenuItem as MenuItem2, TextField as TextField3, usePopupState } from "@elementor/ui";
272
- var TextFieldInnerSelection = forwardRef(
273
- ({ placeholder, type, value, onChange, endAdornment, startAdornment }, ref) => {
274
- return /* @__PURE__ */ React12.createElement(
275
- TextField3,
276
- {
277
- size: "tiny",
278
- type,
279
- value,
280
- onChange,
281
- placeholder,
282
- InputProps: {
283
- endAdornment,
284
- startAdornment
285
- },
286
- ref
287
- }
288
- );
289
- }
290
- );
291
- var SelectionEndAdornment = ({
292
- options: options5,
293
- onClick,
294
- value
295
- }) => {
47
+ // src/popover-action.tsx
48
+ import * as React2 from "react";
49
+ import { useId } from "react";
50
+ import { XIcon } from "@elementor/icons";
51
+ import { bindPopover, bindToggle, IconButton, Popover, Stack, Tooltip, Typography, usePopupState } from "@elementor/ui";
52
+ var SIZE = "tiny";
53
+ function PopoverAction({
54
+ title,
55
+ visible = true,
56
+ icon: Icon,
57
+ popoverContent: PopoverContent
58
+ }) {
59
+ const id = useId();
296
60
  const popupState = usePopupState({
297
61
  variant: "popover",
298
- popupId: useId()
299
- });
300
- const handleMenuItemClick = (index) => {
301
- onClick(options5[index]);
302
- popupState.close();
303
- };
304
- return /* @__PURE__ */ React12.createElement(InputAdornment, { position: "end" }, /* @__PURE__ */ React12.createElement(
305
- Button2,
306
- {
307
- size: "small",
308
- color: "inherit",
309
- sx: { font: "inherit", minWidth: "initial" },
310
- ...bindTrigger(popupState)
311
- },
312
- value.toUpperCase()
313
- ), /* @__PURE__ */ React12.createElement(Menu, { MenuListProps: { dense: true }, ...bindMenu(popupState) }, options5.map((option, index) => /* @__PURE__ */ React12.createElement(MenuItem2, { key: option, onClick: () => handleMenuItemClick(index) }, option.toUpperCase()))));
314
- };
315
-
316
- // src/controls/controls/size-control.tsx
317
- var defaultUnits = ["px", "%", "em", "rem", "vw", "vh"];
318
- var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, startIcon }) => {
319
- const { value, setValue } = useBoundProp();
320
- const [state, setState] = useSyncExternalState({
321
- external: value,
322
- setExternal: setValue,
323
- persistWhen: (controlValue) => !!controlValue?.value.size || controlValue?.value.size === 0,
324
- fallback: (controlValue) => ({
325
- $$type: "size",
326
- value: { unit: controlValue?.value.unit || "px", size: NaN }
327
- })
62
+ popupId: `elementor-popover-action-${id}`
328
63
  });
329
- const handleUnitChange = (unit) => {
330
- setState((prev) => ({
331
- ...prev,
332
- value: {
333
- ...prev.value,
334
- unit
335
- }
336
- }));
337
- };
338
- const handleSizeChange = (event) => {
339
- const { value: size } = event.target;
340
- setState((prev) => ({
341
- ...prev,
342
- value: {
343
- ...prev.value,
344
- size: size || size === "0" ? parseFloat(size) : NaN
345
- }
346
- }));
347
- };
348
- return /* @__PURE__ */ React13.createElement(ControlActions, null, /* @__PURE__ */ React13.createElement(
349
- TextFieldInnerSelection,
350
- {
351
- endAdornment: /* @__PURE__ */ React13.createElement(SelectionEndAdornment, { options: units2, onClick: handleUnitChange, value: state.value.unit }),
352
- placeholder,
353
- startAdornment: startIcon ?? /* @__PURE__ */ React13.createElement(InputAdornment2, { position: "start" }, startIcon),
354
- type: "number",
355
- value: Number.isNaN(state.value.size) ? "" : state.value.size,
356
- onChange: handleSizeChange
357
- }
358
- ));
359
- });
360
-
361
- // src/controls/controls/stroke-control.tsx
362
- import * as React15 from "react";
363
- import { __ as __3 } from "@wordpress/i18n";
364
- import { Grid as Grid2, Stack as Stack3 } from "@elementor/ui";
365
-
366
- // src/controls/controls/color-control.tsx
367
- import * as React14 from "react";
368
- import { UnstableColorField } from "@elementor/ui";
369
- var ColorControl = createControl(
370
- (props) => {
371
- const { value, setValue } = useBoundProp();
372
- const handleChange = (selectedColor) => {
373
- setValue({
374
- $$type: "color",
375
- value: selectedColor
376
- });
377
- };
378
- return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(UnstableColorField, { size: "tiny", ...props, value: value?.value, onChange: handleChange }));
379
- }
380
- );
381
-
382
- // src/controls/controls/stroke-control.tsx
383
- var defaultStrokeControlValue = {
384
- $$type: "stroke",
385
- value: {
386
- color: {
387
- $$type: "color",
388
- value: "#000000"
389
- },
390
- width: {
391
- $$type: "size",
392
- value: {
393
- unit: "px",
394
- size: NaN
395
- }
396
- }
64
+ if (!visible) {
65
+ return null;
397
66
  }
398
- };
399
- var units = ["px", "em", "rem"];
400
- var StrokeControl = createControl(() => {
401
- const { value, setValue } = useBoundProp(defaultStrokeControlValue);
402
- const setStrokeWidth = (newValue) => {
403
- const updatedValue = {
404
- ...value?.value ?? defaultStrokeControlValue.value,
405
- width: newValue
406
- };
407
- setValue({
408
- $$type: "stroke",
409
- value: updatedValue
410
- });
411
- };
412
- const setStrokeColor = (newValue) => {
413
- const updatedValue = {
414
- ...value?.value ?? defaultStrokeControlValue.value,
415
- color: newValue
416
- };
417
- setValue({
418
- $$type: "stroke",
419
- value: updatedValue
420
- });
421
- };
422
- return /* @__PURE__ */ React15.createElement(Stack3, { gap: 1.5 }, /* @__PURE__ */ React15.createElement(
423
- Control,
424
- {
425
- bind: "width",
426
- label: __3("Stroke Width", "elementor"),
427
- value: value?.value.width ?? defaultStrokeControlValue.value.width,
428
- setValue: setStrokeWidth
429
- },
430
- /* @__PURE__ */ React15.createElement(SizeControl, { units })
431
- ), /* @__PURE__ */ React15.createElement(
432
- Control,
433
- {
434
- bind: "color",
435
- label: __3("Stroke Color", "elementor"),
436
- value: value?.value.color ?? defaultStrokeControlValue.value.color,
437
- setValue: setStrokeColor
438
- },
439
- /* @__PURE__ */ React15.createElement(ColorControl, null)
440
- ));
441
- });
442
- var Control = ({
443
- bind,
444
- value,
445
- setValue,
446
- label,
447
- children
448
- }) => /* @__PURE__ */ React15.createElement(BoundPropProvider, { bind, value, setValue }, /* @__PURE__ */ React15.createElement(Grid2, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React15.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React15.createElement(ControlLabel, null, label)), /* @__PURE__ */ React15.createElement(Grid2, { item: true, xs: 6 }, children)));
449
-
450
- // src/controls/controls/box-shadow-repeater-control.tsx
451
- import * as React17 from "react";
452
- import { __ as __5 } from "@wordpress/i18n";
453
- import { Grid as Grid3, Stack as Stack5, Typography as Typography3, UnstableColorIndicator } from "@elementor/ui";
454
-
455
- // src/controls/components/repeater.tsx
456
- import * as React16 from "react";
457
- import { useId as useId2, useRef, useState as useState2 } from "react";
458
- import { __ as __4 } from "@wordpress/i18n";
459
- import { PlusIcon, XIcon, CopyIcon, EyeIcon, EyeOffIcon } from "@elementor/icons";
460
- import {
461
- Box,
462
- Stack as Stack4,
463
- Popover,
464
- IconButton,
465
- bindTrigger as bindTrigger2,
466
- bindPopover,
467
- usePopupState as usePopupState2,
468
- UnstableTag,
469
- Typography as Typography2
470
- } from "@elementor/ui";
471
- var SIZE = "tiny";
472
- var Repeater = ({
473
- label,
474
- itemSettings,
475
- values: repeaterValues = [],
476
- setValues: setRepeaterValues
477
- }) => {
478
- const addRepeaterItem = () => {
479
- const newItem = structuredClone(itemSettings.initialValues);
480
- setRepeaterValues([...repeaterValues, newItem]);
481
- };
482
- const duplicateRepeaterItem = (index) => {
483
- setRepeaterValues([
484
- ...repeaterValues.slice(0, index),
485
- structuredClone(repeaterValues[index]),
486
- ...repeaterValues.slice(index)
487
- ]);
488
- };
489
- const removeRepeaterItem = (index) => {
490
- setRepeaterValues(repeaterValues.filter((_, i) => i !== index));
491
- };
492
- const toggleDisableRepeaterItem = (index) => {
493
- setRepeaterValues(
494
- repeaterValues.map((value, i) => {
495
- if (i === index) {
496
- const { disabled, ...rest } = value;
497
- return { ...rest, ...disabled ? {} : { disabled: true } };
498
- }
499
- return value;
500
- })
501
- );
502
- };
503
- return /* @__PURE__ */ React16.createElement(Stack4, null, /* @__PURE__ */ React16.createElement(Stack4, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pb: 1 } }, /* @__PURE__ */ React16.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary" }, label), /* @__PURE__ */ React16.createElement(IconButton, { size: SIZE, onClick: addRepeaterItem, "aria-label": __4("Add item", "elementor") }, /* @__PURE__ */ React16.createElement(PlusIcon, { fontSize: SIZE }))), /* @__PURE__ */ React16.createElement(Stack4, { gap: 1 }, repeaterValues.map((value, index) => /* @__PURE__ */ React16.createElement(
504
- RepeaterItem,
505
- {
506
- key: index,
507
- disabled: value.disabled,
508
- label: /* @__PURE__ */ React16.createElement(itemSettings.Label, { value }),
509
- startIcon: /* @__PURE__ */ React16.createElement(itemSettings.Icon, { value }),
510
- removeItem: () => removeRepeaterItem(index),
511
- duplicateItem: () => duplicateRepeaterItem(index),
512
- toggleDisableItem: () => toggleDisableRepeaterItem(index)
513
- },
514
- (props) => /* @__PURE__ */ React16.createElement(
515
- itemSettings.Content,
516
- {
517
- ...props,
518
- value,
519
- setValue: (newValue) => setRepeaterValues(
520
- repeaterValues.map((item, i) => i === index ? newValue : item)
521
- )
522
- }
523
- )
524
- ))));
525
- };
526
- var RepeaterItem = ({
527
- label,
528
- disabled,
529
- startIcon,
530
- children,
531
- removeItem,
532
- duplicateItem,
533
- toggleDisableItem
534
- }) => {
535
- const popupId = useId2();
536
- const tagRef = useRef(null);
537
- const [anchorEl, setAnchorEl] = useState2(null);
538
- const popoverState = usePopupState2({ popupId, variant: "popover" });
539
- const popoverProps = bindPopover(popoverState);
540
- return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
541
- UnstableTag,
542
- {
543
- ref: tagRef,
544
- label,
545
- showActionsOnHover: true,
546
- variant: "outlined",
547
- "aria-label": __4("Open item", "elementor"),
548
- ...bindTrigger2(popoverState),
549
- startIcon,
550
- actions: /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
551
- IconButton,
552
- {
553
- size: SIZE,
554
- onClick: duplicateItem,
555
- "aria-label": __4("Duplicate item", "elementor")
556
- },
557
- /* @__PURE__ */ React16.createElement(CopyIcon, { fontSize: SIZE })
558
- ), /* @__PURE__ */ React16.createElement(
559
- IconButton,
560
- {
561
- size: SIZE,
562
- onClick: toggleDisableItem,
563
- "aria-label": disabled ? __4("Enable item", "elementor") : __4("Disable item", "elementor")
564
- },
565
- disabled ? /* @__PURE__ */ React16.createElement(EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React16.createElement(EyeIcon, { fontSize: SIZE })
566
- ), /* @__PURE__ */ React16.createElement(
567
- IconButton,
568
- {
569
- size: SIZE,
570
- onClick: removeItem,
571
- "aria-label": __4("Remove item", "elementor")
572
- },
573
- /* @__PURE__ */ React16.createElement(XIcon, { fontSize: SIZE })
574
- ))
575
- }
576
- ), /* @__PURE__ */ React16.createElement(
67
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(Tooltip, { placement: "top", title }, /* @__PURE__ */ React2.createElement(IconButton, { "aria-label": title, key: id, size: SIZE, ...bindToggle(popupState) }, /* @__PURE__ */ React2.createElement(Icon, { fontSize: SIZE }))), /* @__PURE__ */ React2.createElement(
577
68
  Popover,
578
69
  {
579
70
  disablePortal: true,
580
- slotProps: {
581
- paper: { ref: setAnchorEl, sx: { width: tagRef.current?.getBoundingClientRect().width } }
71
+ disableScrollLock: true,
72
+ anchorOrigin: {
73
+ vertical: "bottom",
74
+ horizontal: "center"
582
75
  },
583
- anchorOrigin: { vertical: "bottom", horizontal: "left" },
584
- ...popoverProps
76
+ ...bindPopover(popupState)
585
77
  },
586
- /* @__PURE__ */ React16.createElement(Box, { p: 2 }, children({ anchorEl }))
78
+ /* @__PURE__ */ React2.createElement(Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React2.createElement(Icon, { fontSize: SIZE, sx: { mr: 0.5 } }), /* @__PURE__ */ React2.createElement(Typography, { variant: "subtitle2" }, title), /* @__PURE__ */ React2.createElement(IconButton, { sx: { ml: "auto" }, size: SIZE, onClick: popupState.close }, /* @__PURE__ */ React2.createElement(XIcon, { fontSize: SIZE }))),
79
+ /* @__PURE__ */ React2.createElement(PopoverContent, { closePopover: popupState.close })
587
80
  ));
588
- };
81
+ }
589
82
 
590
- // src/controls/controls/box-shadow-repeater-control.tsx
591
- var BoxShadowRepeaterControl = createControl(() => {
592
- const { value, setValue } = useBoundProp();
593
- const boxShadowValues = value?.value;
594
- const setBoxShadow = (newValue) => {
595
- setValue({
596
- $$type: "box-shadow",
597
- value: newValue
598
- });
599
- };
600
- return /* @__PURE__ */ React17.createElement(
601
- Repeater,
602
- {
603
- values: boxShadowValues,
604
- setValues: setBoxShadow,
605
- label: __5("Box shadow", "elementor"),
606
- itemSettings: {
607
- Icon: ItemIcon,
608
- Label: ItemLabel,
609
- Content: ItemContent,
610
- initialValues: initialShadow
611
- }
612
- }
613
- );
614
- });
615
- var ItemIcon = ({ value }) => /* @__PURE__ */ React17.createElement(UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color.value });
616
- var ItemContent = ({
617
- value,
618
- setValue
619
- }) => {
620
- const setShadow = (newValue) => {
621
- setValue({
622
- $$type: "shadow",
623
- value: newValue
624
- });
625
- };
626
- return /* @__PURE__ */ React17.createElement(Stack5, { gap: 1.5 }, /* @__PURE__ */ React17.createElement(Grid3, { container: true, spacing: 1 }, /* @__PURE__ */ React17.createElement(
627
- Control2,
628
- {
629
- bind: "color",
630
- value: value.value.color,
631
- label: __5("Color", "elementor"),
632
- setValue: (v) => setShadow({ ...value.value, color: v })
633
- },
634
- /* @__PURE__ */ React17.createElement(ColorControl, null)
635
- ), /* @__PURE__ */ React17.createElement(
636
- Control2,
637
- {
638
- bind: "position",
639
- value: value.value.position,
640
- label: __5("Position", "elementor"),
641
- setValue: (v) => setShadow({ ...value.value, position: v || null })
642
- },
643
- /* @__PURE__ */ React17.createElement(
644
- SelectControl,
645
- {
646
- options: [
647
- { label: __5("Inset", "elementor"), value: "inset" },
648
- { label: __5("Outset", "elementor"), value: "" }
649
- ]
650
- }
651
- )
652
- )), /* @__PURE__ */ React17.createElement(Grid3, { container: true, spacing: 1 }, /* @__PURE__ */ React17.createElement(
653
- Control2,
654
- {
655
- bind: "hOffset",
656
- label: __5("Horizontal", "elementor"),
657
- value: value.value.hOffset,
658
- setValue: (v) => setShadow({ ...value.value, hOffset: v })
659
- },
660
- /* @__PURE__ */ React17.createElement(SizeControl, null)
661
- ), /* @__PURE__ */ React17.createElement(
662
- Control2,
663
- {
664
- bind: "vOffset",
665
- label: __5("Vertical", "elementor"),
666
- value: value.value.vOffset,
667
- setValue: (v) => setShadow({ ...value.value, vOffset: v })
668
- },
669
- /* @__PURE__ */ React17.createElement(SizeControl, null)
670
- )), /* @__PURE__ */ React17.createElement(Grid3, { container: true, spacing: 1 }, /* @__PURE__ */ React17.createElement(
671
- Control2,
672
- {
673
- bind: "blur",
674
- value: value.value.blur,
675
- label: __5("Blur", "elementor"),
676
- setValue: (v) => setShadow({ ...value.value, blur: v })
677
- },
678
- /* @__PURE__ */ React17.createElement(SizeControl, null)
679
- ), /* @__PURE__ */ React17.createElement(
680
- Control2,
681
- {
682
- bind: "spread",
683
- label: __5("Spread", "elementor"),
684
- value: value.value.spread,
685
- setValue: (v) => setShadow({ ...value.value, spread: v })
686
- },
687
- /* @__PURE__ */ React17.createElement(SizeControl, null)
688
- )));
689
- };
690
- var Control2 = ({
691
- value,
692
- setValue,
693
- label,
694
- bind,
695
- children
696
- }) => /* @__PURE__ */ React17.createElement(BoundPropProvider, { value, setValue, bind }, /* @__PURE__ */ React17.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React17.createElement(Grid3, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React17.createElement(Grid3, { item: true, xs: 12 }, /* @__PURE__ */ React17.createElement(Typography3, { component: "label", variant: "caption", color: "text.secondary" }, label)), /* @__PURE__ */ React17.createElement(Grid3, { item: true, xs: 12 }, children))));
697
- var ItemLabel = ({ value }) => {
698
- const { position, hOffset, vOffset, blur, spread } = value.value;
699
- const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
700
- const { size: spreadSize = "", unit: spreadUnit = "" } = spread?.value || {};
701
- const { size: hOffsetSize = "unset", unit: hOffsetUnit = "" } = hOffset?.value || {};
702
- const { size: vOffsetSize = "unset", unit: vOffsetUnit = "" } = vOffset?.value || {};
703
- const sizes = [
704
- hOffsetSize + hOffsetUnit,
705
- vOffsetSize + vOffsetUnit,
706
- blurSize + blurUnit,
707
- spreadSize + spreadUnit
708
- ].join(" ");
709
- return /* @__PURE__ */ React17.createElement("span", { style: { textTransform: "capitalize" } }, position ?? "outset", ": ", sizes);
710
- };
711
- var initialShadow = {
712
- $$type: "shadow",
713
- value: {
714
- hOffset: {
715
- $$type: "size",
716
- value: { unit: "px", size: 0 }
717
- },
718
- vOffset: {
719
- $$type: "size",
720
- value: { unit: "px", size: 0 }
721
- },
722
- blur: {
723
- $$type: "size",
724
- value: { unit: "px", size: 10 }
725
- },
726
- spread: {
727
- $$type: "size",
728
- value: { unit: "px", size: 0 }
729
- },
730
- color: {
731
- $$type: "color",
732
- value: "rgba(0, 0, 0, 1)"
733
- },
734
- position: null
83
+ // src/controls-actions.ts
84
+ var controlActionsMenu = createMenu({
85
+ components: {
86
+ PopoverAction
735
87
  }
736
- };
737
-
738
- // src/controls/controls/toggle-control.tsx
739
- import * as React19 from "react";
740
-
741
- // src/controls/components/control-toggle-button-group.tsx
742
- import * as React18 from "react";
743
- import { styled as styled2, ToggleButton, ToggleButtonGroup, Tooltip } from "@elementor/ui";
744
- var StyledToggleButtonGroup = styled2(ToggleButtonGroup)`
745
- ${({ justify }) => `justify-content: ${justify};`}
746
- `;
747
- var ControlToggleButtonGroup = ({
748
- justify = "end",
749
- size = "tiny",
750
- value,
751
- onChange,
752
- items,
753
- exclusive = false
754
- }) => {
755
- const handleChange = (_, newValue) => {
756
- onChange(newValue);
757
- };
758
- return /* @__PURE__ */ React18.createElement(StyledToggleButtonGroup, { justify, value, onChange: handleChange, exclusive }, items.map(
759
- ({ label, value: buttonValue, icon: Icon, showTooltip }) => showTooltip ? /* @__PURE__ */ React18.createElement(Tooltip, { title: label, disableFocusListener: true, placement: "top", key: buttonValue }, /* @__PURE__ */ React18.createElement(ToggleButton, { value: buttonValue, "aria-label": label, size }, /* @__PURE__ */ React18.createElement(Icon, { fontSize: size }))) : /* @__PURE__ */ React18.createElement(ToggleButton, { key: buttonValue, value: buttonValue, "aria-label": label, size }, /* @__PURE__ */ React18.createElement(Icon, { fontSize: size }))
760
- ));
761
- };
762
-
763
- // src/controls/controls/toggle-control.tsx
764
- var ToggleControl = createControl(({ options: options5 }) => {
765
- const { value, setValue } = useBoundProp();
766
- const handleToggle = (option) => {
767
- setValue(option);
768
- };
769
- return /* @__PURE__ */ React19.createElement(
770
- ControlToggleButtonGroup,
771
- {
772
- items: options5,
773
- value: value || null,
774
- onChange: handleToggle,
775
- exclusive: true
776
- }
777
- );
778
88
  });
779
89
 
780
- // src/controls/controls/number-control.tsx
781
- import * as React20 from "react";
782
- import { TextField as TextField4 } from "@elementor/ui";
783
- var isEmptyOrNaN = (value) => value === void 0 || value === "" || Number.isNaN(Number(value));
784
- var NumberControl = createControl(({ placeholder }) => {
785
- const { value, setValue } = useBoundProp();
786
- const handleChange = (event) => {
787
- const eventValue = event.target.value;
788
- setValue(isEmptyOrNaN(eventValue) ? void 0 : Number(eventValue));
789
- };
790
- return /* @__PURE__ */ React20.createElement(ControlActions, null, /* @__PURE__ */ React20.createElement(
791
- TextField4,
792
- {
793
- size: "tiny",
794
- type: "number",
795
- value: isEmptyOrNaN(value) ? "" : value,
796
- onChange: handleChange,
797
- placeholder
798
- }
799
- ));
800
- });
801
-
802
- // src/controls/control-actions/control-actions-menu.ts
803
- import { createMenu } from "@elementor/menus";
804
- var createControlActionsMenu = ({ components }) => {
805
- return createMenu({
806
- components
807
- });
808
- };
809
-
810
- // src/control-replacement.tsx
811
- var { replaceControl, getControlReplacement } = createControlReplacement();
812
-
813
- // src/panel.ts
814
- import { __createPanel as createPanel } from "@elementor/editor-panels";
815
-
816
- // src/components/editing-panel.tsx
817
- import * as React66 from "react";
818
- import { __ as __38 } from "@wordpress/i18n";
819
- import { useSelectedElement } from "@elementor/editor-elements";
820
- import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
821
-
822
- // src/components/editing-panel-tabs.tsx
823
- import { Stack as Stack22, Tabs, Tab, TabPanel, useTabs } from "@elementor/ui";
824
- import * as React63 from "react";
825
- import { __ as __37 } from "@wordpress/i18n";
826
-
827
- // src/components/settings-tab.tsx
828
- import * as React26 from "react";
829
- import { Stack as Stack7 } from "@elementor/ui";
830
-
831
- // src/controls-registry/settings-field.tsx
832
- import * as React22 from "react";
833
- import { useElementSetting, updateSettings } from "@elementor/editor-elements";
834
-
835
- // src/contexts/element-context.tsx
836
- import * as React21 from "react";
837
- import { createContext as createContext4, useContext as useContext4 } from "react";
838
- var Context2 = createContext4(null);
839
- function ElementProvider({ children, element, elementType }) {
840
- return /* @__PURE__ */ React21.createElement(Context2.Provider, { value: { element, elementType } }, children);
841
- }
842
- function useElement() {
843
- const context = useContext4(Context2);
844
- if (!context) {
845
- throw new Error("useElement must be used within a ElementProvider");
846
- }
847
- return context;
90
+ // src/components/editing-panel-error-fallback.tsx
91
+ import * as React3 from "react";
92
+ import { Alert, Box } from "@elementor/ui";
93
+ function EditorPanelErrorFallback() {
94
+ return /* @__PURE__ */ React3.createElement(Box, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React3.createElement(Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React3.createElement("strong", null, "Something went wrong")));
848
95
  }
849
96
 
850
- // src/controls-registry/settings-field.tsx
851
- var SettingsField = ({ bind, children }) => {
852
- const { element, elementType } = useElement();
853
- const defaultValue = elementType.propsSchema[bind]?.default;
854
- const settingsValue = useElementSetting({ id: element.id, bind });
855
- const value = settingsValue ?? defaultValue ?? null;
856
- const setValue = (newValue) => {
857
- updateSettings({
858
- id: element.id,
859
- props: {
860
- [bind]: newValue
861
- }
862
- });
863
- };
864
- return /* @__PURE__ */ React22.createElement(BoundPropProvider, { setValue, value, bind }, children);
865
- };
866
-
867
- // src/components/accordion-section.tsx
868
- import * as React23 from "react";
869
- import { useId as useId3 } from "react";
870
- import { Accordion, AccordionSummary, AccordionDetails, AccordionSummaryText, Stack as Stack6 } from "@elementor/ui";
871
- var AccordionSection = ({ title, children, defaultExpanded = false }) => {
872
- const uid = useId3();
873
- const labelId = `label-${uid}`;
874
- const contentId = `content-${uid}`;
875
- return /* @__PURE__ */ React23.createElement(Accordion, { disableGutters: true, defaultExpanded }, /* @__PURE__ */ React23.createElement(AccordionSummary, { "aria-controls": contentId, id: labelId }, /* @__PURE__ */ React23.createElement(AccordionSummaryText, { primaryTypographyProps: { variant: "caption" } }, title)), /* @__PURE__ */ React23.createElement(AccordionDetails, { id: contentId, "aria-labelledby": labelId }, /* @__PURE__ */ React23.createElement(Stack6, { gap: 2.5 }, children)));
876
- };
97
+ // src/components/editing-panel-tabs.tsx
98
+ import * as React53 from "react";
99
+ import { Fragment as Fragment6 } from "react";
100
+ import { Divider as Divider8, Stack as Stack18, Tab, TabPanel, Tabs, useTabs } from "@elementor/ui";
101
+ import { __ as __34 } from "@wordpress/i18n";
102
+
103
+ // src/components/settings-tab.tsx
104
+ import * as React9 from "react";
105
+ import { ControlLabel } from "@elementor/editor-controls";
877
106
 
878
107
  // src/controls-registry/control.tsx
879
- import * as React24 from "react";
108
+ import * as React4 from "react";
880
109
  import { createError } from "@elementor/utils";
881
110
 
882
111
  // src/controls-registry/controls-registry.tsx
112
+ import {
113
+ ImageControl,
114
+ SelectControl,
115
+ SizeControl,
116
+ TextAreaControl,
117
+ TextControl
118
+ } from "@elementor/editor-controls";
883
119
  var controlTypes = {
884
120
  image: { component: ImageControl, layout: "full" },
885
121
  text: { component: TextControl, layout: "two-columns" },
@@ -895,27 +131,27 @@ var ControlTypeError = createError({
895
131
  code: "CONTROL_TYPE_NOT_FOUND",
896
132
  message: `Control type not found.`
897
133
  });
898
- var Control3 = ({ props, type }) => {
134
+ var Control = ({ props, type }) => {
899
135
  const ControlByType = getControlByType(type);
900
136
  if (!ControlByType) {
901
137
  throw new ControlTypeError({
902
138
  context: { type }
903
139
  });
904
140
  }
905
- return /* @__PURE__ */ React24.createElement(ControlByType, { ...props });
141
+ return /* @__PURE__ */ React4.createElement(ControlByType, { ...props });
906
142
  };
907
143
 
908
144
  // src/controls-registry/control-type-container.tsx
909
- import * as React25 from "react";
910
- import { styled as styled3, Box as Box2 } from "@elementor/ui";
145
+ import * as React5 from "react";
146
+ import { Box as Box2, styled } from "@elementor/ui";
911
147
  var ControlTypeContainer = ({
912
148
  controlType,
913
149
  children
914
150
  }) => {
915
151
  const layout = getLayoutByType(controlType);
916
- return /* @__PURE__ */ React25.createElement(StyledContainer, { layout }, children);
152
+ return /* @__PURE__ */ React5.createElement(StyledContainer, { layout }, children);
917
153
  };
918
- var StyledContainer = styled3(Box2, {
154
+ var StyledContainer = styled(Box2, {
919
155
  shouldForwardProp: (prop) => !["layout"].includes(prop)
920
156
  })(({ layout, theme }) => ({
921
157
  display: "grid",
@@ -930,17 +166,79 @@ var getGridLayout = (layout) => ({
930
166
  }[layout]
931
167
  });
932
168
 
169
+ // src/controls-registry/settings-field.tsx
170
+ import * as React6 from "react";
171
+ import { BoundPropProvider } from "@elementor/editor-controls";
172
+ import { updateSettings, useElementSetting } from "@elementor/editor-elements";
173
+ var SettingsField = ({ bind, children }) => {
174
+ const { element, elementType } = useElement();
175
+ const defaultValue = elementType.propsSchema[bind]?.default;
176
+ const settingsValue = useElementSetting(element.id, bind);
177
+ const value = settingsValue ?? defaultValue ?? null;
178
+ const setValue = (newValue) => {
179
+ updateSettings({
180
+ id: element.id,
181
+ props: {
182
+ [bind]: newValue
183
+ }
184
+ });
185
+ };
186
+ return /* @__PURE__ */ React6.createElement(BoundPropProvider, { setValue, value, bind }, children);
187
+ };
188
+
189
+ // src/components/section.tsx
190
+ import * as React7 from "react";
191
+ import { useId as useId2, useState } from "react";
192
+ import { Collapse, Divider, ListItemButton, ListItemText, Stack as Stack2 } from "@elementor/ui";
193
+
194
+ // src/components/collapse-icon.tsx
195
+ import { ChevronDownIcon } from "@elementor/icons";
196
+ import { styled as styled2 } from "@elementor/ui";
197
+ var CollapseIcon = styled2(ChevronDownIcon, {
198
+ shouldForwardProp: (prop) => prop !== "open"
199
+ })(({ theme, open }) => ({
200
+ transform: open ? "rotate(180deg)" : "rotate(0deg)",
201
+ transition: theme.transitions.create("transform", {
202
+ duration: theme.transitions.duration.standard
203
+ })
204
+ }));
205
+
206
+ // src/components/section.tsx
207
+ function Section({ title, children, defaultExpanded = false }) {
208
+ const [isOpen, setIsOpen] = useState(!!defaultExpanded);
209
+ const id = useId2();
210
+ const labelId = `label-${id}`;
211
+ const contentId = `content-${id}`;
212
+ return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(
213
+ ListItemButton,
214
+ {
215
+ id: labelId,
216
+ "aria-controls": contentId,
217
+ onClick: () => setIsOpen((prev) => !prev)
218
+ },
219
+ /* @__PURE__ */ React7.createElement(ListItemText, { secondary: title }),
220
+ /* @__PURE__ */ React7.createElement(CollapseIcon, { open: isOpen, color: "secondary" })
221
+ ), /* @__PURE__ */ React7.createElement(Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React7.createElement(Stack2, { gap: 2.5, p: 2 }, children)), /* @__PURE__ */ React7.createElement(Divider, null));
222
+ }
223
+
224
+ // src/components/sections-list.tsx
225
+ import * as React8 from "react";
226
+ import { List } from "@elementor/ui";
227
+ function SectionsList(props) {
228
+ return /* @__PURE__ */ React8.createElement(List, { disablePadding: true, component: "div", ...props });
229
+ }
230
+
933
231
  // src/components/settings-tab.tsx
934
232
  var SettingsTab = () => {
935
233
  const { elementType } = useElement();
936
- return /* @__PURE__ */ React26.createElement(Stack7, null, elementType.controls.map(({ type, value }, index) => {
234
+ return /* @__PURE__ */ React9.createElement(SectionsList, null, elementType.controls.map(({ type, value }, index) => {
937
235
  if (type === "control") {
938
- return /* @__PURE__ */ React26.createElement(Control4, { key: value.bind, control: value });
236
+ return /* @__PURE__ */ React9.createElement(Control2, { key: value.bind, control: value });
939
237
  }
940
238
  if (type === "section") {
941
- return /* @__PURE__ */ React26.createElement(AccordionSection, { key: type + "." + index, title: value.label, defaultExpanded: true }, value.items?.map((item) => {
239
+ return /* @__PURE__ */ React9.createElement(Section, { title: value.label, key: type + "." + index, defaultExpanded: true }, value.items?.map((item) => {
942
240
  if (item.type === "control") {
943
- return /* @__PURE__ */ React26.createElement(Control4, { key: item.value.bind, control: item.value });
241
+ return /* @__PURE__ */ React9.createElement(Control2, { key: item.value.bind, control: item.value });
944
242
  }
945
243
  return null;
946
244
  }));
@@ -948,73 +246,299 @@ var SettingsTab = () => {
948
246
  return null;
949
247
  }));
950
248
  };
951
- var Control4 = ({ control }) => {
249
+ var Control2 = ({ control }) => {
952
250
  if (!getControlByType(control.type)) {
953
251
  return null;
954
252
  }
955
- return /* @__PURE__ */ React26.createElement(SettingsField, { bind: control.bind }, /* @__PURE__ */ React26.createElement(ControlTypeContainer, { controlType: control.type }, control.label ? /* @__PURE__ */ React26.createElement(ControlLabel, null, control.label) : null, /* @__PURE__ */ React26.createElement(Control3, { type: control.type, props: control.props })));
253
+ return /* @__PURE__ */ React9.createElement(SettingsField, { bind: control.bind }, /* @__PURE__ */ React9.createElement(ControlTypeContainer, { controlType: control.type }, control.label ? /* @__PURE__ */ React9.createElement(ControlLabel, null, control.label) : null, /* @__PURE__ */ React9.createElement(Control, { type: control.type, props: control.props })));
956
254
  };
957
255
 
958
256
  // src/components/style-tab.tsx
959
- import * as React62 from "react";
960
- import { useState as useState5 } from "react";
961
- import { Stack as Stack21 } from "@elementor/ui";
962
- import { generateId } from "@elementor/editor-styles";
257
+ import * as React52 from "react";
258
+ import { useState as useState4 } from "react";
259
+ import { useElementSetting as useElementSetting3, useElementStyles as useElementStyles2 } from "@elementor/editor-elements";
963
260
  import { useActiveBreakpoint } from "@elementor/editor-responsive";
964
- import { getElementStyles, getElementSetting } from "@elementor/editor-elements";
261
+ import { generateId } from "@elementor/editor-styles";
262
+ import { Divider as Divider7 } from "@elementor/ui";
263
+ import { __ as __33 } from "@wordpress/i18n";
264
+
265
+ // src/contexts/classes-prop-context.tsx
266
+ import * as React10 from "react";
267
+ import { createContext as createContext2, useContext as useContext2 } from "react";
268
+ var Context2 = createContext2(null);
269
+ function ClassesPropProvider({ children, prop }) {
270
+ return /* @__PURE__ */ React10.createElement(Context2.Provider, { value: { prop } }, children);
271
+ }
272
+ function useClassesProp() {
273
+ const context = useContext2(Context2);
274
+ if (!context) {
275
+ throw new Error("useClassesProp must be used within a ClassesPropProvider");
276
+ }
277
+ return context.prop;
278
+ }
965
279
 
966
280
  // src/contexts/style-context.tsx
967
- import * as React27 from "react";
968
- import { createContext as createContext5, useContext as useContext5 } from "react";
969
- var Context3 = createContext5(null);
970
- function StyleProvider({ children, id, meta }) {
971
- return /* @__PURE__ */ React27.createElement(Context3.Provider, { value: { id, meta } }, children);
281
+ import * as React11 from "react";
282
+ import { createContext as createContext3, useContext as useContext3 } from "react";
283
+ var Context3 = createContext3(null);
284
+ function StyleProvider({ children, id, setId, meta }) {
285
+ return /* @__PURE__ */ React11.createElement(Context3.Provider, { value: { id, setId, meta } }, children);
972
286
  }
973
287
  function useStyle() {
974
- const context = useContext5(Context3);
288
+ const context = useContext3(Context3);
975
289
  if (!context) {
976
- throw new Error("UseStyleContext must be used within a StyleContextProvider");
290
+ throw new Error("useStyle must be used within a StyleProvider");
977
291
  }
978
292
  return context;
979
293
  }
980
294
 
981
- // src/components/style-sections/size-section/size-section.tsx
982
- import * as React31 from "react";
983
- import { Divider, Grid as Grid5, Stack as Stack8 } from "@elementor/ui";
984
- import { __ as __7 } from "@wordpress/i18n";
295
+ // src/components/css-class-selector.tsx
296
+ import * as React13 from "react";
297
+ import { updateSettings as updateSettings2, useElementSetting as useElementSetting2, useElementStyles } from "@elementor/editor-elements";
298
+ import { classesPropTypeUtil } from "@elementor/editor-props";
299
+ import { Chip as Chip2, Stack as Stack3, Typography as Typography2 } from "@elementor/ui";
300
+ import { __ } from "@wordpress/i18n";
985
301
 
986
- // src/components/style-sections/size-section/overflow-field.tsx
987
- import * as React30 from "react";
988
- import { __ as __6 } from "@wordpress/i18n";
989
- import { Grid as Grid4 } from "@elementor/ui";
990
- import { EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2, ExpandBottomIcon } from "@elementor/icons";
302
+ // src/components/multi-combobox/multi-combobox.tsx
303
+ import * as React12 from "react";
304
+ import {
305
+ Autocomplete,
306
+ Box as Box3,
307
+ Chip,
308
+ styled as styled3,
309
+ TextField
310
+ } from "@elementor/ui";
991
311
 
992
- // src/controls-registry/styles-field.tsx
993
- import * as React29 from "react";
312
+ // src/components/multi-combobox/use-combobox-actions.ts
313
+ import { createFilterOptions } from "@elementor/ui";
314
+ var useComboboxActions = (applied, actions, optionsLabel, onSelect) => ({
315
+ action: {
316
+ is: (opt) => typeof opt !== "string" && "action" in opt,
317
+ getLabel: (option) => option.action.getLabel(option.label),
318
+ groupBy: (option) => option.action.groupLabel,
319
+ onChange: ({ action, label }) => action?.apply(label),
320
+ getFilteredActions: (optionList, params) => {
321
+ const actionGroups = Object.values(actions);
322
+ return actionGroups.reduce((groups, group) => {
323
+ const actionOptions = group.actions.reduce((groupActions, action) => {
324
+ const shouldShowAction = action.condition(optionList, params.inputValue);
325
+ if (shouldShowAction) {
326
+ const actionOption = createActionOption(group.label, action, params.inputValue);
327
+ groupActions.unshift(actionOption);
328
+ }
329
+ return groupActions;
330
+ }, []);
331
+ return [...groups, ...actionOptions];
332
+ }, []);
333
+ }
334
+ },
335
+ option: {
336
+ is: (opt) => typeof opt !== "string" && !("action" in opt),
337
+ getLabel: (option) => option.label,
338
+ groupBy: () => optionsLabel ?? "",
339
+ onChange: (optionValues) => onSelect?.(optionValues),
340
+ getFilteredOptions: (optionList, params) => {
341
+ const appliedValues = applied.map((option) => option.value);
342
+ const optionsWithoutApplied = optionList.filter((option) => !appliedValues.includes(option.value));
343
+ return filter(optionsWithoutApplied, params);
344
+ }
345
+ }
346
+ });
347
+ var filter = createFilterOptions();
348
+ var createActionOption = (groupLabel, action, inputValue) => ({
349
+ value: "",
350
+ label: inputValue,
351
+ action: {
352
+ groupLabel,
353
+ apply: action.apply,
354
+ getLabel: action.getLabel
355
+ }
356
+ });
994
357
 
995
- // src/hooks/use-styles-field.ts
996
- import { useElementStyleProp, updateStyle } from "@elementor/editor-elements";
358
+ // src/components/multi-combobox/multi-combobox.tsx
359
+ var MultiCombobox = ({
360
+ actions = {},
361
+ selected,
362
+ options: options7,
363
+ optionsLabel,
364
+ onSelect,
365
+ onCreate,
366
+ ...props
367
+ }) => {
368
+ const { action: actionProps, option: optionProps } = useComboboxActions(
369
+ selected,
370
+ actions,
371
+ // TODO: make the group mechanism more generic, allow passing list of groups.
372
+ optionsLabel,
373
+ onSelect
374
+ );
375
+ return /* @__PURE__ */ React12.createElement(
376
+ Autocomplete,
377
+ {
378
+ ...props,
379
+ freeSolo: true,
380
+ multiple: true,
381
+ clearOnBlur: true,
382
+ selectOnFocus: true,
383
+ disableClearable: true,
384
+ handleHomeEndKeys: true,
385
+ value: selected,
386
+ options: options7,
387
+ renderGroup,
388
+ renderInput: (params) => /* @__PURE__ */ React12.createElement(TextField, { ...params }),
389
+ getLimitTagsText: (more) => /* @__PURE__ */ React12.createElement(Chip, { size: "tiny", variant: "standard", label: `+${more}`, clickable: true }),
390
+ onChange: (_, selectedOrTypedValue, reason) => {
391
+ if (reason === "createOption") {
392
+ const typedValue = selectedOrTypedValue.find((option) => typeof option === "string");
393
+ return typedValue && onCreate?.(typedValue);
394
+ }
395
+ const action = selectedOrTypedValue.find((value) => actionProps.is(value));
396
+ if (reason === "selectOption" && action) {
397
+ return actionProps.onChange(action);
398
+ }
399
+ const selectedValues = selectedOrTypedValue.filter((v) => typeof v !== "string");
400
+ const fixedValues = options7.filter((option) => option.fixed);
401
+ optionProps.onChange([.../* @__PURE__ */ new Set([...fixedValues, ...selectedValues])]);
402
+ },
403
+ getOptionLabel: (option) => {
404
+ if (optionProps.is(option)) {
405
+ return optionProps.getLabel(option);
406
+ }
407
+ if (actionProps.is(option)) {
408
+ return actionProps.getLabel(option);
409
+ }
410
+ return "";
411
+ },
412
+ filterOptions: (optionList, params) => {
413
+ const filteredOptions = optionProps.getFilteredOptions(optionList, params);
414
+ const actionOptions = actionProps.getFilteredActions(optionList, params);
415
+ return [...actionOptions, ...filteredOptions];
416
+ },
417
+ groupBy: (option) => (optionProps.is(option) ? optionProps.groupBy() : actionProps.groupBy(option)) ?? ""
418
+ }
419
+ );
420
+ };
421
+ var renderGroup = (params) => /* @__PURE__ */ React12.createElement(Group, { key: params.key }, /* @__PURE__ */ React12.createElement(GroupHeader, null, params.group), /* @__PURE__ */ React12.createElement(GroupItems, null, params.children));
422
+ var Group = styled3("li")`
423
+ &:not( :last-of-type ) {
424
+ border-bottom: 1px solid ${({ theme }) => theme.palette.divider};
425
+ }
426
+ `;
427
+ var GroupHeader = styled3(Box3)(({ theme }) => ({
428
+ position: "sticky",
429
+ top: "-8px",
430
+ padding: theme.spacing(1, 2),
431
+ color: theme.palette.text.tertiary
432
+ }));
433
+ var GroupItems = styled3("ul")`
434
+ padding: 0;
435
+ `;
997
436
 
998
- // src/contexts/classes-prop-context.tsx
999
- import * as React28 from "react";
1000
- import { createContext as createContext6, useContext as useContext6 } from "react";
1001
- var Context4 = createContext6(null);
1002
- function ClassesPropProvider({ children, prop }) {
1003
- return /* @__PURE__ */ React28.createElement(Context4.Provider, { value: { prop } }, children);
437
+ // src/components/css-class-selector.tsx
438
+ var ID = "elementor-css-class-selector";
439
+ var TAGS_LIMIT = 8;
440
+ function CssClassSelector() {
441
+ const options7 = useOptions();
442
+ const { id: activeId, setId: setActiveId } = useStyle();
443
+ const [appliedIds] = useAppliedClassesIds();
444
+ const handleApply = useHandleApply();
445
+ const handleActivate = ({ value }) => setActiveId(value);
446
+ const active = options7.find((option) => option.value === activeId) || null;
447
+ const applied = appliedIds.map((id) => options7.find((option) => option.value === id)).filter((option) => !!option);
448
+ return /* @__PURE__ */ React13.createElement(Stack3, { gap: 1, p: 2 }, /* @__PURE__ */ React13.createElement(Typography2, { component: "label", variant: "caption", htmlFor: ID }, __("CSS Classes", "elementor")), /* @__PURE__ */ React13.createElement(
449
+ MultiCombobox,
450
+ {
451
+ id: ID,
452
+ size: "tiny",
453
+ options: options7,
454
+ selected: applied,
455
+ onSelect: handleApply,
456
+ limitTags: TAGS_LIMIT,
457
+ optionsLabel: __("Global CSS Classes", "elementor"),
458
+ renderTags: (values, getTagProps) => values.map((value, index) => {
459
+ const chipProps = getTagProps({ index });
460
+ const isActive = value.value === active?.value;
461
+ return /* @__PURE__ */ React13.createElement(
462
+ Chip2,
463
+ {
464
+ ...chipProps,
465
+ key: chipProps.key,
466
+ size: "small",
467
+ label: value.label,
468
+ variant: isActive ? "filled" : "standard",
469
+ color: isActive && value.color ? value.color : "default",
470
+ onClick: () => handleActivate(value),
471
+ onDelete: null
472
+ }
473
+ );
474
+ })
475
+ }
476
+ ));
1004
477
  }
1005
- function useClassesProp() {
1006
- const context = useContext6(Context4);
1007
- if (!context) {
1008
- throw new Error("useClassesProp must be used within a ClassesPropProvider");
1009
- }
1010
- return context.prop;
478
+ function useOptions() {
479
+ const { element } = useElement();
480
+ const styleDefs = useElementStyles(element.id);
481
+ return Object.values(styleDefs).map((styleDef) => ({
482
+ label: styleDef.label,
483
+ value: styleDef.id,
484
+ fixed: true,
485
+ color: "primary"
486
+ }));
487
+ }
488
+ function useAppliedClassesIds() {
489
+ const { element } = useElement();
490
+ const currentClassesProp = useClassesProp();
491
+ const value = useElementSetting2(element.id, currentClassesProp)?.value || [];
492
+ const setValue = (ids) => {
493
+ updateSettings2({
494
+ id: element.id,
495
+ props: {
496
+ [currentClassesProp]: classesPropTypeUtil.create(ids)
497
+ }
498
+ });
499
+ };
500
+ return [value, setValue];
501
+ }
502
+ function useHandleApply() {
503
+ const { id: activeId, setId: setActiveId } = useStyle();
504
+ const [appliedIds, setAppliedIds] = useAppliedClassesIds();
505
+ return (selectedOptions) => {
506
+ const selectedValues = selectedOptions.map(({ value }) => value);
507
+ const isSameClassesAlreadyApplied = selectedValues.length === appliedIds.length && selectedValues.every((value) => appliedIds.includes(value));
508
+ if (isSameClassesAlreadyApplied) {
509
+ return;
510
+ }
511
+ setAppliedIds(selectedValues);
512
+ const addedValue = selectedValues.find((id) => !appliedIds.includes(id));
513
+ if (addedValue) {
514
+ setActiveId(addedValue);
515
+ return;
516
+ }
517
+ const removedValue = appliedIds.find((id) => !selectedValues.includes(id));
518
+ if (removedValue && removedValue === activeId) {
519
+ setActiveId(selectedValues[0] ?? null);
520
+ }
521
+ };
1011
522
  }
1012
523
 
524
+ // src/components/style-sections/background-section/background-section.tsx
525
+ import * as React16 from "react";
526
+ import { BackgroundOverlayRepeaterControl } from "@elementor/editor-controls";
527
+ import { Stack as Stack4 } from "@elementor/ui";
528
+
529
+ // src/controls-registry/styles-field.tsx
530
+ import * as React14 from "react";
531
+ import { BoundPropProvider as BoundPropProvider2 } from "@elementor/editor-controls";
532
+
1013
533
  // src/hooks/use-styles-field.ts
534
+ import { useEffect, useRef } from "react";
535
+ import { updateStyle, useElementStyleProp } from "@elementor/editor-elements";
1014
536
  var useStylesField = (propName) => {
1015
537
  const { element } = useElement();
1016
538
  const { id, meta } = useStyle();
1017
539
  const classesProp = useClassesProp();
540
+ const previousValue = useRef(null);
541
+ const onChangeCallbacks = useRef(/* @__PURE__ */ new Set());
1018
542
  const value = useElementStyleProp({
1019
543
  elementID: element.id,
1020
544
  styleDefID: id,
@@ -1030,778 +554,1118 @@ var useStylesField = (propName) => {
1030
554
  bind: classesProp
1031
555
  });
1032
556
  };
1033
- return [value, setValue];
557
+ const registerChangeListener = (callback) => {
558
+ onChangeCallbacks.current.add(callback);
559
+ };
560
+ useEffect(() => {
561
+ onChangeCallbacks.current.forEach((cb) => {
562
+ cb(value, previousValue.current);
563
+ });
564
+ previousValue.current = value;
565
+ }, [value]);
566
+ return [value, setValue, registerChangeListener];
1034
567
  };
1035
568
 
1036
569
  // src/controls-registry/styles-field.tsx
1037
570
  var StylesField = ({ bind, children }) => {
1038
571
  const [value, setValue] = useStylesField(bind);
1039
- return /* @__PURE__ */ React29.createElement(BoundPropProvider, { setValue, value, bind }, children);
572
+ return /* @__PURE__ */ React14.createElement(BoundPropProvider2, { setValue, value, bind }, children);
1040
573
  };
1041
574
 
1042
- // src/components/style-sections/size-section/overflow-field.tsx
1043
- var options = [
575
+ // src/components/style-sections/background-section/background-color-field.tsx
576
+ import * as React15 from "react";
577
+ import { ColorControl, ControlLabel as ControlLabel2 } from "@elementor/editor-controls";
578
+ import { Grid } from "@elementor/ui";
579
+ import { __ as __2 } from "@wordpress/i18n";
580
+ var BackgroundColorField = () => {
581
+ return /* @__PURE__ */ React15.createElement(StylesField, { bind: "background-color" }, /* @__PURE__ */ React15.createElement(Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React15.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React15.createElement(ControlLabel2, null, __2("Color", "elementor"))), /* @__PURE__ */ React15.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React15.createElement(ColorControl, null))));
582
+ };
583
+
584
+ // src/components/style-sections/background-section/background-section.tsx
585
+ var BackgroundSection = () => {
586
+ return /* @__PURE__ */ React16.createElement(Stack4, { gap: 1.5 }, /* @__PURE__ */ React16.createElement(StylesField, { bind: "background-image" }, /* @__PURE__ */ React16.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React16.createElement(BackgroundColorField, null));
587
+ };
588
+
589
+ // src/components/style-sections/border-section/border-section.tsx
590
+ import * as React23 from "react";
591
+ import { Divider as Divider2, Stack as Stack6 } from "@elementor/ui";
592
+
593
+ // src/components/style-sections/border-section/border-field.tsx
594
+ import * as React21 from "react";
595
+ import { __ as __6 } from "@wordpress/i18n";
596
+
597
+ // src/components/add-or-remove-content.tsx
598
+ import * as React17 from "react";
599
+ import { ControlLabel as ControlLabel3 } from "@elementor/editor-controls";
600
+ import { MinusIcon, PlusIcon } from "@elementor/icons";
601
+ import { Collapse as Collapse2, IconButton as IconButton2, Stack as Stack5 } from "@elementor/ui";
602
+ var SIZE2 = "tiny";
603
+ var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
604
+ return /* @__PURE__ */ React17.createElement(Stack5, { gap: 1.5 }, /* @__PURE__ */ React17.createElement(
605
+ Stack5,
606
+ {
607
+ direction: "row",
608
+ sx: {
609
+ justifyContent: "space-between",
610
+ alignItems: "center"
611
+ }
612
+ },
613
+ /* @__PURE__ */ React17.createElement(ControlLabel3, null, label),
614
+ isAdded ? /* @__PURE__ */ React17.createElement(IconButton2, { size: SIZE2, onClick: onRemove }, /* @__PURE__ */ React17.createElement(MinusIcon, { fontSize: SIZE2 })) : /* @__PURE__ */ React17.createElement(IconButton2, { size: SIZE2, onClick: onAdd }, /* @__PURE__ */ React17.createElement(PlusIcon, { fontSize: SIZE2 }))
615
+ ), /* @__PURE__ */ React17.createElement(Collapse2, { in: isAdded, unmountOnExit: true }, /* @__PURE__ */ React17.createElement(Stack5, { gap: 1.5 }, children)));
616
+ };
617
+
618
+ // src/components/style-sections/border-section/border-color-field.tsx
619
+ import * as React18 from "react";
620
+ import { ColorControl as ColorControl2, ControlLabel as ControlLabel4 } from "@elementor/editor-controls";
621
+ import { Grid as Grid2 } from "@elementor/ui";
622
+ import { __ as __3 } from "@wordpress/i18n";
623
+ var BorderColorField = () => {
624
+ return /* @__PURE__ */ React18.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React18.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React18.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React18.createElement(ControlLabel4, null, __3("Border Color", "elementor"))), /* @__PURE__ */ React18.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React18.createElement(ColorControl2, null))));
625
+ };
626
+
627
+ // src/components/style-sections/border-section/border-style-field.tsx
628
+ import * as React19 from "react";
629
+ import { ControlLabel as ControlLabel5, SelectControl as SelectControl2 } from "@elementor/editor-controls";
630
+ import { Grid as Grid3 } from "@elementor/ui";
631
+ import { __ as __4 } from "@wordpress/i18n";
632
+ var borderStyles = [
633
+ { value: "none", label: __4("None", "elementor") },
634
+ { value: "solid", label: __4("Solid", "elementor") },
635
+ { value: "dashed", label: __4("Dashed", "elementor") },
636
+ { value: "dotted", label: __4("Dotted", "elementor") },
637
+ { value: "double", label: __4("Double", "elementor") },
638
+ { value: "groove", label: __4("Groove", "elementor") },
639
+ { value: "ridge", label: __4("Ridge", "elementor") },
640
+ { value: "inset", label: __4("Inset", "elementor") },
641
+ { value: "outset", label: __4("Outset", "elementor") }
642
+ ];
643
+ var BorderStyleField = () => {
644
+ return /* @__PURE__ */ React19.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React19.createElement(Grid3, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React19.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(ControlLabel5, null, __4("Border Type", "elementor"))), /* @__PURE__ */ React19.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(SelectControl2, { options: borderStyles }))));
645
+ };
646
+
647
+ // src/components/style-sections/border-section/border-width-field.tsx
648
+ import * as React20 from "react";
649
+ import { EqualUnequalSizesControl } from "@elementor/editor-controls";
650
+ import { SideAllIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
651
+ import { __ as __5 } from "@wordpress/i18n";
652
+ var edges = [
653
+ {
654
+ label: __5("Top", "elementor"),
655
+ icon: /* @__PURE__ */ React20.createElement(SideTopIcon, { fontSize: "tiny" }),
656
+ bind: "top"
657
+ },
658
+ {
659
+ label: __5("Right", "elementor"),
660
+ icon: /* @__PURE__ */ React20.createElement(SideRightIcon, { fontSize: "tiny" }),
661
+ bind: "right"
662
+ },
663
+ {
664
+ label: __5("Bottom", "elementor"),
665
+ icon: /* @__PURE__ */ React20.createElement(SideBottomIcon, { fontSize: "tiny" }),
666
+ bind: "bottom"
667
+ },
668
+ {
669
+ label: __5("Left", "elementor"),
670
+ icon: /* @__PURE__ */ React20.createElement(SideLeftIcon, { fontSize: "tiny" }),
671
+ bind: "left"
672
+ }
673
+ ];
674
+ var BorderWidthField = () => {
675
+ return /* @__PURE__ */ React20.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React20.createElement(
676
+ EqualUnequalSizesControl,
677
+ {
678
+ label: __5("Border Width", "elementor"),
679
+ icon: /* @__PURE__ */ React20.createElement(SideAllIcon, { fontSize: "tiny" }),
680
+ items: edges,
681
+ multiSizeType: "border-width"
682
+ }
683
+ ));
684
+ };
685
+
686
+ // src/components/style-sections/border-section/border-field.tsx
687
+ var initialSize = { $$type: "size", value: { size: 1, unit: "px" } };
688
+ var initialBorderWidth = {
689
+ $$type: "border-width",
690
+ value: { top: initialSize, right: initialSize, bottom: initialSize, left: initialSize }
691
+ };
692
+ var initialBorderColor = { $$type: "color", value: "#000000" };
693
+ var initialBorderStyle = "solid";
694
+ var BorderField = () => {
695
+ const [borderWidth, setBorderWidth] = useStylesField("border-width");
696
+ const [borderColor, setBorderColor] = useStylesField("border-color");
697
+ const [borderStyle, setBorderStyle] = useStylesField("border-style");
698
+ const addBorder = () => {
699
+ setBorderWidth(initialBorderWidth);
700
+ setBorderColor(initialBorderColor);
701
+ setBorderStyle(initialBorderStyle);
702
+ };
703
+ const removeBorder = () => {
704
+ setBorderWidth(null);
705
+ setBorderColor(null);
706
+ setBorderStyle(null);
707
+ };
708
+ const hasBorder = Boolean(borderWidth || borderColor || borderStyle);
709
+ return /* @__PURE__ */ React21.createElement(
710
+ AddOrRemoveContent,
711
+ {
712
+ label: __6("Border", "elementor"),
713
+ isAdded: hasBorder,
714
+ onAdd: addBorder,
715
+ onRemove: removeBorder
716
+ },
717
+ /* @__PURE__ */ React21.createElement(BorderWidthField, null),
718
+ /* @__PURE__ */ React21.createElement(BorderColorField, null),
719
+ /* @__PURE__ */ React21.createElement(BorderStyleField, null)
720
+ );
721
+ };
722
+
723
+ // src/components/style-sections/border-section/border-radius-field.tsx
724
+ import * as React22 from "react";
725
+ import { EqualUnequalSizesControl as EqualUnequalSizesControl2 } from "@elementor/editor-controls";
726
+ import {
727
+ BorderCornersIcon,
728
+ RadiusBottomLeftIcon,
729
+ RadiusBottomRightIcon,
730
+ RadiusTopLeftIcon,
731
+ RadiusTopRightIcon
732
+ } from "@elementor/icons";
733
+ import { __ as __7 } from "@wordpress/i18n";
734
+ var corners = [
735
+ {
736
+ label: __7("Top Left", "elementor"),
737
+ icon: /* @__PURE__ */ React22.createElement(RadiusTopLeftIcon, { fontSize: "tiny" }),
738
+ bind: "top-left"
739
+ },
1044
740
  {
1045
- value: "visible",
1046
- label: __6("Visible", "elementor"),
1047
- icon: EyeIcon2,
1048
- showTooltip: true
741
+ label: __7("Top Right", "elementor"),
742
+ icon: /* @__PURE__ */ React22.createElement(RadiusTopRightIcon, { fontSize: "tiny" }),
743
+ bind: "top-right"
1049
744
  },
1050
745
  {
1051
- value: "hidden",
1052
- label: __6("Hidden", "elementor"),
1053
- icon: EyeOffIcon2,
1054
- showTooltip: true
746
+ label: __7("Bottom Right", "elementor"),
747
+ icon: /* @__PURE__ */ React22.createElement(RadiusBottomRightIcon, { fontSize: "tiny" }),
748
+ bind: "bottom-right"
1055
749
  },
1056
750
  {
1057
- value: "auto",
1058
- label: __6("Auto", "elementor"),
1059
- icon: ExpandBottomIcon,
1060
- showTooltip: true
751
+ label: __7("Bottom Left", "elementor"),
752
+ icon: /* @__PURE__ */ React22.createElement(RadiusBottomLeftIcon, { fontSize: "tiny" }),
753
+ bind: "bottom-left"
1061
754
  }
1062
755
  ];
1063
- var OverflowField = () => {
1064
- return /* @__PURE__ */ React30.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React30.createElement(Grid4, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React30.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, __6("Overflow", "elementor"))), /* @__PURE__ */ React30.createElement(Grid4, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React30.createElement(ToggleControl, { options }))));
756
+ var BorderRadiusField = () => {
757
+ return /* @__PURE__ */ React22.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React22.createElement(
758
+ EqualUnequalSizesControl2,
759
+ {
760
+ label: __7("Border Radius", "elementor"),
761
+ icon: /* @__PURE__ */ React22.createElement(BorderCornersIcon, { fontSize: "tiny" }),
762
+ items: corners,
763
+ multiSizeType: "border-radius"
764
+ }
765
+ ));
1065
766
  };
1066
767
 
1067
- // src/components/style-sections/size-section/size-section.tsx
1068
- var SizeSection = () => {
1069
- return /* @__PURE__ */ React31.createElement(AccordionSection, { title: __7("Size", "elementor") }, /* @__PURE__ */ React31.createElement(Stack8, { gap: 1.5 }, /* @__PURE__ */ React31.createElement(Grid5, { container: true, spacing: 2 }, /* @__PURE__ */ React31.createElement(SizeField, { bind: "width", label: __7("Width", "elementor") }), /* @__PURE__ */ React31.createElement(SizeField, { bind: "height", label: __7("Height", "elementor") })), /* @__PURE__ */ React31.createElement(Grid5, { container: true, spacing: 2 }, /* @__PURE__ */ React31.createElement(SizeField, { bind: "min-width", label: __7("Min. Width", "elementor") }), /* @__PURE__ */ React31.createElement(SizeField, { bind: "min-height", label: __7("Min. Height", "elementor") })), /* @__PURE__ */ React31.createElement(Grid5, { container: true, spacing: 2 }, /* @__PURE__ */ React31.createElement(SizeField, { bind: "max-width", label: __7("Max. Width", "elementor") }), /* @__PURE__ */ React31.createElement(SizeField, { bind: "max-height", label: __7("Max. Height", "elementor") })), /* @__PURE__ */ React31.createElement(Divider, null), /* @__PURE__ */ React31.createElement(Stack8, null, /* @__PURE__ */ React31.createElement(OverflowField, null))));
1070
- };
1071
- var SizeField = ({ label, bind }) => {
1072
- return /* @__PURE__ */ React31.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(StylesField, { bind }, /* @__PURE__ */ React31.createElement(Grid5, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React31.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(ControlLabel, null, label)), /* @__PURE__ */ React31.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(SizeControl, null)))));
768
+ // src/components/style-sections/border-section/border-section.tsx
769
+ var BorderSection = () => /* @__PURE__ */ React23.createElement(Stack6, { gap: 1.5 }, /* @__PURE__ */ React23.createElement(BorderRadiusField, null), /* @__PURE__ */ React23.createElement(Divider2, null), /* @__PURE__ */ React23.createElement(BorderField, null));
770
+
771
+ // src/components/style-sections/effects-section/effects-section.tsx
772
+ import * as React24 from "react";
773
+ import { BoxShadowRepeaterControl } from "@elementor/editor-controls";
774
+ import { Stack as Stack7 } from "@elementor/ui";
775
+ var EffectsSection = () => {
776
+ return /* @__PURE__ */ React24.createElement(Stack7, { gap: 1.5 }, /* @__PURE__ */ React24.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React24.createElement(BoxShadowRepeaterControl, null)));
1073
777
  };
1074
778
 
1075
- // src/components/style-sections/typography-section/typography-section.tsx
1076
- import * as React44 from "react";
1077
- import { Divider as Divider2, Stack as Stack11 } from "@elementor/ui";
779
+ // src/components/style-sections/layout-section/layout-section.tsx
780
+ import * as React31 from "react";
781
+ import { ControlLabel as ControlLabel12 } from "@elementor/editor-controls";
782
+ import { Divider as Divider3, Stack as Stack11 } from "@elementor/ui";
783
+ import { __ as __14 } from "@wordpress/i18n";
1078
784
 
1079
- // src/components/style-sections/typography-section/text-style-field.tsx
1080
- import * as React32 from "react";
785
+ // src/components/style-sections/layout-section/align-items-field.tsx
786
+ import * as React25 from "react";
787
+ import { ControlLabel as ControlLabel6, ToggleControl } from "@elementor/editor-controls";
788
+ import {
789
+ LayoutAlignCenterIcon as CenterIcon,
790
+ LayoutAlignLeftIcon,
791
+ LayoutAlignRightIcon,
792
+ LayoutDistributeVerticalIcon as JustifyIcon
793
+ } from "@elementor/icons";
794
+ import { DirectionProvider, Grid as Grid4, ThemeProvider, useTheme as useTheme2, withDirection } from "@elementor/ui";
1081
795
  import { __ as __8 } from "@wordpress/i18n";
1082
- import { Grid as Grid6, ToggleButton as ToggleButtonBase, ToggleButtonGroup as ToggleButtonGroup2 } from "@elementor/ui";
1083
- import { ItalicIcon, StrikethroughIcon, UnderlineIcon } from "@elementor/icons";
1084
- var buttonSize = "tiny";
1085
- var TextStyleField = () => {
1086
- const [fontStyle, setFontStyle] = useStylesField("font-style");
1087
- const [textDecoration, setTextDecoration] = useStylesField("text-decoration");
1088
- const formats = [fontStyle, ...(textDecoration || "").split(" ")];
1089
- return /* @__PURE__ */ React32.createElement(Grid6, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React32.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(ControlLabel, null, __8("Style", "elementor"))), /* @__PURE__ */ React32.createElement(Grid6, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React32.createElement(ToggleButtonGroup2, { value: formats }, /* @__PURE__ */ React32.createElement(
1090
- ToggleButton2,
796
+
797
+ // src/hooks/use-direction.ts
798
+ import { useTheme } from "@elementor/ui";
799
+ function useDirection() {
800
+ const theme = useTheme(), extendedWindow = window;
801
+ const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!extendedWindow.elementorFrontend?.config?.is_rtl;
802
+ return { isSiteRtl, isUiRtl };
803
+ }
804
+
805
+ // src/components/style-sections/layout-section/align-items-field.tsx
806
+ var AlignItemsField = () => {
807
+ const options7 = useOptions2(), { isSiteRtl } = useDirection();
808
+ return /* @__PURE__ */ React25.createElement(DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React25.createElement(ThemeProvider, null, /* @__PURE__ */ React25.createElement(StylesField, { bind: "align-items" }, /* @__PURE__ */ React25.createElement(Grid4, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React25.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React25.createElement(ControlLabel6, null, __8("Align Items", "elementor"))), /* @__PURE__ */ React25.createElement(Grid4, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React25.createElement(ToggleControl, { options: options7 }))))));
809
+ };
810
+ var useOptions2 = () => {
811
+ const StartIcon = withDirection(LayoutAlignLeftIcon), EndIcon = withDirection(LayoutAlignRightIcon);
812
+ return [
1091
813
  {
1092
- value: "italic",
1093
- onChange: (v) => setFontStyle(fontStyle === v ? null : v),
1094
- "aria-label": "italic",
1095
- sx: { marginLeft: "auto" }
814
+ value: "start",
815
+ label: __8("Start", "elementor"),
816
+ renderContent: ({ size }) => /* @__PURE__ */ React25.createElement(RotatedIcon, { icon: StartIcon, size }),
817
+ showTooltip: true
1096
818
  },
1097
- /* @__PURE__ */ React32.createElement(ItalicIcon, { fontSize: buttonSize })
1098
- ), /* @__PURE__ */ React32.createElement(
1099
- ShorthandControl,
1100
819
  {
1101
- value: "line-through",
1102
- currentValues: textDecoration || "",
1103
- updateValues: setTextDecoration,
1104
- "aria-label": "line-through"
820
+ value: "center",
821
+ label: __8("Center", "elementor"),
822
+ renderContent: ({ size }) => /* @__PURE__ */ React25.createElement(RotatedIcon, { icon: CenterIcon, size }),
823
+ showTooltip: true
1105
824
  },
1106
- /* @__PURE__ */ React32.createElement(StrikethroughIcon, { fontSize: buttonSize })
1107
- ), /* @__PURE__ */ React32.createElement(
1108
- ShorthandControl,
1109
825
  {
1110
- value: "underline",
1111
- currentValues: textDecoration || "",
1112
- updateValues: setTextDecoration,
1113
- "aria-label": "underline"
826
+ value: "end",
827
+ label: __8("End", "elementor"),
828
+ renderContent: ({ size }) => /* @__PURE__ */ React25.createElement(RotatedIcon, { icon: EndIcon, size }),
829
+ showTooltip: true
1114
830
  },
1115
- /* @__PURE__ */ React32.createElement(UnderlineIcon, { fontSize: buttonSize })
1116
- ))));
1117
- };
1118
- var ShorthandControl = ({
1119
- children,
1120
- value,
1121
- currentValues,
1122
- updateValues,
1123
- "aria-label": ariaLabel
1124
- }) => {
1125
- const valuesArr = currentValues.split(" ").filter(Boolean);
1126
- const selected = valuesArr.includes(value);
1127
- const toggleValue = (newValue) => {
1128
- if (selected) {
1129
- updateValues(valuesArr.filter((v) => v !== newValue).join(" ") || null);
1130
- } else {
1131
- updateValues([...valuesArr, newValue].join(" "));
831
+ {
832
+ value: "justify",
833
+ label: __8("Justify", "elementor"),
834
+ renderContent: ({ size }) => /* @__PURE__ */ React25.createElement(RotatedIcon, { icon: JustifyIcon, size }),
835
+ showTooltip: true
1132
836
  }
837
+ ];
838
+ };
839
+ var RotatedIcon = ({ icon: Icon, size }) => {
840
+ const [direction] = useStylesField("flex-direction"), isRtl = "rtl" === useTheme2().direction, rotationMultiplier = isRtl ? -1 : 1;
841
+ const rotationAngelMap = {
842
+ row: 90,
843
+ column: 0,
844
+ "row-reverse": -90,
845
+ "column-reverse": -180
1133
846
  };
1134
- return /* @__PURE__ */ React32.createElement(ToggleButton2, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
1135
- };
1136
- var ToggleButton2 = ({ onChange, ...props }) => {
1137
- const handleChange = (_e, newValue) => {
1138
- onChange(newValue);
1139
- };
1140
- return /* @__PURE__ */ React32.createElement(ToggleButtonBase, { ...props, onChange: handleChange, size: buttonSize });
847
+ return /* @__PURE__ */ React25.createElement(
848
+ Icon,
849
+ {
850
+ fontSize: size,
851
+ sx: { transition: ".3s", rotate: `${rotationAngelMap[direction || "row"] * rotationMultiplier}deg` }
852
+ }
853
+ );
1141
854
  };
1142
855
 
1143
- // src/components/style-sections/typography-section/typography-section.tsx
1144
- import { __ as __20 } from "@wordpress/i18n";
1145
-
1146
- // src/components/style-sections/typography-section/font-size-field.tsx
1147
- import * as React33 from "react";
856
+ // src/components/style-sections/layout-section/display-field.tsx
857
+ import * as React26 from "react";
858
+ import { ControlLabel as ControlLabel7, ToggleControl as ToggleControl2 } from "@elementor/editor-controls";
859
+ import { Stack as Stack8 } from "@elementor/ui";
1148
860
  import { __ as __9 } from "@wordpress/i18n";
1149
- import { Grid as Grid7 } from "@elementor/ui";
1150
- var FontSizeField = () => {
1151
- return /* @__PURE__ */ React33.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React33.createElement(Grid7, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React33.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(ControlLabel, null, __9("Font Size", "elementor"))), /* @__PURE__ */ React33.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SizeControl, null))));
861
+ var DisplayField = () => {
862
+ const options7 = [
863
+ {
864
+ value: "block",
865
+ renderContent: () => __9("Block", "elementor"),
866
+ label: __9("Block", "elementor")
867
+ },
868
+ {
869
+ value: "flex",
870
+ renderContent: () => __9("Flex", "elementor"),
871
+ label: __9("Flex", "elementor")
872
+ }
873
+ ];
874
+ return /* @__PURE__ */ React26.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React26.createElement(Stack8, { gap: 1 }, /* @__PURE__ */ React26.createElement(ControlLabel7, null, __9("Display", "elementor")), /* @__PURE__ */ React26.createElement(ToggleControl2, { options: options7, fullWidth: true })));
1152
875
  };
1153
876
 
1154
- // src/components/style-sections/typography-section/font-weight-field.tsx
1155
- import * as React34 from "react";
877
+ // src/components/style-sections/layout-section/flex-direction-field.tsx
878
+ import * as React27 from "react";
879
+ import { ControlLabel as ControlLabel8, ToggleControl as ToggleControl3 } from "@elementor/editor-controls";
880
+ import { ArrowDownSmallIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpSmallIcon } from "@elementor/icons";
881
+ import { DirectionProvider as DirectionProvider2, Grid as Grid5, ThemeProvider as ThemeProvider2, withDirection as withDirection2 } from "@elementor/ui";
1156
882
  import { __ as __10 } from "@wordpress/i18n";
1157
- import { Grid as Grid8 } from "@elementor/ui";
1158
- var fontWeightOptions = [
1159
- { label: __10("Light - 400", "elementor"), value: "400" },
1160
- { label: __10("Regular - 500", "elementor"), value: "500" },
1161
- { label: __10("Semi Bold - 600", "elementor"), value: "600" },
1162
- { label: __10("Bold - 700", "elementor"), value: "700" },
1163
- { label: __10("Black - 900", "elementor"), value: "900" }
883
+ var options = [
884
+ {
885
+ value: "row",
886
+ label: __10("Row", "elementor"),
887
+ renderContent: ({ size }) => {
888
+ const StartIcon = withDirection2(ArrowRightIcon);
889
+ return /* @__PURE__ */ React27.createElement(StartIcon, { fontSize: size });
890
+ },
891
+ showTooltip: true
892
+ },
893
+ {
894
+ value: "column",
895
+ label: __10("Column", "elementor"),
896
+ renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(ArrowDownSmallIcon, { fontSize: size }),
897
+ showTooltip: true
898
+ },
899
+ {
900
+ value: "row-reverse",
901
+ label: __10("Row reverse", "elementor"),
902
+ renderContent: ({ size }) => {
903
+ const EndIcon = withDirection2(ArrowLeftIcon);
904
+ return /* @__PURE__ */ React27.createElement(EndIcon, { fontSize: size });
905
+ },
906
+ showTooltip: true
907
+ },
908
+ {
909
+ value: "column-reverse",
910
+ label: __10("Column reverse", "elementor"),
911
+ renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(ArrowUpSmallIcon, { fontSize: size }),
912
+ showTooltip: true
913
+ }
1164
914
  ];
1165
- var FontWeightField = () => {
1166
- return /* @__PURE__ */ React34.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React34.createElement(Grid8, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React34.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(ControlLabel, null, __10("Font Weight", "elementor"))), /* @__PURE__ */ React34.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(SelectControl, { options: fontWeightOptions }))));
915
+ var FlexDirectionField = () => {
916
+ const { isSiteRtl } = useDirection();
917
+ return /* @__PURE__ */ React27.createElement(DirectionProvider2, { rtl: isSiteRtl }, /* @__PURE__ */ React27.createElement(ThemeProvider2, null, /* @__PURE__ */ React27.createElement(StylesField, { bind: "flex-direction" }, /* @__PURE__ */ React27.createElement(Grid5, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React27.createElement(ControlLabel8, null, __10("Direction", "elementor"))), /* @__PURE__ */ React27.createElement(Grid5, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React27.createElement(ToggleControl3, { options }))))));
1167
918
  };
1168
919
 
1169
- // src/components/style-sections/typography-section/text-color-field.tsx
1170
- import * as React35 from "react";
920
+ // src/components/style-sections/layout-section/flex-order-field.tsx
921
+ import * as React28 from "react";
922
+ import { useState as useState2 } from "react";
923
+ import {
924
+ ControlLabel as ControlLabel9,
925
+ ControlToggleButtonGroup,
926
+ NumberControl
927
+ } from "@elementor/editor-controls";
928
+ import { ArrowDownSmallIcon as ArrowDownSmallIcon2, ArrowUpSmallIcon as ArrowUpSmallIcon2, PencilIcon } from "@elementor/icons";
929
+ import { DirectionProvider as DirectionProvider3, Grid as Grid6, Stack as Stack9, ThemeProvider as ThemeProvider3 } from "@elementor/ui";
1171
930
  import { __ as __11 } from "@wordpress/i18n";
1172
- import { Grid as Grid9 } from "@elementor/ui";
1173
- var TextColorField = () => {
1174
- return /* @__PURE__ */ React35.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React35.createElement(Grid9, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React35.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel, null, __11("Text Color", "elementor"))), /* @__PURE__ */ React35.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ColorControl, null))));
931
+ var FIRST_DEFAULT_VALUE = -99999;
932
+ var LAST_DEFAULT_VALUE = 99999;
933
+ var FIRST = "first";
934
+ var LAST = "last";
935
+ var CUSTOM = "custom";
936
+ var items = [
937
+ {
938
+ value: FIRST,
939
+ label: __11("First", "elementor"),
940
+ renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(ArrowUpSmallIcon2, { fontSize: size }),
941
+ showTooltip: true
942
+ },
943
+ {
944
+ value: LAST,
945
+ label: __11("Last", "elementor"),
946
+ renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(ArrowDownSmallIcon2, { fontSize: size }),
947
+ showTooltip: true
948
+ },
949
+ {
950
+ value: CUSTOM,
951
+ label: __11("Custom", "elementor"),
952
+ renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(PencilIcon, { fontSize: size }),
953
+ showTooltip: true
954
+ }
955
+ ];
956
+ var FlexOrderField = () => {
957
+ const { isSiteRtl } = useDirection(), [order, setOrder] = useStylesField("order");
958
+ const [groupControlValue, setGroupControlValue] = useState2(getGroupControlValue(order));
959
+ const handleToggleButtonChange = (group) => {
960
+ setGroupControlValue(group);
961
+ const orderValueMap = {
962
+ [FIRST]: FIRST_DEFAULT_VALUE,
963
+ [LAST]: LAST_DEFAULT_VALUE,
964
+ [CUSTOM]: null
965
+ };
966
+ setOrder(group ? orderValueMap[group] : null);
967
+ };
968
+ return /* @__PURE__ */ React28.createElement(DirectionProvider3, { rtl: isSiteRtl }, /* @__PURE__ */ React28.createElement(ThemeProvider3, null, /* @__PURE__ */ React28.createElement(Stack9, { gap: 2 }, /* @__PURE__ */ React28.createElement(Grid6, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlLabel9, null, __11("Order", "elementor"))), /* @__PURE__ */ React28.createElement(Grid6, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React28.createElement(
969
+ ControlToggleButtonGroup,
970
+ {
971
+ items,
972
+ value: groupControlValue,
973
+ onChange: handleToggleButtonChange,
974
+ exclusive: true
975
+ }
976
+ ))), CUSTOM === groupControlValue && /* @__PURE__ */ React28.createElement(StylesField, { bind: "order" }, /* @__PURE__ */ React28.createElement(Grid6, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlLabel9, null, __11("Custom order", "elementor"))), /* @__PURE__ */ React28.createElement(Grid6, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React28.createElement(
977
+ NumberControl,
978
+ {
979
+ min: FIRST_DEFAULT_VALUE + 1,
980
+ max: LAST_DEFAULT_VALUE - 1,
981
+ shouldForceInt: true
982
+ }
983
+ )))))));
1175
984
  };
1176
-
1177
- // src/components/style-sections/typography-section/letter-spacing-field.tsx
1178
- import * as React36 from "react";
1179
- import { __ as __12 } from "@wordpress/i18n";
1180
- import { Grid as Grid10 } from "@elementor/ui";
1181
- var LetterSpacingField = () => {
1182
- return /* @__PURE__ */ React36.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React36.createElement(Grid10, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React36.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel, null, __12("Letter Spacing", "elementor"))), /* @__PURE__ */ React36.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(SizeControl, null))));
985
+ var getGroupControlValue = (order) => {
986
+ if (LAST_DEFAULT_VALUE === order) {
987
+ return LAST;
988
+ }
989
+ if (FIRST_DEFAULT_VALUE === order) {
990
+ return FIRST;
991
+ }
992
+ return 0 === order || order ? CUSTOM : null;
1183
993
  };
1184
994
 
1185
- // src/components/style-sections/typography-section/word-spacing-field.tsx
1186
- import * as React37 from "react";
1187
- import { __ as __13 } from "@wordpress/i18n";
1188
- import { Grid as Grid11 } from "@elementor/ui";
1189
- var WordSpacingField = () => {
1190
- return /* @__PURE__ */ React37.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React37.createElement(Grid11, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React37.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel, null, __13("Word Spacing", "elementor"))), /* @__PURE__ */ React37.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(SizeControl, null))));
995
+ // src/components/style-sections/layout-section/justify-content-field.tsx
996
+ import * as React29 from "react";
997
+ import { ControlLabel as ControlLabel10, ToggleControl as ToggleControl4 } from "@elementor/editor-controls";
998
+ import {
999
+ JustifyBottomIcon,
1000
+ JustifyCenterIcon as CenterIcon2,
1001
+ JustifyDistributeVerticalIcon as EvenlyIcon,
1002
+ JustifySpaceAroundVerticalIcon as AroundIcon,
1003
+ JustifySpaceBetweenVerticalIcon as BetweenIcon,
1004
+ JustifyTopIcon
1005
+ } from "@elementor/icons";
1006
+ import {
1007
+ DirectionProvider as DirectionProvider4,
1008
+ Stack as Stack10,
1009
+ ThemeProvider as ThemeProvider4,
1010
+ useTheme as useTheme3,
1011
+ withDirection as withDirection3
1012
+ } from "@elementor/ui";
1013
+ import { __ as __12 } from "@wordpress/i18n";
1014
+ var JustifyContentField = () => {
1015
+ const options7 = useOptions3(), { isSiteRtl } = useDirection();
1016
+ return /* @__PURE__ */ React29.createElement(DirectionProvider4, { rtl: isSiteRtl }, /* @__PURE__ */ React29.createElement(ThemeProvider4, null, /* @__PURE__ */ React29.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React29.createElement(Stack10, { gap: 1 }, /* @__PURE__ */ React29.createElement(ControlLabel10, null, __12("Justify Content", "elementor")), /* @__PURE__ */ React29.createElement(ToggleControl4, { options: options7, fullWidth: true })))));
1191
1017
  };
1192
-
1193
- // src/components/collapsible-content.tsx
1194
- import * as React38 from "react";
1195
- import { useState as useState3 } from "react";
1196
- import { ChevronDownIcon } from "@elementor/icons";
1197
- import { Button as Button3, Collapse, Stack as Stack9, styled as styled4 } from "@elementor/ui";
1198
- import { __ as __14 } from "@wordpress/i18n";
1199
- var CollapsibleContent = ({ children, defaultOpen = false }) => {
1200
- const [open, setOpen] = useState3(defaultOpen);
1201
- const handleToggle = () => {
1202
- setOpen((prevOpen) => !prevOpen);
1203
- };
1204
- return /* @__PURE__ */ React38.createElement(Stack9, { sx: { py: 0.5 } }, /* @__PURE__ */ React38.createElement(
1205
- Button3,
1018
+ var useOptions3 = () => {
1019
+ const StartIcon = withDirection3(JustifyTopIcon), EndIcon = withDirection3(JustifyBottomIcon);
1020
+ return [
1206
1021
  {
1207
- fullWidth: true,
1208
- size: "small",
1209
- color: "secondary",
1210
- variant: "outlined",
1211
- onClick: handleToggle,
1212
- endIcon: /* @__PURE__ */ React38.createElement(ChevronIcon, { open })
1022
+ value: "start",
1023
+ label: __12("Start", "elementor"),
1024
+ renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon2, { icon: StartIcon, size }),
1025
+ showTooltip: true
1026
+ },
1027
+ {
1028
+ value: "center",
1029
+ label: __12("Center", "elementor"),
1030
+ renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon2, { icon: CenterIcon2, size }),
1031
+ showTooltip: true
1032
+ },
1033
+ {
1034
+ value: "end",
1035
+ label: __12("End", "elementor"),
1036
+ renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon2, { icon: EndIcon, size }),
1037
+ showTooltip: true
1038
+ },
1039
+ {
1040
+ value: "space-between",
1041
+ label: __12("Space between", "elementor"),
1042
+ renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon2, { icon: BetweenIcon, size }),
1043
+ showTooltip: true
1044
+ },
1045
+ {
1046
+ value: "space-around",
1047
+ label: __12("Space around", "elementor"),
1048
+ renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon2, { icon: AroundIcon, size }),
1049
+ showTooltip: true
1213
1050
  },
1214
- open ? __14("Show less", "elementor") : __14("Show more", "elementor")
1215
- ), /* @__PURE__ */ React38.createElement(Collapse, { in: open, timeout: "auto" }, children));
1051
+ {
1052
+ value: "space-evenly",
1053
+ label: __12("Space evenly", "elementor"),
1054
+ renderContent: ({ size }) => /* @__PURE__ */ React29.createElement(RotatedIcon2, { icon: EvenlyIcon, size }),
1055
+ showTooltip: true
1056
+ }
1057
+ ];
1058
+ };
1059
+ var RotatedIcon2 = ({ icon: Icon, size }) => {
1060
+ const [direction] = useStylesField("flex-direction"), isRtl = "rtl" === useTheme3().direction, rotationMultiplier = isRtl ? -1 : 1;
1061
+ const rotationAngelMap = {
1062
+ row: -90,
1063
+ column: 0,
1064
+ "row-reverse": 90,
1065
+ "column-reverse": 180
1066
+ };
1067
+ return /* @__PURE__ */ React29.createElement(
1068
+ Icon,
1069
+ {
1070
+ fontSize: size,
1071
+ sx: { transition: ".3s", rotate: `${rotationAngelMap[direction || "row"] * rotationMultiplier}deg` }
1072
+ }
1073
+ );
1216
1074
  };
1217
- var ChevronIcon = styled4(ChevronDownIcon, {
1218
- shouldForwardProp: (prop) => prop !== "open"
1219
- })(({ theme, open }) => ({
1220
- transform: open ? "rotate(180deg)" : "rotate(0)",
1221
- transition: theme.transitions.create("transform", {
1222
- duration: theme.transitions.duration.standard
1223
- })
1224
- }));
1225
1075
 
1226
- // src/components/style-sections/typography-section/transform-field.tsx
1227
- import * as React39 from "react";
1228
- import { __ as __15 } from "@wordpress/i18n";
1229
- import { Grid as Grid12 } from "@elementor/ui";
1230
- import { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon } from "@elementor/icons";
1076
+ // src/components/style-sections/layout-section/wrap-field.tsx
1077
+ import * as React30 from "react";
1078
+ import { ControlLabel as ControlLabel11, ToggleControl as ToggleControl5 } from "@elementor/editor-controls";
1079
+ import { ArrowBackIcon, ArrowForwardIcon, ArrowRightIcon as ArrowRightIcon2 } from "@elementor/icons";
1080
+ import { DirectionProvider as DirectionProvider5, Grid as Grid7, ThemeProvider as ThemeProvider5 } from "@elementor/ui";
1081
+ import { __ as __13 } from "@wordpress/i18n";
1231
1082
  var options2 = [
1232
- { value: "capitalize", label: __15("Capitalize", "elementor"), icon: LetterCaseIcon },
1233
- { value: "uppercase", label: __15("Uppercase", "elementor"), icon: LetterCaseUpperIcon },
1234
- { value: "lowercase", label: __15("Lowercase", "elementor"), icon: LetterCaseLowerIcon }
1235
- ];
1236
- var TransformField = () => /* @__PURE__ */ React39.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React39.createElement(Grid12, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, __15("Transform", "elementor"))), /* @__PURE__ */ React39.createElement(Grid12, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React39.createElement(ToggleControl, { options: options2 }))));
1237
-
1238
- // src/components/style-sections/typography-section/text-alignment-field.tsx
1239
- import * as React40 from "react";
1240
- import { __ as __16 } from "@wordpress/i18n";
1241
- import { Grid as Grid13 } from "@elementor/ui";
1242
- import { AlignLeftIcon, AlignCenterIcon, AlignRightIcon, AlignJustifiedIcon } from "@elementor/icons";
1243
- var options3 = [
1244
- {
1245
- value: "left",
1246
- label: __16("Left", "elementor"),
1247
- icon: AlignLeftIcon
1248
- },
1249
1083
  {
1250
- value: "center",
1251
- label: __16("Center", "elementor"),
1252
- icon: AlignCenterIcon
1084
+ value: "nowrap",
1085
+ label: __13("No wrap", "elementor"),
1086
+ renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(ArrowRightIcon2, { fontSize: size }),
1087
+ showTooltip: true
1253
1088
  },
1254
1089
  {
1255
- value: "right",
1256
- label: __16("Right", "elementor"),
1257
- icon: AlignRightIcon
1090
+ value: "wrap",
1091
+ label: __13("Wrap", "elementor"),
1092
+ renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(ArrowBackIcon, { fontSize: size }),
1093
+ showTooltip: true
1258
1094
  },
1259
1095
  {
1260
- value: "justify",
1261
- label: __16("Justify", "elementor"),
1262
- icon: AlignJustifiedIcon
1096
+ value: "wrap-reverse",
1097
+ label: __13("Wrap reverse", "elementor"),
1098
+ renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(ArrowForwardIcon, { fontSize: size }),
1099
+ showTooltip: true
1263
1100
  }
1264
1101
  ];
1265
- var TextAlignmentField = () => {
1266
- return /* @__PURE__ */ React40.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React40.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React40.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlLabel, null, __16("Alignment", "elementor"))), /* @__PURE__ */ React40.createElement(Grid13, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React40.createElement(ToggleControl, { options: options3 }))));
1102
+ var WrapField = () => {
1103
+ const { isSiteRtl } = useDirection();
1104
+ return /* @__PURE__ */ React30.createElement(DirectionProvider5, { rtl: isSiteRtl }, /* @__PURE__ */ React30.createElement(ThemeProvider5, null, /* @__PURE__ */ React30.createElement(StylesField, { bind: "flex-wrap" }, /* @__PURE__ */ React30.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel11, null, __13("Wrap", "elementor"))), /* @__PURE__ */ React30.createElement(Grid7, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React30.createElement(ToggleControl5, { options: options2 }))))));
1267
1105
  };
1268
1106
 
1269
- // src/components/style-sections/typography-section/text-direction-field.tsx
1270
- import * as React41 from "react";
1271
- import { __ as __17 } from "@wordpress/i18n";
1272
- import { Grid as Grid14 } from "@elementor/ui";
1273
- import { TextDirectionLtrIcon, TextDirectionRtlIcon } from "@elementor/icons";
1274
- var options4 = [
1275
- {
1276
- value: "ltr",
1277
- label: __17("Left to Right", "elementor"),
1278
- icon: TextDirectionLtrIcon
1279
- },
1280
- {
1281
- value: "rtl",
1282
- label: __17("Right to Left", "elementor"),
1283
- icon: TextDirectionRtlIcon
1284
- }
1285
- ];
1286
- var TextDirectionField = () => {
1287
- return /* @__PURE__ */ React41.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React41.createElement(Grid14, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React41.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlLabel, null, __17("Direction", "elementor"))), /* @__PURE__ */ React41.createElement(Grid14, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React41.createElement(ToggleControl, { options: options4 }))));
1107
+ // src/components/style-sections/layout-section/layout-section.tsx
1108
+ var LayoutSection = () => {
1109
+ const [display] = useStylesField("display");
1110
+ return /* @__PURE__ */ React31.createElement(Stack11, { gap: 2 }, /* @__PURE__ */ React31.createElement(DisplayField, null), "flex" === display && /* @__PURE__ */ React31.createElement(FlexFields, null));
1288
1111
  };
1112
+ var FlexFields = () => /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(FlexDirectionField, null), /* @__PURE__ */ React31.createElement(JustifyContentField, null), /* @__PURE__ */ React31.createElement(AlignItemsField, null), /* @__PURE__ */ React31.createElement(Divider3, null), /* @__PURE__ */ React31.createElement(WrapField, null), /* @__PURE__ */ React31.createElement(Divider3, null), /* @__PURE__ */ React31.createElement(ControlLabel12, null, __14("Flex child", "elementor")), /* @__PURE__ */ React31.createElement(FlexOrderField, null));
1289
1113
 
1290
- // src/components/style-sections/typography-section/text-stroke-field.tsx
1291
- import * as React43 from "react";
1292
- import { __ as __19 } from "@wordpress/i18n";
1114
+ // src/components/style-sections/position-section/position-section.tsx
1115
+ import * as React35 from "react";
1116
+ import { useCallback as useCallback3 } from "react";
1117
+ import { Stack as Stack13 } from "@elementor/ui";
1293
1118
 
1294
- // src/components/collapsible-field.tsx
1295
- import * as React42 from "react";
1296
- import { useState as useState4 } from "react";
1297
- import { __ as __18 } from "@wordpress/i18n";
1298
- import { Collapse as Collapse2, IconButton as IconButton2, Stack as Stack10 } from "@elementor/ui";
1299
- import { MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
1300
- var CollapsibleField = ({ label, children, defaultOpen = false }) => {
1301
- const [open, setOpen] = useState4(defaultOpen);
1302
- const handleToggle = () => {
1303
- setOpen((prevOpen) => !prevOpen);
1304
- };
1305
- return /* @__PURE__ */ React42.createElement(Stack10, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(Stack10, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { py: 0.5 } }, label, /* @__PURE__ */ React42.createElement(
1306
- IconButton2,
1307
- {
1308
- onClick: handleToggle,
1309
- size: "tiny",
1310
- "aria-label": open ? __18("Close", "elementor") : __18("Expand", "elementor")
1311
- },
1312
- open ? /* @__PURE__ */ React42.createElement(MinusIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React42.createElement(PlusIcon2, { fontSize: "tiny" })
1313
- )), /* @__PURE__ */ React42.createElement(Collapse2, { in: open }, children));
1314
- };
1119
+ // src/hooks/use-style-prop-history.ts
1120
+ import { useCallback as useCallback2, useMemo as useMemo2 } from "react";
1121
+ import { getElementStyles, getVariantByMeta, updateStyle as updateStyle2 } from "@elementor/editor-elements";
1315
1122
 
1316
- // src/components/style-sections/typography-section/text-stroke-field.tsx
1317
- var TextStrokeField = () => {
1318
- return /* @__PURE__ */ React43.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React43.createElement(CollapsibleField, { label: /* @__PURE__ */ React43.createElement(ControlLabel, null, __19("Text Stroke", "elementor")) }, /* @__PURE__ */ React43.createElement(StrokeControl, null)));
1123
+ // src/hooks/use-prop-value-history.ts
1124
+ import { useCallback, useMemo } from "react";
1125
+ import { getSessionStorageItem, setSessionStorageItem } from "@elementor/utils";
1126
+ var PROPS_VALUES_HISTORY_PREFIX = "elementor/editor-editing-panel/prop-value-history";
1127
+ var usePropValueHistory = () => {
1128
+ const { element } = useElement();
1129
+ const elementKey = `${PROPS_VALUES_HISTORY_PREFIX}/${element.id}`;
1130
+ const getElementPropsHistory = useCallback(() => {
1131
+ return getSessionStorageItem(elementKey);
1132
+ }, [elementKey]);
1133
+ const getPropValue = useCallback(
1134
+ (propKey) => {
1135
+ const elementPropValues = getElementPropsHistory();
1136
+ return elementPropValues?.[propKey] ?? null;
1137
+ },
1138
+ [getElementPropsHistory]
1139
+ );
1140
+ const setPropValue = useCallback(
1141
+ (propKey, propValue) => {
1142
+ const elementPropValues = getElementPropsHistory();
1143
+ const updatedElementPropValues = { ...elementPropValues, [propKey]: propValue };
1144
+ setSessionStorageItem(elementKey, updatedElementPropValues);
1145
+ },
1146
+ [getElementPropsHistory, elementKey]
1147
+ );
1148
+ const removeProp = useCallback(
1149
+ (propKey) => {
1150
+ const elementPropValues = getElementPropsHistory();
1151
+ const updatedElementPropValues = Object.fromEntries(
1152
+ Object.entries(elementPropValues || {}).filter(([key]) => key !== propKey)
1153
+ );
1154
+ setSessionStorageItem(elementKey, updatedElementPropValues);
1155
+ },
1156
+ [getElementPropsHistory, elementKey]
1157
+ );
1158
+ return useMemo(() => ({ getPropValue, setPropValue, removeProp }), [getPropValue, removeProp, setPropValue]);
1319
1159
  };
1320
1160
 
1321
- // src/components/style-sections/typography-section/typography-section.tsx
1322
- var TypographySection = () => {
1323
- return /* @__PURE__ */ React44.createElement(AccordionSection, { title: __20("Typography", "elementor") }, /* @__PURE__ */ React44.createElement(Stack11, { gap: 1.5 }, /* @__PURE__ */ React44.createElement(FontWeightField, null), /* @__PURE__ */ React44.createElement(FontSizeField, null), /* @__PURE__ */ React44.createElement(Divider2, null), /* @__PURE__ */ React44.createElement(TextColorField, null), /* @__PURE__ */ React44.createElement(CollapsibleContent, null, /* @__PURE__ */ React44.createElement(Stack11, { gap: 1.5, sx: { pt: 1.5 } }, /* @__PURE__ */ React44.createElement(LetterSpacingField, null), /* @__PURE__ */ React44.createElement(WordSpacingField, null), /* @__PURE__ */ React44.createElement(Divider2, null), /* @__PURE__ */ React44.createElement(TextAlignmentField, null), /* @__PURE__ */ React44.createElement(TextStyleField, null), /* @__PURE__ */ React44.createElement(TransformField, null), /* @__PURE__ */ React44.createElement(TextDirectionField, null), /* @__PURE__ */ React44.createElement(TextStrokeField, null)))));
1161
+ // src/hooks/use-style-prop-history.ts
1162
+ var useStylePropsHistory = (props) => {
1163
+ const { element } = useElement();
1164
+ const { id: styleDefID, meta } = useStyle();
1165
+ const { getPropValue, setPropValue, removeProp } = usePropValueHistory();
1166
+ const styleDef = getElementStyles(element.id)?.[styleDefID];
1167
+ const styleVariant = styleDef ? getVariantByMeta(styleDef, meta) : null;
1168
+ const styleVariantPath = `${styleDefID}-${styleVariant?.meta.breakpoint}-${styleVariant?.meta.state}`;
1169
+ const saveStylePropsHistory = useCallback2(() => {
1170
+ props.forEach((propKey) => {
1171
+ const propValue = styleVariant?.props[propKey];
1172
+ if (propValue) {
1173
+ const propPath = `${styleVariantPath}-${propKey}`;
1174
+ setPropValue(propPath, propValue);
1175
+ }
1176
+ });
1177
+ }, [props, setPropValue, styleVariant?.props, styleVariantPath]);
1178
+ const updateStylePropsFromHistory = useCallback2(() => {
1179
+ const propValuesFromHistory = props.reduce((allProps, currentPropKey) => {
1180
+ const propPath = `${styleVariantPath}-${currentPropKey}`;
1181
+ const propHistory = getPropValue(propPath);
1182
+ if (propHistory) {
1183
+ removeProp(propPath);
1184
+ return { ...allProps, [currentPropKey]: propHistory };
1185
+ }
1186
+ return allProps;
1187
+ }, {});
1188
+ if (Object.keys(propValuesFromHistory).length) {
1189
+ updateStyle2({
1190
+ elementID: element.id,
1191
+ styleDefID,
1192
+ meta,
1193
+ props: propValuesFromHistory,
1194
+ bind: "classes"
1195
+ });
1196
+ }
1197
+ }, [element.id, getPropValue, meta, props, removeProp, styleDefID, styleVariantPath]);
1198
+ const clearCurrentStyleProps = useCallback2(() => {
1199
+ const resetValues = props.reduce(
1200
+ (allProps, currentPropKey) => ({
1201
+ ...allProps,
1202
+ [currentPropKey]: void 0
1203
+ }),
1204
+ {}
1205
+ );
1206
+ updateStyle2({
1207
+ elementID: element.id,
1208
+ styleDefID,
1209
+ meta,
1210
+ props: resetValues,
1211
+ bind: "classes"
1212
+ });
1213
+ }, [element.id, meta, props, styleDefID]);
1214
+ return useMemo2(
1215
+ () => ({ saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps }),
1216
+ [saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps]
1217
+ );
1324
1218
  };
1325
1219
 
1326
- // src/components/style-sections/position-section/position-section.tsx
1327
- import * as React48 from "react";
1328
- import { Stack as Stack13 } from "@elementor/ui";
1329
-
1330
- // src/components/style-sections/position-section/z-index-field.tsx
1331
- import * as React45 from "react";
1332
- import { __ as __21 } from "@wordpress/i18n";
1333
- import { Grid as Grid15 } from "@elementor/ui";
1334
- var ZIndexField = () => {
1335
- return /* @__PURE__ */ React45.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React45.createElement(Grid15, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React45.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(ControlLabel, null, __21("Z-Index", "elementor"))), /* @__PURE__ */ React45.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(NumberControl, null))));
1220
+ // src/components/style-sections/position-section/dimensions-field.tsx
1221
+ import * as React32 from "react";
1222
+ import { ControlLabel as ControlLabel13, SizeControl as SizeControl2 } from "@elementor/editor-controls";
1223
+ import { SideBottomIcon as SideBottomIcon2, SideLeftIcon as SideLeftIcon2, SideRightIcon as SideRightIcon2, SideTopIcon as SideTopIcon2 } from "@elementor/icons";
1224
+ import { Grid as Grid8, Stack as Stack12 } from "@elementor/ui";
1225
+ import { __ as __15 } from "@wordpress/i18n";
1226
+ var sideIcons = {
1227
+ left: /* @__PURE__ */ React32.createElement(SideLeftIcon2, { fontSize: "tiny" }),
1228
+ right: /* @__PURE__ */ React32.createElement(SideRightIcon2, { fontSize: "tiny" }),
1229
+ top: /* @__PURE__ */ React32.createElement(SideTopIcon2, { fontSize: "tiny" }),
1230
+ bottom: /* @__PURE__ */ React32.createElement(SideBottomIcon2, { fontSize: "tiny" })
1231
+ };
1232
+ var DimensionsField = () => {
1233
+ return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(Stack12, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(DimensionField, { side: "top", label: __15("Top", "elementor") }), /* @__PURE__ */ React32.createElement(DimensionField, { side: "right", label: __15("Right", "elementor") })), /* @__PURE__ */ React32.createElement(Stack12, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(DimensionField, { side: "bottom", label: __15("Bottom", "elementor") }), /* @__PURE__ */ React32.createElement(DimensionField, { side: "left", label: __15("Left", "elementor") })));
1234
+ };
1235
+ var DimensionField = ({ side, label }) => {
1236
+ return /* @__PURE__ */ React32.createElement(Grid8, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(ControlLabel13, null, label)), /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(StylesField, { bind: side }, /* @__PURE__ */ React32.createElement(SizeControl2, { startIcon: sideIcons[side] }))));
1336
1237
  };
1337
1238
 
1338
1239
  // src/components/style-sections/position-section/position-field.tsx
1339
- import * as React46 from "react";
1340
- import { __ as __22 } from "@wordpress/i18n";
1341
- import { Grid as Grid16 } from "@elementor/ui";
1240
+ import * as React33 from "react";
1241
+ import { ControlLabel as ControlLabel14, SelectControl as SelectControl3 } from "@elementor/editor-controls";
1242
+ import { Grid as Grid9 } from "@elementor/ui";
1243
+ import { __ as __16 } from "@wordpress/i18n";
1342
1244
  var positionOptions = [
1343
- { label: __22("Static", "elementor"), value: "static" },
1344
- { label: __22("Relative", "elementor"), value: "relative" },
1345
- { label: __22("Absolute", "elementor"), value: "absolute" },
1346
- { label: __22("Fixed", "elementor"), value: "fixed" }
1245
+ { label: __16("Static", "elementor"), value: "static" },
1246
+ { label: __16("Relative", "elementor"), value: "relative" },
1247
+ { label: __16("Absolute", "elementor"), value: "absolute" },
1248
+ { label: __16("Fixed", "elementor"), value: "fixed" }
1347
1249
  ];
1348
1250
  var PositionField = () => {
1349
- return /* @__PURE__ */ React46.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React46.createElement(Grid16, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React46.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlLabel, null, __22("Position", "elementor"))), /* @__PURE__ */ React46.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(SelectControl, { options: positionOptions }))));
1251
+ return /* @__PURE__ */ React33.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React33.createElement(Grid9, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React33.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(ControlLabel14, null, __16("Position", "elementor"))), /* @__PURE__ */ React33.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(SelectControl3, { options: positionOptions }))));
1350
1252
  };
1351
1253
 
1352
- // src/components/style-sections/position-section/position-section.tsx
1353
- import { __ as __24 } from "@wordpress/i18n";
1354
-
1355
- // src/components/style-sections/position-section/dimensions-field.tsx
1356
- import * as React47 from "react";
1357
- import { Grid as Grid17, Stack as Stack12 } from "@elementor/ui";
1358
- import { __ as __23 } from "@wordpress/i18n";
1359
- import { SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
1360
- var sideIcons = {
1361
- left: /* @__PURE__ */ React47.createElement(SideLeftIcon, { fontSize: "tiny" }),
1362
- right: /* @__PURE__ */ React47.createElement(SideRightIcon, { fontSize: "tiny" }),
1363
- top: /* @__PURE__ */ React47.createElement(SideTopIcon, { fontSize: "tiny" }),
1364
- bottom: /* @__PURE__ */ React47.createElement(SideBottomIcon, { fontSize: "tiny" })
1365
- };
1366
- var DimensionsField = () => {
1367
- return /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(Stack12, { direction: "row", gap: 2 }, /* @__PURE__ */ React47.createElement(DimensionField, { side: "top", label: __23("Top", "elementor") }), /* @__PURE__ */ React47.createElement(DimensionField, { side: "right", label: __23("Right", "elementor") })), /* @__PURE__ */ React47.createElement(Stack12, { direction: "row", gap: 2 }, /* @__PURE__ */ React47.createElement(DimensionField, { side: "bottom", label: __23("Bottom", "elementor") }), /* @__PURE__ */ React47.createElement(DimensionField, { side: "left", label: __23("Left", "elementor") })));
1368
- };
1369
- var DimensionField = ({ side, label }) => {
1370
- return /* @__PURE__ */ React47.createElement(Grid17, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React47.createElement(Grid17, { item: true, xs: 12 }, /* @__PURE__ */ React47.createElement(ControlLabel, null, label)), /* @__PURE__ */ React47.createElement(Grid17, { item: true, xs: 12 }, /* @__PURE__ */ React47.createElement(StylesField, { bind: side }, /* @__PURE__ */ React47.createElement(SizeControl, { startIcon: sideIcons[side] }))));
1254
+ // src/components/style-sections/position-section/z-index-field.tsx
1255
+ import * as React34 from "react";
1256
+ import { ControlLabel as ControlLabel15, NumberControl as NumberControl2 } from "@elementor/editor-controls";
1257
+ import { Grid as Grid10 } from "@elementor/ui";
1258
+ import { __ as __17 } from "@wordpress/i18n";
1259
+ var ZIndexField = () => {
1260
+ return /* @__PURE__ */ React34.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React34.createElement(Grid10, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React34.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(ControlLabel15, null, __17("Z-Index", "elementor"))), /* @__PURE__ */ React34.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(NumberControl2, null))));
1371
1261
  };
1372
1262
 
1373
1263
  // src/components/style-sections/position-section/position-section.tsx
1264
+ var dimensionsPropKeys = ["top", "bottom", "left", "right"];
1374
1265
  var PositionSection = () => {
1375
1266
  const [positionValue] = useStylesField("position");
1267
+ usePositionChangeHandler();
1376
1268
  const isNotStatic = positionValue && positionValue !== "static";
1377
- return /* @__PURE__ */ React48.createElement(AccordionSection, { title: __24("Position", "elementor") }, /* @__PURE__ */ React48.createElement(Stack13, { gap: 1.5 }, /* @__PURE__ */ React48.createElement(PositionField, null), isNotStatic ? /* @__PURE__ */ React48.createElement(React48.Fragment, null, /* @__PURE__ */ React48.createElement(DimensionsField, null), /* @__PURE__ */ React48.createElement(ZIndexField, null)) : null));
1269
+ return /* @__PURE__ */ React35.createElement(Stack13, { gap: 1.5 }, /* @__PURE__ */ React35.createElement(PositionField, null), isNotStatic ? /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(DimensionsField, null), /* @__PURE__ */ React35.createElement(ZIndexField, null)) : null);
1270
+ };
1271
+ var usePositionChangeHandler = () => {
1272
+ const dimensionsHistory = useStylePropsHistory(dimensionsPropKeys);
1273
+ const onPositionChange = useCallback3(
1274
+ (newPositionValue, previousPosition) => {
1275
+ if (!dimensionsHistory) {
1276
+ return;
1277
+ }
1278
+ const { saveStylePropsHistory, updateStylePropsFromHistory, clearCurrentStyleProps } = dimensionsHistory;
1279
+ if (newPositionValue === "static") {
1280
+ saveStylePropsHistory();
1281
+ clearCurrentStyleProps();
1282
+ } else if (previousPosition === "static") {
1283
+ updateStylePropsFromHistory();
1284
+ }
1285
+ previousPosition = newPositionValue;
1286
+ },
1287
+ [dimensionsHistory]
1288
+ );
1289
+ const [, , registerChangeListener] = useStylesField("position");
1290
+ registerChangeListener?.(onPositionChange);
1378
1291
  };
1379
1292
 
1380
- // src/components/style-sections/spacing-section/spacing-section.tsx
1381
- import * as React50 from "react";
1382
- import { Divider as Divider3, Stack as Stack15 } from "@elementor/ui";
1383
- import { __ as __26 } from "@wordpress/i18n";
1384
-
1385
- // src/controls/controls/linked-dimensions-control.tsx
1386
- import * as React49 from "react";
1387
- import { __ as __25 } from "@wordpress/i18n";
1388
- import { Grid as Grid18, Stack as Stack14, ToggleButton as ToggleButton3 } from "@elementor/ui";
1389
- import { DetachIcon, LinkIcon, SideBottomIcon as SideBottomIcon2, SideLeftIcon as SideLeftIcon2, SideRightIcon as SideRightIcon2, SideTopIcon as SideTopIcon2 } from "@elementor/icons";
1390
- var LinkedDimensionsControl = createControl(({ label }) => {
1391
- const { value, setValue } = useBoundProp();
1392
- const { top, right, bottom, left, isLinked = true } = value?.value || {};
1393
- const setLinkedValue = (position, newValue) => {
1394
- const updatedValue = {
1395
- isLinked,
1396
- top: isLinked ? newValue : top,
1397
- right: isLinked ? newValue : right,
1398
- bottom: isLinked ? newValue : bottom,
1399
- left: isLinked ? newValue : left,
1400
- [position]: newValue
1401
- };
1402
- setValue({
1403
- $$type: "linked-dimensions",
1404
- value: updatedValue
1405
- });
1406
- };
1407
- const toggleLinked = () => {
1408
- const updatedValue = {
1409
- isLinked: !isLinked,
1410
- top,
1411
- right: !isLinked ? top : right,
1412
- bottom: !isLinked ? top : bottom,
1413
- left: !isLinked ? top : left
1414
- };
1415
- setValue({
1416
- $$type: "linked-dimensions",
1417
- value: updatedValue
1418
- });
1419
- };
1420
- const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
1421
- return /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(Stack14, { direction: "row", gap: 2 }, /* @__PURE__ */ React49.createElement(ControlLabel, null, label), /* @__PURE__ */ React49.createElement(
1422
- ToggleButton3,
1423
- {
1424
- "aria-label": __25("Link Inputs", "elementor"),
1425
- size: "tiny",
1426
- value: "check",
1427
- selected: isLinked,
1428
- sx: { marginLeft: "auto" },
1429
- onChange: toggleLinked
1430
- },
1431
- /* @__PURE__ */ React49.createElement(LinkedIcon, { fontSize: "tiny" })
1432
- )), /* @__PURE__ */ React49.createElement(Stack14, { direction: "row", gap: 2 }, /* @__PURE__ */ React49.createElement(Grid18, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(ControlLabel, null, __25("Top", "elementor"))), /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(
1433
- Control5,
1434
- {
1435
- bind: "top",
1436
- value: top,
1437
- setValue: setLinkedValue,
1438
- startIcon: /* @__PURE__ */ React49.createElement(SideTopIcon2, { fontSize: "tiny" })
1439
- }
1440
- ))), /* @__PURE__ */ React49.createElement(Grid18, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(ControlLabel, null, __25("Right", "elementor"))), /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(
1441
- Control5,
1442
- {
1443
- bind: "right",
1444
- value: right,
1445
- setValue: setLinkedValue,
1446
- startIcon: /* @__PURE__ */ React49.createElement(SideRightIcon2, { fontSize: "tiny" })
1447
- }
1448
- )))), /* @__PURE__ */ React49.createElement(Stack14, { direction: "row", gap: 2 }, /* @__PURE__ */ React49.createElement(Grid18, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(ControlLabel, null, __25("Bottom", "elementor"))), /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(
1449
- Control5,
1450
- {
1451
- bind: "bottom",
1452
- value: bottom,
1453
- setValue: setLinkedValue,
1454
- startIcon: /* @__PURE__ */ React49.createElement(SideBottomIcon2, { fontSize: "tiny" })
1455
- }
1456
- ))), /* @__PURE__ */ React49.createElement(Grid18, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(ControlLabel, null, __25("Left", "elementor"))), /* @__PURE__ */ React49.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(
1457
- Control5,
1458
- {
1459
- bind: "left",
1460
- value: left,
1461
- setValue: setLinkedValue,
1462
- startIcon: /* @__PURE__ */ React49.createElement(SideLeftIcon2, { fontSize: "tiny" })
1463
- }
1464
- )))));
1465
- });
1466
- var Control5 = ({
1467
- bind,
1468
- startIcon,
1469
- value,
1470
- setValue
1471
- }) => /* @__PURE__ */ React49.createElement(BoundPropProvider, { setValue: (newValue) => setValue(bind, newValue), value, bind }, /* @__PURE__ */ React49.createElement(SizeControl, { startIcon }));
1293
+ // src/components/style-sections/size-section/size-section.tsx
1294
+ import * as React37 from "react";
1295
+ import { ControlLabel as ControlLabel17, SizeControl as SizeControl3 } from "@elementor/editor-controls";
1296
+ import { Divider as Divider4, Grid as Grid12, Stack as Stack14 } from "@elementor/ui";
1297
+ import { __ as __19 } from "@wordpress/i18n";
1472
1298
 
1473
- // src/components/style-sections/spacing-section/spacing-section.tsx
1474
- var SpacingSection = () => {
1475
- return /* @__PURE__ */ React50.createElement(AccordionSection, { title: __26("Spacing", "elementor") }, /* @__PURE__ */ React50.createElement(Stack15, { gap: 1.5 }, /* @__PURE__ */ React50.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React50.createElement(LinkedDimensionsControl, { label: __26("Padding", "elementor") })), /* @__PURE__ */ React50.createElement(Divider3, null), /* @__PURE__ */ React50.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React50.createElement(LinkedDimensionsControl, { label: __26("Margin", "elementor") }))));
1299
+ // src/components/style-sections/size-section/overflow-field.tsx
1300
+ import * as React36 from "react";
1301
+ import { ControlLabel as ControlLabel16, ToggleControl as ToggleControl6 } from "@elementor/editor-controls";
1302
+ import { ExpandBottomIcon, EyeIcon, EyeOffIcon } from "@elementor/icons";
1303
+ import { Grid as Grid11 } from "@elementor/ui";
1304
+ import { __ as __18 } from "@wordpress/i18n";
1305
+ var options3 = [
1306
+ {
1307
+ value: "visible",
1308
+ label: __18("Visible", "elementor"),
1309
+ renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(EyeIcon, { fontSize: size }),
1310
+ showTooltip: true
1311
+ },
1312
+ {
1313
+ value: "hidden",
1314
+ label: __18("Hidden", "elementor"),
1315
+ renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(EyeOffIcon, { fontSize: size }),
1316
+ showTooltip: true
1317
+ },
1318
+ {
1319
+ value: "auto",
1320
+ label: __18("Auto", "elementor"),
1321
+ renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(ExpandBottomIcon, { fontSize: size }),
1322
+ showTooltip: true
1323
+ }
1324
+ ];
1325
+ var OverflowField = () => {
1326
+ return /* @__PURE__ */ React36.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React36.createElement(Grid11, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel16, null, __18("Overflow", "elementor"))), /* @__PURE__ */ React36.createElement(Grid11, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React36.createElement(ToggleControl6, { options: options3 }))));
1476
1327
  };
1477
1328
 
1478
- // src/components/style-sections/effects-section/effects-section.tsx
1479
- import * as React51 from "react";
1480
- import { __ as __27 } from "@wordpress/i18n";
1481
- import { Stack as Stack16 } from "@elementor/ui";
1482
- var EffectsSection = () => {
1483
- return /* @__PURE__ */ React51.createElement(AccordionSection, { title: __27("Effects", "elementor") }, /* @__PURE__ */ React51.createElement(Stack16, { gap: 1.5 }, /* @__PURE__ */ React51.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React51.createElement(BoxShadowRepeaterControl, null))));
1329
+ // src/components/style-sections/size-section/size-section.tsx
1330
+ var SizeSection = () => {
1331
+ return /* @__PURE__ */ React37.createElement(Stack14, { gap: 1.5 }, /* @__PURE__ */ React37.createElement(Grid12, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(SizeField, { bind: "width", label: __19("Width", "elementor") })), /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(SizeField, { bind: "height", label: __19("Height", "elementor") }))), /* @__PURE__ */ React37.createElement(Grid12, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(SizeField, { bind: "min-width", label: __19("Min. Width", "elementor") })), /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(SizeField, { bind: "min-height", label: __19("Min. Height", "elementor") }))), /* @__PURE__ */ React37.createElement(Grid12, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(SizeField, { bind: "max-width", label: __19("Max. Width", "elementor") })), /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(SizeField, { bind: "max-height", label: __19("Max. Height", "elementor") }))), /* @__PURE__ */ React37.createElement(Divider4, null), /* @__PURE__ */ React37.createElement(Stack14, null, /* @__PURE__ */ React37.createElement(OverflowField, null)));
1484
1332
  };
1485
-
1486
- // src/components/style-sections/background-section/background-section.tsx
1487
- import * as React53 from "react";
1488
- import { __ as __29 } from "@wordpress/i18n";
1489
- import { Stack as Stack17 } from "@elementor/ui";
1490
-
1491
- // src/components/style-sections/background-section/background-color-field.tsx
1492
- import * as React52 from "react";
1493
- import { __ as __28 } from "@wordpress/i18n";
1494
- import { Grid as Grid19 } from "@elementor/ui";
1495
- var BackgroundColorField = () => {
1496
- return /* @__PURE__ */ React52.createElement(StylesField, { bind: "background-color" }, /* @__PURE__ */ React52.createElement(Grid19, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React52.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(ControlLabel, null, __28("Color", "elementor"))), /* @__PURE__ */ React52.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(ColorControl, null))));
1333
+ var SizeField = ({ label, bind }) => {
1334
+ return /* @__PURE__ */ React37.createElement(StylesField, { bind }, /* @__PURE__ */ React37.createElement(Grid12, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(ControlLabel17, null, label)), /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(SizeControl3, null))));
1497
1335
  };
1498
1336
 
1499
- // src/components/style-sections/background-section/background-section.tsx
1500
- var BackgroundSection = () => {
1501
- return /* @__PURE__ */ React53.createElement(AccordionSection, { title: __29("Background", "elementor") }, /* @__PURE__ */ React53.createElement(Stack17, { gap: 1.5 }, /* @__PURE__ */ React53.createElement(BackgroundColorField, null)));
1337
+ // src/components/style-sections/spacing-section/spacing-section.tsx
1338
+ import * as React38 from "react";
1339
+ import { LinkedDimensionsControl } from "@elementor/editor-controls";
1340
+ import { Divider as Divider5, Stack as Stack15 } from "@elementor/ui";
1341
+ import { __ as __20 } from "@wordpress/i18n";
1342
+ var SpacingSection = () => {
1343
+ return /* @__PURE__ */ React38.createElement(Stack15, { gap: 1.5 }, /* @__PURE__ */ React38.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React38.createElement(LinkedDimensionsControl, { label: __20("Padding", "elementor") })), /* @__PURE__ */ React38.createElement(Divider5, null), /* @__PURE__ */ React38.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React38.createElement(LinkedDimensionsControl, { label: __20("Margin", "elementor") })));
1502
1344
  };
1503
1345
 
1504
- // src/components/style-sections/border-section/border-section.tsx
1505
- import * as React61 from "react";
1506
- import { Divider as Divider4, Stack as Stack20 } from "@elementor/ui";
1507
- import { __ as __36 } from "@wordpress/i18n";
1508
-
1509
- // src/components/style-sections/border-section/border-radius-field.tsx
1510
- import * as React55 from "react";
1511
- import { __ as __31 } from "@wordpress/i18n";
1512
- import {
1513
- BorderCornersIcon,
1514
- RadiusBottomLeftIcon,
1515
- RadiusBottomRightIcon,
1516
- RadiusTopLeftIcon,
1517
- RadiusTopRightIcon
1518
- } from "@elementor/icons";
1346
+ // src/components/style-sections/typography-section/typography-section.tsx
1347
+ import * as React51 from "react";
1348
+ import { Divider as Divider6, Stack as Stack17 } from "@elementor/ui";
1519
1349
 
1520
- // src/controls/controls/equal-unequal-sizes-control.tsx
1521
- import * as React54 from "react";
1522
- import { useId as useId4, useRef as useRef2 } from "react";
1523
- import { bindPopover as bindPopover2, bindToggle, Grid as Grid20, Popover as Popover2, Stack as Stack18, ToggleButton as ToggleButton4, usePopupState as usePopupState3 } from "@elementor/ui";
1524
- import { __ as __30 } from "@wordpress/i18n";
1525
- function hasMixedSizes(values) {
1526
- const [firstValue, ...restValues] = values;
1527
- return restValues.some(
1528
- (value) => value?.value?.size !== firstValue?.value?.size || value?.value?.unit !== firstValue?.value?.unit
1529
- );
1530
- }
1531
- function EqualUnequalSizesControl({ label, icon, items, multiSizeType }) {
1532
- const popupId = useId4();
1533
- const controlRef = useRef2(null);
1534
- const { value: controlValue, setValue: setControlValue } = useBoundProp();
1535
- const actualValue = controlValue?.value ?? {};
1536
- const setActualValue = (newValue) => {
1537
- setControlValue({ $$type: multiSizeType, value: newValue });
1538
- };
1539
- const setNestedProp = (item, newValue) => {
1540
- const { bind } = item;
1541
- const newValues = {
1542
- ...actualValue,
1543
- [bind]: newValue
1544
- };
1545
- setActualValue(newValues);
1546
- };
1547
- const setEqualValues = (newValue) => {
1548
- const equalValues = items.reduce((values, item) => {
1549
- return {
1550
- ...values,
1551
- [item.bind]: newValue
1552
- };
1553
- }, {});
1554
- setActualValue(equalValues);
1350
+ // src/components/collapsible-content.tsx
1351
+ import * as React39 from "react";
1352
+ import { useState as useState3 } from "react";
1353
+ import { Button, Collapse as Collapse3, Stack as Stack16 } from "@elementor/ui";
1354
+ import { __ as __21 } from "@wordpress/i18n";
1355
+ var CollapsibleContent = ({ children, defaultOpen = false }) => {
1356
+ const [open, setOpen] = useState3(defaultOpen);
1357
+ const handleToggle = () => {
1358
+ setOpen((prevOpen) => !prevOpen);
1555
1359
  };
1556
- const popupState = usePopupState3({
1557
- variant: "popover",
1558
- popupId
1559
- });
1560
- return /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(Grid20, { container: true, alignItems: "center", ref: controlRef }, /* @__PURE__ */ React54.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(ControlLabel, null, label)), /* @__PURE__ */ React54.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(
1561
- EqualValuesControl,
1562
- {
1563
- value: actualValue,
1564
- setValue: setEqualValues,
1565
- iconButton: /* @__PURE__ */ React54.createElement(
1566
- ToggleButton4,
1567
- {
1568
- size: "tiny",
1569
- value: "check",
1570
- sx: { marginLeft: "auto" },
1571
- ...bindToggle(popupState),
1572
- selected: popupState.isOpen
1573
- },
1574
- icon
1575
- )
1576
- }
1577
- ))), /* @__PURE__ */ React54.createElement(
1578
- Popover2,
1360
+ return /* @__PURE__ */ React39.createElement(Stack16, { sx: { py: 0.5 } }, /* @__PURE__ */ React39.createElement(
1361
+ Button,
1579
1362
  {
1580
- disablePortal: true,
1581
- disableScrollLock: true,
1582
- anchorOrigin: {
1583
- vertical: "bottom",
1584
- horizontal: "right"
1585
- },
1586
- transformOrigin: {
1587
- vertical: "top",
1588
- horizontal: "right"
1589
- },
1590
- ...bindPopover2(popupState),
1591
- slotProps: {
1592
- paper: { sx: { mt: 0.5, p: 2, pt: 1, width: controlRef.current?.getBoundingClientRect().width } }
1593
- }
1363
+ fullWidth: true,
1364
+ size: "small",
1365
+ color: "secondary",
1366
+ variant: "outlined",
1367
+ onClick: handleToggle,
1368
+ endIcon: /* @__PURE__ */ React39.createElement(CollapseIcon, { open })
1594
1369
  },
1595
- /* @__PURE__ */ React54.createElement(Stack18, { gap: 1.5 }, /* @__PURE__ */ React54.createElement(Grid20, { container: true, spacing: 2, alignItems: "center" }, /* @__PURE__ */ React54.createElement(NestedValueControl, { item: items[0], value: actualValue, setNestedProp }), /* @__PURE__ */ React54.createElement(NestedValueControl, { item: items[1], value: actualValue, setNestedProp })), /* @__PURE__ */ React54.createElement(Grid20, { container: true, spacing: 2, alignItems: "center" }, /* @__PURE__ */ React54.createElement(NestedValueControl, { item: items[3], value: actualValue, setNestedProp }), /* @__PURE__ */ React54.createElement(NestedValueControl, { item: items[2], value: actualValue, setNestedProp })))
1596
- ));
1597
- }
1598
- var NestedValueControl = ({
1599
- item,
1600
- value,
1601
- setNestedProp
1602
- }) => {
1603
- const { bind } = item;
1604
- const nestedValue = value?.[bind] ? value[bind] : void 0;
1605
- return /* @__PURE__ */ React54.createElement(BoundPropProvider, { bind: "", setValue: (val) => setNestedProp(item, val), value: nestedValue }, /* @__PURE__ */ React54.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(Grid20, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React54.createElement(Grid20, { item: true, xs: 12 }, /* @__PURE__ */ React54.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React54.createElement(Grid20, { item: true, xs: 12 }, /* @__PURE__ */ React54.createElement(SizeControl, { startIcon: item.icon })))));
1370
+ open ? __21("Show less", "elementor") : __21("Show more", "elementor")
1371
+ ), /* @__PURE__ */ React39.createElement(Collapse3, { in: open, timeout: "auto", unmountOnExit: true }, children));
1606
1372
  };
1607
- var EqualValuesControl = ({
1608
- value,
1609
- setValue,
1610
- iconButton
1611
- }) => {
1612
- const values = Object.values(value ?? {});
1613
- const isMixed = hasMixedSizes(values);
1614
- return /* @__PURE__ */ React54.createElement(
1615
- BoundPropProvider,
1616
- {
1617
- bind: "",
1618
- setValue: (val) => setValue(val),
1619
- value: isMixed ? void 0 : values[0]
1620
- },
1621
- /* @__PURE__ */ React54.createElement(Stack18, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React54.createElement(SizeControl, { placeholder: __30("MIXED", "elementor") }), iconButton)
1622
- );
1373
+
1374
+ // src/components/style-sections/typography-section/font-family-field.tsx
1375
+ import * as React40 from "react";
1376
+ import { ControlLabel as ControlLabel18, FontFamilyControl } from "@elementor/editor-controls";
1377
+ import { Grid as Grid13 } from "@elementor/ui";
1378
+ import { __ as __22 } from "@wordpress/i18n";
1379
+
1380
+ // src/sync/get-elementor-config.ts
1381
+ var getElementorConfig = () => {
1382
+ const extendedWindow = window;
1383
+ return extendedWindow.elementor?.config ?? {};
1623
1384
  };
1624
1385
 
1625
- // src/components/style-sections/border-section/border-radius-field.tsx
1626
- var corners = [
1627
- {
1628
- label: __31("Top Left", "elementor"),
1629
- icon: /* @__PURE__ */ React55.createElement(RadiusTopLeftIcon, { fontSize: "tiny" }),
1630
- bind: "top-left"
1631
- },
1632
- {
1633
- label: __31("Top Right", "elementor"),
1634
- icon: /* @__PURE__ */ React55.createElement(RadiusTopRightIcon, { fontSize: "tiny" }),
1635
- bind: "top-right"
1636
- },
1637
- {
1638
- label: __31("Bottom Right", "elementor"),
1639
- icon: /* @__PURE__ */ React55.createElement(RadiusBottomRightIcon, { fontSize: "tiny" }),
1640
- bind: "bottom-right"
1641
- },
1642
- {
1643
- label: __31("Bottom Left", "elementor"),
1644
- icon: /* @__PURE__ */ React55.createElement(RadiusBottomLeftIcon, { fontSize: "tiny" }),
1645
- bind: "bottom-left"
1386
+ // src/components/style-sections/typography-section/font-family-field.tsx
1387
+ var FontFamilyField = () => {
1388
+ const fontFamilies = getFontFamilies();
1389
+ if (!fontFamilies) {
1390
+ return null;
1391
+ }
1392
+ return /* @__PURE__ */ React40.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React40.createElement(Grid13, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlLabel18, null, __22("Font Family", "elementor"))), /* @__PURE__ */ React40.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(FontFamilyControl, { fontFamilies }))));
1393
+ };
1394
+ var getFontFamilies = () => {
1395
+ const { controls } = getElementorConfig();
1396
+ const options7 = controls?.font?.options;
1397
+ if (!options7) {
1398
+ return null;
1646
1399
  }
1400
+ return options7;
1401
+ };
1402
+
1403
+ // src/components/style-sections/typography-section/font-size-field.tsx
1404
+ import * as React41 from "react";
1405
+ import { ControlLabel as ControlLabel19, SizeControl as SizeControl4 } from "@elementor/editor-controls";
1406
+ import { Grid as Grid14 } from "@elementor/ui";
1407
+ import { __ as __23 } from "@wordpress/i18n";
1408
+ var FontSizeField = () => {
1409
+ return /* @__PURE__ */ React41.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React41.createElement(Grid14, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlLabel19, null, __23("Font Size", "elementor"))), /* @__PURE__ */ React41.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(SizeControl4, null))));
1410
+ };
1411
+
1412
+ // src/components/style-sections/typography-section/font-weight-field.tsx
1413
+ import * as React42 from "react";
1414
+ import { ControlLabel as ControlLabel20, SelectControl as SelectControl4 } from "@elementor/editor-controls";
1415
+ import { Grid as Grid15 } from "@elementor/ui";
1416
+ import { __ as __24 } from "@wordpress/i18n";
1417
+ var fontWeightOptions = [
1418
+ { label: __24("Light - 400", "elementor"), value: "400" },
1419
+ { label: __24("Regular - 500", "elementor"), value: "500" },
1420
+ { label: __24("Semi Bold - 600", "elementor"), value: "600" },
1421
+ { label: __24("Bold - 700", "elementor"), value: "700" },
1422
+ { label: __24("Black - 900", "elementor"), value: "900" }
1647
1423
  ];
1648
- var BorderRadiusField = () => {
1649
- return /* @__PURE__ */ React55.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React55.createElement(
1650
- EqualUnequalSizesControl,
1651
- {
1652
- label: __31("Border Radius", "elementor"),
1653
- icon: /* @__PURE__ */ React55.createElement(BorderCornersIcon, { fontSize: "tiny" }),
1654
- items: corners,
1655
- multiSizeType: "border-radius"
1656
- }
1657
- ));
1424
+ var FontWeightField = () => {
1425
+ return /* @__PURE__ */ React42.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React42.createElement(Grid15, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(ControlLabel20, null, __24("Font Weight", "elementor"))), /* @__PURE__ */ React42.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SelectControl4, { options: fontWeightOptions }))));
1658
1426
  };
1659
1427
 
1660
- // src/components/style-sections/border-section/border-field.tsx
1661
- import * as React60 from "react";
1662
- import { __ as __35 } from "@wordpress/i18n";
1428
+ // src/components/style-sections/typography-section/letter-spacing-field.tsx
1429
+ import * as React43 from "react";
1430
+ import { ControlLabel as ControlLabel21, SizeControl as SizeControl5 } from "@elementor/editor-controls";
1431
+ import { Grid as Grid16 } from "@elementor/ui";
1432
+ import { __ as __25 } from "@wordpress/i18n";
1433
+ var LetterSpacingField = () => {
1434
+ return /* @__PURE__ */ React43.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React43.createElement(Grid16, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React43.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(ControlLabel21, null, __25("Letter Spacing", "elementor"))), /* @__PURE__ */ React43.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(SizeControl5, null))));
1435
+ };
1663
1436
 
1664
- // src/components/style-sections/border-section/border-width-field.tsx
1665
- import * as React56 from "react";
1666
- import { SideBottomIcon as SideBottomIcon3, SideLeftIcon as SideLeftIcon3, SideRightIcon as SideRightIcon3, SideTopIcon as SideTopIcon3, SideAllIcon } from "@elementor/icons";
1667
- import { __ as __32 } from "@wordpress/i18n";
1668
- var edges = [
1437
+ // src/components/style-sections/typography-section/text-alignment-field.tsx
1438
+ import * as React44 from "react";
1439
+ import { ControlLabel as ControlLabel22, ToggleControl as ToggleControl7 } from "@elementor/editor-controls";
1440
+ import { AlignCenterIcon, AlignJustifiedIcon, AlignLeftIcon, AlignRightIcon } from "@elementor/icons";
1441
+ import { Grid as Grid17 } from "@elementor/ui";
1442
+ import { __ as __26 } from "@wordpress/i18n";
1443
+ var options4 = [
1669
1444
  {
1670
- label: __32("Top", "elementor"),
1671
- icon: /* @__PURE__ */ React56.createElement(SideTopIcon3, { fontSize: "tiny" }),
1672
- bind: "top"
1445
+ value: "left",
1446
+ label: __26("Left", "elementor"),
1447
+ renderContent: ({ size }) => /* @__PURE__ */ React44.createElement(AlignLeftIcon, { fontSize: size })
1673
1448
  },
1674
1449
  {
1675
- label: __32("Right", "elementor"),
1676
- icon: /* @__PURE__ */ React56.createElement(SideRightIcon3, { fontSize: "tiny" }),
1677
- bind: "right"
1450
+ value: "center",
1451
+ label: __26("Center", "elementor"),
1452
+ renderContent: ({ size }) => /* @__PURE__ */ React44.createElement(AlignCenterIcon, { fontSize: size })
1678
1453
  },
1679
1454
  {
1680
- label: __32("Bottom", "elementor"),
1681
- icon: /* @__PURE__ */ React56.createElement(SideBottomIcon3, { fontSize: "tiny" }),
1682
- bind: "bottom"
1455
+ value: "right",
1456
+ label: __26("Right", "elementor"),
1457
+ renderContent: ({ size }) => /* @__PURE__ */ React44.createElement(AlignRightIcon, { fontSize: size })
1683
1458
  },
1684
1459
  {
1685
- label: __32("Left", "elementor"),
1686
- icon: /* @__PURE__ */ React56.createElement(SideLeftIcon3, { fontSize: "tiny" }),
1687
- bind: "left"
1460
+ value: "justify",
1461
+ label: __26("Justify", "elementor"),
1462
+ renderContent: ({ size }) => /* @__PURE__ */ React44.createElement(AlignJustifiedIcon, { fontSize: size })
1688
1463
  }
1689
1464
  ];
1690
- var BorderWidthField = () => {
1691
- return /* @__PURE__ */ React56.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React56.createElement(
1692
- EqualUnequalSizesControl,
1693
- {
1694
- label: __32("Border Width", "elementor"),
1695
- icon: /* @__PURE__ */ React56.createElement(SideAllIcon, { fontSize: "tiny" }),
1696
- items: edges,
1697
- multiSizeType: "border-width"
1698
- }
1699
- ));
1465
+ var TextAlignmentField = () => {
1466
+ return /* @__PURE__ */ React44.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React44.createElement(Grid17, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React44.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(ControlLabel22, null, __26("Alignment", "elementor"))), /* @__PURE__ */ React44.createElement(Grid17, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React44.createElement(ToggleControl7, { options: options4 }))));
1700
1467
  };
1701
1468
 
1702
- // src/components/style-sections/border-section/border-color-field.tsx
1703
- import * as React57 from "react";
1704
- import { __ as __33 } from "@wordpress/i18n";
1705
- import { Grid as Grid21 } from "@elementor/ui";
1706
- var BorderColorField = () => {
1707
- return /* @__PURE__ */ React57.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React57.createElement(Grid21, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React57.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ControlLabel, null, __33("Border Color", "elementor"))), /* @__PURE__ */ React57.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ColorControl, null))));
1469
+ // src/components/style-sections/typography-section/text-color-field.tsx
1470
+ import * as React45 from "react";
1471
+ import { ColorControl as ColorControl3, ControlLabel as ControlLabel23 } from "@elementor/editor-controls";
1472
+ import { Grid as Grid18 } from "@elementor/ui";
1473
+ import { __ as __27 } from "@wordpress/i18n";
1474
+ var TextColorField = () => {
1475
+ return /* @__PURE__ */ React45.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React45.createElement(Grid18, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(ControlLabel23, null, __27("Text Color", "elementor"))), /* @__PURE__ */ React45.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(ColorControl3, null))));
1708
1476
  };
1709
1477
 
1710
- // src/components/style-sections/border-section/border-style-field.tsx
1711
- import * as React58 from "react";
1712
- import { __ as __34 } from "@wordpress/i18n";
1713
- import { Grid as Grid22 } from "@elementor/ui";
1714
- var borderStyles = [
1715
- { value: "none", label: __34("None", "elementor") },
1716
- { value: "solid", label: __34("Solid", "elementor") },
1717
- { value: "dashed", label: __34("Dashed", "elementor") },
1718
- { value: "dotted", label: __34("Dotted", "elementor") },
1719
- { value: "double", label: __34("Double", "elementor") },
1720
- { value: "groove", label: __34("Groove", "elementor") },
1721
- { value: "ridge", label: __34("Ridge", "elementor") },
1722
- { value: "inset", label: __34("Inset", "elementor") },
1723
- { value: "outset", label: __34("Outset", "elementor") }
1478
+ // src/components/style-sections/typography-section/text-direction-field.tsx
1479
+ import * as React46 from "react";
1480
+ import { ControlLabel as ControlLabel24, ToggleControl as ToggleControl8 } from "@elementor/editor-controls";
1481
+ import { TextDirectionLtrIcon, TextDirectionRtlIcon } from "@elementor/icons";
1482
+ import { Grid as Grid19 } from "@elementor/ui";
1483
+ import { __ as __28 } from "@wordpress/i18n";
1484
+ var options5 = [
1485
+ {
1486
+ value: "ltr",
1487
+ label: __28("Left to Right", "elementor"),
1488
+ renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(TextDirectionLtrIcon, { fontSize: size })
1489
+ },
1490
+ {
1491
+ value: "rtl",
1492
+ label: __28("Right to Left", "elementor"),
1493
+ renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(TextDirectionRtlIcon, { fontSize: size })
1494
+ }
1724
1495
  ];
1725
- var BorderStyleField = () => {
1726
- return /* @__PURE__ */ React58.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React58.createElement(Grid22, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React58.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React58.createElement(ControlLabel, null, __34("Border Type", "elementor"))), /* @__PURE__ */ React58.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React58.createElement(SelectControl, { options: borderStyles }))));
1496
+ var TextDirectionField = () => {
1497
+ return /* @__PURE__ */ React46.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React46.createElement(Grid19, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlLabel24, null, __28("Direction", "elementor"))), /* @__PURE__ */ React46.createElement(Grid19, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React46.createElement(ToggleControl8, { options: options5 }))));
1727
1498
  };
1728
1499
 
1729
- // src/components/add-or-remove-content.tsx
1730
- import * as React59 from "react";
1731
- import { MinusIcon as MinusIcon2, PlusIcon as PlusIcon3 } from "@elementor/icons";
1732
- import { Collapse as Collapse3, IconButton as IconButton3, Stack as Stack19 } from "@elementor/ui";
1733
- var SIZE2 = "tiny";
1734
- var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
1735
- return /* @__PURE__ */ React59.createElement(Stack19, { gap: 1.5 }, /* @__PURE__ */ React59.createElement(
1736
- Stack19,
1737
- {
1738
- direction: "row",
1739
- sx: {
1740
- justifyContent: "space-between",
1741
- alignItems: "center"
1742
- }
1500
+ // src/components/style-sections/typography-section/text-stroke-field.tsx
1501
+ import * as React47 from "react";
1502
+ import { StrokeControl } from "@elementor/editor-controls";
1503
+ import { __ as __29 } from "@wordpress/i18n";
1504
+ var initTextStroke = {
1505
+ $$type: "stroke",
1506
+ value: {
1507
+ color: {
1508
+ $$type: "color",
1509
+ value: "#000000"
1743
1510
  },
1744
- /* @__PURE__ */ React59.createElement(ControlLabel, null, label),
1745
- isAdded ? /* @__PURE__ */ React59.createElement(IconButton3, { size: SIZE2, onClick: onRemove }, /* @__PURE__ */ React59.createElement(MinusIcon2, { fontSize: SIZE2 })) : /* @__PURE__ */ React59.createElement(IconButton3, { size: SIZE2, onClick: onAdd }, /* @__PURE__ */ React59.createElement(PlusIcon3, { fontSize: SIZE2 }))
1746
- ), /* @__PURE__ */ React59.createElement(Collapse3, { in: isAdded }, /* @__PURE__ */ React59.createElement(Stack19, { gap: 1.5 }, children)));
1747
- };
1748
-
1749
- // src/components/style-sections/border-section/border-field.tsx
1750
- var initialSize = { $$type: "size", value: { size: 1, unit: "px" } };
1751
- var initialBorderWidth = {
1752
- $$type: "border-width",
1753
- value: { top: initialSize, right: initialSize, bottom: initialSize, left: initialSize }
1511
+ width: {
1512
+ $$type: "size",
1513
+ value: {
1514
+ unit: "px",
1515
+ size: 1
1516
+ }
1517
+ }
1518
+ }
1754
1519
  };
1755
- var initialBorderColor = { $$type: "color", value: "#000000" };
1756
- var initialBorderStyle = "solid";
1757
- var BorderField = () => {
1758
- const [borderWidth, setBorderWidth] = useStylesField("border-width");
1759
- const [borderColor, setBorderColor] = useStylesField("border-color");
1760
- const [borderStyle, setBorderStyle] = useStylesField("border-style");
1761
- const addBorder = () => {
1762
- setBorderWidth(initialBorderWidth);
1763
- setBorderColor(initialBorderColor);
1764
- setBorderStyle(initialBorderStyle);
1520
+ var TextStrokeField = () => {
1521
+ const [textStroke, setTextStroke] = useStylesField("-webkit-text-stroke");
1522
+ const addTextStroke = () => {
1523
+ setTextStroke(initTextStroke);
1765
1524
  };
1766
- const removeBorder = () => {
1767
- setBorderWidth(null);
1768
- setBorderColor(null);
1769
- setBorderStyle(null);
1525
+ const removeTextStroke = () => {
1526
+ setTextStroke(null);
1770
1527
  };
1771
- const hasBorder = Boolean(borderWidth || borderColor || borderStyle);
1772
- return /* @__PURE__ */ React60.createElement(
1528
+ const hasTextStroke = Boolean(textStroke);
1529
+ return /* @__PURE__ */ React47.createElement(
1773
1530
  AddOrRemoveContent,
1774
1531
  {
1775
- label: __35("Border", "elementor"),
1776
- isAdded: hasBorder,
1777
- onAdd: addBorder,
1778
- onRemove: removeBorder
1532
+ label: __29("Text Stroke", "elementor"),
1533
+ isAdded: hasTextStroke,
1534
+ onAdd: addTextStroke,
1535
+ onRemove: removeTextStroke
1779
1536
  },
1780
- /* @__PURE__ */ React60.createElement(BorderWidthField, null),
1781
- /* @__PURE__ */ React60.createElement(BorderColorField, null),
1782
- /* @__PURE__ */ React60.createElement(BorderStyleField, null)
1537
+ /* @__PURE__ */ React47.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React47.createElement(StrokeControl, null))
1783
1538
  );
1784
1539
  };
1785
1540
 
1786
- // src/components/style-sections/border-section/border-section.tsx
1787
- var BorderSection = () => /* @__PURE__ */ React61.createElement(AccordionSection, { title: __36("Border", "elementor") }, /* @__PURE__ */ React61.createElement(Stack20, { gap: 1.5 }, /* @__PURE__ */ React61.createElement(BorderRadiusField, null), /* @__PURE__ */ React61.createElement(Divider4, null), /* @__PURE__ */ React61.createElement(BorderField, null)));
1541
+ // src/components/style-sections/typography-section/text-style-field.tsx
1542
+ import * as React48 from "react";
1543
+ import { ControlLabel as ControlLabel25 } from "@elementor/editor-controls";
1544
+ import { ItalicIcon, StrikethroughIcon, UnderlineIcon } from "@elementor/icons";
1545
+ import { Grid as Grid20, ToggleButton as ToggleButtonBase, ToggleButtonGroup } from "@elementor/ui";
1546
+ import { __ as __30 } from "@wordpress/i18n";
1547
+ var buttonSize = "tiny";
1548
+ var TextStyleField = () => {
1549
+ const [fontStyle, setFontStyle] = useStylesField("font-style");
1550
+ const [textDecoration, setTextDecoration] = useStylesField("text-decoration");
1551
+ const formats = [fontStyle, ...(textDecoration || "").split(" ")];
1552
+ return /* @__PURE__ */ React48.createElement(Grid20, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React48.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(ControlLabel25, null, __30("Style", "elementor"))), /* @__PURE__ */ React48.createElement(Grid20, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React48.createElement(ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React48.createElement(
1553
+ ToggleButton,
1554
+ {
1555
+ value: "italic",
1556
+ onChange: (v) => setFontStyle(fontStyle === v ? null : v),
1557
+ "aria-label": "italic",
1558
+ sx: { marginLeft: "auto" }
1559
+ },
1560
+ /* @__PURE__ */ React48.createElement(ItalicIcon, { fontSize: buttonSize })
1561
+ ), /* @__PURE__ */ React48.createElement(
1562
+ ShorthandControl,
1563
+ {
1564
+ value: "line-through",
1565
+ currentValues: textDecoration || "",
1566
+ updateValues: setTextDecoration,
1567
+ "aria-label": "line-through"
1568
+ },
1569
+ /* @__PURE__ */ React48.createElement(StrikethroughIcon, { fontSize: buttonSize })
1570
+ ), /* @__PURE__ */ React48.createElement(
1571
+ ShorthandControl,
1572
+ {
1573
+ value: "underline",
1574
+ currentValues: textDecoration || "",
1575
+ updateValues: setTextDecoration,
1576
+ "aria-label": "underline"
1577
+ },
1578
+ /* @__PURE__ */ React48.createElement(UnderlineIcon, { fontSize: buttonSize })
1579
+ ))));
1580
+ };
1581
+ var ShorthandControl = ({
1582
+ children,
1583
+ value,
1584
+ currentValues,
1585
+ updateValues,
1586
+ "aria-label": ariaLabel
1587
+ }) => {
1588
+ const valuesArr = currentValues.split(" ").filter(Boolean);
1589
+ const selected = valuesArr.includes(value);
1590
+ const toggleValue = (newValue) => {
1591
+ if (selected) {
1592
+ updateValues(valuesArr.filter((v) => v !== newValue).join(" ") || null);
1593
+ } else {
1594
+ updateValues([...valuesArr, newValue].join(" "));
1595
+ }
1596
+ };
1597
+ return /* @__PURE__ */ React48.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
1598
+ };
1599
+ var ToggleButton = ({ onChange, ...props }) => {
1600
+ const handleChange = (_e, newValue) => {
1601
+ onChange(newValue);
1602
+ };
1603
+ return /* @__PURE__ */ React48.createElement(ToggleButtonBase, { ...props, onChange: handleChange, size: buttonSize });
1604
+ };
1605
+
1606
+ // src/components/style-sections/typography-section/transform-field.tsx
1607
+ import * as React49 from "react";
1608
+ import { ControlLabel as ControlLabel26, ToggleControl as ToggleControl9 } from "@elementor/editor-controls";
1609
+ import { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon } from "@elementor/icons";
1610
+ import { Grid as Grid21 } from "@elementor/ui";
1611
+ import { __ as __31 } from "@wordpress/i18n";
1612
+ var options6 = [
1613
+ {
1614
+ value: "capitalize",
1615
+ label: __31("Capitalize", "elementor"),
1616
+ renderContent: ({ size }) => /* @__PURE__ */ React49.createElement(LetterCaseIcon, { fontSize: size })
1617
+ },
1618
+ {
1619
+ value: "uppercase",
1620
+ label: __31("Uppercase", "elementor"),
1621
+ renderContent: ({ size }) => /* @__PURE__ */ React49.createElement(LetterCaseUpperIcon, { fontSize: size })
1622
+ },
1623
+ {
1624
+ value: "lowercase",
1625
+ label: __31("Lowercase", "elementor"),
1626
+ renderContent: ({ size }) => /* @__PURE__ */ React49.createElement(LetterCaseLowerIcon, { fontSize: size })
1627
+ }
1628
+ ];
1629
+ var TransformField = () => /* @__PURE__ */ React49.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React49.createElement(Grid21, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React49.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(ControlLabel26, null, __31("Transform", "elementor"))), /* @__PURE__ */ React49.createElement(Grid21, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React49.createElement(ToggleControl9, { options: options6 }))));
1630
+
1631
+ // src/components/style-sections/typography-section/word-spacing-field.tsx
1632
+ import * as React50 from "react";
1633
+ import { ControlLabel as ControlLabel27, SizeControl as SizeControl6 } from "@elementor/editor-controls";
1634
+ import { Grid as Grid22 } from "@elementor/ui";
1635
+ import { __ as __32 } from "@wordpress/i18n";
1636
+ var WordSpacingField = () => {
1637
+ return /* @__PURE__ */ React50.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React50.createElement(Grid22, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React50.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(ControlLabel27, null, __32("Word Spacing", "elementor"))), /* @__PURE__ */ React50.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(SizeControl6, null))));
1638
+ };
1639
+
1640
+ // src/components/style-sections/typography-section/typography-section.tsx
1641
+ var TypographySection = () => {
1642
+ return /* @__PURE__ */ React51.createElement(Stack17, { gap: 1.5 }, /* @__PURE__ */ React51.createElement(FontFamilyField, null), /* @__PURE__ */ React51.createElement(FontWeightField, null), /* @__PURE__ */ React51.createElement(FontSizeField, null), /* @__PURE__ */ React51.createElement(Divider6, null), /* @__PURE__ */ React51.createElement(TextColorField, null), /* @__PURE__ */ React51.createElement(CollapsibleContent, null, /* @__PURE__ */ React51.createElement(Stack17, { gap: 1.5, sx: { pt: 1.5 } }, /* @__PURE__ */ React51.createElement(LetterSpacingField, null), /* @__PURE__ */ React51.createElement(WordSpacingField, null), /* @__PURE__ */ React51.createElement(Divider6, null), /* @__PURE__ */ React51.createElement(TextAlignmentField, null), /* @__PURE__ */ React51.createElement(TextStyleField, null), /* @__PURE__ */ React51.createElement(TransformField, null), /* @__PURE__ */ React51.createElement(TextDirectionField, null), /* @__PURE__ */ React51.createElement(TextStrokeField, null))));
1643
+ };
1788
1644
 
1789
1645
  // src/components/style-tab.tsx
1790
1646
  var CLASSES_PROP_KEY = "classes";
1791
1647
  var StyleTab = () => {
1792
1648
  const currentClassesProp = useCurrentClassesProp();
1793
- const [selectedStyleDefId] = useSelectedStyleDefId(currentClassesProp);
1649
+ const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
1794
1650
  const breakpoint = useActiveBreakpoint();
1795
- return /* @__PURE__ */ React62.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React62.createElement(StyleProvider, { meta: { breakpoint, state: null }, id: selectedStyleDefId }, /* @__PURE__ */ React62.createElement(Stack21, null, /* @__PURE__ */ React62.createElement(SpacingSection, null), /* @__PURE__ */ React62.createElement(SizeSection, null), /* @__PURE__ */ React62.createElement(PositionSection, null), /* @__PURE__ */ React62.createElement(TypographySection, null), /* @__PURE__ */ React62.createElement(BackgroundSection, null), /* @__PURE__ */ React62.createElement(BorderSection, null), /* @__PURE__ */ React62.createElement(EffectsSection, null))));
1651
+ return /* @__PURE__ */ React52.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React52.createElement(StyleProvider, { meta: { breakpoint, state: null }, id: activeStyleDefId, setId: setActiveStyleDefId }, /* @__PURE__ */ React52.createElement(CssClassSelector, null), /* @__PURE__ */ React52.createElement(Divider7, null), /* @__PURE__ */ React52.createElement(SectionsList, null, /* @__PURE__ */ React52.createElement(Section, { title: __33("Layout", "elementor") }, /* @__PURE__ */ React52.createElement(LayoutSection, null)), /* @__PURE__ */ React52.createElement(Section, { title: __33("Spacing", "elementor") }, /* @__PURE__ */ React52.createElement(SpacingSection, null)), /* @__PURE__ */ React52.createElement(Section, { title: __33("Size", "elementor") }, /* @__PURE__ */ React52.createElement(SizeSection, null)), /* @__PURE__ */ React52.createElement(Section, { title: __33("Position", "elementor") }, /* @__PURE__ */ React52.createElement(PositionSection, null)), /* @__PURE__ */ React52.createElement(Section, { title: __33("Typography", "elementor") }, /* @__PURE__ */ React52.createElement(TypographySection, null)), /* @__PURE__ */ React52.createElement(Section, { title: __33("Background", "elementor") }, /* @__PURE__ */ React52.createElement(BackgroundSection, null)), /* @__PURE__ */ React52.createElement(Section, { title: __33("Border", "elementor") }, /* @__PURE__ */ React52.createElement(BorderSection, null)), /* @__PURE__ */ React52.createElement(Section, { title: __33("Effects", "elementor") }, /* @__PURE__ */ React52.createElement(EffectsSection, null)))));
1796
1652
  };
1797
- function useSelectedStyleDefId(currentClassesProp) {
1653
+ function useActiveStyleDefId(currentClassesProp) {
1654
+ const [activeStyledDefId, setActiveStyledDefId] = useState4(null);
1655
+ const fallback = useFirstElementStyleDef(currentClassesProp);
1656
+ const newId = useGeneratedId();
1657
+ return [activeStyledDefId || fallback?.id || newId, setActiveStyledDefId];
1658
+ }
1659
+ function useFirstElementStyleDef(currentClassesProp) {
1798
1660
  const { element } = useElement();
1799
- const [selectedStyleDefId, setSelectedStyleDefId] = useState5(() => {
1800
- const styleIds = getElementSetting(element.id, currentClassesProp)?.value ?? [];
1801
- const stylesDefs = getElementStyles(element.id) ?? {};
1802
- return styleIds.find((id) => id in stylesDefs) ?? generateId(`e-${element.id}-`, Object.keys(stylesDefs));
1803
- });
1804
- return [selectedStyleDefId, setSelectedStyleDefId];
1661
+ const classesIds = useElementSetting3(element.id, currentClassesProp)?.value || [];
1662
+ const stylesDefs = useElementStyles2(element.id);
1663
+ return Object.values(stylesDefs).find((styleDef) => classesIds.includes(styleDef.id));
1664
+ }
1665
+ function useGeneratedId() {
1666
+ const { element } = useElement();
1667
+ const stylesDefs = useElementStyles2(element.id);
1668
+ return generateId(`e-${element.id}-`, Object.keys(stylesDefs));
1805
1669
  }
1806
1670
  function useCurrentClassesProp() {
1807
1671
  const { elementType } = useElement();
@@ -1816,64 +1680,17 @@ function useCurrentClassesProp() {
1816
1680
 
1817
1681
  // src/components/editing-panel-tabs.tsx
1818
1682
  var EditingPanelTabs = () => {
1683
+ const { element } = useElement();
1819
1684
  const { getTabProps, getTabPanelProps, getTabsProps } = useTabs("settings");
1820
- return /* @__PURE__ */ React63.createElement(Stack22, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React63.createElement(Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React63.createElement(Tab, { label: __37("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React63.createElement(Tab, { label: __37("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React63.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React63.createElement(SettingsTab, null)), /* @__PURE__ */ React63.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React63.createElement(StyleTab, null)));
1685
+ return (
1686
+ // When switching between elements, the local states should be reset. We are using key to rerender the tabs.
1687
+ // Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
1688
+ /* @__PURE__ */ React53.createElement(Fragment6, { key: element.id }, /* @__PURE__ */ React53.createElement(Stack18, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React53.createElement(Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React53.createElement(Tab, { label: __34("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React53.createElement(Tab, { label: __34("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React53.createElement(Divider8, null), /* @__PURE__ */ React53.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React53.createElement(SettingsTab, null)), /* @__PURE__ */ React53.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React53.createElement(StyleTab, null))))
1689
+ );
1821
1690
  };
1822
1691
 
1823
1692
  // src/components/editing-panel.tsx
1824
- import { ErrorBoundary as ErrorBoundary2 } from "@elementor/ui";
1825
-
1826
- // src/components/editing-panel-error-fallback.tsx
1827
- import * as React64 from "react";
1828
- import { Alert, Box as Box3 } from "@elementor/ui";
1829
- function EditorPanelErrorFallback() {
1830
- return /* @__PURE__ */ React64.createElement(Box3, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React64.createElement(Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React64.createElement("strong", null, "Something went wrong")));
1831
- }
1832
-
1833
- // src/popover-action.tsx
1834
- import * as React65 from "react";
1835
- import { useId as useId5 } from "react";
1836
- import { XIcon as XIcon2 } from "@elementor/icons";
1837
- import { bindPopover as bindPopover3, bindToggle as bindToggle2, IconButton as IconButton4, Popover as Popover3, Stack as Stack23, Tooltip as Tooltip2, Typography as Typography4, usePopupState as usePopupState4 } from "@elementor/ui";
1838
- var SIZE3 = "tiny";
1839
- function PopoverAction({
1840
- title,
1841
- visible = true,
1842
- icon: Icon,
1843
- popoverContent: PopoverContent
1844
- }) {
1845
- const id = useId5();
1846
- const popupState = usePopupState4({
1847
- variant: "popover",
1848
- popupId: `elementor-popover-action-${id}`
1849
- });
1850
- if (!visible) {
1851
- return null;
1852
- }
1853
- return /* @__PURE__ */ React65.createElement(React65.Fragment, null, /* @__PURE__ */ React65.createElement(Tooltip2, { placement: "top", title }, /* @__PURE__ */ React65.createElement(IconButton4, { "aria-label": title, key: id, size: SIZE3, ...bindToggle2(popupState) }, /* @__PURE__ */ React65.createElement(Icon, { fontSize: SIZE3 }))), /* @__PURE__ */ React65.createElement(
1854
- Popover3,
1855
- {
1856
- disablePortal: true,
1857
- disableScrollLock: true,
1858
- anchorOrigin: {
1859
- vertical: "bottom",
1860
- horizontal: "center"
1861
- },
1862
- ...bindPopover3(popupState)
1863
- },
1864
- /* @__PURE__ */ React65.createElement(Stack23, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React65.createElement(Icon, { fontSize: SIZE3, sx: { mr: 0.5 } }), /* @__PURE__ */ React65.createElement(Typography4, { variant: "subtitle2" }, title), /* @__PURE__ */ React65.createElement(IconButton4, { sx: { ml: "auto" }, size: SIZE3, onClick: popupState.close }, /* @__PURE__ */ React65.createElement(XIcon2, { fontSize: SIZE3 }))),
1865
- /* @__PURE__ */ React65.createElement(PopoverContent, { closePopover: popupState.close })
1866
- ));
1867
- }
1868
-
1869
- // src/controls-actions.ts
1870
- var { useMenuItems, registerPopoverAction } = createControlActionsMenu({
1871
- components: {
1872
- PopoverAction
1873
- }
1874
- });
1875
-
1876
- // src/components/editing-panel.tsx
1693
+ var { useMenuItems } = controlActionsMenu;
1877
1694
  var EditingPanel = () => {
1878
1695
  const { element, elementType } = useSelectedElement();
1879
1696
  const controlReplacement = getControlReplacement();
@@ -1881,8 +1698,8 @@ var EditingPanel = () => {
1881
1698
  if (!element || !elementType) {
1882
1699
  return null;
1883
1700
  }
1884
- const panelTitle = __38("Edit %s", "elementor").replace("%s", elementType.title);
1885
- return /* @__PURE__ */ React66.createElement(ErrorBoundary2, { fallback: /* @__PURE__ */ React66.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React66.createElement(Panel, null, /* @__PURE__ */ React66.createElement(PanelHeader, null, /* @__PURE__ */ React66.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React66.createElement(PanelBody, null, /* @__PURE__ */ React66.createElement(ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React66.createElement(ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React66.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React66.createElement(EditingPanelTabs, null)))))));
1701
+ const panelTitle = __35("Edit %s", "elementor").replace("%s", elementType.title);
1702
+ return /* @__PURE__ */ React54.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React54.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React54.createElement(Panel, null, /* @__PURE__ */ React54.createElement(PanelHeader, null, /* @__PURE__ */ React54.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React54.createElement(PanelBody, null, /* @__PURE__ */ React54.createElement(ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React54.createElement(ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React54.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React54.createElement(EditingPanelTabs, null)))))));
1886
1703
  };
1887
1704
 
1888
1705
  // src/panel.ts
@@ -1891,12 +1708,9 @@ var { panel, usePanelActions, usePanelStatus } = createPanel({
1891
1708
  component: EditingPanel
1892
1709
  });
1893
1710
 
1894
- // src/init.ts
1895
- import { injectIntoLogic } from "@elementor/editor";
1896
-
1897
- // src/sync/should-use-v2-panel.ts
1711
+ // src/sync/is-atomic-widget-selected.ts
1898
1712
  import { getSelectedElements, getWidgetsCache } from "@elementor/editor-elements";
1899
- var shouldUseV2Panel = () => {
1713
+ var isAtomicWidgetSelected = () => {
1900
1714
  const selectedElements = getSelectedElements();
1901
1715
  const widgetCache = getWidgetsCache();
1902
1716
  if (selectedElements.length !== 1) {
@@ -1905,14 +1719,29 @@ var shouldUseV2Panel = () => {
1905
1719
  return !!widgetCache?.[selectedElements[0].type]?.atomic_controls;
1906
1720
  };
1907
1721
 
1722
+ // src/hooks/use-close-editor-panel.ts
1723
+ var useCloseEditorPanel = () => {
1724
+ const { close } = usePanelActions();
1725
+ return useEffect2(() => {
1726
+ return listenTo(commandStartEvent("document/elements/delete"), (e) => {
1727
+ const selectedElement = getSelectedElements2()[0];
1728
+ const { container: deletedContainer } = e?.args;
1729
+ const isSelectedElementInDeletedContainer = deletedContainer && selectedElement && isElementInContainer(selectedElement, deletedContainer);
1730
+ if (isSelectedElementInDeletedContainer && isAtomicWidgetSelected()) {
1731
+ close();
1732
+ }
1733
+ });
1734
+ }, []);
1735
+ };
1736
+
1908
1737
  // src/hooks/use-open-editor-panel.ts
1909
- import { useEffect as useEffect2 } from "react";
1910
- import { commandStartEvent, __privateListenTo as listenTo } from "@elementor/editor-v1-adapters";
1738
+ import { useEffect as useEffect3 } from "react";
1739
+ import { __privateListenTo as listenTo2, commandStartEvent as commandStartEvent2 } from "@elementor/editor-v1-adapters";
1911
1740
  var useOpenEditorPanel = () => {
1912
1741
  const { open } = usePanelActions();
1913
- useEffect2(() => {
1914
- return listenTo(commandStartEvent("panel/editor/open"), () => {
1915
- if (shouldUseV2Panel()) {
1742
+ useEffect3(() => {
1743
+ return listenTo2(commandStartEvent2("panel/editor/open"), () => {
1744
+ if (isAtomicWidgetSelected()) {
1916
1745
  open();
1917
1746
  }
1918
1747
  });
@@ -1922,54 +1751,53 @@ var useOpenEditorPanel = () => {
1922
1751
  // src/components/editing-panel-hooks.tsx
1923
1752
  var EditingPanelHooks = () => {
1924
1753
  useOpenEditorPanel();
1754
+ useCloseEditorPanel();
1925
1755
  return null;
1926
1756
  };
1927
1757
 
1928
- // src/init.ts
1929
- import { __registerPanel as registerPanel } from "@elementor/editor-panels";
1930
- import { __privateBlockDataCommand as blockDataCommand } from "@elementor/editor-v1-adapters";
1931
-
1932
1758
  // src/dynamics/components/dynamic-selection-control.tsx
1933
- import * as React69 from "react";
1934
- import { useId as useId6 } from "react";
1935
- import { __ as __40 } from "@wordpress/i18n";
1936
- import { DatabaseIcon, SettingsIcon, XIcon as XIcon3 } from "@elementor/icons";
1759
+ import * as React57 from "react";
1760
+ import { useId as useId3 } from "react";
1761
+ import { ControlLabel as ControlLabel28, useBoundProp as useBoundProp3 } from "@elementor/editor-controls";
1762
+ import { DatabaseIcon, SettingsIcon, XIcon as XIcon2 } from "@elementor/icons";
1937
1763
  import {
1938
- bindPopover as bindPopover4,
1939
- bindTrigger as bindTrigger3,
1764
+ bindPopover as bindPopover2,
1765
+ bindTrigger,
1940
1766
  Box as Box5,
1941
- IconButton as IconButton5,
1767
+ Divider as Divider10,
1768
+ IconButton as IconButton3,
1942
1769
  Paper,
1943
- Popover as Popover4,
1944
- Stack as Stack25,
1945
- Typography as Typography6,
1946
- UnstableTag as Tag,
1947
- usePopupState as usePopupState5,
1948
- Tabs as Tabs2,
1949
- Divider as Divider6,
1950
- useTabs as useTabs2,
1770
+ Popover as Popover2,
1771
+ Stack as Stack20,
1951
1772
  Tab as Tab2,
1952
- TabPanel as TabPanel2
1773
+ TabPanel as TabPanel2,
1774
+ Tabs as Tabs2,
1775
+ Typography as Typography4,
1776
+ UnstableTag as Tag,
1777
+ usePopupState as usePopupState2,
1778
+ useTabs as useTabs2
1953
1779
  } from "@elementor/ui";
1780
+ import { __ as __37 } from "@wordpress/i18n";
1954
1781
 
1955
1782
  // src/dynamics/dynamic-control.tsx
1956
- import * as React67 from "react";
1783
+ import * as React55 from "react";
1784
+ import { BoundPropProvider as BoundPropProvider3, useBoundProp } from "@elementor/editor-controls";
1957
1785
 
1958
1786
  // src/dynamics/hooks/use-dynamic-tag.ts
1959
- import { useMemo as useMemo2 } from "react";
1787
+ import { useMemo as useMemo4 } from "react";
1960
1788
 
1961
1789
  // src/dynamics/hooks/use-prop-dynamic-tags.ts
1962
- import { useMemo } from "react";
1790
+ import { useMemo as useMemo3 } from "react";
1963
1791
 
1964
1792
  // src/dynamics/sync/get-elementor-config.ts
1965
- var getElementorConfig = () => {
1793
+ var getElementorConfig2 = () => {
1966
1794
  const extendedWindow = window;
1967
1795
  return extendedWindow.elementor?.config ?? {};
1968
1796
  };
1969
1797
 
1970
1798
  // src/dynamics/sync/get-atomic-dynamic-tags.ts
1971
1799
  var getAtomicDynamicTags = () => {
1972
- const { atomicDynamicTags } = getElementorConfig();
1800
+ const { atomicDynamicTags } = getElementorConfig2();
1973
1801
  if (!atomicDynamicTags) {
1974
1802
  return null;
1975
1803
  }
@@ -2003,7 +1831,7 @@ var usePropDynamicTags = (propName) => {
2003
1831
  const propDynamicType = getDynamicPropType(propType);
2004
1832
  categories = propDynamicType?.settings.categories || [];
2005
1833
  }
2006
- return useMemo(() => getDynamicTagsByCategories(categories), [categories.join()]);
1834
+ return useMemo3(() => getDynamicTagsByCategories(categories), [categories.join()]);
2007
1835
  };
2008
1836
  var getDynamicTagsByCategories = (categories) => {
2009
1837
  const dynamicTags = getAtomicDynamicTags();
@@ -2019,7 +1847,7 @@ var getDynamicTagsByCategories = (categories) => {
2019
1847
  // src/dynamics/hooks/use-dynamic-tag.ts
2020
1848
  var useDynamicTag = (propName, tagName) => {
2021
1849
  const dynamicTags = usePropDynamicTags(propName);
2022
- return useMemo2(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
1850
+ return useMemo4(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
2023
1851
  };
2024
1852
 
2025
1853
  // src/dynamics/dynamic-control.tsx
@@ -2044,81 +1872,61 @@ var DynamicControl = ({ bind, children }) => {
2044
1872
  }
2045
1873
  });
2046
1874
  };
2047
- return /* @__PURE__ */ React67.createElement(BoundPropProvider, { setValue: setDynamicValue, value: dynamicValue, bind }, children);
1875
+ return /* @__PURE__ */ React55.createElement(BoundPropProvider3, { setValue: setDynamicValue, value: dynamicValue, bind }, children);
2048
1876
  };
2049
1877
 
2050
1878
  // src/dynamics/components/dynamic-selection.tsx
2051
- import * as React68 from "react";
2052
- import { useState as useState6, Fragment as Fragment7 } from "react";
2053
- import { SearchIcon, PhotoIcon } from "@elementor/icons";
1879
+ import * as React56 from "react";
1880
+ import { Fragment as Fragment7, useState as useState5 } from "react";
1881
+ import { useBoundProp as useBoundProp2 } from "@elementor/editor-controls";
1882
+ import { PhotoIcon, SearchIcon } from "@elementor/icons";
2054
1883
  import {
2055
1884
  Box as Box4,
2056
- Divider as Divider5,
2057
- InputAdornment as InputAdornment3,
1885
+ Divider as Divider9,
1886
+ InputAdornment,
2058
1887
  Link,
2059
1888
  ListSubheader,
2060
- MenuItem as MenuItem3,
1889
+ MenuItem,
2061
1890
  MenuList,
2062
- Stack as Stack24,
2063
- TextField as TextField5,
2064
- Typography as Typography5
1891
+ Stack as Stack19,
1892
+ TextField as TextField2,
1893
+ Typography as Typography3
2065
1894
  } from "@elementor/ui";
2066
- import { __ as __39 } from "@wordpress/i18n";
2067
-
2068
- // src/dynamics/hooks/use-prop-value-history.ts
2069
- var PROPS_VALUES_HISTORY_KEY = "elementor/dynamic/non-dynamic-values-history";
2070
- var usePropValueHistory = (path) => {
2071
- const valuesHistory = getValues();
2072
- const { element } = useElement();
2073
- const key = `${element.id}-${path}`;
2074
- const value = valuesHistory[key] ?? null;
2075
- const setValue = (newValue) => {
2076
- setValues({ ...valuesHistory, [key]: newValue });
2077
- };
2078
- return [value, setValue];
2079
- };
2080
- var getValues = () => {
2081
- return JSON.parse(sessionStorage.getItem(PROPS_VALUES_HISTORY_KEY) || "{}");
2082
- };
2083
- var setValues = (values) => {
2084
- sessionStorage.setItem(PROPS_VALUES_HISTORY_KEY, JSON.stringify(values));
2085
- };
2086
-
2087
- // src/dynamics/components/dynamic-selection.tsx
2088
- var SIZE4 = "tiny";
1895
+ import { __ as __36 } from "@wordpress/i18n";
1896
+ var SIZE3 = "tiny";
2089
1897
  var DynamicSelection = ({ onSelect }) => {
2090
- const [searchValue, setSearchValue] = useState6("");
1898
+ const [searchValue, setSearchValue] = useState5("");
2091
1899
  const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
2092
- const { bind, value: currentValue, setValue } = useBoundProp();
2093
- const [, updatePropValueHistory] = usePropValueHistory(bind);
1900
+ const { bind, value: currentValue, setValue } = useBoundProp2();
1901
+ const { setPropValue: updatePropValueHistory } = usePropValueHistory();
2094
1902
  const isCurrentValueDynamic = isDynamicPropValue(currentValue);
2095
- const options5 = useFilteredOptions(bind, searchValue);
1903
+ const options7 = useFilteredOptions(bind, searchValue);
2096
1904
  const handleSearch = (event) => {
2097
1905
  setSearchValue(event.target.value);
2098
1906
  };
2099
1907
  const handleSetDynamicTag = (value) => {
2100
1908
  if (!isCurrentValueDynamic) {
2101
- updatePropValueHistory(currentValue);
1909
+ updatePropValueHistory(bind, currentValue);
2102
1910
  }
2103
1911
  setValue({ $$type: "dynamic", value: { name: value, settings: {} } });
2104
1912
  onSelect?.();
2105
1913
  };
2106
- return /* @__PURE__ */ React68.createElement(Stack24, null, /* @__PURE__ */ React68.createElement(Box4, { px: 1.5, pb: 1 }, /* @__PURE__ */ React68.createElement(
2107
- TextField5,
1914
+ return /* @__PURE__ */ React56.createElement(Stack19, null, /* @__PURE__ */ React56.createElement(Box4, { px: 1.5, pb: 1 }, /* @__PURE__ */ React56.createElement(
1915
+ TextField2,
2108
1916
  {
2109
1917
  fullWidth: true,
2110
- size: SIZE4,
1918
+ size: SIZE3,
2111
1919
  value: searchValue,
2112
1920
  onChange: handleSearch,
2113
- placeholder: __39("Search dynamic tag", "elementor"),
1921
+ placeholder: __36("Search dynamic tag", "elementor"),
2114
1922
  InputProps: {
2115
- startAdornment: /* @__PURE__ */ React68.createElement(InputAdornment3, { position: "start" }, /* @__PURE__ */ React68.createElement(SearchIcon, { fontSize: SIZE4 }))
1923
+ startAdornment: /* @__PURE__ */ React56.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React56.createElement(SearchIcon, { fontSize: SIZE3 }))
2116
1924
  }
2117
1925
  }
2118
- )), /* @__PURE__ */ React68.createElement(Divider5, null), /* @__PURE__ */ React68.createElement(Box4, { sx: { overflowY: "auto", height: 260, width: 220 } }, options5.length > 0 ? /* @__PURE__ */ React68.createElement(MenuList, { role: "listbox", tabIndex: 0 }, options5.map(([category, items], index) => /* @__PURE__ */ React68.createElement(Fragment7, { key: index }, /* @__PURE__ */ React68.createElement(ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items.map(({ value, label: tagLabel }) => {
1926
+ )), /* @__PURE__ */ React56.createElement(Divider9, null), /* @__PURE__ */ React56.createElement(Box4, { sx: { overflowY: "auto", height: 260, width: 220 } }, options7.length > 0 ? /* @__PURE__ */ React56.createElement(MenuList, { role: "listbox", tabIndex: 0 }, options7.map(([category, items2], index) => /* @__PURE__ */ React56.createElement(Fragment7, { key: index }, /* @__PURE__ */ React56.createElement(ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items2.map(({ value, label: tagLabel }) => {
2119
1927
  const isSelected = isCurrentValueDynamic && value === currentValue?.value?.name;
2120
- return /* @__PURE__ */ React68.createElement(
2121
- MenuItem3,
1928
+ return /* @__PURE__ */ React56.createElement(
1929
+ MenuItem,
2122
1930
  {
2123
1931
  key: value,
2124
1932
  selected: isSelected,
@@ -2128,7 +1936,7 @@ var DynamicSelection = ({ onSelect }) => {
2128
1936
  },
2129
1937
  tagLabel
2130
1938
  );
2131
- })))) : /* @__PURE__ */ React68.createElement(Stack24, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React68.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React68.createElement(Typography5, { align: "center", variant: "caption", color: "text.secondary" }, __39("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React68.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React68.createElement(Typography5, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React68.createElement(
1939
+ })))) : /* @__PURE__ */ React56.createElement(Stack19, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React56.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React56.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, __36("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React56.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React56.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React56.createElement(
2132
1940
  Link,
2133
1941
  {
2134
1942
  color: "secondary",
@@ -2136,12 +1944,12 @@ var DynamicSelection = ({ onSelect }) => {
2136
1944
  component: "button",
2137
1945
  onClick: () => setSearchValue("")
2138
1946
  },
2139
- __39("Clear the filters", "elementor")
2140
- ), "\xA0", __39("and try again.", "elementor")))));
1947
+ __36("Clear the filters", "elementor")
1948
+ ), "\xA0", __36("and try again.", "elementor")))));
2141
1949
  };
2142
1950
  var useFilteredOptions = (bind, searchValue) => {
2143
1951
  const dynamicTags = usePropDynamicTags(bind);
2144
- const options5 = dynamicTags.reduce((categories, { name, label, group }) => {
1952
+ const options7 = dynamicTags.reduce((categories, { name, label, group }) => {
2145
1953
  const isVisible = label.toLowerCase().includes(searchValue.trim().toLowerCase());
2146
1954
  if (!isVisible) {
2147
1955
  return categories;
@@ -2152,76 +1960,77 @@ var useFilteredOptions = (bind, searchValue) => {
2152
1960
  categories.get(group)?.push({ label, value: name });
2153
1961
  return categories;
2154
1962
  }, /* @__PURE__ */ new Map());
2155
- return [...options5];
1963
+ return [...options7];
2156
1964
  };
2157
1965
 
2158
1966
  // src/dynamics/components/dynamic-selection-control.tsx
2159
- var SIZE5 = "tiny";
1967
+ var SIZE4 = "tiny";
2160
1968
  var DynamicSelectionControl = () => {
2161
- const { bind, value, setValue } = useBoundProp();
2162
- const [propValueFromHistory] = usePropValueHistory(bind);
1969
+ const { bind, value, setValue } = useBoundProp3();
1970
+ const { getPropValue: getPropValueFromHistory } = usePropValueHistory();
2163
1971
  const { name: tagName = "" } = value?.value || {};
2164
- const selectionPopoverId = useId6();
2165
- const selectionPopoverState = usePopupState5({ variant: "popover", popupId: selectionPopoverId });
1972
+ const selectionPopoverId = useId3();
1973
+ const selectionPopoverState = usePopupState2({ variant: "popover", popupId: selectionPopoverId });
2166
1974
  const dynamicTag = useDynamicTag(bind, tagName);
2167
1975
  const removeDynamicTag = () => {
2168
- setValue(propValueFromHistory ?? null);
1976
+ const propValue = getPropValueFromHistory(bind);
1977
+ setValue(propValue ?? null);
2169
1978
  };
2170
1979
  if (!dynamicTag) {
2171
1980
  throw new Error(`Dynamic tag ${tagName} not found`);
2172
1981
  }
2173
- return /* @__PURE__ */ React69.createElement(Box5, null, /* @__PURE__ */ React69.createElement(
1982
+ return /* @__PURE__ */ React57.createElement(Box5, null, /* @__PURE__ */ React57.createElement(
2174
1983
  Tag,
2175
1984
  {
2176
1985
  fullWidth: true,
2177
1986
  showActionsOnHover: true,
2178
1987
  label: dynamicTag.label,
2179
- startIcon: /* @__PURE__ */ React69.createElement(DatabaseIcon, { fontSize: SIZE5 }),
2180
- ...bindTrigger3(selectionPopoverState),
2181
- actions: /* @__PURE__ */ React69.createElement(React69.Fragment, null, /* @__PURE__ */ React69.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React69.createElement(
2182
- IconButton5,
1988
+ startIcon: /* @__PURE__ */ React57.createElement(DatabaseIcon, { fontSize: SIZE4 }),
1989
+ ...bindTrigger(selectionPopoverState),
1990
+ actions: /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React57.createElement(
1991
+ IconButton3,
2183
1992
  {
2184
- size: SIZE5,
1993
+ size: SIZE4,
2185
1994
  onClick: removeDynamicTag,
2186
- "aria-label": __40("Remove dynamic value", "elementor")
1995
+ "aria-label": __37("Remove dynamic value", "elementor")
2187
1996
  },
2188
- /* @__PURE__ */ React69.createElement(XIcon3, { fontSize: SIZE5 })
1997
+ /* @__PURE__ */ React57.createElement(XIcon2, { fontSize: SIZE4 })
2189
1998
  ))
2190
1999
  }
2191
- ), /* @__PURE__ */ React69.createElement(
2192
- Popover4,
2000
+ ), /* @__PURE__ */ React57.createElement(
2001
+ Popover2,
2193
2002
  {
2194
2003
  disablePortal: true,
2195
2004
  disableScrollLock: true,
2196
2005
  anchorOrigin: { vertical: "bottom", horizontal: "left" },
2197
- ...bindPopover4(selectionPopoverState)
2006
+ ...bindPopover2(selectionPopoverState)
2198
2007
  },
2199
- /* @__PURE__ */ React69.createElement(Stack25, null, /* @__PURE__ */ React69.createElement(Stack25, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React69.createElement(DatabaseIcon, { fontSize: SIZE5, sx: { mr: 0.5 } }), /* @__PURE__ */ React69.createElement(Typography6, { variant: "subtitle2" }, __40("Dynamic Tags", "elementor")), /* @__PURE__ */ React69.createElement(IconButton5, { size: SIZE5, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React69.createElement(XIcon3, { fontSize: SIZE5 }))), /* @__PURE__ */ React69.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
2008
+ /* @__PURE__ */ React57.createElement(Stack20, null, /* @__PURE__ */ React57.createElement(Stack20, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React57.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React57.createElement(Typography4, { variant: "subtitle2" }, __37("Dynamic Tags", "elementor")), /* @__PURE__ */ React57.createElement(IconButton3, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React57.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React57.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
2200
2009
  ));
2201
2010
  };
2202
2011
  var DynamicSettingsPopover = ({ dynamicTag }) => {
2203
- const popupId = useId6();
2204
- const settingsPopupState = usePopupState5({ variant: "popover", popupId });
2012
+ const popupId = useId3();
2013
+ const settingsPopupState = usePopupState2({ variant: "popover", popupId });
2205
2014
  const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
2206
2015
  if (!hasDynamicSettings) {
2207
2016
  return null;
2208
2017
  }
2209
- return /* @__PURE__ */ React69.createElement(React69.Fragment, null, /* @__PURE__ */ React69.createElement(
2210
- IconButton5,
2018
+ return /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(
2019
+ IconButton3,
2211
2020
  {
2212
- size: SIZE5,
2213
- ...bindTrigger3(settingsPopupState),
2214
- "aria-label": __40("Settings", "elementor")
2021
+ size: SIZE4,
2022
+ ...bindTrigger(settingsPopupState),
2023
+ "aria-label": __37("Settings", "elementor")
2215
2024
  },
2216
- /* @__PURE__ */ React69.createElement(SettingsIcon, { fontSize: SIZE5 })
2217
- ), /* @__PURE__ */ React69.createElement(
2218
- Popover4,
2025
+ /* @__PURE__ */ React57.createElement(SettingsIcon, { fontSize: SIZE4 })
2026
+ ), /* @__PURE__ */ React57.createElement(
2027
+ Popover2,
2219
2028
  {
2220
2029
  disableScrollLock: true,
2221
2030
  anchorOrigin: { vertical: "bottom", horizontal: "center" },
2222
- ...bindPopover4(settingsPopupState)
2031
+ ...bindPopover2(settingsPopupState)
2223
2032
  },
2224
- /* @__PURE__ */ React69.createElement(Paper, { component: Stack25, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React69.createElement(Stack25, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React69.createElement(DatabaseIcon, { fontSize: SIZE5, sx: { mr: 0.5 } }), /* @__PURE__ */ React69.createElement(Typography6, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React69.createElement(IconButton5, { sx: { ml: "auto" }, size: SIZE5, onClick: settingsPopupState.close }, /* @__PURE__ */ React69.createElement(XIcon3, { fontSize: SIZE5 }))), /* @__PURE__ */ React69.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
2033
+ /* @__PURE__ */ React57.createElement(Paper, { component: Stack20, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React57.createElement(Stack20, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React57.createElement(DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React57.createElement(Typography4, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React57.createElement(IconButton3, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React57.createElement(XIcon2, { fontSize: SIZE4 }))), /* @__PURE__ */ React57.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
2225
2034
  ));
2226
2035
  };
2227
2036
  var DynamicSettings = ({ controls }) => {
@@ -2230,40 +2039,42 @@ var DynamicSettings = ({ controls }) => {
2230
2039
  if (!tabs.length) {
2231
2040
  return null;
2232
2041
  }
2233
- return /* @__PURE__ */ React69.createElement(React69.Fragment, null, /* @__PURE__ */ React69.createElement(Tabs2, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React69.createElement(Tab2, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React69.createElement(Divider6, null), tabs.map(({ value }, index) => {
2234
- return /* @__PURE__ */ React69.createElement(TabPanel2, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React69.createElement(Stack25, { gap: 1, px: 2 }, value.items.map((item) => {
2042
+ return /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(Tabs2, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React57.createElement(Tab2, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React57.createElement(Divider10, null), tabs.map(({ value }, index) => {
2043
+ return /* @__PURE__ */ React57.createElement(TabPanel2, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React57.createElement(Stack20, { gap: 1, px: 2 }, value.items.map((item) => {
2235
2044
  if (item.type === "control") {
2236
- return /* @__PURE__ */ React69.createElement(Control6, { key: item.value.bind, control: item.value });
2045
+ return /* @__PURE__ */ React57.createElement(Control3, { key: item.value.bind, control: item.value });
2237
2046
  }
2238
2047
  return null;
2239
2048
  })));
2240
2049
  }));
2241
2050
  };
2242
- var Control6 = ({ control }) => {
2051
+ var Control3 = ({ control }) => {
2243
2052
  if (!getControlByType(control.type)) {
2244
2053
  return null;
2245
2054
  }
2246
- return /* @__PURE__ */ React69.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React69.createElement(ControlLabel, null, control.label) : null, /* @__PURE__ */ React69.createElement(Control3, { type: control.type, props: control.props }));
2055
+ return /* @__PURE__ */ React57.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React57.createElement(ControlLabel28, null, control.label) : null, /* @__PURE__ */ React57.createElement(Control, { type: control.type, props: control.props }));
2247
2056
  };
2248
2057
 
2249
2058
  // src/dynamics/hooks/use-prop-dynamic-action.tsx
2250
- import * as React70 from "react";
2251
- import { __ as __41 } from "@wordpress/i18n";
2059
+ import * as React58 from "react";
2060
+ import { useBoundProp as useBoundProp4 } from "@elementor/editor-controls";
2252
2061
  import { DatabaseIcon as DatabaseIcon2 } from "@elementor/icons";
2062
+ import { __ as __38 } from "@wordpress/i18n";
2253
2063
  var usePropDynamicAction = () => {
2254
- const { bind } = useBoundProp();
2064
+ const { bind } = useBoundProp4();
2255
2065
  const { elementType } = useElement();
2256
2066
  const propType = elementType.propsSchema[bind];
2257
2067
  const visible = !!propType && supportsDynamic(propType);
2258
2068
  return {
2259
2069
  visible,
2260
2070
  icon: DatabaseIcon2,
2261
- title: __41("Dynamic Tags", "elementor"),
2262
- popoverContent: ({ closePopover }) => /* @__PURE__ */ React70.createElement(DynamicSelection, { onSelect: closePopover })
2071
+ title: __38("Dynamic Tags", "elementor"),
2072
+ popoverContent: ({ closePopover }) => /* @__PURE__ */ React58.createElement(DynamicSelection, { onSelect: closePopover })
2263
2073
  };
2264
2074
  };
2265
2075
 
2266
2076
  // src/dynamics/init.ts
2077
+ var { registerPopoverAction } = controlActionsMenu;
2267
2078
  var init = () => {
2268
2079
  replaceControl({
2269
2080
  component: DynamicSelectionControl,
@@ -2288,7 +2099,7 @@ function init2() {
2288
2099
  var blockV1Panel = () => {
2289
2100
  blockDataCommand({
2290
2101
  command: "panel/editor/open",
2291
- condition: shouldUseV2Panel
2102
+ condition: isAtomicWidgetSelected
2292
2103
  });
2293
2104
  };
2294
2105
 
@@ -2296,6 +2107,6 @@ var blockV1Panel = () => {
2296
2107
  init2();
2297
2108
  export {
2298
2109
  replaceControl,
2299
- useBoundProp
2110
+ useBoundProp5 as useBoundProp
2300
2111
  };
2301
2112
  //# sourceMappingURL=index.mjs.map