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