@elementor/editor-app-bar 0.6.9 → 0.7.1
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 +19 -0
- package/dist/index.d.mts +45 -1
- package/dist/index.d.ts +45 -1
- package/dist/index.js +215 -162
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +185 -123
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/components/__tests__/top-bar.test.tsx +4 -4
- package/src/components/locations/__tests__/locations-components.test.tsx +3 -3
- package/src/components/locations/__tests__/menus.test.tsx +39 -8
- package/src/components/locations/integrations-menu-location.tsx +59 -0
- package/src/components/locations/main-menu-location.tsx +9 -21
- package/src/components/ui/popover-sub-menu.tsx +29 -0
- package/src/components/ui/toolbar-logo.tsx +2 -2
- package/src/extensions/documents-indicator/components/__tests__/settings-button.test.tsx +6 -6
- package/src/extensions/documents-save/components/__tests__/primary-action-menu.test.tsx +3 -3
- package/src/extensions/documents-save/components/__tests__/primary-action.test.tsx +24 -24
- package/src/extensions/documents-save/components/primary-action-menu.tsx +2 -1
- package/src/extensions/site-settings/components/__tests__/portalled-primary-action.test.tsx +1 -1
- package/src/extensions/site-settings/components/__tests__/primary-action.test.tsx +2 -2
- package/src/index.ts +1 -0
- package/src/locations/__tests__/menus.test.tsx +28 -30
- package/src/locations/index.ts +2 -0
package/dist/index.mjs
CHANGED
|
@@ -135,12 +135,12 @@ function createMenu(groups = []) {
|
|
|
135
135
|
component: Component
|
|
136
136
|
})
|
|
137
137
|
);
|
|
138
|
-
const
|
|
138
|
+
const useMenuItems6 = createUseMenuItems(locations);
|
|
139
139
|
return {
|
|
140
140
|
registerAction,
|
|
141
141
|
registerToggleAction,
|
|
142
142
|
registerLink,
|
|
143
|
-
useMenuItems:
|
|
143
|
+
useMenuItems: useMenuItems6
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
146
|
function createRegisterMenuItem({ locations, menuGroups, component }) {
|
|
@@ -201,15 +201,16 @@ var {
|
|
|
201
201
|
var mainMenu = createMenu(["exits"]);
|
|
202
202
|
var toolsMenu = createMenu();
|
|
203
203
|
var utilitiesMenu = createMenu();
|
|
204
|
+
var integrationsMenu = createMenu();
|
|
204
205
|
var documentOptionsMenu = createMenu(["save"]);
|
|
205
206
|
|
|
206
207
|
// src/components/app-bar.tsx
|
|
207
|
-
import * as
|
|
208
|
-
import { AppBar as BaseAppBar, Box as Box3, Divider as
|
|
208
|
+
import * as React21 from "react";
|
|
209
|
+
import { AppBar as BaseAppBar, Box as Box3, Divider as Divider4, Grid, ThemeProvider } from "@elementor/ui";
|
|
209
210
|
|
|
210
211
|
// src/components/locations/main-menu-location.tsx
|
|
211
|
-
import * as
|
|
212
|
-
import { usePopupState, bindMenu, bindTrigger, Stack, Divider } from "@elementor/ui";
|
|
212
|
+
import * as React13 from "react";
|
|
213
|
+
import { usePopupState as usePopupState2, bindMenu as bindMenu2, bindTrigger, Stack, Divider as Divider2 } from "@elementor/ui";
|
|
213
214
|
|
|
214
215
|
// src/components/ui/popover-menu.tsx
|
|
215
216
|
import * as React9 from "react";
|
|
@@ -238,8 +239,8 @@ import { ToggleButton as ToggleButton2, SvgIcon, styled } from "@elementor/ui";
|
|
|
238
239
|
var ElementorLogo = (props) => {
|
|
239
240
|
return /* @__PURE__ */ React10.createElement(SvgIcon, { viewBox: "0 0 32 32", ...props }, /* @__PURE__ */ React10.createElement("g", null, /* @__PURE__ */ React10.createElement("circle", { cx: "16", cy: "16", r: "16" }), /* @__PURE__ */ React10.createElement("path", { d: "M11.7 9H9V22.3H11.7V9Z" }), /* @__PURE__ */ React10.createElement("path", { d: "M22.4 9H9V11.7H22.4V9Z" }), /* @__PURE__ */ React10.createElement("path", { d: "M22.4 14.4004H9V17.1004H22.4V14.4004Z" }), /* @__PURE__ */ React10.createElement("path", { d: "M22.4 19.6992H9V22.3992H22.4V19.6992Z" })));
|
|
240
241
|
};
|
|
241
|
-
var StyledToggleButton = styled(ToggleButton2)(() => ({
|
|
242
|
-
|
|
242
|
+
var StyledToggleButton = styled(ToggleButton2)(({ theme }) => ({
|
|
243
|
+
paddingInline: theme.spacing(1),
|
|
243
244
|
"&.MuiToggleButton-root:hover": {
|
|
244
245
|
backgroundColor: "initial"
|
|
245
246
|
},
|
|
@@ -291,113 +292,172 @@ function ToolbarLogo(props) {
|
|
|
291
292
|
);
|
|
292
293
|
}
|
|
293
294
|
|
|
294
|
-
// src/components/locations/
|
|
295
|
-
|
|
296
|
-
|
|
295
|
+
// src/components/locations/integrations-menu-location.tsx
|
|
296
|
+
import * as React12 from "react";
|
|
297
|
+
import {
|
|
298
|
+
bindMenu,
|
|
299
|
+
Divider,
|
|
300
|
+
ListItemIcon as ListItemIcon2,
|
|
301
|
+
ListItemText as ListItemText2,
|
|
302
|
+
MenuItem as MenuItem2,
|
|
303
|
+
usePopupState,
|
|
304
|
+
bindHover,
|
|
305
|
+
bindFocus,
|
|
306
|
+
withDirection as withDirection2
|
|
307
|
+
} from "@elementor/ui";
|
|
308
|
+
import { __ as __2 } from "@wordpress/i18n";
|
|
309
|
+
import { ChevronRightIcon, PlugIcon } from "@elementor/icons";
|
|
310
|
+
|
|
311
|
+
// src/components/ui/popover-sub-menu.tsx
|
|
312
|
+
import * as React11 from "react";
|
|
313
|
+
import { useTheme } from "@elementor/ui";
|
|
314
|
+
function PopoverSubMenu({ children, ...props }) {
|
|
315
|
+
const theme = useTheme();
|
|
316
|
+
const isRTL = theme.direction === "rtl";
|
|
317
|
+
return /* @__PURE__ */ React11.createElement(
|
|
318
|
+
PopoverMenu,
|
|
319
|
+
{
|
|
320
|
+
sx: { pointerEvents: "none" },
|
|
321
|
+
PaperProps: {
|
|
322
|
+
sx: {
|
|
323
|
+
// This is a workaround to support RTL in PopoverMenu, since it doesn't support it yet.
|
|
324
|
+
...isRTL ? { marginInlineEnd: -2 } : { marginInlineStart: 2 },
|
|
325
|
+
pointerEvents: "auto"
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
anchorOrigin: { vertical: "center", horizontal: isRTL ? "left" : "right" },
|
|
329
|
+
transformOrigin: { vertical: "center", horizontal: isRTL ? "right" : "left" },
|
|
330
|
+
...props
|
|
331
|
+
},
|
|
332
|
+
children
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// src/components/locations/integrations-menu-location.tsx
|
|
337
|
+
var { useMenuItems } = integrationsMenu;
|
|
338
|
+
var DirectionalChevronIcon = withDirection2(ChevronRightIcon);
|
|
339
|
+
function IntegrationsMenuLocation({ parentPopupState }) {
|
|
297
340
|
const menuItems = useMenuItems();
|
|
298
|
-
const orderedGroups = [
|
|
299
|
-
menuItems.default,
|
|
300
|
-
menuItems.exits
|
|
301
|
-
];
|
|
302
341
|
const popupState = usePopupState({
|
|
342
|
+
parentPopupState,
|
|
343
|
+
variant: "popover",
|
|
344
|
+
popupId: "elementor-v2-app-bar-integrations"
|
|
345
|
+
});
|
|
346
|
+
if (menuItems.default.length === 0) {
|
|
347
|
+
return null;
|
|
348
|
+
}
|
|
349
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(Divider, null), /* @__PURE__ */ React12.createElement(
|
|
350
|
+
MenuItem2,
|
|
351
|
+
{
|
|
352
|
+
...bindHover(popupState),
|
|
353
|
+
...bindFocus(popupState)
|
|
354
|
+
},
|
|
355
|
+
/* @__PURE__ */ React12.createElement(ListItemIcon2, null, /* @__PURE__ */ React12.createElement(PlugIcon, null)),
|
|
356
|
+
/* @__PURE__ */ React12.createElement(ListItemText2, { primary: __2("Integrations", "elementor") }),
|
|
357
|
+
/* @__PURE__ */ React12.createElement(DirectionalChevronIcon, null),
|
|
358
|
+
/* @__PURE__ */ React12.createElement(PopoverSubMenu, { ...bindMenu(popupState), onClick: popupState.close }, menuItems.default.map(
|
|
359
|
+
({ MenuItem: IntegrationsMenuItem, id }) => /* @__PURE__ */ React12.createElement(IntegrationsMenuItem, { key: id })
|
|
360
|
+
))
|
|
361
|
+
));
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// src/components/locations/main-menu-location.tsx
|
|
365
|
+
var { useMenuItems: useMenuItems2 } = mainMenu;
|
|
366
|
+
function MainMenuLocation() {
|
|
367
|
+
const menuItems = useMenuItems2();
|
|
368
|
+
const popupState = usePopupState2({
|
|
303
369
|
variant: "popover",
|
|
304
370
|
popupId: "elementor-v2-app-bar-main-menu"
|
|
305
371
|
});
|
|
306
|
-
return /* @__PURE__ */
|
|
372
|
+
return /* @__PURE__ */ React13.createElement(Stack, { sx: { paddingInlineStart: 3 }, direction: "row", alignItems: "center" }, /* @__PURE__ */ React13.createElement(
|
|
307
373
|
ToolbarLogo,
|
|
308
374
|
{
|
|
309
375
|
...bindTrigger(popupState),
|
|
310
376
|
selected: popupState.isOpen
|
|
311
377
|
}
|
|
312
|
-
), /* @__PURE__ */
|
|
378
|
+
), /* @__PURE__ */ React13.createElement(
|
|
313
379
|
PopoverMenu,
|
|
314
380
|
{
|
|
315
381
|
onClick: popupState.close,
|
|
316
|
-
...
|
|
317
|
-
|
|
318
|
-
sx: { mt: 4, marginInlineStart: -2 }
|
|
319
|
-
}
|
|
382
|
+
...bindMenu2(popupState),
|
|
383
|
+
marginThreshold: 8
|
|
320
384
|
},
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React11.createElement(MenuItem2, { key: id })
|
|
326
|
-
)
|
|
327
|
-
];
|
|
328
|
-
})
|
|
385
|
+
menuItems.default.map(({ MenuItem: MenuItem3, id }) => /* @__PURE__ */ React13.createElement(MenuItem3, { key: id })),
|
|
386
|
+
/* @__PURE__ */ React13.createElement(IntegrationsMenuLocation, { key: "integrations-location", parentPopupState: popupState }),
|
|
387
|
+
menuItems.exits.length > 0 && /* @__PURE__ */ React13.createElement(Divider2, null),
|
|
388
|
+
menuItems.exits.map(({ MenuItem: MenuItem3, id }) => /* @__PURE__ */ React13.createElement(MenuItem3, { key: id }))
|
|
329
389
|
));
|
|
330
390
|
}
|
|
331
391
|
|
|
332
392
|
// src/components/locations/tools-menu-location.tsx
|
|
333
|
-
import * as
|
|
393
|
+
import * as React16 from "react";
|
|
334
394
|
|
|
335
395
|
// src/components/ui/toolbar-menu.tsx
|
|
336
|
-
import * as
|
|
396
|
+
import * as React14 from "react";
|
|
337
397
|
import { Stack as Stack2 } from "@elementor/ui";
|
|
338
398
|
function ToolbarMenu({ children, ...props }) {
|
|
339
|
-
return /* @__PURE__ */
|
|
399
|
+
return /* @__PURE__ */ React14.createElement(MenuContextProvider, { type: "toolbar" }, /* @__PURE__ */ React14.createElement(Stack2, { sx: { px: 4 }, spacing: 4, direction: "row", alignItems: "center", ...props }, children));
|
|
340
400
|
}
|
|
341
401
|
|
|
342
402
|
// src/components/ui/toolbar-menu-more.tsx
|
|
343
|
-
import * as
|
|
344
|
-
import { bindMenu as
|
|
345
|
-
import { __ as
|
|
403
|
+
import * as React15 from "react";
|
|
404
|
+
import { bindMenu as bindMenu3, bindTrigger as bindTrigger2, usePopupState as usePopupState3 } from "@elementor/ui";
|
|
405
|
+
import { __ as __3 } from "@wordpress/i18n";
|
|
346
406
|
import { DotsVerticalIcon } from "@elementor/icons";
|
|
347
407
|
function ToolbarMenuMore({ children, id }) {
|
|
348
|
-
const popupState =
|
|
408
|
+
const popupState = usePopupState3({
|
|
349
409
|
variant: "popover",
|
|
350
410
|
popupId: id
|
|
351
411
|
});
|
|
352
|
-
return /* @__PURE__ */
|
|
412
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(ToolbarMenuItem, { ...bindTrigger2(popupState), title: __3("More", "elementor") }, /* @__PURE__ */ React15.createElement(DotsVerticalIcon, null)), /* @__PURE__ */ React15.createElement(PopoverMenu, { onClick: popupState.close, ...bindMenu3(popupState) }, children));
|
|
353
413
|
}
|
|
354
414
|
|
|
355
415
|
// src/components/locations/tools-menu-location.tsx
|
|
356
416
|
var MAX_TOOLBAR_ACTIONS = 5;
|
|
357
|
-
var { useMenuItems:
|
|
417
|
+
var { useMenuItems: useMenuItems3 } = toolsMenu;
|
|
358
418
|
function ToolsMenuLocation() {
|
|
359
|
-
const menuItems =
|
|
419
|
+
const menuItems = useMenuItems3();
|
|
360
420
|
const toolbarMenuItems = menuItems.default.slice(0, MAX_TOOLBAR_ACTIONS);
|
|
361
421
|
const popoverMenuItems = menuItems.default.slice(MAX_TOOLBAR_ACTIONS);
|
|
362
|
-
return /* @__PURE__ */
|
|
422
|
+
return /* @__PURE__ */ React16.createElement(ToolbarMenu, null, toolbarMenuItems.map(({ MenuItem: MenuItem3, id }) => /* @__PURE__ */ React16.createElement(MenuItem3, { key: id })), popoverMenuItems.length > 0 && /* @__PURE__ */ React16.createElement(ToolbarMenuMore, { id: "elementor-editor-app-bar-tools-more" }, popoverMenuItems.map(({ MenuItem: MenuItem3, id }) => /* @__PURE__ */ React16.createElement(MenuItem3, { key: id }))));
|
|
363
423
|
}
|
|
364
424
|
|
|
365
425
|
// src/components/locations/utilities-menu-location.tsx
|
|
366
|
-
import * as
|
|
367
|
-
import { Fragment as
|
|
368
|
-
import { Divider as
|
|
426
|
+
import * as React17 from "react";
|
|
427
|
+
import { Fragment as Fragment3 } from "react";
|
|
428
|
+
import { Divider as Divider3 } from "@elementor/ui";
|
|
369
429
|
var MAX_TOOLBAR_ACTIONS2 = 3;
|
|
370
|
-
var { useMenuItems:
|
|
430
|
+
var { useMenuItems: useMenuItems4 } = utilitiesMenu;
|
|
371
431
|
function UtilitiesMenuLocation() {
|
|
372
|
-
const menuItems =
|
|
432
|
+
const menuItems = useMenuItems4();
|
|
373
433
|
const toolbarMenuItems = menuItems.default.slice(0, MAX_TOOLBAR_ACTIONS2);
|
|
374
434
|
const popoverMenuItems = menuItems.default.slice(MAX_TOOLBAR_ACTIONS2);
|
|
375
|
-
return /* @__PURE__ */
|
|
376
|
-
({ MenuItem:
|
|
377
|
-
), popoverMenuItems.length > 0 && /* @__PURE__ */
|
|
435
|
+
return /* @__PURE__ */ React17.createElement(ToolbarMenu, null, toolbarMenuItems.map(
|
|
436
|
+
({ MenuItem: MenuItem3, id }, index) => /* @__PURE__ */ React17.createElement(Fragment3, { key: id }, index === 0 && /* @__PURE__ */ React17.createElement(Divider3, { orientation: "vertical" }), /* @__PURE__ */ React17.createElement(MenuItem3, null))
|
|
437
|
+
), popoverMenuItems.length > 0 && /* @__PURE__ */ React17.createElement(ToolbarMenuMore, { id: "elementor-editor-app-bar-utilities-more" }, popoverMenuItems.map(({ MenuItem: MenuItem3, id }) => /* @__PURE__ */ React17.createElement(MenuItem3, { key: id }))));
|
|
378
438
|
}
|
|
379
439
|
|
|
380
440
|
// src/components/locations/primary-action-location.tsx
|
|
381
|
-
import * as
|
|
441
|
+
import * as React18 from "react";
|
|
382
442
|
function PrimaryActionLocation() {
|
|
383
|
-
return /* @__PURE__ */
|
|
443
|
+
return /* @__PURE__ */ React18.createElement(PrimaryActionSlot, null);
|
|
384
444
|
}
|
|
385
445
|
|
|
386
446
|
// src/components/locations/page-indication-location.tsx
|
|
387
|
-
import * as
|
|
447
|
+
import * as React19 from "react";
|
|
388
448
|
function PageIndicationLocation() {
|
|
389
|
-
return /* @__PURE__ */
|
|
449
|
+
return /* @__PURE__ */ React19.createElement(PageIndicationSlot, null);
|
|
390
450
|
}
|
|
391
451
|
|
|
392
452
|
// src/components/locations/responsive-location.tsx
|
|
393
|
-
import * as
|
|
453
|
+
import * as React20 from "react";
|
|
394
454
|
function ResponsiveLocation() {
|
|
395
|
-
return /* @__PURE__ */
|
|
455
|
+
return /* @__PURE__ */ React20.createElement(ResponsiveSlot, null);
|
|
396
456
|
}
|
|
397
457
|
|
|
398
458
|
// src/components/app-bar.tsx
|
|
399
459
|
function AppBar() {
|
|
400
|
-
return /* @__PURE__ */
|
|
460
|
+
return /* @__PURE__ */ React21.createElement(ThemeProvider, { colorScheme: "dark" }, /* @__PURE__ */ React21.createElement(BaseAppBar, { position: "sticky" }, /* @__PURE__ */ React21.createElement(Box3, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)" }, /* @__PURE__ */ React21.createElement(Grid, { container: true }, /* @__PURE__ */ React21.createElement(MainMenuLocation, null), /* @__PURE__ */ React21.createElement(ToolsMenuLocation, null)), /* @__PURE__ */ React21.createElement(Grid, { container: true, justifyContent: "center" }, /* @__PURE__ */ React21.createElement(ToolbarMenu, { spacing: 3 }, /* @__PURE__ */ React21.createElement(Divider4, { orientation: "vertical" }), /* @__PURE__ */ React21.createElement(PageIndicationLocation, null), /* @__PURE__ */ React21.createElement(Divider4, { orientation: "vertical" }), /* @__PURE__ */ React21.createElement(ResponsiveLocation, null), /* @__PURE__ */ React21.createElement(Divider4, { orientation: "vertical" }))), /* @__PURE__ */ React21.createElement(Grid, { container: true, justifyContent: "flex-end" }, /* @__PURE__ */ React21.createElement(UtilitiesMenuLocation, null), /* @__PURE__ */ React21.createElement(PrimaryActionLocation, null)))));
|
|
401
461
|
}
|
|
402
462
|
|
|
403
463
|
// src/init.ts
|
|
@@ -412,9 +472,9 @@ function redirectOldMenus() {
|
|
|
412
472
|
}
|
|
413
473
|
|
|
414
474
|
// src/extensions/documents-indicator/components/settings-button.tsx
|
|
415
|
-
import * as
|
|
475
|
+
import * as React22 from "react";
|
|
416
476
|
import { Box as Box4, ToggleButton as ToggleButton3, Tooltip as Tooltip3 } from "@elementor/ui";
|
|
417
|
-
import { __ as
|
|
477
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
418
478
|
import { openRoute as openRoute2, useRouteStatus } from "@elementor/editor-v1-adapters";
|
|
419
479
|
import { SettingsIcon } from "@elementor/icons";
|
|
420
480
|
import { useActiveDocument, useHostDocument } from "@elementor/editor-documents";
|
|
@@ -426,8 +486,8 @@ function SettingsButton() {
|
|
|
426
486
|
if (!document2) {
|
|
427
487
|
return null;
|
|
428
488
|
}
|
|
429
|
-
const title =
|
|
430
|
-
return /* @__PURE__ */
|
|
489
|
+
const title = __4("%s Settings", "elementor").replace("%s", document2.type.label);
|
|
490
|
+
return /* @__PURE__ */ React22.createElement(Tooltip3, { title }, /* @__PURE__ */ React22.createElement(Box4, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React22.createElement(
|
|
431
491
|
ToggleButton3,
|
|
432
492
|
{
|
|
433
493
|
value: "document-settings",
|
|
@@ -437,7 +497,7 @@ function SettingsButton() {
|
|
|
437
497
|
"aria-label": title,
|
|
438
498
|
size: "small"
|
|
439
499
|
},
|
|
440
|
-
/* @__PURE__ */
|
|
500
|
+
/* @__PURE__ */ React22.createElement(SettingsIcon, null)
|
|
441
501
|
)));
|
|
442
502
|
}
|
|
443
503
|
|
|
@@ -454,7 +514,7 @@ function init() {
|
|
|
454
514
|
}
|
|
455
515
|
|
|
456
516
|
// src/extensions/documents-preview/hooks/use-action-props.ts
|
|
457
|
-
import { __ as
|
|
517
|
+
import { __ as __5 } from "@wordpress/i18n";
|
|
458
518
|
import { EyeIcon } from "@elementor/icons";
|
|
459
519
|
import { runCommand } from "@elementor/editor-v1-adapters";
|
|
460
520
|
import { useActiveDocument as useActiveDocument2 } from "@elementor/editor-documents";
|
|
@@ -462,7 +522,7 @@ function useActionProps() {
|
|
|
462
522
|
const document2 = useActiveDocument2();
|
|
463
523
|
return {
|
|
464
524
|
icon: EyeIcon,
|
|
465
|
-
title:
|
|
525
|
+
title: __5("Preview Changes", "elementor"),
|
|
466
526
|
onClick: () => document2 && runCommand("editor/documents/preview", {
|
|
467
527
|
id: document2.id,
|
|
468
528
|
force: true
|
|
@@ -481,7 +541,7 @@ function init2() {
|
|
|
481
541
|
}
|
|
482
542
|
|
|
483
543
|
// src/extensions/documents-save/hooks/use-document-save-draft-props.ts
|
|
484
|
-
import { __ as
|
|
544
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
485
545
|
import { FileReportIcon } from "@elementor/icons";
|
|
486
546
|
import { useActiveDocument as useActiveDocument3, useActiveDocumentActions } from "@elementor/editor-documents";
|
|
487
547
|
function useDocumentSaveDraftProps() {
|
|
@@ -489,33 +549,33 @@ function useDocumentSaveDraftProps() {
|
|
|
489
549
|
const { saveDraft } = useActiveDocumentActions();
|
|
490
550
|
return {
|
|
491
551
|
icon: FileReportIcon,
|
|
492
|
-
title:
|
|
552
|
+
title: __6("Save Draft", "elementor"),
|
|
493
553
|
onClick: saveDraft,
|
|
494
554
|
disabled: !document2 || document2.isSaving || document2.isSavingDraft || !document2.isDirty
|
|
495
555
|
};
|
|
496
556
|
}
|
|
497
557
|
|
|
498
558
|
// src/extensions/documents-save/hooks/use-document-save-template-props.ts
|
|
499
|
-
import { __ as
|
|
559
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
500
560
|
import { FolderIcon } from "@elementor/icons";
|
|
501
561
|
import { useActiveDocumentActions as useActiveDocumentActions2 } from "@elementor/editor-documents";
|
|
502
562
|
function useDocumentSaveTemplateProps() {
|
|
503
563
|
const { saveTemplate } = useActiveDocumentActions2();
|
|
504
564
|
return {
|
|
505
565
|
icon: FolderIcon,
|
|
506
|
-
title:
|
|
566
|
+
title: __7("Save as Template", "elementor"),
|
|
507
567
|
onClick: saveTemplate
|
|
508
568
|
};
|
|
509
569
|
}
|
|
510
570
|
|
|
511
571
|
// src/extensions/documents-save/components/primary-action.tsx
|
|
512
|
-
import * as
|
|
513
|
-
import { __ as
|
|
572
|
+
import * as React24 from "react";
|
|
573
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
514
574
|
|
|
515
575
|
// src/extensions/documents-save/components/primary-action-menu.tsx
|
|
516
|
-
import * as
|
|
517
|
-
import { Divider as
|
|
518
|
-
var { useMenuItems:
|
|
576
|
+
import * as React23 from "react";
|
|
577
|
+
import { Divider as Divider5, styled as styled2 } from "@elementor/ui";
|
|
578
|
+
var { useMenuItems: useMenuItems5 } = documentOptionsMenu;
|
|
519
579
|
var StyledPopoverMenu = styled2(PopoverMenu)`
|
|
520
580
|
& > .MuiPopover-paper > .MuiList-root > .MuiDivider-root {
|
|
521
581
|
&:only-child, /* A divider is being rendered lonely */
|
|
@@ -526,8 +586,8 @@ var StyledPopoverMenu = styled2(PopoverMenu)`
|
|
|
526
586
|
}
|
|
527
587
|
`;
|
|
528
588
|
function PrimaryActionMenu(props) {
|
|
529
|
-
const { save: saveActions, default: defaultActions } =
|
|
530
|
-
return /* @__PURE__ */
|
|
589
|
+
const { save: saveActions, default: defaultActions } = useMenuItems5();
|
|
590
|
+
return /* @__PURE__ */ React23.createElement(
|
|
531
591
|
StyledPopoverMenu,
|
|
532
592
|
{
|
|
533
593
|
...props,
|
|
@@ -539,36 +599,37 @@ function PrimaryActionMenu(props) {
|
|
|
539
599
|
vertical: "top",
|
|
540
600
|
horizontal: "right"
|
|
541
601
|
},
|
|
602
|
+
marginThreshold: 8,
|
|
542
603
|
PaperProps: {
|
|
543
|
-
sx: { mt: 2
|
|
604
|
+
sx: { mt: 2 }
|
|
544
605
|
}
|
|
545
606
|
},
|
|
546
|
-
saveActions.map(({ MenuItem:
|
|
547
|
-
index > 0 && /* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */
|
|
607
|
+
saveActions.map(({ MenuItem: MenuItem3, id }, index) => [
|
|
608
|
+
index > 0 && /* @__PURE__ */ React23.createElement(Divider5, { key: `${id}-divider` }),
|
|
609
|
+
/* @__PURE__ */ React23.createElement(MenuItem3, { key: id })
|
|
549
610
|
]),
|
|
550
|
-
defaultActions.length > 0 && /* @__PURE__ */
|
|
551
|
-
defaultActions.map(({ MenuItem:
|
|
611
|
+
defaultActions.length > 0 && /* @__PURE__ */ React23.createElement(Divider5, null),
|
|
612
|
+
defaultActions.map(({ MenuItem: MenuItem3, id }) => /* @__PURE__ */ React23.createElement(MenuItem3, { key: id }))
|
|
552
613
|
);
|
|
553
614
|
}
|
|
554
615
|
|
|
555
616
|
// src/extensions/documents-save/components/primary-action.tsx
|
|
556
617
|
import {
|
|
557
|
-
bindMenu as
|
|
618
|
+
bindMenu as bindMenu4,
|
|
558
619
|
bindTrigger as bindTrigger3,
|
|
559
620
|
Box as Box5,
|
|
560
621
|
Button,
|
|
561
622
|
ButtonGroup,
|
|
562
623
|
CircularProgress,
|
|
563
624
|
Tooltip as Tooltip4,
|
|
564
|
-
usePopupState as
|
|
625
|
+
usePopupState as usePopupState4
|
|
565
626
|
} from "@elementor/ui";
|
|
566
627
|
import { useActiveDocument as useActiveDocument4, useActiveDocumentActions as useActiveDocumentActions3 } from "@elementor/editor-documents";
|
|
567
628
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
568
629
|
function PrimaryAction() {
|
|
569
630
|
const document2 = useActiveDocument4();
|
|
570
631
|
const { save } = useActiveDocumentActions3();
|
|
571
|
-
const popupState =
|
|
632
|
+
const popupState = usePopupState4({
|
|
572
633
|
variant: "popover",
|
|
573
634
|
popupId: "document-save-options"
|
|
574
635
|
});
|
|
@@ -577,7 +638,7 @@ function PrimaryAction() {
|
|
|
577
638
|
}
|
|
578
639
|
const isDisabled = !isEnabled(document2);
|
|
579
640
|
const shouldShowSpinner = document2.isSaving && !isDisabled;
|
|
580
|
-
return /* @__PURE__ */
|
|
641
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(ButtonGroup, { size: "medium", variant: "contained" }, /* @__PURE__ */ React24.createElement(
|
|
581
642
|
Button,
|
|
582
643
|
{
|
|
583
644
|
onClick: () => !document2.isSaving && save(),
|
|
@@ -591,11 +652,11 @@ function PrimaryAction() {
|
|
|
591
652
|
},
|
|
592
653
|
disabled: isDisabled
|
|
593
654
|
},
|
|
594
|
-
shouldShowSpinner ? /* @__PURE__ */
|
|
595
|
-
), /* @__PURE__ */
|
|
655
|
+
shouldShowSpinner ? /* @__PURE__ */ React24.createElement(CircularProgress, null) : getLabel(document2)
|
|
656
|
+
), /* @__PURE__ */ React24.createElement(
|
|
596
657
|
Tooltip4,
|
|
597
658
|
{
|
|
598
|
-
title:
|
|
659
|
+
title: __8("Save Options", "elementor"),
|
|
599
660
|
PopperProps: {
|
|
600
661
|
sx: {
|
|
601
662
|
"&.MuiTooltip-popper .MuiTooltip-tooltip.MuiTooltip-tooltipPlacementBottom": {
|
|
@@ -605,20 +666,20 @@ function PrimaryAction() {
|
|
|
605
666
|
}
|
|
606
667
|
}
|
|
607
668
|
},
|
|
608
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ React24.createElement(Box5, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React24.createElement(
|
|
609
670
|
Button,
|
|
610
671
|
{
|
|
611
672
|
...bindTrigger3(popupState),
|
|
612
673
|
sx: { px: 0, height: "100%" },
|
|
613
674
|
disabled: document2.type.value === "kit",
|
|
614
|
-
"aria-label":
|
|
675
|
+
"aria-label": __8("Save Options", "elementor")
|
|
615
676
|
},
|
|
616
|
-
/* @__PURE__ */
|
|
677
|
+
/* @__PURE__ */ React24.createElement(ChevronDownIcon, null)
|
|
617
678
|
))
|
|
618
|
-
)), /* @__PURE__ */
|
|
679
|
+
)), /* @__PURE__ */ React24.createElement(PrimaryActionMenu, { ...bindMenu4(popupState), onClick: popupState.close }));
|
|
619
680
|
}
|
|
620
681
|
function getLabel(document2) {
|
|
621
|
-
return document2.userCan.publish ?
|
|
682
|
+
return document2.userCan.publish ? __8("Publish", "elementor") : __8("Submit", "elementor");
|
|
622
683
|
}
|
|
623
684
|
function isEnabled(document2) {
|
|
624
685
|
if (document2.type.value === "kit") {
|
|
@@ -650,11 +711,11 @@ function init3() {
|
|
|
650
711
|
}
|
|
651
712
|
|
|
652
713
|
// src/extensions/elements/sync/sync-panel-title.ts
|
|
653
|
-
import { __ as
|
|
714
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
654
715
|
import { isRouteActive, listenTo as listenTo2, routeOpenEvent as routeOpenEvent2, v1ReadyEvent } from "@elementor/editor-v1-adapters";
|
|
655
716
|
function syncPanelTitle() {
|
|
656
|
-
const panelTitle =
|
|
657
|
-
const tabTitle =
|
|
717
|
+
const panelTitle = __9("Elements", "elementor");
|
|
718
|
+
const tabTitle = __9("Widgets", "elementor");
|
|
658
719
|
listenTo2(
|
|
659
720
|
routeOpenEvent2("panel/elements"),
|
|
660
721
|
() => {
|
|
@@ -684,12 +745,12 @@ function setTabTitle(title) {
|
|
|
684
745
|
|
|
685
746
|
// src/extensions/elements/hooks/use-action-props.ts
|
|
686
747
|
import { PlusIcon } from "@elementor/icons";
|
|
687
|
-
import { __ as
|
|
748
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
688
749
|
import { openRoute as openRoute3, useRouteStatus as useRouteStatus2 } from "@elementor/editor-v1-adapters";
|
|
689
750
|
function useActionProps2() {
|
|
690
751
|
const { isActive, isBlocked } = useRouteStatus2("panel/elements");
|
|
691
752
|
return {
|
|
692
|
-
title:
|
|
753
|
+
title: __10("Add Element", "elementor"),
|
|
693
754
|
icon: PlusIcon,
|
|
694
755
|
onClick: () => openRoute3("panel/elements/categories"),
|
|
695
756
|
selected: isActive,
|
|
@@ -708,7 +769,7 @@ function init4() {
|
|
|
708
769
|
}
|
|
709
770
|
|
|
710
771
|
// src/extensions/finder/hooks/use-action-props.ts
|
|
711
|
-
import { __ as
|
|
772
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
712
773
|
import { SearchIcon } from "@elementor/icons";
|
|
713
774
|
import { runCommand as runCommand2, useRouteStatus as useRouteStatus3 } from "@elementor/editor-v1-adapters";
|
|
714
775
|
function useActionProps3() {
|
|
@@ -717,7 +778,7 @@ function useActionProps3() {
|
|
|
717
778
|
blockOnPreviewMode: false
|
|
718
779
|
});
|
|
719
780
|
return {
|
|
720
|
-
title:
|
|
781
|
+
title: __11("Finder", "elementor"),
|
|
721
782
|
icon: SearchIcon,
|
|
722
783
|
onClick: () => runCommand2("finder/toggle"),
|
|
723
784
|
selected: isActive,
|
|
@@ -736,7 +797,7 @@ function init5() {
|
|
|
736
797
|
}
|
|
737
798
|
|
|
738
799
|
// src/extensions/help/index.ts
|
|
739
|
-
import { __ as
|
|
800
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
740
801
|
import { HelpIcon } from "@elementor/icons";
|
|
741
802
|
function init6() {
|
|
742
803
|
utilitiesMenu.registerLink({
|
|
@@ -745,7 +806,7 @@ function init6() {
|
|
|
745
806
|
// After Finder.
|
|
746
807
|
useProps: () => {
|
|
747
808
|
return {
|
|
748
|
-
title:
|
|
809
|
+
title: __12("Help", "elementor"),
|
|
749
810
|
href: "https://go.elementor.com/editor-top-bar-learn/",
|
|
750
811
|
icon: HelpIcon,
|
|
751
812
|
target: "_blank"
|
|
@@ -756,12 +817,12 @@ function init6() {
|
|
|
756
817
|
|
|
757
818
|
// src/extensions/history/hooks/use-action-props.ts
|
|
758
819
|
import { HistoryIcon } from "@elementor/icons";
|
|
759
|
-
import { __ as
|
|
820
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
760
821
|
import { openRoute as openRoute4, useRouteStatus as useRouteStatus4 } from "@elementor/editor-v1-adapters";
|
|
761
822
|
function useActionProps4() {
|
|
762
823
|
const { isActive, isBlocked } = useRouteStatus4("panel/history");
|
|
763
824
|
return {
|
|
764
|
-
title:
|
|
825
|
+
title: __13("History", "elementor"),
|
|
765
826
|
icon: HistoryIcon,
|
|
766
827
|
onClick: () => openRoute4("panel/history/actions"),
|
|
767
828
|
selected: isActive,
|
|
@@ -779,13 +840,13 @@ function init7() {
|
|
|
779
840
|
}
|
|
780
841
|
|
|
781
842
|
// src/extensions/keyboard-shortcuts/hooks/use-action-props.ts
|
|
782
|
-
import { __ as
|
|
843
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
783
844
|
import { KeyboardIcon } from "@elementor/icons";
|
|
784
845
|
import { runCommand as runCommand3 } from "@elementor/editor-v1-adapters";
|
|
785
846
|
function useActionProps5() {
|
|
786
847
|
return {
|
|
787
848
|
icon: KeyboardIcon,
|
|
788
|
-
title:
|
|
849
|
+
title: __14("Keyboard Shortcuts", "elementor"),
|
|
789
850
|
onClick: () => runCommand3("shortcuts/open")
|
|
790
851
|
};
|
|
791
852
|
}
|
|
@@ -805,10 +866,10 @@ function init8() {
|
|
|
805
866
|
import { injectIntoTop } from "@elementor/editor";
|
|
806
867
|
|
|
807
868
|
// src/extensions/site-settings/components/portalled-primary-action.tsx
|
|
808
|
-
import * as
|
|
869
|
+
import * as React27 from "react";
|
|
809
870
|
|
|
810
871
|
// src/extensions/site-settings/components/portal.tsx
|
|
811
|
-
import * as
|
|
872
|
+
import * as React25 from "react";
|
|
812
873
|
import { Portal as BasePortal } from "@elementor/ui";
|
|
813
874
|
import { isRouteActive as isRouteActive2, routeCloseEvent, routeOpenEvent as routeOpenEvent3, useListenTo } from "@elementor/editor-v1-adapters";
|
|
814
875
|
function Portal(props) {
|
|
@@ -822,26 +883,26 @@ function Portal(props) {
|
|
|
822
883
|
if (!containerRef.current) {
|
|
823
884
|
return null;
|
|
824
885
|
}
|
|
825
|
-
return /* @__PURE__ */
|
|
886
|
+
return /* @__PURE__ */ React25.createElement(BasePortal, { container: containerRef.current, ...props });
|
|
826
887
|
}
|
|
827
888
|
function getContainerRef() {
|
|
828
889
|
return isRouteActive2("panel/global") ? { current: document.querySelector("#elementor-panel-inner") } : { current: null };
|
|
829
890
|
}
|
|
830
891
|
|
|
831
892
|
// src/extensions/site-settings/components/primary-action.tsx
|
|
832
|
-
import * as
|
|
893
|
+
import * as React26 from "react";
|
|
833
894
|
import { useActiveDocument as useActiveDocument5, useActiveDocumentActions as useActiveDocumentActions4 } from "@elementor/editor-documents";
|
|
834
895
|
import { Button as Button2, CircularProgress as CircularProgress2, Paper } from "@elementor/ui";
|
|
835
|
-
import { __ as
|
|
896
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
836
897
|
function PrimaryAction2() {
|
|
837
898
|
const document2 = useActiveDocument5();
|
|
838
899
|
const { save } = useActiveDocumentActions4();
|
|
839
|
-
return /* @__PURE__ */
|
|
900
|
+
return /* @__PURE__ */ React26.createElement(Paper, { sx: {
|
|
840
901
|
px: 5,
|
|
841
902
|
py: 4,
|
|
842
903
|
borderTop: 1,
|
|
843
904
|
borderColor: "divider"
|
|
844
|
-
} }, /* @__PURE__ */
|
|
905
|
+
} }, /* @__PURE__ */ React26.createElement(
|
|
845
906
|
Button2,
|
|
846
907
|
{
|
|
847
908
|
variant: "contained",
|
|
@@ -850,17 +911,17 @@ function PrimaryAction2() {
|
|
|
850
911
|
sx: { width: "100%" },
|
|
851
912
|
onClick: () => document2 && !document2.isSaving ? save() : null
|
|
852
913
|
},
|
|
853
|
-
document2?.isSaving ? /* @__PURE__ */
|
|
914
|
+
document2?.isSaving ? /* @__PURE__ */ React26.createElement(CircularProgress2, null) : __15("Save Changes", "elementor")
|
|
854
915
|
));
|
|
855
916
|
}
|
|
856
917
|
|
|
857
918
|
// src/extensions/site-settings/components/portalled-primary-action.tsx
|
|
858
919
|
function PortalledPrimaryAction() {
|
|
859
|
-
return /* @__PURE__ */
|
|
920
|
+
return /* @__PURE__ */ React27.createElement(Portal, null, /* @__PURE__ */ React27.createElement(PrimaryAction2, null));
|
|
860
921
|
}
|
|
861
922
|
|
|
862
923
|
// src/extensions/site-settings/hooks/use-action-props.ts
|
|
863
|
-
import { __ as
|
|
924
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
864
925
|
import { runCommand as runCommand4, useRouteStatus as useRouteStatus5 } from "@elementor/editor-v1-adapters";
|
|
865
926
|
import { AdjustmentsHorizontalIcon } from "@elementor/icons";
|
|
866
927
|
function useActionProps6() {
|
|
@@ -868,7 +929,7 @@ function useActionProps6() {
|
|
|
868
929
|
blockOnKitRoutes: false
|
|
869
930
|
});
|
|
870
931
|
return {
|
|
871
|
-
title:
|
|
932
|
+
title: __16("Site Settings", "elementor"),
|
|
872
933
|
icon: AdjustmentsHorizontalIcon,
|
|
873
934
|
onClick: () => isActive ? runCommand4("panel/global/close") : runCommand4("panel/global/open"),
|
|
874
935
|
selected: isActive,
|
|
@@ -890,13 +951,13 @@ function init9() {
|
|
|
890
951
|
}
|
|
891
952
|
|
|
892
953
|
// src/extensions/structure/hooks/use-action-props.ts
|
|
893
|
-
import { __ as
|
|
954
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
894
955
|
import { runCommand as runCommand5, useRouteStatus as useRouteStatus6 } from "@elementor/editor-v1-adapters";
|
|
895
956
|
import { StructureIcon } from "@elementor/icons";
|
|
896
957
|
function useActionProps7() {
|
|
897
958
|
const { isActive, isBlocked } = useRouteStatus6("navigator");
|
|
898
959
|
return {
|
|
899
|
-
title:
|
|
960
|
+
title: __17("Structure", "elementor"),
|
|
900
961
|
icon: StructureIcon,
|
|
901
962
|
onClick: () => runCommand5("navigator/toggle"),
|
|
902
963
|
selected: isActive,
|
|
@@ -914,13 +975,13 @@ function init10() {
|
|
|
914
975
|
}
|
|
915
976
|
|
|
916
977
|
// src/extensions/theme-builder/hooks/use-action-props.ts
|
|
917
|
-
import { __ as
|
|
978
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
918
979
|
import { ThemeBuilderIcon } from "@elementor/icons";
|
|
919
980
|
import { runCommand as runCommand6 } from "@elementor/editor-v1-adapters";
|
|
920
981
|
function useActionProps8() {
|
|
921
982
|
return {
|
|
922
983
|
icon: ThemeBuilderIcon,
|
|
923
|
-
title:
|
|
984
|
+
title: __18("Theme Builder", "elementor"),
|
|
924
985
|
onClick: () => runCommand6("app/open")
|
|
925
986
|
};
|
|
926
987
|
}
|
|
@@ -934,14 +995,14 @@ function init11() {
|
|
|
934
995
|
}
|
|
935
996
|
|
|
936
997
|
// src/extensions/user-preferences/hooks/use-action-props.ts
|
|
937
|
-
import { __ as
|
|
998
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
938
999
|
import { ToggleRightIcon } from "@elementor/icons";
|
|
939
1000
|
import { openRoute as openRoute5, useRouteStatus as useRouteStatus7 } from "@elementor/editor-v1-adapters";
|
|
940
1001
|
function useActionProps9() {
|
|
941
1002
|
const { isActive, isBlocked } = useRouteStatus7("panel/editor-preferences");
|
|
942
1003
|
return {
|
|
943
1004
|
icon: ToggleRightIcon,
|
|
944
|
-
title:
|
|
1005
|
+
title: __19("User Preferences", "elementor"),
|
|
945
1006
|
onClick: () => openRoute5("panel/editor-preferences"),
|
|
946
1007
|
selected: isActive,
|
|
947
1008
|
disabled: isBlocked
|
|
@@ -959,7 +1020,7 @@ function init12() {
|
|
|
959
1020
|
}
|
|
960
1021
|
|
|
961
1022
|
// src/extensions/wordpress/index.ts
|
|
962
|
-
import { __ as
|
|
1023
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
963
1024
|
import { WordpressIcon } from "@elementor/icons";
|
|
964
1025
|
import { useActiveDocument as useActiveDocument6 } from "@elementor/editor-documents";
|
|
965
1026
|
function init13() {
|
|
@@ -969,7 +1030,7 @@ function init13() {
|
|
|
969
1030
|
useProps: () => {
|
|
970
1031
|
const document2 = useActiveDocument6();
|
|
971
1032
|
return {
|
|
972
|
-
title:
|
|
1033
|
+
title: __20("Exit to WordPress", "elementor"),
|
|
973
1034
|
href: document2?.links?.platformEdit,
|
|
974
1035
|
icon: WordpressIcon
|
|
975
1036
|
};
|
|
@@ -1011,6 +1072,7 @@ export {
|
|
|
1011
1072
|
injectIntoPageIndication,
|
|
1012
1073
|
injectIntoPrimaryAction,
|
|
1013
1074
|
injectIntoResponsive,
|
|
1075
|
+
integrationsMenu,
|
|
1014
1076
|
mainMenu,
|
|
1015
1077
|
toolsMenu,
|
|
1016
1078
|
utilitiesMenu
|