@elementor/editor-editing-panel 1.0.0 → 1.2.0

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