@elementor/editor-app-bar 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/index.js +162 -74
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +138 -50
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/components/__tests__/top-bar.test.tsx +2 -0
- package/src/components/app-bar.tsx +1 -1
- package/src/components/ui/popover-menu-item.tsx +5 -0
- package/src/components/ui/popover-menu.tsx +1 -1
- package/src/components/ui/toolbar-logo.tsx +10 -6
- package/src/components/ui/toolbar-menu-item.tsx +27 -2
- package/src/components/ui/toolbar-menu-toggle-item.tsx +15 -1
- package/src/components/ui/toolbar-menu.tsx +1 -1
- package/src/extensions/documents-indicator/components/__tests__/settings-button.test.tsx +10 -4
- package/src/extensions/documents-indicator/components/settings-button.tsx +24 -5
- package/src/extensions/documents-preview/hooks/__tests__/use-document-preview-props.test.ts +4 -4
- package/src/extensions/documents-preview/hooks/use-action-props.ts +2 -2
- package/src/extensions/documents-save/components/__tests__/primary-action-menu.test.tsx +1 -3
- package/src/extensions/documents-save/components/__tests__/primary-action.test.tsx +44 -14
- package/src/extensions/documents-save/components/primary-action-menu.tsx +2 -2
- package/src/extensions/documents-save/components/primary-action.tsx +18 -14
- package/src/extensions/documents-save/hooks/__tests__/use-document-save-draft-props.test.ts +6 -6
- package/src/extensions/documents-save/hooks/__tests__/use-document-save-template-props.test.ts +3 -3
- package/src/extensions/documents-save/hooks/use-document-save-draft-props.ts +3 -3
- package/src/extensions/documents-save/hooks/use-document-save-template-props.ts +2 -2
- package/src/extensions/finder/hooks/__tests__/use-action-props.test.ts +0 -1
- package/src/extensions/finder/hooks/use-action-props.ts +1 -2
- package/src/extensions/finder/index.ts +1 -1
- package/src/extensions/site-settings/components/__tests__/portalled-primary-action.test.tsx +10 -6
- package/src/extensions/site-settings/components/__tests__/primary-action.test.tsx +10 -10
- package/src/extensions/site-settings/components/primary-action.tsx +3 -3
- package/src/extensions/wordpress/index.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.8.0](https://github.com/elementor/elementor-packages/compare/@elementor/editor-app-bar@0.7.3...@elementor/editor-app-bar@0.8.0) (2023-09-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* ui adaptations [ED-11933] ([#107](https://github.com/elementor/elementor-packages/issues/107)) ([18ef329](https://github.com/elementor/elementor-packages/commit/18ef32928cbe921d7f5340c37c3c965b117d8d63))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **editor-documents:** mark experimental functions [ED-12066] ([#112](https://github.com/elementor/elementor-packages/issues/112)) ([f4b7a9a](https://github.com/elementor/elementor-packages/commit/f4b7a9ac7953a2b48062349495acff05b5640de3))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [0.7.3](https://github.com/elementor/elementor-packages/compare/@elementor/editor-app-bar@0.7.2...@elementor/editor-app-bar@0.7.3) (2023-08-22)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* **editor-documents:** disable document save on preview mode [ED-11667] ([#105](https://github.com/elementor/elementor-packages/issues/105)) ([e903233](https://github.com/elementor/elementor-packages/commit/e90323367289508e941ef4acc41bc08a3d0fd559))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [0.7.2](https://github.com/elementor/elementor-packages/compare/@elementor/editor-app-bar@0.7.1...@elementor/editor-app-bar@0.7.2) (2023-08-20)
|
|
7
34
|
|
|
8
35
|
|
package/dist/index.js
CHANGED
|
@@ -64,7 +64,37 @@ function useMenuContext() {
|
|
|
64
64
|
var React2 = __toESM(require("react"));
|
|
65
65
|
var import_ui = require("@elementor/ui");
|
|
66
66
|
function ToolbarMenuItem({ title, ...props }) {
|
|
67
|
-
return /* @__PURE__ */ React2.createElement(
|
|
67
|
+
return /* @__PURE__ */ React2.createElement(Tooltip, { title }, /* @__PURE__ */ React2.createElement(import_ui.Box, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React2.createElement(
|
|
68
|
+
import_ui.IconButton,
|
|
69
|
+
{
|
|
70
|
+
...props,
|
|
71
|
+
"aria-label": title,
|
|
72
|
+
size: "medium",
|
|
73
|
+
sx: {
|
|
74
|
+
"& .MuiSvgIcon-root": {
|
|
75
|
+
fontSize: "1.25rem"
|
|
76
|
+
},
|
|
77
|
+
"&:hover": {
|
|
78
|
+
color: "text.primary"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
)));
|
|
83
|
+
}
|
|
84
|
+
function Tooltip(props) {
|
|
85
|
+
return /* @__PURE__ */ React2.createElement(
|
|
86
|
+
import_ui.Tooltip,
|
|
87
|
+
{
|
|
88
|
+
PopperProps: {
|
|
89
|
+
sx: {
|
|
90
|
+
"&.MuiTooltip-popper .MuiTooltip-tooltip.MuiTooltip-tooltipPlacementBottom": {
|
|
91
|
+
mt: 2
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
...props
|
|
96
|
+
}
|
|
97
|
+
);
|
|
68
98
|
}
|
|
69
99
|
|
|
70
100
|
// src/components/ui/popover-menu-item.tsx
|
|
@@ -82,7 +112,13 @@ function PopoverMenuItem({ text, icon, onClick, href, target, disabled, ...props
|
|
|
82
112
|
onClick,
|
|
83
113
|
component: href ? "a" : "div",
|
|
84
114
|
href,
|
|
85
|
-
target
|
|
115
|
+
target,
|
|
116
|
+
sx: {
|
|
117
|
+
"&:hover": {
|
|
118
|
+
color: "text.primary"
|
|
119
|
+
// Overriding global CSS from the editor.
|
|
120
|
+
}
|
|
121
|
+
}
|
|
86
122
|
},
|
|
87
123
|
/* @__PURE__ */ React3.createElement(import_ui2.ListItemIcon, null, icon),
|
|
88
124
|
/* @__PURE__ */ React3.createElement(import_ui2.ListItemText, { primary: text }),
|
|
@@ -113,7 +149,26 @@ var React6 = __toESM(require("react"));
|
|
|
113
149
|
var React5 = __toESM(require("react"));
|
|
114
150
|
var import_ui3 = require("@elementor/ui");
|
|
115
151
|
function ToolbarMenuToggleItem({ title, onClick, ...props }) {
|
|
116
|
-
return /* @__PURE__ */ React5.createElement(import_ui3.Tooltip, { title }, /* @__PURE__ */ React5.createElement(import_ui3.Box, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React5.createElement(
|
|
152
|
+
return /* @__PURE__ */ React5.createElement(import_ui3.Tooltip, { title }, /* @__PURE__ */ React5.createElement(import_ui3.Box, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React5.createElement(
|
|
153
|
+
import_ui3.ToggleButton,
|
|
154
|
+
{
|
|
155
|
+
...props,
|
|
156
|
+
onChange: onClick,
|
|
157
|
+
"aria-label": title,
|
|
158
|
+
size: "small",
|
|
159
|
+
sx: {
|
|
160
|
+
border: 0,
|
|
161
|
+
// Temp fix until the style of the ToggleButton component will be decided.
|
|
162
|
+
"&.Mui-disabled": {
|
|
163
|
+
border: 0
|
|
164
|
+
// Temp fix until the style of the ToggleButton component will be decided.
|
|
165
|
+
},
|
|
166
|
+
"& .MuiSvgIcon-root": {
|
|
167
|
+
fontSize: "1.25rem"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
)));
|
|
117
172
|
}
|
|
118
173
|
|
|
119
174
|
// src/components/actions/toggle-action.tsx
|
|
@@ -258,7 +313,7 @@ function PopoverMenu({ children, ...props }) {
|
|
|
258
313
|
import_ui4.Menu,
|
|
259
314
|
{
|
|
260
315
|
PaperProps: {
|
|
261
|
-
sx: { mt:
|
|
316
|
+
sx: { mt: 1.5 }
|
|
262
317
|
},
|
|
263
318
|
...props,
|
|
264
319
|
MenuListProps: {
|
|
@@ -279,7 +334,9 @@ var ElementorLogo = (props) => {
|
|
|
279
334
|
return /* @__PURE__ */ React10.createElement(import_ui5.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" })));
|
|
280
335
|
};
|
|
281
336
|
var StyledToggleButton = (0, import_ui5.styled)(import_ui5.ToggleButton)(({ theme }) => ({
|
|
282
|
-
|
|
337
|
+
padding: 0,
|
|
338
|
+
border: 0,
|
|
339
|
+
color: theme.palette.text.primary,
|
|
283
340
|
"&.MuiToggleButton-root:hover": {
|
|
284
341
|
backgroundColor: "initial"
|
|
285
342
|
},
|
|
@@ -290,10 +347,8 @@ var StyledToggleButton = (0, import_ui5.styled)(import_ui5.ToggleButton)(({ them
|
|
|
290
347
|
var StyledElementorLogo = (0, import_ui5.styled)(ElementorLogo, {
|
|
291
348
|
shouldForwardProp: (prop) => prop !== "showMenuIcon"
|
|
292
349
|
})(({ theme, showMenuIcon }) => ({
|
|
293
|
-
width: "auto",
|
|
294
|
-
height: "100%",
|
|
295
350
|
"& path": {
|
|
296
|
-
fill:
|
|
351
|
+
fill: theme.palette.background.default,
|
|
297
352
|
transition: "all 0.2s linear",
|
|
298
353
|
transformOrigin: "bottom left",
|
|
299
354
|
"&:first-of-type": {
|
|
@@ -323,11 +378,18 @@ function ToolbarLogo(props) {
|
|
|
323
378
|
{
|
|
324
379
|
...props,
|
|
325
380
|
value: "selected",
|
|
326
|
-
size: "
|
|
381
|
+
size: "large",
|
|
327
382
|
onMouseEnter: () => setIsHoverState(true),
|
|
328
383
|
onMouseLeave: () => setIsHoverState(false)
|
|
329
384
|
},
|
|
330
|
-
/* @__PURE__ */ React10.createElement(
|
|
385
|
+
/* @__PURE__ */ React10.createElement(
|
|
386
|
+
StyledElementorLogo,
|
|
387
|
+
{
|
|
388
|
+
fontSize: "large",
|
|
389
|
+
showMenuIcon,
|
|
390
|
+
titleAccess: (0, import_i18n.__)("Elementor Logo", "elementor")
|
|
391
|
+
}
|
|
392
|
+
)
|
|
331
393
|
);
|
|
332
394
|
}
|
|
333
395
|
|
|
@@ -425,7 +487,7 @@ var React16 = __toESM(require("react"));
|
|
|
425
487
|
var React14 = __toESM(require("react"));
|
|
426
488
|
var import_ui9 = require("@elementor/ui");
|
|
427
489
|
function ToolbarMenu({ children, ...props }) {
|
|
428
|
-
return /* @__PURE__ */ React14.createElement(MenuContextProvider, { type: "toolbar" }, /* @__PURE__ */ React14.createElement(import_ui9.Stack, { sx: { px:
|
|
490
|
+
return /* @__PURE__ */ React14.createElement(MenuContextProvider, { type: "toolbar" }, /* @__PURE__ */ React14.createElement(import_ui9.Stack, { sx: { px: 1.5 }, spacing: 1.5, direction: "row", alignItems: "center", ...props }, children));
|
|
429
491
|
}
|
|
430
492
|
|
|
431
493
|
// src/components/ui/toolbar-menu-more.tsx
|
|
@@ -486,7 +548,7 @@ function ResponsiveLocation() {
|
|
|
486
548
|
|
|
487
549
|
// src/components/app-bar.tsx
|
|
488
550
|
function AppBar() {
|
|
489
|
-
return /* @__PURE__ */ React21.createElement(import_ui12.ThemeProvider, { colorScheme: "dark" }, /* @__PURE__ */ React21.createElement(import_ui12.AppBar, { position: "sticky" }, /* @__PURE__ */ React21.createElement(import_ui12.Box, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)" }, /* @__PURE__ */ React21.createElement(import_ui12.Grid, { container: true }, /* @__PURE__ */ React21.createElement(MainMenuLocation, null), /* @__PURE__ */ React21.createElement(ToolsMenuLocation, null)), /* @__PURE__ */ React21.createElement(import_ui12.Grid, { container: true, justifyContent: "center" }, /* @__PURE__ */ React21.createElement(ToolbarMenu, { spacing:
|
|
551
|
+
return /* @__PURE__ */ React21.createElement(import_ui12.ThemeProvider, { colorScheme: "dark" }, /* @__PURE__ */ React21.createElement(import_ui12.AppBar, { position: "sticky" }, /* @__PURE__ */ React21.createElement(import_ui12.Box, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)" }, /* @__PURE__ */ React21.createElement(import_ui12.Grid, { container: true }, /* @__PURE__ */ React21.createElement(MainMenuLocation, null), /* @__PURE__ */ React21.createElement(ToolsMenuLocation, null)), /* @__PURE__ */ React21.createElement(import_ui12.Grid, { container: true, justifyContent: "center" }, /* @__PURE__ */ React21.createElement(ToolbarMenu, { spacing: 1.5 }, /* @__PURE__ */ React21.createElement(import_ui12.Divider, { orientation: "vertical" }), /* @__PURE__ */ React21.createElement(PageIndicationLocation, null), /* @__PURE__ */ React21.createElement(import_ui12.Divider, { orientation: "vertical" }), /* @__PURE__ */ React21.createElement(ResponsiveLocation, null), /* @__PURE__ */ React21.createElement(import_ui12.Divider, { orientation: "vertical" }))), /* @__PURE__ */ React21.createElement(import_ui12.Grid, { container: true, justifyContent: "flex-end" }, /* @__PURE__ */ React21.createElement(UtilitiesMenuLocation, null), /* @__PURE__ */ React21.createElement(PrimaryActionLocation, null)))));
|
|
490
552
|
}
|
|
491
553
|
|
|
492
554
|
// src/init.ts
|
|
@@ -508,15 +570,15 @@ var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
|
508
570
|
var import_icons4 = require("@elementor/icons");
|
|
509
571
|
var import_editor_documents = require("@elementor/editor-documents");
|
|
510
572
|
function SettingsButton() {
|
|
511
|
-
const activeDocument = (0, import_editor_documents.
|
|
512
|
-
const hostDocument = (0, import_editor_documents.
|
|
573
|
+
const activeDocument = (0, import_editor_documents.__useActiveDocument)();
|
|
574
|
+
const hostDocument = (0, import_editor_documents.__useHostDocument)();
|
|
513
575
|
const document2 = activeDocument && activeDocument.type.value !== "kit" ? activeDocument : hostDocument;
|
|
514
576
|
const { isActive, isBlocked } = (0, import_editor_v1_adapters2.useRouteStatus)("panel/page-settings");
|
|
515
577
|
if (!document2) {
|
|
516
578
|
return null;
|
|
517
579
|
}
|
|
518
580
|
const title = (0, import_i18n4.__)("%s Settings", "elementor").replace("%s", document2.type.label);
|
|
519
|
-
return /* @__PURE__ */ React22.createElement(
|
|
581
|
+
return /* @__PURE__ */ React22.createElement(Tooltip3, { title }, /* @__PURE__ */ React22.createElement(import_ui13.Box, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React22.createElement(
|
|
520
582
|
import_ui13.ToggleButton,
|
|
521
583
|
{
|
|
522
584
|
value: "document-settings",
|
|
@@ -524,11 +586,34 @@ function SettingsButton() {
|
|
|
524
586
|
disabled: isBlocked,
|
|
525
587
|
onChange: () => (0, import_editor_v1_adapters2.openRoute)("panel/page-settings/settings"),
|
|
526
588
|
"aria-label": title,
|
|
527
|
-
size: "small"
|
|
589
|
+
size: "small",
|
|
590
|
+
sx: {
|
|
591
|
+
border: 0,
|
|
592
|
+
// Temp fix until the style of the ToggleButton component will be decided.
|
|
593
|
+
"&.Mui-disabled": {
|
|
594
|
+
border: 0
|
|
595
|
+
// Temp fix until the style of the ToggleButton component will be decided.
|
|
596
|
+
}
|
|
597
|
+
}
|
|
528
598
|
},
|
|
529
|
-
/* @__PURE__ */ React22.createElement(import_icons4.SettingsIcon,
|
|
599
|
+
/* @__PURE__ */ React22.createElement(import_icons4.SettingsIcon, { fontSize: "small" })
|
|
530
600
|
)));
|
|
531
601
|
}
|
|
602
|
+
function Tooltip3(props) {
|
|
603
|
+
return /* @__PURE__ */ React22.createElement(
|
|
604
|
+
import_ui13.Tooltip,
|
|
605
|
+
{
|
|
606
|
+
PopperProps: {
|
|
607
|
+
sx: {
|
|
608
|
+
"&.MuiTooltip-popper .MuiTooltip-tooltip.MuiTooltip-tooltipPlacementBottom": {
|
|
609
|
+
mt: 1.7
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
},
|
|
613
|
+
...props
|
|
614
|
+
}
|
|
615
|
+
);
|
|
616
|
+
}
|
|
532
617
|
|
|
533
618
|
// src/extensions/documents-indicator/index.ts
|
|
534
619
|
function init() {
|
|
@@ -548,7 +633,7 @@ var import_icons5 = require("@elementor/icons");
|
|
|
548
633
|
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
549
634
|
var import_editor_documents2 = require("@elementor/editor-documents");
|
|
550
635
|
function useActionProps() {
|
|
551
|
-
const document2 = (0, import_editor_documents2.
|
|
636
|
+
const document2 = (0, import_editor_documents2.__useActiveDocument)();
|
|
552
637
|
return {
|
|
553
638
|
icon: import_icons5.EyeIcon,
|
|
554
639
|
title: (0, import_i18n5.__)("Preview Changes", "elementor"),
|
|
@@ -574,8 +659,8 @@ var import_i18n6 = require("@wordpress/i18n");
|
|
|
574
659
|
var import_icons6 = require("@elementor/icons");
|
|
575
660
|
var import_editor_documents3 = require("@elementor/editor-documents");
|
|
576
661
|
function useDocumentSaveDraftProps() {
|
|
577
|
-
const document2 = (0, import_editor_documents3.
|
|
578
|
-
const { saveDraft } = (0, import_editor_documents3.
|
|
662
|
+
const document2 = (0, import_editor_documents3.__useActiveDocument)();
|
|
663
|
+
const { saveDraft } = (0, import_editor_documents3.__useActiveDocumentActions)();
|
|
579
664
|
return {
|
|
580
665
|
icon: import_icons6.FileReportIcon,
|
|
581
666
|
title: (0, import_i18n6.__)("Save Draft", "elementor"),
|
|
@@ -589,7 +674,7 @@ var import_i18n7 = require("@wordpress/i18n");
|
|
|
589
674
|
var import_icons7 = require("@elementor/icons");
|
|
590
675
|
var import_editor_documents4 = require("@elementor/editor-documents");
|
|
591
676
|
function useDocumentSaveTemplateProps() {
|
|
592
|
-
const { saveTemplate } = (0, import_editor_documents4.
|
|
677
|
+
const { saveTemplate } = (0, import_editor_documents4.__useActiveDocumentActions)();
|
|
593
678
|
return {
|
|
594
679
|
icon: import_icons7.FolderIcon,
|
|
595
680
|
title: (0, import_i18n7.__)("Save as Template", "elementor"),
|
|
@@ -628,9 +713,9 @@ function PrimaryActionMenu(props) {
|
|
|
628
713
|
vertical: "top",
|
|
629
714
|
horizontal: "right"
|
|
630
715
|
},
|
|
631
|
-
marginThreshold:
|
|
716
|
+
marginThreshold: 4,
|
|
632
717
|
PaperProps: {
|
|
633
|
-
sx: { mt:
|
|
718
|
+
sx: { mt: 0.5 }
|
|
634
719
|
}
|
|
635
720
|
},
|
|
636
721
|
saveActions.map(({ MenuItem: MenuItem3, id }, index) => [
|
|
@@ -646,9 +731,11 @@ function PrimaryActionMenu(props) {
|
|
|
646
731
|
var import_ui15 = require("@elementor/ui");
|
|
647
732
|
var import_editor_documents5 = require("@elementor/editor-documents");
|
|
648
733
|
var import_icons8 = require("@elementor/icons");
|
|
734
|
+
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
649
735
|
function PrimaryAction() {
|
|
650
|
-
const document2 = (0, import_editor_documents5.
|
|
651
|
-
const { save } = (0, import_editor_documents5.
|
|
736
|
+
const document2 = (0, import_editor_documents5.__useActiveDocument)();
|
|
737
|
+
const { save } = (0, import_editor_documents5.__useActiveDocumentActions)();
|
|
738
|
+
const isPreviewMode = (0, import_editor_v1_adapters4.useIsPreviewMode)();
|
|
652
739
|
const popupState = (0, import_ui15.usePopupState)({
|
|
653
740
|
variant: "popover",
|
|
654
741
|
popupId: "document-save-options"
|
|
@@ -656,23 +743,24 @@ function PrimaryAction() {
|
|
|
656
743
|
if (!document2) {
|
|
657
744
|
return null;
|
|
658
745
|
}
|
|
659
|
-
const
|
|
660
|
-
const
|
|
661
|
-
|
|
746
|
+
const isPublishDisabled = isPreviewMode || !isPublishEnabled(document2);
|
|
747
|
+
const isSaveOptionsDisabled = isPreviewMode || document2.type.value === "kit";
|
|
748
|
+
const shouldShowSpinner = document2.isSaving && !isPublishDisabled;
|
|
749
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(import_ui15.ButtonGroup, { size: "large", variant: "contained" }, /* @__PURE__ */ React24.createElement(
|
|
662
750
|
import_ui15.Button,
|
|
663
751
|
{
|
|
664
752
|
onClick: () => !document2.isSaving && save(),
|
|
665
753
|
sx: {
|
|
666
|
-
px: 7,
|
|
667
754
|
height: "100%",
|
|
755
|
+
borderRadius: 0,
|
|
668
756
|
maxWidth: "158px",
|
|
669
757
|
"&.MuiButtonBase-root.MuiButtonGroup-grouped": {
|
|
670
758
|
minWidth: "110px"
|
|
671
759
|
}
|
|
672
760
|
},
|
|
673
|
-
disabled:
|
|
761
|
+
disabled: isPublishDisabled
|
|
674
762
|
},
|
|
675
|
-
shouldShowSpinner ? /* @__PURE__ */ React24.createElement(import_ui15.CircularProgress,
|
|
763
|
+
shouldShowSpinner ? /* @__PURE__ */ React24.createElement(import_ui15.CircularProgress, { color: "inherit", size: "1.5em" }) : getLabel(document2)
|
|
676
764
|
), /* @__PURE__ */ React24.createElement(
|
|
677
765
|
import_ui15.Tooltip,
|
|
678
766
|
{
|
|
@@ -680,8 +768,8 @@ function PrimaryAction() {
|
|
|
680
768
|
PopperProps: {
|
|
681
769
|
sx: {
|
|
682
770
|
"&.MuiTooltip-popper .MuiTooltip-tooltip.MuiTooltip-tooltipPlacementBottom": {
|
|
683
|
-
mt:
|
|
684
|
-
mr:
|
|
771
|
+
mt: 1,
|
|
772
|
+
mr: 0.25
|
|
685
773
|
}
|
|
686
774
|
}
|
|
687
775
|
}
|
|
@@ -689,9 +777,10 @@ function PrimaryAction() {
|
|
|
689
777
|
/* @__PURE__ */ React24.createElement(import_ui15.Box, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React24.createElement(
|
|
690
778
|
import_ui15.Button,
|
|
691
779
|
{
|
|
780
|
+
size: "small",
|
|
692
781
|
...(0, import_ui15.bindTrigger)(popupState),
|
|
693
|
-
sx: { px: 0, height: "100%" },
|
|
694
|
-
disabled:
|
|
782
|
+
sx: { px: 0, height: "100%", borderRadius: 0 },
|
|
783
|
+
disabled: isSaveOptionsDisabled,
|
|
695
784
|
"aria-label": (0, import_i18n8.__)("Save Options", "elementor")
|
|
696
785
|
},
|
|
697
786
|
/* @__PURE__ */ React24.createElement(import_icons8.ChevronDownIcon, null)
|
|
@@ -701,7 +790,7 @@ function PrimaryAction() {
|
|
|
701
790
|
function getLabel(document2) {
|
|
702
791
|
return document2.userCan.publish ? (0, import_i18n8.__)("Publish", "elementor") : (0, import_i18n8.__)("Submit", "elementor");
|
|
703
792
|
}
|
|
704
|
-
function
|
|
793
|
+
function isPublishEnabled(document2) {
|
|
705
794
|
if (document2.type.value === "kit") {
|
|
706
795
|
return false;
|
|
707
796
|
}
|
|
@@ -732,21 +821,21 @@ function init3() {
|
|
|
732
821
|
|
|
733
822
|
// src/extensions/elements/sync/sync-panel-title.ts
|
|
734
823
|
var import_i18n9 = require("@wordpress/i18n");
|
|
735
|
-
var
|
|
824
|
+
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
736
825
|
function syncPanelTitle() {
|
|
737
826
|
const panelTitle = (0, import_i18n9.__)("Elements", "elementor");
|
|
738
827
|
const tabTitle = (0, import_i18n9.__)("Widgets", "elementor");
|
|
739
|
-
(0,
|
|
740
|
-
(0,
|
|
828
|
+
(0, import_editor_v1_adapters5.listenTo)(
|
|
829
|
+
(0, import_editor_v1_adapters5.routeOpenEvent)("panel/elements"),
|
|
741
830
|
() => {
|
|
742
831
|
setPanelTitle(panelTitle);
|
|
743
832
|
setTabTitle(tabTitle);
|
|
744
833
|
}
|
|
745
834
|
);
|
|
746
|
-
(0,
|
|
747
|
-
(0,
|
|
835
|
+
(0, import_editor_v1_adapters5.listenTo)(
|
|
836
|
+
(0, import_editor_v1_adapters5.v1ReadyEvent)(),
|
|
748
837
|
() => {
|
|
749
|
-
if ((0,
|
|
838
|
+
if ((0, import_editor_v1_adapters5.isRouteActive)("panel/elements")) {
|
|
750
839
|
setPanelTitle(panelTitle);
|
|
751
840
|
setTabTitle(tabTitle);
|
|
752
841
|
}
|
|
@@ -766,13 +855,13 @@ function setTabTitle(title) {
|
|
|
766
855
|
// src/extensions/elements/hooks/use-action-props.ts
|
|
767
856
|
var import_icons9 = require("@elementor/icons");
|
|
768
857
|
var import_i18n10 = require("@wordpress/i18n");
|
|
769
|
-
var
|
|
858
|
+
var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
770
859
|
function useActionProps2() {
|
|
771
|
-
const { isActive, isBlocked } = (0,
|
|
860
|
+
const { isActive, isBlocked } = (0, import_editor_v1_adapters6.useRouteStatus)("panel/elements");
|
|
772
861
|
return {
|
|
773
862
|
title: (0, import_i18n10.__)("Add Element", "elementor"),
|
|
774
863
|
icon: import_icons9.PlusIcon,
|
|
775
|
-
onClick: () => (0,
|
|
864
|
+
onClick: () => (0, import_editor_v1_adapters6.openRoute)("panel/elements/categories"),
|
|
776
865
|
selected: isActive,
|
|
777
866
|
disabled: isBlocked
|
|
778
867
|
};
|
|
@@ -791,24 +880,23 @@ function init4() {
|
|
|
791
880
|
// src/extensions/finder/hooks/use-action-props.ts
|
|
792
881
|
var import_i18n11 = require("@wordpress/i18n");
|
|
793
882
|
var import_icons10 = require("@elementor/icons");
|
|
794
|
-
var
|
|
883
|
+
var import_editor_v1_adapters7 = require("@elementor/editor-v1-adapters");
|
|
795
884
|
function useActionProps3() {
|
|
796
|
-
const {
|
|
885
|
+
const { isBlocked } = (0, import_editor_v1_adapters7.useRouteStatus)("finder", {
|
|
797
886
|
blockOnKitRoutes: false,
|
|
798
887
|
blockOnPreviewMode: false
|
|
799
888
|
});
|
|
800
889
|
return {
|
|
801
890
|
title: (0, import_i18n11.__)("Finder", "elementor"),
|
|
802
891
|
icon: import_icons10.SearchIcon,
|
|
803
|
-
onClick: () => (0,
|
|
804
|
-
selected: isActive,
|
|
892
|
+
onClick: () => (0, import_editor_v1_adapters7.runCommand)("finder/toggle"),
|
|
805
893
|
disabled: isBlocked
|
|
806
894
|
};
|
|
807
895
|
}
|
|
808
896
|
|
|
809
897
|
// src/extensions/finder/index.ts
|
|
810
898
|
function init5() {
|
|
811
|
-
utilitiesMenu.
|
|
899
|
+
utilitiesMenu.registerAction({
|
|
812
900
|
id: "toggle-finder",
|
|
813
901
|
priority: 10,
|
|
814
902
|
// Before help.
|
|
@@ -838,13 +926,13 @@ function init6() {
|
|
|
838
926
|
// src/extensions/history/hooks/use-action-props.ts
|
|
839
927
|
var import_icons12 = require("@elementor/icons");
|
|
840
928
|
var import_i18n13 = require("@wordpress/i18n");
|
|
841
|
-
var
|
|
929
|
+
var import_editor_v1_adapters8 = require("@elementor/editor-v1-adapters");
|
|
842
930
|
function useActionProps4() {
|
|
843
|
-
const { isActive, isBlocked } = (0,
|
|
931
|
+
const { isActive, isBlocked } = (0, import_editor_v1_adapters8.useRouteStatus)("panel/history");
|
|
844
932
|
return {
|
|
845
933
|
title: (0, import_i18n13.__)("History", "elementor"),
|
|
846
934
|
icon: import_icons12.HistoryIcon,
|
|
847
|
-
onClick: () => (0,
|
|
935
|
+
onClick: () => (0, import_editor_v1_adapters8.openRoute)("panel/history/actions"),
|
|
848
936
|
selected: isActive,
|
|
849
937
|
disabled: isBlocked
|
|
850
938
|
};
|
|
@@ -862,12 +950,12 @@ function init7() {
|
|
|
862
950
|
// src/extensions/keyboard-shortcuts/hooks/use-action-props.ts
|
|
863
951
|
var import_i18n14 = require("@wordpress/i18n");
|
|
864
952
|
var import_icons13 = require("@elementor/icons");
|
|
865
|
-
var
|
|
953
|
+
var import_editor_v1_adapters9 = require("@elementor/editor-v1-adapters");
|
|
866
954
|
function useActionProps5() {
|
|
867
955
|
return {
|
|
868
956
|
icon: import_icons13.KeyboardIcon,
|
|
869
957
|
title: (0, import_i18n14.__)("Keyboard Shortcuts", "elementor"),
|
|
870
|
-
onClick: () => (0,
|
|
958
|
+
onClick: () => (0, import_editor_v1_adapters9.runCommand)("shortcuts/open")
|
|
871
959
|
};
|
|
872
960
|
}
|
|
873
961
|
|
|
@@ -891,12 +979,12 @@ var React27 = __toESM(require("react"));
|
|
|
891
979
|
// src/extensions/site-settings/components/portal.tsx
|
|
892
980
|
var React25 = __toESM(require("react"));
|
|
893
981
|
var import_ui16 = require("@elementor/ui");
|
|
894
|
-
var
|
|
982
|
+
var import_editor_v1_adapters10 = require("@elementor/editor-v1-adapters");
|
|
895
983
|
function Portal(props) {
|
|
896
|
-
const containerRef = (0,
|
|
984
|
+
const containerRef = (0, import_editor_v1_adapters10.useListenTo)(
|
|
897
985
|
[
|
|
898
|
-
(0,
|
|
899
|
-
(0,
|
|
986
|
+
(0, import_editor_v1_adapters10.routeOpenEvent)("panel/global"),
|
|
987
|
+
(0, import_editor_v1_adapters10.routeCloseEvent)("panel/global")
|
|
900
988
|
],
|
|
901
989
|
getContainerRef
|
|
902
990
|
);
|
|
@@ -906,7 +994,7 @@ function Portal(props) {
|
|
|
906
994
|
return /* @__PURE__ */ React25.createElement(import_ui16.Portal, { container: containerRef.current, ...props });
|
|
907
995
|
}
|
|
908
996
|
function getContainerRef() {
|
|
909
|
-
return (0,
|
|
997
|
+
return (0, import_editor_v1_adapters10.isRouteActive)("panel/global") ? { current: document.querySelector("#elementor-panel-inner") } : { current: null };
|
|
910
998
|
}
|
|
911
999
|
|
|
912
1000
|
// src/extensions/site-settings/components/primary-action.tsx
|
|
@@ -915,8 +1003,8 @@ var import_editor_documents6 = require("@elementor/editor-documents");
|
|
|
915
1003
|
var import_ui17 = require("@elementor/ui");
|
|
916
1004
|
var import_i18n15 = require("@wordpress/i18n");
|
|
917
1005
|
function PrimaryAction2() {
|
|
918
|
-
const document2 = (0, import_editor_documents6.
|
|
919
|
-
const { save } = (0, import_editor_documents6.
|
|
1006
|
+
const document2 = (0, import_editor_documents6.__useActiveDocument)();
|
|
1007
|
+
const { save } = (0, import_editor_documents6.__useActiveDocumentActions)();
|
|
920
1008
|
return /* @__PURE__ */ React26.createElement(import_ui17.Paper, { sx: {
|
|
921
1009
|
px: 5,
|
|
922
1010
|
py: 4,
|
|
@@ -942,16 +1030,16 @@ function PortalledPrimaryAction() {
|
|
|
942
1030
|
|
|
943
1031
|
// src/extensions/site-settings/hooks/use-action-props.ts
|
|
944
1032
|
var import_i18n16 = require("@wordpress/i18n");
|
|
945
|
-
var
|
|
1033
|
+
var import_editor_v1_adapters11 = require("@elementor/editor-v1-adapters");
|
|
946
1034
|
var import_icons14 = require("@elementor/icons");
|
|
947
1035
|
function useActionProps6() {
|
|
948
|
-
const { isActive, isBlocked } = (0,
|
|
1036
|
+
const { isActive, isBlocked } = (0, import_editor_v1_adapters11.useRouteStatus)("panel/global", {
|
|
949
1037
|
blockOnKitRoutes: false
|
|
950
1038
|
});
|
|
951
1039
|
return {
|
|
952
1040
|
title: (0, import_i18n16.__)("Site Settings", "elementor"),
|
|
953
1041
|
icon: import_icons14.AdjustmentsHorizontalIcon,
|
|
954
|
-
onClick: () => isActive ? (0,
|
|
1042
|
+
onClick: () => isActive ? (0, import_editor_v1_adapters11.runCommand)("panel/global/close") : (0, import_editor_v1_adapters11.runCommand)("panel/global/open"),
|
|
955
1043
|
selected: isActive,
|
|
956
1044
|
disabled: isBlocked
|
|
957
1045
|
};
|
|
@@ -972,14 +1060,14 @@ function init9() {
|
|
|
972
1060
|
|
|
973
1061
|
// src/extensions/structure/hooks/use-action-props.ts
|
|
974
1062
|
var import_i18n17 = require("@wordpress/i18n");
|
|
975
|
-
var
|
|
1063
|
+
var import_editor_v1_adapters12 = require("@elementor/editor-v1-adapters");
|
|
976
1064
|
var import_icons15 = require("@elementor/icons");
|
|
977
1065
|
function useActionProps7() {
|
|
978
|
-
const { isActive, isBlocked } = (0,
|
|
1066
|
+
const { isActive, isBlocked } = (0, import_editor_v1_adapters12.useRouteStatus)("navigator");
|
|
979
1067
|
return {
|
|
980
1068
|
title: (0, import_i18n17.__)("Structure", "elementor"),
|
|
981
1069
|
icon: import_icons15.StructureIcon,
|
|
982
|
-
onClick: () => (0,
|
|
1070
|
+
onClick: () => (0, import_editor_v1_adapters12.runCommand)("navigator/toggle"),
|
|
983
1071
|
selected: isActive,
|
|
984
1072
|
disabled: isBlocked
|
|
985
1073
|
};
|
|
@@ -997,12 +1085,12 @@ function init10() {
|
|
|
997
1085
|
// src/extensions/theme-builder/hooks/use-action-props.ts
|
|
998
1086
|
var import_i18n18 = require("@wordpress/i18n");
|
|
999
1087
|
var import_icons16 = require("@elementor/icons");
|
|
1000
|
-
var
|
|
1088
|
+
var import_editor_v1_adapters13 = require("@elementor/editor-v1-adapters");
|
|
1001
1089
|
function useActionProps8() {
|
|
1002
1090
|
return {
|
|
1003
1091
|
icon: import_icons16.ThemeBuilderIcon,
|
|
1004
1092
|
title: (0, import_i18n18.__)("Theme Builder", "elementor"),
|
|
1005
|
-
onClick: () => (0,
|
|
1093
|
+
onClick: () => (0, import_editor_v1_adapters13.runCommand)("app/open")
|
|
1006
1094
|
};
|
|
1007
1095
|
}
|
|
1008
1096
|
|
|
@@ -1017,13 +1105,13 @@ function init11() {
|
|
|
1017
1105
|
// src/extensions/user-preferences/hooks/use-action-props.ts
|
|
1018
1106
|
var import_i18n19 = require("@wordpress/i18n");
|
|
1019
1107
|
var import_icons17 = require("@elementor/icons");
|
|
1020
|
-
var
|
|
1108
|
+
var import_editor_v1_adapters14 = require("@elementor/editor-v1-adapters");
|
|
1021
1109
|
function useActionProps9() {
|
|
1022
|
-
const { isActive, isBlocked } = (0,
|
|
1110
|
+
const { isActive, isBlocked } = (0, import_editor_v1_adapters14.useRouteStatus)("panel/editor-preferences");
|
|
1023
1111
|
return {
|
|
1024
1112
|
icon: import_icons17.ToggleRightIcon,
|
|
1025
1113
|
title: (0, import_i18n19.__)("User Preferences", "elementor"),
|
|
1026
|
-
onClick: () => (0,
|
|
1114
|
+
onClick: () => (0, import_editor_v1_adapters14.openRoute)("panel/editor-preferences"),
|
|
1027
1115
|
selected: isActive,
|
|
1028
1116
|
disabled: isBlocked
|
|
1029
1117
|
};
|
|
@@ -1048,7 +1136,7 @@ function init13() {
|
|
|
1048
1136
|
id: "exit-to-wordpress",
|
|
1049
1137
|
group: "exits",
|
|
1050
1138
|
useProps: () => {
|
|
1051
|
-
const document2 = (0, import_editor_documents7.
|
|
1139
|
+
const document2 = (0, import_editor_documents7.__useActiveDocument)();
|
|
1052
1140
|
return {
|
|
1053
1141
|
title: (0, import_i18n20.__)("Exit to WordPress", "elementor"),
|
|
1054
1142
|
href: document2?.links?.platformEdit,
|