@elementor/editor-app-bar 0.8.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/index.js +33 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/components/ui/toolbar-menu-item.tsx +3 -1
- package/src/components/ui/toolbar-menu-toggle-item.tsx +3 -1
- package/src/extensions/documents-indicator/components/__tests__/settings-button.test.tsx +5 -5
- package/src/extensions/documents-indicator/components/settings-button.tsx +4 -4
- package/src/extensions/documents-preview/hooks/__tests__/use-document-preview-props.test.ts +5 -5
- package/src/extensions/documents-preview/hooks/use-action-props.ts +3 -3
- package/src/extensions/documents-save/components/__tests__/primary-action.test.tsx +14 -14
- package/src/extensions/documents-save/components/primary-action.tsx +4 -4
- package/src/extensions/documents-save/hooks/__tests__/use-document-save-draft-props.test.ts +4 -4
- package/src/extensions/documents-save/hooks/__tests__/use-document-save-template-props.test.ts +2 -2
- 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/elements/hooks/__tests__/use-action-props.test.ts +3 -3
- package/src/extensions/elements/hooks/use-action-props.ts +1 -1
- package/src/extensions/elements/sync/__tests__/sync-panel-title.test.ts +2 -2
- package/src/extensions/elements/sync/sync-panel-title.ts +1 -1
- package/src/extensions/finder/hooks/__tests__/use-action-props.test.ts +3 -3
- package/src/extensions/finder/hooks/use-action-props.ts +1 -1
- package/src/extensions/history/hooks/__tests__/use-action-props.test.ts +3 -3
- package/src/extensions/history/hooks/use-action-props.ts +1 -1
- package/src/extensions/keyboard-shortcuts/hooks/__tests__/use-action-props.test.ts +2 -2
- package/src/extensions/keyboard-shortcuts/hooks/use-action-props.ts +1 -1
- package/src/extensions/site-settings/components/__tests__/portalled-primary-action.test.tsx +5 -5
- package/src/extensions/site-settings/components/__tests__/primary-action.test.tsx +7 -7
- package/src/extensions/site-settings/components/portal.tsx +1 -1
- package/src/extensions/site-settings/components/primary-action.tsx +3 -3
- package/src/extensions/site-settings/hooks/__tests__/use-action-props.test.ts +3 -3
- package/src/extensions/site-settings/hooks/use-action-props.ts +1 -1
- package/src/extensions/structure/hooks/__tests__/use-action-props.test.ts +3 -3
- package/src/extensions/structure/hooks/use-action-props.ts +1 -1
- package/src/extensions/theme-builder/hooks/__tests__/use-action-props.test.ts +2 -2
- package/src/extensions/theme-builder/hooks/use-action-props.ts +1 -1
- package/src/extensions/user-preferences/hooks/__tests__/use-action-props.test.ts +3 -3
- package/src/extensions/user-preferences/hooks/use-action-props.ts +1 -1
- package/src/extensions/wordpress/index.ts +2 -2
- package/src/sync/__tests__/redirect-old-menus.test.ts +2 -2
- package/src/sync/redirect-old-menus.ts +1 -1
package/dist/index.mjs
CHANGED
|
@@ -28,8 +28,10 @@ function ToolbarMenuItem({ title, ...props }) {
|
|
|
28
28
|
"aria-label": title,
|
|
29
29
|
size: "medium",
|
|
30
30
|
sx: {
|
|
31
|
-
"&
|
|
32
|
-
fontSize: "1.25rem"
|
|
31
|
+
"& svg": {
|
|
32
|
+
fontSize: "1.25rem",
|
|
33
|
+
height: "1em",
|
|
34
|
+
width: "1em"
|
|
33
35
|
},
|
|
34
36
|
"&:hover": {
|
|
35
37
|
color: "text.primary"
|
|
@@ -125,8 +127,10 @@ function ToolbarMenuToggleItem({ title, onClick, ...props }) {
|
|
|
125
127
|
border: 0
|
|
126
128
|
// Temp fix until the style of the ToggleButton component will be decided.
|
|
127
129
|
},
|
|
128
|
-
"&
|
|
129
|
-
fontSize: "1.25rem"
|
|
130
|
+
"& svg": {
|
|
131
|
+
fontSize: "1.25rem",
|
|
132
|
+
height: "1em",
|
|
133
|
+
width: "1em"
|
|
130
134
|
}
|
|
131
135
|
}
|
|
132
136
|
}
|
|
@@ -527,7 +531,7 @@ function AppBar() {
|
|
|
527
531
|
import { injectIntoTop as injectIntoTop2 } from "@elementor/editor";
|
|
528
532
|
|
|
529
533
|
// src/sync/redirect-old-menus.ts
|
|
530
|
-
import { listenTo, openRoute, routeOpenEvent } from "@elementor/editor-v1-adapters";
|
|
534
|
+
import { __privateListenTo as listenTo, __privateOpenRoute as openRoute, routeOpenEvent } from "@elementor/editor-v1-adapters";
|
|
531
535
|
function redirectOldMenus() {
|
|
532
536
|
listenTo(routeOpenEvent("panel/menu"), () => {
|
|
533
537
|
openRoute("panel/elements/categories");
|
|
@@ -538,12 +542,12 @@ function redirectOldMenus() {
|
|
|
538
542
|
import * as React22 from "react";
|
|
539
543
|
import { Box as Box4, ToggleButton as ToggleButton3, Tooltip as BaseTooltip2 } from "@elementor/ui";
|
|
540
544
|
import { __ as __4 } from "@wordpress/i18n";
|
|
541
|
-
import {
|
|
545
|
+
import { __privateOpenRoute as openRoute2, __privateUseRouteStatus as useRouteStatus } from "@elementor/editor-v1-adapters";
|
|
542
546
|
import { SettingsIcon } from "@elementor/icons";
|
|
543
|
-
import { __useActiveDocument, __useHostDocument } from "@elementor/editor-documents";
|
|
547
|
+
import { __useActiveDocument as useActiveDocument, __useHostDocument as useHostDocument } from "@elementor/editor-documents";
|
|
544
548
|
function SettingsButton() {
|
|
545
|
-
const activeDocument =
|
|
546
|
-
const hostDocument =
|
|
549
|
+
const activeDocument = useActiveDocument();
|
|
550
|
+
const hostDocument = useHostDocument();
|
|
547
551
|
const document2 = activeDocument && activeDocument.type.value !== "kit" ? activeDocument : hostDocument;
|
|
548
552
|
const { isActive, isBlocked } = useRouteStatus("panel/page-settings");
|
|
549
553
|
if (!document2) {
|
|
@@ -602,10 +606,10 @@ function init() {
|
|
|
602
606
|
// src/extensions/documents-preview/hooks/use-action-props.ts
|
|
603
607
|
import { __ as __5 } from "@wordpress/i18n";
|
|
604
608
|
import { EyeIcon } from "@elementor/icons";
|
|
605
|
-
import { runCommand } from "@elementor/editor-v1-adapters";
|
|
606
|
-
import { __useActiveDocument as
|
|
609
|
+
import { __privateRunCommand as runCommand } from "@elementor/editor-v1-adapters";
|
|
610
|
+
import { __useActiveDocument as useActiveDocument2 } from "@elementor/editor-documents";
|
|
607
611
|
function useActionProps() {
|
|
608
|
-
const document2 =
|
|
612
|
+
const document2 = useActiveDocument2();
|
|
609
613
|
return {
|
|
610
614
|
icon: EyeIcon,
|
|
611
615
|
title: __5("Preview Changes", "elementor"),
|
|
@@ -629,10 +633,10 @@ function init2() {
|
|
|
629
633
|
// src/extensions/documents-save/hooks/use-document-save-draft-props.ts
|
|
630
634
|
import { __ as __6 } from "@wordpress/i18n";
|
|
631
635
|
import { FileReportIcon } from "@elementor/icons";
|
|
632
|
-
import { __useActiveDocument as
|
|
636
|
+
import { __useActiveDocument as useActiveDocument3, __useActiveDocumentActions as useActiveDocumentActions } from "@elementor/editor-documents";
|
|
633
637
|
function useDocumentSaveDraftProps() {
|
|
634
|
-
const document2 =
|
|
635
|
-
const { saveDraft } =
|
|
638
|
+
const document2 = useActiveDocument3();
|
|
639
|
+
const { saveDraft } = useActiveDocumentActions();
|
|
636
640
|
return {
|
|
637
641
|
icon: FileReportIcon,
|
|
638
642
|
title: __6("Save Draft", "elementor"),
|
|
@@ -644,9 +648,9 @@ function useDocumentSaveDraftProps() {
|
|
|
644
648
|
// src/extensions/documents-save/hooks/use-document-save-template-props.ts
|
|
645
649
|
import { __ as __7 } from "@wordpress/i18n";
|
|
646
650
|
import { FolderIcon } from "@elementor/icons";
|
|
647
|
-
import { __useActiveDocumentActions as
|
|
651
|
+
import { __useActiveDocumentActions as useActiveDocumentActions2 } from "@elementor/editor-documents";
|
|
648
652
|
function useDocumentSaveTemplateProps() {
|
|
649
|
-
const { saveTemplate } =
|
|
653
|
+
const { saveTemplate } = useActiveDocumentActions2();
|
|
650
654
|
return {
|
|
651
655
|
icon: FolderIcon,
|
|
652
656
|
title: __7("Save as Template", "elementor"),
|
|
@@ -710,12 +714,12 @@ import {
|
|
|
710
714
|
Tooltip as Tooltip4,
|
|
711
715
|
usePopupState as usePopupState4
|
|
712
716
|
} from "@elementor/ui";
|
|
713
|
-
import { __useActiveDocument as
|
|
717
|
+
import { __useActiveDocument as useActiveDocument4, __useActiveDocumentActions as useActiveDocumentActions3 } from "@elementor/editor-documents";
|
|
714
718
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
715
|
-
import { useIsPreviewMode } from "@elementor/editor-v1-adapters";
|
|
719
|
+
import { __privateUseIsPreviewMode as useIsPreviewMode } from "@elementor/editor-v1-adapters";
|
|
716
720
|
function PrimaryAction() {
|
|
717
|
-
const document2 =
|
|
718
|
-
const { save } =
|
|
721
|
+
const document2 = useActiveDocument4();
|
|
722
|
+
const { save } = useActiveDocumentActions3();
|
|
719
723
|
const isPreviewMode = useIsPreviewMode();
|
|
720
724
|
const popupState = usePopupState4({
|
|
721
725
|
variant: "popover",
|
|
@@ -802,7 +806,7 @@ function init3() {
|
|
|
802
806
|
|
|
803
807
|
// src/extensions/elements/sync/sync-panel-title.ts
|
|
804
808
|
import { __ as __9 } from "@wordpress/i18n";
|
|
805
|
-
import { isRouteActive,
|
|
809
|
+
import { __privateIsRouteActive as isRouteActive, __privateListenTo as listenTo2, routeOpenEvent as routeOpenEvent2, v1ReadyEvent } from "@elementor/editor-v1-adapters";
|
|
806
810
|
function syncPanelTitle() {
|
|
807
811
|
const panelTitle = __9("Elements", "elementor");
|
|
808
812
|
const tabTitle = __9("Widgets", "elementor");
|
|
@@ -836,7 +840,7 @@ function setTabTitle(title) {
|
|
|
836
840
|
// src/extensions/elements/hooks/use-action-props.ts
|
|
837
841
|
import { PlusIcon } from "@elementor/icons";
|
|
838
842
|
import { __ as __10 } from "@wordpress/i18n";
|
|
839
|
-
import {
|
|
843
|
+
import { __privateOpenRoute as openRoute3, __privateUseRouteStatus as useRouteStatus2 } from "@elementor/editor-v1-adapters";
|
|
840
844
|
function useActionProps2() {
|
|
841
845
|
const { isActive, isBlocked } = useRouteStatus2("panel/elements");
|
|
842
846
|
return {
|
|
@@ -861,7 +865,7 @@ function init4() {
|
|
|
861
865
|
// src/extensions/finder/hooks/use-action-props.ts
|
|
862
866
|
import { __ as __11 } from "@wordpress/i18n";
|
|
863
867
|
import { SearchIcon } from "@elementor/icons";
|
|
864
|
-
import {
|
|
868
|
+
import { __privateRunCommand as runCommand2, __privateUseRouteStatus as useRouteStatus3 } from "@elementor/editor-v1-adapters";
|
|
865
869
|
function useActionProps3() {
|
|
866
870
|
const { isBlocked } = useRouteStatus3("finder", {
|
|
867
871
|
blockOnKitRoutes: false,
|
|
@@ -907,7 +911,7 @@ function init6() {
|
|
|
907
911
|
// src/extensions/history/hooks/use-action-props.ts
|
|
908
912
|
import { HistoryIcon } from "@elementor/icons";
|
|
909
913
|
import { __ as __13 } from "@wordpress/i18n";
|
|
910
|
-
import {
|
|
914
|
+
import { __privateOpenRoute as openRoute4, __privateUseRouteStatus as useRouteStatus4 } from "@elementor/editor-v1-adapters";
|
|
911
915
|
function useActionProps4() {
|
|
912
916
|
const { isActive, isBlocked } = useRouteStatus4("panel/history");
|
|
913
917
|
return {
|
|
@@ -931,7 +935,7 @@ function init7() {
|
|
|
931
935
|
// src/extensions/keyboard-shortcuts/hooks/use-action-props.ts
|
|
932
936
|
import { __ as __14 } from "@wordpress/i18n";
|
|
933
937
|
import { KeyboardIcon } from "@elementor/icons";
|
|
934
|
-
import {
|
|
938
|
+
import { __privateRunCommand as runCommand3 } from "@elementor/editor-v1-adapters";
|
|
935
939
|
function useActionProps5() {
|
|
936
940
|
return {
|
|
937
941
|
icon: KeyboardIcon,
|
|
@@ -960,7 +964,7 @@ import * as React27 from "react";
|
|
|
960
964
|
// src/extensions/site-settings/components/portal.tsx
|
|
961
965
|
import * as React25 from "react";
|
|
962
966
|
import { Portal as BasePortal } from "@elementor/ui";
|
|
963
|
-
import {
|
|
967
|
+
import { __privateIsRouteActive as isRouteActive2, routeCloseEvent, routeOpenEvent as routeOpenEvent3, __privateUseListenTo as useListenTo } from "@elementor/editor-v1-adapters";
|
|
964
968
|
function Portal(props) {
|
|
965
969
|
const containerRef = useListenTo(
|
|
966
970
|
[
|
|
@@ -980,12 +984,12 @@ function getContainerRef() {
|
|
|
980
984
|
|
|
981
985
|
// src/extensions/site-settings/components/primary-action.tsx
|
|
982
986
|
import * as React26 from "react";
|
|
983
|
-
import { __useActiveDocument as
|
|
987
|
+
import { __useActiveDocument as useActiveDocument5, __useActiveDocumentActions as useActiveDocumentActions4 } from "@elementor/editor-documents";
|
|
984
988
|
import { Button as Button2, CircularProgress as CircularProgress2, Paper } from "@elementor/ui";
|
|
985
989
|
import { __ as __15 } from "@wordpress/i18n";
|
|
986
990
|
function PrimaryAction2() {
|
|
987
|
-
const document2 =
|
|
988
|
-
const { save } =
|
|
991
|
+
const document2 = useActiveDocument5();
|
|
992
|
+
const { save } = useActiveDocumentActions4();
|
|
989
993
|
return /* @__PURE__ */ React26.createElement(Paper, { sx: {
|
|
990
994
|
px: 5,
|
|
991
995
|
py: 4,
|
|
@@ -1011,7 +1015,7 @@ function PortalledPrimaryAction() {
|
|
|
1011
1015
|
|
|
1012
1016
|
// src/extensions/site-settings/hooks/use-action-props.ts
|
|
1013
1017
|
import { __ as __16 } from "@wordpress/i18n";
|
|
1014
|
-
import {
|
|
1018
|
+
import { __privateRunCommand as runCommand4, __privateUseRouteStatus as useRouteStatus5 } from "@elementor/editor-v1-adapters";
|
|
1015
1019
|
import { AdjustmentsHorizontalIcon } from "@elementor/icons";
|
|
1016
1020
|
function useActionProps6() {
|
|
1017
1021
|
const { isActive, isBlocked } = useRouteStatus5("panel/global", {
|
|
@@ -1041,7 +1045,7 @@ function init9() {
|
|
|
1041
1045
|
|
|
1042
1046
|
// src/extensions/structure/hooks/use-action-props.ts
|
|
1043
1047
|
import { __ as __17 } from "@wordpress/i18n";
|
|
1044
|
-
import {
|
|
1048
|
+
import { __privateRunCommand as runCommand5, __privateUseRouteStatus as useRouteStatus6 } from "@elementor/editor-v1-adapters";
|
|
1045
1049
|
import { StructureIcon } from "@elementor/icons";
|
|
1046
1050
|
function useActionProps7() {
|
|
1047
1051
|
const { isActive, isBlocked } = useRouteStatus6("navigator");
|
|
@@ -1066,7 +1070,7 @@ function init10() {
|
|
|
1066
1070
|
// src/extensions/theme-builder/hooks/use-action-props.ts
|
|
1067
1071
|
import { __ as __18 } from "@wordpress/i18n";
|
|
1068
1072
|
import { ThemeBuilderIcon } from "@elementor/icons";
|
|
1069
|
-
import {
|
|
1073
|
+
import { __privateRunCommand as runCommand6 } from "@elementor/editor-v1-adapters";
|
|
1070
1074
|
function useActionProps8() {
|
|
1071
1075
|
return {
|
|
1072
1076
|
icon: ThemeBuilderIcon,
|
|
@@ -1086,7 +1090,7 @@ function init11() {
|
|
|
1086
1090
|
// src/extensions/user-preferences/hooks/use-action-props.ts
|
|
1087
1091
|
import { __ as __19 } from "@wordpress/i18n";
|
|
1088
1092
|
import { ToggleRightIcon } from "@elementor/icons";
|
|
1089
|
-
import {
|
|
1093
|
+
import { __privateOpenRoute as openRoute5, __privateUseRouteStatus as useRouteStatus7 } from "@elementor/editor-v1-adapters";
|
|
1090
1094
|
function useActionProps9() {
|
|
1091
1095
|
const { isActive, isBlocked } = useRouteStatus7("panel/editor-preferences");
|
|
1092
1096
|
return {
|
|
@@ -1111,13 +1115,13 @@ function init12() {
|
|
|
1111
1115
|
// src/extensions/wordpress/index.ts
|
|
1112
1116
|
import { __ as __20 } from "@wordpress/i18n";
|
|
1113
1117
|
import { WordpressIcon } from "@elementor/icons";
|
|
1114
|
-
import { __useActiveDocument as
|
|
1118
|
+
import { __useActiveDocument as useActiveDocument6 } from "@elementor/editor-documents";
|
|
1115
1119
|
function init13() {
|
|
1116
1120
|
mainMenu.registerLink({
|
|
1117
1121
|
id: "exit-to-wordpress",
|
|
1118
1122
|
group: "exits",
|
|
1119
1123
|
useProps: () => {
|
|
1120
|
-
const document2 =
|
|
1124
|
+
const document2 = useActiveDocument6();
|
|
1121
1125
|
return {
|
|
1122
1126
|
title: __20("Exit to WordPress", "elementor"),
|
|
1123
1127
|
href: document2?.links?.platformEdit,
|