@elementor/editor-app-bar 0.14.4 → 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.
- package/CHANGELOG.md +27 -233
- package/dist/index.js +156 -260
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +223 -286
- package/dist/index.mjs.map +1 -1
- package/package.json +46 -46
- package/src/components/__tests__/app-bar.test.tsx +6 -2
- package/src/components/actions/action.tsx +1 -5
- package/src/components/actions/actions-group.tsx +7 -7
- package/src/components/actions/link.tsx +2 -6
- package/src/components/actions/toggle-action.tsx +1 -5
- package/src/components/app-bar.tsx +1 -2
- package/src/components/locations/__tests__/menus.test.tsx +1 -6
- package/src/components/locations/integrations-menu-location.tsx +4 -8
- package/src/components/locations/main-menu-location.tsx +14 -21
- package/src/components/locations/page-indication-location.tsx +1 -3
- package/src/components/locations/primary-action-location.tsx +1 -3
- package/src/components/locations/responsive-location.tsx +1 -3
- package/src/components/locations/tools-menu-location.tsx +6 -2
- package/src/components/locations/utilities-menu-location.tsx +9 -9
- package/src/components/ui/popover-menu-item.tsx +12 -9
- package/src/components/ui/popover-menu.tsx +1 -1
- package/src/components/ui/popover-sub-menu.tsx +1 -4
- package/src/components/ui/toolbar-logo.tsx +2 -2
- package/src/components/ui/toolbar-menu-item.tsx +12 -10
- package/src/components/ui/toolbar-menu-more.tsx +2 -2
- package/src/components/ui/toolbar-menu-toggle-item.tsx +2 -2
- package/src/contexts/menu-context.tsx +4 -8
- package/src/extensions/documents-indicator/components/__tests__/settings-button.test.tsx +9 -4
- package/src/extensions/documents-indicator/components/settings-button.tsx +27 -25
- package/src/extensions/documents-preview/hooks/use-action-props.ts +6 -9
- package/src/extensions/documents-save/components/__tests__/primary-action.test.tsx +4 -1
- package/src/extensions/documents-save/components/primary-action-menu.tsx +7 -7
- package/src/extensions/documents-save/components/primary-action.tsx +12 -13
- package/src/extensions/documents-save/hooks/__tests__/use-document-save-draft-props.test.ts +4 -1
- package/src/extensions/documents-save/hooks/use-document-copy-and-share-props.ts +6 -5
- package/src/extensions/documents-save/hooks/use-document-save-draft-props.ts +4 -1
- package/src/extensions/documents-save/hooks/use-document-view-page-props.ts +5 -3
- package/src/extensions/elements/hooks/__tests__/use-action-props.test.ts +4 -1
- package/src/extensions/elements/hooks/use-action-props.ts +10 -10
- package/src/extensions/elements/sync/__tests__/sync-panel-title.test.ts +18 -14
- package/src/extensions/elements/sync/sync-panel-title.ts +18 -19
- package/src/extensions/finder/hooks/__tests__/use-action-props.test.ts +4 -1
- package/src/extensions/finder/hooks/use-action-props.ts +10 -10
- package/src/extensions/help/index.ts +6 -9
- package/src/extensions/history/hooks/__tests__/use-action-props.test.ts +4 -1
- package/src/extensions/history/hooks/use-action-props.ts +10 -10
- package/src/extensions/keyboard-shortcuts/hooks/use-action-props.ts +6 -9
- package/src/extensions/site-settings/components/__tests__/portalled-primary-action.test.tsx +9 -4
- package/src/extensions/site-settings/components/__tests__/primary-action.test.tsx +11 -6
- package/src/extensions/site-settings/components/portal.tsx +9 -9
- package/src/extensions/site-settings/components/primary-action.tsx +14 -13
- package/src/extensions/site-settings/hooks/__tests__/use-action-props.test.ts +4 -1
- package/src/extensions/site-settings/hooks/use-action-props.ts +10 -10
- package/src/extensions/structure/hooks/__tests__/use-action-props.test.ts +4 -1
- package/src/extensions/structure/hooks/use-action-props.ts +10 -10
- package/src/extensions/theme-builder/hooks/use-action-props.ts +6 -9
- package/src/extensions/user-preferences/hooks/__tests__/use-action-props.test.ts +4 -1
- package/src/extensions/user-preferences/hooks/use-action-props.ts +10 -10
- package/src/extensions/wordpress/index.ts +6 -9
- package/src/index.ts +1 -5
- package/src/locations/__tests__/menus.test.tsx +5 -6
- package/src/locations/index.ts +5 -14
- package/src/locations/menus.tsx +60 -75
- package/src/sync/__tests__/redirect-old-menus.test.ts +14 -10
- package/src/sync/redirect-old-menus.ts +5 -1
- package/src/types.ts +11 -11
package/dist/index.js
CHANGED
|
@@ -107,7 +107,16 @@ var import_ui2 = require("@elementor/ui");
|
|
|
107
107
|
var import_icons = require("@elementor/icons");
|
|
108
108
|
var DirectionalArrowIcon = (0, import_ui2.withDirection)(import_icons.ArrowUpRightIcon);
|
|
109
109
|
var DirectionalChevronIcon = (0, import_ui2.withDirection)(import_icons.ChevronRightIcon);
|
|
110
|
-
function PopoverMenuItem({
|
|
110
|
+
function PopoverMenuItem({
|
|
111
|
+
text,
|
|
112
|
+
icon,
|
|
113
|
+
onClick,
|
|
114
|
+
href,
|
|
115
|
+
target,
|
|
116
|
+
disabled,
|
|
117
|
+
isGroupParent,
|
|
118
|
+
...props
|
|
119
|
+
}) {
|
|
111
120
|
const isExternalLink = href && target === "_blank";
|
|
112
121
|
return /* @__PURE__ */ React3.createElement(
|
|
113
122
|
import_ui2.MenuItem,
|
|
@@ -138,14 +147,7 @@ function Action({ icon: Icon, title, visible = true, ...props }) {
|
|
|
138
147
|
if (!visible) {
|
|
139
148
|
return null;
|
|
140
149
|
}
|
|
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
|
-
);
|
|
150
|
+
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) });
|
|
149
151
|
}
|
|
150
152
|
|
|
151
153
|
// src/components/actions/toggle-action.tsx
|
|
@@ -185,14 +187,7 @@ function ToggleAction({ icon: Icon, title, value, visible = true, ...props }) {
|
|
|
185
187
|
if (!visible) {
|
|
186
188
|
return null;
|
|
187
189
|
}
|
|
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
|
-
);
|
|
190
|
+
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) });
|
|
196
191
|
}
|
|
197
192
|
|
|
198
193
|
// src/components/actions/link.tsx
|
|
@@ -202,14 +197,7 @@ function Link({ icon: Icon, title, visible = true, ...props }) {
|
|
|
202
197
|
if (!visible) {
|
|
203
198
|
return null;
|
|
204
199
|
}
|
|
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
|
-
);
|
|
200
|
+
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) });
|
|
213
201
|
}
|
|
214
202
|
|
|
215
203
|
// src/components/actions/actions-group.tsx
|
|
@@ -299,23 +287,12 @@ function ActionsGroup({ icon: Icon, title, visible = true, items, ...props }) {
|
|
|
299
287
|
icon: /* @__PURE__ */ React10.createElement(Icon, null),
|
|
300
288
|
isGroupParent: true
|
|
301
289
|
}
|
|
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
|
-
));
|
|
290
|
+
), /* @__PURE__ */ React10.createElement(PopoverSubMenu, { ...props, ...(0, import_ui6.bindPopover)(popupState), popupState }, items.map(({ MenuItem: MenuItem2, id: key }) => /* @__PURE__ */ React10.createElement(MenuItem2, { key }))));
|
|
311
291
|
}
|
|
312
292
|
|
|
313
293
|
// src/locations/menus.tsx
|
|
314
294
|
function createMenu(groups = []) {
|
|
315
|
-
const menuGroups = [
|
|
316
|
-
...groups,
|
|
317
|
-
"default"
|
|
318
|
-
];
|
|
295
|
+
const menuGroups = [...groups, "default"];
|
|
319
296
|
const locations = menuGroups.reduce(
|
|
320
297
|
(carry, group) => ({
|
|
321
298
|
...carry,
|
|
@@ -323,11 +300,7 @@ function createMenu(groups = []) {
|
|
|
323
300
|
}),
|
|
324
301
|
{}
|
|
325
302
|
);
|
|
326
|
-
const [
|
|
327
|
-
registerAction,
|
|
328
|
-
registerToggleAction,
|
|
329
|
-
registerLink
|
|
330
|
-
] = [Action, ToggleAction, Link].map(
|
|
303
|
+
const [registerAction, registerToggleAction, registerLink] = [Action, ToggleAction, Link].map(
|
|
331
304
|
(Component) => createRegisterMenuItem({
|
|
332
305
|
locations,
|
|
333
306
|
menuGroups,
|
|
@@ -347,7 +320,12 @@ function createMenu(groups = []) {
|
|
|
347
320
|
useMenuItems: useMenuItems6
|
|
348
321
|
};
|
|
349
322
|
}
|
|
350
|
-
function createRegisterMenuItem({
|
|
323
|
+
function createRegisterMenuItem({
|
|
324
|
+
locations,
|
|
325
|
+
menuGroups,
|
|
326
|
+
component,
|
|
327
|
+
useMenuItems: useMenuItems6
|
|
328
|
+
}) {
|
|
351
329
|
return ({ group = "default", id, overwrite, priority, ...args }) => {
|
|
352
330
|
if (!menuGroups.includes(group)) {
|
|
353
331
|
return;
|
|
@@ -358,14 +336,7 @@ function createRegisterMenuItem({ locations, menuGroups, component, useMenuItems
|
|
|
358
336
|
const componentProps = useProps();
|
|
359
337
|
const items = useMenuItems6?.();
|
|
360
338
|
if (items?.length) {
|
|
361
|
-
return /* @__PURE__ */ React11.createElement(
|
|
362
|
-
Component,
|
|
363
|
-
{
|
|
364
|
-
...props,
|
|
365
|
-
...componentProps,
|
|
366
|
-
items
|
|
367
|
-
}
|
|
368
|
-
);
|
|
339
|
+
return /* @__PURE__ */ React11.createElement(Component, { ...props, ...componentProps, items });
|
|
369
340
|
}
|
|
370
341
|
return /* @__PURE__ */ React11.createElement(Component, { ...props, ...componentProps });
|
|
371
342
|
};
|
|
@@ -379,7 +350,10 @@ function createRegisterMenuItem({ locations, menuGroups, component, useMenuItems
|
|
|
379
350
|
});
|
|
380
351
|
};
|
|
381
352
|
}
|
|
382
|
-
function createRegisterSubMenu({
|
|
353
|
+
function createRegisterSubMenu({
|
|
354
|
+
locations,
|
|
355
|
+
menuGroups
|
|
356
|
+
}) {
|
|
383
357
|
return (args) => {
|
|
384
358
|
const menu = createMenu();
|
|
385
359
|
createRegisterMenuItem({
|
|
@@ -394,37 +368,25 @@ function createRegisterSubMenu({ locations, menuGroups }) {
|
|
|
394
368
|
function createUseMenuItems(locations) {
|
|
395
369
|
return () => {
|
|
396
370
|
return (0, import_react3.useMemo)(() => {
|
|
397
|
-
return Object.entries(locations).reduce(
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
},
|
|
408
|
-
{}
|
|
409
|
-
);
|
|
371
|
+
return Object.entries(locations).reduce((carry, [groupName, location]) => {
|
|
372
|
+
const items = location.getInjections().map((injection) => ({
|
|
373
|
+
id: injection.id,
|
|
374
|
+
MenuItem: injection.component
|
|
375
|
+
}));
|
|
376
|
+
return {
|
|
377
|
+
...carry,
|
|
378
|
+
[groupName]: items
|
|
379
|
+
};
|
|
380
|
+
}, {});
|
|
410
381
|
}, []);
|
|
411
382
|
};
|
|
412
383
|
}
|
|
413
384
|
|
|
414
385
|
// src/locations/index.ts
|
|
415
386
|
var import_locations2 = require("@elementor/locations");
|
|
416
|
-
var {
|
|
417
|
-
|
|
418
|
-
|
|
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)();
|
|
387
|
+
var { inject: injectIntoPageIndication, Slot: PageIndicationSlot } = (0, import_locations2.createLocation)();
|
|
388
|
+
var { inject: injectIntoResponsive, Slot: ResponsiveSlot } = (0, import_locations2.createLocation)();
|
|
389
|
+
var { inject: injectIntoPrimaryAction, Slot: PrimaryActionSlot } = (0, import_locations2.createLocation)();
|
|
428
390
|
var mainMenu = createMenu(["exits"]);
|
|
429
391
|
var toolsMenu = createMenu();
|
|
430
392
|
var utilitiesMenu = createMenu();
|
|
@@ -522,36 +484,16 @@ function MainMenuLocation() {
|
|
|
522
484
|
const extendedWindow = window;
|
|
523
485
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
524
486
|
if (config) {
|
|
525
|
-
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
526
|
-
config.
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
element: config.elements.buttonIcon
|
|
532
|
-
}
|
|
533
|
-
);
|
|
487
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.elementorLogoDropdown, {
|
|
488
|
+
location: config.locations.topBar,
|
|
489
|
+
secondaryLocation: config.secondaryLocations.elementorLogo,
|
|
490
|
+
trigger: config.triggers.dropdownClick,
|
|
491
|
+
element: config.elements.buttonIcon
|
|
492
|
+
});
|
|
534
493
|
}
|
|
535
494
|
toolbarLogoProps.onClick(e);
|
|
536
495
|
};
|
|
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
|
-
));
|
|
496
|
+
return /* @__PURE__ */ React13.createElement(import_ui8.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, ...(0, import_ui8.bindMenu)(popupState), marginThreshold: 8 }, menuItems.default.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React13.createElement(MenuItem2, { key: id })), menuItems.exits.length > 0 && /* @__PURE__ */ React13.createElement(import_ui8.Divider, null), menuItems.exits.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React13.createElement(MenuItem2, { key: id }))));
|
|
555
497
|
}
|
|
556
498
|
|
|
557
499
|
// src/components/locations/tools-menu-location.tsx
|
|
@@ -600,9 +542,7 @@ function IntegrationsMenuLocation() {
|
|
|
600
542
|
marginThreshold: 8,
|
|
601
543
|
open: popupState.isOpen
|
|
602
544
|
},
|
|
603
|
-
menuItems.default.map(
|
|
604
|
-
({ MenuItem: IntegrationsMenuItem, id }) => /* @__PURE__ */ React16.createElement(IntegrationsMenuItem, { key: id })
|
|
605
|
-
)
|
|
545
|
+
menuItems.default.map(({ MenuItem: IntegrationsMenuItem, id }) => /* @__PURE__ */ React16.createElement(IntegrationsMenuItem, { key: id }))
|
|
606
546
|
));
|
|
607
547
|
}
|
|
608
548
|
|
|
@@ -626,9 +566,7 @@ function UtilitiesMenuLocation() {
|
|
|
626
566
|
const menuItems = useMenuItems4();
|
|
627
567
|
const toolbarMenuItems = menuItems.default.slice(0, MAX_TOOLBAR_ACTIONS2);
|
|
628
568
|
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 }))));
|
|
569
|
+
return /* @__PURE__ */ React18.createElement(ToolbarMenu, null, toolbarMenuItems.map(({ 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))), 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
570
|
}
|
|
633
571
|
|
|
634
572
|
// src/components/locations/primary-action-location.tsx
|
|
@@ -693,15 +631,12 @@ function SettingsButton() {
|
|
|
693
631
|
const extendedWindow = window;
|
|
694
632
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
695
633
|
if (config) {
|
|
696
|
-
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
697
|
-
config.
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
element: config.elements.buttonIcon
|
|
703
|
-
}
|
|
704
|
-
);
|
|
634
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.documentSettings, {
|
|
635
|
+
location: config.locations.topBar,
|
|
636
|
+
secondaryLocation: config.secondaryLocations["document-settings"],
|
|
637
|
+
trigger: config.triggers.click,
|
|
638
|
+
element: config.elements.buttonIcon
|
|
639
|
+
});
|
|
705
640
|
}
|
|
706
641
|
(0, import_editor_v1_adapters2.__privateOpenRoute)("panel/page-settings/settings");
|
|
707
642
|
},
|
|
@@ -761,15 +696,12 @@ function useActionProps() {
|
|
|
761
696
|
const extendedWindow = window;
|
|
762
697
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
763
698
|
if (config) {
|
|
764
|
-
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
765
|
-
config.
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
element: config.elements.buttonIcon
|
|
771
|
-
}
|
|
772
|
-
);
|
|
699
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.previewPage, {
|
|
700
|
+
location: config.locations.topBar,
|
|
701
|
+
secondaryLocation: config.secondaryLocations["preview-page"],
|
|
702
|
+
trigger: config.triggers.click,
|
|
703
|
+
element: config.elements.buttonIcon
|
|
704
|
+
});
|
|
773
705
|
}
|
|
774
706
|
if (document2) {
|
|
775
707
|
(0, import_editor_v1_adapters3.__privateRunCommand)("editor/documents/preview", {
|
|
@@ -849,7 +781,7 @@ var StyledPopoverMenu = (0, import_ui15.styled)(PopoverMenu)`
|
|
|
849
781
|
display: none;
|
|
850
782
|
}
|
|
851
783
|
|
|
852
|
-
& > *:not(.MuiDivider-root):not(:last-of-type) + .MuiDivider-root {
|
|
784
|
+
& > *:not( .MuiDivider-root ):not( :last-of-type ) + .MuiDivider-root {
|
|
853
785
|
display: block;
|
|
854
786
|
}
|
|
855
787
|
}
|
|
@@ -911,15 +843,12 @@ function PrimaryAction() {
|
|
|
911
843
|
const extendedWindow = window;
|
|
912
844
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
913
845
|
if (config) {
|
|
914
|
-
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
915
|
-
config.
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
element: config.elements.mainCta
|
|
921
|
-
}
|
|
922
|
-
);
|
|
846
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.publishButton, {
|
|
847
|
+
location: config.locations.topBar,
|
|
848
|
+
secondaryLocation: config.secondaryLocations["publish-button"],
|
|
849
|
+
trigger: config.triggers.click,
|
|
850
|
+
element: config.elements.mainCta
|
|
851
|
+
});
|
|
923
852
|
}
|
|
924
853
|
if (!document2.isSaving) {
|
|
925
854
|
save();
|
|
@@ -1024,22 +953,16 @@ var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
|
1024
953
|
function syncPanelTitle() {
|
|
1025
954
|
const panelTitle = (0, import_i18n11.__)("Elements", "elementor");
|
|
1026
955
|
const tabTitle = (0, import_i18n11.__)("Widgets", "elementor");
|
|
1027
|
-
(0, import_editor_v1_adapters6.__privateListenTo)(
|
|
1028
|
-
(
|
|
1029
|
-
()
|
|
956
|
+
(0, import_editor_v1_adapters6.__privateListenTo)((0, import_editor_v1_adapters6.routeOpenEvent)("panel/elements"), () => {
|
|
957
|
+
setPanelTitle(panelTitle);
|
|
958
|
+
setTabTitle(tabTitle);
|
|
959
|
+
});
|
|
960
|
+
(0, import_editor_v1_adapters6.__privateListenTo)((0, import_editor_v1_adapters6.v1ReadyEvent)(), () => {
|
|
961
|
+
if ((0, import_editor_v1_adapters6.__privateIsRouteActive)("panel/elements")) {
|
|
1030
962
|
setPanelTitle(panelTitle);
|
|
1031
963
|
setTabTitle(tabTitle);
|
|
1032
964
|
}
|
|
1033
|
-
);
|
|
1034
|
-
(0, import_editor_v1_adapters6.__privateListenTo)(
|
|
1035
|
-
(0, import_editor_v1_adapters6.v1ReadyEvent)(),
|
|
1036
|
-
() => {
|
|
1037
|
-
if ((0, import_editor_v1_adapters6.__privateIsRouteActive)("panel/elements")) {
|
|
1038
|
-
setPanelTitle(panelTitle);
|
|
1039
|
-
setTabTitle(tabTitle);
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
);
|
|
965
|
+
});
|
|
1043
966
|
}
|
|
1044
967
|
function setPanelTitle(title) {
|
|
1045
968
|
window.elementor?.getPanelView?.()?.getHeaderView?.()?.setTitle?.(title);
|
|
@@ -1064,15 +987,12 @@ function useActionProps2() {
|
|
|
1064
987
|
const extendedWindow = window;
|
|
1065
988
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
1066
989
|
if (config) {
|
|
1067
|
-
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
1068
|
-
config.
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
element: config.elements.buttonIcon
|
|
1074
|
-
}
|
|
1075
|
-
);
|
|
990
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.widgetPanel, {
|
|
991
|
+
location: config.locations.topBar,
|
|
992
|
+
secondaryLocation: config.secondaryLocations["widget-panel"],
|
|
993
|
+
trigger: config.triggers.toggleClick,
|
|
994
|
+
element: config.elements.buttonIcon
|
|
995
|
+
});
|
|
1076
996
|
}
|
|
1077
997
|
(0, import_editor_v1_adapters7.__privateOpenRoute)("panel/elements/categories");
|
|
1078
998
|
},
|
|
@@ -1107,15 +1027,12 @@ function useActionProps3() {
|
|
|
1107
1027
|
const extendedWindow = window;
|
|
1108
1028
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
1109
1029
|
if (config) {
|
|
1110
|
-
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
1111
|
-
config.
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
element: config.elements.buttonIcon
|
|
1117
|
-
}
|
|
1118
|
-
);
|
|
1030
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.finder, {
|
|
1031
|
+
location: config.locations.topBar,
|
|
1032
|
+
secondaryLocation: config.secondaryLocations.finder,
|
|
1033
|
+
trigger: config.triggers.toggleClick,
|
|
1034
|
+
element: config.elements.buttonIcon
|
|
1035
|
+
});
|
|
1119
1036
|
}
|
|
1120
1037
|
(0, import_editor_v1_adapters8.__privateRunCommand)("finder/toggle");
|
|
1121
1038
|
},
|
|
@@ -1151,15 +1068,12 @@ function init6() {
|
|
|
1151
1068
|
const extendedWindow = window;
|
|
1152
1069
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
1153
1070
|
if (config) {
|
|
1154
|
-
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
1155
|
-
config.
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
element: config.elements.buttonIcon
|
|
1161
|
-
}
|
|
1162
|
-
);
|
|
1071
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.help, {
|
|
1072
|
+
location: config.locations.topBar,
|
|
1073
|
+
secondaryLocation: config.secondaryLocations.help,
|
|
1074
|
+
trigger: config.triggers.click,
|
|
1075
|
+
element: config.elements.buttonIcon
|
|
1076
|
+
});
|
|
1163
1077
|
}
|
|
1164
1078
|
}
|
|
1165
1079
|
};
|
|
@@ -1180,15 +1094,12 @@ function useActionProps4() {
|
|
|
1180
1094
|
const extendedWindow = window;
|
|
1181
1095
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
1182
1096
|
if (config) {
|
|
1183
|
-
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
1184
|
-
config.
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
element: config.elements.link
|
|
1190
|
-
}
|
|
1191
|
-
);
|
|
1097
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.history, {
|
|
1098
|
+
location: config.locations.topBar,
|
|
1099
|
+
secondaryLocation: config.secondaryLocations.elementorLogo,
|
|
1100
|
+
trigger: config.triggers.click,
|
|
1101
|
+
element: config.elements.link
|
|
1102
|
+
});
|
|
1192
1103
|
}
|
|
1193
1104
|
(0, import_editor_v1_adapters9.__privateOpenRoute)("panel/history/actions");
|
|
1194
1105
|
},
|
|
@@ -1218,15 +1129,12 @@ function useActionProps5() {
|
|
|
1218
1129
|
const extendedWindow = window;
|
|
1219
1130
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
1220
1131
|
if (config) {
|
|
1221
|
-
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
1222
|
-
config.
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
element: config.elements.link
|
|
1228
|
-
}
|
|
1229
|
-
);
|
|
1132
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.keyboardShortcuts, {
|
|
1133
|
+
location: config.locations.topBar,
|
|
1134
|
+
secondaryLocation: config.secondaryLocations.elementorLogo,
|
|
1135
|
+
trigger: config.triggers.click,
|
|
1136
|
+
element: config.elements.link
|
|
1137
|
+
});
|
|
1230
1138
|
}
|
|
1231
1139
|
(0, import_editor_v1_adapters10.__privateRunCommand)("shortcuts/open");
|
|
1232
1140
|
}
|
|
@@ -1256,10 +1164,7 @@ var import_ui17 = require("@elementor/ui");
|
|
|
1256
1164
|
var import_editor_v1_adapters11 = require("@elementor/editor-v1-adapters");
|
|
1257
1165
|
function Portal(props) {
|
|
1258
1166
|
const containerRef = (0, import_editor_v1_adapters11.__privateUseListenTo)(
|
|
1259
|
-
[
|
|
1260
|
-
(0, import_editor_v1_adapters11.routeOpenEvent)("panel/global"),
|
|
1261
|
-
(0, import_editor_v1_adapters11.routeCloseEvent)("panel/global")
|
|
1262
|
-
],
|
|
1167
|
+
[(0, import_editor_v1_adapters11.routeOpenEvent)("panel/global"), (0, import_editor_v1_adapters11.routeCloseEvent)("panel/global")],
|
|
1263
1168
|
getContainerRef
|
|
1264
1169
|
);
|
|
1265
1170
|
if (!containerRef.current) {
|
|
@@ -1279,22 +1184,28 @@ var import_i18n17 = require("@wordpress/i18n");
|
|
|
1279
1184
|
function PrimaryAction2() {
|
|
1280
1185
|
const document2 = (0, import_editor_documents9.__useActiveDocument)();
|
|
1281
1186
|
const { save } = (0, import_editor_documents9.__useActiveDocumentActions)();
|
|
1282
|
-
return /* @__PURE__ */ React27.createElement(
|
|
1283
|
-
|
|
1284
|
-
py: 4,
|
|
1285
|
-
borderTop: 1,
|
|
1286
|
-
borderColor: "divider"
|
|
1287
|
-
} }, /* @__PURE__ */ React27.createElement(
|
|
1288
|
-
import_ui18.Button,
|
|
1187
|
+
return /* @__PURE__ */ React27.createElement(
|
|
1188
|
+
import_ui18.Paper,
|
|
1289
1189
|
{
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1190
|
+
sx: {
|
|
1191
|
+
px: 5,
|
|
1192
|
+
py: 4,
|
|
1193
|
+
borderTop: 1,
|
|
1194
|
+
borderColor: "divider"
|
|
1195
|
+
}
|
|
1295
1196
|
},
|
|
1296
|
-
|
|
1297
|
-
|
|
1197
|
+
/* @__PURE__ */ React27.createElement(
|
|
1198
|
+
import_ui18.Button,
|
|
1199
|
+
{
|
|
1200
|
+
variant: "contained",
|
|
1201
|
+
disabled: !document2 || !document2.isDirty,
|
|
1202
|
+
size: "medium",
|
|
1203
|
+
sx: { width: "100%" },
|
|
1204
|
+
onClick: () => document2 && !document2.isSaving ? save() : null
|
|
1205
|
+
},
|
|
1206
|
+
document2?.isSaving ? /* @__PURE__ */ React27.createElement(import_ui18.CircularProgress, null) : (0, import_i18n17.__)("Save Changes", "elementor")
|
|
1207
|
+
)
|
|
1208
|
+
);
|
|
1298
1209
|
}
|
|
1299
1210
|
|
|
1300
1211
|
// src/extensions/site-settings/components/portalled-primary-action.tsx
|
|
@@ -1317,15 +1228,12 @@ function useActionProps6() {
|
|
|
1317
1228
|
const extendedWindow = window;
|
|
1318
1229
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
1319
1230
|
if (config) {
|
|
1320
|
-
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
1321
|
-
config.
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
element: config.elements.buttonIcon
|
|
1327
|
-
}
|
|
1328
|
-
);
|
|
1231
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.siteSettings, {
|
|
1232
|
+
location: config.locations.topBar,
|
|
1233
|
+
secondaryLocation: config.secondaryLocations.siteSettings,
|
|
1234
|
+
trigger: config.triggers.toggleClick,
|
|
1235
|
+
element: config.elements.buttonIcon
|
|
1236
|
+
});
|
|
1329
1237
|
}
|
|
1330
1238
|
if (isActive) {
|
|
1331
1239
|
(0, import_editor_v1_adapters12.__privateRunCommand)("panel/global/close");
|
|
@@ -1364,15 +1272,12 @@ function useActionProps7() {
|
|
|
1364
1272
|
const extendedWindow = window;
|
|
1365
1273
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
1366
1274
|
if (config) {
|
|
1367
|
-
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
1368
|
-
config.
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
element: config.elements.buttonIcon
|
|
1374
|
-
}
|
|
1375
|
-
);
|
|
1275
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.structure, {
|
|
1276
|
+
location: config.locations.topBar,
|
|
1277
|
+
secondaryLocation: config.secondaryLocations.structure,
|
|
1278
|
+
trigger: config.triggers.toggleClick,
|
|
1279
|
+
element: config.elements.buttonIcon
|
|
1280
|
+
});
|
|
1376
1281
|
}
|
|
1377
1282
|
(0, import_editor_v1_adapters13.__privateRunCommand)("navigator/toggle");
|
|
1378
1283
|
},
|
|
@@ -1402,15 +1307,12 @@ function useActionProps8() {
|
|
|
1402
1307
|
const extendedWindow = window;
|
|
1403
1308
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
1404
1309
|
if (config) {
|
|
1405
|
-
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
1406
|
-
config.
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
element: config.elements.link
|
|
1412
|
-
}
|
|
1413
|
-
);
|
|
1310
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.themeBuilder, {
|
|
1311
|
+
location: config.locations.topBar,
|
|
1312
|
+
secondaryLocation: config.secondaryLocations.elementorLogo,
|
|
1313
|
+
trigger: config.triggers.click,
|
|
1314
|
+
element: config.elements.link
|
|
1315
|
+
});
|
|
1414
1316
|
}
|
|
1415
1317
|
(0, import_editor_v1_adapters14.__privateRunCommand)("app/open");
|
|
1416
1318
|
}
|
|
@@ -1438,15 +1340,12 @@ function useActionProps9() {
|
|
|
1438
1340
|
const extendedWindow = window;
|
|
1439
1341
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
1440
1342
|
if (config) {
|
|
1441
|
-
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
1442
|
-
config.
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
element: config.elements.link
|
|
1448
|
-
}
|
|
1449
|
-
);
|
|
1343
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.userPreferences, {
|
|
1344
|
+
location: config.locations.topBar,
|
|
1345
|
+
secondaryLocation: config.secondaryLocations.elementorLogo,
|
|
1346
|
+
trigger: config.triggers.click,
|
|
1347
|
+
element: config.elements.link
|
|
1348
|
+
});
|
|
1450
1349
|
}
|
|
1451
1350
|
(0, import_editor_v1_adapters15.__privateOpenRoute)("panel/editor-preferences");
|
|
1452
1351
|
},
|
|
@@ -1483,15 +1382,12 @@ function init13() {
|
|
|
1483
1382
|
const extendedWindow = window;
|
|
1484
1383
|
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
1485
1384
|
if (config) {
|
|
1486
|
-
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
1487
|
-
config.
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
element: config.elements.link
|
|
1493
|
-
}
|
|
1494
|
-
);
|
|
1385
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.exitToWordpress, {
|
|
1386
|
+
location: config.locations.topBar,
|
|
1387
|
+
secondaryLocation: config.secondaryLocations.elementorLogo,
|
|
1388
|
+
trigger: config.triggers.click,
|
|
1389
|
+
element: config.elements.link
|
|
1390
|
+
});
|
|
1495
1391
|
}
|
|
1496
1392
|
}
|
|
1497
1393
|
};
|