@elementor/editor-app-bar 0.14.5 → 0.14.6

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +25 -239
  2. package/dist/index.js +156 -260
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +223 -286
  5. package/dist/index.mjs.map +1 -1
  6. package/package.json +46 -46
  7. package/src/components/__tests__/app-bar.test.tsx +6 -2
  8. package/src/components/actions/action.tsx +1 -5
  9. package/src/components/actions/actions-group.tsx +7 -7
  10. package/src/components/actions/link.tsx +2 -6
  11. package/src/components/actions/toggle-action.tsx +1 -5
  12. package/src/components/app-bar.tsx +1 -2
  13. package/src/components/locations/__tests__/menus.test.tsx +1 -6
  14. package/src/components/locations/integrations-menu-location.tsx +4 -8
  15. package/src/components/locations/main-menu-location.tsx +14 -21
  16. package/src/components/locations/page-indication-location.tsx +1 -3
  17. package/src/components/locations/primary-action-location.tsx +1 -3
  18. package/src/components/locations/responsive-location.tsx +1 -3
  19. package/src/components/locations/tools-menu-location.tsx +6 -2
  20. package/src/components/locations/utilities-menu-location.tsx +9 -9
  21. package/src/components/ui/popover-menu-item.tsx +12 -9
  22. package/src/components/ui/popover-menu.tsx +1 -1
  23. package/src/components/ui/popover-sub-menu.tsx +1 -4
  24. package/src/components/ui/toolbar-logo.tsx +2 -2
  25. package/src/components/ui/toolbar-menu-item.tsx +12 -10
  26. package/src/components/ui/toolbar-menu-more.tsx +2 -2
  27. package/src/components/ui/toolbar-menu-toggle-item.tsx +2 -2
  28. package/src/contexts/menu-context.tsx +4 -8
  29. package/src/extensions/documents-indicator/components/__tests__/settings-button.test.tsx +9 -4
  30. package/src/extensions/documents-indicator/components/settings-button.tsx +27 -25
  31. package/src/extensions/documents-preview/hooks/use-action-props.ts +6 -9
  32. package/src/extensions/documents-save/components/__tests__/primary-action.test.tsx +4 -1
  33. package/src/extensions/documents-save/components/primary-action-menu.tsx +7 -7
  34. package/src/extensions/documents-save/components/primary-action.tsx +12 -13
  35. package/src/extensions/documents-save/hooks/__tests__/use-document-save-draft-props.test.ts +4 -1
  36. package/src/extensions/documents-save/hooks/use-document-copy-and-share-props.ts +6 -5
  37. package/src/extensions/documents-save/hooks/use-document-save-draft-props.ts +4 -1
  38. package/src/extensions/documents-save/hooks/use-document-view-page-props.ts +5 -3
  39. package/src/extensions/elements/hooks/__tests__/use-action-props.test.ts +4 -1
  40. package/src/extensions/elements/hooks/use-action-props.ts +10 -10
  41. package/src/extensions/elements/sync/__tests__/sync-panel-title.test.ts +18 -14
  42. package/src/extensions/elements/sync/sync-panel-title.ts +18 -19
  43. package/src/extensions/finder/hooks/__tests__/use-action-props.test.ts +4 -1
  44. package/src/extensions/finder/hooks/use-action-props.ts +10 -10
  45. package/src/extensions/help/index.ts +6 -9
  46. package/src/extensions/history/hooks/__tests__/use-action-props.test.ts +4 -1
  47. package/src/extensions/history/hooks/use-action-props.ts +10 -10
  48. package/src/extensions/keyboard-shortcuts/hooks/use-action-props.ts +6 -9
  49. package/src/extensions/site-settings/components/__tests__/portalled-primary-action.test.tsx +9 -4
  50. package/src/extensions/site-settings/components/__tests__/primary-action.test.tsx +11 -6
  51. package/src/extensions/site-settings/components/portal.tsx +9 -9
  52. package/src/extensions/site-settings/components/primary-action.tsx +14 -13
  53. package/src/extensions/site-settings/hooks/__tests__/use-action-props.test.ts +4 -1
  54. package/src/extensions/site-settings/hooks/use-action-props.ts +10 -10
  55. package/src/extensions/structure/hooks/__tests__/use-action-props.test.ts +4 -1
  56. package/src/extensions/structure/hooks/use-action-props.ts +10 -10
  57. package/src/extensions/theme-builder/hooks/use-action-props.ts +6 -9
  58. package/src/extensions/user-preferences/hooks/__tests__/use-action-props.test.ts +4 -1
  59. package/src/extensions/user-preferences/hooks/use-action-props.ts +10 -10
  60. package/src/extensions/wordpress/index.ts +6 -9
  61. package/src/index.ts +1 -5
  62. package/src/locations/__tests__/menus.test.tsx +5 -6
  63. package/src/locations/index.ts +5 -14
  64. package/src/locations/menus.tsx +60 -75
  65. package/src/sync/__tests__/redirect-old-menus.test.ts +14 -10
  66. package/src/sync/redirect-old-menus.ts +5 -1
  67. package/src/types.ts +11 -11
package/dist/index.mjs CHANGED
@@ -60,16 +60,20 @@ function Tooltip(props) {
60
60
 
61
61
  // src/components/ui/popover-menu-item.tsx
62
62
  import * as React3 from "react";
63
- import {
64
- MenuItem,
65
- ListItemText,
66
- ListItemIcon,
67
- withDirection
68
- } from "@elementor/ui";
63
+ import { MenuItem, ListItemText, ListItemIcon, withDirection } from "@elementor/ui";
69
64
  import { ArrowUpRightIcon, ChevronRightIcon } from "@elementor/icons";
70
65
  var DirectionalArrowIcon = withDirection(ArrowUpRightIcon);
71
66
  var DirectionalChevronIcon = withDirection(ChevronRightIcon);
72
- function PopoverMenuItem({ text, icon, onClick, href, target, disabled, isGroupParent, ...props }) {
67
+ function PopoverMenuItem({
68
+ text,
69
+ icon,
70
+ onClick,
71
+ href,
72
+ target,
73
+ disabled,
74
+ isGroupParent,
75
+ ...props
76
+ }) {
73
77
  const isExternalLink = href && target === "_blank";
74
78
  return /* @__PURE__ */ React3.createElement(
75
79
  MenuItem,
@@ -100,14 +104,7 @@ function Action({ icon: Icon, title, visible = true, ...props }) {
100
104
  if (!visible) {
101
105
  return null;
102
106
  }
103
- return type === "toolbar" ? /* @__PURE__ */ React4.createElement(ToolbarMenuItem, { title, ...props }, /* @__PURE__ */ React4.createElement(Icon, null)) : /* @__PURE__ */ React4.createElement(
104
- PopoverMenuItem,
105
- {
106
- ...props,
107
- text: title,
108
- icon: /* @__PURE__ */ React4.createElement(Icon, null)
109
- }
110
- );
107
+ return type === "toolbar" ? /* @__PURE__ */ React4.createElement(ToolbarMenuItem, { title, ...props }, /* @__PURE__ */ React4.createElement(Icon, null)) : /* @__PURE__ */ React4.createElement(PopoverMenuItem, { ...props, text: title, icon: /* @__PURE__ */ React4.createElement(Icon, null) });
111
108
  }
112
109
 
113
110
  // src/components/actions/toggle-action.tsx
@@ -147,14 +144,7 @@ function ToggleAction({ icon: Icon, title, value, visible = true, ...props }) {
147
144
  if (!visible) {
148
145
  return null;
149
146
  }
150
- return type === "toolbar" ? /* @__PURE__ */ React6.createElement(ToolbarMenuToggleItem, { value: value || title, title, ...props }, /* @__PURE__ */ React6.createElement(Icon, null)) : /* @__PURE__ */ React6.createElement(
151
- PopoverMenuItem,
152
- {
153
- ...props,
154
- text: title,
155
- icon: /* @__PURE__ */ React6.createElement(Icon, null)
156
- }
157
- );
147
+ return type === "toolbar" ? /* @__PURE__ */ React6.createElement(ToolbarMenuToggleItem, { value: value || title, title, ...props }, /* @__PURE__ */ React6.createElement(Icon, null)) : /* @__PURE__ */ React6.createElement(PopoverMenuItem, { ...props, text: title, icon: /* @__PURE__ */ React6.createElement(Icon, null) });
158
148
  }
159
149
 
160
150
  // src/components/actions/link.tsx
@@ -164,14 +154,7 @@ function Link({ icon: Icon, title, visible = true, ...props }) {
164
154
  if (!visible) {
165
155
  return null;
166
156
  }
167
- return type === "toolbar" ? /* @__PURE__ */ React7.createElement(ToolbarMenuItem, { title, ...props }, /* @__PURE__ */ React7.createElement(Icon, null)) : /* @__PURE__ */ React7.createElement(
168
- PopoverMenuItem,
169
- {
170
- ...props,
171
- text: title,
172
- icon: /* @__PURE__ */ React7.createElement(Icon, null)
173
- }
174
- );
157
+ return type === "toolbar" ? /* @__PURE__ */ React7.createElement(ToolbarMenuItem, { title, ...props }, /* @__PURE__ */ React7.createElement(Icon, null)) : /* @__PURE__ */ React7.createElement(PopoverMenuItem, { ...props, text: title, icon: /* @__PURE__ */ React7.createElement(Icon, null) });
175
158
  }
176
159
 
177
160
  // src/components/actions/actions-group.tsx
@@ -261,23 +244,12 @@ function ActionsGroup({ icon: Icon, title, visible = true, items, ...props }) {
261
244
  icon: /* @__PURE__ */ React10.createElement(Icon, null),
262
245
  isGroupParent: true
263
246
  }
264
- ), /* @__PURE__ */ React10.createElement(
265
- PopoverSubMenu,
266
- {
267
- ...props,
268
- ...bindPopover(popupState),
269
- popupState
270
- },
271
- items.map(({ MenuItem: MenuItem2, id: key }) => /* @__PURE__ */ React10.createElement(MenuItem2, { key }))
272
- ));
247
+ ), /* @__PURE__ */ React10.createElement(PopoverSubMenu, { ...props, ...bindPopover(popupState), popupState }, items.map(({ MenuItem: MenuItem2, id: key }) => /* @__PURE__ */ React10.createElement(MenuItem2, { key }))));
273
248
  }
274
249
 
275
250
  // src/locations/menus.tsx
276
251
  function createMenu(groups = []) {
277
- const menuGroups = [
278
- ...groups,
279
- "default"
280
- ];
252
+ const menuGroups = [...groups, "default"];
281
253
  const locations = menuGroups.reduce(
282
254
  (carry, group) => ({
283
255
  ...carry,
@@ -285,11 +257,7 @@ function createMenu(groups = []) {
285
257
  }),
286
258
  {}
287
259
  );
288
- const [
289
- registerAction,
290
- registerToggleAction,
291
- registerLink
292
- ] = [Action, ToggleAction, Link].map(
260
+ const [registerAction, registerToggleAction, registerLink] = [Action, ToggleAction, Link].map(
293
261
  (Component) => createRegisterMenuItem({
294
262
  locations,
295
263
  menuGroups,
@@ -309,7 +277,12 @@ function createMenu(groups = []) {
309
277
  useMenuItems: useMenuItems6
310
278
  };
311
279
  }
312
- function createRegisterMenuItem({ locations, menuGroups, component, useMenuItems: useMenuItems6 }) {
280
+ function createRegisterMenuItem({
281
+ locations,
282
+ menuGroups,
283
+ component,
284
+ useMenuItems: useMenuItems6
285
+ }) {
313
286
  return ({ group = "default", id, overwrite, priority, ...args }) => {
314
287
  if (!menuGroups.includes(group)) {
315
288
  return;
@@ -320,14 +293,7 @@ function createRegisterMenuItem({ locations, menuGroups, component, useMenuItems
320
293
  const componentProps = useProps();
321
294
  const items = useMenuItems6?.();
322
295
  if (items?.length) {
323
- return /* @__PURE__ */ React11.createElement(
324
- Component,
325
- {
326
- ...props,
327
- ...componentProps,
328
- items
329
- }
330
- );
296
+ return /* @__PURE__ */ React11.createElement(Component, { ...props, ...componentProps, items });
331
297
  }
332
298
  return /* @__PURE__ */ React11.createElement(Component, { ...props, ...componentProps });
333
299
  };
@@ -341,7 +307,10 @@ function createRegisterMenuItem({ locations, menuGroups, component, useMenuItems
341
307
  });
342
308
  };
343
309
  }
344
- function createRegisterSubMenu({ locations, menuGroups }) {
310
+ function createRegisterSubMenu({
311
+ locations,
312
+ menuGroups
313
+ }) {
345
314
  return (args) => {
346
315
  const menu = createMenu();
347
316
  createRegisterMenuItem({
@@ -356,37 +325,25 @@ function createRegisterSubMenu({ locations, menuGroups }) {
356
325
  function createUseMenuItems(locations) {
357
326
  return () => {
358
327
  return useMemo(() => {
359
- return Object.entries(locations).reduce(
360
- (carry, [groupName, location]) => {
361
- const items = location.getInjections().map((injection) => ({
362
- id: injection.id,
363
- MenuItem: injection.component
364
- }));
365
- return {
366
- ...carry,
367
- [groupName]: items
368
- };
369
- },
370
- {}
371
- );
328
+ return Object.entries(locations).reduce((carry, [groupName, location]) => {
329
+ const items = location.getInjections().map((injection) => ({
330
+ id: injection.id,
331
+ MenuItem: injection.component
332
+ }));
333
+ return {
334
+ ...carry,
335
+ [groupName]: items
336
+ };
337
+ }, {});
372
338
  }, []);
373
339
  };
374
340
  }
375
341
 
376
342
  // src/locations/index.ts
377
343
  import { createLocation as createLocation2 } from "@elementor/locations";
378
- var {
379
- inject: injectIntoPageIndication,
380
- Slot: PageIndicationSlot
381
- } = createLocation2();
382
- var {
383
- inject: injectIntoResponsive,
384
- Slot: ResponsiveSlot
385
- } = createLocation2();
386
- var {
387
- inject: injectIntoPrimaryAction,
388
- Slot: PrimaryActionSlot
389
- } = createLocation2();
344
+ var { inject: injectIntoPageIndication, Slot: PageIndicationSlot } = createLocation2();
345
+ var { inject: injectIntoResponsive, Slot: ResponsiveSlot } = createLocation2();
346
+ var { inject: injectIntoPrimaryAction, Slot: PrimaryActionSlot } = createLocation2();
390
347
  var mainMenu = createMenu(["exits"]);
391
348
  var toolsMenu = createMenu();
392
349
  var utilitiesMenu = createMenu();
@@ -484,36 +441,16 @@ function MainMenuLocation() {
484
441
  const extendedWindow = window;
485
442
  const config = extendedWindow?.elementor?.editorEvents?.config;
486
443
  if (config) {
487
- extendedWindow.elementor.editorEvents.dispatchEvent(
488
- config.names.topBar.elementorLogoDropdown,
489
- {
490
- location: config.locations.topBar,
491
- secondaryLocation: config.secondaryLocations.elementorLogo,
492
- trigger: config.triggers.dropdownClick,
493
- element: config.elements.buttonIcon
494
- }
495
- );
444
+ extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.elementorLogoDropdown, {
445
+ location: config.locations.topBar,
446
+ secondaryLocation: config.secondaryLocations.elementorLogo,
447
+ trigger: config.triggers.dropdownClick,
448
+ element: config.elements.buttonIcon
449
+ });
496
450
  }
497
451
  toolbarLogoProps.onClick(e);
498
452
  };
499
- return /* @__PURE__ */ React13.createElement(Stack, { sx: { paddingInlineStart: 3 }, direction: "row", alignItems: "center" }, /* @__PURE__ */ React13.createElement(
500
- ToolbarLogo,
501
- {
502
- ...toolbarLogoProps,
503
- onClick: onToolbarClick,
504
- selected: popupState.isOpen
505
- }
506
- ), /* @__PURE__ */ React13.createElement(
507
- PopoverMenu,
508
- {
509
- onClick: popupState.close,
510
- ...bindMenu2(popupState),
511
- marginThreshold: 8
512
- },
513
- menuItems.default.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React13.createElement(MenuItem2, { key: id })),
514
- menuItems.exits.length > 0 && /* @__PURE__ */ React13.createElement(Divider, null),
515
- menuItems.exits.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React13.createElement(MenuItem2, { key: id }))
516
- ));
453
+ return /* @__PURE__ */ React13.createElement(Stack, { sx: { paddingInlineStart: 3 }, direction: "row", alignItems: "center" }, /* @__PURE__ */ React13.createElement(ToolbarLogo, { ...toolbarLogoProps, onClick: onToolbarClick, selected: popupState.isOpen }), /* @__PURE__ */ React13.createElement(PopoverMenu, { onClick: popupState.close, ...bindMenu2(popupState), marginThreshold: 8 }, menuItems.default.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React13.createElement(MenuItem2, { key: id })), menuItems.exits.length > 0 && /* @__PURE__ */ React13.createElement(Divider, null), menuItems.exits.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React13.createElement(MenuItem2, { key: id }))));
517
454
  }
518
455
 
519
456
  // src/components/locations/tools-menu-location.tsx
@@ -541,11 +478,7 @@ function ToolbarMenuMore({ children, id }) {
541
478
 
542
479
  // src/components/locations/integrations-menu-location.tsx
543
480
  import * as React16 from "react";
544
- import {
545
- bindMenu as bindMenu4,
546
- bindTrigger as bindTrigger4,
547
- usePopupState as usePopupState4
548
- } from "@elementor/ui";
481
+ import { bindMenu as bindMenu4, bindTrigger as bindTrigger4, usePopupState as usePopupState4 } from "@elementor/ui";
549
482
  import { __ as __3 } from "@wordpress/i18n";
550
483
  import { PlugIcon } from "@elementor/icons";
551
484
  var { useMenuItems: useMenuItems2 } = integrationsMenu;
@@ -566,9 +499,7 @@ function IntegrationsMenuLocation() {
566
499
  marginThreshold: 8,
567
500
  open: popupState.isOpen
568
501
  },
569
- menuItems.default.map(
570
- ({ MenuItem: IntegrationsMenuItem, id }) => /* @__PURE__ */ React16.createElement(IntegrationsMenuItem, { key: id })
571
- )
502
+ menuItems.default.map(({ MenuItem: IntegrationsMenuItem, id }) => /* @__PURE__ */ React16.createElement(IntegrationsMenuItem, { key: id }))
572
503
  ));
573
504
  }
574
505
 
@@ -592,9 +523,7 @@ function UtilitiesMenuLocation() {
592
523
  const menuItems = useMenuItems4();
593
524
  const toolbarMenuItems = menuItems.default.slice(0, MAX_TOOLBAR_ACTIONS2);
594
525
  const popoverMenuItems = menuItems.default.slice(MAX_TOOLBAR_ACTIONS2);
595
- return /* @__PURE__ */ React18.createElement(ToolbarMenu, null, toolbarMenuItems.map(
596
- ({ MenuItem: MenuItem2, id }, index) => /* @__PURE__ */ React18.createElement(Fragment4, { key: id }, index === 0 && /* @__PURE__ */ React18.createElement(Divider2, { orientation: "vertical" }), /* @__PURE__ */ React18.createElement(MenuItem2, null))
597
- ), 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 }))));
526
+ return /* @__PURE__ */ React18.createElement(ToolbarMenu, null, toolbarMenuItems.map(({ MenuItem: MenuItem2, id }, index) => /* @__PURE__ */ React18.createElement(Fragment4, { key: id }, index === 0 && /* @__PURE__ */ React18.createElement(Divider2, { orientation: "vertical" }), /* @__PURE__ */ React18.createElement(MenuItem2, null))), 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 }))));
598
527
  }
599
528
 
600
529
  // src/components/locations/primary-action-location.tsx
@@ -626,7 +555,11 @@ function AppBar() {
626
555
  import { injectIntoTop as injectIntoTop2 } from "@elementor/editor";
627
556
 
628
557
  // src/sync/redirect-old-menus.ts
629
- import { __privateListenTo as listenTo, __privateOpenRoute as openRoute, routeOpenEvent } from "@elementor/editor-v1-adapters";
558
+ import {
559
+ __privateListenTo as listenTo,
560
+ __privateOpenRoute as openRoute,
561
+ routeOpenEvent
562
+ } from "@elementor/editor-v1-adapters";
630
563
  function redirectOldMenus() {
631
564
  listenTo(routeOpenEvent("panel/menu"), () => {
632
565
  openRoute("panel/elements/categories");
@@ -637,9 +570,15 @@ function redirectOldMenus() {
637
570
  import * as React23 from "react";
638
571
  import { Box as Box4, ToggleButton as ToggleButton3, Tooltip as BaseTooltip2 } from "@elementor/ui";
639
572
  import { __ as __4 } from "@wordpress/i18n";
640
- import { __privateOpenRoute as openRoute2, __privateUseRouteStatus as useRouteStatus } from "@elementor/editor-v1-adapters";
573
+ import {
574
+ __privateOpenRoute as openRoute2,
575
+ __privateUseRouteStatus as useRouteStatus
576
+ } from "@elementor/editor-v1-adapters";
641
577
  import { SettingsIcon } from "@elementor/icons";
642
- import { __useActiveDocument as useActiveDocument2, __useHostDocument as useHostDocument } from "@elementor/editor-documents";
578
+ import {
579
+ __useActiveDocument as useActiveDocument2,
580
+ __useHostDocument as useHostDocument
581
+ } from "@elementor/editor-documents";
643
582
  function SettingsButton() {
644
583
  const activeDocument = useActiveDocument2();
645
584
  const hostDocument = useHostDocument();
@@ -659,15 +598,12 @@ function SettingsButton() {
659
598
  const extendedWindow = window;
660
599
  const config = extendedWindow?.elementor?.editorEvents?.config;
661
600
  if (config) {
662
- extendedWindow.elementor.editorEvents.dispatchEvent(
663
- config.names.topBar.documentSettings,
664
- {
665
- location: config.locations.topBar,
666
- secondaryLocation: config.secondaryLocations["document-settings"],
667
- trigger: config.triggers.click,
668
- element: config.elements.buttonIcon
669
- }
670
- );
601
+ extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.documentSettings, {
602
+ location: config.locations.topBar,
603
+ secondaryLocation: config.secondaryLocations["document-settings"],
604
+ trigger: config.triggers.click,
605
+ element: config.elements.buttonIcon
606
+ });
671
607
  }
672
608
  openRoute2("panel/page-settings/settings");
673
609
  },
@@ -727,15 +663,12 @@ function useActionProps() {
727
663
  const extendedWindow = window;
728
664
  const config = extendedWindow?.elementor?.editorEvents?.config;
729
665
  if (config) {
730
- extendedWindow.elementor.editorEvents.dispatchEvent(
731
- config.names.topBar.previewPage,
732
- {
733
- location: config.locations.topBar,
734
- secondaryLocation: config.secondaryLocations["preview-page"],
735
- trigger: config.triggers.click,
736
- element: config.elements.buttonIcon
737
- }
738
- );
666
+ extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.previewPage, {
667
+ location: config.locations.topBar,
668
+ secondaryLocation: config.secondaryLocations["preview-page"],
669
+ trigger: config.triggers.click,
670
+ element: config.elements.buttonIcon
671
+ });
739
672
  }
740
673
  if (document2) {
741
674
  runCommand("editor/documents/preview", {
@@ -760,7 +693,10 @@ function init2() {
760
693
  // src/extensions/documents-save/hooks/use-document-save-draft-props.ts
761
694
  import { __ as __6 } from "@wordpress/i18n";
762
695
  import { FileReportIcon } from "@elementor/icons";
763
- import { __useActiveDocument as useActiveDocument4, __useActiveDocumentActions as useActiveDocumentActions } from "@elementor/editor-documents";
696
+ import {
697
+ __useActiveDocument as useActiveDocument4,
698
+ __useActiveDocumentActions as useActiveDocumentActions
699
+ } from "@elementor/editor-documents";
764
700
  function useDocumentSaveDraftProps() {
765
701
  const document2 = useActiveDocument4();
766
702
  const { saveDraft } = useActiveDocumentActions();
@@ -815,7 +751,7 @@ var StyledPopoverMenu = styled2(PopoverMenu)`
815
751
  display: none;
816
752
  }
817
753
 
818
- & > *:not(.MuiDivider-root):not(:last-of-type) + .MuiDivider-root {
754
+ & > *:not( .MuiDivider-root ):not( :last-of-type ) + .MuiDivider-root {
819
755
  display: block;
820
756
  }
821
757
  }
@@ -862,7 +798,10 @@ import {
862
798
  Tooltip as Tooltip4,
863
799
  usePopupState as usePopupState5
864
800
  } from "@elementor/ui";
865
- import { __useActiveDocument as useActiveDocument6, __useActiveDocumentActions as useActiveDocumentActions3 } from "@elementor/editor-documents";
801
+ import {
802
+ __useActiveDocument as useActiveDocument6,
803
+ __useActiveDocumentActions as useActiveDocumentActions3
804
+ } from "@elementor/editor-documents";
866
805
  import { ChevronDownIcon } from "@elementor/icons";
867
806
  import { __privateUseIsPreviewMode as useIsPreviewMode } from "@elementor/editor-v1-adapters";
868
807
  function PrimaryAction() {
@@ -886,15 +825,12 @@ function PrimaryAction() {
886
825
  const extendedWindow = window;
887
826
  const config = extendedWindow?.elementor?.editorEvents?.config;
888
827
  if (config) {
889
- extendedWindow.elementor.editorEvents.dispatchEvent(
890
- config.names.topBar.publishButton,
891
- {
892
- location: config.locations.topBar,
893
- secondaryLocation: config.secondaryLocations["publish-button"],
894
- trigger: config.triggers.click,
895
- element: config.elements.mainCta
896
- }
897
- );
828
+ extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.publishButton, {
829
+ location: config.locations.topBar,
830
+ secondaryLocation: config.secondaryLocations["publish-button"],
831
+ trigger: config.triggers.click,
832
+ element: config.elements.mainCta
833
+ });
898
834
  }
899
835
  if (!document2.isSaving) {
900
836
  save();
@@ -950,7 +886,10 @@ function isPublishEnabled(document2) {
950
886
  // src/extensions/documents-save/hooks/use-document-copy-and-share-props.ts
951
887
  import { __ as __10 } from "@wordpress/i18n";
952
888
  import { LinkIcon } from "@elementor/icons";
953
- import { __useActiveDocument as useActiveDocument7, __useActiveDocumentActions as useActiveDocumentActions4 } from "@elementor/editor-documents";
889
+ import {
890
+ __useActiveDocument as useActiveDocument7,
891
+ __useActiveDocumentActions as useActiveDocumentActions4
892
+ } from "@elementor/editor-documents";
954
893
  function useDocumentCopyAndShareProps() {
955
894
  const document2 = useActiveDocument7();
956
895
  const { copyAndShare } = useActiveDocumentActions4();
@@ -995,26 +934,25 @@ function init3() {
995
934
 
996
935
  // src/extensions/elements/sync/sync-panel-title.ts
997
936
  import { __ as __11 } from "@wordpress/i18n";
998
- import { __privateIsRouteActive as isRouteActive, __privateListenTo as listenTo2, routeOpenEvent as routeOpenEvent2, v1ReadyEvent } from "@elementor/editor-v1-adapters";
937
+ import {
938
+ __privateIsRouteActive as isRouteActive,
939
+ __privateListenTo as listenTo2,
940
+ routeOpenEvent as routeOpenEvent2,
941
+ v1ReadyEvent
942
+ } from "@elementor/editor-v1-adapters";
999
943
  function syncPanelTitle() {
1000
944
  const panelTitle = __11("Elements", "elementor");
1001
945
  const tabTitle = __11("Widgets", "elementor");
1002
- listenTo2(
1003
- routeOpenEvent2("panel/elements"),
1004
- () => {
946
+ listenTo2(routeOpenEvent2("panel/elements"), () => {
947
+ setPanelTitle(panelTitle);
948
+ setTabTitle(tabTitle);
949
+ });
950
+ listenTo2(v1ReadyEvent(), () => {
951
+ if (isRouteActive("panel/elements")) {
1005
952
  setPanelTitle(panelTitle);
1006
953
  setTabTitle(tabTitle);
1007
954
  }
1008
- );
1009
- listenTo2(
1010
- v1ReadyEvent(),
1011
- () => {
1012
- if (isRouteActive("panel/elements")) {
1013
- setPanelTitle(panelTitle);
1014
- setTabTitle(tabTitle);
1015
- }
1016
- }
1017
- );
955
+ });
1018
956
  }
1019
957
  function setPanelTitle(title) {
1020
958
  window.elementor?.getPanelView?.()?.getHeaderView?.()?.setTitle?.(title);
@@ -1029,7 +967,10 @@ function setTabTitle(title) {
1029
967
  // src/extensions/elements/hooks/use-action-props.ts
1030
968
  import { PlusIcon } from "@elementor/icons";
1031
969
  import { __ as __12 } from "@wordpress/i18n";
1032
- import { __privateOpenRoute as openRoute3, __privateUseRouteStatus as useRouteStatus2 } from "@elementor/editor-v1-adapters";
970
+ import {
971
+ __privateOpenRoute as openRoute3,
972
+ __privateUseRouteStatus as useRouteStatus2
973
+ } from "@elementor/editor-v1-adapters";
1033
974
  function useActionProps2() {
1034
975
  const { isActive, isBlocked } = useRouteStatus2("panel/elements");
1035
976
  return {
@@ -1039,15 +980,12 @@ function useActionProps2() {
1039
980
  const extendedWindow = window;
1040
981
  const config = extendedWindow?.elementor?.editorEvents?.config;
1041
982
  if (config) {
1042
- extendedWindow.elementor.editorEvents.dispatchEvent(
1043
- config.names.topBar.widgetPanel,
1044
- {
1045
- location: config.locations.topBar,
1046
- secondaryLocation: config.secondaryLocations["widget-panel"],
1047
- trigger: config.triggers.toggleClick,
1048
- element: config.elements.buttonIcon
1049
- }
1050
- );
983
+ extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.widgetPanel, {
984
+ location: config.locations.topBar,
985
+ secondaryLocation: config.secondaryLocations["widget-panel"],
986
+ trigger: config.triggers.toggleClick,
987
+ element: config.elements.buttonIcon
988
+ });
1051
989
  }
1052
990
  openRoute3("panel/elements/categories");
1053
991
  },
@@ -1069,7 +1007,10 @@ function init4() {
1069
1007
  // src/extensions/finder/hooks/use-action-props.ts
1070
1008
  import { __ as __13 } from "@wordpress/i18n";
1071
1009
  import { SearchIcon } from "@elementor/icons";
1072
- import { __privateRunCommand as runCommand3, __privateUseRouteStatus as useRouteStatus3 } from "@elementor/editor-v1-adapters";
1010
+ import {
1011
+ __privateRunCommand as runCommand3,
1012
+ __privateUseRouteStatus as useRouteStatus3
1013
+ } from "@elementor/editor-v1-adapters";
1073
1014
  function useActionProps3() {
1074
1015
  const { isBlocked } = useRouteStatus3("finder", {
1075
1016
  blockOnKitRoutes: false,
@@ -1082,15 +1023,12 @@ function useActionProps3() {
1082
1023
  const extendedWindow = window;
1083
1024
  const config = extendedWindow?.elementor?.editorEvents?.config;
1084
1025
  if (config) {
1085
- extendedWindow.elementor.editorEvents.dispatchEvent(
1086
- config.names.topBar.finder,
1087
- {
1088
- location: config.locations.topBar,
1089
- secondaryLocation: config.secondaryLocations.finder,
1090
- trigger: config.triggers.toggleClick,
1091
- element: config.elements.buttonIcon
1092
- }
1093
- );
1026
+ extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.finder, {
1027
+ location: config.locations.topBar,
1028
+ secondaryLocation: config.secondaryLocations.finder,
1029
+ trigger: config.triggers.toggleClick,
1030
+ element: config.elements.buttonIcon
1031
+ });
1094
1032
  }
1095
1033
  runCommand3("finder/toggle");
1096
1034
  },
@@ -1126,15 +1064,12 @@ function init6() {
1126
1064
  const extendedWindow = window;
1127
1065
  const config = extendedWindow?.elementor?.editorEvents?.config;
1128
1066
  if (config) {
1129
- extendedWindow.elementor.editorEvents.dispatchEvent(
1130
- config.names.topBar.help,
1131
- {
1132
- location: config.locations.topBar,
1133
- secondaryLocation: config.secondaryLocations.help,
1134
- trigger: config.triggers.click,
1135
- element: config.elements.buttonIcon
1136
- }
1137
- );
1067
+ extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.help, {
1068
+ location: config.locations.topBar,
1069
+ secondaryLocation: config.secondaryLocations.help,
1070
+ trigger: config.triggers.click,
1071
+ element: config.elements.buttonIcon
1072
+ });
1138
1073
  }
1139
1074
  }
1140
1075
  };
@@ -1145,7 +1080,10 @@ function init6() {
1145
1080
  // src/extensions/history/hooks/use-action-props.ts
1146
1081
  import { HistoryIcon } from "@elementor/icons";
1147
1082
  import { __ as __15 } from "@wordpress/i18n";
1148
- import { __privateOpenRoute as openRoute4, __privateUseRouteStatus as useRouteStatus4 } from "@elementor/editor-v1-adapters";
1083
+ import {
1084
+ __privateOpenRoute as openRoute4,
1085
+ __privateUseRouteStatus as useRouteStatus4
1086
+ } from "@elementor/editor-v1-adapters";
1149
1087
  function useActionProps4() {
1150
1088
  const { isActive, isBlocked } = useRouteStatus4("panel/history");
1151
1089
  return {
@@ -1155,15 +1093,12 @@ function useActionProps4() {
1155
1093
  const extendedWindow = window;
1156
1094
  const config = extendedWindow?.elementor?.editorEvents?.config;
1157
1095
  if (config) {
1158
- extendedWindow.elementor.editorEvents.dispatchEvent(
1159
- config.names.topBar.history,
1160
- {
1161
- location: config.locations.topBar,
1162
- secondaryLocation: config.secondaryLocations.elementorLogo,
1163
- trigger: config.triggers.click,
1164
- element: config.elements.link
1165
- }
1166
- );
1096
+ extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.history, {
1097
+ location: config.locations.topBar,
1098
+ secondaryLocation: config.secondaryLocations.elementorLogo,
1099
+ trigger: config.triggers.click,
1100
+ element: config.elements.link
1101
+ });
1167
1102
  }
1168
1103
  openRoute4("panel/history/actions");
1169
1104
  },
@@ -1193,15 +1128,12 @@ function useActionProps5() {
1193
1128
  const extendedWindow = window;
1194
1129
  const config = extendedWindow?.elementor?.editorEvents?.config;
1195
1130
  if (config) {
1196
- extendedWindow.elementor.editorEvents.dispatchEvent(
1197
- config.names.topBar.keyboardShortcuts,
1198
- {
1199
- location: config.locations.topBar,
1200
- secondaryLocation: config.secondaryLocations.elementorLogo,
1201
- trigger: config.triggers.click,
1202
- element: config.elements.link
1203
- }
1204
- );
1131
+ extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.keyboardShortcuts, {
1132
+ location: config.locations.topBar,
1133
+ secondaryLocation: config.secondaryLocations.elementorLogo,
1134
+ trigger: config.triggers.click,
1135
+ element: config.elements.link
1136
+ });
1205
1137
  }
1206
1138
  runCommand4("shortcuts/open");
1207
1139
  }
@@ -1228,13 +1160,15 @@ import * as React28 from "react";
1228
1160
  // src/extensions/site-settings/components/portal.tsx
1229
1161
  import * as React26 from "react";
1230
1162
  import { Portal as BasePortal } from "@elementor/ui";
1231
- import { __privateIsRouteActive as isRouteActive2, routeCloseEvent, routeOpenEvent as routeOpenEvent3, __privateUseListenTo as useListenTo } from "@elementor/editor-v1-adapters";
1163
+ import {
1164
+ __privateIsRouteActive as isRouteActive2,
1165
+ routeCloseEvent,
1166
+ routeOpenEvent as routeOpenEvent3,
1167
+ __privateUseListenTo as useListenTo
1168
+ } from "@elementor/editor-v1-adapters";
1232
1169
  function Portal(props) {
1233
1170
  const containerRef = useListenTo(
1234
- [
1235
- routeOpenEvent3("panel/global"),
1236
- routeCloseEvent("panel/global")
1237
- ],
1171
+ [routeOpenEvent3("panel/global"), routeCloseEvent("panel/global")],
1238
1172
  getContainerRef
1239
1173
  );
1240
1174
  if (!containerRef.current) {
@@ -1248,28 +1182,37 @@ function getContainerRef() {
1248
1182
 
1249
1183
  // src/extensions/site-settings/components/primary-action.tsx
1250
1184
  import * as React27 from "react";
1251
- import { __useActiveDocument as useActiveDocument8, __useActiveDocumentActions as useActiveDocumentActions5 } from "@elementor/editor-documents";
1185
+ import {
1186
+ __useActiveDocument as useActiveDocument8,
1187
+ __useActiveDocumentActions as useActiveDocumentActions5
1188
+ } from "@elementor/editor-documents";
1252
1189
  import { Button as Button2, CircularProgress as CircularProgress2, Paper } from "@elementor/ui";
1253
1190
  import { __ as __17 } from "@wordpress/i18n";
1254
1191
  function PrimaryAction2() {
1255
1192
  const document2 = useActiveDocument8();
1256
1193
  const { save } = useActiveDocumentActions5();
1257
- return /* @__PURE__ */ React27.createElement(Paper, { sx: {
1258
- px: 5,
1259
- py: 4,
1260
- borderTop: 1,
1261
- borderColor: "divider"
1262
- } }, /* @__PURE__ */ React27.createElement(
1263
- Button2,
1194
+ return /* @__PURE__ */ React27.createElement(
1195
+ Paper,
1264
1196
  {
1265
- variant: "contained",
1266
- disabled: !document2 || !document2.isDirty,
1267
- size: "medium",
1268
- sx: { width: "100%" },
1269
- onClick: () => document2 && !document2.isSaving ? save() : null
1197
+ sx: {
1198
+ px: 5,
1199
+ py: 4,
1200
+ borderTop: 1,
1201
+ borderColor: "divider"
1202
+ }
1270
1203
  },
1271
- document2?.isSaving ? /* @__PURE__ */ React27.createElement(CircularProgress2, null) : __17("Save Changes", "elementor")
1272
- ));
1204
+ /* @__PURE__ */ React27.createElement(
1205
+ Button2,
1206
+ {
1207
+ variant: "contained",
1208
+ disabled: !document2 || !document2.isDirty,
1209
+ size: "medium",
1210
+ sx: { width: "100%" },
1211
+ onClick: () => document2 && !document2.isSaving ? save() : null
1212
+ },
1213
+ document2?.isSaving ? /* @__PURE__ */ React27.createElement(CircularProgress2, null) : __17("Save Changes", "elementor")
1214
+ )
1215
+ );
1273
1216
  }
1274
1217
 
1275
1218
  // src/extensions/site-settings/components/portalled-primary-action.tsx
@@ -1279,7 +1222,10 @@ function PortalledPrimaryAction() {
1279
1222
 
1280
1223
  // src/extensions/site-settings/hooks/use-action-props.ts
1281
1224
  import { __ as __18 } from "@wordpress/i18n";
1282
- import { __privateRunCommand as runCommand5, __privateUseRouteStatus as useRouteStatus5 } from "@elementor/editor-v1-adapters";
1225
+ import {
1226
+ __privateRunCommand as runCommand5,
1227
+ __privateUseRouteStatus as useRouteStatus5
1228
+ } from "@elementor/editor-v1-adapters";
1283
1229
  import { AdjustmentsHorizontalIcon } from "@elementor/icons";
1284
1230
  function useActionProps6() {
1285
1231
  const { isActive, isBlocked } = useRouteStatus5("panel/global", {
@@ -1292,15 +1238,12 @@ function useActionProps6() {
1292
1238
  const extendedWindow = window;
1293
1239
  const config = extendedWindow?.elementor?.editorEvents?.config;
1294
1240
  if (config) {
1295
- extendedWindow.elementor.editorEvents.dispatchEvent(
1296
- config.names.topBar.siteSettings,
1297
- {
1298
- location: config.locations.topBar,
1299
- secondaryLocation: config.secondaryLocations.siteSettings,
1300
- trigger: config.triggers.toggleClick,
1301
- element: config.elements.buttonIcon
1302
- }
1303
- );
1241
+ extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.siteSettings, {
1242
+ location: config.locations.topBar,
1243
+ secondaryLocation: config.secondaryLocations.siteSettings,
1244
+ trigger: config.triggers.toggleClick,
1245
+ element: config.elements.buttonIcon
1246
+ });
1304
1247
  }
1305
1248
  if (isActive) {
1306
1249
  runCommand5("panel/global/close");
@@ -1328,7 +1271,10 @@ function init9() {
1328
1271
 
1329
1272
  // src/extensions/structure/hooks/use-action-props.ts
1330
1273
  import { __ as __19 } from "@wordpress/i18n";
1331
- import { __privateRunCommand as runCommand6, __privateUseRouteStatus as useRouteStatus6 } from "@elementor/editor-v1-adapters";
1274
+ import {
1275
+ __privateRunCommand as runCommand6,
1276
+ __privateUseRouteStatus as useRouteStatus6
1277
+ } from "@elementor/editor-v1-adapters";
1332
1278
  import { StructureIcon } from "@elementor/icons";
1333
1279
  function useActionProps7() {
1334
1280
  const { isActive, isBlocked } = useRouteStatus6("navigator");
@@ -1339,15 +1285,12 @@ function useActionProps7() {
1339
1285
  const extendedWindow = window;
1340
1286
  const config = extendedWindow?.elementor?.editorEvents?.config;
1341
1287
  if (config) {
1342
- extendedWindow.elementor.editorEvents.dispatchEvent(
1343
- config.names.topBar.structure,
1344
- {
1345
- location: config.locations.topBar,
1346
- secondaryLocation: config.secondaryLocations.structure,
1347
- trigger: config.triggers.toggleClick,
1348
- element: config.elements.buttonIcon
1349
- }
1350
- );
1288
+ extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.structure, {
1289
+ location: config.locations.topBar,
1290
+ secondaryLocation: config.secondaryLocations.structure,
1291
+ trigger: config.triggers.toggleClick,
1292
+ element: config.elements.buttonIcon
1293
+ });
1351
1294
  }
1352
1295
  runCommand6("navigator/toggle");
1353
1296
  },
@@ -1377,15 +1320,12 @@ function useActionProps8() {
1377
1320
  const extendedWindow = window;
1378
1321
  const config = extendedWindow?.elementor?.editorEvents?.config;
1379
1322
  if (config) {
1380
- extendedWindow.elementor.editorEvents.dispatchEvent(
1381
- config.names.topBar.themeBuilder,
1382
- {
1383
- location: config.locations.topBar,
1384
- secondaryLocation: config.secondaryLocations.elementorLogo,
1385
- trigger: config.triggers.click,
1386
- element: config.elements.link
1387
- }
1388
- );
1323
+ extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.themeBuilder, {
1324
+ location: config.locations.topBar,
1325
+ secondaryLocation: config.secondaryLocations.elementorLogo,
1326
+ trigger: config.triggers.click,
1327
+ element: config.elements.link
1328
+ });
1389
1329
  }
1390
1330
  runCommand7("app/open");
1391
1331
  }
@@ -1403,7 +1343,10 @@ function init11() {
1403
1343
  // src/extensions/user-preferences/hooks/use-action-props.ts
1404
1344
  import { __ as __21 } from "@wordpress/i18n";
1405
1345
  import { ToggleRightIcon } from "@elementor/icons";
1406
- import { __privateOpenRoute as openRoute5, __privateUseRouteStatus as useRouteStatus7 } from "@elementor/editor-v1-adapters";
1346
+ import {
1347
+ __privateOpenRoute as openRoute5,
1348
+ __privateUseRouteStatus as useRouteStatus7
1349
+ } from "@elementor/editor-v1-adapters";
1407
1350
  function useActionProps9() {
1408
1351
  const { isActive, isBlocked } = useRouteStatus7("panel/editor-preferences");
1409
1352
  return {
@@ -1413,15 +1356,12 @@ function useActionProps9() {
1413
1356
  const extendedWindow = window;
1414
1357
  const config = extendedWindow?.elementor?.editorEvents?.config;
1415
1358
  if (config) {
1416
- extendedWindow.elementor.editorEvents.dispatchEvent(
1417
- config.names.topBar.userPreferences,
1418
- {
1419
- location: config.locations.topBar,
1420
- secondaryLocation: config.secondaryLocations.elementorLogo,
1421
- trigger: config.triggers.click,
1422
- element: config.elements.link
1423
- }
1424
- );
1359
+ extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.userPreferences, {
1360
+ location: config.locations.topBar,
1361
+ secondaryLocation: config.secondaryLocations.elementorLogo,
1362
+ trigger: config.triggers.click,
1363
+ element: config.elements.link
1364
+ });
1425
1365
  }
1426
1366
  openRoute5("panel/editor-preferences");
1427
1367
  },
@@ -1458,15 +1398,12 @@ function init13() {
1458
1398
  const extendedWindow = window;
1459
1399
  const config = extendedWindow?.elementor?.editorEvents?.config;
1460
1400
  if (config) {
1461
- extendedWindow.elementor.editorEvents.dispatchEvent(
1462
- config.names.topBar.exitToWordpress,
1463
- {
1464
- location: config.locations.topBar,
1465
- secondaryLocation: config.secondaryLocations.elementorLogo,
1466
- trigger: config.triggers.click,
1467
- element: config.elements.link
1468
- }
1469
- );
1401
+ extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.exitToWordpress, {
1402
+ location: config.locations.topBar,
1403
+ secondaryLocation: config.secondaryLocations.elementorLogo,
1404
+ trigger: config.triggers.click,
1405
+ element: config.elements.link
1406
+ });
1470
1407
  }
1471
1408
  }
1472
1409
  };