@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/dist/index.mjs
CHANGED
|
@@ -19,9 +19,39 @@ function useMenuContext() {
|
|
|
19
19
|
|
|
20
20
|
// src/components/ui/toolbar-menu-item.tsx
|
|
21
21
|
import * as React2 from "react";
|
|
22
|
-
import { Box, IconButton, Tooltip } from "@elementor/ui";
|
|
22
|
+
import { Box, IconButton, Tooltip as BaseTooltip } from "@elementor/ui";
|
|
23
23
|
function ToolbarMenuItem({ title, ...props }) {
|
|
24
|
-
return /* @__PURE__ */ React2.createElement(Tooltip, { title }, /* @__PURE__ */ React2.createElement(Box, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React2.createElement(
|
|
24
|
+
return /* @__PURE__ */ React2.createElement(Tooltip, { title }, /* @__PURE__ */ React2.createElement(Box, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React2.createElement(
|
|
25
|
+
IconButton,
|
|
26
|
+
{
|
|
27
|
+
...props,
|
|
28
|
+
"aria-label": title,
|
|
29
|
+
size: "medium",
|
|
30
|
+
sx: {
|
|
31
|
+
"& .MuiSvgIcon-root": {
|
|
32
|
+
fontSize: "1.25rem"
|
|
33
|
+
},
|
|
34
|
+
"&:hover": {
|
|
35
|
+
color: "text.primary"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
)));
|
|
40
|
+
}
|
|
41
|
+
function Tooltip(props) {
|
|
42
|
+
return /* @__PURE__ */ React2.createElement(
|
|
43
|
+
BaseTooltip,
|
|
44
|
+
{
|
|
45
|
+
PopperProps: {
|
|
46
|
+
sx: {
|
|
47
|
+
"&.MuiTooltip-popper .MuiTooltip-tooltip.MuiTooltip-tooltipPlacementBottom": {
|
|
48
|
+
mt: 2
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
...props
|
|
53
|
+
}
|
|
54
|
+
);
|
|
25
55
|
}
|
|
26
56
|
|
|
27
57
|
// src/components/ui/popover-menu-item.tsx
|
|
@@ -44,7 +74,13 @@ function PopoverMenuItem({ text, icon, onClick, href, target, disabled, ...props
|
|
|
44
74
|
onClick,
|
|
45
75
|
component: href ? "a" : "div",
|
|
46
76
|
href,
|
|
47
|
-
target
|
|
77
|
+
target,
|
|
78
|
+
sx: {
|
|
79
|
+
"&:hover": {
|
|
80
|
+
color: "text.primary"
|
|
81
|
+
// Overriding global CSS from the editor.
|
|
82
|
+
}
|
|
83
|
+
}
|
|
48
84
|
},
|
|
49
85
|
/* @__PURE__ */ React3.createElement(ListItemIcon, null, icon),
|
|
50
86
|
/* @__PURE__ */ React3.createElement(ListItemText, { primary: text }),
|
|
@@ -75,7 +111,26 @@ import * as React6 from "react";
|
|
|
75
111
|
import * as React5 from "react";
|
|
76
112
|
import { Box as Box2, ToggleButton, Tooltip as Tooltip2 } from "@elementor/ui";
|
|
77
113
|
function ToolbarMenuToggleItem({ title, onClick, ...props }) {
|
|
78
|
-
return /* @__PURE__ */ React5.createElement(Tooltip2, { title }, /* @__PURE__ */ React5.createElement(Box2, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React5.createElement(
|
|
114
|
+
return /* @__PURE__ */ React5.createElement(Tooltip2, { title }, /* @__PURE__ */ React5.createElement(Box2, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React5.createElement(
|
|
115
|
+
ToggleButton,
|
|
116
|
+
{
|
|
117
|
+
...props,
|
|
118
|
+
onChange: onClick,
|
|
119
|
+
"aria-label": title,
|
|
120
|
+
size: "small",
|
|
121
|
+
sx: {
|
|
122
|
+
border: 0,
|
|
123
|
+
// Temp fix until the style of the ToggleButton component will be decided.
|
|
124
|
+
"&.Mui-disabled": {
|
|
125
|
+
border: 0
|
|
126
|
+
// Temp fix until the style of the ToggleButton component will be decided.
|
|
127
|
+
},
|
|
128
|
+
"& .MuiSvgIcon-root": {
|
|
129
|
+
fontSize: "1.25rem"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
)));
|
|
79
134
|
}
|
|
80
135
|
|
|
81
136
|
// src/components/actions/toggle-action.tsx
|
|
@@ -220,7 +275,7 @@ function PopoverMenu({ children, ...props }) {
|
|
|
220
275
|
Menu,
|
|
221
276
|
{
|
|
222
277
|
PaperProps: {
|
|
223
|
-
sx: { mt:
|
|
278
|
+
sx: { mt: 1.5 }
|
|
224
279
|
},
|
|
225
280
|
...props,
|
|
226
281
|
MenuListProps: {
|
|
@@ -241,7 +296,9 @@ var ElementorLogo = (props) => {
|
|
|
241
296
|
return /* @__PURE__ */ React10.createElement(SvgIcon, { viewBox: "0 0 32 32", ...props }, /* @__PURE__ */ React10.createElement("g", null, /* @__PURE__ */ React10.createElement("circle", { cx: "16", cy: "16", r: "16" }), /* @__PURE__ */ React10.createElement("path", { d: "M11.7 9H9V22.3H11.7V9Z" }), /* @__PURE__ */ React10.createElement("path", { d: "M22.4 9H9V11.7H22.4V9Z" }), /* @__PURE__ */ React10.createElement("path", { d: "M22.4 14.4004H9V17.1004H22.4V14.4004Z" }), /* @__PURE__ */ React10.createElement("path", { d: "M22.4 19.6992H9V22.3992H22.4V19.6992Z" })));
|
|
242
297
|
};
|
|
243
298
|
var StyledToggleButton = styled(ToggleButton2)(({ theme }) => ({
|
|
244
|
-
|
|
299
|
+
padding: 0,
|
|
300
|
+
border: 0,
|
|
301
|
+
color: theme.palette.text.primary,
|
|
245
302
|
"&.MuiToggleButton-root:hover": {
|
|
246
303
|
backgroundColor: "initial"
|
|
247
304
|
},
|
|
@@ -252,10 +309,8 @@ var StyledToggleButton = styled(ToggleButton2)(({ theme }) => ({
|
|
|
252
309
|
var StyledElementorLogo = styled(ElementorLogo, {
|
|
253
310
|
shouldForwardProp: (prop) => prop !== "showMenuIcon"
|
|
254
311
|
})(({ theme, showMenuIcon }) => ({
|
|
255
|
-
width: "auto",
|
|
256
|
-
height: "100%",
|
|
257
312
|
"& path": {
|
|
258
|
-
fill:
|
|
313
|
+
fill: theme.palette.background.default,
|
|
259
314
|
transition: "all 0.2s linear",
|
|
260
315
|
transformOrigin: "bottom left",
|
|
261
316
|
"&:first-of-type": {
|
|
@@ -285,11 +340,18 @@ function ToolbarLogo(props) {
|
|
|
285
340
|
{
|
|
286
341
|
...props,
|
|
287
342
|
value: "selected",
|
|
288
|
-
size: "
|
|
343
|
+
size: "large",
|
|
289
344
|
onMouseEnter: () => setIsHoverState(true),
|
|
290
345
|
onMouseLeave: () => setIsHoverState(false)
|
|
291
346
|
},
|
|
292
|
-
/* @__PURE__ */ React10.createElement(
|
|
347
|
+
/* @__PURE__ */ React10.createElement(
|
|
348
|
+
StyledElementorLogo,
|
|
349
|
+
{
|
|
350
|
+
fontSize: "large",
|
|
351
|
+
showMenuIcon,
|
|
352
|
+
titleAccess: __("Elementor Logo", "elementor")
|
|
353
|
+
}
|
|
354
|
+
)
|
|
293
355
|
);
|
|
294
356
|
}
|
|
295
357
|
|
|
@@ -397,7 +459,7 @@ import * as React16 from "react";
|
|
|
397
459
|
import * as React14 from "react";
|
|
398
460
|
import { Stack as Stack2 } from "@elementor/ui";
|
|
399
461
|
function ToolbarMenu({ children, ...props }) {
|
|
400
|
-
return /* @__PURE__ */ React14.createElement(MenuContextProvider, { type: "toolbar" }, /* @__PURE__ */ React14.createElement(Stack2, { sx: { px:
|
|
462
|
+
return /* @__PURE__ */ React14.createElement(MenuContextProvider, { type: "toolbar" }, /* @__PURE__ */ React14.createElement(Stack2, { sx: { px: 1.5 }, spacing: 1.5, direction: "row", alignItems: "center", ...props }, children));
|
|
401
463
|
}
|
|
402
464
|
|
|
403
465
|
// src/components/ui/toolbar-menu-more.tsx
|
|
@@ -458,7 +520,7 @@ function ResponsiveLocation() {
|
|
|
458
520
|
|
|
459
521
|
// src/components/app-bar.tsx
|
|
460
522
|
function AppBar() {
|
|
461
|
-
return /* @__PURE__ */ React21.createElement(ThemeProvider, { colorScheme: "dark" }, /* @__PURE__ */ React21.createElement(BaseAppBar, { position: "sticky" }, /* @__PURE__ */ React21.createElement(Box3, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)" }, /* @__PURE__ */ React21.createElement(Grid, { container: true }, /* @__PURE__ */ React21.createElement(MainMenuLocation, null), /* @__PURE__ */ React21.createElement(ToolsMenuLocation, null)), /* @__PURE__ */ React21.createElement(Grid, { container: true, justifyContent: "center" }, /* @__PURE__ */ React21.createElement(ToolbarMenu, { spacing:
|
|
523
|
+
return /* @__PURE__ */ React21.createElement(ThemeProvider, { colorScheme: "dark" }, /* @__PURE__ */ React21.createElement(BaseAppBar, { position: "sticky" }, /* @__PURE__ */ React21.createElement(Box3, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)" }, /* @__PURE__ */ React21.createElement(Grid, { container: true }, /* @__PURE__ */ React21.createElement(MainMenuLocation, null), /* @__PURE__ */ React21.createElement(ToolsMenuLocation, null)), /* @__PURE__ */ React21.createElement(Grid, { container: true, justifyContent: "center" }, /* @__PURE__ */ React21.createElement(ToolbarMenu, { spacing: 1.5 }, /* @__PURE__ */ React21.createElement(Divider4, { orientation: "vertical" }), /* @__PURE__ */ React21.createElement(PageIndicationLocation, null), /* @__PURE__ */ React21.createElement(Divider4, { orientation: "vertical" }), /* @__PURE__ */ React21.createElement(ResponsiveLocation, null), /* @__PURE__ */ React21.createElement(Divider4, { orientation: "vertical" }))), /* @__PURE__ */ React21.createElement(Grid, { container: true, justifyContent: "flex-end" }, /* @__PURE__ */ React21.createElement(UtilitiesMenuLocation, null), /* @__PURE__ */ React21.createElement(PrimaryActionLocation, null)))));
|
|
462
524
|
}
|
|
463
525
|
|
|
464
526
|
// src/init.ts
|
|
@@ -474,14 +536,14 @@ function redirectOldMenus() {
|
|
|
474
536
|
|
|
475
537
|
// src/extensions/documents-indicator/components/settings-button.tsx
|
|
476
538
|
import * as React22 from "react";
|
|
477
|
-
import { Box as Box4, ToggleButton as ToggleButton3, Tooltip as
|
|
539
|
+
import { Box as Box4, ToggleButton as ToggleButton3, Tooltip as BaseTooltip2 } from "@elementor/ui";
|
|
478
540
|
import { __ as __4 } from "@wordpress/i18n";
|
|
479
541
|
import { openRoute as openRoute2, useRouteStatus } from "@elementor/editor-v1-adapters";
|
|
480
542
|
import { SettingsIcon } from "@elementor/icons";
|
|
481
|
-
import {
|
|
543
|
+
import { __useActiveDocument, __useHostDocument } from "@elementor/editor-documents";
|
|
482
544
|
function SettingsButton() {
|
|
483
|
-
const activeDocument =
|
|
484
|
-
const hostDocument =
|
|
545
|
+
const activeDocument = __useActiveDocument();
|
|
546
|
+
const hostDocument = __useHostDocument();
|
|
485
547
|
const document2 = activeDocument && activeDocument.type.value !== "kit" ? activeDocument : hostDocument;
|
|
486
548
|
const { isActive, isBlocked } = useRouteStatus("panel/page-settings");
|
|
487
549
|
if (!document2) {
|
|
@@ -496,11 +558,34 @@ function SettingsButton() {
|
|
|
496
558
|
disabled: isBlocked,
|
|
497
559
|
onChange: () => openRoute2("panel/page-settings/settings"),
|
|
498
560
|
"aria-label": title,
|
|
499
|
-
size: "small"
|
|
561
|
+
size: "small",
|
|
562
|
+
sx: {
|
|
563
|
+
border: 0,
|
|
564
|
+
// Temp fix until the style of the ToggleButton component will be decided.
|
|
565
|
+
"&.Mui-disabled": {
|
|
566
|
+
border: 0
|
|
567
|
+
// Temp fix until the style of the ToggleButton component will be decided.
|
|
568
|
+
}
|
|
569
|
+
}
|
|
500
570
|
},
|
|
501
|
-
/* @__PURE__ */ React22.createElement(SettingsIcon,
|
|
571
|
+
/* @__PURE__ */ React22.createElement(SettingsIcon, { fontSize: "small" })
|
|
502
572
|
)));
|
|
503
573
|
}
|
|
574
|
+
function Tooltip3(props) {
|
|
575
|
+
return /* @__PURE__ */ React22.createElement(
|
|
576
|
+
BaseTooltip2,
|
|
577
|
+
{
|
|
578
|
+
PopperProps: {
|
|
579
|
+
sx: {
|
|
580
|
+
"&.MuiTooltip-popper .MuiTooltip-tooltip.MuiTooltip-tooltipPlacementBottom": {
|
|
581
|
+
mt: 1.7
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
...props
|
|
586
|
+
}
|
|
587
|
+
);
|
|
588
|
+
}
|
|
504
589
|
|
|
505
590
|
// src/extensions/documents-indicator/index.ts
|
|
506
591
|
function init() {
|
|
@@ -518,9 +603,9 @@ function init() {
|
|
|
518
603
|
import { __ as __5 } from "@wordpress/i18n";
|
|
519
604
|
import { EyeIcon } from "@elementor/icons";
|
|
520
605
|
import { runCommand } from "@elementor/editor-v1-adapters";
|
|
521
|
-
import {
|
|
606
|
+
import { __useActiveDocument as __useActiveDocument2 } from "@elementor/editor-documents";
|
|
522
607
|
function useActionProps() {
|
|
523
|
-
const document2 =
|
|
608
|
+
const document2 = __useActiveDocument2();
|
|
524
609
|
return {
|
|
525
610
|
icon: EyeIcon,
|
|
526
611
|
title: __5("Preview Changes", "elementor"),
|
|
@@ -544,10 +629,10 @@ function init2() {
|
|
|
544
629
|
// src/extensions/documents-save/hooks/use-document-save-draft-props.ts
|
|
545
630
|
import { __ as __6 } from "@wordpress/i18n";
|
|
546
631
|
import { FileReportIcon } from "@elementor/icons";
|
|
547
|
-
import {
|
|
632
|
+
import { __useActiveDocument as __useActiveDocument3, __useActiveDocumentActions } from "@elementor/editor-documents";
|
|
548
633
|
function useDocumentSaveDraftProps() {
|
|
549
|
-
const document2 =
|
|
550
|
-
const { saveDraft } =
|
|
634
|
+
const document2 = __useActiveDocument3();
|
|
635
|
+
const { saveDraft } = __useActiveDocumentActions();
|
|
551
636
|
return {
|
|
552
637
|
icon: FileReportIcon,
|
|
553
638
|
title: __6("Save Draft", "elementor"),
|
|
@@ -559,9 +644,9 @@ function useDocumentSaveDraftProps() {
|
|
|
559
644
|
// src/extensions/documents-save/hooks/use-document-save-template-props.ts
|
|
560
645
|
import { __ as __7 } from "@wordpress/i18n";
|
|
561
646
|
import { FolderIcon } from "@elementor/icons";
|
|
562
|
-
import {
|
|
647
|
+
import { __useActiveDocumentActions as __useActiveDocumentActions2 } from "@elementor/editor-documents";
|
|
563
648
|
function useDocumentSaveTemplateProps() {
|
|
564
|
-
const { saveTemplate } =
|
|
649
|
+
const { saveTemplate } = __useActiveDocumentActions2();
|
|
565
650
|
return {
|
|
566
651
|
icon: FolderIcon,
|
|
567
652
|
title: __7("Save as Template", "elementor"),
|
|
@@ -600,9 +685,9 @@ function PrimaryActionMenu(props) {
|
|
|
600
685
|
vertical: "top",
|
|
601
686
|
horizontal: "right"
|
|
602
687
|
},
|
|
603
|
-
marginThreshold:
|
|
688
|
+
marginThreshold: 4,
|
|
604
689
|
PaperProps: {
|
|
605
|
-
sx: { mt:
|
|
690
|
+
sx: { mt: 0.5 }
|
|
606
691
|
}
|
|
607
692
|
},
|
|
608
693
|
saveActions.map(({ MenuItem: MenuItem3, id }, index) => [
|
|
@@ -625,11 +710,13 @@ import {
|
|
|
625
710
|
Tooltip as Tooltip4,
|
|
626
711
|
usePopupState as usePopupState4
|
|
627
712
|
} from "@elementor/ui";
|
|
628
|
-
import {
|
|
713
|
+
import { __useActiveDocument as __useActiveDocument4, __useActiveDocumentActions as __useActiveDocumentActions3 } from "@elementor/editor-documents";
|
|
629
714
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
715
|
+
import { useIsPreviewMode } from "@elementor/editor-v1-adapters";
|
|
630
716
|
function PrimaryAction() {
|
|
631
|
-
const document2 =
|
|
632
|
-
const { save } =
|
|
717
|
+
const document2 = __useActiveDocument4();
|
|
718
|
+
const { save } = __useActiveDocumentActions3();
|
|
719
|
+
const isPreviewMode = useIsPreviewMode();
|
|
633
720
|
const popupState = usePopupState4({
|
|
634
721
|
variant: "popover",
|
|
635
722
|
popupId: "document-save-options"
|
|
@@ -637,23 +724,24 @@ function PrimaryAction() {
|
|
|
637
724
|
if (!document2) {
|
|
638
725
|
return null;
|
|
639
726
|
}
|
|
640
|
-
const
|
|
641
|
-
const
|
|
642
|
-
|
|
727
|
+
const isPublishDisabled = isPreviewMode || !isPublishEnabled(document2);
|
|
728
|
+
const isSaveOptionsDisabled = isPreviewMode || document2.type.value === "kit";
|
|
729
|
+
const shouldShowSpinner = document2.isSaving && !isPublishDisabled;
|
|
730
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(ButtonGroup, { size: "large", variant: "contained" }, /* @__PURE__ */ React24.createElement(
|
|
643
731
|
Button,
|
|
644
732
|
{
|
|
645
733
|
onClick: () => !document2.isSaving && save(),
|
|
646
734
|
sx: {
|
|
647
|
-
px: 7,
|
|
648
735
|
height: "100%",
|
|
736
|
+
borderRadius: 0,
|
|
649
737
|
maxWidth: "158px",
|
|
650
738
|
"&.MuiButtonBase-root.MuiButtonGroup-grouped": {
|
|
651
739
|
minWidth: "110px"
|
|
652
740
|
}
|
|
653
741
|
},
|
|
654
|
-
disabled:
|
|
742
|
+
disabled: isPublishDisabled
|
|
655
743
|
},
|
|
656
|
-
shouldShowSpinner ? /* @__PURE__ */ React24.createElement(CircularProgress,
|
|
744
|
+
shouldShowSpinner ? /* @__PURE__ */ React24.createElement(CircularProgress, { color: "inherit", size: "1.5em" }) : getLabel(document2)
|
|
657
745
|
), /* @__PURE__ */ React24.createElement(
|
|
658
746
|
Tooltip4,
|
|
659
747
|
{
|
|
@@ -661,8 +749,8 @@ function PrimaryAction() {
|
|
|
661
749
|
PopperProps: {
|
|
662
750
|
sx: {
|
|
663
751
|
"&.MuiTooltip-popper .MuiTooltip-tooltip.MuiTooltip-tooltipPlacementBottom": {
|
|
664
|
-
mt:
|
|
665
|
-
mr:
|
|
752
|
+
mt: 1,
|
|
753
|
+
mr: 0.25
|
|
666
754
|
}
|
|
667
755
|
}
|
|
668
756
|
}
|
|
@@ -670,9 +758,10 @@ function PrimaryAction() {
|
|
|
670
758
|
/* @__PURE__ */ React24.createElement(Box5, { component: "span", "aria-label": void 0 }, /* @__PURE__ */ React24.createElement(
|
|
671
759
|
Button,
|
|
672
760
|
{
|
|
761
|
+
size: "small",
|
|
673
762
|
...bindTrigger3(popupState),
|
|
674
|
-
sx: { px: 0, height: "100%" },
|
|
675
|
-
disabled:
|
|
763
|
+
sx: { px: 0, height: "100%", borderRadius: 0 },
|
|
764
|
+
disabled: isSaveOptionsDisabled,
|
|
676
765
|
"aria-label": __8("Save Options", "elementor")
|
|
677
766
|
},
|
|
678
767
|
/* @__PURE__ */ React24.createElement(ChevronDownIcon, null)
|
|
@@ -682,7 +771,7 @@ function PrimaryAction() {
|
|
|
682
771
|
function getLabel(document2) {
|
|
683
772
|
return document2.userCan.publish ? __8("Publish", "elementor") : __8("Submit", "elementor");
|
|
684
773
|
}
|
|
685
|
-
function
|
|
774
|
+
function isPublishEnabled(document2) {
|
|
686
775
|
if (document2.type.value === "kit") {
|
|
687
776
|
return false;
|
|
688
777
|
}
|
|
@@ -774,7 +863,7 @@ import { __ as __11 } from "@wordpress/i18n";
|
|
|
774
863
|
import { SearchIcon } from "@elementor/icons";
|
|
775
864
|
import { runCommand as runCommand2, useRouteStatus as useRouteStatus3 } from "@elementor/editor-v1-adapters";
|
|
776
865
|
function useActionProps3() {
|
|
777
|
-
const {
|
|
866
|
+
const { isBlocked } = useRouteStatus3("finder", {
|
|
778
867
|
blockOnKitRoutes: false,
|
|
779
868
|
blockOnPreviewMode: false
|
|
780
869
|
});
|
|
@@ -782,14 +871,13 @@ function useActionProps3() {
|
|
|
782
871
|
title: __11("Finder", "elementor"),
|
|
783
872
|
icon: SearchIcon,
|
|
784
873
|
onClick: () => runCommand2("finder/toggle"),
|
|
785
|
-
selected: isActive,
|
|
786
874
|
disabled: isBlocked
|
|
787
875
|
};
|
|
788
876
|
}
|
|
789
877
|
|
|
790
878
|
// src/extensions/finder/index.ts
|
|
791
879
|
function init5() {
|
|
792
|
-
utilitiesMenu.
|
|
880
|
+
utilitiesMenu.registerAction({
|
|
793
881
|
id: "toggle-finder",
|
|
794
882
|
priority: 10,
|
|
795
883
|
// Before help.
|
|
@@ -892,12 +980,12 @@ function getContainerRef() {
|
|
|
892
980
|
|
|
893
981
|
// src/extensions/site-settings/components/primary-action.tsx
|
|
894
982
|
import * as React26 from "react";
|
|
895
|
-
import {
|
|
983
|
+
import { __useActiveDocument as __useActiveDocument5, __useActiveDocumentActions as __useActiveDocumentActions4 } from "@elementor/editor-documents";
|
|
896
984
|
import { Button as Button2, CircularProgress as CircularProgress2, Paper } from "@elementor/ui";
|
|
897
985
|
import { __ as __15 } from "@wordpress/i18n";
|
|
898
986
|
function PrimaryAction2() {
|
|
899
|
-
const document2 =
|
|
900
|
-
const { save } =
|
|
987
|
+
const document2 = __useActiveDocument5();
|
|
988
|
+
const { save } = __useActiveDocumentActions4();
|
|
901
989
|
return /* @__PURE__ */ React26.createElement(Paper, { sx: {
|
|
902
990
|
px: 5,
|
|
903
991
|
py: 4,
|
|
@@ -1023,13 +1111,13 @@ function init12() {
|
|
|
1023
1111
|
// src/extensions/wordpress/index.ts
|
|
1024
1112
|
import { __ as __20 } from "@wordpress/i18n";
|
|
1025
1113
|
import { WordpressIcon } from "@elementor/icons";
|
|
1026
|
-
import {
|
|
1114
|
+
import { __useActiveDocument as __useActiveDocument6 } from "@elementor/editor-documents";
|
|
1027
1115
|
function init13() {
|
|
1028
1116
|
mainMenu.registerLink({
|
|
1029
1117
|
id: "exit-to-wordpress",
|
|
1030
1118
|
group: "exits",
|
|
1031
1119
|
useProps: () => {
|
|
1032
|
-
const document2 =
|
|
1120
|
+
const document2 = __useActiveDocument6();
|
|
1033
1121
|
return {
|
|
1034
1122
|
title: __20("Exit to WordPress", "elementor"),
|
|
1035
1123
|
href: document2?.links?.platformEdit,
|