@elementor/editor-app-bar 0.2.1 → 0.4.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 +40 -0
- package/dist/index.d.ts +27 -42
- package/dist/index.js +81 -106
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +83 -108
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -6
- package/src/components/locations/__tests__/locations-components.test.tsx +1 -1
- package/src/components/locations/__tests__/menus.test.tsx +4 -4
- package/src/components/locations/page-indication-location.tsx +2 -3
- package/src/components/locations/primary-action-location.tsx +2 -3
- package/src/components/locations/responsive-location.tsx +2 -3
- package/src/extensions/documents-indicator/index.ts +1 -1
- package/src/extensions/documents-preview/index.ts +1 -1
- package/src/extensions/documents-save/components/__tests__/primary-action-menu.test.tsx +2 -2
- package/src/extensions/documents-save/index.ts +3 -3
- package/src/extensions/elements/index.ts +1 -1
- package/src/extensions/finder/index.ts +1 -1
- package/src/extensions/help/index.ts +1 -1
- package/src/extensions/history/index.ts +1 -1
- package/src/extensions/keyboard-shortcuts/index.ts +1 -1
- package/src/extensions/site-settings/index.ts +2 -2
- package/src/extensions/structure/index.ts +1 -1
- package/src/extensions/theme-builder/index.ts +1 -1
- package/src/extensions/user-preferences/index.ts +1 -1
- package/src/extensions/wordpress/index.ts +10 -7
- package/src/init.ts +1 -4
- package/src/locations/__tests__/menus.test.tsx +15 -30
- package/src/locations/index.ts +19 -21
- package/src/locations/menus.tsx +57 -69
- package/src/env.ts +0 -17
- package/src/locations/consts.ts +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,46 @@
|
|
|
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.4.0](https://github.com/elementor/elementor-packages/compare/@elementor/editor-app-bar@0.3.0...@elementor/editor-app-bar@0.4.0) (2023-05-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **locations:** change api to support props for slots [ED-10730] ([#38](https://github.com/elementor/elementor-packages/issues/38)) ([44bec3c](https://github.com/elementor/elementor-packages/commit/44bec3cda1020037ba7105c6f05ce4baa8e3b376))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# 0.3.0 (2023-05-16)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **editor-app-bar:** change exit to wordpress link functionality [ED-10275] ([#37](https://github.com/elementor/elementor-packages/issues/37)) ([e0f5b6e](https://github.com/elementor/elementor-packages/commit/e0f5b6e3a50473f8a6d9c9e00474baedeb1b3664))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 0.2.1 (2023-05-11)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* **editor-app-bar:** make save options button disabled in site-settings [ED-10221] ([#30](https://github.com/elementor/elementor-packages/issues/30)) ([1991096](https://github.com/elementor/elementor-packages/commit/1991096115efeae7bc3648e4889899b85d7328d6))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# 0.2.0 (2023-05-09)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Features
|
|
39
|
+
|
|
40
|
+
* **env:** support consuming environment variables in packages [ED-10161] ([#26](https://github.com/elementor/elementor-packages/issues/26)) ([dd811ff](https://github.com/elementor/elementor-packages/commit/dd811ff71e43bf998ee07c6e1f380a379874a7fd))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
6
46
|
## [0.2.1](https://github.com/elementor/elementor-packages/compare/v0.2.0...v0.2.1) (2023-05-11)
|
|
7
47
|
|
|
8
48
|
|
package/dist/index.d.ts
CHANGED
|
@@ -28,27 +28,12 @@ type Props = {
|
|
|
28
28
|
target?: string;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
declare const injectIntoPageIndication: (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
name: string;
|
|
35
|
-
options?: _elementor_locations.InjectionOptions | undefined;
|
|
36
|
-
}, "location">) => void;
|
|
37
|
-
declare const injectIntoResponsive: ({ filler, name, options }: Omit<{
|
|
38
|
-
location: string;
|
|
39
|
-
filler: _elementor_locations.Filler;
|
|
40
|
-
name: string;
|
|
41
|
-
options?: _elementor_locations.InjectionOptions | undefined;
|
|
42
|
-
}, "location">) => void;
|
|
43
|
-
declare const injectIntoPrimaryAction: ({ filler, name, options }: Omit<{
|
|
44
|
-
location: string;
|
|
45
|
-
filler: _elementor_locations.Filler;
|
|
46
|
-
name: string;
|
|
47
|
-
options?: _elementor_locations.InjectionOptions | undefined;
|
|
48
|
-
}, "location">) => void;
|
|
31
|
+
declare const injectIntoPageIndication: (args: _elementor_locations.InjectArgs<_elementor_locations.EmptyObject>) => void;
|
|
32
|
+
declare const injectIntoResponsive: (args: _elementor_locations.InjectArgs<_elementor_locations.EmptyObject>) => void;
|
|
33
|
+
declare const injectIntoPrimaryAction: (args: _elementor_locations.InjectArgs<_elementor_locations.EmptyObject>) => void;
|
|
49
34
|
declare const mainMenu: {
|
|
50
|
-
registerAction: (
|
|
51
|
-
|
|
35
|
+
registerAction: (args: {
|
|
36
|
+
id: string;
|
|
52
37
|
group?: ("default" | "exits") | undefined;
|
|
53
38
|
priority?: number | undefined;
|
|
54
39
|
overwrite?: boolean | undefined;
|
|
@@ -59,8 +44,8 @@ declare const mainMenu: {
|
|
|
59
44
|
useProps: () => Props$2;
|
|
60
45
|
props?: undefined;
|
|
61
46
|
})) => void;
|
|
62
|
-
registerToggleAction: (
|
|
63
|
-
|
|
47
|
+
registerToggleAction: (args: {
|
|
48
|
+
id: string;
|
|
64
49
|
group?: ("default" | "exits") | undefined;
|
|
65
50
|
priority?: number | undefined;
|
|
66
51
|
overwrite?: boolean | undefined;
|
|
@@ -71,8 +56,8 @@ declare const mainMenu: {
|
|
|
71
56
|
useProps: () => Props$1;
|
|
72
57
|
props?: undefined;
|
|
73
58
|
})) => void;
|
|
74
|
-
registerLink: (
|
|
75
|
-
|
|
59
|
+
registerLink: (args: {
|
|
60
|
+
id: string;
|
|
76
61
|
group?: ("default" | "exits") | undefined;
|
|
77
62
|
priority?: number | undefined;
|
|
78
63
|
overwrite?: boolean | undefined;
|
|
@@ -95,8 +80,8 @@ declare const mainMenu: {
|
|
|
95
80
|
};
|
|
96
81
|
};
|
|
97
82
|
declare const toolsMenu: {
|
|
98
|
-
registerAction: (
|
|
99
|
-
|
|
83
|
+
registerAction: (args: {
|
|
84
|
+
id: string;
|
|
100
85
|
group?: "default" | undefined;
|
|
101
86
|
priority?: number | undefined;
|
|
102
87
|
overwrite?: boolean | undefined;
|
|
@@ -107,8 +92,8 @@ declare const toolsMenu: {
|
|
|
107
92
|
useProps: () => Props$2;
|
|
108
93
|
props?: undefined;
|
|
109
94
|
})) => void;
|
|
110
|
-
registerToggleAction: (
|
|
111
|
-
|
|
95
|
+
registerToggleAction: (args: {
|
|
96
|
+
id: string;
|
|
112
97
|
group?: "default" | undefined;
|
|
113
98
|
priority?: number | undefined;
|
|
114
99
|
overwrite?: boolean | undefined;
|
|
@@ -119,8 +104,8 @@ declare const toolsMenu: {
|
|
|
119
104
|
useProps: () => Props$1;
|
|
120
105
|
props?: undefined;
|
|
121
106
|
})) => void;
|
|
122
|
-
registerLink: (
|
|
123
|
-
|
|
107
|
+
registerLink: (args: {
|
|
108
|
+
id: string;
|
|
124
109
|
group?: "default" | undefined;
|
|
125
110
|
priority?: number | undefined;
|
|
126
111
|
overwrite?: boolean | undefined;
|
|
@@ -139,8 +124,8 @@ declare const toolsMenu: {
|
|
|
139
124
|
};
|
|
140
125
|
};
|
|
141
126
|
declare const utilitiesMenu: {
|
|
142
|
-
registerAction: (
|
|
143
|
-
|
|
127
|
+
registerAction: (args: {
|
|
128
|
+
id: string;
|
|
144
129
|
group?: "default" | undefined;
|
|
145
130
|
priority?: number | undefined;
|
|
146
131
|
overwrite?: boolean | undefined;
|
|
@@ -151,8 +136,8 @@ declare const utilitiesMenu: {
|
|
|
151
136
|
useProps: () => Props$2;
|
|
152
137
|
props?: undefined;
|
|
153
138
|
})) => void;
|
|
154
|
-
registerToggleAction: (
|
|
155
|
-
|
|
139
|
+
registerToggleAction: (args: {
|
|
140
|
+
id: string;
|
|
156
141
|
group?: "default" | undefined;
|
|
157
142
|
priority?: number | undefined;
|
|
158
143
|
overwrite?: boolean | undefined;
|
|
@@ -163,8 +148,8 @@ declare const utilitiesMenu: {
|
|
|
163
148
|
useProps: () => Props$1;
|
|
164
149
|
props?: undefined;
|
|
165
150
|
})) => void;
|
|
166
|
-
registerLink: (
|
|
167
|
-
|
|
151
|
+
registerLink: (args: {
|
|
152
|
+
id: string;
|
|
168
153
|
group?: "default" | undefined;
|
|
169
154
|
priority?: number | undefined;
|
|
170
155
|
overwrite?: boolean | undefined;
|
|
@@ -183,8 +168,8 @@ declare const utilitiesMenu: {
|
|
|
183
168
|
};
|
|
184
169
|
};
|
|
185
170
|
declare const documentOptionsMenu: {
|
|
186
|
-
registerAction: (
|
|
187
|
-
|
|
171
|
+
registerAction: (args: {
|
|
172
|
+
id: string;
|
|
188
173
|
group?: ("default" | "save") | undefined;
|
|
189
174
|
priority?: number | undefined;
|
|
190
175
|
overwrite?: boolean | undefined;
|
|
@@ -195,8 +180,8 @@ declare const documentOptionsMenu: {
|
|
|
195
180
|
useProps: () => Props$2;
|
|
196
181
|
props?: undefined;
|
|
197
182
|
})) => void;
|
|
198
|
-
registerToggleAction: (
|
|
199
|
-
|
|
183
|
+
registerToggleAction: (args: {
|
|
184
|
+
id: string;
|
|
200
185
|
group?: ("default" | "save") | undefined;
|
|
201
186
|
priority?: number | undefined;
|
|
202
187
|
overwrite?: boolean | undefined;
|
|
@@ -207,8 +192,8 @@ declare const documentOptionsMenu: {
|
|
|
207
192
|
useProps: () => Props$1;
|
|
208
193
|
props?: undefined;
|
|
209
194
|
})) => void;
|
|
210
|
-
registerLink: (
|
|
211
|
-
|
|
195
|
+
registerLink: (args: {
|
|
196
|
+
id: string;
|
|
212
197
|
group?: ("default" | "save") | undefined;
|
|
213
198
|
priority?: number | undefined;
|
|
214
199
|
overwrite?: boolean | undefined;
|
package/dist/index.js
CHANGED
|
@@ -149,30 +149,30 @@ function Link({ icon: Icon, title, visible = true, ...props }) {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
// src/locations/menus.tsx
|
|
152
|
-
function createMenu(
|
|
152
|
+
function createMenu(groups = []) {
|
|
153
153
|
const menuGroups = [
|
|
154
154
|
...groups,
|
|
155
155
|
"default"
|
|
156
156
|
];
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
157
|
+
const locations = menuGroups.reduce(
|
|
158
|
+
(carry, group) => ({
|
|
159
|
+
...carry,
|
|
160
|
+
[group]: (0, import_locations.createLocation)()
|
|
161
|
+
}),
|
|
162
|
+
{}
|
|
163
|
+
);
|
|
164
|
+
const [
|
|
165
|
+
registerAction,
|
|
166
|
+
registerToggleAction,
|
|
167
|
+
registerLink
|
|
168
|
+
] = [Action, ToggleAction, Link].map(
|
|
169
|
+
(Component) => createRegisterMenuItem({
|
|
170
|
+
locations,
|
|
171
|
+
menuGroups,
|
|
172
|
+
component: Component
|
|
173
|
+
})
|
|
174
|
+
);
|
|
175
|
+
const useMenuItems5 = createUseMenuItems(locations);
|
|
176
176
|
return {
|
|
177
177
|
registerAction,
|
|
178
178
|
registerToggleAction,
|
|
@@ -180,8 +180,8 @@ function createMenu({ name: menuName, groups = [] }) {
|
|
|
180
180
|
useMenuItems: useMenuItems5
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
|
-
function createRegisterMenuItem({
|
|
184
|
-
return ({ group = "default",
|
|
183
|
+
function createRegisterMenuItem({ locations, menuGroups, component }) {
|
|
184
|
+
return ({ group = "default", id, overwrite, priority, ...args }) => {
|
|
185
185
|
if (!menuGroups.includes(group)) {
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
@@ -191,10 +191,8 @@ function createRegisterMenuItem({ menuName, menuGroups, component }) {
|
|
|
191
191
|
const componentProps = useProps();
|
|
192
192
|
return /* @__PURE__ */ React8.createElement(Component, { ...props, ...componentProps });
|
|
193
193
|
};
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
location,
|
|
197
|
-
name,
|
|
194
|
+
locations[group].inject({
|
|
195
|
+
id,
|
|
198
196
|
filler: Filler,
|
|
199
197
|
options: {
|
|
200
198
|
priority,
|
|
@@ -203,54 +201,44 @@ function createRegisterMenuItem({ menuName, menuGroups, component }) {
|
|
|
203
201
|
});
|
|
204
202
|
};
|
|
205
203
|
}
|
|
206
|
-
function createUseMenuItems(
|
|
207
|
-
const locations = menuGroups.map((group) => getMenuLocationId(menuName, group));
|
|
204
|
+
function createUseMenuItems(locations) {
|
|
208
205
|
return () => {
|
|
209
|
-
const injectionsGroups = (0, import_locations.useInjectionsOf)(locations);
|
|
210
206
|
return (0, import_react2.useMemo)(() => {
|
|
211
|
-
return
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
...acc,
|
|
215
|
-
[groupName]: injections.map((injection) => ({
|
|
207
|
+
return Object.entries(locations).reduce(
|
|
208
|
+
(carry, [groupName, location]) => {
|
|
209
|
+
const items = location.getInjections().map((injection) => ({
|
|
216
210
|
id: injection.id,
|
|
217
211
|
MenuItem: injection.filler
|
|
218
|
-
}))
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
212
|
+
}));
|
|
213
|
+
return {
|
|
214
|
+
...carry,
|
|
215
|
+
[groupName]: items
|
|
216
|
+
};
|
|
217
|
+
},
|
|
218
|
+
{}
|
|
219
|
+
);
|
|
220
|
+
}, []);
|
|
222
221
|
};
|
|
223
222
|
}
|
|
224
|
-
function getMenuLocationId(menu, group) {
|
|
225
|
-
return `editor/app-bar/${menu}/${group}`;
|
|
226
|
-
}
|
|
227
223
|
|
|
228
224
|
// src/locations/index.ts
|
|
229
225
|
var import_locations2 = require("@elementor/locations");
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
var
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
var
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
var
|
|
245
|
-
|
|
246
|
-
});
|
|
247
|
-
var utilitiesMenu = createMenu({
|
|
248
|
-
name: "utilities"
|
|
249
|
-
});
|
|
250
|
-
var documentOptionsMenu = createMenu({
|
|
251
|
-
name: "document-options",
|
|
252
|
-
groups: ["save"]
|
|
253
|
-
});
|
|
226
|
+
var {
|
|
227
|
+
inject: injectIntoPageIndication,
|
|
228
|
+
Slot: PageIndicationSlot
|
|
229
|
+
} = (0, import_locations2.createLocation)();
|
|
230
|
+
var {
|
|
231
|
+
inject: injectIntoResponsive,
|
|
232
|
+
Slot: ResponsiveSlot
|
|
233
|
+
} = (0, import_locations2.createLocation)();
|
|
234
|
+
var {
|
|
235
|
+
inject: injectIntoPrimaryAction,
|
|
236
|
+
Slot: PrimaryActionSlot
|
|
237
|
+
} = (0, import_locations2.createLocation)();
|
|
238
|
+
var mainMenu = createMenu(["exits"]);
|
|
239
|
+
var toolsMenu = createMenu();
|
|
240
|
+
var utilitiesMenu = createMenu();
|
|
241
|
+
var documentOptionsMenu = createMenu(["save"]);
|
|
254
242
|
|
|
255
243
|
// src/components/app-bar.tsx
|
|
256
244
|
var React19 = __toESM(require("react"));
|
|
@@ -428,23 +416,20 @@ function UtilitiesMenuLocation() {
|
|
|
428
416
|
|
|
429
417
|
// src/components/locations/primary-action-location.tsx
|
|
430
418
|
var React16 = __toESM(require("react"));
|
|
431
|
-
var import_locations6 = require("@elementor/locations");
|
|
432
419
|
function PrimaryActionLocation() {
|
|
433
|
-
return /* @__PURE__ */ React16.createElement(
|
|
420
|
+
return /* @__PURE__ */ React16.createElement(PrimaryActionSlot, null);
|
|
434
421
|
}
|
|
435
422
|
|
|
436
423
|
// src/components/locations/page-indication-location.tsx
|
|
437
424
|
var React17 = __toESM(require("react"));
|
|
438
|
-
var import_locations8 = require("@elementor/locations");
|
|
439
425
|
function PageIndicationLocation() {
|
|
440
|
-
return /* @__PURE__ */ React17.createElement(
|
|
426
|
+
return /* @__PURE__ */ React17.createElement(PageIndicationSlot, null);
|
|
441
427
|
}
|
|
442
428
|
|
|
443
429
|
// src/components/locations/responsive-location.tsx
|
|
444
430
|
var React18 = __toESM(require("react"));
|
|
445
|
-
var import_locations10 = require("@elementor/locations");
|
|
446
431
|
function ResponsiveLocation() {
|
|
447
|
-
return /* @__PURE__ */ React18.createElement(
|
|
432
|
+
return /* @__PURE__ */ React18.createElement(ResponsiveSlot, null);
|
|
448
433
|
}
|
|
449
434
|
|
|
450
435
|
// src/components/app-bar.tsx
|
|
@@ -496,7 +481,7 @@ function SettingsButton() {
|
|
|
496
481
|
// src/extensions/documents-indicator/index.ts
|
|
497
482
|
function init() {
|
|
498
483
|
injectIntoPageIndication({
|
|
499
|
-
|
|
484
|
+
id: "document-settings-button",
|
|
500
485
|
filler: SettingsButton,
|
|
501
486
|
options: {
|
|
502
487
|
priority: 20
|
|
@@ -525,7 +510,7 @@ function useActionProps() {
|
|
|
525
510
|
// src/extensions/documents-preview/index.ts
|
|
526
511
|
function init2() {
|
|
527
512
|
utilitiesMenu.registerAction({
|
|
528
|
-
|
|
513
|
+
id: "document-preview-button",
|
|
529
514
|
priority: 30,
|
|
530
515
|
// After help.
|
|
531
516
|
useProps: useActionProps
|
|
@@ -666,19 +651,19 @@ function isEnabled(document2) {
|
|
|
666
651
|
// src/extensions/documents-save/index.ts
|
|
667
652
|
function init3() {
|
|
668
653
|
injectIntoPrimaryAction({
|
|
669
|
-
|
|
654
|
+
id: "document-primary-action",
|
|
670
655
|
filler: PrimaryAction
|
|
671
656
|
});
|
|
672
657
|
documentOptionsMenu.registerAction({
|
|
673
658
|
group: "save",
|
|
674
|
-
|
|
659
|
+
id: "document-save-draft",
|
|
675
660
|
priority: 10,
|
|
676
661
|
// Before save as template.
|
|
677
662
|
useProps: useDocumentSaveDraftProps
|
|
678
663
|
});
|
|
679
664
|
documentOptionsMenu.registerAction({
|
|
680
665
|
group: "save",
|
|
681
|
-
|
|
666
|
+
id: "document-save-as-template",
|
|
682
667
|
priority: 20,
|
|
683
668
|
// After save draft.
|
|
684
669
|
useProps: useDocumentSaveTemplateProps
|
|
@@ -737,7 +722,7 @@ function useActionProps2() {
|
|
|
737
722
|
function init4() {
|
|
738
723
|
syncPanelTitle();
|
|
739
724
|
toolsMenu.registerToggleAction({
|
|
740
|
-
|
|
725
|
+
id: "open-elements-panel",
|
|
741
726
|
priority: 1,
|
|
742
727
|
useProps: useActionProps2
|
|
743
728
|
});
|
|
@@ -764,7 +749,7 @@ function useActionProps3() {
|
|
|
764
749
|
// src/extensions/finder/index.ts
|
|
765
750
|
function init5() {
|
|
766
751
|
utilitiesMenu.registerToggleAction({
|
|
767
|
-
|
|
752
|
+
id: "toggle-finder",
|
|
768
753
|
priority: 10,
|
|
769
754
|
// Before help.
|
|
770
755
|
useProps: useActionProps3
|
|
@@ -776,7 +761,7 @@ var import_i18n11 = require("@wordpress/i18n");
|
|
|
776
761
|
var import_icons10 = require("@elementor/icons");
|
|
777
762
|
function init6() {
|
|
778
763
|
utilitiesMenu.registerLink({
|
|
779
|
-
|
|
764
|
+
id: "open-help-center",
|
|
780
765
|
priority: 20,
|
|
781
766
|
// After Finder.
|
|
782
767
|
useProps: () => {
|
|
@@ -808,7 +793,7 @@ function useActionProps4() {
|
|
|
808
793
|
// src/extensions/history/index.ts
|
|
809
794
|
function init7() {
|
|
810
795
|
mainMenu.registerToggleAction({
|
|
811
|
-
|
|
796
|
+
id: "open-history",
|
|
812
797
|
priority: 20,
|
|
813
798
|
useProps: useActionProps4
|
|
814
799
|
});
|
|
@@ -829,7 +814,7 @@ function useActionProps5() {
|
|
|
829
814
|
// src/extensions/keyboard-shortcuts/index.ts
|
|
830
815
|
function init8() {
|
|
831
816
|
mainMenu.registerAction({
|
|
832
|
-
|
|
817
|
+
id: "open-keyboard-shortcuts",
|
|
833
818
|
group: "default",
|
|
834
819
|
priority: 40,
|
|
835
820
|
// After user preferences.
|
|
@@ -915,11 +900,11 @@ function useActionProps6() {
|
|
|
915
900
|
// src/extensions/site-settings/index.ts
|
|
916
901
|
function init9() {
|
|
917
902
|
(0, import_editor.injectIntoTop)({
|
|
918
|
-
|
|
903
|
+
id: "site-settings-primary-action-portal",
|
|
919
904
|
filler: PortalledPrimaryAction
|
|
920
905
|
});
|
|
921
906
|
toolsMenu.registerToggleAction({
|
|
922
|
-
|
|
907
|
+
id: "toggle-site-settings",
|
|
923
908
|
priority: 2,
|
|
924
909
|
useProps: useActionProps6
|
|
925
910
|
});
|
|
@@ -943,7 +928,7 @@ function useActionProps7() {
|
|
|
943
928
|
// src/extensions/structure/index.ts
|
|
944
929
|
function init10() {
|
|
945
930
|
toolsMenu.registerToggleAction({
|
|
946
|
-
|
|
931
|
+
id: "toggle-structure-view",
|
|
947
932
|
priority: 3,
|
|
948
933
|
useProps: useActionProps7
|
|
949
934
|
});
|
|
@@ -964,7 +949,7 @@ function useActionProps8() {
|
|
|
964
949
|
// src/extensions/theme-builder/index.ts
|
|
965
950
|
function init11() {
|
|
966
951
|
mainMenu.registerAction({
|
|
967
|
-
|
|
952
|
+
id: "open-theme-builder",
|
|
968
953
|
useProps: useActionProps8
|
|
969
954
|
});
|
|
970
955
|
}
|
|
@@ -987,37 +972,28 @@ function useActionProps9() {
|
|
|
987
972
|
// src/extensions/user-preferences/index.ts
|
|
988
973
|
function init12() {
|
|
989
974
|
mainMenu.registerToggleAction({
|
|
990
|
-
|
|
975
|
+
id: "open-user-preferences",
|
|
991
976
|
priority: 30,
|
|
992
977
|
// After history.
|
|
993
978
|
useProps: useActionProps9
|
|
994
979
|
});
|
|
995
980
|
}
|
|
996
981
|
|
|
997
|
-
// src/env.ts
|
|
998
|
-
var import_env = require("@elementor/env");
|
|
999
|
-
var { env, validateEnv } = (0, import_env.parseEnv)("@elementor/editor-app-bar", (envData) => {
|
|
1000
|
-
if (!isValid(envData)) {
|
|
1001
|
-
throw new import_env.InvalidEnvError("Invalid admin URL");
|
|
1002
|
-
}
|
|
1003
|
-
return envData;
|
|
1004
|
-
});
|
|
1005
|
-
function isValid(subject) {
|
|
1006
|
-
return "admin_url" in subject && typeof subject.admin_url === "string";
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
982
|
// src/extensions/wordpress/index.ts
|
|
1010
983
|
var import_i18n19 = require("@wordpress/i18n");
|
|
1011
984
|
var import_icons17 = require("@elementor/icons");
|
|
985
|
+
var import_editor_documents7 = require("@elementor/editor-documents");
|
|
1012
986
|
function init13() {
|
|
1013
987
|
mainMenu.registerLink({
|
|
1014
|
-
|
|
988
|
+
id: "exit-to-wordpress",
|
|
1015
989
|
group: "exits",
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
990
|
+
useProps: () => {
|
|
991
|
+
const document2 = (0, import_editor_documents7.useActiveDocument)();
|
|
992
|
+
return {
|
|
993
|
+
title: (0, import_i18n19.__)("Exit to WordPress", "elementor"),
|
|
994
|
+
href: document2?.links?.platformEdit,
|
|
995
|
+
icon: import_icons17.WordpressIcon
|
|
996
|
+
};
|
|
1021
997
|
}
|
|
1022
998
|
});
|
|
1023
999
|
}
|
|
@@ -1041,11 +1017,10 @@ function init14() {
|
|
|
1041
1017
|
|
|
1042
1018
|
// src/init.ts
|
|
1043
1019
|
function init15() {
|
|
1044
|
-
validateEnv();
|
|
1045
1020
|
redirectOldMenus();
|
|
1046
1021
|
init14();
|
|
1047
1022
|
(0, import_editor2.injectIntoTop)({
|
|
1048
|
-
|
|
1023
|
+
id: "app-bar",
|
|
1049
1024
|
filler: AppBar
|
|
1050
1025
|
});
|
|
1051
1026
|
}
|