@elementor/editor-app-bar 0.14.0 → 0.14.2
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 +16 -0
- package/dist/index.d.mts +78 -196
- package/dist/index.d.ts +78 -196
- package/dist/index.js +774 -201
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +734 -162
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -8
- package/src/components/__tests__/app-bar.test.tsx +23 -0
- package/src/components/actions/action.tsx +33 -0
- package/src/components/actions/actions-group.tsx +69 -0
- package/src/components/actions/link.tsx +33 -0
- package/src/components/actions/toggle-action.tsx +35 -0
- package/src/components/app-bar.tsx +42 -0
- package/src/components/locations/__tests__/locations-components.test.tsx +37 -0
- package/src/components/locations/__tests__/menus.test.tsx +158 -0
- package/src/components/locations/integrations-menu-location.tsx +44 -0
- package/src/components/locations/main-menu-location.tsx +57 -0
- package/src/components/locations/page-indication-location.tsx +8 -0
- package/src/components/locations/primary-action-location.tsx +8 -0
- package/src/components/locations/responsive-location.tsx +8 -0
- package/src/components/locations/tools-menu-location.tsx +28 -0
- package/src/components/locations/utilities-menu-location.tsx +35 -0
- package/src/components/ui/popover-menu-item.tsx +47 -0
- package/src/components/ui/popover-menu.tsx +26 -0
- package/src/components/ui/popover-sub-menu.tsx +29 -0
- package/src/components/ui/toolbar-logo.tsx +84 -0
- package/src/components/ui/toolbar-menu-item.tsx +45 -0
- package/src/components/ui/toolbar-menu-more.tsx +29 -0
- package/src/components/ui/toolbar-menu-toggle-item.tsx +34 -0
- package/src/components/ui/toolbar-menu.tsx +15 -0
- package/src/contexts/menu-context.tsx +24 -0
- package/src/extensions/documents-indicator/index.ts +1 -1
- package/src/extensions/documents-preview/index.ts +1 -1
- package/src/extensions/documents-save/components/primary-action-menu.tsx +1 -1
- package/src/extensions/documents-save/hooks/use-document-copy-and-share-props.ts +1 -1
- package/src/extensions/documents-save/hooks/use-document-save-draft-props.ts +1 -1
- package/src/extensions/documents-save/hooks/use-document-save-template-props.ts +1 -1
- package/src/extensions/documents-save/index.ts +1 -1
- package/src/extensions/documents-save/locations.ts +1 -1
- package/src/extensions/elements/index.ts +1 -1
- package/src/extensions/finder/index.ts +1 -1
- package/src/extensions/help/index.ts +1 -1
- package/src/extensions/history/index.ts +1 -1
- package/src/extensions/keyboard-shortcuts/hooks/use-action-props.ts +1 -2
- package/src/extensions/keyboard-shortcuts/index.ts +1 -1
- package/src/extensions/site-settings/hooks/use-action-props.ts +1 -2
- package/src/extensions/site-settings/index.ts +1 -1
- package/src/extensions/structure/hooks/use-action-props.ts +1 -2
- package/src/extensions/structure/index.ts +1 -1
- package/src/extensions/theme-builder/hooks/use-action-props.ts +1 -2
- package/src/extensions/theme-builder/index.ts +1 -1
- package/src/extensions/user-preferences/hooks/use-action-props.ts +1 -2
- package/src/extensions/user-preferences/index.ts +1 -1
- package/src/extensions/wordpress/index.ts +1 -1
- package/src/index.ts +14 -10
- package/src/init.ts +1 -1
- package/src/locations/__tests__/menus.test.tsx +212 -0
- package/src/locations/index.ts +27 -0
- package/src/locations/menus.tsx +172 -0
- package/src/types.ts +4 -0
package/dist/index.js
CHANGED
|
@@ -31,23 +31,632 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
documentOptionsMenu: () => documentOptionsMenu,
|
|
34
|
-
injectIntoPageIndication: () =>
|
|
35
|
-
injectIntoPrimaryAction: () =>
|
|
36
|
-
injectIntoResponsive: () =>
|
|
37
|
-
integrationsMenu: () =>
|
|
38
|
-
mainMenu: () =>
|
|
39
|
-
toolsMenu: () =>
|
|
40
|
-
utilitiesMenu: () =>
|
|
34
|
+
injectIntoPageIndication: () => injectIntoPageIndication,
|
|
35
|
+
injectIntoPrimaryAction: () => injectIntoPrimaryAction,
|
|
36
|
+
injectIntoResponsive: () => injectIntoResponsive,
|
|
37
|
+
integrationsMenu: () => integrationsMenu,
|
|
38
|
+
mainMenu: () => mainMenu,
|
|
39
|
+
toolsMenu: () => toolsMenu,
|
|
40
|
+
utilitiesMenu: () => utilitiesMenu
|
|
41
41
|
});
|
|
42
42
|
module.exports = __toCommonJS(src_exports);
|
|
43
|
-
|
|
43
|
+
|
|
44
|
+
// src/locations/menus.tsx
|
|
45
|
+
var React11 = __toESM(require("react"));
|
|
46
|
+
var import_react3 = require("react");
|
|
47
|
+
var import_locations = require("@elementor/locations");
|
|
48
|
+
|
|
49
|
+
// src/components/actions/action.tsx
|
|
50
|
+
var React4 = __toESM(require("react"));
|
|
51
|
+
|
|
52
|
+
// src/contexts/menu-context.tsx
|
|
53
|
+
var React = __toESM(require("react"));
|
|
54
|
+
var import_react = require("react");
|
|
55
|
+
var MenuContext = (0, import_react.createContext)({
|
|
56
|
+
type: "toolbar"
|
|
57
|
+
});
|
|
58
|
+
function MenuContextProvider({ type, popupState, children }) {
|
|
59
|
+
return /* @__PURE__ */ React.createElement(MenuContext.Provider, { value: { type, popupState } }, children);
|
|
60
|
+
}
|
|
61
|
+
function useMenuContext() {
|
|
62
|
+
return (0, import_react.useContext)(MenuContext);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// src/components/ui/toolbar-menu-item.tsx
|
|
66
|
+
var React2 = __toESM(require("react"));
|
|
67
|
+
var import_ui = require("@elementor/ui");
|
|
68
|
+
function ToolbarMenuItem({ title, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ React2.createElement(Tooltip, { title }, /* @__PURE__ */ React2.createElement(import_ui.Box, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React2.createElement(
|
|
70
|
+
import_ui.IconButton,
|
|
71
|
+
{
|
|
72
|
+
...props,
|
|
73
|
+
"aria-label": title,
|
|
74
|
+
size: "medium",
|
|
75
|
+
sx: {
|
|
76
|
+
"& svg": {
|
|
77
|
+
fontSize: "1.25rem",
|
|
78
|
+
height: "1em",
|
|
79
|
+
width: "1em"
|
|
80
|
+
},
|
|
81
|
+
"&:hover": {
|
|
82
|
+
color: "text.primary"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
)));
|
|
87
|
+
}
|
|
88
|
+
function Tooltip(props) {
|
|
89
|
+
return /* @__PURE__ */ React2.createElement(
|
|
90
|
+
import_ui.Tooltip,
|
|
91
|
+
{
|
|
92
|
+
PopperProps: {
|
|
93
|
+
sx: {
|
|
94
|
+
"&.MuiTooltip-popper .MuiTooltip-tooltip.MuiTooltip-tooltipPlacementBottom": {
|
|
95
|
+
mt: 2
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
...props
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// src/components/ui/popover-menu-item.tsx
|
|
105
|
+
var React3 = __toESM(require("react"));
|
|
106
|
+
var import_ui2 = require("@elementor/ui");
|
|
107
|
+
var import_icons = require("@elementor/icons");
|
|
108
|
+
var DirectionalArrowIcon = (0, import_ui2.withDirection)(import_icons.ArrowUpRightIcon);
|
|
109
|
+
var DirectionalChevronIcon = (0, import_ui2.withDirection)(import_icons.ChevronRightIcon);
|
|
110
|
+
function PopoverMenuItem({ text, icon, onClick, href, target, disabled, isGroupParent, ...props }) {
|
|
111
|
+
const isExternalLink = href && target === "_blank";
|
|
112
|
+
return /* @__PURE__ */ React3.createElement(
|
|
113
|
+
import_ui2.MenuItem,
|
|
114
|
+
{
|
|
115
|
+
...props,
|
|
116
|
+
disabled,
|
|
117
|
+
onClick,
|
|
118
|
+
component: href ? "a" : "div",
|
|
119
|
+
href,
|
|
120
|
+
target,
|
|
121
|
+
sx: {
|
|
122
|
+
"&:hover": {
|
|
123
|
+
color: "text.primary"
|
|
124
|
+
// Overriding global CSS from the editor.
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
/* @__PURE__ */ React3.createElement(import_ui2.ListItemIcon, null, icon),
|
|
129
|
+
/* @__PURE__ */ React3.createElement(import_ui2.ListItemText, { primary: text }),
|
|
130
|
+
isExternalLink && /* @__PURE__ */ React3.createElement(DirectionalArrowIcon, null),
|
|
131
|
+
isGroupParent && /* @__PURE__ */ React3.createElement(DirectionalChevronIcon, null)
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// src/components/actions/action.tsx
|
|
136
|
+
function Action({ icon: Icon, title, visible = true, ...props }) {
|
|
137
|
+
const { type } = useMenuContext();
|
|
138
|
+
if (!visible) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
return type === "toolbar" ? /* @__PURE__ */ React4.createElement(ToolbarMenuItem, { title, ...props }, /* @__PURE__ */ React4.createElement(Icon, null)) : /* @__PURE__ */ React4.createElement(
|
|
142
|
+
PopoverMenuItem,
|
|
143
|
+
{
|
|
144
|
+
...props,
|
|
145
|
+
text: title,
|
|
146
|
+
icon: /* @__PURE__ */ React4.createElement(Icon, null)
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// src/components/actions/toggle-action.tsx
|
|
152
|
+
var React6 = __toESM(require("react"));
|
|
153
|
+
|
|
154
|
+
// src/components/ui/toolbar-menu-toggle-item.tsx
|
|
155
|
+
var React5 = __toESM(require("react"));
|
|
156
|
+
var import_ui3 = require("@elementor/ui");
|
|
157
|
+
function ToolbarMenuToggleItem({ title, onClick, ...props }) {
|
|
158
|
+
return /* @__PURE__ */ React5.createElement(import_ui3.Tooltip, { title }, /* @__PURE__ */ React5.createElement(import_ui3.Box, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React5.createElement(
|
|
159
|
+
import_ui3.ToggleButton,
|
|
160
|
+
{
|
|
161
|
+
...props,
|
|
162
|
+
onChange: onClick,
|
|
163
|
+
"aria-label": title,
|
|
164
|
+
size: "small",
|
|
165
|
+
sx: {
|
|
166
|
+
border: 0,
|
|
167
|
+
// Temp fix until the style of the ToggleButton component will be decided.
|
|
168
|
+
"&.Mui-disabled": {
|
|
169
|
+
border: 0
|
|
170
|
+
// Temp fix until the style of the ToggleButton component will be decided.
|
|
171
|
+
},
|
|
172
|
+
"& svg": {
|
|
173
|
+
fontSize: "1.25rem",
|
|
174
|
+
height: "1em",
|
|
175
|
+
width: "1em"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
)));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// src/components/actions/toggle-action.tsx
|
|
183
|
+
function ToggleAction({ icon: Icon, title, value, visible = true, ...props }) {
|
|
184
|
+
const { type } = useMenuContext();
|
|
185
|
+
if (!visible) {
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
return type === "toolbar" ? /* @__PURE__ */ React6.createElement(ToolbarMenuToggleItem, { value: value || title, title, ...props }, /* @__PURE__ */ React6.createElement(Icon, null)) : /* @__PURE__ */ React6.createElement(
|
|
189
|
+
PopoverMenuItem,
|
|
190
|
+
{
|
|
191
|
+
...props,
|
|
192
|
+
text: title,
|
|
193
|
+
icon: /* @__PURE__ */ React6.createElement(Icon, null)
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// src/components/actions/link.tsx
|
|
199
|
+
var React7 = __toESM(require("react"));
|
|
200
|
+
function Link({ icon: Icon, title, visible = true, ...props }) {
|
|
201
|
+
const { type } = useMenuContext();
|
|
202
|
+
if (!visible) {
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
return type === "toolbar" ? /* @__PURE__ */ React7.createElement(ToolbarMenuItem, { title, ...props }, /* @__PURE__ */ React7.createElement(Icon, null)) : /* @__PURE__ */ React7.createElement(
|
|
206
|
+
PopoverMenuItem,
|
|
207
|
+
{
|
|
208
|
+
...props,
|
|
209
|
+
text: title,
|
|
210
|
+
icon: /* @__PURE__ */ React7.createElement(Icon, null)
|
|
211
|
+
}
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// src/components/actions/actions-group.tsx
|
|
216
|
+
var React10 = __toESM(require("react"));
|
|
217
|
+
var import_react2 = require("react");
|
|
218
|
+
|
|
219
|
+
// src/components/ui/popover-sub-menu.tsx
|
|
220
|
+
var React9 = __toESM(require("react"));
|
|
221
|
+
|
|
222
|
+
// src/components/ui/popover-menu.tsx
|
|
223
|
+
var React8 = __toESM(require("react"));
|
|
224
|
+
var import_ui4 = require("@elementor/ui");
|
|
225
|
+
function PopoverMenu({ children, popupState, ...props }) {
|
|
226
|
+
return /* @__PURE__ */ React8.createElement(MenuContextProvider, { type: "popover", popupState }, /* @__PURE__ */ React8.createElement(
|
|
227
|
+
import_ui4.Menu,
|
|
228
|
+
{
|
|
229
|
+
PaperProps: {
|
|
230
|
+
sx: { mt: 1.5 }
|
|
231
|
+
},
|
|
232
|
+
...props,
|
|
233
|
+
MenuListProps: {
|
|
234
|
+
component: "div",
|
|
235
|
+
dense: true
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
children
|
|
239
|
+
));
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// src/components/ui/popover-sub-menu.tsx
|
|
243
|
+
var import_ui5 = require("@elementor/ui");
|
|
244
|
+
function PopoverSubMenu({ children, ...props }) {
|
|
245
|
+
const theme = (0, import_ui5.useTheme)();
|
|
246
|
+
const isRTL = theme.direction === "rtl";
|
|
247
|
+
return /* @__PURE__ */ React9.createElement(
|
|
248
|
+
PopoverMenu,
|
|
249
|
+
{
|
|
250
|
+
sx: { pointerEvents: "none" },
|
|
251
|
+
PaperProps: {
|
|
252
|
+
sx: {
|
|
253
|
+
// This is a workaround to support RTL in PopoverMenu, since it doesn't support it yet.
|
|
254
|
+
...isRTL ? { marginInlineEnd: -1 } : { marginInlineStart: 1 },
|
|
255
|
+
pointerEvents: "auto"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
anchorOrigin: { vertical: "center", horizontal: isRTL ? "left" : "right" },
|
|
259
|
+
transformOrigin: { vertical: "center", horizontal: isRTL ? "right" : "left" },
|
|
260
|
+
...props
|
|
261
|
+
},
|
|
262
|
+
children
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// src/components/actions/actions-group.tsx
|
|
267
|
+
var import_ui6 = require("@elementor/ui");
|
|
268
|
+
function ActionsGroup({ icon: Icon, title, visible = true, items, ...props }) {
|
|
269
|
+
const groupId = (0, import_react2.useId)();
|
|
270
|
+
const { type, popupState: parentPopupState } = useMenuContext();
|
|
271
|
+
const popupState = (0, import_ui6.usePopupState)({
|
|
272
|
+
parentPopupState,
|
|
273
|
+
variant: "popover",
|
|
274
|
+
popupId: "elementor-v2-app-bar-actions-group-" + groupId
|
|
275
|
+
});
|
|
276
|
+
if (!visible) {
|
|
277
|
+
return null;
|
|
278
|
+
}
|
|
279
|
+
if (type === "toolbar") {
|
|
280
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(ToolbarMenuItem, { ...(0, import_ui6.bindTrigger)(popupState), title, ...props }, /* @__PURE__ */ React10.createElement(Icon, null)), /* @__PURE__ */ React10.createElement(
|
|
281
|
+
PopoverMenu,
|
|
282
|
+
{
|
|
283
|
+
onClick: popupState.close,
|
|
284
|
+
...(0, import_ui6.bindMenu)(popupState),
|
|
285
|
+
marginThreshold: 8,
|
|
286
|
+
open: popupState.isOpen,
|
|
287
|
+
popupState
|
|
288
|
+
},
|
|
289
|
+
items.map(({ MenuItem: MenuItem2, id: key }) => /* @__PURE__ */ React10.createElement(MenuItem2, { key }))
|
|
290
|
+
));
|
|
291
|
+
}
|
|
292
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(
|
|
293
|
+
PopoverMenuItem,
|
|
294
|
+
{
|
|
295
|
+
...props,
|
|
296
|
+
...(0, import_ui6.bindHover)(popupState),
|
|
297
|
+
...(0, import_ui6.bindFocus)(popupState),
|
|
298
|
+
text: title,
|
|
299
|
+
icon: /* @__PURE__ */ React10.createElement(Icon, null),
|
|
300
|
+
isGroupParent: true
|
|
301
|
+
}
|
|
302
|
+
), /* @__PURE__ */ React10.createElement(
|
|
303
|
+
PopoverSubMenu,
|
|
304
|
+
{
|
|
305
|
+
...props,
|
|
306
|
+
...(0, import_ui6.bindPopover)(popupState),
|
|
307
|
+
popupState
|
|
308
|
+
},
|
|
309
|
+
items.map(({ MenuItem: MenuItem2, id: key }) => /* @__PURE__ */ React10.createElement(MenuItem2, { key }))
|
|
310
|
+
));
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// src/locations/menus.tsx
|
|
314
|
+
function createMenu(groups = []) {
|
|
315
|
+
const menuGroups = [
|
|
316
|
+
...groups,
|
|
317
|
+
"default"
|
|
318
|
+
];
|
|
319
|
+
const locations = menuGroups.reduce(
|
|
320
|
+
(carry, group) => ({
|
|
321
|
+
...carry,
|
|
322
|
+
[group]: (0, import_locations.createLocation)()
|
|
323
|
+
}),
|
|
324
|
+
{}
|
|
325
|
+
);
|
|
326
|
+
const [
|
|
327
|
+
registerAction,
|
|
328
|
+
registerToggleAction,
|
|
329
|
+
registerLink
|
|
330
|
+
] = [Action, ToggleAction, Link].map(
|
|
331
|
+
(Component) => createRegisterMenuItem({
|
|
332
|
+
locations,
|
|
333
|
+
menuGroups,
|
|
334
|
+
component: Component
|
|
335
|
+
})
|
|
336
|
+
);
|
|
337
|
+
const useMenuItems6 = createUseMenuItems(locations);
|
|
338
|
+
const registerSubMenu = createRegisterSubMenu({
|
|
339
|
+
locations,
|
|
340
|
+
menuGroups
|
|
341
|
+
});
|
|
342
|
+
return {
|
|
343
|
+
registerAction,
|
|
344
|
+
registerToggleAction,
|
|
345
|
+
registerLink,
|
|
346
|
+
registerSubMenu,
|
|
347
|
+
useMenuItems: useMenuItems6
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
function createRegisterMenuItem({ locations, menuGroups, component, useMenuItems: useMenuItems6 }) {
|
|
351
|
+
return ({ group = "default", id, overwrite, priority, ...args }) => {
|
|
352
|
+
if (!menuGroups.includes(group)) {
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
const useProps = "props" in args ? () => args.props : args.useProps;
|
|
356
|
+
const Component = component;
|
|
357
|
+
const InjectedComponent = (props) => {
|
|
358
|
+
const componentProps = useProps();
|
|
359
|
+
const items = useMenuItems6?.();
|
|
360
|
+
if (items?.length) {
|
|
361
|
+
return /* @__PURE__ */ React11.createElement(
|
|
362
|
+
Component,
|
|
363
|
+
{
|
|
364
|
+
...props,
|
|
365
|
+
...componentProps,
|
|
366
|
+
items
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
return /* @__PURE__ */ React11.createElement(Component, { ...props, ...componentProps });
|
|
371
|
+
};
|
|
372
|
+
locations[group].inject({
|
|
373
|
+
id,
|
|
374
|
+
component: InjectedComponent,
|
|
375
|
+
options: {
|
|
376
|
+
priority,
|
|
377
|
+
overwrite
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
function createRegisterSubMenu({ locations, menuGroups }) {
|
|
383
|
+
return (args) => {
|
|
384
|
+
const menu = createMenu();
|
|
385
|
+
createRegisterMenuItem({
|
|
386
|
+
locations,
|
|
387
|
+
menuGroups,
|
|
388
|
+
component: ActionsGroup,
|
|
389
|
+
useMenuItems: () => menu.useMenuItems().default
|
|
390
|
+
})(args);
|
|
391
|
+
return menu;
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
function createUseMenuItems(locations) {
|
|
395
|
+
return () => {
|
|
396
|
+
return (0, import_react3.useMemo)(() => {
|
|
397
|
+
return Object.entries(locations).reduce(
|
|
398
|
+
(carry, [groupName, location]) => {
|
|
399
|
+
const items = location.getInjections().map((injection) => ({
|
|
400
|
+
id: injection.id,
|
|
401
|
+
MenuItem: injection.component
|
|
402
|
+
}));
|
|
403
|
+
return {
|
|
404
|
+
...carry,
|
|
405
|
+
[groupName]: items
|
|
406
|
+
};
|
|
407
|
+
},
|
|
408
|
+
{}
|
|
409
|
+
);
|
|
410
|
+
}, []);
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// src/locations/index.ts
|
|
415
|
+
var import_locations2 = require("@elementor/locations");
|
|
416
|
+
var {
|
|
417
|
+
inject: injectIntoPageIndication,
|
|
418
|
+
Slot: PageIndicationSlot
|
|
419
|
+
} = (0, import_locations2.createLocation)();
|
|
420
|
+
var {
|
|
421
|
+
inject: injectIntoResponsive,
|
|
422
|
+
Slot: ResponsiveSlot
|
|
423
|
+
} = (0, import_locations2.createLocation)();
|
|
424
|
+
var {
|
|
425
|
+
inject: injectIntoPrimaryAction,
|
|
426
|
+
Slot: PrimaryActionSlot
|
|
427
|
+
} = (0, import_locations2.createLocation)();
|
|
428
|
+
var mainMenu = createMenu(["exits"]);
|
|
429
|
+
var toolsMenu = createMenu();
|
|
430
|
+
var utilitiesMenu = createMenu();
|
|
431
|
+
var integrationsMenu = createMenu();
|
|
44
432
|
|
|
45
433
|
// src/extensions/documents-save/locations.ts
|
|
46
|
-
var
|
|
47
|
-
|
|
434
|
+
var documentOptionsMenu = createMenu(["save"]);
|
|
435
|
+
|
|
436
|
+
// src/components/app-bar.tsx
|
|
437
|
+
var React22 = __toESM(require("react"));
|
|
438
|
+
var import_ui13 = require("@elementor/ui");
|
|
439
|
+
|
|
440
|
+
// src/components/locations/main-menu-location.tsx
|
|
441
|
+
var React13 = __toESM(require("react"));
|
|
442
|
+
var import_ui8 = require("@elementor/ui");
|
|
443
|
+
|
|
444
|
+
// src/components/ui/toolbar-logo.tsx
|
|
445
|
+
var React12 = __toESM(require("react"));
|
|
446
|
+
var import_react4 = require("react");
|
|
447
|
+
var import_i18n = require("@wordpress/i18n");
|
|
448
|
+
var import_ui7 = require("@elementor/ui");
|
|
449
|
+
var ElementorLogo = (props) => {
|
|
450
|
+
return /* @__PURE__ */ React12.createElement(import_ui7.SvgIcon, { viewBox: "0 0 32 32", ...props }, /* @__PURE__ */ React12.createElement("g", null, /* @__PURE__ */ React12.createElement("circle", { cx: "16", cy: "16", r: "16" }), /* @__PURE__ */ React12.createElement("path", { d: "M11.7 9H9V22.3H11.7V9Z" }), /* @__PURE__ */ React12.createElement("path", { d: "M22.4 9H9V11.7H22.4V9Z" }), /* @__PURE__ */ React12.createElement("path", { d: "M22.4 14.4004H9V17.1004H22.4V14.4004Z" }), /* @__PURE__ */ React12.createElement("path", { d: "M22.4 19.6992H9V22.3992H22.4V19.6992Z" })));
|
|
451
|
+
};
|
|
452
|
+
var StyledToggleButton = (0, import_ui7.styled)(import_ui7.ToggleButton)(({ theme }) => ({
|
|
453
|
+
padding: 0,
|
|
454
|
+
border: 0,
|
|
455
|
+
color: theme.palette.text.primary,
|
|
456
|
+
"&.MuiToggleButton-root:hover": {
|
|
457
|
+
backgroundColor: "initial"
|
|
458
|
+
},
|
|
459
|
+
"&.MuiToggleButton-root.Mui-selected": {
|
|
460
|
+
backgroundColor: "initial"
|
|
461
|
+
}
|
|
462
|
+
}));
|
|
463
|
+
var StyledElementorLogo = (0, import_ui7.styled)(ElementorLogo, {
|
|
464
|
+
shouldForwardProp: (prop) => prop !== "showMenuIcon"
|
|
465
|
+
})(({ theme, showMenuIcon }) => ({
|
|
466
|
+
"& path": {
|
|
467
|
+
fill: theme.palette.background.default,
|
|
468
|
+
transition: "all 0.2s linear",
|
|
469
|
+
transformOrigin: "bottom left",
|
|
470
|
+
"&:first-of-type": {
|
|
471
|
+
transitionDelay: !showMenuIcon && "0.2s",
|
|
472
|
+
transform: showMenuIcon && "translateY(-9px) scaleY(0)"
|
|
473
|
+
},
|
|
474
|
+
"&:not(:first-of-type)": {
|
|
475
|
+
// Emotion automatically change 4 to -4 in RTL moode.
|
|
476
|
+
transform: !showMenuIcon && `translateX(${theme.direction === "rtl" ? "4" : "9"}px) scaleX(0.6)`
|
|
477
|
+
},
|
|
478
|
+
"&:nth-of-type(2)": {
|
|
479
|
+
transitionDelay: showMenuIcon ? "0" : "0.2s"
|
|
480
|
+
},
|
|
481
|
+
"&:nth-of-type(3)": {
|
|
482
|
+
transitionDelay: "0.1s"
|
|
483
|
+
},
|
|
484
|
+
"&:nth-of-type(4)": {
|
|
485
|
+
transitionDelay: showMenuIcon ? "0.2s" : "0"
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}));
|
|
489
|
+
function ToolbarLogo(props) {
|
|
490
|
+
const [isHoverState, setIsHoverState] = (0, import_react4.useState)(false);
|
|
491
|
+
const showMenuIcon = props.selected || isHoverState;
|
|
492
|
+
return /* @__PURE__ */ React12.createElement(
|
|
493
|
+
StyledToggleButton,
|
|
494
|
+
{
|
|
495
|
+
...props,
|
|
496
|
+
value: "selected",
|
|
497
|
+
size: "large",
|
|
498
|
+
onMouseEnter: () => setIsHoverState(true),
|
|
499
|
+
onMouseLeave: () => setIsHoverState(false)
|
|
500
|
+
},
|
|
501
|
+
/* @__PURE__ */ React12.createElement(
|
|
502
|
+
StyledElementorLogo,
|
|
503
|
+
{
|
|
504
|
+
fontSize: "large",
|
|
505
|
+
showMenuIcon,
|
|
506
|
+
titleAccess: (0, import_i18n.__)("Elementor Logo", "elementor")
|
|
507
|
+
}
|
|
508
|
+
)
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// src/components/locations/main-menu-location.tsx
|
|
513
|
+
var { useMenuItems } = mainMenu;
|
|
514
|
+
function MainMenuLocation() {
|
|
515
|
+
const menuItems = useMenuItems();
|
|
516
|
+
const popupState = (0, import_ui8.usePopupState)({
|
|
517
|
+
variant: "popover",
|
|
518
|
+
popupId: "elementor-v2-app-bar-main-menu"
|
|
519
|
+
});
|
|
520
|
+
const toolbarLogoProps = (0, import_ui8.bindTrigger)(popupState);
|
|
521
|
+
const onToolbarClick = (e) => {
|
|
522
|
+
const extendedWindow = window;
|
|
523
|
+
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
524
|
+
if (config) {
|
|
525
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
526
|
+
config.names.topBar.elementorLogoDropdown,
|
|
527
|
+
{
|
|
528
|
+
location: config.locations.topBar,
|
|
529
|
+
secondaryLocation: config.secondaryLocations.elementorLogo,
|
|
530
|
+
trigger: config.triggers.dropdownClick,
|
|
531
|
+
element: config.elements.buttonIcon
|
|
532
|
+
}
|
|
533
|
+
);
|
|
534
|
+
}
|
|
535
|
+
toolbarLogoProps.onClick(e);
|
|
536
|
+
};
|
|
537
|
+
return /* @__PURE__ */ React13.createElement(import_ui8.Stack, { sx: { paddingInlineStart: 3 }, direction: "row", alignItems: "center" }, /* @__PURE__ */ React13.createElement(
|
|
538
|
+
ToolbarLogo,
|
|
539
|
+
{
|
|
540
|
+
...toolbarLogoProps,
|
|
541
|
+
onClick: onToolbarClick,
|
|
542
|
+
selected: popupState.isOpen
|
|
543
|
+
}
|
|
544
|
+
), /* @__PURE__ */ React13.createElement(
|
|
545
|
+
PopoverMenu,
|
|
546
|
+
{
|
|
547
|
+
onClick: popupState.close,
|
|
548
|
+
...(0, import_ui8.bindMenu)(popupState),
|
|
549
|
+
marginThreshold: 8
|
|
550
|
+
},
|
|
551
|
+
menuItems.default.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React13.createElement(MenuItem2, { key: id })),
|
|
552
|
+
menuItems.exits.length > 0 && /* @__PURE__ */ React13.createElement(import_ui8.Divider, null),
|
|
553
|
+
menuItems.exits.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React13.createElement(MenuItem2, { key: id }))
|
|
554
|
+
));
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// src/components/locations/tools-menu-location.tsx
|
|
558
|
+
var React17 = __toESM(require("react"));
|
|
559
|
+
|
|
560
|
+
// src/components/ui/toolbar-menu.tsx
|
|
561
|
+
var React14 = __toESM(require("react"));
|
|
562
|
+
var import_ui9 = require("@elementor/ui");
|
|
563
|
+
function ToolbarMenu({ children, ...props }) {
|
|
564
|
+
return /* @__PURE__ */ React14.createElement(MenuContextProvider, { type: "toolbar" }, /* @__PURE__ */ React14.createElement(import_ui9.Stack, { sx: { px: 1.5 }, spacing: 1.5, direction: "row", alignItems: "center", ...props }, children));
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
// src/components/ui/toolbar-menu-more.tsx
|
|
568
|
+
var React15 = __toESM(require("react"));
|
|
569
|
+
var import_ui10 = require("@elementor/ui");
|
|
570
|
+
var import_i18n2 = require("@wordpress/i18n");
|
|
571
|
+
var import_icons2 = require("@elementor/icons");
|
|
572
|
+
function ToolbarMenuMore({ children, id }) {
|
|
573
|
+
const popupState = (0, import_ui10.usePopupState)({
|
|
574
|
+
variant: "popover",
|
|
575
|
+
popupId: id
|
|
576
|
+
});
|
|
577
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(ToolbarMenuItem, { ...(0, import_ui10.bindTrigger)(popupState), title: (0, import_i18n2.__)("More", "elementor") }, /* @__PURE__ */ React15.createElement(import_icons2.DotsVerticalIcon, null)), /* @__PURE__ */ React15.createElement(PopoverMenu, { onClick: popupState.close, ...(0, import_ui10.bindMenu)(popupState) }, children));
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// src/components/locations/integrations-menu-location.tsx
|
|
581
|
+
var React16 = __toESM(require("react"));
|
|
582
|
+
var import_ui11 = require("@elementor/ui");
|
|
583
|
+
var import_i18n3 = require("@wordpress/i18n");
|
|
584
|
+
var import_icons3 = require("@elementor/icons");
|
|
585
|
+
var { useMenuItems: useMenuItems2 } = integrationsMenu;
|
|
586
|
+
function IntegrationsMenuLocation() {
|
|
587
|
+
const menuItems = useMenuItems2();
|
|
588
|
+
const popupState = (0, import_ui11.usePopupState)({
|
|
589
|
+
variant: "popover",
|
|
590
|
+
popupId: "elementor-v2-app-bar-integrations"
|
|
591
|
+
});
|
|
592
|
+
if (menuItems.default.length === 0) {
|
|
593
|
+
return null;
|
|
594
|
+
}
|
|
595
|
+
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(ToolbarMenuItem, { ...(0, import_ui11.bindTrigger)(popupState), title: (0, import_i18n3.__)("Integrations", "elementor") }, /* @__PURE__ */ React16.createElement(import_icons3.PlugIcon, null)), /* @__PURE__ */ React16.createElement(
|
|
596
|
+
PopoverMenu,
|
|
597
|
+
{
|
|
598
|
+
onClick: popupState.close,
|
|
599
|
+
...(0, import_ui11.bindMenu)(popupState),
|
|
600
|
+
marginThreshold: 8,
|
|
601
|
+
open: popupState.isOpen
|
|
602
|
+
},
|
|
603
|
+
menuItems.default.map(
|
|
604
|
+
({ MenuItem: IntegrationsMenuItem, id }) => /* @__PURE__ */ React16.createElement(IntegrationsMenuItem, { key: id })
|
|
605
|
+
)
|
|
606
|
+
));
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
// src/components/locations/tools-menu-location.tsx
|
|
610
|
+
var MAX_TOOLBAR_ACTIONS = 5;
|
|
611
|
+
var { useMenuItems: useMenuItems3 } = toolsMenu;
|
|
612
|
+
function ToolsMenuLocation() {
|
|
613
|
+
const menuItems = useMenuItems3();
|
|
614
|
+
const toolbarMenuItems = menuItems.default.slice(0, MAX_TOOLBAR_ACTIONS);
|
|
615
|
+
const popoverMenuItems = menuItems.default.slice(MAX_TOOLBAR_ACTIONS);
|
|
616
|
+
return /* @__PURE__ */ React17.createElement(ToolbarMenu, null, toolbarMenuItems.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React17.createElement(MenuItem2, { key: id })), /* @__PURE__ */ React17.createElement(IntegrationsMenuLocation, null), popoverMenuItems.length > 0 && /* @__PURE__ */ React17.createElement(ToolbarMenuMore, { id: "elementor-editor-app-bar-tools-more" }, popoverMenuItems.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React17.createElement(MenuItem2, { key: id }))));
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
// src/components/locations/utilities-menu-location.tsx
|
|
620
|
+
var React18 = __toESM(require("react"));
|
|
621
|
+
var import_react5 = require("react");
|
|
622
|
+
var import_ui12 = require("@elementor/ui");
|
|
623
|
+
var MAX_TOOLBAR_ACTIONS2 = 4;
|
|
624
|
+
var { useMenuItems: useMenuItems4 } = utilitiesMenu;
|
|
625
|
+
function UtilitiesMenuLocation() {
|
|
626
|
+
const menuItems = useMenuItems4();
|
|
627
|
+
const toolbarMenuItems = menuItems.default.slice(0, MAX_TOOLBAR_ACTIONS2);
|
|
628
|
+
const popoverMenuItems = menuItems.default.slice(MAX_TOOLBAR_ACTIONS2);
|
|
629
|
+
return /* @__PURE__ */ React18.createElement(ToolbarMenu, null, toolbarMenuItems.map(
|
|
630
|
+
({ MenuItem: MenuItem2, id }, index) => /* @__PURE__ */ React18.createElement(import_react5.Fragment, { key: id }, index === 0 && /* @__PURE__ */ React18.createElement(import_ui12.Divider, { orientation: "vertical" }), /* @__PURE__ */ React18.createElement(MenuItem2, null))
|
|
631
|
+
), popoverMenuItems.length > 0 && /* @__PURE__ */ React18.createElement(ToolbarMenuMore, { id: "elementor-editor-app-bar-utilities-more" }, popoverMenuItems.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React18.createElement(MenuItem2, { key: id }))));
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
// src/components/locations/primary-action-location.tsx
|
|
635
|
+
var React19 = __toESM(require("react"));
|
|
636
|
+
function PrimaryActionLocation() {
|
|
637
|
+
return /* @__PURE__ */ React19.createElement(PrimaryActionSlot, null);
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
// src/components/locations/page-indication-location.tsx
|
|
641
|
+
var React20 = __toESM(require("react"));
|
|
642
|
+
function PageIndicationLocation() {
|
|
643
|
+
return /* @__PURE__ */ React20.createElement(PageIndicationSlot, null);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
// src/components/locations/responsive-location.tsx
|
|
647
|
+
var React21 = __toESM(require("react"));
|
|
648
|
+
function ResponsiveLocation() {
|
|
649
|
+
return /* @__PURE__ */ React21.createElement(ResponsiveSlot, null);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
// src/components/app-bar.tsx
|
|
653
|
+
var import_editor_documents = require("@elementor/editor-documents");
|
|
654
|
+
function AppBar() {
|
|
655
|
+
const document2 = (0, import_editor_documents.__useActiveDocument)();
|
|
656
|
+
return /* @__PURE__ */ React22.createElement(import_ui13.ThemeProvider, { colorScheme: "dark" }, /* @__PURE__ */ React22.createElement(import_ui13.AppBar, { position: "sticky" }, /* @__PURE__ */ React22.createElement(import_ui13.Toolbar, { disableGutters: true, variant: "dense" }, /* @__PURE__ */ React22.createElement(import_ui13.Box, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", flexGrow: 1 }, /* @__PURE__ */ React22.createElement(import_ui13.Grid, { container: true }, /* @__PURE__ */ React22.createElement(MainMenuLocation, null), document2?.permissions?.allowAddingWidgets && /* @__PURE__ */ React22.createElement(ToolsMenuLocation, null)), /* @__PURE__ */ React22.createElement(import_ui13.Grid, { container: true, justifyContent: "center" }, /* @__PURE__ */ React22.createElement(ToolbarMenu, { spacing: 1.5 }, /* @__PURE__ */ React22.createElement(import_ui13.Divider, { orientation: "vertical" }), /* @__PURE__ */ React22.createElement(PageIndicationLocation, null), /* @__PURE__ */ React22.createElement(import_ui13.Divider, { orientation: "vertical" }), /* @__PURE__ */ React22.createElement(ResponsiveLocation, null), /* @__PURE__ */ React22.createElement(import_ui13.Divider, { orientation: "vertical" }))), /* @__PURE__ */ React22.createElement(import_ui13.Grid, { container: true, justifyContent: "flex-end" }, /* @__PURE__ */ React22.createElement(UtilitiesMenuLocation, null), /* @__PURE__ */ React22.createElement(PrimaryActionLocation, null))))));
|
|
657
|
+
}
|
|
48
658
|
|
|
49
659
|
// src/init.ts
|
|
50
|
-
var import_editor_app_bar_ui16 = require("@elementor/editor-app-bar-ui");
|
|
51
660
|
var import_editor2 = require("@elementor/editor");
|
|
52
661
|
|
|
53
662
|
// src/sync/redirect-old-menus.ts
|
|
@@ -58,27 +667,24 @@ function redirectOldMenus() {
|
|
|
58
667
|
});
|
|
59
668
|
}
|
|
60
669
|
|
|
61
|
-
// src/extensions/documents-indicator/index.ts
|
|
62
|
-
var import_editor_app_bar_ui2 = require("@elementor/editor-app-bar-ui");
|
|
63
|
-
|
|
64
670
|
// src/extensions/documents-indicator/components/settings-button.tsx
|
|
65
|
-
var
|
|
66
|
-
var
|
|
67
|
-
var
|
|
671
|
+
var React23 = __toESM(require("react"));
|
|
672
|
+
var import_ui14 = require("@elementor/ui");
|
|
673
|
+
var import_i18n4 = require("@wordpress/i18n");
|
|
68
674
|
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
69
|
-
var
|
|
70
|
-
var
|
|
675
|
+
var import_icons4 = require("@elementor/icons");
|
|
676
|
+
var import_editor_documents2 = require("@elementor/editor-documents");
|
|
71
677
|
function SettingsButton() {
|
|
72
|
-
const activeDocument = (0,
|
|
73
|
-
const hostDocument = (0,
|
|
678
|
+
const activeDocument = (0, import_editor_documents2.__useActiveDocument)();
|
|
679
|
+
const hostDocument = (0, import_editor_documents2.__useHostDocument)();
|
|
74
680
|
const document2 = activeDocument && activeDocument.type.value !== "kit" ? activeDocument : hostDocument;
|
|
75
681
|
const { isActive, isBlocked } = (0, import_editor_v1_adapters2.__privateUseRouteStatus)("panel/page-settings");
|
|
76
682
|
if (!document2) {
|
|
77
683
|
return null;
|
|
78
684
|
}
|
|
79
|
-
const title = (0,
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
-
|
|
685
|
+
const title = (0, import_i18n4.__)("%s Settings", "elementor").replace("%s", document2.type.label);
|
|
686
|
+
return /* @__PURE__ */ React23.createElement(Tooltip3, { title }, /* @__PURE__ */ React23.createElement(import_ui14.Box, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React23.createElement(
|
|
687
|
+
import_ui14.ToggleButton,
|
|
82
688
|
{
|
|
83
689
|
value: "document-settings",
|
|
84
690
|
selected: isActive,
|
|
@@ -110,12 +716,12 @@ function SettingsButton() {
|
|
|
110
716
|
}
|
|
111
717
|
}
|
|
112
718
|
},
|
|
113
|
-
/* @__PURE__ */
|
|
719
|
+
/* @__PURE__ */ React23.createElement(import_icons4.SettingsIcon, { fontSize: "small" })
|
|
114
720
|
)));
|
|
115
721
|
}
|
|
116
|
-
function
|
|
117
|
-
return /* @__PURE__ */
|
|
118
|
-
|
|
722
|
+
function Tooltip3(props) {
|
|
723
|
+
return /* @__PURE__ */ React23.createElement(
|
|
724
|
+
import_ui14.Tooltip,
|
|
119
725
|
{
|
|
120
726
|
PopperProps: {
|
|
121
727
|
sx: {
|
|
@@ -131,7 +737,7 @@ function Tooltip(props) {
|
|
|
131
737
|
|
|
132
738
|
// src/extensions/documents-indicator/index.ts
|
|
133
739
|
function init() {
|
|
134
|
-
(
|
|
740
|
+
injectIntoPageIndication({
|
|
135
741
|
id: "document-settings-button",
|
|
136
742
|
component: SettingsButton,
|
|
137
743
|
options: {
|
|
@@ -141,19 +747,16 @@ function init() {
|
|
|
141
747
|
});
|
|
142
748
|
}
|
|
143
749
|
|
|
144
|
-
// src/extensions/documents-preview/index.ts
|
|
145
|
-
var import_editor_app_bar_ui3 = require("@elementor/editor-app-bar-ui");
|
|
146
|
-
|
|
147
750
|
// src/extensions/documents-preview/hooks/use-action-props.ts
|
|
148
|
-
var
|
|
149
|
-
var
|
|
751
|
+
var import_i18n5 = require("@wordpress/i18n");
|
|
752
|
+
var import_icons5 = require("@elementor/icons");
|
|
150
753
|
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
151
|
-
var
|
|
754
|
+
var import_editor_documents3 = require("@elementor/editor-documents");
|
|
152
755
|
function useActionProps() {
|
|
153
|
-
const document2 = (0,
|
|
756
|
+
const document2 = (0, import_editor_documents3.__useActiveDocument)();
|
|
154
757
|
return {
|
|
155
|
-
icon:
|
|
156
|
-
title: (0,
|
|
758
|
+
icon: import_icons5.EyeIcon,
|
|
759
|
+
title: (0, import_i18n5.__)("Preview Changes", "elementor"),
|
|
157
760
|
onClick: () => {
|
|
158
761
|
const extendedWindow = window;
|
|
159
762
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
@@ -180,7 +783,7 @@ function useActionProps() {
|
|
|
180
783
|
|
|
181
784
|
// src/extensions/documents-preview/index.ts
|
|
182
785
|
function init2() {
|
|
183
|
-
|
|
786
|
+
utilitiesMenu.registerAction({
|
|
184
787
|
id: "document-preview-button",
|
|
185
788
|
priority: 30,
|
|
186
789
|
// After help.
|
|
@@ -188,47 +791,44 @@ function init2() {
|
|
|
188
791
|
});
|
|
189
792
|
}
|
|
190
793
|
|
|
191
|
-
// src/extensions/documents-save/index.ts
|
|
192
|
-
var import_editor_app_bar_ui5 = require("@elementor/editor-app-bar-ui");
|
|
193
|
-
|
|
194
794
|
// src/extensions/documents-save/hooks/use-document-save-draft-props.ts
|
|
195
|
-
var
|
|
196
|
-
var
|
|
197
|
-
var
|
|
795
|
+
var import_i18n6 = require("@wordpress/i18n");
|
|
796
|
+
var import_icons6 = require("@elementor/icons");
|
|
797
|
+
var import_editor_documents4 = require("@elementor/editor-documents");
|
|
198
798
|
function useDocumentSaveDraftProps() {
|
|
199
|
-
const document2 = (0,
|
|
200
|
-
const { saveDraft } = (0,
|
|
799
|
+
const document2 = (0, import_editor_documents4.__useActiveDocument)();
|
|
800
|
+
const { saveDraft } = (0, import_editor_documents4.__useActiveDocumentActions)();
|
|
201
801
|
return {
|
|
202
|
-
icon:
|
|
203
|
-
title: (0,
|
|
802
|
+
icon: import_icons6.FileReportIcon,
|
|
803
|
+
title: (0, import_i18n6.__)("Save Draft", "elementor"),
|
|
204
804
|
onClick: saveDraft,
|
|
205
805
|
disabled: !document2 || document2.isSaving || document2.isSavingDraft || !document2.isDirty
|
|
206
806
|
};
|
|
207
807
|
}
|
|
208
808
|
|
|
209
809
|
// src/extensions/documents-save/hooks/use-document-save-template-props.ts
|
|
210
|
-
var
|
|
211
|
-
var
|
|
212
|
-
var
|
|
810
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
811
|
+
var import_icons7 = require("@elementor/icons");
|
|
812
|
+
var import_editor_documents5 = require("@elementor/editor-documents");
|
|
213
813
|
function useDocumentSaveTemplateProps() {
|
|
214
|
-
const { saveTemplate } = (0,
|
|
814
|
+
const { saveTemplate } = (0, import_editor_documents5.__useActiveDocumentActions)();
|
|
215
815
|
return {
|
|
216
|
-
icon:
|
|
217
|
-
title: (0,
|
|
816
|
+
icon: import_icons7.FolderIcon,
|
|
817
|
+
title: (0, import_i18n7.__)("Save as Template", "elementor"),
|
|
218
818
|
onClick: saveTemplate
|
|
219
819
|
};
|
|
220
820
|
}
|
|
221
821
|
|
|
222
822
|
// src/extensions/documents-save/hooks/use-document-view-page-props.ts
|
|
223
|
-
var
|
|
224
|
-
var
|
|
225
|
-
var
|
|
823
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
824
|
+
var import_icons8 = require("@elementor/icons");
|
|
825
|
+
var import_editor_documents6 = require("@elementor/editor-documents");
|
|
226
826
|
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
227
827
|
function useDocumentViewPageProps() {
|
|
228
|
-
const document2 = (0,
|
|
828
|
+
const document2 = (0, import_editor_documents6.__useActiveDocument)();
|
|
229
829
|
return {
|
|
230
|
-
icon:
|
|
231
|
-
title: (0,
|
|
830
|
+
icon: import_icons8.EyeIcon,
|
|
831
|
+
title: (0, import_i18n8.__)("View Page", "elementor"),
|
|
232
832
|
onClick: () => document2?.id && (0, import_editor_v1_adapters4.__privateRunCommand)("editor/documents/view", {
|
|
233
833
|
id: document2.id
|
|
234
834
|
})
|
|
@@ -236,15 +836,14 @@ function useDocumentViewPageProps() {
|
|
|
236
836
|
}
|
|
237
837
|
|
|
238
838
|
// src/extensions/documents-save/components/primary-action.tsx
|
|
239
|
-
var
|
|
240
|
-
var
|
|
839
|
+
var React25 = __toESM(require("react"));
|
|
840
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
241
841
|
|
|
242
842
|
// src/extensions/documents-save/components/primary-action-menu.tsx
|
|
243
|
-
var
|
|
244
|
-
var
|
|
245
|
-
var
|
|
246
|
-
var
|
|
247
|
-
var StyledPopoverMenu = (0, import_ui2.styled)(import_editor_app_bar_ui4.__privatePopoverMenu)`
|
|
843
|
+
var React24 = __toESM(require("react"));
|
|
844
|
+
var import_ui15 = require("@elementor/ui");
|
|
845
|
+
var { useMenuItems: useMenuItems5 } = documentOptionsMenu;
|
|
846
|
+
var StyledPopoverMenu = (0, import_ui15.styled)(PopoverMenu)`
|
|
248
847
|
& > .MuiPopover-paper > .MuiList-root {
|
|
249
848
|
& > .MuiDivider-root {
|
|
250
849
|
display: none;
|
|
@@ -256,8 +855,8 @@ var StyledPopoverMenu = (0, import_ui2.styled)(import_editor_app_bar_ui4.__priva
|
|
|
256
855
|
}
|
|
257
856
|
`;
|
|
258
857
|
function PrimaryActionMenu(props) {
|
|
259
|
-
const { save: saveActions, default: defaultActions } =
|
|
260
|
-
return /* @__PURE__ */
|
|
858
|
+
const { save: saveActions, default: defaultActions } = useMenuItems5();
|
|
859
|
+
return /* @__PURE__ */ React24.createElement(
|
|
261
860
|
StyledPopoverMenu,
|
|
262
861
|
{
|
|
263
862
|
...props,
|
|
@@ -274,28 +873,28 @@ function PrimaryActionMenu(props) {
|
|
|
274
873
|
sx: { mt: 0.5 }
|
|
275
874
|
}
|
|
276
875
|
},
|
|
277
|
-
saveActions.map(({ MenuItem, id }, index) => [
|
|
278
|
-
index > 0 && /* @__PURE__ */
|
|
279
|
-
/* @__PURE__ */
|
|
876
|
+
saveActions.map(({ MenuItem: MenuItem2, id }, index) => [
|
|
877
|
+
index > 0 && /* @__PURE__ */ React24.createElement(import_ui15.Divider, { key: `${id}-divider` }),
|
|
878
|
+
/* @__PURE__ */ React24.createElement(MenuItem2, { key: id })
|
|
280
879
|
]),
|
|
281
|
-
saveActions.length > 0 && defaultActions.length > 0 && /* @__PURE__ */
|
|
282
|
-
defaultActions.map(({ MenuItem, id }, index) => [
|
|
283
|
-
index > 0 && /* @__PURE__ */
|
|
284
|
-
/* @__PURE__ */
|
|
880
|
+
saveActions.length > 0 && defaultActions.length > 0 && /* @__PURE__ */ React24.createElement(import_ui15.Divider, null),
|
|
881
|
+
defaultActions.map(({ MenuItem: MenuItem2, id }, index) => [
|
|
882
|
+
index > 0 && /* @__PURE__ */ React24.createElement(import_ui15.Divider, { key: `${id}-divider` }),
|
|
883
|
+
/* @__PURE__ */ React24.createElement(MenuItem2, { key: id })
|
|
285
884
|
])
|
|
286
885
|
);
|
|
287
886
|
}
|
|
288
887
|
|
|
289
888
|
// src/extensions/documents-save/components/primary-action.tsx
|
|
290
|
-
var
|
|
291
|
-
var
|
|
292
|
-
var
|
|
889
|
+
var import_ui16 = require("@elementor/ui");
|
|
890
|
+
var import_editor_documents7 = require("@elementor/editor-documents");
|
|
891
|
+
var import_icons9 = require("@elementor/icons");
|
|
293
892
|
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
294
893
|
function PrimaryAction() {
|
|
295
|
-
const document2 = (0,
|
|
296
|
-
const { save } = (0,
|
|
894
|
+
const document2 = (0, import_editor_documents7.__useActiveDocument)();
|
|
895
|
+
const { save } = (0, import_editor_documents7.__useActiveDocumentActions)();
|
|
297
896
|
const isPreviewMode = (0, import_editor_v1_adapters5.__privateUseIsPreviewMode)();
|
|
298
|
-
const popupState = (0,
|
|
897
|
+
const popupState = (0, import_ui16.usePopupState)({
|
|
299
898
|
variant: "popover",
|
|
300
899
|
popupId: "document-save-options"
|
|
301
900
|
});
|
|
@@ -305,8 +904,8 @@ function PrimaryAction() {
|
|
|
305
904
|
const isPublishDisabled = isPreviewMode || !isPublishEnabled(document2);
|
|
306
905
|
const isSaveOptionsDisabled = isPreviewMode || document2.type.value === "kit";
|
|
307
906
|
const shouldShowSpinner = document2.isSaving && !isPublishDisabled;
|
|
308
|
-
return /* @__PURE__ */
|
|
309
|
-
|
|
907
|
+
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(import_ui16.ButtonGroup, { size: "large", variant: "contained" }, /* @__PURE__ */ React25.createElement(
|
|
908
|
+
import_ui16.Button,
|
|
310
909
|
{
|
|
311
910
|
onClick: () => {
|
|
312
911
|
const extendedWindow = window;
|
|
@@ -336,11 +935,11 @@ function PrimaryAction() {
|
|
|
336
935
|
},
|
|
337
936
|
disabled: isPublishDisabled
|
|
338
937
|
},
|
|
339
|
-
shouldShowSpinner ? /* @__PURE__ */
|
|
340
|
-
), /* @__PURE__ */
|
|
341
|
-
|
|
938
|
+
shouldShowSpinner ? /* @__PURE__ */ React25.createElement(import_ui16.CircularProgress, { color: "inherit", size: "1.5em" }) : getLabel(document2)
|
|
939
|
+
), /* @__PURE__ */ React25.createElement(
|
|
940
|
+
import_ui16.Tooltip,
|
|
342
941
|
{
|
|
343
|
-
title: (0,
|
|
942
|
+
title: (0, import_i18n9.__)("Save Options", "elementor"),
|
|
344
943
|
PopperProps: {
|
|
345
944
|
sx: {
|
|
346
945
|
"&.MuiTooltip-popper .MuiTooltip-tooltip.MuiTooltip-tooltipPlacementBottom": {
|
|
@@ -350,21 +949,21 @@ function PrimaryAction() {
|
|
|
350
949
|
}
|
|
351
950
|
}
|
|
352
951
|
},
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
-
|
|
952
|
+
/* @__PURE__ */ React25.createElement(import_ui16.Box, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React25.createElement(
|
|
953
|
+
import_ui16.Button,
|
|
355
954
|
{
|
|
356
955
|
size: "small",
|
|
357
|
-
...(0,
|
|
956
|
+
...(0, import_ui16.bindTrigger)(popupState),
|
|
358
957
|
sx: { px: 0, height: "100%", borderRadius: 0 },
|
|
359
958
|
disabled: isSaveOptionsDisabled,
|
|
360
|
-
"aria-label": (0,
|
|
959
|
+
"aria-label": (0, import_i18n9.__)("Save Options", "elementor")
|
|
361
960
|
},
|
|
362
|
-
/* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ React25.createElement(import_icons9.ChevronDownIcon, null)
|
|
363
962
|
))
|
|
364
|
-
)), /* @__PURE__ */
|
|
963
|
+
)), /* @__PURE__ */ React25.createElement(PrimaryActionMenu, { ...(0, import_ui16.bindMenu)(popupState), onClick: popupState.close }));
|
|
365
964
|
}
|
|
366
965
|
function getLabel(document2) {
|
|
367
|
-
return document2.userCan.publish ? (0,
|
|
966
|
+
return document2.userCan.publish ? (0, import_i18n9.__)("Publish", "elementor") : (0, import_i18n9.__)("Submit", "elementor");
|
|
368
967
|
}
|
|
369
968
|
function isPublishEnabled(document2) {
|
|
370
969
|
if (document2.type.value === "kit") {
|
|
@@ -374,15 +973,15 @@ function isPublishEnabled(document2) {
|
|
|
374
973
|
}
|
|
375
974
|
|
|
376
975
|
// src/extensions/documents-save/hooks/use-document-copy-and-share-props.ts
|
|
377
|
-
var
|
|
378
|
-
var
|
|
379
|
-
var
|
|
976
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
977
|
+
var import_icons10 = require("@elementor/icons");
|
|
978
|
+
var import_editor_documents8 = require("@elementor/editor-documents");
|
|
380
979
|
function useDocumentCopyAndShareProps() {
|
|
381
|
-
const document2 = (0,
|
|
382
|
-
const { copyAndShare } = (0,
|
|
980
|
+
const document2 = (0, import_editor_documents8.__useActiveDocument)();
|
|
981
|
+
const { copyAndShare } = (0, import_editor_documents8.__useActiveDocumentActions)();
|
|
383
982
|
return {
|
|
384
|
-
icon:
|
|
385
|
-
title: (0,
|
|
983
|
+
icon: import_icons10.LinkIcon,
|
|
984
|
+
title: (0, import_i18n10.__)("Copy and Share", "elementor"),
|
|
386
985
|
onClick: copyAndShare,
|
|
387
986
|
disabled: !document2 || document2.isSaving || document2.isSavingDraft || !("publish" === document2.status.value),
|
|
388
987
|
visible: document2?.permissions?.showCopyAndShare
|
|
@@ -391,7 +990,7 @@ function useDocumentCopyAndShareProps() {
|
|
|
391
990
|
|
|
392
991
|
// src/extensions/documents-save/index.ts
|
|
393
992
|
function init3() {
|
|
394
|
-
(
|
|
993
|
+
injectIntoPrimaryAction({
|
|
395
994
|
id: "document-primary-action",
|
|
396
995
|
component: PrimaryAction
|
|
397
996
|
});
|
|
@@ -420,11 +1019,11 @@ function init3() {
|
|
|
420
1019
|
}
|
|
421
1020
|
|
|
422
1021
|
// src/extensions/elements/sync/sync-panel-title.ts
|
|
423
|
-
var
|
|
1022
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
424
1023
|
var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
425
1024
|
function syncPanelTitle() {
|
|
426
|
-
const panelTitle = (0,
|
|
427
|
-
const tabTitle = (0,
|
|
1025
|
+
const panelTitle = (0, import_i18n11.__)("Elements", "elementor");
|
|
1026
|
+
const tabTitle = (0, import_i18n11.__)("Widgets", "elementor");
|
|
428
1027
|
(0, import_editor_v1_adapters6.__privateListenTo)(
|
|
429
1028
|
(0, import_editor_v1_adapters6.routeOpenEvent)("panel/elements"),
|
|
430
1029
|
() => {
|
|
@@ -452,18 +1051,15 @@ function setTabTitle(title) {
|
|
|
452
1051
|
}
|
|
453
1052
|
}
|
|
454
1053
|
|
|
455
|
-
// src/extensions/elements/index.ts
|
|
456
|
-
var import_editor_app_bar_ui6 = require("@elementor/editor-app-bar-ui");
|
|
457
|
-
|
|
458
1054
|
// src/extensions/elements/hooks/use-action-props.ts
|
|
459
|
-
var
|
|
460
|
-
var
|
|
1055
|
+
var import_icons11 = require("@elementor/icons");
|
|
1056
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
461
1057
|
var import_editor_v1_adapters7 = require("@elementor/editor-v1-adapters");
|
|
462
1058
|
function useActionProps2() {
|
|
463
1059
|
const { isActive, isBlocked } = (0, import_editor_v1_adapters7.__privateUseRouteStatus)("panel/elements");
|
|
464
1060
|
return {
|
|
465
|
-
title: (0,
|
|
466
|
-
icon:
|
|
1061
|
+
title: (0, import_i18n12.__)("Add Element", "elementor"),
|
|
1062
|
+
icon: import_icons11.PlusIcon,
|
|
467
1063
|
onClick: () => {
|
|
468
1064
|
const extendedWindow = window;
|
|
469
1065
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
@@ -488,19 +1084,16 @@ function useActionProps2() {
|
|
|
488
1084
|
// src/extensions/elements/index.ts
|
|
489
1085
|
function init4() {
|
|
490
1086
|
syncPanelTitle();
|
|
491
|
-
|
|
1087
|
+
toolsMenu.registerToggleAction({
|
|
492
1088
|
id: "open-elements-panel",
|
|
493
1089
|
priority: 1,
|
|
494
1090
|
useProps: useActionProps2
|
|
495
1091
|
});
|
|
496
1092
|
}
|
|
497
1093
|
|
|
498
|
-
// src/extensions/finder/index.ts
|
|
499
|
-
var import_editor_app_bar_ui7 = require("@elementor/editor-app-bar-ui");
|
|
500
|
-
|
|
501
1094
|
// src/extensions/finder/hooks/use-action-props.ts
|
|
502
|
-
var
|
|
503
|
-
var
|
|
1095
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
1096
|
+
var import_icons12 = require("@elementor/icons");
|
|
504
1097
|
var import_editor_v1_adapters8 = require("@elementor/editor-v1-adapters");
|
|
505
1098
|
function useActionProps3() {
|
|
506
1099
|
const { isBlocked } = (0, import_editor_v1_adapters8.__privateUseRouteStatus)("finder", {
|
|
@@ -508,8 +1101,8 @@ function useActionProps3() {
|
|
|
508
1101
|
blockOnPreviewMode: false
|
|
509
1102
|
});
|
|
510
1103
|
return {
|
|
511
|
-
title: (0,
|
|
512
|
-
icon:
|
|
1104
|
+
title: (0, import_i18n13.__)("Finder", "elementor"),
|
|
1105
|
+
icon: import_icons12.SearchIcon,
|
|
513
1106
|
onClick: () => {
|
|
514
1107
|
const extendedWindow = window;
|
|
515
1108
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
@@ -532,7 +1125,7 @@ function useActionProps3() {
|
|
|
532
1125
|
|
|
533
1126
|
// src/extensions/finder/index.ts
|
|
534
1127
|
function init5() {
|
|
535
|
-
|
|
1128
|
+
utilitiesMenu.registerAction({
|
|
536
1129
|
id: "toggle-finder",
|
|
537
1130
|
priority: 10,
|
|
538
1131
|
// Before help.
|
|
@@ -541,19 +1134,18 @@ function init5() {
|
|
|
541
1134
|
}
|
|
542
1135
|
|
|
543
1136
|
// src/extensions/help/index.ts
|
|
544
|
-
var
|
|
545
|
-
var
|
|
546
|
-
var import_icons10 = require("@elementor/icons");
|
|
1137
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
1138
|
+
var import_icons13 = require("@elementor/icons");
|
|
547
1139
|
function init6() {
|
|
548
|
-
|
|
1140
|
+
utilitiesMenu.registerLink({
|
|
549
1141
|
id: "open-help-center",
|
|
550
1142
|
priority: 20,
|
|
551
1143
|
// After Finder.
|
|
552
1144
|
useProps: () => {
|
|
553
1145
|
return {
|
|
554
|
-
title: (0,
|
|
1146
|
+
title: (0, import_i18n14.__)("Help", "elementor"),
|
|
555
1147
|
href: "https://go.elementor.com/editor-top-bar-learn/",
|
|
556
|
-
icon:
|
|
1148
|
+
icon: import_icons13.HelpIcon,
|
|
557
1149
|
target: "_blank",
|
|
558
1150
|
onClick: () => {
|
|
559
1151
|
const extendedWindow = window;
|
|
@@ -575,18 +1167,15 @@ function init6() {
|
|
|
575
1167
|
});
|
|
576
1168
|
}
|
|
577
1169
|
|
|
578
|
-
// src/extensions/history/index.ts
|
|
579
|
-
var import_editor_app_bar_ui9 = require("@elementor/editor-app-bar-ui");
|
|
580
|
-
|
|
581
1170
|
// src/extensions/history/hooks/use-action-props.ts
|
|
582
|
-
var
|
|
583
|
-
var
|
|
1171
|
+
var import_icons14 = require("@elementor/icons");
|
|
1172
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
584
1173
|
var import_editor_v1_adapters9 = require("@elementor/editor-v1-adapters");
|
|
585
1174
|
function useActionProps4() {
|
|
586
1175
|
const { isActive, isBlocked } = (0, import_editor_v1_adapters9.__privateUseRouteStatus)("panel/history");
|
|
587
1176
|
return {
|
|
588
|
-
title: (0,
|
|
589
|
-
icon:
|
|
1177
|
+
title: (0, import_i18n15.__)("History", "elementor"),
|
|
1178
|
+
icon: import_icons14.HistoryIcon,
|
|
590
1179
|
onClick: () => {
|
|
591
1180
|
const extendedWindow = window;
|
|
592
1181
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
@@ -610,24 +1199,21 @@ function useActionProps4() {
|
|
|
610
1199
|
|
|
611
1200
|
// src/extensions/history/index.ts
|
|
612
1201
|
function init7() {
|
|
613
|
-
|
|
1202
|
+
mainMenu.registerToggleAction({
|
|
614
1203
|
id: "open-history",
|
|
615
1204
|
priority: 20,
|
|
616
1205
|
useProps: useActionProps4
|
|
617
1206
|
});
|
|
618
1207
|
}
|
|
619
1208
|
|
|
620
|
-
// src/extensions/keyboard-shortcuts/index.ts
|
|
621
|
-
var import_editor_app_bar_ui10 = require("@elementor/editor-app-bar-ui");
|
|
622
|
-
|
|
623
1209
|
// src/extensions/keyboard-shortcuts/hooks/use-action-props.ts
|
|
624
|
-
var
|
|
625
|
-
var
|
|
1210
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
1211
|
+
var import_icons15 = require("@elementor/icons");
|
|
626
1212
|
var import_editor_v1_adapters10 = require("@elementor/editor-v1-adapters");
|
|
627
1213
|
function useActionProps5() {
|
|
628
1214
|
return {
|
|
629
|
-
icon:
|
|
630
|
-
title: (0,
|
|
1215
|
+
icon: import_icons15.KeyboardIcon,
|
|
1216
|
+
title: (0, import_i18n16.__)("Keyboard Shortcuts", "elementor"),
|
|
631
1217
|
onClick: () => {
|
|
632
1218
|
const extendedWindow = window;
|
|
633
1219
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
@@ -649,7 +1235,7 @@ function useActionProps5() {
|
|
|
649
1235
|
|
|
650
1236
|
// src/extensions/keyboard-shortcuts/index.ts
|
|
651
1237
|
function init8() {
|
|
652
|
-
|
|
1238
|
+
mainMenu.registerAction({
|
|
653
1239
|
id: "open-keyboard-shortcuts",
|
|
654
1240
|
group: "default",
|
|
655
1241
|
priority: 40,
|
|
@@ -662,11 +1248,11 @@ function init8() {
|
|
|
662
1248
|
var import_editor = require("@elementor/editor");
|
|
663
1249
|
|
|
664
1250
|
// src/extensions/site-settings/components/portalled-primary-action.tsx
|
|
665
|
-
var
|
|
1251
|
+
var React28 = __toESM(require("react"));
|
|
666
1252
|
|
|
667
1253
|
// src/extensions/site-settings/components/portal.tsx
|
|
668
|
-
var
|
|
669
|
-
var
|
|
1254
|
+
var React26 = __toESM(require("react"));
|
|
1255
|
+
var import_ui17 = require("@elementor/ui");
|
|
670
1256
|
var import_editor_v1_adapters11 = require("@elementor/editor-v1-adapters");
|
|
671
1257
|
function Portal(props) {
|
|
672
1258
|
const containerRef = (0, import_editor_v1_adapters11.__privateUseListenTo)(
|
|
@@ -679,27 +1265,27 @@ function Portal(props) {
|
|
|
679
1265
|
if (!containerRef.current) {
|
|
680
1266
|
return null;
|
|
681
1267
|
}
|
|
682
|
-
return /* @__PURE__ */
|
|
1268
|
+
return /* @__PURE__ */ React26.createElement(import_ui17.Portal, { container: containerRef.current, ...props });
|
|
683
1269
|
}
|
|
684
1270
|
function getContainerRef() {
|
|
685
1271
|
return (0, import_editor_v1_adapters11.__privateIsRouteActive)("panel/global") ? { current: document.querySelector("#elementor-panel-inner") } : { current: null };
|
|
686
1272
|
}
|
|
687
1273
|
|
|
688
1274
|
// src/extensions/site-settings/components/primary-action.tsx
|
|
689
|
-
var
|
|
690
|
-
var
|
|
691
|
-
var
|
|
692
|
-
var
|
|
1275
|
+
var React27 = __toESM(require("react"));
|
|
1276
|
+
var import_editor_documents9 = require("@elementor/editor-documents");
|
|
1277
|
+
var import_ui18 = require("@elementor/ui");
|
|
1278
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
693
1279
|
function PrimaryAction2() {
|
|
694
|
-
const document2 = (0,
|
|
695
|
-
const { save } = (0,
|
|
696
|
-
return /* @__PURE__ */
|
|
1280
|
+
const document2 = (0, import_editor_documents9.__useActiveDocument)();
|
|
1281
|
+
const { save } = (0, import_editor_documents9.__useActiveDocumentActions)();
|
|
1282
|
+
return /* @__PURE__ */ React27.createElement(import_ui18.Paper, { sx: {
|
|
697
1283
|
px: 5,
|
|
698
1284
|
py: 4,
|
|
699
1285
|
borderTop: 1,
|
|
700
1286
|
borderColor: "divider"
|
|
701
|
-
} }, /* @__PURE__ */
|
|
702
|
-
|
|
1287
|
+
} }, /* @__PURE__ */ React27.createElement(
|
|
1288
|
+
import_ui18.Button,
|
|
703
1289
|
{
|
|
704
1290
|
variant: "contained",
|
|
705
1291
|
disabled: !document2 || !document2.isDirty,
|
|
@@ -707,29 +1293,26 @@ function PrimaryAction2() {
|
|
|
707
1293
|
sx: { width: "100%" },
|
|
708
1294
|
onClick: () => document2 && !document2.isSaving ? save() : null
|
|
709
1295
|
},
|
|
710
|
-
document2?.isSaving ? /* @__PURE__ */
|
|
1296
|
+
document2?.isSaving ? /* @__PURE__ */ React27.createElement(import_ui18.CircularProgress, null) : (0, import_i18n17.__)("Save Changes", "elementor")
|
|
711
1297
|
));
|
|
712
1298
|
}
|
|
713
1299
|
|
|
714
1300
|
// src/extensions/site-settings/components/portalled-primary-action.tsx
|
|
715
1301
|
function PortalledPrimaryAction() {
|
|
716
|
-
return /* @__PURE__ */
|
|
1302
|
+
return /* @__PURE__ */ React28.createElement(Portal, null, /* @__PURE__ */ React28.createElement(PrimaryAction2, null));
|
|
717
1303
|
}
|
|
718
1304
|
|
|
719
|
-
// src/extensions/site-settings/index.ts
|
|
720
|
-
var import_editor_app_bar_ui11 = require("@elementor/editor-app-bar-ui");
|
|
721
|
-
|
|
722
1305
|
// src/extensions/site-settings/hooks/use-action-props.ts
|
|
723
|
-
var
|
|
1306
|
+
var import_i18n18 = require("@wordpress/i18n");
|
|
724
1307
|
var import_editor_v1_adapters12 = require("@elementor/editor-v1-adapters");
|
|
725
|
-
var
|
|
1308
|
+
var import_icons16 = require("@elementor/icons");
|
|
726
1309
|
function useActionProps6() {
|
|
727
1310
|
const { isActive, isBlocked } = (0, import_editor_v1_adapters12.__privateUseRouteStatus)("panel/global", {
|
|
728
1311
|
blockOnKitRoutes: false
|
|
729
1312
|
});
|
|
730
1313
|
return {
|
|
731
|
-
title: (0,
|
|
732
|
-
icon:
|
|
1314
|
+
title: (0, import_i18n18.__)("Site Settings", "elementor"),
|
|
1315
|
+
icon: import_icons16.AdjustmentsHorizontalIcon,
|
|
733
1316
|
onClick: () => {
|
|
734
1317
|
const extendedWindow = window;
|
|
735
1318
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
@@ -761,25 +1344,22 @@ function init9() {
|
|
|
761
1344
|
id: "site-settings-primary-action-portal",
|
|
762
1345
|
component: PortalledPrimaryAction
|
|
763
1346
|
});
|
|
764
|
-
|
|
1347
|
+
toolsMenu.registerToggleAction({
|
|
765
1348
|
id: "toggle-site-settings",
|
|
766
1349
|
priority: 2,
|
|
767
1350
|
useProps: useActionProps6
|
|
768
1351
|
});
|
|
769
1352
|
}
|
|
770
1353
|
|
|
771
|
-
// src/extensions/structure/index.ts
|
|
772
|
-
var import_editor_app_bar_ui12 = require("@elementor/editor-app-bar-ui");
|
|
773
|
-
|
|
774
1354
|
// src/extensions/structure/hooks/use-action-props.ts
|
|
775
|
-
var
|
|
1355
|
+
var import_i18n19 = require("@wordpress/i18n");
|
|
776
1356
|
var import_editor_v1_adapters13 = require("@elementor/editor-v1-adapters");
|
|
777
|
-
var
|
|
1357
|
+
var import_icons17 = require("@elementor/icons");
|
|
778
1358
|
function useActionProps7() {
|
|
779
1359
|
const { isActive, isBlocked } = (0, import_editor_v1_adapters13.__privateUseRouteStatus)("navigator");
|
|
780
1360
|
return {
|
|
781
|
-
title: (0,
|
|
782
|
-
icon:
|
|
1361
|
+
title: (0, import_i18n19.__)("Structure", "elementor"),
|
|
1362
|
+
icon: import_icons17.StructureIcon,
|
|
783
1363
|
onClick: () => {
|
|
784
1364
|
const extendedWindow = window;
|
|
785
1365
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
@@ -803,24 +1383,21 @@ function useActionProps7() {
|
|
|
803
1383
|
|
|
804
1384
|
// src/extensions/structure/index.ts
|
|
805
1385
|
function init10() {
|
|
806
|
-
|
|
1386
|
+
toolsMenu.registerToggleAction({
|
|
807
1387
|
id: "toggle-structure-view",
|
|
808
1388
|
priority: 3,
|
|
809
1389
|
useProps: useActionProps7
|
|
810
1390
|
});
|
|
811
1391
|
}
|
|
812
1392
|
|
|
813
|
-
// src/extensions/theme-builder/index.ts
|
|
814
|
-
var import_editor_app_bar_ui13 = require("@elementor/editor-app-bar-ui");
|
|
815
|
-
|
|
816
1393
|
// src/extensions/theme-builder/hooks/use-action-props.ts
|
|
817
|
-
var
|
|
818
|
-
var
|
|
1394
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
1395
|
+
var import_icons18 = require("@elementor/icons");
|
|
819
1396
|
var import_editor_v1_adapters14 = require("@elementor/editor-v1-adapters");
|
|
820
1397
|
function useActionProps8() {
|
|
821
1398
|
return {
|
|
822
|
-
icon:
|
|
823
|
-
title: (0,
|
|
1399
|
+
icon: import_icons18.ThemeBuilderIcon,
|
|
1400
|
+
title: (0, import_i18n20.__)("Theme Builder", "elementor"),
|
|
824
1401
|
onClick: () => {
|
|
825
1402
|
const extendedWindow = window;
|
|
826
1403
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
@@ -842,24 +1419,21 @@ function useActionProps8() {
|
|
|
842
1419
|
|
|
843
1420
|
// src/extensions/theme-builder/index.ts
|
|
844
1421
|
function init11() {
|
|
845
|
-
|
|
1422
|
+
mainMenu.registerAction({
|
|
846
1423
|
id: "open-theme-builder",
|
|
847
1424
|
useProps: useActionProps8
|
|
848
1425
|
});
|
|
849
1426
|
}
|
|
850
1427
|
|
|
851
|
-
// src/extensions/user-preferences/index.ts
|
|
852
|
-
var import_editor_app_bar_ui14 = require("@elementor/editor-app-bar-ui");
|
|
853
|
-
|
|
854
1428
|
// src/extensions/user-preferences/hooks/use-action-props.ts
|
|
855
|
-
var
|
|
856
|
-
var
|
|
1429
|
+
var import_i18n21 = require("@wordpress/i18n");
|
|
1430
|
+
var import_icons19 = require("@elementor/icons");
|
|
857
1431
|
var import_editor_v1_adapters15 = require("@elementor/editor-v1-adapters");
|
|
858
1432
|
function useActionProps9() {
|
|
859
1433
|
const { isActive, isBlocked } = (0, import_editor_v1_adapters15.__privateUseRouteStatus)("panel/editor-preferences");
|
|
860
1434
|
return {
|
|
861
|
-
icon:
|
|
862
|
-
title: (0,
|
|
1435
|
+
icon: import_icons19.ToggleRightIcon,
|
|
1436
|
+
title: (0, import_i18n21.__)("User Preferences", "elementor"),
|
|
863
1437
|
onClick: () => {
|
|
864
1438
|
const extendedWindow = window;
|
|
865
1439
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
@@ -883,7 +1457,7 @@ function useActionProps9() {
|
|
|
883
1457
|
|
|
884
1458
|
// src/extensions/user-preferences/index.ts
|
|
885
1459
|
function init12() {
|
|
886
|
-
|
|
1460
|
+
mainMenu.registerToggleAction({
|
|
887
1461
|
id: "open-user-preferences",
|
|
888
1462
|
priority: 30,
|
|
889
1463
|
// After history.
|
|
@@ -892,20 +1466,19 @@ function init12() {
|
|
|
892
1466
|
}
|
|
893
1467
|
|
|
894
1468
|
// src/extensions/wordpress/index.ts
|
|
895
|
-
var
|
|
896
|
-
var
|
|
897
|
-
var
|
|
898
|
-
var import_editor_documents9 = require("@elementor/editor-documents");
|
|
1469
|
+
var import_i18n22 = require("@wordpress/i18n");
|
|
1470
|
+
var import_icons20 = require("@elementor/icons");
|
|
1471
|
+
var import_editor_documents10 = require("@elementor/editor-documents");
|
|
899
1472
|
function init13() {
|
|
900
|
-
|
|
1473
|
+
mainMenu.registerLink({
|
|
901
1474
|
id: "exit-to-wordpress",
|
|
902
1475
|
group: "exits",
|
|
903
1476
|
useProps: () => {
|
|
904
|
-
const document2 = (0,
|
|
1477
|
+
const document2 = (0, import_editor_documents10.__useActiveDocument)();
|
|
905
1478
|
return {
|
|
906
|
-
title: (0,
|
|
1479
|
+
title: (0, import_i18n22.__)("Exit to WordPress", "elementor"),
|
|
907
1480
|
href: document2?.links?.platformEdit,
|
|
908
|
-
icon:
|
|
1481
|
+
icon: import_icons20.WordpressIcon,
|
|
909
1482
|
onClick: () => {
|
|
910
1483
|
const extendedWindow = window;
|
|
911
1484
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
@@ -949,7 +1522,7 @@ function init15() {
|
|
|
949
1522
|
init14();
|
|
950
1523
|
(0, import_editor2.injectIntoTop)({
|
|
951
1524
|
id: "app-bar",
|
|
952
|
-
component:
|
|
1525
|
+
component: AppBar
|
|
953
1526
|
});
|
|
954
1527
|
}
|
|
955
1528
|
|