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