@elementor/editor-editing-panel 1.9.0 → 1.11.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 +105 -0
- package/dist/index.d.mts +1 -35
- package/dist/index.d.ts +1 -35
- package/dist/index.js +996 -1059
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +905 -970
- package/dist/index.mjs.map +1 -1
- package/package.json +18 -14
- package/src/components/css-classes/css-class-item.tsx +130 -0
- package/src/components/css-classes/css-class-menu.tsx +151 -0
- package/src/components/{css-class-selector.tsx → css-classes/css-class-selector.tsx} +34 -160
- package/src/components/style-sections/layout-section/display-field.tsx +9 -1
- package/src/components/style-sections/layout-section/flex-order-field.tsx +5 -5
- package/src/components/style-sections/layout-section/flex-size-field.tsx +1 -1
- package/src/components/style-sections/layout-section/gap-control-field.tsx +0 -2
- package/src/components/style-sections/position-section/dimensions-field.tsx +1 -1
- package/src/components/style-sections/position-section/position-section.tsx +1 -1
- package/src/components/style-sections/typography-section/font-weight-field.tsx +9 -5
- package/src/components/style-sections/typography-section/text-alignment-field.tsx +16 -8
- package/src/components/style-sections/typography-section/transform-field.tsx +12 -3
- package/src/components/style-tab.tsx +1 -1
- package/src/contexts/style-context.tsx +36 -5
- package/src/controls-registry/control.tsx +3 -12
- package/src/controls-registry/controls-registry.tsx +3 -1
- package/src/controls-registry/settings-field.tsx +8 -1
- package/src/dynamics/components/dynamic-selection.tsx +1 -1
- package/src/dynamics/dynamic-control.tsx +1 -1
- package/src/dynamics/types.ts +2 -2
- package/src/dynamics/utils.ts +2 -2
- package/src/errors.ts +22 -0
- package/src/hooks/use-persist-dynamic-value.ts +1 -1
- package/src/hooks/use-styles-fields.ts +151 -9
- package/src/hooks/use-unapply-class.ts +4 -0
- package/src/index.ts +1 -2
- package/src/init.ts +2 -4
- package/src/sync/types.ts +4 -3
- package/src/components/collapsible-field.tsx +0 -36
- package/src/components/conditional-tooltip-wrapper.tsx +0 -58
- package/src/components/css-class-menu.tsx +0 -125
- package/src/components/editable-field.tsx +0 -166
- package/src/contexts/css-class-item-context.tsx +0 -31
- package/src/css-classes.ts +0 -45
- package/src/hooks/use-session-storage.ts +0 -46
- package/src/sync/enqueue-font.ts +0 -7
package/dist/index.js
CHANGED
|
@@ -31,8 +31,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
injectIntoClassSelectorActions: () => injectIntoClassSelectorActions,
|
|
34
|
-
registerGlobalClassMenuItem: () => registerGlobalClassMenuItem,
|
|
35
|
-
registerStateMenuItem: () => registerStateMenuItem,
|
|
36
34
|
replaceControl: () => replaceControl,
|
|
37
35
|
useBoundProp: () => import_editor_controls47.useBoundProp,
|
|
38
36
|
usePanelActions: () => usePanelActions,
|
|
@@ -45,135 +43,24 @@ var import_editor_controls47 = require("@elementor/editor-controls");
|
|
|
45
43
|
var import_editor_controls = require("@elementor/editor-controls");
|
|
46
44
|
var { replaceControl, getControlReplacement } = (0, import_editor_controls.createControlReplacement)();
|
|
47
45
|
|
|
48
|
-
// src/components/css-class-
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var import_menus = require("@elementor/menus");
|
|
52
|
-
var import_ui = require("@elementor/ui");
|
|
53
|
-
var import_i18n = require("@wordpress/i18n");
|
|
54
|
-
|
|
55
|
-
// src/contexts/css-class-item-context.tsx
|
|
56
|
-
var React = __toESM(require("react"));
|
|
57
|
-
var import_react = require("react");
|
|
58
|
-
var ClassItemContext = (0, import_react.createContext)({
|
|
59
|
-
styleId: "",
|
|
60
|
-
isGlobal: false,
|
|
61
|
-
isActive: false
|
|
62
|
-
});
|
|
63
|
-
function CssClassItemProvider({ styleId, isGlobal, isActive, children }) {
|
|
64
|
-
return /* @__PURE__ */ React.createElement(ClassItemContext.Provider, { value: { styleId, isGlobal, isActive } }, children);
|
|
65
|
-
}
|
|
66
|
-
function useCssClassItem() {
|
|
67
|
-
const context = (0, import_react.useContext)(ClassItemContext);
|
|
68
|
-
if (!context) {
|
|
69
|
-
throw new Error("useCssClassItem must be used within a CssClassItemProvider");
|
|
70
|
-
}
|
|
71
|
-
return context;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// src/contexts/style-context.tsx
|
|
75
|
-
var React2 = __toESM(require("react"));
|
|
76
|
-
var import_react2 = require("react");
|
|
77
|
-
var Context = (0, import_react2.createContext)(null);
|
|
78
|
-
function StyleProvider({ children, id, setId, meta, setMetaState }) {
|
|
79
|
-
return /* @__PURE__ */ React2.createElement(Context.Provider, { value: { id, setId, meta, setMetaState } }, children);
|
|
80
|
-
}
|
|
81
|
-
function useStyle() {
|
|
82
|
-
const context = (0, import_react2.useContext)(Context);
|
|
83
|
-
if (!context) {
|
|
84
|
-
throw new Error("useStyle must be used within a StyleProvider");
|
|
85
|
-
}
|
|
86
|
-
return context;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// src/components/css-class-menu.tsx
|
|
90
|
-
var { useMenuItems: useStateMenuItems, registerStateMenuItem } = (0, import_menus.createMenu)({
|
|
91
|
-
components: {
|
|
92
|
-
StateMenuItem
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
var { useMenuItems: useGlobalClassMenuItems, registerGlobalClassMenuItem } = (0, import_menus.createMenu)({
|
|
96
|
-
components: {
|
|
97
|
-
GlobalClassMenuItem
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
function CssClassMenu({
|
|
101
|
-
popupState,
|
|
102
|
-
containerRef
|
|
103
|
-
}) {
|
|
104
|
-
const { isGlobal } = useCssClassItem();
|
|
105
|
-
const { default: globalClassMenuItems } = useGlobalClassMenuItems();
|
|
106
|
-
const { default: stateMenuItems } = useStateMenuItems();
|
|
107
|
-
return /* @__PURE__ */ React3.createElement(
|
|
108
|
-
import_ui.Menu,
|
|
109
|
-
{
|
|
110
|
-
MenuListProps: { dense: true },
|
|
111
|
-
...(0, import_ui.bindMenu)(popupState),
|
|
112
|
-
anchorOrigin: {
|
|
113
|
-
vertical: "top",
|
|
114
|
-
horizontal: "right"
|
|
115
|
-
},
|
|
116
|
-
anchorEl: containerRef.current
|
|
117
|
-
},
|
|
118
|
-
isGlobal && /* @__PURE__ */ React3.createElement(GlobalClassMenuSection, null, globalClassMenuItems.map(({ id, MenuItem: MenuItemComponent }) => /* @__PURE__ */ React3.createElement(MenuItemComponent, { key: id }))),
|
|
119
|
-
/* @__PURE__ */ React3.createElement(import_ui.ListSubheader, null, (0, import_i18n.__)("Add a pseudo selector", "elementor")),
|
|
120
|
-
stateMenuItems.map(({ id, MenuItem: MenuItemComponent }) => /* @__PURE__ */ React3.createElement(MenuItemComponent, { key: id }))
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
function StateMenuItem({ state, disabled }) {
|
|
124
|
-
const { isActive, styleId } = useCssClassItem();
|
|
125
|
-
const { setId: setActiveId, setMetaState: setActiveMetaState, meta } = useStyle();
|
|
126
|
-
const { state: activeState } = meta;
|
|
127
|
-
const isSelected = state === activeState && isActive;
|
|
128
|
-
return /* @__PURE__ */ React3.createElement(
|
|
129
|
-
StyledMenuItem,
|
|
130
|
-
{
|
|
131
|
-
selected: state === activeState && isActive,
|
|
132
|
-
disabled,
|
|
133
|
-
onClick: () => {
|
|
134
|
-
if (!isActive) {
|
|
135
|
-
setActiveId(styleId);
|
|
136
|
-
}
|
|
137
|
-
setActiveMetaState(state);
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
isSelected && /* @__PURE__ */ React3.createElement(import_ui.ListItemIcon, null, /* @__PURE__ */ React3.createElement(import_icons.CheckIcon, null)),
|
|
141
|
-
/* @__PURE__ */ React3.createElement(import_ui.ListItemText, { primary: state ? `:${state}` : "Normal" })
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
function GlobalClassMenuItem({ text, onClick }) {
|
|
145
|
-
return /* @__PURE__ */ React3.createElement(StyledMenuItem, { onClick }, /* @__PURE__ */ React3.createElement(import_ui.ListItemText, { primary: text }));
|
|
146
|
-
}
|
|
147
|
-
var GlobalClassMenuSection = (0, import_ui.styled)(import_ui.Box)(({ theme }) => ({
|
|
148
|
-
borderBottom: `1px solid ${theme?.palette.divider}`
|
|
149
|
-
}));
|
|
150
|
-
var StyledMenuItem = (0, import_ui.styled)(import_ui.MenuItem)({
|
|
151
|
-
"&:hover": {
|
|
152
|
-
color: "text.primary"
|
|
153
|
-
// Overriding global CSS from the editor.
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
// src/components/css-class-selector.tsx
|
|
158
|
-
var React9 = __toESM(require("react"));
|
|
159
|
-
var import_react8 = require("react");
|
|
160
|
-
var import_editor_elements = require("@elementor/editor-elements");
|
|
46
|
+
// src/components/css-classes/css-class-selector.tsx
|
|
47
|
+
var React7 = __toESM(require("react"));
|
|
48
|
+
var import_editor_elements2 = require("@elementor/editor-elements");
|
|
161
49
|
var import_editor_props = require("@elementor/editor-props");
|
|
162
|
-
var
|
|
163
|
-
var import_icons2 = require("@elementor/icons");
|
|
50
|
+
var import_editor_styles_repository4 = require("@elementor/editor-styles-repository");
|
|
164
51
|
var import_locations = require("@elementor/locations");
|
|
165
|
-
var
|
|
166
|
-
var
|
|
52
|
+
var import_ui4 = require("@elementor/ui");
|
|
53
|
+
var import_i18n3 = require("@wordpress/i18n");
|
|
167
54
|
|
|
168
55
|
// src/contexts/classes-prop-context.tsx
|
|
169
|
-
var
|
|
170
|
-
var
|
|
171
|
-
var
|
|
56
|
+
var React = __toESM(require("react"));
|
|
57
|
+
var import_react = require("react");
|
|
58
|
+
var Context = (0, import_react.createContext)(null);
|
|
172
59
|
function ClassesPropProvider({ children, prop }) {
|
|
173
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ React.createElement(Context.Provider, { value: { prop } }, children);
|
|
174
61
|
}
|
|
175
62
|
function useClassesProp() {
|
|
176
|
-
const context = (0,
|
|
63
|
+
const context = (0, import_react.useContext)(Context);
|
|
177
64
|
if (!context) {
|
|
178
65
|
throw new Error("useClassesProp must be used within a ClassesPropProvider");
|
|
179
66
|
}
|
|
@@ -181,175 +68,71 @@ function useClassesProp() {
|
|
|
181
68
|
}
|
|
182
69
|
|
|
183
70
|
// src/contexts/element-context.tsx
|
|
184
|
-
var
|
|
185
|
-
var
|
|
186
|
-
var
|
|
71
|
+
var React2 = __toESM(require("react"));
|
|
72
|
+
var import_react2 = require("react");
|
|
73
|
+
var Context2 = (0, import_react2.createContext)(null);
|
|
187
74
|
function ElementProvider({ children, element, elementType }) {
|
|
188
|
-
return /* @__PURE__ */
|
|
75
|
+
return /* @__PURE__ */ React2.createElement(Context2.Provider, { value: { element, elementType } }, children);
|
|
189
76
|
}
|
|
190
77
|
function useElement() {
|
|
191
|
-
const context = (0,
|
|
78
|
+
const context = (0, import_react2.useContext)(Context2);
|
|
192
79
|
if (!context) {
|
|
193
80
|
throw new Error("useElement must be used within a ElementProvider");
|
|
194
81
|
}
|
|
195
82
|
return context;
|
|
196
83
|
}
|
|
197
84
|
|
|
198
|
-
// src/
|
|
199
|
-
var
|
|
200
|
-
var
|
|
201
|
-
var
|
|
202
|
-
var ConditionalTooltipWrapper = ({ maxWidth, title }) => {
|
|
203
|
-
const elRef = (0, import_react5.useRef)(null);
|
|
204
|
-
const [isOverflown, setIsOverflown] = (0, import_react5.useState)(false);
|
|
205
|
-
(0, import_react5.useEffect)(() => {
|
|
206
|
-
const onResize = () => {
|
|
207
|
-
const element = elRef.current;
|
|
208
|
-
if (element) {
|
|
209
|
-
setIsOverflown(element.scrollWidth > element.clientWidth);
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
onResize();
|
|
213
|
-
window.addEventListener("resize", onResize);
|
|
214
|
-
return () => {
|
|
215
|
-
window.removeEventListener("resize", onResize);
|
|
216
|
-
};
|
|
217
|
-
}, []);
|
|
218
|
-
if (isOverflown) {
|
|
219
|
-
return /* @__PURE__ */ React6.createElement(import_ui2.Tooltip, { title, placement: "top" }, /* @__PURE__ */ React6.createElement(Content, { maxWidth, ref: elRef }, title));
|
|
220
|
-
}
|
|
221
|
-
return /* @__PURE__ */ React6.createElement(Content, { maxWidth, ref: elRef }, title);
|
|
222
|
-
};
|
|
223
|
-
var Content = React6.forwardRef(({ maxWidth, ...tooltipProps }, ref) => /* @__PURE__ */ React6.createElement(
|
|
224
|
-
import_ui2.Box,
|
|
225
|
-
{
|
|
226
|
-
ref,
|
|
227
|
-
position: "relative",
|
|
228
|
-
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", maxWidth },
|
|
229
|
-
...tooltipProps
|
|
230
|
-
}
|
|
231
|
-
));
|
|
85
|
+
// src/contexts/style-context.tsx
|
|
86
|
+
var React3 = __toESM(require("react"));
|
|
87
|
+
var import_react3 = require("react");
|
|
88
|
+
var import_editor_styles_repository = require("@elementor/editor-styles-repository");
|
|
232
89
|
|
|
233
|
-
// src/
|
|
234
|
-
var
|
|
235
|
-
var
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
try {
|
|
259
|
-
await onSubmit(newValue);
|
|
260
|
-
} finally {
|
|
261
|
-
setSubmitting(false);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
closeEditMode();
|
|
265
|
-
};
|
|
266
|
-
const onChange = (event) => {
|
|
267
|
-
const { innerText: newValue } = event.target;
|
|
268
|
-
if (validation) {
|
|
269
|
-
setError(validation(newValue));
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
return /* @__PURE__ */ React7.createElement(
|
|
273
|
-
Context4.Provider,
|
|
274
|
-
{
|
|
275
|
-
value: {
|
|
276
|
-
isEditing,
|
|
277
|
-
openEditMode,
|
|
278
|
-
closeEditMode,
|
|
279
|
-
onChange,
|
|
280
|
-
value,
|
|
281
|
-
error,
|
|
282
|
-
submit,
|
|
283
|
-
editable,
|
|
284
|
-
submitting
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
children
|
|
288
|
-
);
|
|
289
|
-
};
|
|
290
|
-
var EditableField = ({ children, onClick, ...props }) => {
|
|
291
|
-
const ref = (0, import_react6.useRef)(null);
|
|
292
|
-
const { isEditing, closeEditMode, value, onChange, error, submit, editable } = useEditableField();
|
|
293
|
-
(0, import_react6.useEffect)(() => {
|
|
294
|
-
if (isEditing) {
|
|
295
|
-
ref.current?.focus();
|
|
296
|
-
selectAll();
|
|
297
|
-
}
|
|
298
|
-
}, [isEditing]);
|
|
299
|
-
const handleKeyDown = (event) => {
|
|
300
|
-
event.stopPropagation();
|
|
301
|
-
if (["Escape"].includes(event.key)) {
|
|
302
|
-
return closeEditMode();
|
|
303
|
-
}
|
|
304
|
-
if (["Enter"].includes(event.key)) {
|
|
305
|
-
event.preventDefault();
|
|
306
|
-
return submit(event.target.innerText);
|
|
307
|
-
}
|
|
308
|
-
};
|
|
309
|
-
const handleClick = (event) => {
|
|
310
|
-
if (isEditing) {
|
|
311
|
-
event.stopPropagation();
|
|
312
|
-
}
|
|
313
|
-
onClick?.(event);
|
|
314
|
-
};
|
|
315
|
-
const selectAll = () => {
|
|
316
|
-
const selection = getSelection();
|
|
317
|
-
if (!selection || !ref.current) {
|
|
318
|
-
return;
|
|
319
|
-
}
|
|
320
|
-
const range = document.createRange();
|
|
321
|
-
range.selectNodeContents(ref.current);
|
|
322
|
-
selection.removeAllRanges();
|
|
323
|
-
selection.addRange(range);
|
|
324
|
-
};
|
|
325
|
-
if (!editable) {
|
|
326
|
-
return children;
|
|
90
|
+
// src/errors.ts
|
|
91
|
+
var import_utils = require("@elementor/utils");
|
|
92
|
+
var ControlTypeNotFoundError = (0, import_utils.createError)({
|
|
93
|
+
code: "control_type_not_found",
|
|
94
|
+
message: "Control type not found."
|
|
95
|
+
});
|
|
96
|
+
var StylesProviderNotFoundError = (0, import_utils.createError)({
|
|
97
|
+
code: "provider_not_found",
|
|
98
|
+
message: "Styles provider not found."
|
|
99
|
+
});
|
|
100
|
+
var StylesProviderCannotUpdatePropsError = (0, import_utils.createError)({
|
|
101
|
+
code: "provider_cannot_update_props",
|
|
102
|
+
message: "Styles provider doesn't support updating props."
|
|
103
|
+
});
|
|
104
|
+
var StyleNotFoundUnderProviderError = (0, import_utils.createError)({
|
|
105
|
+
code: "style_not_found_under_provider",
|
|
106
|
+
message: "Style not found under the provider."
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// src/contexts/style-context.tsx
|
|
110
|
+
var Context3 = (0, import_react3.createContext)(null);
|
|
111
|
+
function StyleProvider({ children, ...props }) {
|
|
112
|
+
const provider = props.id === null ? null : getProviderByStyleId(props.id);
|
|
113
|
+
if (props.id && !provider) {
|
|
114
|
+
throw new StylesProviderNotFoundError({ context: { styleId: props.id } });
|
|
327
115
|
}
|
|
328
|
-
return /* @__PURE__ */
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
contentEditable: isEditing,
|
|
335
|
-
suppressContentEditableWarning: true,
|
|
336
|
-
onBlur: closeEditMode
|
|
337
|
-
},
|
|
338
|
-
isEditing ? value : children
|
|
339
|
-
)));
|
|
340
|
-
};
|
|
341
|
-
var useEditableField = () => {
|
|
342
|
-
const contextValue = (0, import_react6.useContext)(Context4);
|
|
343
|
-
if (!contextValue) {
|
|
344
|
-
throw new Error("useEditableField must be used within a EditableFieldProvider");
|
|
116
|
+
return /* @__PURE__ */ React3.createElement(Context3.Provider, { value: { ...props, provider } }, children);
|
|
117
|
+
}
|
|
118
|
+
function useStyle() {
|
|
119
|
+
const context = (0, import_react3.useContext)(Context3);
|
|
120
|
+
if (!context) {
|
|
121
|
+
throw new Error("useStyle must be used within a StyleProvider");
|
|
345
122
|
}
|
|
346
|
-
return
|
|
347
|
-
}
|
|
123
|
+
return context;
|
|
124
|
+
}
|
|
125
|
+
function getProviderByStyleId(styleId) {
|
|
126
|
+
const styleProvider = import_editor_styles_repository.stylesRepository.getProviders().find((provider) => {
|
|
127
|
+
return provider.actions.get().find((style) => style.id === styleId);
|
|
128
|
+
});
|
|
129
|
+
return styleProvider ?? null;
|
|
130
|
+
}
|
|
348
131
|
|
|
349
132
|
// src/components/multi-combobox.tsx
|
|
350
|
-
var
|
|
351
|
-
var
|
|
352
|
-
var
|
|
133
|
+
var React4 = __toESM(require("react"));
|
|
134
|
+
var import_react4 = require("react");
|
|
135
|
+
var import_ui = require("@elementor/ui");
|
|
353
136
|
function MultiCombobox({
|
|
354
137
|
actions = [],
|
|
355
138
|
selected,
|
|
@@ -359,8 +142,8 @@ function MultiCombobox({
|
|
|
359
142
|
}) {
|
|
360
143
|
const filter = useFilterOptions();
|
|
361
144
|
const { run, loading } = useActionRunner();
|
|
362
|
-
return /* @__PURE__ */
|
|
363
|
-
|
|
145
|
+
return /* @__PURE__ */ React4.createElement(
|
|
146
|
+
import_ui.Autocomplete,
|
|
364
147
|
{
|
|
365
148
|
...props,
|
|
366
149
|
freeSolo: true,
|
|
@@ -372,8 +155,8 @@ function MultiCombobox({
|
|
|
372
155
|
disabled: loading,
|
|
373
156
|
value: selected,
|
|
374
157
|
options: options10,
|
|
375
|
-
renderGroup: (params) => /* @__PURE__ */
|
|
376
|
-
renderInput: (params) => /* @__PURE__ */
|
|
158
|
+
renderGroup: (params) => /* @__PURE__ */ React4.createElement(Group, { ...params }),
|
|
159
|
+
renderInput: (params) => /* @__PURE__ */ React4.createElement(import_ui.TextField, { ...params }),
|
|
377
160
|
onChange: (_, selectedOrInputValue, reason) => {
|
|
378
161
|
const inputValue = selectedOrInputValue.find((option) => typeof option === "string");
|
|
379
162
|
const optionsAndActions = selectedOrInputValue.filter((option) => typeof option !== "string");
|
|
@@ -412,28 +195,28 @@ function MultiCombobox({
|
|
|
412
195
|
);
|
|
413
196
|
}
|
|
414
197
|
var Group = (params) => {
|
|
415
|
-
const id = `combobox-group-${(0,
|
|
416
|
-
return /* @__PURE__ */
|
|
198
|
+
const id = `combobox-group-${(0, import_react4.useId)().replace(/:/g, "_")}`;
|
|
199
|
+
return /* @__PURE__ */ React4.createElement(StyledGroup, { role: "group", "aria-labelledby": id }, /* @__PURE__ */ React4.createElement(StyledGroupHeader, { id }, " ", params.group), /* @__PURE__ */ React4.createElement(StyledGroupItems, { role: "listbox" }, params.children));
|
|
417
200
|
};
|
|
418
|
-
var StyledGroup = (0,
|
|
201
|
+
var StyledGroup = (0, import_ui.styled)("li")`
|
|
419
202
|
&:not( :last-of-type ) {
|
|
420
203
|
border-bottom: 1px solid ${({ theme }) => theme.palette.divider};
|
|
421
204
|
}
|
|
422
205
|
`;
|
|
423
|
-
var StyledGroupHeader = (0,
|
|
206
|
+
var StyledGroupHeader = (0, import_ui.styled)(import_ui.Box)(({ theme }) => ({
|
|
424
207
|
position: "sticky",
|
|
425
208
|
top: "-8px",
|
|
426
209
|
padding: theme.spacing(1, 2),
|
|
427
210
|
color: theme.palette.text.tertiary
|
|
428
211
|
}));
|
|
429
|
-
var StyledGroupItems = (0,
|
|
212
|
+
var StyledGroupItems = (0, import_ui.styled)("ul")`
|
|
430
213
|
padding: 0;
|
|
431
214
|
`;
|
|
432
215
|
function useFilterOptions() {
|
|
433
|
-
return (0,
|
|
216
|
+
return (0, import_react4.useState)(() => (0, import_ui.createFilterOptions)())[0];
|
|
434
217
|
}
|
|
435
218
|
function useActionRunner() {
|
|
436
|
-
const [loading, setLoading] = (0,
|
|
219
|
+
const [loading, setLoading] = (0, import_react4.useState)(false);
|
|
437
220
|
const run = async (apply, value) => {
|
|
438
221
|
setLoading(true);
|
|
439
222
|
try {
|
|
@@ -458,113 +241,187 @@ function isAction(option) {
|
|
|
458
241
|
return "apply" in option && "condition" in option;
|
|
459
242
|
}
|
|
460
243
|
|
|
461
|
-
// src/components/css-class-
|
|
462
|
-
var
|
|
463
|
-
var
|
|
464
|
-
var
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
244
|
+
// src/components/css-classes/css-class-item.tsx
|
|
245
|
+
var React6 = __toESM(require("react"));
|
|
246
|
+
var import_react5 = require("react");
|
|
247
|
+
var import_editor_styles_repository3 = require("@elementor/editor-styles-repository");
|
|
248
|
+
var import_editor_ui = require("@elementor/editor-ui");
|
|
249
|
+
var import_icons = require("@elementor/icons");
|
|
250
|
+
var import_ui3 = require("@elementor/ui");
|
|
251
|
+
var import_i18n2 = require("@wordpress/i18n");
|
|
252
|
+
|
|
253
|
+
// src/components/css-classes/css-class-menu.tsx
|
|
254
|
+
var React5 = __toESM(require("react"));
|
|
255
|
+
var import_editor_styles_repository2 = require("@elementor/editor-styles-repository");
|
|
256
|
+
var import_ui2 = require("@elementor/ui");
|
|
257
|
+
var import_i18n = require("@wordpress/i18n");
|
|
258
|
+
|
|
259
|
+
// src/hooks/use-unapply-class.ts
|
|
260
|
+
var import_editor_elements = require("@elementor/editor-elements");
|
|
261
|
+
var useUnapplyClass = (classId) => {
|
|
262
|
+
const { element } = useElement();
|
|
263
|
+
const { setId: setStyleId } = useStyle();
|
|
264
|
+
const classesProp = useClassesProp();
|
|
265
|
+
const classes = (0, import_editor_elements.useElementSetting)(element.id, classesProp);
|
|
266
|
+
const filteredClasses = classes?.value.filter((className) => className !== classId) ?? [];
|
|
267
|
+
return () => {
|
|
268
|
+
(0, import_editor_elements.updateElementSettings)({
|
|
269
|
+
id: element.id,
|
|
270
|
+
props: {
|
|
271
|
+
[classesProp]: {
|
|
272
|
+
$$type: "classes",
|
|
273
|
+
value: filteredClasses
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
setStyleId(null);
|
|
278
|
+
};
|
|
470
279
|
};
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
const active = applied.find((option) => option.value === activeId) ?? EMPTY_OPTION;
|
|
481
|
-
return /* @__PURE__ */ React9.createElement(import_ui5.Stack, { gap: 1, p: 2 }, /* @__PURE__ */ React9.createElement(import_ui5.Stack, { direction: "row", gap: 1, alignItems: "baseline", justifyContent: "space-between" }, /* @__PURE__ */ React9.createElement(import_ui5.Typography, { component: "label", variant: "caption", htmlFor: ID }, (0, import_i18n2.__)("CSS Classes", "elementor")), /* @__PURE__ */ React9.createElement(import_ui5.Stack, { direction: "row", gap: 1 }, /* @__PURE__ */ React9.createElement(ClassSelectorActionsSlot, null))), /* @__PURE__ */ React9.createElement(
|
|
482
|
-
MultiCombobox,
|
|
280
|
+
|
|
281
|
+
// src/components/css-classes/css-class-menu.tsx
|
|
282
|
+
var STATES = ["hover", "focus", "active"];
|
|
283
|
+
function CssClassMenu({ styleId, provider, popupState, handleRename, anchorEl }) {
|
|
284
|
+
const handleKeyDown = (e) => {
|
|
285
|
+
e.stopPropagation();
|
|
286
|
+
};
|
|
287
|
+
return /* @__PURE__ */ React5.createElement(
|
|
288
|
+
import_ui2.Menu,
|
|
483
289
|
{
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
onSubmit: renameLabel,
|
|
504
|
-
editable: value.provider !== import_editor_styles_repository.ELEMENTS_STYLES_PROVIDER_KEY,
|
|
505
|
-
validation: (newLabel) => renameValidation(
|
|
506
|
-
newLabel,
|
|
507
|
-
options10.filter((option) => option.value !== value.value)
|
|
508
|
-
)
|
|
509
|
-
},
|
|
510
|
-
/* @__PURE__ */ React9.createElement(
|
|
511
|
-
CssClassItem,
|
|
512
|
-
{
|
|
513
|
-
label: value.label,
|
|
514
|
-
id: value.value,
|
|
515
|
-
isActive,
|
|
516
|
-
isGlobal: value.color === "global",
|
|
517
|
-
color: isActive && value.color ? value.color : "default",
|
|
518
|
-
chipProps,
|
|
519
|
-
onClickActive: () => handleActivate(value)
|
|
520
|
-
}
|
|
521
|
-
)
|
|
522
|
-
);
|
|
523
|
-
})
|
|
524
|
-
}
|
|
525
|
-
));
|
|
290
|
+
MenuListProps: { dense: true },
|
|
291
|
+
...(0, import_ui2.bindMenu)(popupState),
|
|
292
|
+
anchorEl,
|
|
293
|
+
anchorOrigin: {
|
|
294
|
+
vertical: "bottom",
|
|
295
|
+
horizontal: "left"
|
|
296
|
+
},
|
|
297
|
+
transformOrigin: {
|
|
298
|
+
horizontal: "left",
|
|
299
|
+
vertical: -4
|
|
300
|
+
},
|
|
301
|
+
onKeyDown: handleKeyDown
|
|
302
|
+
},
|
|
303
|
+
getMenuItemsByProvider({ provider, styleId, handleRename, closeMenu: popupState.close }),
|
|
304
|
+
/* @__PURE__ */ React5.createElement(import_ui2.ListSubheader, { sx: { typography: "caption", color: "text.secondary", pb: 0.5, pt: 1 } }, (0, import_i18n.__)("Pseudo selector", "elementor")),
|
|
305
|
+
STATES.map((state) => {
|
|
306
|
+
return /* @__PURE__ */ React5.createElement(StateMenuItem, { key: state, state, styleId });
|
|
307
|
+
})
|
|
308
|
+
);
|
|
526
309
|
}
|
|
310
|
+
function getMenuItemsByProvider({
|
|
311
|
+
provider,
|
|
312
|
+
styleId,
|
|
313
|
+
handleRename,
|
|
314
|
+
closeMenu
|
|
315
|
+
}) {
|
|
316
|
+
const providerInstance = import_editor_styles_repository2.stylesRepository.getProviderByKey(provider);
|
|
317
|
+
const providerActions = providerInstance?.actions;
|
|
318
|
+
const [canUpdate, canDelete] = [providerActions?.update, providerActions?.delete];
|
|
319
|
+
const actions = [
|
|
320
|
+
canUpdate && /* @__PURE__ */ React5.createElement(RenameClassMenuItem, { key: "rename-class", handleRename, closeMenu }),
|
|
321
|
+
canDelete && /* @__PURE__ */ React5.createElement(UnapplyClassMenuItem, { key: "unapply-class", styleId })
|
|
322
|
+
].filter(Boolean);
|
|
323
|
+
if (actions.length) {
|
|
324
|
+
actions.unshift(
|
|
325
|
+
/* @__PURE__ */ React5.createElement(
|
|
326
|
+
import_ui2.ListSubheader,
|
|
327
|
+
{
|
|
328
|
+
key: "provider-label",
|
|
329
|
+
sx: { typography: "caption", color: "text.secondary", pb: 0.5, pt: 1 }
|
|
330
|
+
},
|
|
331
|
+
providerInstance?.labels?.singular
|
|
332
|
+
)
|
|
333
|
+
);
|
|
334
|
+
actions.push(/* @__PURE__ */ React5.createElement(import_ui2.Divider, { key: "provider-actions-divider" }));
|
|
335
|
+
}
|
|
336
|
+
return actions;
|
|
337
|
+
}
|
|
338
|
+
function StateMenuItem({ state, styleId, ...props }) {
|
|
339
|
+
const { id: activeId, setId: setActiveId, setMetaState: setActiveMetaState, meta } = useStyle();
|
|
340
|
+
const { state: activeState } = meta;
|
|
341
|
+
const isActive = styleId === activeId;
|
|
342
|
+
const isSelected = state === activeState && isActive;
|
|
343
|
+
return /* @__PURE__ */ React5.createElement(
|
|
344
|
+
StyledMenuItem,
|
|
345
|
+
{
|
|
346
|
+
...props,
|
|
347
|
+
selected: isSelected,
|
|
348
|
+
sx: { textTransform: "capitalize" },
|
|
349
|
+
onClick: () => {
|
|
350
|
+
if (!isActive) {
|
|
351
|
+
setActiveId(styleId);
|
|
352
|
+
}
|
|
353
|
+
setActiveMetaState(state);
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
state
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
function UnapplyClassMenuItem({ styleId, ...props }) {
|
|
360
|
+
const unapplyClass = useUnapplyClass(styleId);
|
|
361
|
+
return /* @__PURE__ */ React5.createElement(StyledMenuItem, { ...props, onClick: unapplyClass }, (0, import_i18n.__)("Remove", "elementor"));
|
|
362
|
+
}
|
|
363
|
+
function RenameClassMenuItem({
|
|
364
|
+
handleRename,
|
|
365
|
+
closeMenu,
|
|
366
|
+
...props
|
|
367
|
+
}) {
|
|
368
|
+
return /* @__PURE__ */ React5.createElement(
|
|
369
|
+
StyledMenuItem,
|
|
370
|
+
{
|
|
371
|
+
...props,
|
|
372
|
+
onClick: () => {
|
|
373
|
+
closeMenu();
|
|
374
|
+
handleRename();
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
(0, import_i18n.__)("Rename", "elementor")
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
var StyledMenuItem = ({ ...props }) => /* @__PURE__ */ React5.createElement(import_ui2.MenuItem, { ...props, sx: { ...props.sx ?? {}, typography: "caption", color: "text.primary" } });
|
|
381
|
+
|
|
382
|
+
// src/components/css-classes/css-class-item.tsx
|
|
527
383
|
var CHIP_SIZE = "tiny";
|
|
528
384
|
function CssClassItem({
|
|
529
385
|
id,
|
|
530
386
|
label,
|
|
387
|
+
provider,
|
|
531
388
|
isActive,
|
|
532
|
-
isGlobal,
|
|
533
389
|
color: colorProp,
|
|
534
390
|
chipProps,
|
|
535
|
-
onClickActive
|
|
391
|
+
onClickActive,
|
|
392
|
+
renameLabel
|
|
536
393
|
}) {
|
|
537
394
|
const { meta } = useStyle();
|
|
538
|
-
const
|
|
539
|
-
const
|
|
540
|
-
const chipRef = (0, import_react8.useRef)(null);
|
|
395
|
+
const popupState = (0, import_ui3.usePopupState)({ variant: "popover" });
|
|
396
|
+
const [chipRef, setChipRef] = (0, import_react5.useState)(null);
|
|
541
397
|
const { onDelete, ...chipGroupProps } = chipProps;
|
|
542
|
-
const {
|
|
398
|
+
const {
|
|
399
|
+
ref,
|
|
400
|
+
isEditing,
|
|
401
|
+
openEditMode,
|
|
402
|
+
error,
|
|
403
|
+
getProps: getEditableProps
|
|
404
|
+
} = (0, import_editor_ui.useEditable)({
|
|
405
|
+
value: label,
|
|
406
|
+
onSubmit: renameLabel,
|
|
407
|
+
validation: validateLabel
|
|
408
|
+
});
|
|
543
409
|
const color = error ? "error" : colorProp;
|
|
544
|
-
|
|
545
|
-
|
|
410
|
+
const providerActions = import_editor_styles_repository3.stylesRepository.getProviderByKey(provider)?.actions;
|
|
411
|
+
const allowRename = Boolean(providerActions?.update);
|
|
412
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(import_ui3.UnstableChipGroup, { ref: setChipRef, ...chipGroupProps, "aria-label": `Edit ${label}`, role: "group" }, /* @__PURE__ */ React6.createElement(
|
|
413
|
+
import_ui3.Chip,
|
|
546
414
|
{
|
|
547
|
-
disabled: submitting,
|
|
548
415
|
size: CHIP_SIZE,
|
|
549
|
-
label: /* @__PURE__ */
|
|
550
|
-
EditableField,
|
|
551
|
-
{
|
|
552
|
-
onDoubleClick: () => {
|
|
553
|
-
if (!isActive) {
|
|
554
|
-
openEditMode();
|
|
555
|
-
}
|
|
556
|
-
},
|
|
557
|
-
onClick: () => {
|
|
558
|
-
if (isActive) {
|
|
559
|
-
openEditMode();
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
},
|
|
563
|
-
/* @__PURE__ */ React9.createElement(ConditionalTooltipWrapper, { maxWidth: "10ch", title: label })
|
|
564
|
-
),
|
|
416
|
+
label: isEditing ? /* @__PURE__ */ React6.createElement(import_editor_ui.EditableField, { ref, error, ...getEditableProps() }) : /* @__PURE__ */ React6.createElement(import_editor_ui.EllipsisWithTooltip, { maxWidth: "10ch", title: label, as: "div" }),
|
|
565
417
|
variant: isActive && !meta.state ? "filled" : "standard",
|
|
566
418
|
color,
|
|
567
|
-
onClick: () =>
|
|
419
|
+
onClick: () => {
|
|
420
|
+
if (isActive && allowRename) {
|
|
421
|
+
openEditMode();
|
|
422
|
+
}
|
|
423
|
+
onClickActive(id);
|
|
424
|
+
},
|
|
568
425
|
"aria-pressed": isActive,
|
|
569
426
|
sx: {
|
|
570
427
|
"&.Mui-focusVisible": {
|
|
@@ -572,78 +429,134 @@ function CssClassItem({
|
|
|
572
429
|
}
|
|
573
430
|
}
|
|
574
431
|
}
|
|
575
|
-
), !isEditing && /* @__PURE__ */
|
|
576
|
-
|
|
432
|
+
), !isEditing && /* @__PURE__ */ React6.createElement(
|
|
433
|
+
import_ui3.Chip,
|
|
577
434
|
{
|
|
578
|
-
disabled: submitting,
|
|
579
435
|
size: CHIP_SIZE,
|
|
580
|
-
label: /* @__PURE__ */
|
|
436
|
+
label: /* @__PURE__ */ React6.createElement(import_ui3.Stack, { direction: "row", gap: 0.5, alignItems: "center" }, isActive && meta.state && /* @__PURE__ */ React6.createElement(import_ui3.Typography, { variant: "inherit" }, meta.state), /* @__PURE__ */ React6.createElement(import_icons.DotsVerticalIcon, { fontSize: "inherit" })),
|
|
581
437
|
variant: "filled",
|
|
582
438
|
color,
|
|
583
|
-
...(0,
|
|
439
|
+
...(0, import_ui3.bindTrigger)(popupState),
|
|
584
440
|
"aria-label": (0, import_i18n2.__)("Open CSS Class Menu", "elementor")
|
|
585
441
|
}
|
|
586
|
-
)), /* @__PURE__ */
|
|
442
|
+
)), /* @__PURE__ */ React6.createElement(
|
|
443
|
+
CssClassMenu,
|
|
444
|
+
{
|
|
445
|
+
styleId: id,
|
|
446
|
+
popupState,
|
|
447
|
+
provider,
|
|
448
|
+
handleRename: openEditMode,
|
|
449
|
+
anchorEl: chipRef
|
|
450
|
+
}
|
|
451
|
+
));
|
|
452
|
+
}
|
|
453
|
+
var validateLabel = (newLabel) => {
|
|
454
|
+
if (!import_editor_styles_repository3.stylesRepository.isLabelValid(newLabel)) {
|
|
455
|
+
return (0, import_i18n2.__)("Format is not valid", "elementor");
|
|
456
|
+
}
|
|
457
|
+
if (import_editor_styles_repository3.stylesRepository.isLabelExist(newLabel)) {
|
|
458
|
+
return (0, import_i18n2.__)("Existing name", "elementor");
|
|
459
|
+
}
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
// src/components/css-classes/css-class-selector.tsx
|
|
463
|
+
var ID = "elementor-css-class-selector";
|
|
464
|
+
var TAGS_LIMIT = 8;
|
|
465
|
+
var EMPTY_OPTION = {
|
|
466
|
+
label: (0, import_i18n3.__)("local", "elementor"),
|
|
467
|
+
value: "",
|
|
468
|
+
fixed: true,
|
|
469
|
+
color: "primary",
|
|
470
|
+
provider: import_editor_styles_repository4.ELEMENTS_STYLES_PROVIDER_KEY
|
|
471
|
+
};
|
|
472
|
+
var { Slot: ClassSelectorActionsSlot, inject: injectIntoClassSelectorActions } = (0, import_locations.createLocation)();
|
|
473
|
+
function CssClassSelector() {
|
|
474
|
+
const options10 = useOptions();
|
|
475
|
+
const { value: appliedIds, setValue: setAppliedIds, pushValue: pushAppliedId } = useAppliedClassesIds();
|
|
476
|
+
const { id: activeId, setId: setActiveId } = useStyle();
|
|
477
|
+
const actions = useCreateActions({ pushAppliedId, setActiveId });
|
|
478
|
+
const handleApply = useHandleApply(appliedIds, setAppliedIds);
|
|
479
|
+
const applied = useAppliedOptions(options10, appliedIds);
|
|
480
|
+
const active = applied.find((option) => option.value === activeId) ?? EMPTY_OPTION;
|
|
481
|
+
return /* @__PURE__ */ React7.createElement(import_ui4.Stack, { gap: 1, p: 2 }, /* @__PURE__ */ React7.createElement(import_ui4.Stack, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React7.createElement(import_ui4.Typography, { component: "label", variant: "caption", htmlFor: ID }, (0, import_i18n3.__)("CSS Classes", "elementor")), /* @__PURE__ */ React7.createElement(import_ui4.Stack, { direction: "row", gap: 1 }, /* @__PURE__ */ React7.createElement(ClassSelectorActionsSlot, null))), /* @__PURE__ */ React7.createElement(
|
|
482
|
+
MultiCombobox,
|
|
483
|
+
{
|
|
484
|
+
id: ID,
|
|
485
|
+
size: "tiny",
|
|
486
|
+
options: options10,
|
|
487
|
+
selected: applied,
|
|
488
|
+
onSelect: handleApply,
|
|
489
|
+
limitTags: TAGS_LIMIT,
|
|
490
|
+
actions,
|
|
491
|
+
getLimitTagsText: (more) => /* @__PURE__ */ React7.createElement(import_ui4.Chip, { size: "tiny", variant: "standard", label: `+${more}`, clickable: true }),
|
|
492
|
+
renderTags: (values, getTagProps) => values.map((value, index) => {
|
|
493
|
+
const chipProps = getTagProps({ index });
|
|
494
|
+
const isActive = value.value === active?.value;
|
|
495
|
+
const isElementsProvider = value.provider === import_editor_styles_repository4.ELEMENTS_STYLES_PROVIDER_KEY;
|
|
496
|
+
const renameLabel = (newLabel) => {
|
|
497
|
+
return updateClassByProvider(value.provider, { label: newLabel, id: value.value });
|
|
498
|
+
};
|
|
499
|
+
return /* @__PURE__ */ React7.createElement(
|
|
500
|
+
CssClassItem,
|
|
501
|
+
{
|
|
502
|
+
key: chipProps.key,
|
|
503
|
+
label: value.label,
|
|
504
|
+
provider: value.provider,
|
|
505
|
+
id: value.value,
|
|
506
|
+
isActive,
|
|
507
|
+
color: isActive && value.color ? value.color : "default",
|
|
508
|
+
chipProps,
|
|
509
|
+
onClickActive: () => setActiveId(isElementsProvider ? null : value.value),
|
|
510
|
+
renameLabel
|
|
511
|
+
}
|
|
512
|
+
);
|
|
513
|
+
})
|
|
514
|
+
}
|
|
515
|
+
));
|
|
587
516
|
}
|
|
588
517
|
var updateClassByProvider = (provider, data) => {
|
|
589
|
-
const providerInstance =
|
|
518
|
+
const providerInstance = import_editor_styles_repository4.stylesRepository.getProviderByKey(provider);
|
|
590
519
|
if (!providerInstance) {
|
|
591
520
|
return;
|
|
592
521
|
}
|
|
593
522
|
return providerInstance.actions.update?.(data);
|
|
594
523
|
};
|
|
595
|
-
var VALID_SELECTOR_REGEX = /^[a-zA-Z0-9_-]+$/;
|
|
596
|
-
var renameValidation = (newLabel, options10) => {
|
|
597
|
-
if (isNameExist(newLabel, options10)) {
|
|
598
|
-
return (0, import_i18n2.__)("Existing name", "elementor");
|
|
599
|
-
}
|
|
600
|
-
if (isCharactersNotSupported(newLabel)) {
|
|
601
|
-
return (0, import_i18n2.__)("Format is not valid", "elementor");
|
|
602
|
-
}
|
|
603
|
-
};
|
|
604
|
-
var isNameExist = (newLabel, options10) => {
|
|
605
|
-
if (!options10?.length) {
|
|
606
|
-
return false;
|
|
607
|
-
}
|
|
608
|
-
return options10.some((option) => option.label.toLowerCase() === newLabel.toLowerCase());
|
|
609
|
-
};
|
|
610
|
-
var isCharactersNotSupported = (newLabel) => !VALID_SELECTOR_REGEX.test(newLabel);
|
|
611
524
|
function useOptions() {
|
|
612
525
|
const { element } = useElement();
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
return styleDefs.map((styleDef) => {
|
|
620
|
-
return {
|
|
621
|
-
label: styleDef.label,
|
|
622
|
-
value: styleDef.id,
|
|
623
|
-
fixed: isElements,
|
|
624
|
-
color: isElements ? "primary" : "global",
|
|
625
|
-
provider: provider.key,
|
|
626
|
-
group: provider.labels?.plural
|
|
627
|
-
};
|
|
628
|
-
});
|
|
526
|
+
const isProviderEditable = (provider) => !!provider.actions.updateProps;
|
|
527
|
+
return (0, import_editor_styles_repository4.useProviders)().filter(isProviderEditable).flatMap((provider) => {
|
|
528
|
+
const isElements = provider.key === import_editor_styles_repository4.ELEMENTS_STYLES_PROVIDER_KEY;
|
|
529
|
+
const styleDefs = provider.actions.get({ elementId: element.id });
|
|
530
|
+
if (isElements && styleDefs.length === 0) {
|
|
531
|
+
return [EMPTY_OPTION];
|
|
629
532
|
}
|
|
630
|
-
|
|
533
|
+
return styleDefs.map((styleDef) => {
|
|
534
|
+
return {
|
|
535
|
+
label: styleDef.label,
|
|
536
|
+
value: styleDef.id,
|
|
537
|
+
fixed: isElements,
|
|
538
|
+
color: isElements ? "primary" : "global",
|
|
539
|
+
provider: provider.key,
|
|
540
|
+
group: provider.labels?.plural
|
|
541
|
+
};
|
|
542
|
+
});
|
|
543
|
+
});
|
|
631
544
|
}
|
|
632
545
|
function useCreateActions({
|
|
633
546
|
pushAppliedId,
|
|
634
547
|
setActiveId
|
|
635
548
|
}) {
|
|
636
|
-
return (0,
|
|
549
|
+
return (0, import_editor_styles_repository4.useCreateActionsByProvider)().map(([provider, create]) => {
|
|
637
550
|
return {
|
|
638
551
|
// translators: %s is the label of the new class.
|
|
639
|
-
label: (value) => (0,
|
|
640
|
-
apply:
|
|
641
|
-
const
|
|
642
|
-
if (!
|
|
552
|
+
label: (value) => (0, import_i18n3.__)('Create new "%s"', "elementor").replace("%s", value),
|
|
553
|
+
apply: (label) => {
|
|
554
|
+
const createdId = create(label);
|
|
555
|
+
if (!createdId) {
|
|
643
556
|
return;
|
|
644
557
|
}
|
|
645
|
-
pushAppliedId(
|
|
646
|
-
setActiveId(
|
|
558
|
+
pushAppliedId(createdId);
|
|
559
|
+
setActiveId(createdId);
|
|
647
560
|
},
|
|
648
561
|
condition: (options10, inputValue) => {
|
|
649
562
|
const isUniqueLabel = !options10.some(
|
|
@@ -652,14 +565,14 @@ function useCreateActions({
|
|
|
652
565
|
return !!inputValue && isUniqueLabel;
|
|
653
566
|
},
|
|
654
567
|
// translators: %s is the singular label of css class provider (e.g "Global CSS Class").
|
|
655
|
-
group: (0,
|
|
568
|
+
group: (0, import_i18n3.__)("Create New %s", "elementor").replace("%s", provider.labels?.singular ?? "")
|
|
656
569
|
};
|
|
657
570
|
});
|
|
658
571
|
}
|
|
659
572
|
function useAppliedOptions(options10, appliedIds) {
|
|
660
573
|
const applied = options10.filter((option) => appliedIds.includes(option.value));
|
|
661
574
|
const hasElementsProviderStyleApplied = applied.some(
|
|
662
|
-
(option) => option.provider ===
|
|
575
|
+
(option) => option.provider === import_editor_styles_repository4.ELEMENTS_STYLES_PROVIDER_KEY
|
|
663
576
|
);
|
|
664
577
|
if (!hasElementsProviderStyleApplied) {
|
|
665
578
|
applied.unshift(EMPTY_OPTION);
|
|
@@ -669,9 +582,9 @@ function useAppliedOptions(options10, appliedIds) {
|
|
|
669
582
|
function useAppliedClassesIds() {
|
|
670
583
|
const { element } = useElement();
|
|
671
584
|
const currentClassesProp = useClassesProp();
|
|
672
|
-
const value = (0,
|
|
585
|
+
const value = (0, import_editor_elements2.useElementSetting)(element.id, currentClassesProp)?.value || [];
|
|
673
586
|
const setValue = (ids) => {
|
|
674
|
-
(0,
|
|
587
|
+
(0, import_editor_elements2.updateElementSettings)({
|
|
675
588
|
id: element.id,
|
|
676
589
|
props: {
|
|
677
590
|
[currentClassesProp]: import_editor_props.classesPropTypeUtil.create(ids)
|
|
@@ -679,7 +592,7 @@ function useAppliedClassesIds() {
|
|
|
679
592
|
});
|
|
680
593
|
};
|
|
681
594
|
const pushValue = (id) => {
|
|
682
|
-
const ids = (0,
|
|
595
|
+
const ids = (0, import_editor_elements2.getElementSetting)(element.id, currentClassesProp)?.value || [];
|
|
683
596
|
setValue([...ids, id]);
|
|
684
597
|
};
|
|
685
598
|
return {
|
|
@@ -713,22 +626,22 @@ function useHandleApply(appliedIds, setAppliedIds) {
|
|
|
713
626
|
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
714
627
|
|
|
715
628
|
// src/components/editing-panel.tsx
|
|
716
|
-
var
|
|
629
|
+
var React60 = __toESM(require("react"));
|
|
717
630
|
var import_editor_controls41 = require("@elementor/editor-controls");
|
|
718
|
-
var
|
|
631
|
+
var import_editor_elements7 = require("@elementor/editor-elements");
|
|
719
632
|
var import_editor_panels = require("@elementor/editor-panels");
|
|
720
|
-
var
|
|
721
|
-
var
|
|
722
|
-
var
|
|
633
|
+
var import_session4 = require("@elementor/session");
|
|
634
|
+
var import_ui50 = require("@elementor/ui");
|
|
635
|
+
var import_i18n41 = require("@wordpress/i18n");
|
|
723
636
|
|
|
724
637
|
// src/controls-actions.ts
|
|
725
|
-
var
|
|
638
|
+
var import_menus = require("@elementor/menus");
|
|
726
639
|
|
|
727
640
|
// src/popover-action.tsx
|
|
728
|
-
var
|
|
729
|
-
var
|
|
730
|
-
var
|
|
731
|
-
var
|
|
641
|
+
var React8 = __toESM(require("react"));
|
|
642
|
+
var import_react6 = require("react");
|
|
643
|
+
var import_icons2 = require("@elementor/icons");
|
|
644
|
+
var import_ui5 = require("@elementor/ui");
|
|
732
645
|
var SIZE = "tiny";
|
|
733
646
|
function PopoverAction({
|
|
734
647
|
title,
|
|
@@ -736,16 +649,16 @@ function PopoverAction({
|
|
|
736
649
|
icon: Icon,
|
|
737
650
|
popoverContent: PopoverContent
|
|
738
651
|
}) {
|
|
739
|
-
const id = (0,
|
|
740
|
-
const popupState = (0,
|
|
652
|
+
const id = (0, import_react6.useId)();
|
|
653
|
+
const popupState = (0, import_ui5.usePopupState)({
|
|
741
654
|
variant: "popover",
|
|
742
655
|
popupId: `elementor-popover-action-${id}`
|
|
743
656
|
});
|
|
744
657
|
if (!visible) {
|
|
745
658
|
return null;
|
|
746
659
|
}
|
|
747
|
-
return /* @__PURE__ */
|
|
748
|
-
|
|
660
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(import_ui5.Tooltip, { placement: "top", title }, /* @__PURE__ */ React8.createElement(import_ui5.IconButton, { "aria-label": title, key: id, size: SIZE, ...(0, import_ui5.bindToggle)(popupState) }, /* @__PURE__ */ React8.createElement(Icon, { fontSize: SIZE }))), /* @__PURE__ */ React8.createElement(
|
|
661
|
+
import_ui5.Popover,
|
|
749
662
|
{
|
|
750
663
|
disablePortal: true,
|
|
751
664
|
disableScrollLock: true,
|
|
@@ -753,47 +666,47 @@ function PopoverAction({
|
|
|
753
666
|
vertical: "bottom",
|
|
754
667
|
horizontal: "center"
|
|
755
668
|
},
|
|
756
|
-
...(0,
|
|
669
|
+
...(0, import_ui5.bindPopover)(popupState)
|
|
757
670
|
},
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
/* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ React8.createElement(import_ui5.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React8.createElement(Icon, { fontSize: SIZE, sx: { mr: 0.5 } }), /* @__PURE__ */ React8.createElement(import_ui5.Typography, { variant: "subtitle2" }, title), /* @__PURE__ */ React8.createElement(import_ui5.IconButton, { sx: { ml: "auto" }, size: SIZE, onClick: popupState.close }, /* @__PURE__ */ React8.createElement(import_icons2.XIcon, { fontSize: SIZE }))),
|
|
672
|
+
/* @__PURE__ */ React8.createElement(PopoverContent, { closePopover: popupState.close })
|
|
760
673
|
));
|
|
761
674
|
}
|
|
762
675
|
|
|
763
676
|
// src/controls-actions.ts
|
|
764
|
-
var controlActionsMenu = (0,
|
|
677
|
+
var controlActionsMenu = (0, import_menus.createMenu)({
|
|
765
678
|
components: {
|
|
766
679
|
PopoverAction
|
|
767
680
|
}
|
|
768
681
|
});
|
|
769
682
|
|
|
770
683
|
// src/components/editing-panel-error-fallback.tsx
|
|
771
|
-
var
|
|
772
|
-
var
|
|
684
|
+
var React9 = __toESM(require("react"));
|
|
685
|
+
var import_ui6 = require("@elementor/ui");
|
|
773
686
|
function EditorPanelErrorFallback() {
|
|
774
|
-
return /* @__PURE__ */
|
|
687
|
+
return /* @__PURE__ */ React9.createElement(import_ui6.Box, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React9.createElement(import_ui6.Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React9.createElement("strong", null, "Something went wrong")));
|
|
775
688
|
}
|
|
776
689
|
|
|
777
690
|
// src/components/editing-panel-tabs.tsx
|
|
778
|
-
var
|
|
779
|
-
var
|
|
780
|
-
var
|
|
781
|
-
var
|
|
691
|
+
var React59 = __toESM(require("react"));
|
|
692
|
+
var import_react14 = require("react");
|
|
693
|
+
var import_ui49 = require("@elementor/ui");
|
|
694
|
+
var import_i18n40 = require("@wordpress/i18n");
|
|
782
695
|
|
|
783
696
|
// src/components/settings-tab.tsx
|
|
784
|
-
var
|
|
697
|
+
var React15 = __toESM(require("react"));
|
|
785
698
|
var import_editor_controls4 = require("@elementor/editor-controls");
|
|
786
699
|
var import_session = require("@elementor/session");
|
|
787
700
|
|
|
788
701
|
// src/controls-registry/control.tsx
|
|
789
|
-
var
|
|
790
|
-
var import_utils = require("@elementor/utils");
|
|
702
|
+
var React10 = __toESM(require("react"));
|
|
791
703
|
|
|
792
704
|
// src/controls-registry/controls-registry.tsx
|
|
793
705
|
var import_editor_controls2 = require("@elementor/editor-controls");
|
|
794
706
|
var controlTypes = {
|
|
795
707
|
image: { component: import_editor_controls2.ImageControl, layout: "full" },
|
|
796
|
-
|
|
708
|
+
"svg-media": { component: import_editor_controls2.SvgMediaControl, layout: "full" },
|
|
709
|
+
text: { component: import_editor_controls2.TextControl, layout: "full" },
|
|
797
710
|
textarea: { component: import_editor_controls2.TextAreaControl, layout: "full" },
|
|
798
711
|
size: { component: import_editor_controls2.SizeControl, layout: "two-columns" },
|
|
799
712
|
select: { component: import_editor_controls2.SelectControl, layout: "two-columns" },
|
|
@@ -804,31 +717,27 @@ var getControlByType = (type) => controlTypes[type]?.component;
|
|
|
804
717
|
var getLayoutByType = (type) => controlTypes[type].layout;
|
|
805
718
|
|
|
806
719
|
// src/controls-registry/control.tsx
|
|
807
|
-
var ControlTypeError = (0, import_utils.createError)({
|
|
808
|
-
code: "CONTROL_TYPE_NOT_FOUND",
|
|
809
|
-
message: `Control type not found.`
|
|
810
|
-
});
|
|
811
720
|
var Control = ({ props, type }) => {
|
|
812
721
|
const ControlByType = getControlByType(type);
|
|
813
722
|
if (!ControlByType) {
|
|
814
|
-
throw new
|
|
815
|
-
context: { type }
|
|
723
|
+
throw new ControlTypeNotFoundError({
|
|
724
|
+
context: { controlType: type }
|
|
816
725
|
});
|
|
817
726
|
}
|
|
818
|
-
return /* @__PURE__ */
|
|
727
|
+
return /* @__PURE__ */ React10.createElement(ControlByType, { ...props });
|
|
819
728
|
};
|
|
820
729
|
|
|
821
730
|
// src/controls-registry/control-type-container.tsx
|
|
822
|
-
var
|
|
823
|
-
var
|
|
731
|
+
var React11 = __toESM(require("react"));
|
|
732
|
+
var import_ui7 = require("@elementor/ui");
|
|
824
733
|
var ControlTypeContainer = ({
|
|
825
734
|
controlType,
|
|
826
735
|
children
|
|
827
736
|
}) => {
|
|
828
737
|
const layout = getLayoutByType(controlType);
|
|
829
|
-
return /* @__PURE__ */
|
|
738
|
+
return /* @__PURE__ */ React11.createElement(StyledContainer, { layout }, children);
|
|
830
739
|
};
|
|
831
|
-
var StyledContainer = (0,
|
|
740
|
+
var StyledContainer = (0, import_ui7.styled)(import_ui7.Box, {
|
|
832
741
|
shouldForwardProp: (prop) => !["layout"].includes(prop)
|
|
833
742
|
})(({ layout, theme }) => ({
|
|
834
743
|
display: "grid",
|
|
@@ -844,9 +753,9 @@ var getGridLayout = (layout) => ({
|
|
|
844
753
|
});
|
|
845
754
|
|
|
846
755
|
// src/controls-registry/settings-field.tsx
|
|
847
|
-
var
|
|
756
|
+
var React12 = __toESM(require("react"));
|
|
848
757
|
var import_editor_controls3 = require("@elementor/editor-controls");
|
|
849
|
-
var
|
|
758
|
+
var import_editor_elements3 = require("@elementor/editor-elements");
|
|
850
759
|
|
|
851
760
|
// src/controls-registry/create-top-level-object-type.ts
|
|
852
761
|
var createTopLevelOjectType = ({ schema }) => {
|
|
@@ -864,27 +773,31 @@ var createTopLevelOjectType = ({ schema }) => {
|
|
|
864
773
|
// src/controls-registry/settings-field.tsx
|
|
865
774
|
var SettingsField = ({ bind, children }) => {
|
|
866
775
|
const { element, elementType } = useElement();
|
|
867
|
-
const settingsValue = (0,
|
|
776
|
+
const settingsValue = (0, import_editor_elements3.useElementSetting)(element.id, bind);
|
|
777
|
+
const linkValue = (0, import_editor_elements3.useElementSetting)(element.id, "link");
|
|
868
778
|
const value = { [bind]: settingsValue };
|
|
869
779
|
const propType = createTopLevelOjectType({ schema: elementType.propsSchema });
|
|
780
|
+
if (bind === "tag" && linkValue?.value && "div-block" === elementType.key) {
|
|
781
|
+
return null;
|
|
782
|
+
}
|
|
870
783
|
const setValue = (newValue) => {
|
|
871
|
-
(0,
|
|
784
|
+
(0, import_editor_elements3.updateElementSettings)({
|
|
872
785
|
id: element.id,
|
|
873
786
|
props: { ...newValue }
|
|
874
787
|
});
|
|
875
788
|
};
|
|
876
|
-
return /* @__PURE__ */
|
|
789
|
+
return /* @__PURE__ */ React12.createElement(import_editor_controls3.PropProvider, { propType, value, setValue }, /* @__PURE__ */ React12.createElement(import_editor_controls3.PropKeyProvider, { bind }, children));
|
|
877
790
|
};
|
|
878
791
|
|
|
879
792
|
// src/components/section.tsx
|
|
880
|
-
var
|
|
881
|
-
var
|
|
882
|
-
var
|
|
793
|
+
var React13 = __toESM(require("react"));
|
|
794
|
+
var import_react7 = require("react");
|
|
795
|
+
var import_ui9 = require("@elementor/ui");
|
|
883
796
|
|
|
884
797
|
// src/components/collapse-icon.tsx
|
|
885
|
-
var
|
|
886
|
-
var
|
|
887
|
-
var CollapseIcon = (0,
|
|
798
|
+
var import_icons3 = require("@elementor/icons");
|
|
799
|
+
var import_ui8 = require("@elementor/ui");
|
|
800
|
+
var CollapseIcon = (0, import_ui8.styled)(import_icons3.ChevronDownIcon, {
|
|
888
801
|
shouldForwardProp: (prop) => prop !== "open"
|
|
889
802
|
})(({ theme, open }) => ({
|
|
890
803
|
transform: open ? "rotate(180deg)" : "rotate(0deg)",
|
|
@@ -895,40 +808,40 @@ var CollapseIcon = (0, import_ui9.styled)(import_icons4.ChevronDownIcon, {
|
|
|
895
808
|
|
|
896
809
|
// src/components/section.tsx
|
|
897
810
|
function Section({ title, children, defaultExpanded = false }) {
|
|
898
|
-
const [isOpen, setIsOpen] = (0,
|
|
899
|
-
const id = (0,
|
|
811
|
+
const [isOpen, setIsOpen] = (0, import_react7.useState)(!!defaultExpanded);
|
|
812
|
+
const id = (0, import_react7.useId)();
|
|
900
813
|
const labelId = `label-${id}`;
|
|
901
814
|
const contentId = `content-${id}`;
|
|
902
|
-
return /* @__PURE__ */
|
|
903
|
-
|
|
815
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(
|
|
816
|
+
import_ui9.ListItemButton,
|
|
904
817
|
{
|
|
905
818
|
id: labelId,
|
|
906
819
|
"aria-controls": contentId,
|
|
907
820
|
onClick: () => setIsOpen((prev) => !prev)
|
|
908
821
|
},
|
|
909
|
-
/* @__PURE__ */
|
|
910
|
-
/* @__PURE__ */
|
|
911
|
-
), /* @__PURE__ */
|
|
822
|
+
/* @__PURE__ */ React13.createElement(import_ui9.ListItemText, { secondary: title }),
|
|
823
|
+
/* @__PURE__ */ React13.createElement(CollapseIcon, { open: isOpen, color: "secondary" })
|
|
824
|
+
), /* @__PURE__ */ React13.createElement(import_ui9.Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React13.createElement(import_ui9.Stack, { gap: 2.5, p: 2 }, children)), /* @__PURE__ */ React13.createElement(import_ui9.Divider, null));
|
|
912
825
|
}
|
|
913
826
|
|
|
914
827
|
// src/components/sections-list.tsx
|
|
915
|
-
var
|
|
916
|
-
var
|
|
828
|
+
var React14 = __toESM(require("react"));
|
|
829
|
+
var import_ui10 = require("@elementor/ui");
|
|
917
830
|
function SectionsList(props) {
|
|
918
|
-
return /* @__PURE__ */
|
|
831
|
+
return /* @__PURE__ */ React14.createElement(import_ui10.List, { disablePadding: true, component: "div", ...props });
|
|
919
832
|
}
|
|
920
833
|
|
|
921
834
|
// src/components/settings-tab.tsx
|
|
922
835
|
var SettingsTab = () => {
|
|
923
836
|
const { elementType, element } = useElement();
|
|
924
|
-
return /* @__PURE__ */
|
|
837
|
+
return /* @__PURE__ */ React15.createElement(import_session.SessionStorageProvider, { prefix: element.id }, /* @__PURE__ */ React15.createElement(SectionsList, null, elementType.controls.map(({ type, value }, index) => {
|
|
925
838
|
if (type === "control") {
|
|
926
|
-
return /* @__PURE__ */
|
|
839
|
+
return /* @__PURE__ */ React15.createElement(Control2, { key: value.bind, control: value });
|
|
927
840
|
}
|
|
928
841
|
if (type === "section") {
|
|
929
|
-
return /* @__PURE__ */
|
|
842
|
+
return /* @__PURE__ */ React15.createElement(Section, { title: value.label, key: type + "." + index, defaultExpanded: true }, value.items?.map((item) => {
|
|
930
843
|
if (item.type === "control") {
|
|
931
|
-
return /* @__PURE__ */
|
|
844
|
+
return /* @__PURE__ */ React15.createElement(Control2, { key: item.value.bind, control: item.value });
|
|
932
845
|
}
|
|
933
846
|
return null;
|
|
934
847
|
}));
|
|
@@ -940,60 +853,151 @@ var Control2 = ({ control }) => {
|
|
|
940
853
|
if (!getControlByType(control.type)) {
|
|
941
854
|
return null;
|
|
942
855
|
}
|
|
943
|
-
return /* @__PURE__ */
|
|
856
|
+
return /* @__PURE__ */ React15.createElement(SettingsField, { bind: control.bind }, /* @__PURE__ */ React15.createElement(ControlTypeContainer, { controlType: control.type }, control.label ? /* @__PURE__ */ React15.createElement(import_editor_controls4.ControlLabel, null, control.label) : null, /* @__PURE__ */ React15.createElement(Control, { type: control.type, props: control.props })));
|
|
944
857
|
};
|
|
945
858
|
|
|
946
859
|
// src/components/style-tab.tsx
|
|
947
|
-
var
|
|
948
|
-
var
|
|
949
|
-
var
|
|
860
|
+
var React58 = __toESM(require("react"));
|
|
861
|
+
var import_react13 = require("react");
|
|
862
|
+
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
950
863
|
var import_editor_responsive = require("@elementor/editor-responsive");
|
|
951
|
-
var
|
|
952
|
-
var
|
|
953
|
-
var
|
|
864
|
+
var import_session3 = require("@elementor/session");
|
|
865
|
+
var import_ui48 = require("@elementor/ui");
|
|
866
|
+
var import_i18n39 = require("@wordpress/i18n");
|
|
954
867
|
|
|
955
868
|
// src/components/style-sections/background-section/background-section.tsx
|
|
956
|
-
var
|
|
869
|
+
var React17 = __toESM(require("react"));
|
|
957
870
|
var import_editor_controls6 = require("@elementor/editor-controls");
|
|
958
871
|
|
|
959
872
|
// src/controls-registry/styles-field.tsx
|
|
960
|
-
var
|
|
873
|
+
var React16 = __toESM(require("react"));
|
|
961
874
|
var import_editor_controls5 = require("@elementor/editor-controls");
|
|
962
|
-
var
|
|
875
|
+
var import_editor_styles2 = require("@elementor/editor-styles");
|
|
963
876
|
|
|
964
877
|
// src/hooks/use-styles-fields.ts
|
|
965
|
-
var
|
|
966
|
-
var
|
|
878
|
+
var import_react8 = require("react");
|
|
879
|
+
var import_editor_elements4 = require("@elementor/editor-elements");
|
|
880
|
+
var import_editor_styles = require("@elementor/editor-styles");
|
|
881
|
+
var import_editor_styles_repository5 = require("@elementor/editor-styles-repository");
|
|
882
|
+
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
883
|
+
var import_i18n4 = require("@wordpress/i18n");
|
|
967
884
|
function useStylesFields(propNames) {
|
|
968
885
|
const { element } = useElement();
|
|
969
|
-
const { id, meta } = useStyle();
|
|
886
|
+
const { id, meta, provider } = useStyle();
|
|
970
887
|
const classesProp = useClassesProp();
|
|
971
|
-
const
|
|
972
|
-
|
|
973
|
-
|
|
888
|
+
const undoableUpdateStyle = useUndoableUpdateStyle();
|
|
889
|
+
const undoableCreateElementStyle = useUndoableCreateElementStyle();
|
|
890
|
+
const [, reRender] = (0, import_react8.useReducer)((p) => !p, false);
|
|
891
|
+
(0, import_react8.useEffect)(() => provider?.subscribe(reRender), [provider]);
|
|
892
|
+
const value = getProps({
|
|
893
|
+
elementId: element.id,
|
|
894
|
+
styleId: id,
|
|
895
|
+
provider,
|
|
974
896
|
meta,
|
|
975
897
|
propNames
|
|
976
898
|
});
|
|
977
899
|
const setValue = (props) => {
|
|
978
900
|
if (id === null) {
|
|
979
|
-
(
|
|
901
|
+
undoableCreateElementStyle({
|
|
980
902
|
elementId: element.id,
|
|
981
903
|
classesProp,
|
|
982
904
|
meta,
|
|
983
|
-
props
|
|
984
|
-
label: (0, import_i18n3.__)("local", "elementor")
|
|
905
|
+
props
|
|
985
906
|
});
|
|
986
907
|
return;
|
|
987
908
|
}
|
|
988
|
-
(
|
|
909
|
+
undoableUpdateStyle({
|
|
989
910
|
elementId: element.id,
|
|
990
911
|
styleId: id,
|
|
991
|
-
|
|
992
|
-
meta
|
|
912
|
+
provider,
|
|
913
|
+
meta,
|
|
914
|
+
props
|
|
993
915
|
});
|
|
994
916
|
};
|
|
995
917
|
return [value, setValue];
|
|
996
918
|
}
|
|
919
|
+
function getProps({ styleId, elementId, provider, meta, propNames }) {
|
|
920
|
+
if (!provider || !styleId) {
|
|
921
|
+
return null;
|
|
922
|
+
}
|
|
923
|
+
const style = provider.actions.getById?.(styleId, { elementId });
|
|
924
|
+
if (!style) {
|
|
925
|
+
throw new StyleNotFoundUnderProviderError({ context: { styleId, providerKey: provider.key } });
|
|
926
|
+
}
|
|
927
|
+
const variant = (0, import_editor_styles.getVariantByMeta)(style, meta);
|
|
928
|
+
return Object.fromEntries(
|
|
929
|
+
propNames.map((key) => [key, variant?.props[key] ?? null])
|
|
930
|
+
);
|
|
931
|
+
}
|
|
932
|
+
function useUndoableCreateElementStyle() {
|
|
933
|
+
return (0, import_react8.useMemo)(() => {
|
|
934
|
+
return (0, import_editor_v1_adapters.undoable)(
|
|
935
|
+
{
|
|
936
|
+
do: (payload) => {
|
|
937
|
+
return (0, import_editor_elements4.createElementStyle)({
|
|
938
|
+
...payload,
|
|
939
|
+
label: import_editor_styles_repository5.LOCAL_STYLES_RESERVED_LABEL
|
|
940
|
+
});
|
|
941
|
+
},
|
|
942
|
+
undo: ({ elementId }, styleId) => {
|
|
943
|
+
(0, import_editor_elements4.deleteElementStyle)(elementId, styleId);
|
|
944
|
+
},
|
|
945
|
+
redo: (payload, styleId) => {
|
|
946
|
+
return (0, import_editor_elements4.createElementStyle)({
|
|
947
|
+
...payload,
|
|
948
|
+
styleId,
|
|
949
|
+
label: import_editor_styles_repository5.LOCAL_STYLES_RESERVED_LABEL
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
title: ({ elementId }) => (0, import_editor_elements4.getElementLabel)(elementId),
|
|
955
|
+
subtitle: (0, import_i18n4.__)("Style edited", "elementor")
|
|
956
|
+
}
|
|
957
|
+
);
|
|
958
|
+
}, []);
|
|
959
|
+
}
|
|
960
|
+
function useUndoableUpdateStyle() {
|
|
961
|
+
return (0, import_react8.useMemo)(() => {
|
|
962
|
+
return (0, import_editor_v1_adapters.undoable)(
|
|
963
|
+
{
|
|
964
|
+
do: ({ elementId, styleId, provider, meta, props }) => {
|
|
965
|
+
if (!provider.actions.updateProps) {
|
|
966
|
+
throw new StylesProviderCannotUpdatePropsError({
|
|
967
|
+
context: { providerKey: provider.key }
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
const style = provider.actions.getById(styleId, { elementId });
|
|
971
|
+
const prevProps = getCurrentProps(style, meta);
|
|
972
|
+
provider.actions.updateProps(
|
|
973
|
+
{
|
|
974
|
+
id: styleId,
|
|
975
|
+
meta,
|
|
976
|
+
props
|
|
977
|
+
},
|
|
978
|
+
{ elementId }
|
|
979
|
+
);
|
|
980
|
+
return prevProps;
|
|
981
|
+
},
|
|
982
|
+
undo: ({ elementId, styleId, meta, provider }, prevProps) => {
|
|
983
|
+
provider.actions.updateProps?.({ id: styleId, meta, props: prevProps }, { elementId });
|
|
984
|
+
}
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
title: ({ elementId }) => (0, import_editor_elements4.getElementLabel)(elementId),
|
|
988
|
+
subtitle: (0, import_i18n4.__)("Style edited", "elementor")
|
|
989
|
+
}
|
|
990
|
+
);
|
|
991
|
+
}, []);
|
|
992
|
+
}
|
|
993
|
+
function getCurrentProps(style, meta) {
|
|
994
|
+
if (!style) {
|
|
995
|
+
return {};
|
|
996
|
+
}
|
|
997
|
+
const variant = (0, import_editor_styles.getVariantByMeta)(style, meta);
|
|
998
|
+
const props = variant?.props ?? {};
|
|
999
|
+
return structuredClone(props);
|
|
1000
|
+
}
|
|
997
1001
|
|
|
998
1002
|
// src/hooks/use-styles-field.ts
|
|
999
1003
|
function useStylesField(propName) {
|
|
@@ -1010,37 +1014,37 @@ function useStylesField(propName) {
|
|
|
1010
1014
|
// src/controls-registry/styles-field.tsx
|
|
1011
1015
|
var StylesField = ({ bind, children }) => {
|
|
1012
1016
|
const [value, setValue] = useStylesField(bind);
|
|
1013
|
-
const stylesSchema = (0,
|
|
1017
|
+
const stylesSchema = (0, import_editor_styles2.getStylesSchema)();
|
|
1014
1018
|
const propType = createTopLevelOjectType({ schema: stylesSchema });
|
|
1015
1019
|
const values = { [bind]: value };
|
|
1016
1020
|
const setValues = (newValue) => {
|
|
1017
1021
|
setValue(newValue[bind]);
|
|
1018
1022
|
};
|
|
1019
|
-
return /* @__PURE__ */
|
|
1023
|
+
return /* @__PURE__ */ React16.createElement(import_editor_controls5.PropProvider, { propType, value: values, setValue: setValues }, /* @__PURE__ */ React16.createElement(import_editor_controls5.PropKeyProvider, { bind }, children));
|
|
1020
1024
|
};
|
|
1021
1025
|
|
|
1022
1026
|
// src/components/style-sections/background-section/background-section.tsx
|
|
1023
1027
|
var BackgroundSection = () => {
|
|
1024
|
-
return /* @__PURE__ */
|
|
1028
|
+
return /* @__PURE__ */ React17.createElement(StylesField, { bind: "background" }, /* @__PURE__ */ React17.createElement(import_editor_controls6.BackgroundControl, null));
|
|
1025
1029
|
};
|
|
1026
1030
|
|
|
1027
1031
|
// src/components/style-sections/border-section/border-section.tsx
|
|
1028
|
-
var
|
|
1029
|
-
var
|
|
1032
|
+
var React24 = __toESM(require("react"));
|
|
1033
|
+
var import_ui14 = require("@elementor/ui");
|
|
1030
1034
|
|
|
1031
1035
|
// src/components/style-sections/border-section/border-field.tsx
|
|
1032
|
-
var
|
|
1033
|
-
var
|
|
1036
|
+
var React22 = __toESM(require("react"));
|
|
1037
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
1034
1038
|
|
|
1035
1039
|
// src/components/add-or-remove-content.tsx
|
|
1036
|
-
var
|
|
1040
|
+
var React18 = __toESM(require("react"));
|
|
1037
1041
|
var import_editor_controls7 = require("@elementor/editor-controls");
|
|
1038
|
-
var
|
|
1039
|
-
var
|
|
1042
|
+
var import_icons4 = require("@elementor/icons");
|
|
1043
|
+
var import_ui11 = require("@elementor/ui");
|
|
1040
1044
|
var SIZE2 = "tiny";
|
|
1041
1045
|
var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
1042
|
-
return /* @__PURE__ */
|
|
1043
|
-
|
|
1046
|
+
return /* @__PURE__ */ React18.createElement(import_ui11.Stack, { gap: 1.5 }, /* @__PURE__ */ React18.createElement(
|
|
1047
|
+
import_ui11.Stack,
|
|
1044
1048
|
{
|
|
1045
1049
|
direction: "row",
|
|
1046
1050
|
sx: {
|
|
@@ -1048,75 +1052,75 @@ var AddOrRemoveContent = ({ isAdded, label, onAdd, onRemove, children }) => {
|
|
|
1048
1052
|
alignItems: "center"
|
|
1049
1053
|
}
|
|
1050
1054
|
},
|
|
1051
|
-
/* @__PURE__ */
|
|
1052
|
-
isAdded ? /* @__PURE__ */
|
|
1053
|
-
), /* @__PURE__ */
|
|
1055
|
+
/* @__PURE__ */ React18.createElement(import_editor_controls7.ControlLabel, null, label),
|
|
1056
|
+
isAdded ? /* @__PURE__ */ React18.createElement(import_ui11.IconButton, { size: SIZE2, onClick: onRemove, "aria-label": "Remove" }, /* @__PURE__ */ React18.createElement(import_icons4.MinusIcon, { fontSize: SIZE2 })) : /* @__PURE__ */ React18.createElement(import_ui11.IconButton, { size: SIZE2, onClick: onAdd, "aria-label": "Add" }, /* @__PURE__ */ React18.createElement(import_icons4.PlusIcon, { fontSize: SIZE2 }))
|
|
1057
|
+
), /* @__PURE__ */ React18.createElement(import_ui11.Collapse, { in: isAdded, unmountOnExit: true }, /* @__PURE__ */ React18.createElement(import_ui11.Stack, { gap: 1.5 }, children)));
|
|
1054
1058
|
};
|
|
1055
1059
|
|
|
1056
1060
|
// src/components/style-sections/border-section/border-color-field.tsx
|
|
1057
|
-
var
|
|
1061
|
+
var React19 = __toESM(require("react"));
|
|
1058
1062
|
var import_editor_controls8 = require("@elementor/editor-controls");
|
|
1059
|
-
var
|
|
1060
|
-
var
|
|
1063
|
+
var import_ui12 = require("@elementor/ui");
|
|
1064
|
+
var import_i18n5 = require("@wordpress/i18n");
|
|
1061
1065
|
var BorderColorField = () => {
|
|
1062
|
-
return /* @__PURE__ */
|
|
1066
|
+
return /* @__PURE__ */ React19.createElement(StylesField, { bind: "border-color" }, /* @__PURE__ */ React19.createElement(import_ui12.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React19.createElement(import_ui12.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(import_editor_controls8.ControlLabel, null, (0, import_i18n5.__)("Border Color", "elementor"))), /* @__PURE__ */ React19.createElement(import_ui12.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(import_editor_controls8.ColorControl, null))));
|
|
1063
1067
|
};
|
|
1064
1068
|
|
|
1065
1069
|
// src/components/style-sections/border-section/border-style-field.tsx
|
|
1066
|
-
var
|
|
1070
|
+
var React20 = __toESM(require("react"));
|
|
1067
1071
|
var import_editor_controls9 = require("@elementor/editor-controls");
|
|
1068
|
-
var
|
|
1069
|
-
var
|
|
1072
|
+
var import_ui13 = require("@elementor/ui");
|
|
1073
|
+
var import_i18n6 = require("@wordpress/i18n");
|
|
1070
1074
|
var borderStyles = [
|
|
1071
|
-
{ value: "none", label: (0,
|
|
1072
|
-
{ value: "solid", label: (0,
|
|
1073
|
-
{ value: "dashed", label: (0,
|
|
1074
|
-
{ value: "dotted", label: (0,
|
|
1075
|
-
{ value: "double", label: (0,
|
|
1076
|
-
{ value: "groove", label: (0,
|
|
1077
|
-
{ value: "ridge", label: (0,
|
|
1078
|
-
{ value: "inset", label: (0,
|
|
1079
|
-
{ value: "outset", label: (0,
|
|
1075
|
+
{ value: "none", label: (0, import_i18n6.__)("None", "elementor") },
|
|
1076
|
+
{ value: "solid", label: (0, import_i18n6.__)("Solid", "elementor") },
|
|
1077
|
+
{ value: "dashed", label: (0, import_i18n6.__)("Dashed", "elementor") },
|
|
1078
|
+
{ value: "dotted", label: (0, import_i18n6.__)("Dotted", "elementor") },
|
|
1079
|
+
{ value: "double", label: (0, import_i18n6.__)("Double", "elementor") },
|
|
1080
|
+
{ value: "groove", label: (0, import_i18n6.__)("Groove", "elementor") },
|
|
1081
|
+
{ value: "ridge", label: (0, import_i18n6.__)("Ridge", "elementor") },
|
|
1082
|
+
{ value: "inset", label: (0, import_i18n6.__)("Inset", "elementor") },
|
|
1083
|
+
{ value: "outset", label: (0, import_i18n6.__)("Outset", "elementor") }
|
|
1080
1084
|
];
|
|
1081
1085
|
var BorderStyleField = () => {
|
|
1082
|
-
return /* @__PURE__ */
|
|
1086
|
+
return /* @__PURE__ */ React20.createElement(StylesField, { bind: "border-style" }, /* @__PURE__ */ React20.createElement(import_ui13.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React20.createElement(import_ui13.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React20.createElement(import_editor_controls9.ControlLabel, null, (0, import_i18n6.__)("Border Type", "elementor"))), /* @__PURE__ */ React20.createElement(import_ui13.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React20.createElement(import_editor_controls9.SelectControl, { options: borderStyles }))));
|
|
1083
1087
|
};
|
|
1084
1088
|
|
|
1085
1089
|
// src/components/style-sections/border-section/border-width-field.tsx
|
|
1086
|
-
var
|
|
1090
|
+
var React21 = __toESM(require("react"));
|
|
1087
1091
|
var import_editor_controls10 = require("@elementor/editor-controls");
|
|
1088
1092
|
var import_editor_props2 = require("@elementor/editor-props");
|
|
1089
|
-
var
|
|
1090
|
-
var
|
|
1093
|
+
var import_icons5 = require("@elementor/icons");
|
|
1094
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
1091
1095
|
var edges = [
|
|
1092
1096
|
{
|
|
1093
|
-
label: (0,
|
|
1094
|
-
icon: /* @__PURE__ */
|
|
1097
|
+
label: (0, import_i18n7.__)("Top", "elementor"),
|
|
1098
|
+
icon: /* @__PURE__ */ React21.createElement(import_icons5.SideTopIcon, { fontSize: "tiny" }),
|
|
1095
1099
|
bind: "top"
|
|
1096
1100
|
},
|
|
1097
1101
|
{
|
|
1098
|
-
label: (0,
|
|
1099
|
-
icon: /* @__PURE__ */
|
|
1102
|
+
label: (0, import_i18n7.__)("Right", "elementor"),
|
|
1103
|
+
icon: /* @__PURE__ */ React21.createElement(import_icons5.SideRightIcon, { fontSize: "tiny" }),
|
|
1100
1104
|
bind: "right"
|
|
1101
1105
|
},
|
|
1102
1106
|
{
|
|
1103
|
-
label: (0,
|
|
1104
|
-
icon: /* @__PURE__ */
|
|
1107
|
+
label: (0, import_i18n7.__)("Bottom", "elementor"),
|
|
1108
|
+
icon: /* @__PURE__ */ React21.createElement(import_icons5.SideBottomIcon, { fontSize: "tiny" }),
|
|
1105
1109
|
bind: "bottom"
|
|
1106
1110
|
},
|
|
1107
1111
|
{
|
|
1108
|
-
label: (0,
|
|
1109
|
-
icon: /* @__PURE__ */
|
|
1112
|
+
label: (0, import_i18n7.__)("Left", "elementor"),
|
|
1113
|
+
icon: /* @__PURE__ */ React21.createElement(import_icons5.SideLeftIcon, { fontSize: "tiny" }),
|
|
1110
1114
|
bind: "left"
|
|
1111
1115
|
}
|
|
1112
1116
|
];
|
|
1113
1117
|
var BorderWidthField = () => {
|
|
1114
|
-
return /* @__PURE__ */
|
|
1118
|
+
return /* @__PURE__ */ React21.createElement(StylesField, { bind: "border-width" }, /* @__PURE__ */ React21.createElement(
|
|
1115
1119
|
import_editor_controls10.EqualUnequalSizesControl,
|
|
1116
1120
|
{
|
|
1117
1121
|
items: edges,
|
|
1118
|
-
label: (0,
|
|
1119
|
-
icon: /* @__PURE__ */
|
|
1122
|
+
label: (0, import_i18n7.__)("Border Width", "elementor"),
|
|
1123
|
+
icon: /* @__PURE__ */ React21.createElement(import_icons5.SideAllIcon, { fontSize: "tiny" }),
|
|
1120
1124
|
multiSizePropTypeUtil: import_editor_props2.borderWidthPropTypeUtil
|
|
1121
1125
|
}
|
|
1122
1126
|
));
|
|
@@ -1141,87 +1145,87 @@ var BorderField = () => {
|
|
|
1141
1145
|
});
|
|
1142
1146
|
};
|
|
1143
1147
|
const hasBorder = Object.values(border ?? {}).some(Boolean);
|
|
1144
|
-
return /* @__PURE__ */
|
|
1148
|
+
return /* @__PURE__ */ React22.createElement(
|
|
1145
1149
|
AddOrRemoveContent,
|
|
1146
1150
|
{
|
|
1147
|
-
label: (0,
|
|
1151
|
+
label: (0, import_i18n8.__)("Border", "elementor"),
|
|
1148
1152
|
isAdded: hasBorder,
|
|
1149
1153
|
onAdd: addBorder,
|
|
1150
1154
|
onRemove: removeBorder
|
|
1151
1155
|
},
|
|
1152
|
-
/* @__PURE__ */
|
|
1153
|
-
/* @__PURE__ */
|
|
1154
|
-
/* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ React22.createElement(BorderWidthField, null),
|
|
1157
|
+
/* @__PURE__ */ React22.createElement(BorderColorField, null),
|
|
1158
|
+
/* @__PURE__ */ React22.createElement(BorderStyleField, null)
|
|
1155
1159
|
);
|
|
1156
1160
|
};
|
|
1157
1161
|
|
|
1158
1162
|
// src/components/style-sections/border-section/border-radius-field.tsx
|
|
1159
|
-
var
|
|
1163
|
+
var React23 = __toESM(require("react"));
|
|
1160
1164
|
var import_editor_controls11 = require("@elementor/editor-controls");
|
|
1161
1165
|
var import_editor_props3 = require("@elementor/editor-props");
|
|
1162
|
-
var
|
|
1163
|
-
var
|
|
1166
|
+
var import_icons6 = require("@elementor/icons");
|
|
1167
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
1164
1168
|
var corners = [
|
|
1165
1169
|
{
|
|
1166
|
-
label: (0,
|
|
1167
|
-
icon: /* @__PURE__ */
|
|
1170
|
+
label: (0, import_i18n9.__)("Top Left", "elementor"),
|
|
1171
|
+
icon: /* @__PURE__ */ React23.createElement(import_icons6.RadiusTopLeftIcon, { fontSize: "tiny" }),
|
|
1168
1172
|
bind: "top-left"
|
|
1169
1173
|
},
|
|
1170
1174
|
{
|
|
1171
|
-
label: (0,
|
|
1172
|
-
icon: /* @__PURE__ */
|
|
1175
|
+
label: (0, import_i18n9.__)("Top Right", "elementor"),
|
|
1176
|
+
icon: /* @__PURE__ */ React23.createElement(import_icons6.RadiusTopRightIcon, { fontSize: "tiny" }),
|
|
1173
1177
|
bind: "top-right"
|
|
1174
1178
|
},
|
|
1175
1179
|
{
|
|
1176
|
-
label: (0,
|
|
1177
|
-
icon: /* @__PURE__ */
|
|
1180
|
+
label: (0, import_i18n9.__)("Bottom Right", "elementor"),
|
|
1181
|
+
icon: /* @__PURE__ */ React23.createElement(import_icons6.RadiusBottomRightIcon, { fontSize: "tiny" }),
|
|
1178
1182
|
bind: "bottom-right"
|
|
1179
1183
|
},
|
|
1180
1184
|
{
|
|
1181
|
-
label: (0,
|
|
1182
|
-
icon: /* @__PURE__ */
|
|
1185
|
+
label: (0, import_i18n9.__)("Bottom Left", "elementor"),
|
|
1186
|
+
icon: /* @__PURE__ */ React23.createElement(import_icons6.RadiusBottomLeftIcon, { fontSize: "tiny" }),
|
|
1183
1187
|
bind: "bottom-left"
|
|
1184
1188
|
}
|
|
1185
1189
|
];
|
|
1186
1190
|
var BorderRadiusField = () => {
|
|
1187
|
-
return /* @__PURE__ */
|
|
1191
|
+
return /* @__PURE__ */ React23.createElement(StylesField, { bind: "border-radius" }, /* @__PURE__ */ React23.createElement(
|
|
1188
1192
|
import_editor_controls11.EqualUnequalSizesControl,
|
|
1189
1193
|
{
|
|
1190
1194
|
items: corners,
|
|
1191
|
-
label: (0,
|
|
1192
|
-
icon: /* @__PURE__ */
|
|
1195
|
+
label: (0, import_i18n9.__)("Border Radius", "elementor"),
|
|
1196
|
+
icon: /* @__PURE__ */ React23.createElement(import_icons6.BorderCornersIcon, { fontSize: "tiny" }),
|
|
1193
1197
|
multiSizePropTypeUtil: import_editor_props3.borderRadiusPropTypeUtil
|
|
1194
1198
|
}
|
|
1195
1199
|
));
|
|
1196
1200
|
};
|
|
1197
1201
|
|
|
1198
1202
|
// src/components/style-sections/border-section/border-section.tsx
|
|
1199
|
-
var BorderSection = () => /* @__PURE__ */
|
|
1203
|
+
var BorderSection = () => /* @__PURE__ */ React24.createElement(import_ui14.Stack, { gap: 1.5 }, /* @__PURE__ */ React24.createElement(BorderRadiusField, null), /* @__PURE__ */ React24.createElement(import_ui14.Divider, null), /* @__PURE__ */ React24.createElement(BorderField, null));
|
|
1200
1204
|
|
|
1201
1205
|
// src/components/style-sections/effects-section/effects-section.tsx
|
|
1202
|
-
var
|
|
1206
|
+
var React25 = __toESM(require("react"));
|
|
1203
1207
|
var import_editor_controls12 = require("@elementor/editor-controls");
|
|
1204
|
-
var
|
|
1208
|
+
var import_ui15 = require("@elementor/ui");
|
|
1205
1209
|
var EffectsSection = () => {
|
|
1206
|
-
return /* @__PURE__ */
|
|
1210
|
+
return /* @__PURE__ */ React25.createElement(import_ui15.Stack, { gap: 1.5 }, /* @__PURE__ */ React25.createElement(StylesField, { bind: "box-shadow" }, /* @__PURE__ */ React25.createElement(import_editor_controls12.BoxShadowRepeaterControl, null)));
|
|
1207
1211
|
};
|
|
1208
1212
|
|
|
1209
1213
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
1210
|
-
var
|
|
1214
|
+
var React36 = __toESM(require("react"));
|
|
1211
1215
|
var import_editor_controls22 = require("@elementor/editor-controls");
|
|
1212
|
-
var
|
|
1213
|
-
var
|
|
1214
|
-
var
|
|
1216
|
+
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
1217
|
+
var import_ui27 = require("@elementor/ui");
|
|
1218
|
+
var import_i18n19 = require("@wordpress/i18n");
|
|
1215
1219
|
|
|
1216
1220
|
// src/hooks/use-computed-style.ts
|
|
1217
|
-
var
|
|
1221
|
+
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
1218
1222
|
function useComputedStyle(elementId) {
|
|
1219
|
-
return (0,
|
|
1223
|
+
return (0, import_editor_v1_adapters2.__privateUseListenTo)(
|
|
1220
1224
|
[
|
|
1221
|
-
(0,
|
|
1222
|
-
(0,
|
|
1223
|
-
(0,
|
|
1224
|
-
(0,
|
|
1225
|
+
(0, import_editor_v1_adapters2.windowEvent)("elementor/device-mode/change"),
|
|
1226
|
+
(0, import_editor_v1_adapters2.commandEndEvent)("document/elements/reset-style"),
|
|
1227
|
+
(0, import_editor_v1_adapters2.commandEndEvent)("document/elements/settings"),
|
|
1228
|
+
(0, import_editor_v1_adapters2.commandEndEvent)("document/elements/paste-style")
|
|
1225
1229
|
],
|
|
1226
1230
|
() => {
|
|
1227
1231
|
if (!elementId) {
|
|
@@ -1239,24 +1243,24 @@ function useComputedStyle(elementId) {
|
|
|
1239
1243
|
}
|
|
1240
1244
|
|
|
1241
1245
|
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
1242
|
-
var
|
|
1246
|
+
var React27 = __toESM(require("react"));
|
|
1243
1247
|
var import_editor_controls13 = require("@elementor/editor-controls");
|
|
1244
|
-
var
|
|
1245
|
-
var
|
|
1246
|
-
var
|
|
1248
|
+
var import_icons7 = require("@elementor/icons");
|
|
1249
|
+
var import_ui18 = require("@elementor/ui");
|
|
1250
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
1247
1251
|
|
|
1248
1252
|
// src/hooks/use-direction.ts
|
|
1249
|
-
var
|
|
1253
|
+
var import_ui16 = require("@elementor/ui");
|
|
1250
1254
|
function useDirection() {
|
|
1251
|
-
const theme = (0,
|
|
1255
|
+
const theme = (0, import_ui16.useTheme)(), extendedWindow = window;
|
|
1252
1256
|
const isUiRtl = "rtl" === theme.direction, isSiteRtl = !!extendedWindow.elementorFrontend?.config?.is_rtl;
|
|
1253
1257
|
return { isSiteRtl, isUiRtl };
|
|
1254
1258
|
}
|
|
1255
1259
|
|
|
1256
1260
|
// src/components/style-sections/layout-section/utils/rotated-icon.tsx
|
|
1257
|
-
var
|
|
1258
|
-
var
|
|
1259
|
-
var
|
|
1261
|
+
var React26 = __toESM(require("react"));
|
|
1262
|
+
var import_react9 = require("react");
|
|
1263
|
+
var import_ui17 = require("@elementor/ui");
|
|
1260
1264
|
var CLOCKWISE_ANGLES = {
|
|
1261
1265
|
row: 0,
|
|
1262
1266
|
column: 90,
|
|
@@ -1270,13 +1274,13 @@ var COUNTER_CLOCKWISE_ANGLES = {
|
|
|
1270
1274
|
"column-reverse": -270
|
|
1271
1275
|
};
|
|
1272
1276
|
var RotatedIcon = ({ icon: Icon, size, isClockwise = true, offset = 0 }) => {
|
|
1273
|
-
const rotate = (0,
|
|
1277
|
+
const rotate = (0, import_react9.useRef)(useGetTargetAngle(isClockwise, offset));
|
|
1274
1278
|
rotate.current = useGetTargetAngle(isClockwise, offset, rotate);
|
|
1275
|
-
return /* @__PURE__ */
|
|
1279
|
+
return /* @__PURE__ */ React26.createElement(Icon, { fontSize: size, sx: { transition: ".3s", rotate: `${rotate.current}deg` } });
|
|
1276
1280
|
};
|
|
1277
1281
|
var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
1278
1282
|
const [direction] = useStylesField("flex-direction");
|
|
1279
|
-
const isRtl = "rtl" === (0,
|
|
1283
|
+
const isRtl = "rtl" === (0, import_ui17.useTheme)().direction;
|
|
1280
1284
|
const rotationMultiplier = isRtl ? -1 : 1;
|
|
1281
1285
|
const angleMap = isClockwise ? CLOCKWISE_ANGLES : COUNTER_CLOCKWISE_ANGLES;
|
|
1282
1286
|
const currentAngle = existingRef ? existingRef.current * rotationMultiplier : angleMap[direction?.value || "row"] + offset;
|
|
@@ -1287,8 +1291,8 @@ var useGetTargetAngle = (isClockwise, offset, existingRef) => {
|
|
|
1287
1291
|
};
|
|
1288
1292
|
|
|
1289
1293
|
// src/components/style-sections/layout-section/align-items-field.tsx
|
|
1290
|
-
var StartIcon = (0,
|
|
1291
|
-
var EndIcon = (0,
|
|
1294
|
+
var StartIcon = (0, import_ui18.withDirection)(import_icons7.LayoutAlignLeftIcon);
|
|
1295
|
+
var EndIcon = (0, import_ui18.withDirection)(import_icons7.LayoutAlignRightIcon);
|
|
1292
1296
|
var iconProps = {
|
|
1293
1297
|
isClockwise: false,
|
|
1294
1298
|
offset: 90
|
|
@@ -1296,42 +1300,42 @@ var iconProps = {
|
|
|
1296
1300
|
var options = [
|
|
1297
1301
|
{
|
|
1298
1302
|
value: "start",
|
|
1299
|
-
label: (0,
|
|
1300
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1303
|
+
label: (0, import_i18n10.__)("Start", "elementor"),
|
|
1304
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: StartIcon, size, ...iconProps }),
|
|
1301
1305
|
showTooltip: true
|
|
1302
1306
|
},
|
|
1303
1307
|
{
|
|
1304
1308
|
value: "center",
|
|
1305
|
-
label: (0,
|
|
1306
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1309
|
+
label: (0, import_i18n10.__)("Center", "elementor"),
|
|
1310
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: import_icons7.LayoutAlignCenterIcon, size, ...iconProps }),
|
|
1307
1311
|
showTooltip: true
|
|
1308
1312
|
},
|
|
1309
1313
|
{
|
|
1310
1314
|
value: "end",
|
|
1311
|
-
label: (0,
|
|
1312
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1315
|
+
label: (0, import_i18n10.__)("End", "elementor"),
|
|
1316
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: EndIcon, size, ...iconProps }),
|
|
1313
1317
|
showTooltip: true
|
|
1314
1318
|
},
|
|
1315
1319
|
{
|
|
1316
1320
|
value: "stretch",
|
|
1317
|
-
label: (0,
|
|
1318
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1321
|
+
label: (0, import_i18n10.__)("Stretch", "elementor"),
|
|
1322
|
+
renderContent: ({ size }) => /* @__PURE__ */ React27.createElement(RotatedIcon, { icon: import_icons7.LayoutDistributeVerticalIcon, size, ...iconProps }),
|
|
1319
1323
|
showTooltip: true
|
|
1320
1324
|
}
|
|
1321
1325
|
];
|
|
1322
1326
|
var AlignItemsField = () => {
|
|
1323
1327
|
const { isSiteRtl } = useDirection();
|
|
1324
|
-
return /* @__PURE__ */
|
|
1328
|
+
return /* @__PURE__ */ React27.createElement(import_ui18.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React27.createElement(import_ui18.ThemeProvider, null, /* @__PURE__ */ React27.createElement(StylesField, { bind: "align-items" }, /* @__PURE__ */ React27.createElement(import_ui18.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(import_ui18.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React27.createElement(import_editor_controls13.ControlLabel, null, (0, import_i18n10.__)("Align items", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui18.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React27.createElement(import_editor_controls13.ToggleControl, { options }))))));
|
|
1325
1329
|
};
|
|
1326
1330
|
|
|
1327
1331
|
// src/components/style-sections/layout-section/align-self-child-field.tsx
|
|
1328
|
-
var
|
|
1332
|
+
var React28 = __toESM(require("react"));
|
|
1329
1333
|
var import_editor_controls14 = require("@elementor/editor-controls");
|
|
1330
|
-
var
|
|
1331
|
-
var
|
|
1332
|
-
var
|
|
1333
|
-
var StartIcon2 = (0,
|
|
1334
|
-
var EndIcon2 = (0,
|
|
1334
|
+
var import_icons8 = require("@elementor/icons");
|
|
1335
|
+
var import_ui19 = require("@elementor/ui");
|
|
1336
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
1337
|
+
var StartIcon2 = (0, import_ui19.withDirection)(import_icons8.LayoutAlignLeftIcon);
|
|
1338
|
+
var EndIcon2 = (0, import_ui19.withDirection)(import_icons8.LayoutAlignRightIcon);
|
|
1335
1339
|
var iconProps2 = {
|
|
1336
1340
|
isClockwise: false,
|
|
1337
1341
|
offset: 90
|
|
@@ -1339,105 +1343,113 @@ var iconProps2 = {
|
|
|
1339
1343
|
var options2 = [
|
|
1340
1344
|
{
|
|
1341
1345
|
value: "start",
|
|
1342
|
-
label: (0,
|
|
1343
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1346
|
+
label: (0, import_i18n11.__)("Start", "elementor"),
|
|
1347
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: StartIcon2, size, ...iconProps2 }),
|
|
1344
1348
|
showTooltip: true
|
|
1345
1349
|
},
|
|
1346
1350
|
{
|
|
1347
1351
|
value: "center",
|
|
1348
|
-
label: (0,
|
|
1349
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1352
|
+
label: (0, import_i18n11.__)("Center", "elementor"),
|
|
1353
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: import_icons8.LayoutAlignCenterIcon, size, ...iconProps2 }),
|
|
1350
1354
|
showTooltip: true
|
|
1351
1355
|
},
|
|
1352
1356
|
{
|
|
1353
1357
|
value: "end",
|
|
1354
|
-
label: (0,
|
|
1355
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1358
|
+
label: (0, import_i18n11.__)("End", "elementor"),
|
|
1359
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: EndIcon2, size, ...iconProps2 }),
|
|
1356
1360
|
showTooltip: true
|
|
1357
1361
|
},
|
|
1358
1362
|
{
|
|
1359
1363
|
value: "stretch",
|
|
1360
|
-
label: (0,
|
|
1361
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1364
|
+
label: (0, import_i18n11.__)("Stretch", "elementor"),
|
|
1365
|
+
renderContent: ({ size }) => /* @__PURE__ */ React28.createElement(RotatedIcon, { icon: import_icons8.LayoutDistributeVerticalIcon, size, ...iconProps2 }),
|
|
1362
1366
|
showTooltip: true
|
|
1363
1367
|
}
|
|
1364
1368
|
];
|
|
1365
1369
|
var AlignSelfChild = () => {
|
|
1366
1370
|
const { isSiteRtl } = useDirection();
|
|
1367
|
-
return /* @__PURE__ */
|
|
1371
|
+
return /* @__PURE__ */ React28.createElement(import_ui19.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React28.createElement(import_ui19.ThemeProvider, null, /* @__PURE__ */ React28.createElement(StylesField, { bind: "align-self" }, /* @__PURE__ */ React28.createElement(import_ui19.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(import_ui19.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(import_editor_controls14.ControlLabel, null, (0, import_i18n11.__)("Align self", "elementor"))), /* @__PURE__ */ React28.createElement(import_ui19.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React28.createElement(import_editor_controls14.ToggleControl, { options: options2 }))))));
|
|
1368
1372
|
};
|
|
1369
1373
|
|
|
1370
1374
|
// src/components/style-sections/layout-section/display-field.tsx
|
|
1371
|
-
var
|
|
1375
|
+
var React29 = __toESM(require("react"));
|
|
1372
1376
|
var import_editor_controls15 = require("@elementor/editor-controls");
|
|
1373
|
-
var
|
|
1374
|
-
var
|
|
1377
|
+
var import_ui20 = require("@elementor/ui");
|
|
1378
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
1375
1379
|
var DisplayField = () => {
|
|
1376
1380
|
const options10 = [
|
|
1377
1381
|
{
|
|
1378
1382
|
value: "block",
|
|
1379
|
-
renderContent: () => (0,
|
|
1380
|
-
label: (0,
|
|
1383
|
+
renderContent: () => (0, import_i18n12.__)("Block", "elementor"),
|
|
1384
|
+
label: (0, import_i18n12.__)("Block", "elementor"),
|
|
1385
|
+
showTooltip: true
|
|
1381
1386
|
},
|
|
1382
1387
|
{
|
|
1383
1388
|
value: "flex",
|
|
1384
|
-
renderContent: () => (0,
|
|
1385
|
-
label: (0,
|
|
1389
|
+
renderContent: () => (0, import_i18n12.__)("Flex", "elementor"),
|
|
1390
|
+
label: (0, import_i18n12.__)("Flex", "elementor"),
|
|
1391
|
+
showTooltip: true
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
value: "inline-block",
|
|
1395
|
+
renderContent: () => (0, import_i18n12.__)("In-blk", "elementor"),
|
|
1396
|
+
label: (0, import_i18n12.__)("Inline-block", "elementor"),
|
|
1397
|
+
showTooltip: true
|
|
1386
1398
|
}
|
|
1387
1399
|
];
|
|
1388
|
-
return /* @__PURE__ */
|
|
1400
|
+
return /* @__PURE__ */ React29.createElement(StylesField, { bind: "display" }, /* @__PURE__ */ React29.createElement(import_ui20.Stack, { gap: 1 }, /* @__PURE__ */ React29.createElement(import_editor_controls15.ControlLabel, null, (0, import_i18n12.__)("Display", "elementor")), /* @__PURE__ */ React29.createElement(import_editor_controls15.ToggleControl, { options: options10, fullWidth: true })));
|
|
1389
1401
|
};
|
|
1390
1402
|
|
|
1391
1403
|
// src/components/style-sections/layout-section/flex-direction-field.tsx
|
|
1392
|
-
var
|
|
1404
|
+
var React30 = __toESM(require("react"));
|
|
1393
1405
|
var import_editor_controls16 = require("@elementor/editor-controls");
|
|
1394
|
-
var
|
|
1395
|
-
var
|
|
1396
|
-
var
|
|
1406
|
+
var import_icons9 = require("@elementor/icons");
|
|
1407
|
+
var import_ui21 = require("@elementor/ui");
|
|
1408
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
1397
1409
|
var options3 = [
|
|
1398
1410
|
{
|
|
1399
1411
|
value: "row",
|
|
1400
|
-
label: (0,
|
|
1412
|
+
label: (0, import_i18n13.__)("Row", "elementor"),
|
|
1401
1413
|
renderContent: ({ size }) => {
|
|
1402
|
-
const
|
|
1403
|
-
return /* @__PURE__ */
|
|
1414
|
+
const StartIcon5 = (0, import_ui21.withDirection)(import_icons9.ArrowRightIcon);
|
|
1415
|
+
return /* @__PURE__ */ React30.createElement(StartIcon5, { fontSize: size });
|
|
1404
1416
|
},
|
|
1405
1417
|
showTooltip: true
|
|
1406
1418
|
},
|
|
1407
1419
|
{
|
|
1408
1420
|
value: "column",
|
|
1409
|
-
label: (0,
|
|
1410
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1421
|
+
label: (0, import_i18n13.__)("Column", "elementor"),
|
|
1422
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(import_icons9.ArrowDownSmallIcon, { fontSize: size }),
|
|
1411
1423
|
showTooltip: true
|
|
1412
1424
|
},
|
|
1413
1425
|
{
|
|
1414
1426
|
value: "row-reverse",
|
|
1415
|
-
label: (0,
|
|
1427
|
+
label: (0, import_i18n13.__)("Reversed row", "elementor"),
|
|
1416
1428
|
renderContent: ({ size }) => {
|
|
1417
|
-
const
|
|
1418
|
-
return /* @__PURE__ */
|
|
1429
|
+
const EndIcon5 = (0, import_ui21.withDirection)(import_icons9.ArrowLeftIcon);
|
|
1430
|
+
return /* @__PURE__ */ React30.createElement(EndIcon5, { fontSize: size });
|
|
1419
1431
|
},
|
|
1420
1432
|
showTooltip: true
|
|
1421
1433
|
},
|
|
1422
1434
|
{
|
|
1423
1435
|
value: "column-reverse",
|
|
1424
|
-
label: (0,
|
|
1425
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1436
|
+
label: (0, import_i18n13.__)("Reversed column", "elementor"),
|
|
1437
|
+
renderContent: ({ size }) => /* @__PURE__ */ React30.createElement(import_icons9.ArrowUpSmallIcon, { fontSize: size }),
|
|
1426
1438
|
showTooltip: true
|
|
1427
1439
|
}
|
|
1428
1440
|
];
|
|
1429
1441
|
var FlexDirectionField = () => {
|
|
1430
1442
|
const { isSiteRtl } = useDirection();
|
|
1431
|
-
return /* @__PURE__ */
|
|
1443
|
+
return /* @__PURE__ */ React30.createElement(import_ui21.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React30.createElement(import_ui21.ThemeProvider, null, /* @__PURE__ */ React30.createElement(StylesField, { bind: "flex-direction" }, /* @__PURE__ */ React30.createElement(import_ui21.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(import_ui21.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(import_editor_controls16.ControlLabel, null, (0, import_i18n13.__)("Direction", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui21.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React30.createElement(import_editor_controls16.ToggleControl, { options: options3 }))))));
|
|
1432
1444
|
};
|
|
1433
1445
|
|
|
1434
1446
|
// src/components/style-sections/layout-section/flex-order-field.tsx
|
|
1435
|
-
var
|
|
1436
|
-
var
|
|
1447
|
+
var React31 = __toESM(require("react"));
|
|
1448
|
+
var import_react10 = require("react");
|
|
1437
1449
|
var import_editor_controls17 = require("@elementor/editor-controls");
|
|
1438
|
-
var
|
|
1439
|
-
var
|
|
1440
|
-
var
|
|
1450
|
+
var import_icons10 = require("@elementor/icons");
|
|
1451
|
+
var import_ui22 = require("@elementor/ui");
|
|
1452
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
1441
1453
|
var FIRST_DEFAULT_VALUE = -99999;
|
|
1442
1454
|
var LAST_DEFAULT_VALUE = 99999;
|
|
1443
1455
|
var FIRST = "first";
|
|
@@ -1450,26 +1462,26 @@ var orderValueMap = {
|
|
|
1450
1462
|
var items = [
|
|
1451
1463
|
{
|
|
1452
1464
|
value: FIRST,
|
|
1453
|
-
label: (0,
|
|
1454
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1465
|
+
label: (0, import_i18n14.__)("First", "elementor"),
|
|
1466
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(import_icons10.ArrowUpSmallIcon, { fontSize: size }),
|
|
1455
1467
|
showTooltip: true
|
|
1456
1468
|
},
|
|
1457
1469
|
{
|
|
1458
1470
|
value: LAST,
|
|
1459
|
-
label: (0,
|
|
1460
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1471
|
+
label: (0, import_i18n14.__)("Last", "elementor"),
|
|
1472
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(import_icons10.ArrowDownSmallIcon, { fontSize: size }),
|
|
1461
1473
|
showTooltip: true
|
|
1462
1474
|
},
|
|
1463
1475
|
{
|
|
1464
1476
|
value: CUSTOM,
|
|
1465
|
-
label: (0,
|
|
1466
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1477
|
+
label: (0, import_i18n14.__)("Custom", "elementor"),
|
|
1478
|
+
renderContent: ({ size }) => /* @__PURE__ */ React31.createElement(import_icons10.PencilIcon, { fontSize: size }),
|
|
1467
1479
|
showTooltip: true
|
|
1468
1480
|
}
|
|
1469
1481
|
];
|
|
1470
1482
|
var FlexOrderField = () => {
|
|
1471
1483
|
const { isSiteRtl } = useDirection(), [order, setOrder] = useStylesField("order");
|
|
1472
|
-
const [groupControlValue, setGroupControlValue] = (0,
|
|
1484
|
+
const [groupControlValue, setGroupControlValue] = (0, import_react10.useState)(getGroupControlValue(order?.value || null));
|
|
1473
1485
|
const handleToggleButtonChange = (group) => {
|
|
1474
1486
|
setGroupControlValue(group);
|
|
1475
1487
|
if (!group || group === CUSTOM) {
|
|
@@ -1478,7 +1490,7 @@ var FlexOrderField = () => {
|
|
|
1478
1490
|
}
|
|
1479
1491
|
setOrder({ $$type: "number", value: orderValueMap[group] });
|
|
1480
1492
|
};
|
|
1481
|
-
return /* @__PURE__ */
|
|
1493
|
+
return /* @__PURE__ */ React31.createElement(import_ui22.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React31.createElement(import_ui22.ThemeProvider, null, /* @__PURE__ */ React31.createElement(import_ui22.Stack, { gap: 2 }, /* @__PURE__ */ React31.createElement(import_ui22.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(import_editor_controls17.ControlLabel, null, (0, import_i18n14.__)("Order", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui22.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(
|
|
1482
1494
|
import_editor_controls17.ControlToggleButtonGroup,
|
|
1483
1495
|
{
|
|
1484
1496
|
items,
|
|
@@ -1486,7 +1498,7 @@ var FlexOrderField = () => {
|
|
|
1486
1498
|
onChange: handleToggleButtonChange,
|
|
1487
1499
|
exclusive: true
|
|
1488
1500
|
}
|
|
1489
|
-
))), CUSTOM === groupControlValue && /* @__PURE__ */
|
|
1501
|
+
))), CUSTOM === groupControlValue && /* @__PURE__ */ React31.createElement(StylesField, { bind: "order" }, /* @__PURE__ */ React31.createElement(import_ui22.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(import_editor_controls17.ControlLabel, null, (0, import_i18n14.__)("Custom order", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui22.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React31.createElement(
|
|
1490
1502
|
import_editor_controls17.NumberControl,
|
|
1491
1503
|
{
|
|
1492
1504
|
min: FIRST_DEFAULT_VALUE + 1,
|
|
@@ -1506,37 +1518,37 @@ var getGroupControlValue = (order) => {
|
|
|
1506
1518
|
};
|
|
1507
1519
|
|
|
1508
1520
|
// src/components/style-sections/layout-section/flex-size-field.tsx
|
|
1509
|
-
var
|
|
1510
|
-
var
|
|
1511
|
-
var import_editor_controls18 = require("@elementor/editor-controls");
|
|
1512
|
-
var
|
|
1513
|
-
var
|
|
1514
|
-
var
|
|
1521
|
+
var React32 = __toESM(require("react"));
|
|
1522
|
+
var import_react11 = require("react");
|
|
1523
|
+
var import_editor_controls18 = require("@elementor/editor-controls");
|
|
1524
|
+
var import_icons11 = require("@elementor/icons");
|
|
1525
|
+
var import_ui23 = require("@elementor/ui");
|
|
1526
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
1515
1527
|
var DEFAULT = 1;
|
|
1516
1528
|
var items2 = [
|
|
1517
1529
|
{
|
|
1518
1530
|
value: "flex-grow",
|
|
1519
|
-
label: (0,
|
|
1520
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1531
|
+
label: (0, import_i18n15.__)("Grow", "elementor"),
|
|
1532
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(import_icons11.ExpandIcon, { fontSize: size }),
|
|
1521
1533
|
showTooltip: true
|
|
1522
1534
|
},
|
|
1523
1535
|
{
|
|
1524
1536
|
value: "flex-shrink",
|
|
1525
|
-
label: (0,
|
|
1526
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1537
|
+
label: (0, import_i18n15.__)("Shrink", "elementor"),
|
|
1538
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(import_icons11.ShrinkIcon, { fontSize: size }),
|
|
1527
1539
|
showTooltip: true
|
|
1528
1540
|
},
|
|
1529
1541
|
{
|
|
1530
1542
|
value: "custom",
|
|
1531
|
-
label: (0,
|
|
1532
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1543
|
+
label: (0, import_i18n15.__)("Custom", "elementor"),
|
|
1544
|
+
renderContent: ({ size }) => /* @__PURE__ */ React32.createElement(import_icons11.PencilIcon, { fontSize: size }),
|
|
1533
1545
|
showTooltip: true
|
|
1534
1546
|
}
|
|
1535
1547
|
];
|
|
1536
1548
|
var FlexSizeField = () => {
|
|
1537
1549
|
const { isSiteRtl } = useDirection(), [growField, setGrowField] = useStylesField("flex-grow"), [shrinkField, setShrinkField] = useStylesField("flex-shrink"), [basisField, setBasisField] = useStylesField("flex-basis");
|
|
1538
1550
|
const grow = growField?.value || null, shrink = shrinkField?.value || null, basis = basisField?.value || null;
|
|
1539
|
-
const currentGroup = (0,
|
|
1551
|
+
const currentGroup = (0, import_react11.useMemo)(() => getActiveGroup({ grow, shrink, basis }), [grow, shrink, basis]), [activeGroup, setActiveGroup] = (0, import_react11.useState)(currentGroup);
|
|
1540
1552
|
const onChangeGroup = (group = null) => {
|
|
1541
1553
|
setActiveGroup(group);
|
|
1542
1554
|
setBasisField(null);
|
|
@@ -1553,7 +1565,7 @@ var FlexSizeField = () => {
|
|
|
1553
1565
|
setGrowField(null);
|
|
1554
1566
|
setShrinkField({ $$type: "number", value: DEFAULT });
|
|
1555
1567
|
};
|
|
1556
|
-
return /* @__PURE__ */
|
|
1568
|
+
return /* @__PURE__ */ React32.createElement(import_ui23.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React32.createElement(import_ui23.ThemeProvider, null, /* @__PURE__ */ React32.createElement(import_ui23.Stack, { gap: 2 }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n15.__)("Size", "elementor"))), /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(
|
|
1557
1569
|
import_editor_controls18.ControlToggleButtonGroup,
|
|
1558
1570
|
{
|
|
1559
1571
|
value: activeGroup,
|
|
@@ -1561,9 +1573,9 @@ var FlexSizeField = () => {
|
|
|
1561
1573
|
items: items2,
|
|
1562
1574
|
exclusive: true
|
|
1563
1575
|
}
|
|
1564
|
-
))), "custom" === activeGroup && /* @__PURE__ */
|
|
1576
|
+
))), "custom" === activeGroup && /* @__PURE__ */ React32.createElement(FlexCustomField, null))));
|
|
1565
1577
|
};
|
|
1566
|
-
var FlexCustomField = () => /* @__PURE__ */
|
|
1578
|
+
var FlexCustomField = () => /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(StylesField, { bind: "flex-grow" }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n15.__)("Grow", "elementor"))), /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(import_editor_controls18.NumberControl, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React32.createElement(StylesField, { bind: "flex-shrink" }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n15.__)("Shrink", "elementor"))), /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(import_editor_controls18.NumberControl, { min: 0, shouldForceInt: true })))), /* @__PURE__ */ React32.createElement(StylesField, { bind: "flex-basis" }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(import_editor_controls18.ControlLabel, null, (0, import_i18n15.__)("Basis", "elementor"))), /* @__PURE__ */ React32.createElement(import_ui23.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "end" } }, /* @__PURE__ */ React32.createElement(import_editor_controls18.SizeControl, null)))));
|
|
1567
1579
|
var getActiveGroup = ({
|
|
1568
1580
|
grow,
|
|
1569
1581
|
shrink,
|
|
@@ -1585,22 +1597,22 @@ var getActiveGroup = ({
|
|
|
1585
1597
|
};
|
|
1586
1598
|
|
|
1587
1599
|
// src/components/style-sections/layout-section/gap-control-field.tsx
|
|
1588
|
-
var
|
|
1600
|
+
var React33 = __toESM(require("react"));
|
|
1589
1601
|
var import_editor_controls19 = require("@elementor/editor-controls");
|
|
1590
|
-
var
|
|
1591
|
-
var
|
|
1602
|
+
var import_ui24 = require("@elementor/ui");
|
|
1603
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
1592
1604
|
var GapControlField = () => {
|
|
1593
|
-
return /* @__PURE__ */
|
|
1605
|
+
return /* @__PURE__ */ React33.createElement(import_ui24.Stack, { gap: 1 }, /* @__PURE__ */ React33.createElement(StylesField, { bind: "gap" }, /* @__PURE__ */ React33.createElement(import_editor_controls19.GapControl, { label: (0, import_i18n16.__)("Gaps", "elementor") })));
|
|
1594
1606
|
};
|
|
1595
1607
|
|
|
1596
1608
|
// src/components/style-sections/layout-section/justify-content-field.tsx
|
|
1597
|
-
var
|
|
1609
|
+
var React34 = __toESM(require("react"));
|
|
1598
1610
|
var import_editor_controls20 = require("@elementor/editor-controls");
|
|
1599
|
-
var
|
|
1600
|
-
var
|
|
1601
|
-
var
|
|
1602
|
-
var StartIcon3 = (0,
|
|
1603
|
-
var EndIcon3 = (0,
|
|
1611
|
+
var import_icons12 = require("@elementor/icons");
|
|
1612
|
+
var import_ui25 = require("@elementor/ui");
|
|
1613
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
1614
|
+
var StartIcon3 = (0, import_ui25.withDirection)(import_icons12.JustifyTopIcon);
|
|
1615
|
+
var EndIcon3 = (0, import_ui25.withDirection)(import_icons12.JustifyBottomIcon);
|
|
1604
1616
|
var iconProps3 = {
|
|
1605
1617
|
isClockwise: true,
|
|
1606
1618
|
offset: -90
|
|
@@ -1608,171 +1620,135 @@ var iconProps3 = {
|
|
|
1608
1620
|
var options4 = [
|
|
1609
1621
|
{
|
|
1610
1622
|
value: "start",
|
|
1611
|
-
label: (0,
|
|
1612
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1623
|
+
label: (0, import_i18n17.__)("Start", "elementor"),
|
|
1624
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: StartIcon3, size, ...iconProps3 }),
|
|
1613
1625
|
showTooltip: true
|
|
1614
1626
|
},
|
|
1615
1627
|
{
|
|
1616
1628
|
value: "center",
|
|
1617
|
-
label: (0,
|
|
1618
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1629
|
+
label: (0, import_i18n17.__)("Center", "elementor"),
|
|
1630
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: import_icons12.JustifyCenterIcon, size, ...iconProps3 }),
|
|
1619
1631
|
showTooltip: true
|
|
1620
1632
|
},
|
|
1621
1633
|
{
|
|
1622
1634
|
value: "end",
|
|
1623
|
-
label: (0,
|
|
1624
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1635
|
+
label: (0, import_i18n17.__)("End", "elementor"),
|
|
1636
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: EndIcon3, size, ...iconProps3 }),
|
|
1625
1637
|
showTooltip: true
|
|
1626
1638
|
},
|
|
1627
1639
|
{
|
|
1628
1640
|
value: "space-between",
|
|
1629
|
-
label: (0,
|
|
1630
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1641
|
+
label: (0, import_i18n17.__)("Space between", "elementor"),
|
|
1642
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: import_icons12.JustifySpaceBetweenVerticalIcon, size, ...iconProps3 }),
|
|
1631
1643
|
showTooltip: true
|
|
1632
1644
|
},
|
|
1633
1645
|
{
|
|
1634
1646
|
value: "space-around",
|
|
1635
|
-
label: (0,
|
|
1636
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1647
|
+
label: (0, import_i18n17.__)("Space around", "elementor"),
|
|
1648
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: import_icons12.JustifySpaceAroundVerticalIcon, size, ...iconProps3 }),
|
|
1637
1649
|
showTooltip: true
|
|
1638
1650
|
},
|
|
1639
1651
|
{
|
|
1640
1652
|
value: "space-evenly",
|
|
1641
|
-
label: (0,
|
|
1642
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1653
|
+
label: (0, import_i18n17.__)("Space evenly", "elementor"),
|
|
1654
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(RotatedIcon, { icon: import_icons12.JustifyDistributeVerticalIcon, size, ...iconProps3 }),
|
|
1643
1655
|
showTooltip: true
|
|
1644
1656
|
}
|
|
1645
1657
|
];
|
|
1646
1658
|
var JustifyContentField = () => {
|
|
1647
1659
|
const { isSiteRtl } = useDirection();
|
|
1648
|
-
return /* @__PURE__ */
|
|
1660
|
+
return /* @__PURE__ */ React34.createElement(import_ui25.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React34.createElement(import_ui25.ThemeProvider, null, /* @__PURE__ */ React34.createElement(StylesField, { bind: "justify-content" }, /* @__PURE__ */ React34.createElement(import_ui25.Stack, { gap: 1 }, /* @__PURE__ */ React34.createElement(import_editor_controls20.ControlLabel, null, (0, import_i18n17.__)("Justify content", "elementor")), /* @__PURE__ */ React34.createElement(import_editor_controls20.ToggleControl, { options: options4, fullWidth: true })))));
|
|
1649
1661
|
};
|
|
1650
1662
|
|
|
1651
1663
|
// src/components/style-sections/layout-section/wrap-field.tsx
|
|
1652
|
-
var
|
|
1664
|
+
var React35 = __toESM(require("react"));
|
|
1653
1665
|
var import_editor_controls21 = require("@elementor/editor-controls");
|
|
1654
|
-
var
|
|
1655
|
-
var
|
|
1656
|
-
var
|
|
1666
|
+
var import_icons13 = require("@elementor/icons");
|
|
1667
|
+
var import_ui26 = require("@elementor/ui");
|
|
1668
|
+
var import_i18n18 = require("@wordpress/i18n");
|
|
1657
1669
|
var options5 = [
|
|
1658
1670
|
{
|
|
1659
1671
|
value: "nowrap",
|
|
1660
|
-
label: (0,
|
|
1661
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1672
|
+
label: (0, import_i18n18.__)("No wrap", "elementor"),
|
|
1673
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(import_icons13.ArrowRightIcon, { fontSize: size }),
|
|
1662
1674
|
showTooltip: true
|
|
1663
1675
|
},
|
|
1664
1676
|
{
|
|
1665
1677
|
value: "wrap",
|
|
1666
|
-
label: (0,
|
|
1667
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1678
|
+
label: (0, import_i18n18.__)("Wrap", "elementor"),
|
|
1679
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(import_icons13.ArrowBackIcon, { fontSize: size }),
|
|
1668
1680
|
showTooltip: true
|
|
1669
1681
|
},
|
|
1670
1682
|
{
|
|
1671
1683
|
value: "wrap-reverse",
|
|
1672
|
-
label: (0,
|
|
1673
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1684
|
+
label: (0, import_i18n18.__)("Reversed wrap", "elementor"),
|
|
1685
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(import_icons13.ArrowForwardIcon, { fontSize: size }),
|
|
1674
1686
|
showTooltip: true
|
|
1675
1687
|
}
|
|
1676
1688
|
];
|
|
1677
1689
|
var WrapField = () => {
|
|
1678
1690
|
const { isSiteRtl } = useDirection();
|
|
1679
|
-
return /* @__PURE__ */
|
|
1691
|
+
return /* @__PURE__ */ React35.createElement(import_ui26.DirectionProvider, { rtl: isSiteRtl }, /* @__PURE__ */ React35.createElement(import_ui26.ThemeProvider, null, /* @__PURE__ */ React35.createElement(StylesField, { bind: "flex-wrap" }, /* @__PURE__ */ React35.createElement(import_ui26.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(import_editor_controls21.ControlLabel, null, (0, import_i18n18.__)("Wrap", "elementor"))), /* @__PURE__ */ React35.createElement(import_ui26.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React35.createElement(import_editor_controls21.ToggleControl, { options: options5 }))))));
|
|
1680
1692
|
};
|
|
1681
1693
|
|
|
1682
1694
|
// src/components/style-sections/layout-section/layout-section.tsx
|
|
1683
1695
|
var LayoutSection = () => {
|
|
1684
1696
|
const [display] = useStylesField("display");
|
|
1685
1697
|
const { element } = useElement();
|
|
1686
|
-
const parent = (0,
|
|
1698
|
+
const parent = (0, import_editor_elements5.useParentElement)(element.id);
|
|
1687
1699
|
const parentStyle = useComputedStyle(parent?.id || null);
|
|
1688
|
-
return /* @__PURE__ */
|
|
1700
|
+
return /* @__PURE__ */ React36.createElement(import_ui27.Stack, { gap: 2 }, /* @__PURE__ */ React36.createElement(DisplayField, null), "flex" === display?.value && /* @__PURE__ */ React36.createElement(FlexFields, null), "flex" === parentStyle?.display && /* @__PURE__ */ React36.createElement(FlexChildFields, null));
|
|
1689
1701
|
};
|
|
1690
|
-
var FlexFields = () => /* @__PURE__ */
|
|
1691
|
-
var FlexChildFields = () => /* @__PURE__ */
|
|
1702
|
+
var FlexFields = () => /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(FlexDirectionField, null), /* @__PURE__ */ React36.createElement(JustifyContentField, null), /* @__PURE__ */ React36.createElement(AlignItemsField, null), /* @__PURE__ */ React36.createElement(import_ui27.Divider, null), /* @__PURE__ */ React36.createElement(GapControlField, null), /* @__PURE__ */ React36.createElement(WrapField, null));
|
|
1703
|
+
var FlexChildFields = () => /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(import_ui27.Divider, null), /* @__PURE__ */ React36.createElement(import_editor_controls22.ControlLabel, null, (0, import_i18n19.__)("Flex child", "elementor")), /* @__PURE__ */ React36.createElement(AlignSelfChild, null), /* @__PURE__ */ React36.createElement(FlexOrderField, null), /* @__PURE__ */ React36.createElement(FlexSizeField, null));
|
|
1692
1704
|
|
|
1693
1705
|
// src/components/style-sections/position-section/position-section.tsx
|
|
1694
|
-
var
|
|
1695
|
-
var
|
|
1696
|
-
|
|
1697
|
-
// src/hooks/use-session-storage.ts
|
|
1698
|
-
var import_react14 = require("react");
|
|
1699
|
-
var import_utils2 = require("@elementor/utils");
|
|
1700
|
-
var useSessionStorage = (key) => {
|
|
1701
|
-
const prefixedKey = `elementor/${key}`;
|
|
1702
|
-
const [value, setValue] = (0, import_react14.useState)();
|
|
1703
|
-
(0, import_react14.useEffect)(() => {
|
|
1704
|
-
return subscribeToSessionStorage(prefixedKey, (newValue) => {
|
|
1705
|
-
setValue(newValue ?? null);
|
|
1706
|
-
});
|
|
1707
|
-
}, [prefixedKey]);
|
|
1708
|
-
const saveValue = (newValue) => {
|
|
1709
|
-
(0, import_utils2.setSessionStorageItem)(prefixedKey, newValue);
|
|
1710
|
-
};
|
|
1711
|
-
const removeValue = () => {
|
|
1712
|
-
(0, import_utils2.removeSessionStorageItem)(prefixedKey);
|
|
1713
|
-
};
|
|
1714
|
-
return [value, saveValue, removeValue];
|
|
1715
|
-
};
|
|
1716
|
-
var subscribeToSessionStorage = (key, subscriber) => {
|
|
1717
|
-
subscriber((0, import_utils2.getSessionStorageItem)(key));
|
|
1718
|
-
const abortController = new AbortController();
|
|
1719
|
-
window.addEventListener(
|
|
1720
|
-
"storage",
|
|
1721
|
-
(e) => {
|
|
1722
|
-
if (e.key !== key || e.storageArea !== sessionStorage) {
|
|
1723
|
-
return;
|
|
1724
|
-
}
|
|
1725
|
-
subscriber((0, import_utils2.getSessionStorageItem)(key));
|
|
1726
|
-
},
|
|
1727
|
-
{ signal: abortController.signal }
|
|
1728
|
-
);
|
|
1729
|
-
return () => {
|
|
1730
|
-
abortController.abort();
|
|
1731
|
-
};
|
|
1732
|
-
};
|
|
1706
|
+
var React40 = __toESM(require("react"));
|
|
1707
|
+
var import_session2 = require("@elementor/session");
|
|
1708
|
+
var import_ui31 = require("@elementor/ui");
|
|
1733
1709
|
|
|
1734
1710
|
// src/components/style-sections/position-section/dimensions-field.tsx
|
|
1735
|
-
var
|
|
1711
|
+
var React37 = __toESM(require("react"));
|
|
1736
1712
|
var import_editor_controls23 = require("@elementor/editor-controls");
|
|
1737
|
-
var
|
|
1738
|
-
var
|
|
1739
|
-
var
|
|
1713
|
+
var import_icons14 = require("@elementor/icons");
|
|
1714
|
+
var import_ui28 = require("@elementor/ui");
|
|
1715
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
1740
1716
|
var sideIcons = {
|
|
1741
|
-
left: /* @__PURE__ */
|
|
1742
|
-
right: /* @__PURE__ */
|
|
1743
|
-
top: /* @__PURE__ */
|
|
1744
|
-
bottom: /* @__PURE__ */
|
|
1717
|
+
left: /* @__PURE__ */ React37.createElement(import_icons14.SideLeftIcon, { fontSize: "tiny" }),
|
|
1718
|
+
right: /* @__PURE__ */ React37.createElement(import_icons14.SideRightIcon, { fontSize: "tiny" }),
|
|
1719
|
+
top: /* @__PURE__ */ React37.createElement(import_icons14.SideTopIcon, { fontSize: "tiny" }),
|
|
1720
|
+
bottom: /* @__PURE__ */ React37.createElement(import_icons14.SideBottomIcon, { fontSize: "tiny" })
|
|
1745
1721
|
};
|
|
1746
1722
|
var DimensionsField = () => {
|
|
1747
|
-
return /* @__PURE__ */
|
|
1723
|
+
return /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(import_ui28.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(DimensionField, { side: "top", label: (0, import_i18n20.__)("Top", "elementor") }), /* @__PURE__ */ React37.createElement(DimensionField, { side: "right", label: (0, import_i18n20.__)("Right", "elementor") })), /* @__PURE__ */ React37.createElement(import_ui28.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(DimensionField, { side: "bottom", label: (0, import_i18n20.__)("Bottom", "elementor") }), /* @__PURE__ */ React37.createElement(DimensionField, { side: "left", label: (0, import_i18n20.__)("Left", "elementor") })));
|
|
1748
1724
|
};
|
|
1749
1725
|
var DimensionField = ({ side, label }) => {
|
|
1750
|
-
return /* @__PURE__ */
|
|
1726
|
+
return /* @__PURE__ */ React37.createElement(import_ui28.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React37.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(import_editor_controls23.ControlLabel, null, label)), /* @__PURE__ */ React37.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(StylesField, { bind: side }, /* @__PURE__ */ React37.createElement(import_editor_controls23.SizeControl, { startIcon: sideIcons[side] }))));
|
|
1751
1727
|
};
|
|
1752
1728
|
|
|
1753
1729
|
// src/components/style-sections/position-section/position-field.tsx
|
|
1754
|
-
var
|
|
1730
|
+
var React38 = __toESM(require("react"));
|
|
1755
1731
|
var import_editor_controls24 = require("@elementor/editor-controls");
|
|
1756
|
-
var
|
|
1757
|
-
var
|
|
1732
|
+
var import_ui29 = require("@elementor/ui");
|
|
1733
|
+
var import_i18n21 = require("@wordpress/i18n");
|
|
1758
1734
|
var positionOptions = [
|
|
1759
|
-
{ label: (0,
|
|
1760
|
-
{ label: (0,
|
|
1761
|
-
{ label: (0,
|
|
1762
|
-
{ label: (0,
|
|
1763
|
-
{ label: (0,
|
|
1735
|
+
{ label: (0, import_i18n21.__)("Static", "elementor"), value: "static" },
|
|
1736
|
+
{ label: (0, import_i18n21.__)("Relative", "elementor"), value: "relative" },
|
|
1737
|
+
{ label: (0, import_i18n21.__)("Absolute", "elementor"), value: "absolute" },
|
|
1738
|
+
{ label: (0, import_i18n21.__)("Fixed", "elementor"), value: "fixed" },
|
|
1739
|
+
{ label: (0, import_i18n21.__)("Sticky", "elementor"), value: "sticky" }
|
|
1764
1740
|
];
|
|
1765
1741
|
var PositionField = ({ onChange }) => {
|
|
1766
|
-
return /* @__PURE__ */
|
|
1742
|
+
return /* @__PURE__ */ React38.createElement(StylesField, { bind: "position" }, /* @__PURE__ */ React38.createElement(import_ui29.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React38.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(import_editor_controls24.ControlLabel, null, (0, import_i18n21.__)("Position", "elementor"))), /* @__PURE__ */ React38.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(import_editor_controls24.SelectControl, { options: positionOptions, onChange }))));
|
|
1767
1743
|
};
|
|
1768
1744
|
|
|
1769
1745
|
// src/components/style-sections/position-section/z-index-field.tsx
|
|
1770
|
-
var
|
|
1746
|
+
var React39 = __toESM(require("react"));
|
|
1771
1747
|
var import_editor_controls25 = require("@elementor/editor-controls");
|
|
1772
|
-
var
|
|
1773
|
-
var
|
|
1748
|
+
var import_ui30 = require("@elementor/ui");
|
|
1749
|
+
var import_i18n22 = require("@wordpress/i18n");
|
|
1774
1750
|
var ZIndexField = () => {
|
|
1775
|
-
return /* @__PURE__ */
|
|
1751
|
+
return /* @__PURE__ */ React39.createElement(StylesField, { bind: "z-index" }, /* @__PURE__ */ React39.createElement(import_ui30.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(import_editor_controls25.ControlLabel, null, (0, import_i18n22.__)("Z-Index", "elementor"))), /* @__PURE__ */ React39.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(import_editor_controls25.NumberControl, null))));
|
|
1776
1752
|
};
|
|
1777
1753
|
|
|
1778
1754
|
// src/components/style-sections/position-section/position-section.tsx
|
|
@@ -1804,101 +1780,101 @@ var PositionSection = () => {
|
|
|
1804
1780
|
}
|
|
1805
1781
|
};
|
|
1806
1782
|
const isNotStatic = positionValue && positionValue?.value !== "static";
|
|
1807
|
-
return /* @__PURE__ */
|
|
1783
|
+
return /* @__PURE__ */ React40.createElement(import_ui31.Stack, { gap: 1.5 }, /* @__PURE__ */ React40.createElement(PositionField, { onChange: onPositionChange }), isNotStatic ? /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(DimensionsField, null), /* @__PURE__ */ React40.createElement(ZIndexField, null)) : null);
|
|
1808
1784
|
};
|
|
1809
1785
|
var usePersistDimensions = () => {
|
|
1810
1786
|
const { id: styleDefID, meta } = useStyle();
|
|
1811
1787
|
const styleVariantPath = `styles/${styleDefID}/${meta.breakpoint || "desktop"}/${meta.state || "null"}`;
|
|
1812
1788
|
const dimensionsPath = `${styleVariantPath}/dimensions`;
|
|
1813
|
-
return useSessionStorage(dimensionsPath);
|
|
1789
|
+
return (0, import_session2.useSessionStorage)(dimensionsPath);
|
|
1814
1790
|
};
|
|
1815
1791
|
|
|
1816
1792
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1817
|
-
var
|
|
1793
|
+
var React42 = __toESM(require("react"));
|
|
1818
1794
|
var import_editor_controls27 = require("@elementor/editor-controls");
|
|
1819
|
-
var
|
|
1820
|
-
var
|
|
1795
|
+
var import_ui33 = require("@elementor/ui");
|
|
1796
|
+
var import_i18n24 = require("@wordpress/i18n");
|
|
1821
1797
|
|
|
1822
1798
|
// src/components/style-sections/size-section/overflow-field.tsx
|
|
1823
|
-
var
|
|
1799
|
+
var React41 = __toESM(require("react"));
|
|
1824
1800
|
var import_editor_controls26 = require("@elementor/editor-controls");
|
|
1825
|
-
var
|
|
1826
|
-
var
|
|
1827
|
-
var
|
|
1801
|
+
var import_icons15 = require("@elementor/icons");
|
|
1802
|
+
var import_ui32 = require("@elementor/ui");
|
|
1803
|
+
var import_i18n23 = require("@wordpress/i18n");
|
|
1828
1804
|
var options6 = [
|
|
1829
1805
|
{
|
|
1830
1806
|
value: "visible",
|
|
1831
|
-
label: (0,
|
|
1832
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1807
|
+
label: (0, import_i18n23.__)("Visible", "elementor"),
|
|
1808
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(import_icons15.EyeIcon, { fontSize: size }),
|
|
1833
1809
|
showTooltip: true
|
|
1834
1810
|
},
|
|
1835
1811
|
{
|
|
1836
1812
|
value: "hidden",
|
|
1837
|
-
label: (0,
|
|
1838
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1813
|
+
label: (0, import_i18n23.__)("Hidden", "elementor"),
|
|
1814
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(import_icons15.EyeOffIcon, { fontSize: size }),
|
|
1839
1815
|
showTooltip: true
|
|
1840
1816
|
},
|
|
1841
1817
|
{
|
|
1842
1818
|
value: "auto",
|
|
1843
|
-
label: (0,
|
|
1844
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1819
|
+
label: (0, import_i18n23.__)("Auto", "elementor"),
|
|
1820
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(import_icons15.ExpandBottomIcon, { fontSize: size }),
|
|
1845
1821
|
showTooltip: true
|
|
1846
1822
|
}
|
|
1847
1823
|
];
|
|
1848
1824
|
var OverflowField = () => {
|
|
1849
|
-
return /* @__PURE__ */
|
|
1825
|
+
return /* @__PURE__ */ React41.createElement(StylesField, { bind: "overflow" }, /* @__PURE__ */ React41.createElement(import_ui32.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(import_editor_controls26.ControlLabel, null, (0, import_i18n23.__)("Overflow", "elementor"))), /* @__PURE__ */ React41.createElement(import_ui32.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React41.createElement(import_editor_controls26.ToggleControl, { options: options6 }))));
|
|
1850
1826
|
};
|
|
1851
1827
|
|
|
1852
1828
|
// src/components/style-sections/size-section/size-section.tsx
|
|
1853
1829
|
var SizeSection = () => {
|
|
1854
|
-
return /* @__PURE__ */
|
|
1830
|
+
return /* @__PURE__ */ React42.createElement(import_ui33.Stack, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(import_ui33.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "width", label: (0, import_i18n24.__)("Width", "elementor") })), /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "height", label: (0, import_i18n24.__)("Height", "elementor") }))), /* @__PURE__ */ React42.createElement(import_ui33.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "min-width", label: (0, import_i18n24.__)("Min. Width", "elementor") })), /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "min-height", label: (0, import_i18n24.__)("Min. Height", "elementor") }))), /* @__PURE__ */ React42.createElement(import_ui33.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "max-width", label: (0, import_i18n24.__)("Max. Width", "elementor") })), /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(SizeField, { bind: "max-height", label: (0, import_i18n24.__)("Max. Height", "elementor") }))), /* @__PURE__ */ React42.createElement(import_ui33.Divider, null), /* @__PURE__ */ React42.createElement(import_ui33.Stack, null, /* @__PURE__ */ React42.createElement(OverflowField, null)));
|
|
1855
1831
|
};
|
|
1856
1832
|
var SizeField = ({ label, bind }) => {
|
|
1857
|
-
return /* @__PURE__ */
|
|
1833
|
+
return /* @__PURE__ */ React42.createElement(StylesField, { bind }, /* @__PURE__ */ React42.createElement(import_ui33.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React42.createElement(import_editor_controls27.ControlLabel, null, label)), /* @__PURE__ */ React42.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React42.createElement(import_editor_controls27.SizeControl, null))));
|
|
1858
1834
|
};
|
|
1859
1835
|
|
|
1860
1836
|
// src/components/style-sections/spacing-section/spacing-section.tsx
|
|
1861
|
-
var
|
|
1837
|
+
var React43 = __toESM(require("react"));
|
|
1862
1838
|
var import_editor_controls28 = require("@elementor/editor-controls");
|
|
1863
|
-
var
|
|
1864
|
-
var
|
|
1839
|
+
var import_ui34 = require("@elementor/ui");
|
|
1840
|
+
var import_i18n25 = require("@wordpress/i18n");
|
|
1865
1841
|
var SpacingSection = () => {
|
|
1866
|
-
return /* @__PURE__ */
|
|
1842
|
+
return /* @__PURE__ */ React43.createElement(import_ui34.Stack, { gap: 1.5 }, /* @__PURE__ */ React43.createElement(StylesField, { bind: "padding" }, /* @__PURE__ */ React43.createElement(import_editor_controls28.LinkedDimensionsControl, { label: (0, import_i18n25.__)("Padding", "elementor") })), /* @__PURE__ */ React43.createElement(import_ui34.Divider, null), /* @__PURE__ */ React43.createElement(StylesField, { bind: "margin" }, /* @__PURE__ */ React43.createElement(import_editor_controls28.LinkedDimensionsControl, { label: (0, import_i18n25.__)("Margin", "elementor") })));
|
|
1867
1843
|
};
|
|
1868
1844
|
|
|
1869
1845
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
1870
|
-
var
|
|
1871
|
-
var
|
|
1846
|
+
var React57 = __toESM(require("react"));
|
|
1847
|
+
var import_ui47 = require("@elementor/ui");
|
|
1872
1848
|
|
|
1873
1849
|
// src/components/collapsible-content.tsx
|
|
1874
|
-
var
|
|
1875
|
-
var
|
|
1876
|
-
var
|
|
1877
|
-
var
|
|
1850
|
+
var React44 = __toESM(require("react"));
|
|
1851
|
+
var import_react12 = require("react");
|
|
1852
|
+
var import_ui35 = require("@elementor/ui");
|
|
1853
|
+
var import_i18n26 = require("@wordpress/i18n");
|
|
1878
1854
|
var CollapsibleContent = ({ children, defaultOpen = false }) => {
|
|
1879
|
-
const [open, setOpen] = (0,
|
|
1855
|
+
const [open, setOpen] = (0, import_react12.useState)(defaultOpen);
|
|
1880
1856
|
const handleToggle = () => {
|
|
1881
1857
|
setOpen((prevOpen) => !prevOpen);
|
|
1882
1858
|
};
|
|
1883
|
-
return /* @__PURE__ */
|
|
1884
|
-
|
|
1859
|
+
return /* @__PURE__ */ React44.createElement(import_ui35.Stack, { sx: { py: 0.5 } }, /* @__PURE__ */ React44.createElement(
|
|
1860
|
+
import_ui35.Button,
|
|
1885
1861
|
{
|
|
1886
1862
|
fullWidth: true,
|
|
1887
1863
|
size: "small",
|
|
1888
1864
|
color: "secondary",
|
|
1889
1865
|
variant: "outlined",
|
|
1890
1866
|
onClick: handleToggle,
|
|
1891
|
-
endIcon: /* @__PURE__ */
|
|
1867
|
+
endIcon: /* @__PURE__ */ React44.createElement(CollapseIcon, { open })
|
|
1892
1868
|
},
|
|
1893
|
-
open ? (0,
|
|
1894
|
-
), /* @__PURE__ */
|
|
1869
|
+
open ? (0, import_i18n26.__)("Show less", "elementor") : (0, import_i18n26.__)("Show more", "elementor")
|
|
1870
|
+
), /* @__PURE__ */ React44.createElement(import_ui35.Collapse, { in: open, timeout: "auto", unmountOnExit: true }, children));
|
|
1895
1871
|
};
|
|
1896
1872
|
|
|
1897
1873
|
// src/components/style-sections/typography-section/font-family-field.tsx
|
|
1898
|
-
var
|
|
1874
|
+
var React45 = __toESM(require("react"));
|
|
1899
1875
|
var import_editor_controls29 = require("@elementor/editor-controls");
|
|
1900
|
-
var
|
|
1901
|
-
var
|
|
1876
|
+
var import_ui36 = require("@elementor/ui");
|
|
1877
|
+
var import_i18n27 = require("@wordpress/i18n");
|
|
1902
1878
|
|
|
1903
1879
|
// src/sync/get-elementor-config.ts
|
|
1904
1880
|
var getElementorConfig = () => {
|
|
@@ -1912,7 +1888,7 @@ var FontFamilyField = () => {
|
|
|
1912
1888
|
if (!fontFamilies) {
|
|
1913
1889
|
return null;
|
|
1914
1890
|
}
|
|
1915
|
-
return /* @__PURE__ */
|
|
1891
|
+
return /* @__PURE__ */ React45.createElement(StylesField, { bind: "font-family" }, /* @__PURE__ */ React45.createElement(import_ui36.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(import_ui36.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(import_editor_controls29.ControlLabel, null, (0, import_i18n27.__)("Font Family", "elementor"))), /* @__PURE__ */ React45.createElement(import_ui36.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(import_editor_controls29.FontFamilyControl, { fontFamilies }))));
|
|
1916
1892
|
};
|
|
1917
1893
|
var getFontFamilies = () => {
|
|
1918
1894
|
const { controls } = getElementorConfig();
|
|
@@ -1924,115 +1900,125 @@ var getFontFamilies = () => {
|
|
|
1924
1900
|
};
|
|
1925
1901
|
|
|
1926
1902
|
// src/components/style-sections/typography-section/font-size-field.tsx
|
|
1927
|
-
var
|
|
1903
|
+
var React46 = __toESM(require("react"));
|
|
1928
1904
|
var import_editor_controls30 = require("@elementor/editor-controls");
|
|
1929
|
-
var
|
|
1930
|
-
var
|
|
1905
|
+
var import_ui37 = require("@elementor/ui");
|
|
1906
|
+
var import_i18n28 = require("@wordpress/i18n");
|
|
1931
1907
|
var FontSizeField = () => {
|
|
1932
|
-
return /* @__PURE__ */
|
|
1908
|
+
return /* @__PURE__ */ React46.createElement(StylesField, { bind: "font-size" }, /* @__PURE__ */ React46.createElement(import_ui37.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(import_editor_controls30.ControlLabel, null, (0, import_i18n28.__)("Font Size", "elementor"))), /* @__PURE__ */ React46.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(import_editor_controls30.SizeControl, null))));
|
|
1933
1909
|
};
|
|
1934
1910
|
|
|
1935
1911
|
// src/components/style-sections/typography-section/font-weight-field.tsx
|
|
1936
|
-
var
|
|
1912
|
+
var React47 = __toESM(require("react"));
|
|
1937
1913
|
var import_editor_controls31 = require("@elementor/editor-controls");
|
|
1938
|
-
var
|
|
1939
|
-
var
|
|
1914
|
+
var import_ui38 = require("@elementor/ui");
|
|
1915
|
+
var import_i18n29 = require("@wordpress/i18n");
|
|
1940
1916
|
var fontWeightOptions = [
|
|
1941
|
-
{ label: (0,
|
|
1942
|
-
{ label: (0,
|
|
1943
|
-
{ label: (0,
|
|
1944
|
-
{ label: (0,
|
|
1945
|
-
{ label: (0,
|
|
1917
|
+
{ value: "100", label: (0, import_i18n29.__)("100 - Thin", "elementor") },
|
|
1918
|
+
{ value: "200", label: (0, import_i18n29.__)("200 - Extra Light", "elementor") },
|
|
1919
|
+
{ value: "300", label: (0, import_i18n29.__)("300 - Light", "elementor") },
|
|
1920
|
+
{ value: "400", label: (0, import_i18n29.__)("400 - Normal", "elementor") },
|
|
1921
|
+
{ value: "500", label: (0, import_i18n29.__)("500 - Medium", "elementor") },
|
|
1922
|
+
{ value: "600", label: (0, import_i18n29.__)("600 - Semi Bold", "elementor") },
|
|
1923
|
+
{ value: "700", label: (0, import_i18n29.__)("700 - Bold", "elementor") },
|
|
1924
|
+
{ value: "800", label: (0, import_i18n29.__)("800 - Extra Bold", "elementor") },
|
|
1925
|
+
{ value: "900", label: (0, import_i18n29.__)("900 - Black", "elementor") }
|
|
1946
1926
|
];
|
|
1947
1927
|
var FontWeightField = () => {
|
|
1948
|
-
return /* @__PURE__ */
|
|
1928
|
+
return /* @__PURE__ */ React47.createElement(StylesField, { bind: "font-weight" }, /* @__PURE__ */ React47.createElement(import_ui38.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React47.createElement(import_ui38.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(import_editor_controls31.ControlLabel, null, (0, import_i18n29.__)("Font Weight", "elementor"))), /* @__PURE__ */ React47.createElement(import_ui38.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(import_editor_controls31.SelectControl, { options: fontWeightOptions }))));
|
|
1949
1929
|
};
|
|
1950
1930
|
|
|
1951
1931
|
// src/components/style-sections/typography-section/letter-spacing-field.tsx
|
|
1952
|
-
var
|
|
1932
|
+
var React48 = __toESM(require("react"));
|
|
1953
1933
|
var import_editor_controls32 = require("@elementor/editor-controls");
|
|
1954
|
-
var
|
|
1955
|
-
var
|
|
1934
|
+
var import_ui39 = require("@elementor/ui");
|
|
1935
|
+
var import_i18n30 = require("@wordpress/i18n");
|
|
1956
1936
|
var LetterSpacingField = () => {
|
|
1957
|
-
return /* @__PURE__ */
|
|
1937
|
+
return /* @__PURE__ */ React48.createElement(StylesField, { bind: "letter-spacing" }, /* @__PURE__ */ React48.createElement(import_ui39.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React48.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(import_editor_controls32.ControlLabel, null, (0, import_i18n30.__)("Letter Spacing", "elementor"))), /* @__PURE__ */ React48.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(import_editor_controls32.SizeControl, null))));
|
|
1958
1938
|
};
|
|
1959
1939
|
|
|
1960
1940
|
// src/components/style-sections/typography-section/line-height-field.tsx
|
|
1961
|
-
var
|
|
1941
|
+
var React49 = __toESM(require("react"));
|
|
1962
1942
|
var import_editor_controls33 = require("@elementor/editor-controls");
|
|
1963
|
-
var
|
|
1964
|
-
var
|
|
1943
|
+
var import_ui40 = require("@elementor/ui");
|
|
1944
|
+
var import_i18n31 = require("@wordpress/i18n");
|
|
1965
1945
|
var LineHeightField = () => {
|
|
1966
|
-
return /* @__PURE__ */
|
|
1946
|
+
return /* @__PURE__ */ React49.createElement(StylesField, { bind: "line-height" }, /* @__PURE__ */ React49.createElement(import_ui40.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React49.createElement(import_ui40.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(import_editor_controls33.ControlLabel, null, (0, import_i18n31.__)("Line Height", "elementor"))), /* @__PURE__ */ React49.createElement(import_ui40.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(import_editor_controls33.SizeControl, null))));
|
|
1967
1947
|
};
|
|
1968
1948
|
|
|
1969
1949
|
// src/components/style-sections/typography-section/text-alignment-field.tsx
|
|
1970
|
-
var
|
|
1950
|
+
var React50 = __toESM(require("react"));
|
|
1971
1951
|
var import_editor_controls34 = require("@elementor/editor-controls");
|
|
1972
|
-
var
|
|
1973
|
-
var
|
|
1974
|
-
var
|
|
1952
|
+
var import_icons16 = require("@elementor/icons");
|
|
1953
|
+
var import_ui41 = require("@elementor/ui");
|
|
1954
|
+
var import_i18n32 = require("@wordpress/i18n");
|
|
1955
|
+
var StartIcon4 = (0, import_ui41.withDirection)(import_icons16.AlignLeftIcon);
|
|
1956
|
+
var EndIcon4 = (0, import_ui41.withDirection)(import_icons16.AlignRightIcon);
|
|
1975
1957
|
var options7 = [
|
|
1976
1958
|
{
|
|
1977
|
-
value: "
|
|
1978
|
-
label: (0,
|
|
1979
|
-
renderContent: (
|
|
1959
|
+
value: "start",
|
|
1960
|
+
label: (0, import_i18n32.__)("Start", "elementor"),
|
|
1961
|
+
renderContent: () => /* @__PURE__ */ React50.createElement(RotatedIcon, { icon: StartIcon4, size: "tiny" }),
|
|
1962
|
+
showTooltip: true
|
|
1980
1963
|
},
|
|
1981
1964
|
{
|
|
1982
1965
|
value: "center",
|
|
1983
|
-
label: (0,
|
|
1984
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1966
|
+
label: (0, import_i18n32.__)("Center", "elementor"),
|
|
1967
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons16.AlignCenterIcon, { fontSize: size }),
|
|
1968
|
+
showTooltip: true
|
|
1985
1969
|
},
|
|
1986
1970
|
{
|
|
1987
|
-
value: "
|
|
1988
|
-
label: (0,
|
|
1989
|
-
renderContent: (
|
|
1971
|
+
value: "end",
|
|
1972
|
+
label: (0, import_i18n32.__)("End", "elementor"),
|
|
1973
|
+
renderContent: () => /* @__PURE__ */ React50.createElement(RotatedIcon, { icon: EndIcon4, size: "tiny" }),
|
|
1974
|
+
showTooltip: true
|
|
1990
1975
|
},
|
|
1991
1976
|
{
|
|
1992
1977
|
value: "justify",
|
|
1993
|
-
label: (0,
|
|
1994
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1978
|
+
label: (0, import_i18n32.__)("Justify", "elementor"),
|
|
1979
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons16.AlignJustifiedIcon, { fontSize: size }),
|
|
1980
|
+
showTooltip: true
|
|
1995
1981
|
}
|
|
1996
1982
|
];
|
|
1997
1983
|
var TextAlignmentField = () => {
|
|
1998
|
-
return /* @__PURE__ */
|
|
1984
|
+
return /* @__PURE__ */ React50.createElement(StylesField, { bind: "text-align" }, /* @__PURE__ */ React50.createElement(import_ui41.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React50.createElement(import_ui41.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(import_editor_controls34.ControlLabel, null, (0, import_i18n32.__)("Alignment", "elementor"))), /* @__PURE__ */ React50.createElement(import_ui41.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React50.createElement(import_editor_controls34.ToggleControl, { options: options7 }))));
|
|
1999
1985
|
};
|
|
2000
1986
|
|
|
2001
1987
|
// src/components/style-sections/typography-section/text-color-field.tsx
|
|
2002
|
-
var
|
|
1988
|
+
var React51 = __toESM(require("react"));
|
|
2003
1989
|
var import_editor_controls35 = require("@elementor/editor-controls");
|
|
2004
|
-
var
|
|
2005
|
-
var
|
|
1990
|
+
var import_ui42 = require("@elementor/ui");
|
|
1991
|
+
var import_i18n33 = require("@wordpress/i18n");
|
|
2006
1992
|
var TextColorField = () => {
|
|
2007
|
-
return /* @__PURE__ */
|
|
1993
|
+
return /* @__PURE__ */ React51.createElement(StylesField, { bind: "color" }, /* @__PURE__ */ React51.createElement(import_ui42.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React51.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(import_editor_controls35.ControlLabel, null, (0, import_i18n33.__)("Text Color", "elementor"))), /* @__PURE__ */ React51.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(import_editor_controls35.ColorControl, null))));
|
|
2008
1994
|
};
|
|
2009
1995
|
|
|
2010
1996
|
// src/components/style-sections/typography-section/text-direction-field.tsx
|
|
2011
|
-
var
|
|
1997
|
+
var React52 = __toESM(require("react"));
|
|
2012
1998
|
var import_editor_controls36 = require("@elementor/editor-controls");
|
|
2013
|
-
var
|
|
2014
|
-
var
|
|
2015
|
-
var
|
|
1999
|
+
var import_icons17 = require("@elementor/icons");
|
|
2000
|
+
var import_ui43 = require("@elementor/ui");
|
|
2001
|
+
var import_i18n34 = require("@wordpress/i18n");
|
|
2016
2002
|
var options8 = [
|
|
2017
2003
|
{
|
|
2018
2004
|
value: "ltr",
|
|
2019
|
-
label: (0,
|
|
2020
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2005
|
+
label: (0, import_i18n34.__)("Left to Right", "elementor"),
|
|
2006
|
+
renderContent: ({ size }) => /* @__PURE__ */ React52.createElement(import_icons17.TextDirectionLtrIcon, { fontSize: size })
|
|
2021
2007
|
},
|
|
2022
2008
|
{
|
|
2023
2009
|
value: "rtl",
|
|
2024
|
-
label: (0,
|
|
2025
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2010
|
+
label: (0, import_i18n34.__)("Right to Left", "elementor"),
|
|
2011
|
+
renderContent: ({ size }) => /* @__PURE__ */ React52.createElement(import_icons17.TextDirectionRtlIcon, { fontSize: size })
|
|
2026
2012
|
}
|
|
2027
2013
|
];
|
|
2028
2014
|
var TextDirectionField = () => {
|
|
2029
|
-
return /* @__PURE__ */
|
|
2015
|
+
return /* @__PURE__ */ React52.createElement(StylesField, { bind: "direction" }, /* @__PURE__ */ React52.createElement(import_ui43.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React52.createElement(import_ui43.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(import_editor_controls36.ControlLabel, null, (0, import_i18n34.__)("Direction", "elementor"))), /* @__PURE__ */ React52.createElement(import_ui43.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React52.createElement(import_editor_controls36.ToggleControl, { options: options8 }))));
|
|
2030
2016
|
};
|
|
2031
2017
|
|
|
2032
2018
|
// src/components/style-sections/typography-section/text-stroke-field.tsx
|
|
2033
|
-
var
|
|
2019
|
+
var React53 = __toESM(require("react"));
|
|
2034
2020
|
var import_editor_controls37 = require("@elementor/editor-controls");
|
|
2035
|
-
var
|
|
2021
|
+
var import_i18n35 = require("@wordpress/i18n");
|
|
2036
2022
|
var initTextStroke = {
|
|
2037
2023
|
$$type: "stroke",
|
|
2038
2024
|
value: {
|
|
@@ -2058,24 +2044,24 @@ var TextStrokeField = () => {
|
|
|
2058
2044
|
setTextStroke(null);
|
|
2059
2045
|
};
|
|
2060
2046
|
const hasTextStroke = Boolean(textStroke);
|
|
2061
|
-
return /* @__PURE__ */
|
|
2047
|
+
return /* @__PURE__ */ React53.createElement(
|
|
2062
2048
|
AddOrRemoveContent,
|
|
2063
2049
|
{
|
|
2064
|
-
label: (0,
|
|
2050
|
+
label: (0, import_i18n35.__)("Text Stroke", "elementor"),
|
|
2065
2051
|
isAdded: hasTextStroke,
|
|
2066
2052
|
onAdd: addTextStroke,
|
|
2067
2053
|
onRemove: removeTextStroke
|
|
2068
2054
|
},
|
|
2069
|
-
/* @__PURE__ */
|
|
2055
|
+
/* @__PURE__ */ React53.createElement(StylesField, { bind: "-webkit-text-stroke" }, /* @__PURE__ */ React53.createElement(import_editor_controls37.StrokeControl, null))
|
|
2070
2056
|
);
|
|
2071
2057
|
};
|
|
2072
2058
|
|
|
2073
2059
|
// src/components/style-sections/typography-section/text-style-field.tsx
|
|
2074
|
-
var
|
|
2060
|
+
var React54 = __toESM(require("react"));
|
|
2075
2061
|
var import_editor_controls38 = require("@elementor/editor-controls");
|
|
2076
|
-
var
|
|
2077
|
-
var
|
|
2078
|
-
var
|
|
2062
|
+
var import_icons18 = require("@elementor/icons");
|
|
2063
|
+
var import_ui44 = require("@elementor/ui");
|
|
2064
|
+
var import_i18n36 = require("@wordpress/i18n");
|
|
2079
2065
|
var buttonSize = "tiny";
|
|
2080
2066
|
var TextStyleField = () => {
|
|
2081
2067
|
const [fontStyle, setFontStyle] = useStylesField("font-style");
|
|
@@ -2099,7 +2085,7 @@ var TextStyleField = () => {
|
|
|
2099
2085
|
value: newValue
|
|
2100
2086
|
});
|
|
2101
2087
|
};
|
|
2102
|
-
return /* @__PURE__ */
|
|
2088
|
+
return /* @__PURE__ */ React54.createElement(import_ui44.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(import_editor_controls38.ControlLabel, null, (0, import_i18n36.__)("Style", "elementor"))), /* @__PURE__ */ React54.createElement(import_ui44.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React54.createElement(import_ui44.ToggleButtonGroup, { value: formats }, /* @__PURE__ */ React54.createElement(
|
|
2103
2089
|
ToggleButton,
|
|
2104
2090
|
{
|
|
2105
2091
|
value: "italic",
|
|
@@ -2107,8 +2093,8 @@ var TextStyleField = () => {
|
|
|
2107
2093
|
"aria-label": "italic",
|
|
2108
2094
|
sx: { marginLeft: "auto" }
|
|
2109
2095
|
},
|
|
2110
|
-
/* @__PURE__ */
|
|
2111
|
-
), /* @__PURE__ */
|
|
2096
|
+
/* @__PURE__ */ React54.createElement(import_icons18.ItalicIcon, { fontSize: buttonSize })
|
|
2097
|
+
), /* @__PURE__ */ React54.createElement(
|
|
2112
2098
|
ShorthandControl,
|
|
2113
2099
|
{
|
|
2114
2100
|
value: "line-through",
|
|
@@ -2116,8 +2102,8 @@ var TextStyleField = () => {
|
|
|
2116
2102
|
updateValues: handleSetTextDecoration,
|
|
2117
2103
|
"aria-label": "line-through"
|
|
2118
2104
|
},
|
|
2119
|
-
/* @__PURE__ */
|
|
2120
|
-
), /* @__PURE__ */
|
|
2105
|
+
/* @__PURE__ */ React54.createElement(import_icons18.StrikethroughIcon, { fontSize: buttonSize })
|
|
2106
|
+
), /* @__PURE__ */ React54.createElement(
|
|
2121
2107
|
ShorthandControl,
|
|
2122
2108
|
{
|
|
2123
2109
|
value: "underline",
|
|
@@ -2125,7 +2111,7 @@ var TextStyleField = () => {
|
|
|
2125
2111
|
updateValues: handleSetTextDecoration,
|
|
2126
2112
|
"aria-label": "underline"
|
|
2127
2113
|
},
|
|
2128
|
-
/* @__PURE__ */
|
|
2114
|
+
/* @__PURE__ */ React54.createElement(import_icons18.UnderlineIcon, { fontSize: buttonSize })
|
|
2129
2115
|
))));
|
|
2130
2116
|
};
|
|
2131
2117
|
var ShorthandControl = ({
|
|
@@ -2144,52 +2130,61 @@ var ShorthandControl = ({
|
|
|
2144
2130
|
updateValues([...valuesArr, newValue].join(" "));
|
|
2145
2131
|
}
|
|
2146
2132
|
};
|
|
2147
|
-
return /* @__PURE__ */
|
|
2133
|
+
return /* @__PURE__ */ React54.createElement(ToggleButton, { value, onChange: toggleValue, selected, "aria-label": ariaLabel }, children);
|
|
2148
2134
|
};
|
|
2149
2135
|
var ToggleButton = ({ onChange, ...props }) => {
|
|
2150
2136
|
const handleChange = (_e, newValue) => {
|
|
2151
2137
|
onChange(newValue);
|
|
2152
2138
|
};
|
|
2153
|
-
return /* @__PURE__ */
|
|
2139
|
+
return /* @__PURE__ */ React54.createElement(import_ui44.ToggleButton, { ...props, onChange: handleChange, size: buttonSize });
|
|
2154
2140
|
};
|
|
2155
2141
|
|
|
2156
2142
|
// src/components/style-sections/typography-section/transform-field.tsx
|
|
2157
|
-
var
|
|
2143
|
+
var React55 = __toESM(require("react"));
|
|
2158
2144
|
var import_editor_controls39 = require("@elementor/editor-controls");
|
|
2159
|
-
var
|
|
2160
|
-
var
|
|
2161
|
-
var
|
|
2145
|
+
var import_icons19 = require("@elementor/icons");
|
|
2146
|
+
var import_ui45 = require("@elementor/ui");
|
|
2147
|
+
var import_i18n37 = require("@wordpress/i18n");
|
|
2162
2148
|
var options9 = [
|
|
2149
|
+
{
|
|
2150
|
+
value: "none",
|
|
2151
|
+
label: (0, import_i18n37.__)("None", "elementor"),
|
|
2152
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(import_icons19.MinusIcon, { fontSize: size }),
|
|
2153
|
+
showTooltip: true
|
|
2154
|
+
},
|
|
2163
2155
|
{
|
|
2164
2156
|
value: "capitalize",
|
|
2165
|
-
label: (0,
|
|
2166
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2157
|
+
label: (0, import_i18n37.__)("Capitalize", "elementor"),
|
|
2158
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(import_icons19.LetterCaseIcon, { fontSize: size }),
|
|
2159
|
+
showTooltip: true
|
|
2167
2160
|
},
|
|
2168
2161
|
{
|
|
2169
2162
|
value: "uppercase",
|
|
2170
|
-
label: (0,
|
|
2171
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2163
|
+
label: (0, import_i18n37.__)("Uppercase", "elementor"),
|
|
2164
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(import_icons19.LetterCaseUpperIcon, { fontSize: size }),
|
|
2165
|
+
showTooltip: true
|
|
2172
2166
|
},
|
|
2173
2167
|
{
|
|
2174
2168
|
value: "lowercase",
|
|
2175
|
-
label: (0,
|
|
2176
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2169
|
+
label: (0, import_i18n37.__)("Lowercase", "elementor"),
|
|
2170
|
+
renderContent: ({ size }) => /* @__PURE__ */ React55.createElement(import_icons19.LetterCaseLowerIcon, { fontSize: size }),
|
|
2171
|
+
showTooltip: true
|
|
2177
2172
|
}
|
|
2178
2173
|
];
|
|
2179
|
-
var TransformField = () => /* @__PURE__ */
|
|
2174
|
+
var TransformField = () => /* @__PURE__ */ React55.createElement(StylesField, { bind: "text-transform" }, /* @__PURE__ */ React55.createElement(import_ui45.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React55.createElement(import_ui45.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React55.createElement(import_editor_controls39.ControlLabel, null, (0, import_i18n37.__)("Text Transform", "elementor"))), /* @__PURE__ */ React55.createElement(import_ui45.Grid, { item: true, xs: 6, display: "flex", justifyContent: "end" }, /* @__PURE__ */ React55.createElement(import_editor_controls39.ToggleControl, { options: options9 }))));
|
|
2180
2175
|
|
|
2181
2176
|
// src/components/style-sections/typography-section/word-spacing-field.tsx
|
|
2182
|
-
var
|
|
2177
|
+
var React56 = __toESM(require("react"));
|
|
2183
2178
|
var import_editor_controls40 = require("@elementor/editor-controls");
|
|
2184
|
-
var
|
|
2185
|
-
var
|
|
2179
|
+
var import_ui46 = require("@elementor/ui");
|
|
2180
|
+
var import_i18n38 = require("@wordpress/i18n");
|
|
2186
2181
|
var WordSpacingField = () => {
|
|
2187
|
-
return /* @__PURE__ */
|
|
2182
|
+
return /* @__PURE__ */ React56.createElement(StylesField, { bind: "word-spacing" }, /* @__PURE__ */ React56.createElement(import_ui46.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(import_ui46.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(import_editor_controls40.ControlLabel, null, (0, import_i18n38.__)("Word Spacing", "elementor"))), /* @__PURE__ */ React56.createElement(import_ui46.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(import_editor_controls40.SizeControl, null))));
|
|
2188
2183
|
};
|
|
2189
2184
|
|
|
2190
2185
|
// src/components/style-sections/typography-section/typography-section.tsx
|
|
2191
2186
|
var TypographySection = () => {
|
|
2192
|
-
return /* @__PURE__ */
|
|
2187
|
+
return /* @__PURE__ */ React57.createElement(import_ui47.Stack, { gap: 1.5 }, /* @__PURE__ */ React57.createElement(FontFamilyField, null), /* @__PURE__ */ React57.createElement(FontWeightField, null), /* @__PURE__ */ React57.createElement(FontSizeField, null), /* @__PURE__ */ React57.createElement(import_ui47.Divider, null), /* @__PURE__ */ React57.createElement(TextAlignmentField, null), /* @__PURE__ */ React57.createElement(TextColorField, null), /* @__PURE__ */ React57.createElement(CollapsibleContent, null, /* @__PURE__ */ React57.createElement(import_ui47.Stack, { gap: 1.5, sx: { pt: 1.5 } }, /* @__PURE__ */ React57.createElement(LineHeightField, null), /* @__PURE__ */ React57.createElement(LetterSpacingField, null), /* @__PURE__ */ React57.createElement(WordSpacingField, null), /* @__PURE__ */ React57.createElement(import_ui47.Divider, null), /* @__PURE__ */ React57.createElement(TextStyleField, null), /* @__PURE__ */ React57.createElement(TransformField, null), /* @__PURE__ */ React57.createElement(TextDirectionField, null), /* @__PURE__ */ React57.createElement(TextStrokeField, null))));
|
|
2193
2188
|
};
|
|
2194
2189
|
|
|
2195
2190
|
// src/components/style-tab.tsx
|
|
@@ -2197,9 +2192,9 @@ var CLASSES_PROP_KEY = "classes";
|
|
|
2197
2192
|
var StyleTab = () => {
|
|
2198
2193
|
const currentClassesProp = useCurrentClassesProp();
|
|
2199
2194
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
2200
|
-
const [activeStyleState, setActiveStyleState] = (0,
|
|
2195
|
+
const [activeStyleState, setActiveStyleState] = (0, import_react13.useState)(null);
|
|
2201
2196
|
const breakpoint = (0, import_editor_responsive.useActiveBreakpoint)();
|
|
2202
|
-
return /* @__PURE__ */
|
|
2197
|
+
return /* @__PURE__ */ React58.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React58.createElement(
|
|
2203
2198
|
StyleProvider,
|
|
2204
2199
|
{
|
|
2205
2200
|
meta: { breakpoint, state: activeStyleState },
|
|
@@ -2210,18 +2205,18 @@ var StyleTab = () => {
|
|
|
2210
2205
|
},
|
|
2211
2206
|
setMetaState: setActiveStyleState
|
|
2212
2207
|
},
|
|
2213
|
-
/* @__PURE__ */
|
|
2208
|
+
/* @__PURE__ */ React58.createElement(import_session3.SessionStorageProvider, { prefix: activeStyleDefId ?? "" }, /* @__PURE__ */ React58.createElement(CssClassSelector, null), /* @__PURE__ */ React58.createElement(import_ui48.Divider, null), /* @__PURE__ */ React58.createElement(SectionsList, null, /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n39.__)("Layout", "elementor") }, /* @__PURE__ */ React58.createElement(LayoutSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n39.__)("Spacing", "elementor") }, /* @__PURE__ */ React58.createElement(SpacingSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n39.__)("Size", "elementor") }, /* @__PURE__ */ React58.createElement(SizeSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n39.__)("Position", "elementor") }, /* @__PURE__ */ React58.createElement(PositionSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n39.__)("Typography", "elementor") }, /* @__PURE__ */ React58.createElement(TypographySection, null)), /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n39.__)("Background", "elementor") }, /* @__PURE__ */ React58.createElement(BackgroundSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n39.__)("Border", "elementor") }, /* @__PURE__ */ React58.createElement(BorderSection, null)), /* @__PURE__ */ React58.createElement(Section, { title: (0, import_i18n39.__)("Effects", "elementor") }, /* @__PURE__ */ React58.createElement(EffectsSection, null))))
|
|
2214
2209
|
));
|
|
2215
2210
|
};
|
|
2216
2211
|
function useActiveStyleDefId(currentClassesProp) {
|
|
2217
|
-
const [activeStyledDefId, setActiveStyledDefId] = (0,
|
|
2212
|
+
const [activeStyledDefId, setActiveStyledDefId] = (0, import_react13.useState)(null);
|
|
2218
2213
|
const fallback = useFirstElementStyleDef(currentClassesProp);
|
|
2219
2214
|
return [activeStyledDefId || fallback?.id || null, setActiveStyledDefId];
|
|
2220
2215
|
}
|
|
2221
2216
|
function useFirstElementStyleDef(currentClassesProp) {
|
|
2222
2217
|
const { element } = useElement();
|
|
2223
|
-
const classesIds = (0,
|
|
2224
|
-
const stylesDefs = (0,
|
|
2218
|
+
const classesIds = (0, import_editor_elements6.useElementSetting)(element.id, currentClassesProp)?.value || [];
|
|
2219
|
+
const stylesDefs = (0, import_editor_elements6.useElementStyles)(element.id);
|
|
2225
2220
|
return Object.values(stylesDefs).find((styleDef) => classesIds.includes(styleDef.id));
|
|
2226
2221
|
}
|
|
2227
2222
|
function useCurrentClassesProp() {
|
|
@@ -2238,25 +2233,25 @@ function useCurrentClassesProp() {
|
|
|
2238
2233
|
// src/components/editing-panel-tabs.tsx
|
|
2239
2234
|
var EditingPanelTabs = () => {
|
|
2240
2235
|
const { element } = useElement();
|
|
2241
|
-
const { getTabProps, getTabPanelProps, getTabsProps } = (0,
|
|
2236
|
+
const { getTabProps, getTabPanelProps, getTabsProps } = (0, import_ui49.useTabs)("settings");
|
|
2242
2237
|
return (
|
|
2243
2238
|
// When switching between elements, the local states should be reset. We are using key to rerender the tabs.
|
|
2244
2239
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
2245
|
-
/* @__PURE__ */
|
|
2240
|
+
/* @__PURE__ */ React59.createElement(import_react14.Fragment, { key: element.id }, /* @__PURE__ */ React59.createElement(import_ui49.Stack, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React59.createElement(import_ui49.Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React59.createElement(import_ui49.Tab, { label: (0, import_i18n40.__)("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React59.createElement(import_ui49.Tab, { label: (0, import_i18n40.__)("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React59.createElement(import_ui49.Divider, null), /* @__PURE__ */ React59.createElement(import_ui49.TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React59.createElement(SettingsTab, null)), /* @__PURE__ */ React59.createElement(import_ui49.TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React59.createElement(StyleTab, null))))
|
|
2246
2241
|
);
|
|
2247
2242
|
};
|
|
2248
2243
|
|
|
2249
2244
|
// src/components/editing-panel.tsx
|
|
2250
2245
|
var { useMenuItems } = controlActionsMenu;
|
|
2251
2246
|
var EditingPanel = () => {
|
|
2252
|
-
const { element, elementType } = (0,
|
|
2247
|
+
const { element, elementType } = (0, import_editor_elements7.useSelectedElement)();
|
|
2253
2248
|
const controlReplacement = getControlReplacement();
|
|
2254
2249
|
const menuItems = useMenuItems().default;
|
|
2255
2250
|
if (!element || !elementType) {
|
|
2256
2251
|
return null;
|
|
2257
2252
|
}
|
|
2258
|
-
const panelTitle = (0,
|
|
2259
|
-
return /* @__PURE__ */
|
|
2253
|
+
const panelTitle = (0, import_i18n41.__)("Edit %s", "elementor").replace("%s", elementType.title);
|
|
2254
|
+
return /* @__PURE__ */ React60.createElement(import_ui50.ErrorBoundary, { fallback: /* @__PURE__ */ React60.createElement(EditorPanelErrorFallback, null) }, /* @__PURE__ */ React60.createElement(import_session4.SessionStorageProvider, { prefix: "elementor" }, /* @__PURE__ */ React60.createElement(import_editor_panels.Panel, null, /* @__PURE__ */ React60.createElement(import_editor_panels.PanelHeader, null, /* @__PURE__ */ React60.createElement(import_editor_panels.PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React60.createElement(import_editor_panels.PanelBody, null, /* @__PURE__ */ React60.createElement(import_editor_controls41.ControlActionsProvider, { items: menuItems }, /* @__PURE__ */ React60.createElement(import_editor_controls41.ControlReplacementProvider, { ...controlReplacement }, /* @__PURE__ */ React60.createElement(ElementProvider, { element, elementType }, /* @__PURE__ */ React60.createElement(EditingPanelTabs, null))))))));
|
|
2260
2255
|
};
|
|
2261
2256
|
|
|
2262
2257
|
// src/panel.ts
|
|
@@ -2268,18 +2263,18 @@ var { panel, usePanelActions, usePanelStatus } = (0, import_editor_panels2.__cre
|
|
|
2268
2263
|
// src/init.ts
|
|
2269
2264
|
var import_editor = require("@elementor/editor");
|
|
2270
2265
|
var import_editor_panels3 = require("@elementor/editor-panels");
|
|
2271
|
-
var
|
|
2266
|
+
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
2272
2267
|
|
|
2273
2268
|
// src/hooks/use-close-editor-panel.ts
|
|
2274
|
-
var
|
|
2275
|
-
var
|
|
2276
|
-
var
|
|
2269
|
+
var import_react15 = require("react");
|
|
2270
|
+
var import_editor_elements9 = require("@elementor/editor-elements");
|
|
2271
|
+
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
2277
2272
|
|
|
2278
2273
|
// src/sync/is-atomic-widget-selected.ts
|
|
2279
|
-
var
|
|
2274
|
+
var import_editor_elements8 = require("@elementor/editor-elements");
|
|
2280
2275
|
var isAtomicWidgetSelected = () => {
|
|
2281
|
-
const selectedElements = (0,
|
|
2282
|
-
const widgetCache = (0,
|
|
2276
|
+
const selectedElements = (0, import_editor_elements8.getSelectedElements)();
|
|
2277
|
+
const widgetCache = (0, import_editor_elements8.getWidgetsCache)();
|
|
2283
2278
|
if (selectedElements.length !== 1) {
|
|
2284
2279
|
return false;
|
|
2285
2280
|
}
|
|
@@ -2289,11 +2284,11 @@ var isAtomicWidgetSelected = () => {
|
|
|
2289
2284
|
// src/hooks/use-close-editor-panel.ts
|
|
2290
2285
|
var useCloseEditorPanel = () => {
|
|
2291
2286
|
const { close } = usePanelActions();
|
|
2292
|
-
return (0,
|
|
2293
|
-
return (0,
|
|
2294
|
-
const selectedElement = (0,
|
|
2287
|
+
return (0, import_react15.useEffect)(() => {
|
|
2288
|
+
return (0, import_editor_v1_adapters3.__privateListenTo)((0, import_editor_v1_adapters3.commandStartEvent)("document/elements/delete"), (e) => {
|
|
2289
|
+
const selectedElement = (0, import_editor_elements9.getSelectedElements)()[0];
|
|
2295
2290
|
const { container: deletedContainer } = e?.args;
|
|
2296
|
-
const isSelectedElementInDeletedContainer = deletedContainer && selectedElement && (0,
|
|
2291
|
+
const isSelectedElementInDeletedContainer = deletedContainer && selectedElement && (0, import_editor_elements9.isElementInContainer)(selectedElement, deletedContainer);
|
|
2297
2292
|
if (isSelectedElementInDeletedContainer && isAtomicWidgetSelected()) {
|
|
2298
2293
|
close();
|
|
2299
2294
|
}
|
|
@@ -2302,12 +2297,12 @@ var useCloseEditorPanel = () => {
|
|
|
2302
2297
|
};
|
|
2303
2298
|
|
|
2304
2299
|
// src/hooks/use-open-editor-panel.ts
|
|
2305
|
-
var
|
|
2306
|
-
var
|
|
2300
|
+
var import_react16 = require("react");
|
|
2301
|
+
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
2307
2302
|
var useOpenEditorPanel = () => {
|
|
2308
2303
|
const { open } = usePanelActions();
|
|
2309
|
-
(0,
|
|
2310
|
-
return (0,
|
|
2304
|
+
(0, import_react16.useEffect)(() => {
|
|
2305
|
+
return (0, import_editor_v1_adapters4.__privateListenTo)((0, import_editor_v1_adapters4.commandStartEvent)("panel/editor/open"), () => {
|
|
2311
2306
|
if (isAtomicWidgetSelected()) {
|
|
2312
2307
|
open();
|
|
2313
2308
|
}
|
|
@@ -2322,86 +2317,31 @@ var EditingPanelHooks = () => {
|
|
|
2322
2317
|
return null;
|
|
2323
2318
|
};
|
|
2324
2319
|
|
|
2325
|
-
// src/hooks/use-unapply-class.ts
|
|
2326
|
-
var import_editor_elements9 = require("@elementor/editor-elements");
|
|
2327
|
-
var useUnapplyClass = (classId) => {
|
|
2328
|
-
const { element } = useElement();
|
|
2329
|
-
const classesProp = useClassesProp();
|
|
2330
|
-
const classes = (0, import_editor_elements9.useElementSetting)(element.id, classesProp);
|
|
2331
|
-
const filteredClasses = classes?.value.filter((className) => className !== classId) ?? [];
|
|
2332
|
-
return () => {
|
|
2333
|
-
(0, import_editor_elements9.updateElementSettings)({
|
|
2334
|
-
id: element.id,
|
|
2335
|
-
props: {
|
|
2336
|
-
[classesProp]: {
|
|
2337
|
-
$$type: "classes",
|
|
2338
|
-
value: filteredClasses
|
|
2339
|
-
}
|
|
2340
|
-
}
|
|
2341
|
-
});
|
|
2342
|
-
};
|
|
2343
|
-
};
|
|
2344
|
-
|
|
2345
|
-
// src/css-classes.ts
|
|
2346
|
-
var STATES = ["hover", "focus", "active"];
|
|
2347
|
-
function initCssClasses() {
|
|
2348
|
-
registerStateItems();
|
|
2349
|
-
registerGlobalClassItems();
|
|
2350
|
-
}
|
|
2351
|
-
function registerStateItems() {
|
|
2352
|
-
registerStateMenuItem({
|
|
2353
|
-
id: "normal",
|
|
2354
|
-
props: {
|
|
2355
|
-
state: null
|
|
2356
|
-
}
|
|
2357
|
-
});
|
|
2358
|
-
STATES.forEach((state) => {
|
|
2359
|
-
registerStateMenuItem({
|
|
2360
|
-
id: state,
|
|
2361
|
-
props: {
|
|
2362
|
-
state
|
|
2363
|
-
}
|
|
2364
|
-
});
|
|
2365
|
-
});
|
|
2366
|
-
}
|
|
2367
|
-
function registerGlobalClassItems() {
|
|
2368
|
-
registerGlobalClassMenuItem({
|
|
2369
|
-
id: "unapply-class",
|
|
2370
|
-
useProps: () => {
|
|
2371
|
-
const { styleId: currentClass } = useCssClassItem();
|
|
2372
|
-
const unapplyClass = useUnapplyClass(currentClass);
|
|
2373
|
-
return {
|
|
2374
|
-
text: "Remove",
|
|
2375
|
-
onClick: unapplyClass
|
|
2376
|
-
};
|
|
2377
|
-
}
|
|
2378
|
-
});
|
|
2379
|
-
}
|
|
2380
|
-
|
|
2381
2320
|
// src/dynamics/components/dynamic-selection-control.tsx
|
|
2382
|
-
var
|
|
2383
|
-
var
|
|
2321
|
+
var React63 = __toESM(require("react"));
|
|
2322
|
+
var import_react20 = require("react");
|
|
2384
2323
|
var import_editor_controls45 = require("@elementor/editor-controls");
|
|
2385
|
-
var
|
|
2386
|
-
var
|
|
2387
|
-
var
|
|
2324
|
+
var import_icons21 = require("@elementor/icons");
|
|
2325
|
+
var import_ui52 = require("@elementor/ui");
|
|
2326
|
+
var import_i18n43 = require("@wordpress/i18n");
|
|
2388
2327
|
|
|
2389
2328
|
// src/hooks/use-persist-dynamic-value.ts
|
|
2329
|
+
var import_session5 = require("@elementor/session");
|
|
2390
2330
|
var usePersistDynamicValue = (propKey) => {
|
|
2391
2331
|
const { element } = useElement();
|
|
2392
2332
|
const prefixedKey = `dynamic/non-dynamic-values-history/${element.id}/${propKey}`;
|
|
2393
|
-
return useSessionStorage(prefixedKey);
|
|
2333
|
+
return (0, import_session5.useSessionStorage)(prefixedKey);
|
|
2394
2334
|
};
|
|
2395
2335
|
|
|
2396
2336
|
// src/dynamics/dynamic-control.tsx
|
|
2397
|
-
var
|
|
2337
|
+
var React61 = __toESM(require("react"));
|
|
2398
2338
|
var import_editor_controls43 = require("@elementor/editor-controls");
|
|
2399
2339
|
|
|
2400
2340
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2401
|
-
var
|
|
2341
|
+
var import_react18 = require("react");
|
|
2402
2342
|
|
|
2403
2343
|
// src/dynamics/hooks/use-prop-dynamic-tags.ts
|
|
2404
|
-
var
|
|
2344
|
+
var import_react17 = require("react");
|
|
2405
2345
|
var import_editor_controls42 = require("@elementor/editor-controls");
|
|
2406
2346
|
|
|
2407
2347
|
// src/dynamics/sync/get-elementor-config.ts
|
|
@@ -2453,7 +2393,7 @@ var usePropDynamicTags = () => {
|
|
|
2453
2393
|
const propDynamicType = getDynamicPropType(propType);
|
|
2454
2394
|
categories = propDynamicType?.settings.categories || [];
|
|
2455
2395
|
}
|
|
2456
|
-
return (0,
|
|
2396
|
+
return (0, import_react17.useMemo)(() => getDynamicTagsByCategories(categories), [categories.join()]);
|
|
2457
2397
|
};
|
|
2458
2398
|
var getDynamicTagsByCategories = (categories) => {
|
|
2459
2399
|
const dynamicTags = getAtomicDynamicTags();
|
|
@@ -2469,7 +2409,7 @@ var getDynamicTagsByCategories = (categories) => {
|
|
|
2469
2409
|
// src/dynamics/hooks/use-dynamic-tag.ts
|
|
2470
2410
|
var useDynamicTag = (tagName) => {
|
|
2471
2411
|
const dynamicTags = usePropDynamicTags();
|
|
2472
|
-
return (0,
|
|
2412
|
+
return (0, import_react18.useMemo)(() => dynamicTags.find((tag) => tag.name === tagName) ?? null, [dynamicTags, tagName]);
|
|
2473
2413
|
};
|
|
2474
2414
|
|
|
2475
2415
|
// src/dynamics/dynamic-control.tsx
|
|
@@ -2493,19 +2433,19 @@ var DynamicControl = ({ bind, children }) => {
|
|
|
2493
2433
|
});
|
|
2494
2434
|
};
|
|
2495
2435
|
const propType = createTopLevelOjectType({ schema: dynamicTag.props_schema });
|
|
2496
|
-
return /* @__PURE__ */
|
|
2436
|
+
return /* @__PURE__ */ React61.createElement(import_editor_controls43.PropProvider, { propType, setValue: setDynamicValue, value: { [bind]: dynamicValue } }, /* @__PURE__ */ React61.createElement(import_editor_controls43.PropKeyProvider, { bind }, children));
|
|
2497
2437
|
};
|
|
2498
2438
|
|
|
2499
2439
|
// src/dynamics/components/dynamic-selection.tsx
|
|
2500
|
-
var
|
|
2501
|
-
var
|
|
2440
|
+
var React62 = __toESM(require("react"));
|
|
2441
|
+
var import_react19 = require("react");
|
|
2502
2442
|
var import_editor_controls44 = require("@elementor/editor-controls");
|
|
2503
|
-
var
|
|
2504
|
-
var
|
|
2505
|
-
var
|
|
2443
|
+
var import_icons20 = require("@elementor/icons");
|
|
2444
|
+
var import_ui51 = require("@elementor/ui");
|
|
2445
|
+
var import_i18n42 = require("@wordpress/i18n");
|
|
2506
2446
|
var SIZE3 = "tiny";
|
|
2507
2447
|
var DynamicSelection = ({ onSelect }) => {
|
|
2508
|
-
const [searchValue, setSearchValue] = (0,
|
|
2448
|
+
const [searchValue, setSearchValue] = (0, import_react19.useState)("");
|
|
2509
2449
|
const { groups: dynamicGroups } = getAtomicDynamicTags() || {};
|
|
2510
2450
|
const { value: anyValue } = (0, import_editor_controls44.useBoundProp)();
|
|
2511
2451
|
const { bind, value: dynamicValue, setValue } = (0, import_editor_controls44.useBoundProp)(dynamicPropTypeUtil);
|
|
@@ -2522,22 +2462,22 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2522
2462
|
setValue({ name: value, settings: {} });
|
|
2523
2463
|
onSelect?.();
|
|
2524
2464
|
};
|
|
2525
|
-
return /* @__PURE__ */
|
|
2526
|
-
|
|
2465
|
+
return /* @__PURE__ */ React62.createElement(import_ui51.Stack, null, /* @__PURE__ */ React62.createElement(import_ui51.Box, { px: 1.5, pb: 1 }, /* @__PURE__ */ React62.createElement(
|
|
2466
|
+
import_ui51.TextField,
|
|
2527
2467
|
{
|
|
2528
2468
|
fullWidth: true,
|
|
2529
2469
|
size: SIZE3,
|
|
2530
2470
|
value: searchValue,
|
|
2531
2471
|
onChange: handleSearch,
|
|
2532
|
-
placeholder: (0,
|
|
2472
|
+
placeholder: (0, import_i18n42.__)("Search dynamic tag", "elementor"),
|
|
2533
2473
|
InputProps: {
|
|
2534
|
-
startAdornment: /* @__PURE__ */
|
|
2474
|
+
startAdornment: /* @__PURE__ */ React62.createElement(import_ui51.InputAdornment, { position: "start" }, /* @__PURE__ */ React62.createElement(import_icons20.SearchIcon, { fontSize: SIZE3 }))
|
|
2535
2475
|
}
|
|
2536
2476
|
}
|
|
2537
|
-
)), /* @__PURE__ */
|
|
2477
|
+
)), /* @__PURE__ */ React62.createElement(import_ui51.Divider, null), /* @__PURE__ */ React62.createElement(import_ui51.Box, { sx: { overflowY: "auto", height: 260, width: 220 } }, options10.length > 0 ? /* @__PURE__ */ React62.createElement(import_ui51.MenuList, { role: "listbox", tabIndex: 0 }, options10.map(([category, items3], index) => /* @__PURE__ */ React62.createElement(import_react19.Fragment, { key: index }, /* @__PURE__ */ React62.createElement(import_ui51.ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, dynamicGroups?.[category]?.title || category), items3.map(({ value, label: tagLabel }) => {
|
|
2538
2478
|
const isSelected = isCurrentValueDynamic && value === dynamicValue?.name;
|
|
2539
|
-
return /* @__PURE__ */
|
|
2540
|
-
|
|
2479
|
+
return /* @__PURE__ */ React62.createElement(
|
|
2480
|
+
import_ui51.MenuItem,
|
|
2541
2481
|
{
|
|
2542
2482
|
key: value,
|
|
2543
2483
|
selected: isSelected,
|
|
@@ -2547,16 +2487,16 @@ var DynamicSelection = ({ onSelect }) => {
|
|
|
2547
2487
|
},
|
|
2548
2488
|
tagLabel
|
|
2549
2489
|
);
|
|
2550
|
-
})))) : /* @__PURE__ */
|
|
2551
|
-
|
|
2490
|
+
})))) : /* @__PURE__ */ React62.createElement(import_ui51.Stack, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React62.createElement(import_icons20.PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React62.createElement(import_ui51.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n42.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React62.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React62.createElement(import_ui51.Typography, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React62.createElement(
|
|
2491
|
+
import_ui51.Link,
|
|
2552
2492
|
{
|
|
2553
2493
|
color: "secondary",
|
|
2554
2494
|
variant: "caption",
|
|
2555
2495
|
component: "button",
|
|
2556
2496
|
onClick: () => setSearchValue("")
|
|
2557
2497
|
},
|
|
2558
|
-
(0,
|
|
2559
|
-
), "\xA0", (0,
|
|
2498
|
+
(0, import_i18n42.__)("Clear the filters", "elementor")
|
|
2499
|
+
), "\xA0", (0, import_i18n42.__)("and try again.", "elementor")))));
|
|
2560
2500
|
};
|
|
2561
2501
|
var useFilteredOptions = (searchValue) => {
|
|
2562
2502
|
const dynamicTags = usePropDynamicTags();
|
|
@@ -2581,8 +2521,8 @@ var DynamicSelectionControl = () => {
|
|
|
2581
2521
|
const { bind, value } = (0, import_editor_controls45.useBoundProp)(dynamicPropTypeUtil);
|
|
2582
2522
|
const [propValueFromHistory] = usePersistDynamicValue(bind);
|
|
2583
2523
|
const { name: tagName = "" } = value;
|
|
2584
|
-
const selectionPopoverId = (0,
|
|
2585
|
-
const selectionPopoverState = (0,
|
|
2524
|
+
const selectionPopoverId = (0, import_react20.useId)();
|
|
2525
|
+
const selectionPopoverState = (0, import_ui52.usePopupState)({ variant: "popover", popupId: selectionPopoverId });
|
|
2586
2526
|
const dynamicTag = useDynamicTag(tagName);
|
|
2587
2527
|
const removeDynamicTag = () => {
|
|
2588
2528
|
setAnyValue(propValueFromHistory ?? null);
|
|
@@ -2590,70 +2530,70 @@ var DynamicSelectionControl = () => {
|
|
|
2590
2530
|
if (!dynamicTag) {
|
|
2591
2531
|
throw new Error(`Dynamic tag ${tagName} not found`);
|
|
2592
2532
|
}
|
|
2593
|
-
return /* @__PURE__ */
|
|
2594
|
-
|
|
2533
|
+
return /* @__PURE__ */ React63.createElement(import_ui52.Box, null, /* @__PURE__ */ React63.createElement(
|
|
2534
|
+
import_ui52.UnstableTag,
|
|
2595
2535
|
{
|
|
2596
2536
|
fullWidth: true,
|
|
2597
2537
|
showActionsOnHover: true,
|
|
2598
2538
|
label: dynamicTag.label,
|
|
2599
|
-
startIcon: /* @__PURE__ */
|
|
2600
|
-
...(0,
|
|
2601
|
-
actions: /* @__PURE__ */
|
|
2602
|
-
|
|
2539
|
+
startIcon: /* @__PURE__ */ React63.createElement(import_icons21.DatabaseIcon, { fontSize: SIZE4 }),
|
|
2540
|
+
...(0, import_ui52.bindTrigger)(selectionPopoverState),
|
|
2541
|
+
actions: /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(DynamicSettingsPopover, { dynamicTag }), /* @__PURE__ */ React63.createElement(
|
|
2542
|
+
import_ui52.IconButton,
|
|
2603
2543
|
{
|
|
2604
2544
|
size: SIZE4,
|
|
2605
2545
|
onClick: removeDynamicTag,
|
|
2606
|
-
"aria-label": (0,
|
|
2546
|
+
"aria-label": (0, import_i18n43.__)("Remove dynamic value", "elementor")
|
|
2607
2547
|
},
|
|
2608
|
-
/* @__PURE__ */
|
|
2548
|
+
/* @__PURE__ */ React63.createElement(import_icons21.XIcon, { fontSize: SIZE4 })
|
|
2609
2549
|
))
|
|
2610
2550
|
}
|
|
2611
|
-
), /* @__PURE__ */
|
|
2612
|
-
|
|
2551
|
+
), /* @__PURE__ */ React63.createElement(
|
|
2552
|
+
import_ui52.Popover,
|
|
2613
2553
|
{
|
|
2614
2554
|
disablePortal: true,
|
|
2615
2555
|
disableScrollLock: true,
|
|
2616
2556
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
2617
|
-
...(0,
|
|
2557
|
+
...(0, import_ui52.bindPopover)(selectionPopoverState)
|
|
2618
2558
|
},
|
|
2619
|
-
/* @__PURE__ */
|
|
2559
|
+
/* @__PURE__ */ React63.createElement(import_ui52.Stack, null, /* @__PURE__ */ React63.createElement(import_ui52.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React63.createElement(import_icons21.DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React63.createElement(import_ui52.Typography, { variant: "subtitle2" }, (0, import_i18n43.__)("Dynamic Tags", "elementor")), /* @__PURE__ */ React63.createElement(import_ui52.IconButton, { size: SIZE4, sx: { ml: "auto" }, onClick: selectionPopoverState.close }, /* @__PURE__ */ React63.createElement(import_icons21.XIcon, { fontSize: SIZE4 }))), /* @__PURE__ */ React63.createElement(DynamicSelection, { onSelect: selectionPopoverState.close }))
|
|
2620
2560
|
));
|
|
2621
2561
|
};
|
|
2622
2562
|
var DynamicSettingsPopover = ({ dynamicTag }) => {
|
|
2623
|
-
const popupId = (0,
|
|
2624
|
-
const settingsPopupState = (0,
|
|
2563
|
+
const popupId = (0, import_react20.useId)();
|
|
2564
|
+
const settingsPopupState = (0, import_ui52.usePopupState)({ variant: "popover", popupId });
|
|
2625
2565
|
const hasDynamicSettings = !!dynamicTag.atomic_controls.length;
|
|
2626
2566
|
if (!hasDynamicSettings) {
|
|
2627
2567
|
return null;
|
|
2628
2568
|
}
|
|
2629
|
-
return /* @__PURE__ */
|
|
2630
|
-
|
|
2569
|
+
return /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(
|
|
2570
|
+
import_ui52.IconButton,
|
|
2631
2571
|
{
|
|
2632
2572
|
size: SIZE4,
|
|
2633
|
-
...(0,
|
|
2634
|
-
"aria-label": (0,
|
|
2573
|
+
...(0, import_ui52.bindTrigger)(settingsPopupState),
|
|
2574
|
+
"aria-label": (0, import_i18n43.__)("Settings", "elementor")
|
|
2635
2575
|
},
|
|
2636
|
-
/* @__PURE__ */
|
|
2637
|
-
), /* @__PURE__ */
|
|
2638
|
-
|
|
2576
|
+
/* @__PURE__ */ React63.createElement(import_icons21.SettingsIcon, { fontSize: SIZE4 })
|
|
2577
|
+
), /* @__PURE__ */ React63.createElement(
|
|
2578
|
+
import_ui52.Popover,
|
|
2639
2579
|
{
|
|
2640
2580
|
disableScrollLock: true,
|
|
2641
2581
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
2642
|
-
...(0,
|
|
2582
|
+
...(0, import_ui52.bindPopover)(settingsPopupState)
|
|
2643
2583
|
},
|
|
2644
|
-
/* @__PURE__ */
|
|
2584
|
+
/* @__PURE__ */ React63.createElement(import_ui52.Paper, { component: import_ui52.Stack, sx: { minHeight: "300px", width: "220px" } }, /* @__PURE__ */ React63.createElement(import_ui52.Stack, { direction: "row", alignItems: "center", px: 1.5, pt: 2, pb: 1 }, /* @__PURE__ */ React63.createElement(import_icons21.DatabaseIcon, { fontSize: SIZE4, sx: { mr: 0.5 } }), /* @__PURE__ */ React63.createElement(import_ui52.Typography, { variant: "subtitle2" }, dynamicTag.label), /* @__PURE__ */ React63.createElement(import_ui52.IconButton, { sx: { ml: "auto" }, size: SIZE4, onClick: settingsPopupState.close }, /* @__PURE__ */ React63.createElement(import_icons21.XIcon, { fontSize: SIZE4 }))), /* @__PURE__ */ React63.createElement(DynamicSettings, { controls: dynamicTag.atomic_controls }))
|
|
2645
2585
|
));
|
|
2646
2586
|
};
|
|
2647
2587
|
var DynamicSettings = ({ controls }) => {
|
|
2648
2588
|
const tabs = controls.filter(({ type }) => type === "section");
|
|
2649
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
2589
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui52.useTabs)(0);
|
|
2650
2590
|
if (!tabs.length) {
|
|
2651
2591
|
return null;
|
|
2652
2592
|
}
|
|
2653
|
-
return /* @__PURE__ */
|
|
2654
|
-
return /* @__PURE__ */
|
|
2593
|
+
return /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(import_ui52.Tabs, { indicatorColor: "secondary", textColor: "secondary", ...getTabsProps() }, tabs.map(({ value }, index) => /* @__PURE__ */ React63.createElement(import_ui52.Tab, { key: index, label: value.label, sx: { px: 1, py: 0.5 }, ...getTabProps(index) }))), /* @__PURE__ */ React63.createElement(import_ui52.Divider, null), tabs.map(({ value }, index) => {
|
|
2594
|
+
return /* @__PURE__ */ React63.createElement(import_ui52.TabPanel, { key: index, sx: { flexGrow: 1 }, ...getTabPanelProps(index) }, /* @__PURE__ */ React63.createElement(import_ui52.Stack, { gap: 1, px: 2 }, value.items.map((item) => {
|
|
2655
2595
|
if (item.type === "control") {
|
|
2656
|
-
return /* @__PURE__ */
|
|
2596
|
+
return /* @__PURE__ */ React63.createElement(Control3, { key: item.value.bind, control: item.value });
|
|
2657
2597
|
}
|
|
2658
2598
|
return null;
|
|
2659
2599
|
})));
|
|
@@ -2663,22 +2603,22 @@ var Control3 = ({ control }) => {
|
|
|
2663
2603
|
if (!getControlByType(control.type)) {
|
|
2664
2604
|
return null;
|
|
2665
2605
|
}
|
|
2666
|
-
return /* @__PURE__ */
|
|
2606
|
+
return /* @__PURE__ */ React63.createElement(DynamicControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React63.createElement(import_editor_controls45.ControlLabel, null, control.label) : null, /* @__PURE__ */ React63.createElement(Control, { type: control.type, props: control.props }));
|
|
2667
2607
|
};
|
|
2668
2608
|
|
|
2669
2609
|
// src/dynamics/hooks/use-prop-dynamic-action.tsx
|
|
2670
|
-
var
|
|
2610
|
+
var React64 = __toESM(require("react"));
|
|
2671
2611
|
var import_editor_controls46 = require("@elementor/editor-controls");
|
|
2672
|
-
var
|
|
2673
|
-
var
|
|
2612
|
+
var import_icons22 = require("@elementor/icons");
|
|
2613
|
+
var import_i18n44 = require("@wordpress/i18n");
|
|
2674
2614
|
var usePropDynamicAction = () => {
|
|
2675
2615
|
const { propType } = (0, import_editor_controls46.useBoundProp)();
|
|
2676
2616
|
const visible = !!propType && supportsDynamic(propType);
|
|
2677
2617
|
return {
|
|
2678
2618
|
visible,
|
|
2679
|
-
icon:
|
|
2680
|
-
title: (0,
|
|
2681
|
-
popoverContent: ({ closePopover }) => /* @__PURE__ */
|
|
2619
|
+
icon: import_icons22.DatabaseIcon,
|
|
2620
|
+
title: (0, import_i18n44.__)("Dynamic Tags", "elementor"),
|
|
2621
|
+
popoverContent: ({ closePopover }) => /* @__PURE__ */ React64.createElement(DynamicSelection, { onSelect: closePopover })
|
|
2682
2622
|
};
|
|
2683
2623
|
};
|
|
2684
2624
|
|
|
@@ -2704,10 +2644,9 @@ function init2() {
|
|
|
2704
2644
|
component: EditingPanelHooks
|
|
2705
2645
|
});
|
|
2706
2646
|
init();
|
|
2707
|
-
initCssClasses();
|
|
2708
2647
|
}
|
|
2709
2648
|
var blockV1Panel = () => {
|
|
2710
|
-
(0,
|
|
2649
|
+
(0, import_editor_v1_adapters5.blockCommand)({
|
|
2711
2650
|
command: "panel/editor/open",
|
|
2712
2651
|
condition: isAtomicWidgetSelected
|
|
2713
2652
|
});
|
|
@@ -2718,8 +2657,6 @@ init2();
|
|
|
2718
2657
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2719
2658
|
0 && (module.exports = {
|
|
2720
2659
|
injectIntoClassSelectorActions,
|
|
2721
|
-
registerGlobalClassMenuItem,
|
|
2722
|
-
registerStateMenuItem,
|
|
2723
2660
|
replaceControl,
|
|
2724
2661
|
useBoundProp,
|
|
2725
2662
|
usePanelActions,
|