@elementor/editor-editing-panel 0.18.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/dist/index.d.mts +8 -24
- package/dist/index.d.ts +8 -24
- package/dist/index.js +1452 -1122
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1436 -1099
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -14
- package/src/components/accordion-section.tsx +3 -2
- package/src/components/add-or-remove-content.tsx +42 -0
- package/src/components/collapsible-field.tsx +34 -0
- package/src/components/editing-panel-error-fallback.tsx +12 -0
- package/src/components/editing-panel.tsx +27 -19
- package/src/components/settings-tab.tsx +12 -11
- package/src/components/style-sections/background-section/background-color-field.tsx +21 -0
- package/src/components/style-sections/background-section/background-section.tsx +15 -0
- package/src/components/style-sections/border-section/border-color-field.tsx +21 -0
- package/src/components/style-sections/border-section/border-field.tsx +47 -0
- package/src/components/style-sections/border-section/border-radius-field.tsx +48 -0
- package/src/components/style-sections/border-section/border-section.tsx +16 -0
- package/src/components/style-sections/border-section/border-style-field.tsx +32 -0
- package/src/components/style-sections/border-section/border-width-field.tsx +42 -0
- package/src/components/style-sections/effects-section/effects-section.tsx +5 -5
- package/src/components/style-sections/position-section/dimensions-field.tsx +46 -0
- package/src/components/style-sections/position-section/position-field.tsx +28 -0
- package/src/components/style-sections/position-section/position-section.tsx +15 -2
- package/src/components/style-sections/position-section/z-index-field.tsx +21 -0
- package/src/components/style-sections/size-section/overflow-field.tsx +45 -0
- package/src/components/style-sections/size-section/size-section.tsx +55 -0
- package/src/components/style-sections/spacing-section/spacing-section.tsx +6 -6
- package/src/components/style-sections/typography-section/font-size-field.tsx +21 -0
- package/src/components/style-sections/typography-section/{font-weight-control.tsx → font-weight-field.tsx} +7 -6
- package/src/components/style-sections/typography-section/letter-spacing-field.tsx +21 -0
- package/src/components/style-sections/typography-section/{text-alignment-control.tsx → text-alignment-field.tsx} +8 -8
- package/src/components/style-sections/typography-section/text-color-field.tsx +21 -0
- package/src/components/style-sections/typography-section/{text-direction-control.tsx → text-direction-field.tsx} +8 -8
- package/src/components/style-sections/typography-section/text-stroke-field.tsx +16 -0
- package/src/components/style-sections/typography-section/{text-style-control.tsx → text-style-field.tsx} +5 -5
- package/src/components/style-sections/typography-section/{transform-control.tsx → transform-field.tsx} +8 -7
- package/src/components/style-sections/typography-section/typography-section.tsx +20 -18
- package/src/components/style-sections/typography-section/word-spacing-field.tsx +21 -0
- package/src/components/style-tab.tsx +44 -25
- package/src/contexts/classes-prop-context.tsx +24 -0
- package/src/contexts/element-context.tsx +6 -10
- package/src/contexts/style-context.tsx +8 -22
- package/src/control-replacement.tsx +3 -0
- package/src/controls/bound-prop-context.tsx +30 -0
- package/src/controls/components/control-toggle-button-group.tsx +15 -6
- package/src/controls/components/repeater.tsx +1 -1
- package/src/controls/components/text-field-inner-selection.tsx +20 -24
- package/src/controls/control-actions/control-actions-context.tsx +27 -0
- package/src/controls/control-actions/control-actions-menu.ts +6 -7
- package/src/controls/control-actions/control-actions.tsx +14 -26
- package/src/{components/style-sections/effects-section/box-shadow-repeater.tsx → controls/controls/box-shadow-repeater-control.tsx} +51 -65
- package/src/controls/controls/color-control.tsx +25 -0
- package/src/controls/controls/equal-unequal-sizes-control.tsx +196 -0
- package/src/controls/{control-types → controls}/image-control.tsx +15 -23
- package/src/controls/{control-types → controls}/image-media-control.tsx +5 -14
- package/src/{components/style-sections/spacing-section → controls/controls}/linked-dimensions-control.tsx +10 -26
- package/src/controls/{control-types → controls}/number-control.tsx +2 -2
- package/src/controls/{control-types → controls}/select-control.tsx +4 -4
- package/src/controls/{control-types → controls}/size-control.tsx +8 -8
- package/src/controls/controls/stroke-control.tsx +105 -0
- package/src/controls/{control-types → controls}/text-area-control.tsx +3 -3
- package/src/controls/{control-types → controls}/text-control.tsx +3 -3
- package/src/controls/{control-types → controls}/toggle-control.tsx +4 -4
- package/src/controls/create-control-replacement.tsx +53 -0
- package/src/controls/create-control.tsx +12 -3
- package/src/controls/index.ts +24 -0
- package/src/controls-actions.ts +8 -0
- package/src/{controls/components → controls-registry}/control-type-container.tsx +1 -1
- package/src/{controls → controls-registry}/controls-registry.tsx +1 -6
- package/src/controls-registry/settings-field.tsx +35 -0
- package/src/controls-registry/styles-field.tsx +19 -0
- package/src/dynamics/components/dynamic-selection-control.tsx +11 -11
- package/src/dynamics/components/dynamic-selection.tsx +6 -6
- package/src/dynamics/dynamic-control.tsx +6 -5
- package/src/dynamics/hooks/use-dynamic-tag.ts +2 -2
- package/src/dynamics/hooks/use-prop-dynamic-action.tsx +7 -7
- package/src/dynamics/hooks/use-prop-dynamic-tags.ts +3 -3
- package/src/dynamics/hooks/use-prop-value-history.ts +3 -3
- package/src/dynamics/init.ts +2 -4
- package/src/dynamics/types.ts +2 -1
- package/src/dynamics/utils.ts +1 -2
- package/src/hooks/use-styles-field.ts +30 -0
- package/src/index.ts +3 -4
- package/src/sync/should-use-v2-panel.ts +1 -2
- package/src/sync/types.ts +3 -2
- package/src/components/style-sections/position-section/z-index-control.tsx +0 -20
- package/src/components/style-sections/size-section.tsx +0 -49
- package/src/components/style-sections/typography-section/font-size-control.tsx +0 -20
- package/src/components/style-sections/typography-section/letter-spacing-control.tsx +0 -20
- package/src/components/style-sections/typography-section/text-color-control.tsx +0 -20
- package/src/components/style-sections/typography-section/word-spacing-control.tsx +0 -20
- package/src/controls/control-context.tsx +0 -22
- package/src/controls/control-replacement.ts +0 -34
- package/src/controls/control-types/color-control.tsx +0 -27
- package/src/controls/hooks/use-style-control.ts +0 -29
- package/src/controls/settings-control.tsx +0 -37
- package/src/controls/style-control.tsx +0 -20
- package/src/hooks/use-element-style-prop.ts +0 -45
- package/src/hooks/use-element-styles.ts +0 -13
- package/src/hooks/use-element-type.ts +0 -33
- package/src/hooks/use-selected-elements.ts +0 -9
- package/src/hooks/use-widget-settings.ts +0 -16
- package/src/props/is-transformable.ts +0 -14
- package/src/sync/get-container.ts +0 -8
- package/src/sync/get-element-styles.ts +0 -9
- package/src/sync/get-selected-elements.ts +0 -21
- package/src/sync/get-widgets-cache.ts +0 -7
- package/src/sync/update-settings.ts +0 -14
- package/src/sync/update-style.ts +0 -24
- package/src/types.ts +0 -89
- package/src/{controls → controls-registry}/control.tsx +0 -0
- package/src/{controls/control-actions/actions/popover-action.tsx → popover-action.tsx} +1 -1
package/dist/index.js
CHANGED
|
@@ -30,318 +30,125 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
|
-
controlActionsMenu: () => controlActionsMenu,
|
|
34
33
|
replaceControl: () => replaceControl,
|
|
35
|
-
|
|
34
|
+
useBoundProp: () => useBoundProp
|
|
36
35
|
});
|
|
37
36
|
module.exports = __toCommonJS(src_exports);
|
|
38
37
|
|
|
39
|
-
// src/controls/control
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
function useControl(defaultValue) {
|
|
43
|
-
const controlContext = (0, import_react.useContext)(ControlContext);
|
|
44
|
-
if (!controlContext) {
|
|
45
|
-
throw new Error("useControl must be used within a ControlContext");
|
|
46
|
-
}
|
|
47
|
-
return { ...controlContext, value: controlContext.value ?? defaultValue };
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// src/controls/control-replacement.ts
|
|
51
|
-
var controlReplacement;
|
|
52
|
-
var getControlReplacement = ({ value }) => {
|
|
53
|
-
let shouldReplace = false;
|
|
54
|
-
try {
|
|
55
|
-
shouldReplace = !!controlReplacement?.condition({ value }) && !!controlReplacement?.component;
|
|
56
|
-
} catch {
|
|
57
|
-
}
|
|
58
|
-
return shouldReplace ? controlReplacement?.component : void 0;
|
|
59
|
-
};
|
|
60
|
-
function replaceControl({ component, condition }) {
|
|
61
|
-
controlReplacement = { component, condition };
|
|
62
|
-
}
|
|
63
|
-
function useControlReplacement() {
|
|
64
|
-
const { value } = useControl();
|
|
65
|
-
return getControlReplacement({ value });
|
|
66
|
-
}
|
|
38
|
+
// src/controls/controls/image-control.tsx
|
|
39
|
+
var React9 = __toESM(require("react"));
|
|
40
|
+
var import_i18n2 = require("@wordpress/i18n");
|
|
67
41
|
|
|
68
|
-
// src/controls/
|
|
42
|
+
// src/controls/bound-prop-context.tsx
|
|
69
43
|
var React = __toESM(require("react"));
|
|
70
|
-
var
|
|
71
|
-
var
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}) {
|
|
80
|
-
const id = (0, import_react2.useId)();
|
|
81
|
-
const popupState = (0, import_ui.usePopupState)({
|
|
82
|
-
variant: "popover",
|
|
83
|
-
popupId: `elementor-popover-action-${id}`
|
|
84
|
-
});
|
|
85
|
-
if (!visible) {
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(import_ui.Tooltip, { placement: "top", title }, /* @__PURE__ */ React.createElement(import_ui.IconButton, { "aria-label": title, key: id, size: SIZE, ...(0, import_ui.bindToggle)(popupState) }, /* @__PURE__ */ React.createElement(Icon, { fontSize: SIZE }))), /* @__PURE__ */ React.createElement(
|
|
89
|
-
import_ui.Popover,
|
|
90
|
-
{
|
|
91
|
-
disablePortal: true,
|
|
92
|
-
disableScrollLock: true,
|
|
93
|
-
anchorOrigin: {
|
|
94
|
-
vertical: "bottom",
|
|
95
|
-
horizontal: "center"
|
|
96
|
-
},
|
|
97
|
-
...(0, import_ui.bindPopover)(popupState)
|
|
98
|
-
},
|
|
99
|
-
/* @__PURE__ */ React.createElement(import_ui.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React.createElement(Icon, { fontSize: SIZE, sx: { mr: 0.5 } }), /* @__PURE__ */ React.createElement(import_ui.Typography, { variant: "subtitle2" }, title), /* @__PURE__ */ React.createElement(import_ui.IconButton, { sx: { ml: "auto" }, size: SIZE, onClick: popupState.close }, /* @__PURE__ */ React.createElement(import_icons.XIcon, { fontSize: SIZE }))),
|
|
100
|
-
/* @__PURE__ */ React.createElement(PopoverContent, { closePopover: popupState.close })
|
|
101
|
-
));
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// src/controls/control-actions/control-actions-menu.ts
|
|
105
|
-
var import_menus = require("@elementor/menus");
|
|
106
|
-
var controlActionsMenu = (0, import_menus.createMenu)({
|
|
107
|
-
components: {
|
|
108
|
-
PopoverAction
|
|
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");
|
|
109
53
|
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// src/panel.ts
|
|
113
|
-
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
114
|
-
|
|
115
|
-
// src/components/editing-panel.tsx
|
|
116
|
-
var React45 = __toESM(require("react"));
|
|
117
|
-
var import_i18n23 = require("@wordpress/i18n");
|
|
118
|
-
|
|
119
|
-
// src/hooks/use-selected-elements.ts
|
|
120
|
-
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
121
|
-
|
|
122
|
-
// src/sync/get-selected-elements.ts
|
|
123
|
-
function getSelectedElements() {
|
|
124
|
-
const extendedWindow = window;
|
|
125
|
-
const selectedElements = extendedWindow.elementor?.selection?.getElements?.() ?? [];
|
|
126
|
-
return selectedElements.reduce((acc, el) => {
|
|
127
|
-
const type = el.model.get("widgetType") || el.model.get("elType");
|
|
128
|
-
if (type) {
|
|
129
|
-
acc.push({
|
|
130
|
-
id: el.model.get("id"),
|
|
131
|
-
type
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
return acc;
|
|
135
|
-
}, []);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// src/hooks/use-selected-elements.ts
|
|
139
|
-
function useSelectedElements() {
|
|
140
|
-
return (0, import_editor_v1_adapters.__privateUseListenTo)(
|
|
141
|
-
[(0, import_editor_v1_adapters.commandEndEvent)("document/elements/select"), (0, import_editor_v1_adapters.commandEndEvent)("document/elements/deselect")],
|
|
142
|
-
() => getSelectedElements()
|
|
143
|
-
);
|
|
54
|
+
return { ...boundPropContext, value: boundPropContext.value ?? defaultValue };
|
|
144
55
|
}
|
|
145
56
|
|
|
146
|
-
// src/
|
|
147
|
-
var
|
|
148
|
-
|
|
149
|
-
// src/sync/get-widgets-cache.ts
|
|
150
|
-
function getWidgetsCache() {
|
|
151
|
-
const extendedWindow = window;
|
|
152
|
-
return extendedWindow?.elementor?.widgetsCache || null;
|
|
153
|
-
}
|
|
57
|
+
// src/controls/controls/image-control.tsx
|
|
58
|
+
var import_ui6 = require("@elementor/ui");
|
|
154
59
|
|
|
155
|
-
// src/
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return null;
|
|
162
|
-
}
|
|
163
|
-
const widgetsCache = getWidgetsCache();
|
|
164
|
-
const elementType = widgetsCache?.[type];
|
|
165
|
-
if (!elementType?.atomic_controls) {
|
|
166
|
-
return null;
|
|
167
|
-
}
|
|
168
|
-
if (!elementType?.atomic_props_schema) {
|
|
169
|
-
return null;
|
|
170
|
-
}
|
|
171
|
-
return {
|
|
172
|
-
key: type,
|
|
173
|
-
controls: elementType.atomic_controls,
|
|
174
|
-
propsSchema: elementType.atomic_props_schema,
|
|
175
|
-
title: elementType.title
|
|
176
|
-
};
|
|
177
|
-
},
|
|
178
|
-
[type]
|
|
179
|
-
);
|
|
180
|
-
}
|
|
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");
|
|
181
66
|
|
|
182
|
-
// src/
|
|
183
|
-
var
|
|
67
|
+
// src/controls/control-actions/control-actions.tsx
|
|
68
|
+
var React3 = __toESM(require("react"));
|
|
69
|
+
var import_ui = require("@elementor/ui");
|
|
184
70
|
|
|
185
|
-
// src/
|
|
71
|
+
// src/controls/control-actions/control-actions-context.tsx
|
|
186
72
|
var React2 = __toESM(require("react"));
|
|
187
|
-
var
|
|
188
|
-
var Context = (0,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
function useElementContext() {
|
|
193
|
-
const context = (0, import_react3.useContext)(Context);
|
|
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);
|
|
194
78
|
if (!context) {
|
|
195
|
-
throw new Error("
|
|
79
|
+
throw new Error("useControlActions must be used within a ControlActionsProvider");
|
|
196
80
|
}
|
|
197
81
|
return context;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// src/components/editing-panel-tabs.tsx
|
|
201
|
-
var import_ui37 = require("@elementor/ui");
|
|
202
|
-
var React44 = __toESM(require("react"));
|
|
203
|
-
var import_i18n22 = require("@wordpress/i18n");
|
|
204
|
-
|
|
205
|
-
// src/components/settings-tab.tsx
|
|
206
|
-
var React17 = __toESM(require("react"));
|
|
207
|
-
var import_ui13 = require("@elementor/ui");
|
|
208
|
-
|
|
209
|
-
// src/controls/settings-control.tsx
|
|
210
|
-
var React4 = __toESM(require("react"));
|
|
211
|
-
|
|
212
|
-
// src/hooks/use-widget-settings.ts
|
|
213
|
-
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
214
|
-
|
|
215
|
-
// src/sync/get-container.ts
|
|
216
|
-
function getContainer(id) {
|
|
217
|
-
const extendedWindow = window;
|
|
218
|
-
const container = extendedWindow.elementor?.getContainer?.(id);
|
|
219
|
-
return container ?? null;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// src/hooks/use-widget-settings.ts
|
|
223
|
-
var useWidgetSettings = ({ id, bind }) => {
|
|
224
|
-
return (0, import_editor_v1_adapters3.__privateUseListenTo)(
|
|
225
|
-
(0, import_editor_v1_adapters3.commandEndEvent)("document/elements/settings"),
|
|
226
|
-
() => {
|
|
227
|
-
const container = getContainer(id);
|
|
228
|
-
const value = container?.settings?.get(bind) ?? null;
|
|
229
|
-
return value;
|
|
230
|
-
},
|
|
231
|
-
[id, bind]
|
|
232
|
-
);
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
// src/sync/update-settings.ts
|
|
236
|
-
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
237
|
-
var updateSettings = ({ id, props }) => {
|
|
238
|
-
const container = getContainer(id);
|
|
239
|
-
(0, import_editor_v1_adapters4.__privateRunCommand)("document/elements/settings", {
|
|
240
|
-
container,
|
|
241
|
-
settings: {
|
|
242
|
-
...props
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
// src/components/control-label.tsx
|
|
248
|
-
var React3 = __toESM(require("react"));
|
|
249
|
-
var import_ui2 = require("@elementor/ui");
|
|
250
|
-
var ControlLabel = ({ children }) => {
|
|
251
|
-
return /* @__PURE__ */ React3.createElement(import_ui2.Typography, { component: "label", variant: "caption", color: "text.secondary" }, children);
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
// src/controls/settings-control.tsx
|
|
255
|
-
var SettingsControl = ({ bind, children }) => {
|
|
256
|
-
const { element, elementType } = useElementContext();
|
|
257
|
-
const defaultValue = elementType.propsSchema[bind]?.default;
|
|
258
|
-
const settingsValue = useWidgetSettings({ id: element.id, bind });
|
|
259
|
-
const value = settingsValue ?? defaultValue ?? null;
|
|
260
|
-
const setValue = (newValue) => {
|
|
261
|
-
updateSettings({
|
|
262
|
-
id: element.id,
|
|
263
|
-
props: {
|
|
264
|
-
[bind]: newValue
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
};
|
|
268
|
-
return /* @__PURE__ */ React4.createElement(ControlContext.Provider, { value: { setValue, value, bind } }, children);
|
|
269
|
-
};
|
|
270
|
-
SettingsControl.Label = ControlLabel;
|
|
271
|
-
|
|
272
|
-
// src/components/accordion-section.tsx
|
|
273
|
-
var React5 = __toESM(require("react"));
|
|
274
|
-
var import_react4 = require("react");
|
|
275
|
-
var import_ui3 = require("@elementor/ui");
|
|
276
|
-
var AccordionSection = ({ title, children }) => {
|
|
277
|
-
const uid = (0, import_react4.useId)();
|
|
278
|
-
const labelId = `label-${uid}`;
|
|
279
|
-
const contentId = `content-${uid}`;
|
|
280
|
-
return /* @__PURE__ */ React5.createElement(import_ui3.Accordion, { disableGutters: true, defaultExpanded: true }, /* @__PURE__ */ React5.createElement(import_ui3.AccordionSummary, { "aria-controls": contentId, id: labelId }, /* @__PURE__ */ React5.createElement(import_ui3.AccordionSummaryText, { primaryTypographyProps: { variant: "caption" } }, title)), /* @__PURE__ */ React5.createElement(import_ui3.AccordionDetails, { id: contentId, "aria-labelledby": labelId }, /* @__PURE__ */ React5.createElement(import_ui3.Stack, { gap: 2.5 }, children)));
|
|
281
82
|
};
|
|
282
83
|
|
|
283
|
-
// src/controls/control.tsx
|
|
284
|
-
var React15 = __toESM(require("react"));
|
|
285
|
-
var import_utils = require("@elementor/utils");
|
|
286
|
-
|
|
287
|
-
// src/controls/control-types/image-control.tsx
|
|
288
|
-
var React10 = __toESM(require("react"));
|
|
289
|
-
var import_ui7 = require("@elementor/ui");
|
|
290
|
-
var import_i18n2 = require("@wordpress/i18n");
|
|
291
|
-
|
|
292
|
-
// src/controls/control-types/image-media-control.tsx
|
|
293
|
-
var React8 = __toESM(require("react"));
|
|
294
|
-
var import_ui5 = require("@elementor/ui");
|
|
295
|
-
var import_icons2 = require("@elementor/icons");
|
|
296
|
-
var import_wp_media = require("@elementor/wp-media");
|
|
297
|
-
var import_i18n = require("@wordpress/i18n");
|
|
298
|
-
|
|
299
84
|
// src/controls/control-actions/control-actions.tsx
|
|
300
|
-
var
|
|
301
|
-
|
|
302
|
-
var { useMenuItems } = controlActionsMenu;
|
|
303
|
-
var FloatingBar = (0, import_ui4.styled)(import_ui4.UnstableFloatingActionBar)`
|
|
304
|
-
& .MuiPaper-root:empty {
|
|
305
|
-
display: none;
|
|
306
|
-
}
|
|
85
|
+
var FloatingBarContainer = (0, import_ui.styled)("span")`
|
|
86
|
+
display: contents;
|
|
307
87
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
& > :first-of-type {
|
|
311
|
-
width: 100%;
|
|
88
|
+
.MuiFloatingActionBar-popper:has( .MuiFloatingActionBar-actions:empty ) {
|
|
89
|
+
display: none;
|
|
312
90
|
}
|
|
313
91
|
`;
|
|
314
|
-
function ControlActions({
|
|
315
|
-
const items =
|
|
92
|
+
function ControlActions({ children }) {
|
|
93
|
+
const { items } = useControlActions();
|
|
316
94
|
if (items.length === 0) {
|
|
317
95
|
return children;
|
|
318
96
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
{
|
|
322
|
-
actions: items.map(({ MenuItem: MenuItem4, id }) => /* @__PURE__ */ React6.createElement(MenuItem4, { key: id })),
|
|
323
|
-
sx: fullWidth ? { width: "100%" } : void 0
|
|
324
|
-
},
|
|
325
|
-
children
|
|
326
|
-
);
|
|
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));
|
|
327
99
|
}
|
|
328
100
|
|
|
329
101
|
// src/controls/create-control.tsx
|
|
330
|
-
var
|
|
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;
|
|
132
|
+
}
|
|
133
|
+
return { replaceControl: replaceControl2, getControlReplacement: getControlReplacement2 };
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
// src/controls/create-control.tsx
|
|
137
|
+
var import_ui2 = require("@elementor/ui");
|
|
331
138
|
var brandSymbol = Symbol("control");
|
|
332
139
|
function createControl(Component, { supportsReplacements = true } = {}) {
|
|
333
140
|
return (props) => {
|
|
334
141
|
const ControlReplacement = useControlReplacement();
|
|
335
142
|
if (ControlReplacement && supportsReplacements) {
|
|
336
|
-
return /* @__PURE__ */
|
|
143
|
+
return /* @__PURE__ */ React5.createElement(import_ui2.ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(ControlReplacement, { ...props }));
|
|
337
144
|
}
|
|
338
|
-
return /* @__PURE__ */
|
|
145
|
+
return /* @__PURE__ */ React5.createElement(import_ui2.ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(Component, { ...props }));
|
|
339
146
|
};
|
|
340
147
|
}
|
|
341
148
|
|
|
342
|
-
// src/controls/
|
|
149
|
+
// src/controls/controls/image-media-control.tsx
|
|
343
150
|
var ImageMediaControl = createControl(() => {
|
|
344
|
-
const { value, setValue } =
|
|
151
|
+
const { value, setValue } = useBoundProp();
|
|
345
152
|
const { id, url } = value?.value ?? {};
|
|
346
153
|
const { data: attachment } = (0, import_wp_media.useWpMediaAttachment)(id?.value || null);
|
|
347
154
|
const src = attachment?.url ?? url;
|
|
@@ -362,8 +169,8 @@ var ImageMediaControl = createControl(() => {
|
|
|
362
169
|
});
|
|
363
170
|
}
|
|
364
171
|
});
|
|
365
|
-
return /* @__PURE__ */
|
|
366
|
-
|
|
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,
|
|
367
174
|
{
|
|
368
175
|
size: "tiny",
|
|
369
176
|
color: "inherit",
|
|
@@ -371,33 +178,40 @@ var ImageMediaControl = createControl(() => {
|
|
|
371
178
|
onClick: () => open({ mode: "browse" })
|
|
372
179
|
},
|
|
373
180
|
(0, import_i18n.__)("Select Image", "elementor")
|
|
374
|
-
), /* @__PURE__ */
|
|
375
|
-
|
|
181
|
+
), /* @__PURE__ */ React6.createElement(
|
|
182
|
+
import_ui3.Button,
|
|
376
183
|
{
|
|
377
184
|
size: "tiny",
|
|
378
185
|
variant: "text",
|
|
379
186
|
color: "inherit",
|
|
380
|
-
startIcon: /* @__PURE__ */
|
|
187
|
+
startIcon: /* @__PURE__ */ React6.createElement(import_icons.UploadIcon, null),
|
|
381
188
|
onClick: () => open({ mode: "upload" })
|
|
382
189
|
},
|
|
383
190
|
(0, import_i18n.__)("Upload Image", "elementor")
|
|
384
191
|
)))));
|
|
385
192
|
});
|
|
386
193
|
|
|
387
|
-
// src/controls/
|
|
388
|
-
var
|
|
389
|
-
var
|
|
390
|
-
var SelectControl = createControl(({ options:
|
|
391
|
-
const { value, setValue } =
|
|
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();
|
|
392
199
|
const handleChange = (event) => {
|
|
393
200
|
setValue(event.target.value);
|
|
394
201
|
};
|
|
395
|
-
return /* @__PURE__ */
|
|
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))));
|
|
396
203
|
});
|
|
397
204
|
|
|
398
|
-
// src/
|
|
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);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
// src/controls/controls/image-control.tsx
|
|
399
213
|
var ImageControl = createControl((props) => {
|
|
400
|
-
const { value, setValue } =
|
|
214
|
+
const { value, setValue } = useBoundProp();
|
|
401
215
|
const { src, size } = value?.value || {};
|
|
402
216
|
const setImageSrc = (newValue) => {
|
|
403
217
|
setValue({
|
|
@@ -417,28 +231,28 @@ var ImageControl = createControl((props) => {
|
|
|
417
231
|
}
|
|
418
232
|
});
|
|
419
233
|
};
|
|
420
|
-
return /* @__PURE__ */
|
|
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 })))));
|
|
421
235
|
});
|
|
422
236
|
|
|
423
|
-
// src/controls/
|
|
424
|
-
var
|
|
425
|
-
var
|
|
237
|
+
// src/controls/controls/text-control.tsx
|
|
238
|
+
var React10 = __toESM(require("react"));
|
|
239
|
+
var import_ui7 = require("@elementor/ui");
|
|
426
240
|
var TextControl = createControl(({ placeholder }) => {
|
|
427
|
-
const { value, setValue } =
|
|
241
|
+
const { value, setValue } = useBoundProp("");
|
|
428
242
|
const handleChange = (event) => setValue(event.target.value);
|
|
429
|
-
return /* @__PURE__ */
|
|
243
|
+
return /* @__PURE__ */ React10.createElement(ControlActions, null, /* @__PURE__ */ React10.createElement(import_ui7.TextField, { type: "text", size: "tiny", value, onChange: handleChange, placeholder }));
|
|
430
244
|
});
|
|
431
245
|
|
|
432
|
-
// src/controls/
|
|
433
|
-
var
|
|
434
|
-
var
|
|
246
|
+
// src/controls/controls/text-area-control.tsx
|
|
247
|
+
var React11 = __toESM(require("react"));
|
|
248
|
+
var import_ui8 = require("@elementor/ui");
|
|
435
249
|
var TextAreaControl = createControl(({ placeholder }) => {
|
|
436
|
-
const { value, setValue } =
|
|
250
|
+
const { value, setValue } = useBoundProp();
|
|
437
251
|
const handleChange = (event) => {
|
|
438
252
|
setValue(event.target.value);
|
|
439
253
|
};
|
|
440
|
-
return /* @__PURE__ */
|
|
441
|
-
|
|
254
|
+
return /* @__PURE__ */ React11.createElement(ControlActions, null, /* @__PURE__ */ React11.createElement(
|
|
255
|
+
import_ui8.TextField,
|
|
442
256
|
{
|
|
443
257
|
size: "tiny",
|
|
444
258
|
multiline: true,
|
|
@@ -451,12 +265,12 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
451
265
|
));
|
|
452
266
|
});
|
|
453
267
|
|
|
454
|
-
// src/controls/
|
|
455
|
-
var
|
|
456
|
-
var
|
|
268
|
+
// src/controls/controls/size-control.tsx
|
|
269
|
+
var React13 = __toESM(require("react"));
|
|
270
|
+
var import_ui10 = require("@elementor/ui");
|
|
457
271
|
|
|
458
272
|
// src/controls/hooks/use-sync-external-state.tsx
|
|
459
|
-
var
|
|
273
|
+
var import_react4 = require("react");
|
|
460
274
|
var useSyncExternalState = ({
|
|
461
275
|
external,
|
|
462
276
|
setExternal,
|
|
@@ -475,8 +289,8 @@ var useSyncExternalState = ({
|
|
|
475
289
|
}
|
|
476
290
|
return externalValue;
|
|
477
291
|
}
|
|
478
|
-
const [internal, setInternal] = (0,
|
|
479
|
-
(0,
|
|
292
|
+
const [internal, setInternal] = (0, import_react4.useState)(toInternal(external, void 0));
|
|
293
|
+
(0, import_react4.useEffect)(() => {
|
|
480
294
|
setInternal((prevInternal) => toInternal(external, prevInternal));
|
|
481
295
|
}, [external]);
|
|
482
296
|
const setInternalValue = (setter) => {
|
|
@@ -489,61 +303,57 @@ var useSyncExternalState = ({
|
|
|
489
303
|
};
|
|
490
304
|
|
|
491
305
|
// src/controls/components/text-field-inner-selection.tsx
|
|
492
|
-
var
|
|
493
|
-
var
|
|
494
|
-
var
|
|
495
|
-
var TextFieldInnerSelection = (
|
|
496
|
-
placeholder,
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
placeholder,
|
|
511
|
-
InputProps: {
|
|
512
|
-
endAdornment,
|
|
513
|
-
startAdornment
|
|
306
|
+
var React12 = __toESM(require("react"));
|
|
307
|
+
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
|
|
514
324
|
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
);
|
|
518
328
|
var SelectionEndAdornment = ({
|
|
519
|
-
options:
|
|
329
|
+
options: options5,
|
|
520
330
|
onClick,
|
|
521
331
|
value
|
|
522
332
|
}) => {
|
|
523
|
-
const popupState = (0,
|
|
333
|
+
const popupState = (0, import_ui9.usePopupState)({
|
|
524
334
|
variant: "popover",
|
|
525
|
-
popupId: (0,
|
|
335
|
+
popupId: (0, import_react5.useId)()
|
|
526
336
|
});
|
|
527
337
|
const handleMenuItemClick = (index) => {
|
|
528
|
-
onClick(
|
|
338
|
+
onClick(options5[index]);
|
|
529
339
|
popupState.close();
|
|
530
340
|
};
|
|
531
|
-
return /* @__PURE__ */
|
|
532
|
-
|
|
341
|
+
return /* @__PURE__ */ React12.createElement(import_ui9.InputAdornment, { position: "end" }, /* @__PURE__ */ React12.createElement(
|
|
342
|
+
import_ui9.Button,
|
|
533
343
|
{
|
|
534
344
|
size: "small",
|
|
535
345
|
color: "inherit",
|
|
536
346
|
sx: { font: "inherit", minWidth: "initial" },
|
|
537
|
-
...(0,
|
|
347
|
+
...(0, import_ui9.bindTrigger)(popupState)
|
|
538
348
|
},
|
|
539
349
|
value.toUpperCase()
|
|
540
|
-
), /* @__PURE__ */
|
|
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()))));
|
|
541
351
|
};
|
|
542
352
|
|
|
543
|
-
// src/controls/
|
|
544
|
-
var defaultUnits = ["px", "%", "em", "rem", "vw"];
|
|
545
|
-
var SizeControl = createControl(({ units = defaultUnits, placeholder, startIcon }) => {
|
|
546
|
-
const { value, setValue } =
|
|
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();
|
|
547
357
|
const [state, setState] = useSyncExternalState({
|
|
548
358
|
external: value,
|
|
549
359
|
setExternal: setValue,
|
|
@@ -572,12 +382,12 @@ var SizeControl = createControl(({ units = defaultUnits, placeholder, startIcon
|
|
|
572
382
|
}
|
|
573
383
|
}));
|
|
574
384
|
};
|
|
575
|
-
return /* @__PURE__ */
|
|
385
|
+
return /* @__PURE__ */ React13.createElement(ControlActions, null, /* @__PURE__ */ React13.createElement(
|
|
576
386
|
TextFieldInnerSelection,
|
|
577
387
|
{
|
|
578
|
-
endAdornment: /* @__PURE__ */
|
|
388
|
+
endAdornment: /* @__PURE__ */ React13.createElement(SelectionEndAdornment, { options: units2, onClick: handleUnitChange, value: state.value.unit }),
|
|
579
389
|
placeholder,
|
|
580
|
-
startAdornment: startIcon ?? /* @__PURE__ */
|
|
390
|
+
startAdornment: startIcon ?? /* @__PURE__ */ React13.createElement(import_ui10.InputAdornment, { position: "start" }, startIcon),
|
|
581
391
|
type: "number",
|
|
582
392
|
value: Number.isNaN(state.value.size) ? "" : state.value.size,
|
|
583
393
|
onChange: handleSizeChange
|
|
@@ -585,43 +395,554 @@ var SizeControl = createControl(({ units = defaultUnits, placeholder, startIcon
|
|
|
585
395
|
));
|
|
586
396
|
});
|
|
587
397
|
|
|
588
|
-
// src/controls/controls-
|
|
589
|
-
var
|
|
590
|
-
|
|
591
|
-
text: { component: TextControl, layout: "two-columns" },
|
|
592
|
-
textarea: { component: TextAreaControl, layout: "full" },
|
|
593
|
-
size: { component: SizeControl, layout: "two-columns" },
|
|
594
|
-
select: { component: SelectControl, layout: "two-columns" }
|
|
595
|
-
};
|
|
596
|
-
var getControlByType = (type) => controlTypes[type]?.component;
|
|
597
|
-
var getLayoutByType = (type) => controlTypes[type].layout;
|
|
598
|
-
|
|
599
|
-
// src/controls/control.tsx
|
|
600
|
-
var ControlTypeError = (0, import_utils.createError)({
|
|
601
|
-
code: "CONTROL_TYPE_NOT_FOUND",
|
|
602
|
-
message: `Control type not found.`
|
|
603
|
-
});
|
|
604
|
-
var Control = ({ props, type }) => {
|
|
605
|
-
const ControlByType = getControlByType(type);
|
|
606
|
-
if (!ControlByType) {
|
|
607
|
-
throw new ControlTypeError({
|
|
608
|
-
context: { type }
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
return /* @__PURE__ */ React15.createElement(ControlByType, { ...props });
|
|
612
|
-
};
|
|
613
|
-
|
|
614
|
-
// src/controls/components/control-type-container.tsx
|
|
615
|
-
var React16 = __toESM(require("react"));
|
|
398
|
+
// src/controls/controls/stroke-control.tsx
|
|
399
|
+
var React15 = __toESM(require("react"));
|
|
400
|
+
var import_i18n3 = require("@wordpress/i18n");
|
|
616
401
|
var import_ui12 = require("@elementor/ui");
|
|
617
|
-
|
|
402
|
+
|
|
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
|
+
);
|
|
418
|
+
|
|
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
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
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
|
+
});
|
|
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");
|
|
491
|
+
|
|
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
|
|
561
|
+
}) => {
|
|
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,
|
|
605
|
+
{
|
|
606
|
+
disablePortal: true,
|
|
607
|
+
slotProps: {
|
|
608
|
+
paper: { ref: setAnchorEl, sx: { width: tagRef.current?.getBoundingClientRect().width } }
|
|
609
|
+
},
|
|
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
|
+
}
|
|
639
|
+
}
|
|
640
|
+
);
|
|
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
|
+
};
|
|
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};`}
|
|
773
|
+
`;
|
|
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
|
+
|
|
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,
|
|
819
|
+
{
|
|
820
|
+
size: "tiny",
|
|
821
|
+
type: "number",
|
|
822
|
+
value: isEmptyOrNaN(value) ? "" : value,
|
|
823
|
+
onChange: handleChange,
|
|
824
|
+
placeholder
|
|
825
|
+
}
|
|
826
|
+
));
|
|
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
|
+
}
|
|
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;
|
|
875
|
+
}
|
|
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)({
|
|
885
|
+
id: element.id,
|
|
886
|
+
props: {
|
|
887
|
+
[bind]: newValue
|
|
888
|
+
}
|
|
889
|
+
});
|
|
890
|
+
};
|
|
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
|
+
};
|
|
904
|
+
|
|
905
|
+
// src/controls-registry/control.tsx
|
|
906
|
+
var React24 = __toESM(require("react"));
|
|
907
|
+
var import_utils = require("@elementor/utils");
|
|
908
|
+
|
|
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;
|
|
919
|
+
|
|
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 }
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
return /* @__PURE__ */ React24.createElement(ControlByType, { ...props });
|
|
933
|
+
};
|
|
934
|
+
|
|
935
|
+
// src/controls-registry/control-type-container.tsx
|
|
936
|
+
var React25 = __toESM(require("react"));
|
|
937
|
+
var import_ui18 = require("@elementor/ui");
|
|
938
|
+
var ControlTypeContainer = ({
|
|
618
939
|
controlType,
|
|
619
940
|
children
|
|
620
941
|
}) => {
|
|
621
942
|
const layout = getLayoutByType(controlType);
|
|
622
|
-
return /* @__PURE__ */
|
|
943
|
+
return /* @__PURE__ */ React25.createElement(StyledContainer, { layout }, children);
|
|
623
944
|
};
|
|
624
|
-
var StyledContainer = (0,
|
|
945
|
+
var StyledContainer = (0, import_ui18.styled)(import_ui18.Box, {
|
|
625
946
|
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
626
947
|
})(({ layout, theme }) => ({
|
|
627
948
|
display: "grid",
|
|
@@ -638,15 +959,15 @@ var getGridLayout = (layout) => ({
|
|
|
638
959
|
|
|
639
960
|
// src/components/settings-tab.tsx
|
|
640
961
|
var SettingsTab = () => {
|
|
641
|
-
const { elementType } =
|
|
642
|
-
return /* @__PURE__ */
|
|
962
|
+
const { elementType } = useElement();
|
|
963
|
+
return /* @__PURE__ */ React26.createElement(import_ui19.Stack, null, elementType.controls.map(({ type, value }, index) => {
|
|
643
964
|
if (type === "control") {
|
|
644
|
-
return /* @__PURE__ */
|
|
965
|
+
return /* @__PURE__ */ React26.createElement(Control4, { key: value.bind, control: value });
|
|
645
966
|
}
|
|
646
967
|
if (type === "section") {
|
|
647
|
-
return /* @__PURE__ */
|
|
968
|
+
return /* @__PURE__ */ React26.createElement(AccordionSection, { key: type + "." + index, title: value.label, defaultExpanded: true }, value.items?.map((item) => {
|
|
648
969
|
if (item.type === "control") {
|
|
649
|
-
return /* @__PURE__ */
|
|
970
|
+
return /* @__PURE__ */ React26.createElement(Control4, { key: item.value.bind, control: item.value });
|
|
650
971
|
}
|
|
651
972
|
return null;
|
|
652
973
|
}));
|
|
@@ -654,169 +975,154 @@ var SettingsTab = () => {
|
|
|
654
975
|
return null;
|
|
655
976
|
}));
|
|
656
977
|
};
|
|
657
|
-
var
|
|
978
|
+
var Control4 = ({ control }) => {
|
|
658
979
|
if (!getControlByType(control.type)) {
|
|
659
980
|
return null;
|
|
660
981
|
}
|
|
661
|
-
return /* @__PURE__ */
|
|
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 })));
|
|
662
983
|
};
|
|
663
984
|
|
|
664
985
|
// src/components/style-tab.tsx
|
|
665
|
-
var
|
|
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");
|
|
666
992
|
|
|
667
993
|
// src/contexts/style-context.tsx
|
|
668
|
-
var
|
|
669
|
-
var
|
|
670
|
-
var
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
const breakpoint = (0, import_editor_responsive.useActiveBreakpoint)();
|
|
674
|
-
const selectedMeta = { breakpoint, state: null };
|
|
675
|
-
return /* @__PURE__ */ React18.createElement(Context2.Provider, { value: { selectedStyleDef, selectedMeta, selectedClassesProp } }, children);
|
|
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);
|
|
676
999
|
}
|
|
677
|
-
function
|
|
678
|
-
const context = (0,
|
|
1000
|
+
function useStyle() {
|
|
1001
|
+
const context = (0, import_react9.useContext)(Context3);
|
|
679
1002
|
if (!context) {
|
|
680
1003
|
throw new Error("UseStyleContext must be used within a StyleContextProvider");
|
|
681
1004
|
}
|
|
682
1005
|
return context;
|
|
683
1006
|
}
|
|
684
1007
|
|
|
685
|
-
// src/
|
|
686
|
-
var
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
var getElementStyles = (elementID) => {
|
|
690
|
-
const container = getContainer(elementID);
|
|
691
|
-
return container?.model.get("styles") || null;
|
|
692
|
-
};
|
|
693
|
-
|
|
694
|
-
// src/hooks/use-element-styles.ts
|
|
695
|
-
var useElementStyles = (elementID) => {
|
|
696
|
-
return (0, import_editor_v1_adapters5.__privateUseListenTo)(
|
|
697
|
-
(0, import_editor_v1_adapters5.commandEndEvent)("document/atomic-widgets/styles"),
|
|
698
|
-
() => {
|
|
699
|
-
return getElementStyles(elementID);
|
|
700
|
-
},
|
|
701
|
-
[elementID]
|
|
702
|
-
);
|
|
703
|
-
};
|
|
1008
|
+
// src/components/style-sections/size-section/size-section.tsx
|
|
1009
|
+
var React31 = __toESM(require("react"));
|
|
1010
|
+
var import_ui21 = require("@elementor/ui");
|
|
1011
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
704
1012
|
|
|
705
|
-
// src/components/style-
|
|
706
|
-
var
|
|
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");
|
|
707
1018
|
|
|
708
|
-
// src/
|
|
709
|
-
var
|
|
1019
|
+
// src/controls-registry/styles-field.tsx
|
|
1020
|
+
var React29 = __toESM(require("react"));
|
|
710
1021
|
|
|
711
|
-
// src/
|
|
712
|
-
var
|
|
1022
|
+
// src/hooks/use-styles-field.ts
|
|
1023
|
+
var import_editor_elements2 = require("@elementor/editor-elements");
|
|
713
1024
|
|
|
714
|
-
// src/
|
|
715
|
-
var
|
|
716
|
-
var
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
(
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
}
|
|
728
|
-
const styleDef = getElementStyles(elementID)?.[styleDefID];
|
|
729
|
-
if (!styleDef) {
|
|
730
|
-
return null;
|
|
731
|
-
}
|
|
732
|
-
const variant = getVariantByMeta(styleDef, meta);
|
|
733
|
-
return variant?.props[propName] ?? null;
|
|
734
|
-
},
|
|
735
|
-
[elementID, styleDefID, propName, meta]
|
|
736
|
-
);
|
|
737
|
-
};
|
|
738
|
-
function getVariantByMeta(styleDef, meta) {
|
|
739
|
-
return styleDef.variants.find((variant) => {
|
|
740
|
-
return variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state;
|
|
741
|
-
});
|
|
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;
|
|
742
1038
|
}
|
|
743
1039
|
|
|
744
|
-
// src/
|
|
745
|
-
var
|
|
746
|
-
|
|
747
|
-
const
|
|
748
|
-
(
|
|
749
|
-
|
|
750
|
-
styleDefID,
|
|
751
|
-
bind,
|
|
752
|
-
meta,
|
|
753
|
-
props
|
|
754
|
-
});
|
|
755
|
-
};
|
|
756
|
-
|
|
757
|
-
// src/controls/hooks/use-style-control.ts
|
|
758
|
-
var useStyleControl = (propName) => {
|
|
759
|
-
const { element } = useElementContext();
|
|
760
|
-
const { selectedStyleDef, selectedMeta, selectedClassesProp } = useStyleContext();
|
|
761
|
-
const value = useElementStyleProp({
|
|
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)({
|
|
762
1046
|
elementID: element.id,
|
|
763
|
-
styleDefID:
|
|
764
|
-
meta
|
|
1047
|
+
styleDefID: id,
|
|
1048
|
+
meta,
|
|
765
1049
|
propName
|
|
766
1050
|
});
|
|
767
1051
|
const setValue = (newValue) => {
|
|
768
|
-
updateStyle({
|
|
1052
|
+
(0, import_editor_elements2.updateStyle)({
|
|
769
1053
|
elementID: element.id,
|
|
770
|
-
styleDefID:
|
|
1054
|
+
styleDefID: id,
|
|
771
1055
|
props: { [propName]: newValue },
|
|
772
|
-
meta
|
|
773
|
-
bind:
|
|
1056
|
+
meta,
|
|
1057
|
+
bind: classesProp
|
|
774
1058
|
});
|
|
775
1059
|
};
|
|
776
1060
|
return [value, setValue];
|
|
777
1061
|
};
|
|
778
1062
|
|
|
779
|
-
// src/controls/
|
|
780
|
-
var
|
|
781
|
-
const [value, setValue] =
|
|
782
|
-
return /* @__PURE__ */
|
|
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);
|
|
783
1067
|
};
|
|
784
|
-
StyleControl.Label = ControlLabel;
|
|
785
1068
|
|
|
786
|
-
// src/components/style-sections/size-section.tsx
|
|
787
|
-
var
|
|
788
|
-
|
|
1069
|
+
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1070
|
+
var options = [
|
|
1071
|
+
{
|
|
1072
|
+
value: "visible",
|
|
1073
|
+
label: (0, import_i18n6.__)("Visible", "elementor"),
|
|
1074
|
+
icon: import_icons3.EyeIcon,
|
|
1075
|
+
showTooltip: true
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
value: "hidden",
|
|
1079
|
+
label: (0, import_i18n6.__)("Hidden", "elementor"),
|
|
1080
|
+
icon: import_icons3.EyeOffIcon,
|
|
1081
|
+
showTooltip: true
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
value: "auto",
|
|
1085
|
+
label: (0, import_i18n6.__)("Auto", "elementor"),
|
|
1086
|
+
icon: import_icons3.ExpandBottomIcon,
|
|
1087
|
+
showTooltip: true
|
|
1088
|
+
}
|
|
1089
|
+
];
|
|
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 }))));
|
|
1092
|
+
};
|
|
1093
|
+
|
|
1094
|
+
// src/components/style-sections/size-section/size-section.tsx
|
|
789
1095
|
var SizeSection = () => {
|
|
790
|
-
return /* @__PURE__ */
|
|
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))));
|
|
791
1097
|
};
|
|
792
|
-
var
|
|
793
|
-
return /* @__PURE__ */
|
|
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)))));
|
|
794
1100
|
};
|
|
795
1101
|
|
|
796
1102
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
797
|
-
var
|
|
798
|
-
var
|
|
1103
|
+
var React44 = __toESM(require("react"));
|
|
1104
|
+
var import_ui33 = require("@elementor/ui");
|
|
799
1105
|
|
|
800
|
-
// src/components/style-sections/typography-section/text-style-
|
|
801
|
-
var
|
|
802
|
-
var
|
|
803
|
-
var
|
|
804
|
-
var
|
|
1106
|
+
// src/components/style-sections/typography-section/text-style-field.tsx
|
|
1107
|
+
var React32 = __toESM(require("react"));
|
|
1108
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
1109
|
+
var import_ui22 = require("@elementor/ui");
|
|
1110
|
+
var import_icons4 = require("@elementor/icons");
|
|
805
1111
|
var buttonSize = "tiny";
|
|
806
|
-
var
|
|
807
|
-
const [fontStyle, setFontStyle] =
|
|
808
|
-
const [textDecoration, setTextDecoration] =
|
|
1112
|
+
var TextStyleField = () => {
|
|
1113
|
+
const [fontStyle, setFontStyle] = useStylesField("font-style");
|
|
1114
|
+
const [textDecoration, setTextDecoration] = useStylesField("text-decoration");
|
|
809
1115
|
const formats = [fontStyle, ...(textDecoration || "").split(" ")];
|
|
810
|
-
return /* @__PURE__ */
|
|
811
|
-
|
|
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,
|
|
812
1118
|
{
|
|
813
1119
|
value: "italic",
|
|
814
1120
|
onChange: (v) => setFontStyle(fontStyle === v ? null : v),
|
|
815
1121
|
"aria-label": "italic",
|
|
816
1122
|
sx: { marginLeft: "auto" }
|
|
817
1123
|
},
|
|
818
|
-
/* @__PURE__ */
|
|
819
|
-
), /* @__PURE__ */
|
|
1124
|
+
/* @__PURE__ */ React32.createElement(import_icons4.ItalicIcon, { fontSize: buttonSize })
|
|
1125
|
+
), /* @__PURE__ */ React32.createElement(
|
|
820
1126
|
ShorthandControl,
|
|
821
1127
|
{
|
|
822
1128
|
value: "line-through",
|
|
@@ -824,8 +1130,8 @@ var TextStyleControl = () => {
|
|
|
824
1130
|
updateValues: setTextDecoration,
|
|
825
1131
|
"aria-label": "line-through"
|
|
826
1132
|
},
|
|
827
|
-
/* @__PURE__ */
|
|
828
|
-
), /* @__PURE__ */
|
|
1133
|
+
/* @__PURE__ */ React32.createElement(import_icons4.StrikethroughIcon, { fontSize: buttonSize })
|
|
1134
|
+
), /* @__PURE__ */ React32.createElement(
|
|
829
1135
|
ShorthandControl,
|
|
830
1136
|
{
|
|
831
1137
|
value: "underline",
|
|
@@ -833,7 +1139,7 @@ var TextStyleControl = () => {
|
|
|
833
1139
|
updateValues: setTextDecoration,
|
|
834
1140
|
"aria-label": "underline"
|
|
835
1141
|
},
|
|
836
|
-
/* @__PURE__ */
|
|
1142
|
+
/* @__PURE__ */ React32.createElement(import_icons4.UnderlineIcon, { fontSize: buttonSize })
|
|
837
1143
|
))));
|
|
838
1144
|
};
|
|
839
1145
|
var ShorthandControl = ({
|
|
@@ -852,108 +1158,90 @@ var ShorthandControl = ({
|
|
|
852
1158
|
updateValues([...valuesArr, newValue].join(" "));
|
|
853
1159
|
}
|
|
854
1160
|
};
|
|
855
|
-
return /* @__PURE__ */
|
|
1161
|
+
return /* @__PURE__ */ React32.createElement(ToggleButton2, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
856
1162
|
};
|
|
857
|
-
var
|
|
1163
|
+
var ToggleButton2 = ({ onChange, ...props }) => {
|
|
858
1164
|
const handleChange = (_e, newValue) => {
|
|
859
1165
|
onChange(newValue);
|
|
860
1166
|
};
|
|
861
|
-
return /* @__PURE__ */
|
|
1167
|
+
return /* @__PURE__ */ React32.createElement(import_ui22.ToggleButton, { ...props, onChange: handleChange, size: buttonSize });
|
|
862
1168
|
};
|
|
863
1169
|
|
|
864
1170
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
865
|
-
var
|
|
866
|
-
|
|
867
|
-
// src/components/style-sections/typography-section/font-size-control.tsx
|
|
868
|
-
var React22 = __toESM(require("react"));
|
|
869
|
-
var import_i18n5 = require("@wordpress/i18n");
|
|
870
|
-
var import_ui16 = require("@elementor/ui");
|
|
871
|
-
var FontSizeControl = () => {
|
|
872
|
-
return /* @__PURE__ */ React22.createElement(StyleControl, { bind: "font-size" }, /* @__PURE__ */ React22.createElement(import_ui16.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React22.createElement(import_ui16.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React22.createElement(StyleControl.Label, null, (0, import_i18n5.__)("Font Size", "elementor"))), /* @__PURE__ */ React22.createElement(import_ui16.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React22.createElement(SizeControl, null))));
|
|
873
|
-
};
|
|
1171
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
874
1172
|
|
|
875
|
-
// src/components/style-sections/typography-section/font-
|
|
876
|
-
var
|
|
877
|
-
var
|
|
878
|
-
var
|
|
879
|
-
var
|
|
880
|
-
{
|
|
881
|
-
{ label: (0, import_i18n6.__)("Regular - 500", "elementor"), value: "500" },
|
|
882
|
-
{ label: (0, import_i18n6.__)("Semi Bold - 600", "elementor"), value: "600" },
|
|
883
|
-
{ label: (0, import_i18n6.__)("Bold - 700", "elementor"), value: "700" },
|
|
884
|
-
{ label: (0, import_i18n6.__)("Black - 900", "elementor"), value: "900" }
|
|
885
|
-
];
|
|
886
|
-
var FontWeightControl = () => {
|
|
887
|
-
return /* @__PURE__ */ React23.createElement(StyleControl, { bind: "font-weight" }, /* @__PURE__ */ React23.createElement(import_ui17.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(import_ui17.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React23.createElement(StyleControl.Label, null, (0, import_i18n6.__)("Font Weight", "elementor"))), /* @__PURE__ */ React23.createElement(import_ui17.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React23.createElement(SelectControl, { options: fontWeightOptions }))));
|
|
1173
|
+
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1174
|
+
var React33 = __toESM(require("react"));
|
|
1175
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
1176
|
+
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))));
|
|
888
1179
|
};
|
|
889
1180
|
|
|
890
|
-
// src/components/style-sections/typography-section/
|
|
891
|
-
var
|
|
892
|
-
var
|
|
893
|
-
var
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
(
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
value: selectedColor
|
|
905
|
-
});
|
|
906
|
-
};
|
|
907
|
-
return /* @__PURE__ */ React24.createElement(ControlActions, null, /* @__PURE__ */ React24.createElement(import_ui18.UnstableColorPicker, { size: "tiny", ...props, value: value?.value, onChange: handleChange }));
|
|
908
|
-
}
|
|
909
|
-
);
|
|
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 }))));
|
|
1194
|
+
};
|
|
910
1195
|
|
|
911
|
-
// src/components/style-sections/typography-section/text-color-
|
|
912
|
-
var
|
|
913
|
-
|
|
1196
|
+
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
1197
|
+
var React35 = __toESM(require("react"));
|
|
1198
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
1199
|
+
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))));
|
|
914
1202
|
};
|
|
915
1203
|
|
|
916
|
-
// src/components/style-sections/typography-section/letter-spacing-
|
|
917
|
-
var
|
|
918
|
-
var
|
|
919
|
-
var
|
|
920
|
-
var
|
|
921
|
-
return /* @__PURE__ */
|
|
1204
|
+
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
1205
|
+
var React36 = __toESM(require("react"));
|
|
1206
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
1207
|
+
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))));
|
|
922
1210
|
};
|
|
923
1211
|
|
|
924
|
-
// src/components/style-sections/typography-section/word-spacing-
|
|
925
|
-
var
|
|
926
|
-
var
|
|
927
|
-
var
|
|
928
|
-
var
|
|
929
|
-
return /* @__PURE__ */
|
|
1212
|
+
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
1213
|
+
var React37 = __toESM(require("react"));
|
|
1214
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
1215
|
+
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))));
|
|
930
1218
|
};
|
|
931
1219
|
|
|
932
1220
|
// src/components/collapsible-content.tsx
|
|
933
|
-
var
|
|
934
|
-
var
|
|
935
|
-
var
|
|
936
|
-
var
|
|
937
|
-
var
|
|
1221
|
+
var React38 = __toESM(require("react"));
|
|
1222
|
+
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");
|
|
938
1226
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
939
|
-
const [open, setOpen] = (0,
|
|
1227
|
+
const [open, setOpen] = (0, import_react11.useState)(defaultOpen);
|
|
940
1228
|
const handleToggle = () => {
|
|
941
1229
|
setOpen((prevOpen) => !prevOpen);
|
|
942
1230
|
};
|
|
943
|
-
return /* @__PURE__ */
|
|
944
|
-
|
|
1231
|
+
return /* @__PURE__ */ React38.createElement(import_ui28.Stack, { sx: { py: 0.5 } }, /* @__PURE__ */ React38.createElement(
|
|
1232
|
+
import_ui28.Button,
|
|
945
1233
|
{
|
|
946
1234
|
fullWidth: true,
|
|
947
1235
|
size: "small",
|
|
948
1236
|
color: "secondary",
|
|
949
1237
|
variant: "outlined",
|
|
950
1238
|
onClick: handleToggle,
|
|
951
|
-
endIcon: /* @__PURE__ */
|
|
1239
|
+
endIcon: /* @__PURE__ */ React38.createElement(ChevronIcon, { open })
|
|
952
1240
|
},
|
|
953
|
-
open ? (0,
|
|
954
|
-
), /* @__PURE__ */
|
|
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));
|
|
955
1243
|
};
|
|
956
|
-
var ChevronIcon = (0,
|
|
1244
|
+
var ChevronIcon = (0, import_ui28.styled)(import_icons5.ChevronDownIcon, {
|
|
957
1245
|
shouldForwardProp: (prop) => prop !== "open"
|
|
958
1246
|
})(({ theme, open }) => ({
|
|
959
1247
|
transform: open ? "rotate(180deg)" : "rotate(0)",
|
|
@@ -962,171 +1250,172 @@ var ChevronIcon = (0, import_ui22.styled)(import_icons4.ChevronDownIcon, {
|
|
|
962
1250
|
})
|
|
963
1251
|
}));
|
|
964
1252
|
|
|
965
|
-
// src/components/style-sections/typography-section/transform-
|
|
966
|
-
var
|
|
967
|
-
var
|
|
968
|
-
var
|
|
969
|
-
var import_icons5 = require("@elementor/icons");
|
|
970
|
-
|
|
971
|
-
// src/controls/control-types/toggle-control.tsx
|
|
972
|
-
var React30 = __toESM(require("react"));
|
|
973
|
-
|
|
974
|
-
// src/controls/components/control-toggle-button-group.tsx
|
|
975
|
-
var React29 = __toESM(require("react"));
|
|
976
|
-
var import_ui23 = require("@elementor/ui");
|
|
977
|
-
var StyledToggleButtonGroup = (0, import_ui23.styled)(import_ui23.ToggleButtonGroup)`
|
|
978
|
-
${({ justify }) => `justify-content: ${justify};`}
|
|
979
|
-
`;
|
|
980
|
-
var ControlToggleButtonGroup = ({
|
|
981
|
-
justify = "end",
|
|
982
|
-
size = "tiny",
|
|
983
|
-
value,
|
|
984
|
-
onChange,
|
|
985
|
-
items,
|
|
986
|
-
exclusive = false
|
|
987
|
-
}) => {
|
|
988
|
-
const handleChange = (_, newValue) => {
|
|
989
|
-
onChange(newValue);
|
|
990
|
-
};
|
|
991
|
-
return /* @__PURE__ */ React29.createElement(StyledToggleButtonGroup, { justify, value, onChange: handleChange, exclusive }, items.map(({ label, value: buttonValue, icon: Icon }) => /* @__PURE__ */ React29.createElement(import_ui23.ToggleButton, { key: buttonValue, value: buttonValue, "aria-label": label, size }, /* @__PURE__ */ React29.createElement(Icon, { fontSize: size }))));
|
|
992
|
-
};
|
|
993
|
-
|
|
994
|
-
// src/controls/control-types/toggle-control.tsx
|
|
995
|
-
var ToggleControl = createControl(({ options: options4 }) => {
|
|
996
|
-
const { value, setValue } = useControl();
|
|
997
|
-
const handleToggle = (option) => {
|
|
998
|
-
setValue(option || void 0);
|
|
999
|
-
};
|
|
1000
|
-
return /* @__PURE__ */ React30.createElement(
|
|
1001
|
-
ControlToggleButtonGroup,
|
|
1002
|
-
{
|
|
1003
|
-
items: options4,
|
|
1004
|
-
value: value || null,
|
|
1005
|
-
onChange: handleToggle,
|
|
1006
|
-
exclusive: true
|
|
1007
|
-
}
|
|
1008
|
-
);
|
|
1009
|
-
});
|
|
1010
|
-
|
|
1011
|
-
// src/components/style-sections/typography-section/transform-control.tsx
|
|
1012
|
-
var options = [
|
|
1013
|
-
{ value: "capitalize", label: (0, import_i18n11.__)("Capitalize", "elementor"), icon: import_icons5.LetterCaseIcon },
|
|
1014
|
-
{ value: "uppercase", label: (0, import_i18n11.__)("Uppercase", "elementor"), icon: import_icons5.LetterCaseUpperIcon },
|
|
1015
|
-
{ value: "lowercase", label: (0, import_i18n11.__)("Lowercase", "elementor"), icon: import_icons5.LetterCaseLowerIcon }
|
|
1016
|
-
];
|
|
1017
|
-
var TransformControl = () => /* @__PURE__ */ React31.createElement(StyleControl, { bind: "text-transform" }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(StyleControl.Label, null, (0, import_i18n11.__)("Transform", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ToggleControl, { options }))));
|
|
1018
|
-
|
|
1019
|
-
// src/components/style-sections/typography-section/text-alignment-control.tsx
|
|
1020
|
-
var React32 = __toESM(require("react"));
|
|
1021
|
-
var import_i18n12 = require("@wordpress/i18n");
|
|
1022
|
-
var import_ui25 = require("@elementor/ui");
|
|
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");
|
|
1023
1257
|
var import_icons6 = require("@elementor/icons");
|
|
1024
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 }
|
|
1262
|
+
];
|
|
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 }))));
|
|
1264
|
+
|
|
1265
|
+
// 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 = [
|
|
1025
1271
|
{
|
|
1026
1272
|
value: "left",
|
|
1027
|
-
label: (0,
|
|
1028
|
-
icon:
|
|
1273
|
+
label: (0, import_i18n16.__)("Left", "elementor"),
|
|
1274
|
+
icon: import_icons7.AlignLeftIcon
|
|
1029
1275
|
},
|
|
1030
1276
|
{
|
|
1031
1277
|
value: "center",
|
|
1032
|
-
label: (0,
|
|
1033
|
-
icon:
|
|
1278
|
+
label: (0, import_i18n16.__)("Center", "elementor"),
|
|
1279
|
+
icon: import_icons7.AlignCenterIcon
|
|
1034
1280
|
},
|
|
1035
1281
|
{
|
|
1036
1282
|
value: "right",
|
|
1037
|
-
label: (0,
|
|
1038
|
-
icon:
|
|
1283
|
+
label: (0, import_i18n16.__)("Right", "elementor"),
|
|
1284
|
+
icon: import_icons7.AlignRightIcon
|
|
1039
1285
|
},
|
|
1040
1286
|
{
|
|
1041
1287
|
value: "justify",
|
|
1042
|
-
label: (0,
|
|
1043
|
-
icon:
|
|
1288
|
+
label: (0, import_i18n16.__)("Justify", "elementor"),
|
|
1289
|
+
icon: import_icons7.AlignJustifiedIcon
|
|
1044
1290
|
}
|
|
1045
1291
|
];
|
|
1046
|
-
var
|
|
1047
|
-
return /* @__PURE__ */
|
|
1292
|
+
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 }))));
|
|
1048
1294
|
};
|
|
1049
1295
|
|
|
1050
|
-
// src/components/style-sections/typography-section/text-direction-
|
|
1051
|
-
var
|
|
1052
|
-
var
|
|
1053
|
-
var
|
|
1054
|
-
var
|
|
1055
|
-
var
|
|
1296
|
+
// 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 = [
|
|
1056
1302
|
{
|
|
1057
1303
|
value: "ltr",
|
|
1058
|
-
label: (0,
|
|
1059
|
-
icon:
|
|
1304
|
+
label: (0, import_i18n17.__)("Left to Right", "elementor"),
|
|
1305
|
+
icon: import_icons8.TextDirectionLtrIcon
|
|
1060
1306
|
},
|
|
1061
1307
|
{
|
|
1062
1308
|
value: "rtl",
|
|
1063
|
-
label: (0,
|
|
1064
|
-
icon:
|
|
1309
|
+
label: (0, import_i18n17.__)("Right to Left", "elementor"),
|
|
1310
|
+
icon: import_icons8.TextDirectionRtlIcon
|
|
1065
1311
|
}
|
|
1066
1312
|
];
|
|
1067
|
-
var
|
|
1068
|
-
return /* @__PURE__ */
|
|
1313
|
+
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 }))));
|
|
1315
|
+
};
|
|
1316
|
+
|
|
1317
|
+
// 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")
|
|
1338
|
+
},
|
|
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));
|
|
1341
|
+
};
|
|
1342
|
+
|
|
1343
|
+
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
1344
|
+
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)));
|
|
1069
1346
|
};
|
|
1070
1347
|
|
|
1071
1348
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1072
1349
|
var TypographySection = () => {
|
|
1073
|
-
return /* @__PURE__ */
|
|
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)))));
|
|
1074
1351
|
};
|
|
1075
1352
|
|
|
1076
1353
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1077
|
-
var
|
|
1078
|
-
var
|
|
1354
|
+
var React48 = __toESM(require("react"));
|
|
1355
|
+
var import_ui37 = require("@elementor/ui");
|
|
1079
1356
|
|
|
1080
|
-
// src/components/style-sections/position-section/z-index-
|
|
1081
|
-
var
|
|
1082
|
-
var
|
|
1083
|
-
var
|
|
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
|
+
};
|
|
1084
1364
|
|
|
1085
|
-
// src/
|
|
1086
|
-
var
|
|
1087
|
-
var
|
|
1088
|
-
var
|
|
1089
|
-
var
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
onChange: handleChange,
|
|
1102
|
-
placeholder
|
|
1103
|
-
}
|
|
1104
|
-
));
|
|
1105
|
-
});
|
|
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");
|
|
1106
1381
|
|
|
1107
|
-
// src/components/style-sections/position-section/
|
|
1108
|
-
var
|
|
1109
|
-
|
|
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] }))));
|
|
1110
1398
|
};
|
|
1111
1399
|
|
|
1112
1400
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1113
|
-
var import_i18n16 = require("@wordpress/i18n");
|
|
1114
1401
|
var PositionSection = () => {
|
|
1115
|
-
|
|
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));
|
|
1116
1405
|
};
|
|
1117
1406
|
|
|
1118
1407
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1119
|
-
var
|
|
1120
|
-
var
|
|
1121
|
-
var
|
|
1408
|
+
var React50 = __toESM(require("react"));
|
|
1409
|
+
var import_ui39 = require("@elementor/ui");
|
|
1410
|
+
var import_i18n26 = require("@wordpress/i18n");
|
|
1122
1411
|
|
|
1123
|
-
// src/
|
|
1124
|
-
var
|
|
1125
|
-
var
|
|
1126
|
-
var
|
|
1127
|
-
var
|
|
1128
|
-
var LinkedDimensionsControl = ({ label }) => {
|
|
1129
|
-
const { value, setValue } =
|
|
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();
|
|
1130
1419
|
const { top, right, bottom, left, isLinked = true } = value?.value || {};
|
|
1131
1420
|
const setLinkedValue = (position, newValue) => {
|
|
1132
1421
|
const updatedValue = {
|
|
@@ -1155,385 +1444,388 @@ var LinkedDimensionsControl = ({ label }) => {
|
|
|
1155
1444
|
value: updatedValue
|
|
1156
1445
|
});
|
|
1157
1446
|
};
|
|
1158
|
-
const LinkedIcon = isLinked ?
|
|
1159
|
-
return /* @__PURE__ */
|
|
1160
|
-
|
|
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,
|
|
1161
1450
|
{
|
|
1162
|
-
"aria-label": (0,
|
|
1451
|
+
"aria-label": (0, import_i18n25.__)("Link Inputs", "elementor"),
|
|
1163
1452
|
size: "tiny",
|
|
1164
1453
|
value: "check",
|
|
1165
1454
|
selected: isLinked,
|
|
1166
1455
|
sx: { marginLeft: "auto" },
|
|
1167
1456
|
onChange: toggleLinked
|
|
1168
1457
|
},
|
|
1169
|
-
/* @__PURE__ */
|
|
1170
|
-
)), /* @__PURE__ */
|
|
1171
|
-
|
|
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,
|
|
1172
1461
|
{
|
|
1173
1462
|
bind: "top",
|
|
1174
1463
|
value: top,
|
|
1175
1464
|
setValue: setLinkedValue,
|
|
1176
|
-
startIcon: /* @__PURE__ */
|
|
1465
|
+
startIcon: /* @__PURE__ */ React49.createElement(import_icons11.SideTopIcon, { fontSize: "tiny" })
|
|
1177
1466
|
}
|
|
1178
|
-
))), /* @__PURE__ */
|
|
1179
|
-
|
|
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,
|
|
1180
1469
|
{
|
|
1181
1470
|
bind: "right",
|
|
1182
1471
|
value: right,
|
|
1183
1472
|
setValue: setLinkedValue,
|
|
1184
|
-
startIcon: /* @__PURE__ */
|
|
1473
|
+
startIcon: /* @__PURE__ */ React49.createElement(import_icons11.SideRightIcon, { fontSize: "tiny" })
|
|
1185
1474
|
}
|
|
1186
|
-
)))), /* @__PURE__ */
|
|
1187
|
-
|
|
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,
|
|
1188
1477
|
{
|
|
1189
1478
|
bind: "bottom",
|
|
1190
1479
|
value: bottom,
|
|
1191
1480
|
setValue: setLinkedValue,
|
|
1192
|
-
startIcon: /* @__PURE__ */
|
|
1481
|
+
startIcon: /* @__PURE__ */ React49.createElement(import_icons11.SideBottomIcon, { fontSize: "tiny" })
|
|
1193
1482
|
}
|
|
1194
|
-
))), /* @__PURE__ */
|
|
1195
|
-
|
|
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,
|
|
1196
1485
|
{
|
|
1197
1486
|
bind: "left",
|
|
1198
1487
|
value: left,
|
|
1199
1488
|
setValue: setLinkedValue,
|
|
1200
|
-
startIcon: /* @__PURE__ */
|
|
1489
|
+
startIcon: /* @__PURE__ */ React49.createElement(import_icons11.SideLeftIcon, { fontSize: "tiny" })
|
|
1201
1490
|
}
|
|
1202
1491
|
)))));
|
|
1203
|
-
};
|
|
1204
|
-
var
|
|
1492
|
+
});
|
|
1493
|
+
var Control5 = ({
|
|
1205
1494
|
bind,
|
|
1206
1495
|
startIcon,
|
|
1207
1496
|
value,
|
|
1208
1497
|
setValue
|
|
1209
|
-
}) => /* @__PURE__ */
|
|
1210
|
-
ControlContext.Provider,
|
|
1211
|
-
{
|
|
1212
|
-
value: {
|
|
1213
|
-
bind,
|
|
1214
|
-
setValue: (newValue) => setValue(bind, newValue),
|
|
1215
|
-
value
|
|
1216
|
-
}
|
|
1217
|
-
},
|
|
1218
|
-
/* @__PURE__ */ React38.createElement(SizeControl, { startIcon })
|
|
1219
|
-
);
|
|
1498
|
+
}) => /* @__PURE__ */ React49.createElement(BoundPropProvider, { setValue: (newValue) => setValue(bind, newValue), value, bind }, /* @__PURE__ */ React49.createElement(SizeControl, { startIcon }));
|
|
1220
1499
|
|
|
1221
1500
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1222
1501
|
var SpacingSection = () => {
|
|
1223
|
-
return /* @__PURE__ */
|
|
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") }))));
|
|
1224
1503
|
};
|
|
1225
1504
|
|
|
1226
1505
|
// src/components/style-sections/effects-section/effects-section.tsx
|
|
1227
|
-
var
|
|
1228
|
-
var
|
|
1229
|
-
var
|
|
1506
|
+
var React51 = __toESM(require("react"));
|
|
1507
|
+
var import_i18n27 = require("@wordpress/i18n");
|
|
1508
|
+
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
|
+
};
|
|
1230
1512
|
|
|
1231
|
-
// src/components/style-sections/
|
|
1232
|
-
var
|
|
1233
|
-
var
|
|
1234
|
-
var
|
|
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");
|
|
1235
1517
|
|
|
1236
|
-
// src/
|
|
1237
|
-
var
|
|
1238
|
-
var
|
|
1239
|
-
var
|
|
1240
|
-
var
|
|
1241
|
-
|
|
1242
|
-
var SIZE2 = "tiny";
|
|
1243
|
-
var Repeater = ({
|
|
1244
|
-
label,
|
|
1245
|
-
itemSettings,
|
|
1246
|
-
values: repeaterValues = [],
|
|
1247
|
-
setValues: setRepeaterValues
|
|
1248
|
-
}) => {
|
|
1249
|
-
const addRepeaterItem = () => {
|
|
1250
|
-
const newItem = structuredClone(itemSettings.initialValues);
|
|
1251
|
-
setRepeaterValues([...repeaterValues, newItem]);
|
|
1252
|
-
};
|
|
1253
|
-
const duplicateRepeaterItem = (index) => {
|
|
1254
|
-
setRepeaterValues([
|
|
1255
|
-
...repeaterValues.slice(0, index),
|
|
1256
|
-
structuredClone(repeaterValues[index]),
|
|
1257
|
-
...repeaterValues.slice(index)
|
|
1258
|
-
]);
|
|
1259
|
-
};
|
|
1260
|
-
const removeRepeaterItem = (index) => {
|
|
1261
|
-
setRepeaterValues(repeaterValues.filter((_, i) => i !== index));
|
|
1262
|
-
};
|
|
1263
|
-
const toggleDisableRepeaterItem = (index) => {
|
|
1264
|
-
setRepeaterValues(
|
|
1265
|
-
repeaterValues.map((value, i) => {
|
|
1266
|
-
if (i === index) {
|
|
1267
|
-
const { disabled, ...rest } = value;
|
|
1268
|
-
return { ...rest, ...disabled ? {} : { disabled: true } };
|
|
1269
|
-
}
|
|
1270
|
-
return value;
|
|
1271
|
-
})
|
|
1272
|
-
);
|
|
1273
|
-
};
|
|
1274
|
-
return /* @__PURE__ */ React40.createElement(import_ui33.Stack, null, /* @__PURE__ */ React40.createElement(import_ui33.Stack, { direction: "row", justifyContent: "space-between", sx: { py: 0.5 } }, /* @__PURE__ */ React40.createElement(import_ui33.Typography, { component: "label", variant: "caption", color: "text.secondary" }, label), /* @__PURE__ */ React40.createElement(import_ui33.IconButton, { size: SIZE2, onClick: addRepeaterItem, "aria-label": (0, import_i18n19.__)("Add item", "elementor") }, /* @__PURE__ */ React40.createElement(import_icons9.PlusIcon, { fontSize: SIZE2 }))), /* @__PURE__ */ React40.createElement(import_ui33.Stack, { gap: 1 }, repeaterValues.map((value, index) => /* @__PURE__ */ React40.createElement(
|
|
1275
|
-
RepeaterItem,
|
|
1276
|
-
{
|
|
1277
|
-
key: index,
|
|
1278
|
-
disabled: value.disabled,
|
|
1279
|
-
label: /* @__PURE__ */ React40.createElement(itemSettings.Label, { value }),
|
|
1280
|
-
startIcon: /* @__PURE__ */ React40.createElement(itemSettings.Icon, { value }),
|
|
1281
|
-
removeItem: () => removeRepeaterItem(index),
|
|
1282
|
-
duplicateItem: () => duplicateRepeaterItem(index),
|
|
1283
|
-
toggleDisableItem: () => toggleDisableRepeaterItem(index)
|
|
1284
|
-
},
|
|
1285
|
-
(props) => /* @__PURE__ */ React40.createElement(
|
|
1286
|
-
itemSettings.Content,
|
|
1287
|
-
{
|
|
1288
|
-
...props,
|
|
1289
|
-
value,
|
|
1290
|
-
setValue: (newValue) => setRepeaterValues(
|
|
1291
|
-
repeaterValues.map((item, i) => i === index ? newValue : item)
|
|
1292
|
-
)
|
|
1293
|
-
}
|
|
1294
|
-
)
|
|
1295
|
-
))));
|
|
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))));
|
|
1296
1524
|
};
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
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
|
+
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,
|
|
1313
1583
|
{
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
"aria-label": (0, import_i18n19.__)("Open item", "elementor"),
|
|
1319
|
-
...(0, import_ui33.bindTrigger)(popoverState),
|
|
1320
|
-
startIcon,
|
|
1321
|
-
actions: /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(
|
|
1322
|
-
import_ui33.IconButton,
|
|
1323
|
-
{
|
|
1324
|
-
size: SIZE2,
|
|
1325
|
-
onClick: duplicateItem,
|
|
1326
|
-
"aria-label": (0, import_i18n19.__)("Duplicate item", "elementor")
|
|
1327
|
-
},
|
|
1328
|
-
/* @__PURE__ */ React40.createElement(import_icons9.CopyIcon, { fontSize: SIZE2 })
|
|
1329
|
-
), /* @__PURE__ */ React40.createElement(
|
|
1330
|
-
import_ui33.IconButton,
|
|
1331
|
-
{
|
|
1332
|
-
size: SIZE2,
|
|
1333
|
-
onClick: toggleDisableItem,
|
|
1334
|
-
"aria-label": disabled ? (0, import_i18n19.__)("Enable item", "elementor") : (0, import_i18n19.__)("Disable item", "elementor")
|
|
1335
|
-
},
|
|
1336
|
-
disabled ? /* @__PURE__ */ React40.createElement(import_icons9.EyeOffIcon, { fontSize: SIZE2 }) : /* @__PURE__ */ React40.createElement(import_icons9.EyeIcon, { fontSize: SIZE2 })
|
|
1337
|
-
), /* @__PURE__ */ React40.createElement(
|
|
1338
|
-
import_ui33.IconButton,
|
|
1584
|
+
value: actualValue,
|
|
1585
|
+
setValue: setEqualValues,
|
|
1586
|
+
iconButton: /* @__PURE__ */ React54.createElement(
|
|
1587
|
+
import_ui43.ToggleButton,
|
|
1339
1588
|
{
|
|
1340
|
-
size:
|
|
1341
|
-
|
|
1342
|
-
|
|
1589
|
+
size: "tiny",
|
|
1590
|
+
value: "check",
|
|
1591
|
+
sx: { marginLeft: "auto" },
|
|
1592
|
+
...(0, import_ui43.bindToggle)(popupState),
|
|
1593
|
+
selected: popupState.isOpen
|
|
1343
1594
|
},
|
|
1344
|
-
|
|
1345
|
-
)
|
|
1595
|
+
icon
|
|
1596
|
+
)
|
|
1346
1597
|
}
|
|
1347
|
-
), /* @__PURE__ */
|
|
1348
|
-
|
|
1598
|
+
))), /* @__PURE__ */ React54.createElement(
|
|
1599
|
+
import_ui43.Popover,
|
|
1349
1600
|
{
|
|
1350
1601
|
disablePortal: true,
|
|
1351
|
-
|
|
1352
|
-
|
|
1602
|
+
disableScrollLock: true,
|
|
1603
|
+
anchorOrigin: {
|
|
1604
|
+
vertical: "bottom",
|
|
1605
|
+
horizontal: "right"
|
|
1353
1606
|
},
|
|
1354
|
-
|
|
1355
|
-
|
|
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
|
+
}
|
|
1356
1615
|
},
|
|
1357
|
-
/* @__PURE__ */
|
|
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 })))
|
|
1358
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 })))));
|
|
1359
1627
|
};
|
|
1360
|
-
|
|
1361
|
-
// src/components/style-sections/effects-section/box-shadow-repeater.tsx
|
|
1362
|
-
var BoxShadowRepeater = () => {
|
|
1363
|
-
const { value, setValue } = useControl();
|
|
1364
|
-
const boxShadowValues = value?.value;
|
|
1365
|
-
const setBoxShadow = (newValue) => {
|
|
1366
|
-
setValue({
|
|
1367
|
-
$$type: "box-shadow",
|
|
1368
|
-
value: newValue
|
|
1369
|
-
});
|
|
1370
|
-
};
|
|
1371
|
-
return /* @__PURE__ */ React41.createElement(
|
|
1372
|
-
Repeater,
|
|
1373
|
-
{
|
|
1374
|
-
values: boxShadowValues,
|
|
1375
|
-
setValues: setBoxShadow,
|
|
1376
|
-
label: (0, import_i18n20.__)("Box shadow", "elementor"),
|
|
1377
|
-
itemSettings: {
|
|
1378
|
-
Icon: ItemIcon,
|
|
1379
|
-
Label: ItemLabel,
|
|
1380
|
-
Content: ItemContent,
|
|
1381
|
-
initialValues: initialShadow
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
);
|
|
1385
|
-
};
|
|
1386
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */ React41.createElement(import_ui34.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color.value });
|
|
1387
|
-
var ItemContent = ({
|
|
1388
|
-
anchorEl,
|
|
1628
|
+
var EqualValuesControl = ({
|
|
1389
1629
|
value,
|
|
1390
|
-
setValue
|
|
1630
|
+
setValue,
|
|
1631
|
+
iconButton
|
|
1391
1632
|
}) => {
|
|
1392
|
-
const
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
});
|
|
1397
|
-
};
|
|
1398
|
-
return /* @__PURE__ */ React41.createElement(import_ui34.Stack, { gap: 1.5 }, /* @__PURE__ */ React41.createElement(import_ui34.Grid, { container: true, spacing: 1 }, /* @__PURE__ */ React41.createElement(
|
|
1399
|
-
Control5,
|
|
1400
|
-
{
|
|
1401
|
-
bind: "color",
|
|
1402
|
-
value: value.value.color,
|
|
1403
|
-
label: (0, import_i18n20.__)("Color", "elementor"),
|
|
1404
|
-
setValue: (v) => setShadow({ ...value.value, color: v })
|
|
1405
|
-
},
|
|
1406
|
-
/* @__PURE__ */ React41.createElement(
|
|
1407
|
-
ColorControl,
|
|
1408
|
-
{
|
|
1409
|
-
anchorEl,
|
|
1410
|
-
anchorOrigin: {
|
|
1411
|
-
vertical: "top",
|
|
1412
|
-
horizontal: "right"
|
|
1413
|
-
},
|
|
1414
|
-
transformOrigin: {
|
|
1415
|
-
vertical: "top",
|
|
1416
|
-
horizontal: -10
|
|
1417
|
-
}
|
|
1418
|
-
}
|
|
1419
|
-
)
|
|
1420
|
-
), /* @__PURE__ */ React41.createElement(
|
|
1421
|
-
Control5,
|
|
1422
|
-
{
|
|
1423
|
-
bind: "position",
|
|
1424
|
-
value: value.value.position,
|
|
1425
|
-
label: (0, import_i18n20.__)("Position", "elementor"),
|
|
1426
|
-
setValue: (v) => setShadow({ ...value.value, position: v })
|
|
1427
|
-
},
|
|
1428
|
-
/* @__PURE__ */ React41.createElement(
|
|
1429
|
-
SelectControl,
|
|
1430
|
-
{
|
|
1431
|
-
options: [
|
|
1432
|
-
{ label: "Inset", value: "inset" },
|
|
1433
|
-
{ label: "Outset", value: "outset" }
|
|
1434
|
-
]
|
|
1435
|
-
}
|
|
1436
|
-
)
|
|
1437
|
-
)), /* @__PURE__ */ React41.createElement(import_ui34.Grid, { container: true, spacing: 1 }, /* @__PURE__ */ React41.createElement(
|
|
1438
|
-
Control5,
|
|
1439
|
-
{
|
|
1440
|
-
bind: "hOffset",
|
|
1441
|
-
label: (0, import_i18n20.__)("Horizontal", "elementor"),
|
|
1442
|
-
value: value.value.hOffset,
|
|
1443
|
-
setValue: (v) => setShadow({ ...value.value, hOffset: v })
|
|
1444
|
-
},
|
|
1445
|
-
/* @__PURE__ */ React41.createElement(SizeControl, null)
|
|
1446
|
-
), /* @__PURE__ */ React41.createElement(
|
|
1447
|
-
Control5,
|
|
1633
|
+
const values = Object.values(value ?? {});
|
|
1634
|
+
const isMixed = hasMixedSizes(values);
|
|
1635
|
+
return /* @__PURE__ */ React54.createElement(
|
|
1636
|
+
BoundPropProvider,
|
|
1448
1637
|
{
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
value:
|
|
1452
|
-
setValue: (v) => setShadow({ ...value.value, vOffset: v })
|
|
1638
|
+
bind: "",
|
|
1639
|
+
setValue: (val) => setValue(val),
|
|
1640
|
+
value: isMixed ? void 0 : values[0]
|
|
1453
1641
|
},
|
|
1454
|
-
/* @__PURE__ */
|
|
1455
|
-
)
|
|
1456
|
-
|
|
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,
|
|
1457
1672
|
{
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
}
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
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"
|
|
1677
|
+
}
|
|
1678
|
+
));
|
|
1679
|
+
};
|
|
1680
|
+
|
|
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
|
+
},
|
|
1695
|
+
{
|
|
1696
|
+
label: (0, import_i18n32.__)("Right", "elementor"),
|
|
1697
|
+
icon: /* @__PURE__ */ React56.createElement(import_icons13.SideRightIcon, { fontSize: "tiny" }),
|
|
1698
|
+
bind: "right"
|
|
1699
|
+
},
|
|
1700
|
+
{
|
|
1701
|
+
label: (0, import_i18n32.__)("Bottom", "elementor"),
|
|
1702
|
+
icon: /* @__PURE__ */ React56.createElement(import_icons13.SideBottomIcon, { fontSize: "tiny" }),
|
|
1703
|
+
bind: "bottom"
|
|
1704
|
+
},
|
|
1705
|
+
{
|
|
1706
|
+
label: (0, import_i18n32.__)("Left", "elementor"),
|
|
1707
|
+
icon: /* @__PURE__ */ React56.createElement(import_icons13.SideLeftIcon, { fontSize: "tiny" }),
|
|
1708
|
+
bind: "left"
|
|
1709
|
+
}
|
|
1710
|
+
];
|
|
1711
|
+
var BorderWidthField = () => {
|
|
1712
|
+
return /* @__PURE__ */ React56.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React56.createElement(
|
|
1713
|
+
EqualUnequalSizesControl,
|
|
1466
1714
|
{
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1473
|
-
)));
|
|
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
|
+
));
|
|
1474
1721
|
};
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
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 }))));
|
|
1495
1748
|
};
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
spread: {
|
|
1512
|
-
$$type: "size",
|
|
1513
|
-
value: { unit: "px", size: 0 }
|
|
1749
|
+
|
|
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
|
+
}
|
|
1514
1764
|
},
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
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)));
|
|
1768
|
+
};
|
|
1769
|
+
|
|
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
|
|
1518
1800
|
},
|
|
1519
|
-
|
|
1520
|
-
|
|
1801
|
+
/* @__PURE__ */ React60.createElement(BorderWidthField, null),
|
|
1802
|
+
/* @__PURE__ */ React60.createElement(BorderColorField, null),
|
|
1803
|
+
/* @__PURE__ */ React60.createElement(BorderStyleField, null)
|
|
1804
|
+
);
|
|
1521
1805
|
};
|
|
1522
1806
|
|
|
1523
|
-
// src/components/style-sections/
|
|
1524
|
-
var
|
|
1525
|
-
return /* @__PURE__ */ React42.createElement(AccordionSection, { title: (0, import_i18n21.__)("Effects", "elementor") }, /* @__PURE__ */ React42.createElement(import_ui35.Stack, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(StyleControl, { bind: "box-shadow" }, /* @__PURE__ */ React42.createElement(BoxShadowRepeater, null))));
|
|
1526
|
-
};
|
|
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)));
|
|
1527
1809
|
|
|
1528
1810
|
// src/components/style-tab.tsx
|
|
1529
1811
|
var CLASSES_PROP_KEY = "classes";
|
|
1530
1812
|
var StyleTab = () => {
|
|
1531
|
-
const
|
|
1532
|
-
const
|
|
1533
|
-
|
|
1534
|
-
};
|
|
1535
|
-
|
|
1536
|
-
|
|
1813
|
+
const currentClassesProp = useCurrentClassesProp();
|
|
1814
|
+
const [selectedStyleDefId] = useSelectedStyleDefId(currentClassesProp);
|
|
1815
|
+
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))));
|
|
1817
|
+
};
|
|
1818
|
+
function useSelectedStyleDefId(currentClassesProp) {
|
|
1819
|
+
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];
|
|
1826
|
+
}
|
|
1827
|
+
function useCurrentClassesProp() {
|
|
1828
|
+
const { elementType } = useElement();
|
|
1537
1829
|
const prop = Object.entries(elementType.propsSchema).find(
|
|
1538
1830
|
([, propType]) => propType.kind === "array" && propType.key === CLASSES_PROP_KEY
|
|
1539
1831
|
);
|
|
@@ -1542,28 +1834,76 @@ function useClassesProp() {
|
|
|
1542
1834
|
}
|
|
1543
1835
|
return prop[0];
|
|
1544
1836
|
}
|
|
1545
|
-
function useStyleDefinition() {
|
|
1546
|
-
const { element } = useElementContext();
|
|
1547
|
-
const elementStyles = useElementStyles(element.id);
|
|
1548
|
-
return Object.values(elementStyles || {})[0] ?? null;
|
|
1549
|
-
}
|
|
1550
1837
|
|
|
1551
1838
|
// src/components/editing-panel-tabs.tsx
|
|
1552
1839
|
var EditingPanelTabs = () => {
|
|
1553
|
-
const { getTabProps, getTabPanelProps, getTabsProps } = (0,
|
|
1554
|
-
return /* @__PURE__ */
|
|
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)));
|
|
1555
1842
|
};
|
|
1556
1843
|
|
|
1844
|
+
// 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
|
+
|
|
1557
1897
|
// src/components/editing-panel.tsx
|
|
1558
1898
|
var EditingPanel = () => {
|
|
1559
|
-
const
|
|
1560
|
-
const
|
|
1561
|
-
const
|
|
1562
|
-
if (
|
|
1899
|
+
const { element, elementType } = (0, import_editor_elements4.useSelectedElement)();
|
|
1900
|
+
const controlReplacement = getControlReplacement();
|
|
1901
|
+
const menuItems = useMenuItems().default;
|
|
1902
|
+
if (!element || !elementType) {
|
|
1563
1903
|
return null;
|
|
1564
1904
|
}
|
|
1565
|
-
const panelTitle = (0,
|
|
1566
|
-
return /* @__PURE__ */
|
|
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)))))));
|
|
1567
1907
|
};
|
|
1568
1908
|
|
|
1569
1909
|
// src/panel.ts
|
|
@@ -1576,9 +1916,10 @@ var { panel, usePanelActions, usePanelStatus } = (0, import_editor_panels2.__cre
|
|
|
1576
1916
|
var import_editor = require("@elementor/editor");
|
|
1577
1917
|
|
|
1578
1918
|
// src/sync/should-use-v2-panel.ts
|
|
1919
|
+
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
1579
1920
|
var shouldUseV2Panel = () => {
|
|
1580
|
-
const selectedElements = getSelectedElements();
|
|
1581
|
-
const widgetCache = getWidgetsCache();
|
|
1921
|
+
const selectedElements = (0, import_editor_elements5.getSelectedElements)();
|
|
1922
|
+
const widgetCache = (0, import_editor_elements5.getWidgetsCache)();
|
|
1582
1923
|
if (selectedElements.length !== 1) {
|
|
1583
1924
|
return false;
|
|
1584
1925
|
}
|
|
@@ -1586,12 +1927,12 @@ var shouldUseV2Panel = () => {
|
|
|
1586
1927
|
};
|
|
1587
1928
|
|
|
1588
1929
|
// src/hooks/use-open-editor-panel.ts
|
|
1589
|
-
var
|
|
1590
|
-
var
|
|
1930
|
+
var import_react16 = require("react");
|
|
1931
|
+
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
1591
1932
|
var useOpenEditorPanel = () => {
|
|
1592
1933
|
const { open } = usePanelActions();
|
|
1593
|
-
(0,
|
|
1594
|
-
return (0,
|
|
1934
|
+
(0, import_react16.useEffect)(() => {
|
|
1935
|
+
return (0, import_editor_v1_adapters.__privateListenTo)((0, import_editor_v1_adapters.commandStartEvent)("panel/editor/open"), () => {
|
|
1595
1936
|
if (shouldUseV2Panel()) {
|
|
1596
1937
|
open();
|
|
1597
1938
|
}
|
|
@@ -1607,17 +1948,23 @@ var EditingPanelHooks = () => {
|
|
|
1607
1948
|
|
|
1608
1949
|
// src/init.ts
|
|
1609
1950
|
var import_editor_panels3 = require("@elementor/editor-panels");
|
|
1610
|
-
var
|
|
1951
|
+
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
1611
1952
|
|
|
1612
1953
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1613
|
-
var
|
|
1614
|
-
var
|
|
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");
|
|
1615
1959
|
|
|
1616
1960
|
// src/dynamics/dynamic-control.tsx
|
|
1617
|
-
var
|
|
1961
|
+
var React67 = __toESM(require("react"));
|
|
1962
|
+
|
|
1963
|
+
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
1964
|
+
var import_react18 = require("react");
|
|
1618
1965
|
|
|
1619
1966
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1620
|
-
var
|
|
1967
|
+
var import_react17 = require("react");
|
|
1621
1968
|
|
|
1622
1969
|
// src/dynamics/sync/get-elementor-config.ts
|
|
1623
1970
|
var getElementorConfig = () => {
|
|
@@ -1637,17 +1984,8 @@ var getAtomicDynamicTags = () => {
|
|
|
1637
1984
|
};
|
|
1638
1985
|
};
|
|
1639
1986
|
|
|
1640
|
-
// src/props/is-transformable.ts
|
|
1641
|
-
var import_schema = require("@elementor/schema");
|
|
1642
|
-
var transformableSchema = import_schema.z.object({
|
|
1643
|
-
$$type: import_schema.z.string(),
|
|
1644
|
-
value: import_schema.z.any()
|
|
1645
|
-
});
|
|
1646
|
-
var isTransformable = (value) => {
|
|
1647
|
-
return transformableSchema.safeParse(value).success;
|
|
1648
|
-
};
|
|
1649
|
-
|
|
1650
1987
|
// src/dynamics/utils.ts
|
|
1988
|
+
var import_editor_props = require("@elementor/editor-props");
|
|
1651
1989
|
var DYNAMIC_PROP_TYPE_KEY = "dynamic";
|
|
1652
1990
|
var isDynamicPropType = (prop) => prop.key === DYNAMIC_PROP_TYPE_KEY;
|
|
1653
1991
|
var getDynamicPropType = (propType) => {
|
|
@@ -1655,7 +1993,7 @@ var getDynamicPropType = (propType) => {
|
|
|
1655
1993
|
return dynamicPropType && isDynamicPropType(dynamicPropType) ? dynamicPropType : null;
|
|
1656
1994
|
};
|
|
1657
1995
|
var isDynamicPropValue = (prop) => {
|
|
1658
|
-
return isTransformable(prop) && prop.$$type === DYNAMIC_PROP_TYPE_KEY;
|
|
1996
|
+
return (0, import_editor_props.isTransformable)(prop) && prop.$$type === DYNAMIC_PROP_TYPE_KEY;
|
|
1659
1997
|
};
|
|
1660
1998
|
var supportsDynamic = (propType) => {
|
|
1661
1999
|
return !!getDynamicPropType(propType);
|
|
@@ -1664,13 +2002,13 @@ var supportsDynamic = (propType) => {
|
|
|
1664
2002
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
1665
2003
|
var usePropDynamicTags = (propName) => {
|
|
1666
2004
|
let categories = [];
|
|
1667
|
-
const { elementType } =
|
|
2005
|
+
const { elementType } = useElement();
|
|
1668
2006
|
const propType = elementType.propsSchema?.[propName];
|
|
1669
2007
|
if (propType) {
|
|
1670
2008
|
const propDynamicType = getDynamicPropType(propType);
|
|
1671
2009
|
categories = propDynamicType?.settings.categories || [];
|
|
1672
2010
|
}
|
|
1673
|
-
return (0,
|
|
2011
|
+
return (0, import_react17.useMemo)(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
1674
2012
|
};
|
|
1675
2013
|
var getDynamicTagsByCategories = (categories) => {
|
|
1676
2014
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -1684,15 +2022,14 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
1684
2022
|
};
|
|
1685
2023
|
|
|
1686
2024
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
1687
|
-
var import_react12 = require("react");
|
|
1688
2025
|
var useDynamicTag = (propName, tagName) => {
|
|
1689
2026
|
const dynamicTags = usePropDynamicTags(propName);
|
|
1690
|
-
return (0,
|
|
2027
|
+
return (0, import_react18.useMemo)(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
1691
2028
|
};
|
|
1692
2029
|
|
|
1693
2030
|
// src/dynamics/dynamic-control.tsx
|
|
1694
2031
|
var DynamicControl = ({ bind, children }) => {
|
|
1695
|
-
const { value, setValue, bind: propName } =
|
|
2032
|
+
const { value, setValue, bind: propName } = useBoundProp();
|
|
1696
2033
|
const { name = "", settings } = value?.value ?? {};
|
|
1697
2034
|
const dynamicTag = useDynamicTag(propName, name);
|
|
1698
2035
|
if (!dynamicTag) {
|
|
@@ -1712,24 +2049,21 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
1712
2049
|
}
|
|
1713
2050
|
});
|
|
1714
2051
|
};
|
|
1715
|
-
return /* @__PURE__ */
|
|
2052
|
+
return /* @__PURE__ */ React67.createElement(BoundPropProvider, { setValue: setDynamicValue, value: dynamicValue, bind }, children);
|
|
1716
2053
|
};
|
|
1717
2054
|
|
|
1718
|
-
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1719
|
-
var import_icons11 = require("@elementor/icons");
|
|
1720
|
-
|
|
1721
2055
|
// src/dynamics/components/dynamic-selection.tsx
|
|
1722
|
-
var
|
|
1723
|
-
var
|
|
1724
|
-
var
|
|
1725
|
-
var
|
|
1726
|
-
var
|
|
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");
|
|
1727
2061
|
|
|
1728
2062
|
// src/dynamics/hooks/use-prop-value-history.ts
|
|
1729
2063
|
var PROPS_VALUES_HISTORY_KEY = "elementor/dynamic/non-dynamic-values-history";
|
|
1730
2064
|
var usePropValueHistory = (path) => {
|
|
1731
2065
|
const valuesHistory = getValues();
|
|
1732
|
-
const { element } =
|
|
2066
|
+
const { element } = useElement();
|
|
1733
2067
|
const key = `${element.id}-${path}`;
|
|
1734
2068
|
const value = valuesHistory[key] ?? null;
|
|
1735
2069
|
const setValue = (newValue) => {
|
|
@@ -1745,14 +2079,14 @@ var setValues = (values) => {
|
|
|
1745
2079
|
};
|
|
1746
2080
|
|
|
1747
2081
|
// src/dynamics/components/dynamic-selection.tsx
|
|
1748
|
-
var
|
|
2082
|
+
var SIZE4 = "tiny";
|
|
1749
2083
|
var DynamicSelection = ({ onSelect }) => {
|
|
1750
|
-
const [searchValue, setSearchValue] = (0,
|
|
2084
|
+
const [searchValue, setSearchValue] = (0, import_react19.useState)("");
|
|
1751
2085
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
1752
|
-
const { bind, value: currentValue, setValue } =
|
|
2086
|
+
const { bind, value: currentValue, setValue } = useBoundProp();
|
|
1753
2087
|
const [, updatePropValueHistory] = usePropValueHistory(bind);
|
|
1754
2088
|
const isCurrentValueDynamic = isDynamicPropValue(currentValue);
|
|
1755
|
-
const
|
|
2089
|
+
const options5 = useFilteredOptions(bind, searchValue);
|
|
1756
2090
|
const handleSearch = (event) => {
|
|
1757
2091
|
setSearchValue(event.target.value);
|
|
1758
2092
|
};
|
|
@@ -1763,22 +2097,22 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
1763
2097
|
setValue({ $$type: "dynamic", value: { name: value, settings: {} } });
|
|
1764
2098
|
onSelect?.();
|
|
1765
2099
|
};
|
|
1766
|
-
return /* @__PURE__ */
|
|
1767
|
-
|
|
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,
|
|
1768
2102
|
{
|
|
1769
2103
|
fullWidth: true,
|
|
1770
|
-
size:
|
|
2104
|
+
size: SIZE4,
|
|
1771
2105
|
value: searchValue,
|
|
1772
2106
|
onChange: handleSearch,
|
|
1773
|
-
placeholder: (0,
|
|
2107
|
+
placeholder: (0, import_i18n39.__)("Search dynamic tag", "elementor"),
|
|
1774
2108
|
InputProps: {
|
|
1775
|
-
startAdornment: /* @__PURE__ */
|
|
2109
|
+
startAdornment: /* @__PURE__ */ React68.createElement(import_ui53.InputAdornment, { position: "start" }, /* @__PURE__ */ React68.createElement(import_icons16.SearchIcon, { fontSize: SIZE4 }))
|
|
1776
2110
|
}
|
|
1777
2111
|
}
|
|
1778
|
-
)), /* @__PURE__ */
|
|
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 }) => {
|
|
1779
2113
|
const isSelected = isCurrentValueDynamic && value === currentValue?.value?.name;
|
|
1780
|
-
return /* @__PURE__ */
|
|
1781
|
-
|
|
2114
|
+
return /* @__PURE__ */ React68.createElement(
|
|
2115
|
+
import_ui53.MenuItem,
|
|
1782
2116
|
{
|
|
1783
2117
|
key: value,
|
|
1784
2118
|
selected: isSelected,
|
|
@@ -1788,20 +2122,20 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
1788
2122
|
},
|
|
1789
2123
|
tagLabel
|
|
1790
2124
|
);
|
|
1791
|
-
})))) : /* @__PURE__ */
|
|
1792
|
-
|
|
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,
|
|
1793
2127
|
{
|
|
1794
2128
|
color: "secondary",
|
|
1795
2129
|
variant: "caption",
|
|
1796
2130
|
component: "button",
|
|
1797
2131
|
onClick: () => setSearchValue("")
|
|
1798
2132
|
},
|
|
1799
|
-
(0,
|
|
1800
|
-
), "\xA0", (0,
|
|
2133
|
+
(0, import_i18n39.__)("Clear the filters", "elementor")
|
|
2134
|
+
), "\xA0", (0, import_i18n39.__)("and try again.", "elementor")))));
|
|
1801
2135
|
};
|
|
1802
2136
|
var useFilteredOptions = (bind, searchValue) => {
|
|
1803
2137
|
const dynamicTags = usePropDynamicTags(bind);
|
|
1804
|
-
const
|
|
2138
|
+
const options5 = dynamicTags.reduce((categories, { name, label, group }) => {
|
|
1805
2139
|
const isVisible = label.toLowerCase().includes(searchValue.trim().toLowerCase());
|
|
1806
2140
|
if (!isVisible) {
|
|
1807
2141
|
return categories;
|
|
@@ -1812,19 +2146,17 @@ var useFilteredOptions = (bind, searchValue) => {
|
|
|
1812
2146
|
categories.get(group)?.push({ label, value: name });
|
|
1813
2147
|
return categories;
|
|
1814
2148
|
}, /* @__PURE__ */ new Map());
|
|
1815
|
-
return [...
|
|
2149
|
+
return [...options5];
|
|
1816
2150
|
};
|
|
1817
2151
|
|
|
1818
2152
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
1819
|
-
var
|
|
1820
|
-
var import_i18n25 = require("@wordpress/i18n");
|
|
1821
|
-
var SIZE4 = "tiny";
|
|
2153
|
+
var SIZE5 = "tiny";
|
|
1822
2154
|
var DynamicSelectionControl = () => {
|
|
1823
|
-
const { bind, value, setValue } =
|
|
2155
|
+
const { bind, value, setValue } = useBoundProp();
|
|
1824
2156
|
const [propValueFromHistory] = usePropValueHistory(bind);
|
|
1825
2157
|
const { name: tagName = "" } = value?.value || {};
|
|
1826
|
-
const selectionPopoverId = (0,
|
|
1827
|
-
const selectionPopoverState = (0,
|
|
2158
|
+
const selectionPopoverId = (0, import_react20.useId)();
|
|
2159
|
+
const selectionPopoverState = (0, import_ui54.usePopupState)({ variant: "popover", popupId: selectionPopoverId });
|
|
1828
2160
|
const dynamicTag = useDynamicTag(bind, tagName);
|
|
1829
2161
|
const removeDynamicTag = () => {
|
|
1830
2162
|
setValue(propValueFromHistory ?? null);
|
|
@@ -1832,70 +2164,70 @@ var DynamicSelectionControl = () => {
|
|
|
1832
2164
|
if (!dynamicTag) {
|
|
1833
2165
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
1834
2166
|
}
|
|
1835
|
-
return /* @__PURE__ */
|
|
1836
|
-
|
|
2167
|
+
return /* @__PURE__ */ React69.createElement(import_ui54.Box, null, /* @__PURE__ */ React69.createElement(
|
|
2168
|
+
import_ui54.UnstableTag,
|
|
1837
2169
|
{
|
|
1838
2170
|
fullWidth: true,
|
|
1839
2171
|
showActionsOnHover: true,
|
|
1840
2172
|
label: dynamicTag.label,
|
|
1841
|
-
startIcon: /* @__PURE__ */
|
|
1842
|
-
...(0,
|
|
1843
|
-
actions: /* @__PURE__ */
|
|
1844
|
-
|
|
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,
|
|
1845
2177
|
{
|
|
1846
|
-
size:
|
|
2178
|
+
size: SIZE5,
|
|
1847
2179
|
onClick: removeDynamicTag,
|
|
1848
|
-
"aria-label": (0,
|
|
2180
|
+
"aria-label": (0, import_i18n40.__)("Remove dynamic value", "elementor")
|
|
1849
2181
|
},
|
|
1850
|
-
/* @__PURE__ */
|
|
2182
|
+
/* @__PURE__ */ React69.createElement(import_icons17.XIcon, { fontSize: SIZE5 })
|
|
1851
2183
|
))
|
|
1852
2184
|
}
|
|
1853
|
-
), /* @__PURE__ */
|
|
1854
|
-
|
|
2185
|
+
), /* @__PURE__ */ React69.createElement(
|
|
2186
|
+
import_ui54.Popover,
|
|
1855
2187
|
{
|
|
1856
2188
|
disablePortal: true,
|
|
1857
2189
|
disableScrollLock: true,
|
|
1858
2190
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1859
|
-
...(0,
|
|
2191
|
+
...(0, import_ui54.bindPopover)(selectionPopoverState)
|
|
1860
2192
|
},
|
|
1861
|
-
/* @__PURE__ */
|
|
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 }))
|
|
1862
2194
|
));
|
|
1863
2195
|
};
|
|
1864
2196
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
1865
|
-
const popupId = (0,
|
|
1866
|
-
const settingsPopupState = (0,
|
|
2197
|
+
const popupId = (0, import_react20.useId)();
|
|
2198
|
+
const settingsPopupState = (0, import_ui54.usePopupState)({ variant: "popover", popupId });
|
|
1867
2199
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
1868
2200
|
if (!hasDynamicSettings) {
|
|
1869
2201
|
return null;
|
|
1870
2202
|
}
|
|
1871
|
-
return /* @__PURE__ */
|
|
1872
|
-
|
|
2203
|
+
return /* @__PURE__ */ React69.createElement(React69.Fragment, null, /* @__PURE__ */ React69.createElement(
|
|
2204
|
+
import_ui54.IconButton,
|
|
1873
2205
|
{
|
|
1874
|
-
size:
|
|
1875
|
-
...(0,
|
|
1876
|
-
"aria-label": (0,
|
|
2206
|
+
size: SIZE5,
|
|
2207
|
+
...(0, import_ui54.bindTrigger)(settingsPopupState),
|
|
2208
|
+
"aria-label": (0, import_i18n40.__)("Settings", "elementor")
|
|
1877
2209
|
},
|
|
1878
|
-
/* @__PURE__ */
|
|
1879
|
-
), /* @__PURE__ */
|
|
1880
|
-
|
|
2210
|
+
/* @__PURE__ */ React69.createElement(import_icons17.SettingsIcon, { fontSize: SIZE5 })
|
|
2211
|
+
), /* @__PURE__ */ React69.createElement(
|
|
2212
|
+
import_ui54.Popover,
|
|
1881
2213
|
{
|
|
1882
2214
|
disableScrollLock: true,
|
|
1883
2215
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
1884
|
-
...(0,
|
|
2216
|
+
...(0, import_ui54.bindPopover)(settingsPopupState)
|
|
1885
2217
|
},
|
|
1886
|
-
/* @__PURE__ */
|
|
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 }))
|
|
1887
2219
|
));
|
|
1888
2220
|
};
|
|
1889
2221
|
var DynamicSettings = ({ controls }) => {
|
|
1890
2222
|
const tabs = controls.filter(({ type }) => type === "section");
|
|
1891
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
2223
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui54.useTabs)(0);
|
|
1892
2224
|
if (!tabs.length) {
|
|
1893
2225
|
return null;
|
|
1894
2226
|
}
|
|
1895
|
-
return /* @__PURE__ */
|
|
1896
|
-
return /* @__PURE__ */
|
|
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) => {
|
|
1897
2229
|
if (item.type === "control") {
|
|
1898
|
-
return /* @__PURE__ */
|
|
2230
|
+
return /* @__PURE__ */ React69.createElement(Control6, { key: item.value.bind, control: item.value });
|
|
1899
2231
|
}
|
|
1900
2232
|
return null;
|
|
1901
2233
|
})));
|
|
@@ -1905,28 +2237,27 @@ var Control6 = ({ control }) => {
|
|
|
1905
2237
|
if (!getControlByType(control.type)) {
|
|
1906
2238
|
return null;
|
|
1907
2239
|
}
|
|
1908
|
-
return /* @__PURE__ */
|
|
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 }));
|
|
1909
2241
|
};
|
|
1910
2242
|
|
|
1911
2243
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
1912
|
-
var
|
|
1913
|
-
var
|
|
1914
|
-
var
|
|
2244
|
+
var React70 = __toESM(require("react"));
|
|
2245
|
+
var import_i18n41 = require("@wordpress/i18n");
|
|
2246
|
+
var import_icons18 = require("@elementor/icons");
|
|
1915
2247
|
var usePropDynamicAction = () => {
|
|
1916
|
-
const { bind } =
|
|
1917
|
-
const { elementType } =
|
|
2248
|
+
const { bind } = useBoundProp();
|
|
2249
|
+
const { elementType } = useElement();
|
|
1918
2250
|
const propType = elementType.propsSchema[bind];
|
|
1919
2251
|
const visible = !!propType && supportsDynamic(propType);
|
|
1920
2252
|
return {
|
|
1921
2253
|
visible,
|
|
1922
|
-
icon:
|
|
1923
|
-
title: (0,
|
|
1924
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
2254
|
+
icon: import_icons18.DatabaseIcon,
|
|
2255
|
+
title: (0, import_i18n41.__)("Dynamic Tags", "elementor"),
|
|
2256
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React70.createElement(DynamicSelection, { onSelect: closePopover })
|
|
1925
2257
|
};
|
|
1926
2258
|
};
|
|
1927
2259
|
|
|
1928
2260
|
// src/dynamics/init.ts
|
|
1929
|
-
var { registerPopoverAction } = controlActionsMenu;
|
|
1930
2261
|
var init = () => {
|
|
1931
2262
|
replaceControl({
|
|
1932
2263
|
component: DynamicSelectionControl,
|
|
@@ -1949,7 +2280,7 @@ function init2() {
|
|
|
1949
2280
|
init();
|
|
1950
2281
|
}
|
|
1951
2282
|
var blockV1Panel = () => {
|
|
1952
|
-
(0,
|
|
2283
|
+
(0, import_editor_v1_adapters2.__privateBlockDataCommand)({
|
|
1953
2284
|
command: "panel/editor/open",
|
|
1954
2285
|
condition: shouldUseV2Panel
|
|
1955
2286
|
});
|
|
@@ -1959,8 +2290,7 @@ var blockV1Panel = () => {
|
|
|
1959
2290
|
init2();
|
|
1960
2291
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1961
2292
|
0 && (module.exports = {
|
|
1962
|
-
controlActionsMenu,
|
|
1963
2293
|
replaceControl,
|
|
1964
|
-
|
|
2294
|
+
useBoundProp
|
|
1965
2295
|
});
|
|
1966
2296
|
//# sourceMappingURL=index.js.map
|