@elementor/editor-site-navigation 0.18.1 → 0.18.3
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/README.md +1 -2
- package/dist/index.js +63 -20
- package/dist/index.mjs +86 -43
- package/package.json +3 -3
- package/src/components/panel/actions-menu/action-menu-item.tsx +1 -3
- package/src/components/top-bar/chip-doc-type.tsx +3 -1
- package/src/components/top-bar/create-post-list-item.tsx +15 -9
- package/src/components/top-bar/indicator.tsx +3 -3
- package/src/components/top-bar/post-list-item.tsx +19 -8
- package/src/components/top-bar/recently-edited.tsx +24 -15
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.18.3](https://github.com/elementor/elementor-packages/compare/@elementor/editor-site-navigation@0.18.2...@elementor/editor-site-navigation@0.18.3) (2023-08-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **editor-site-navigation:** noWrap for the post title [ED-11626] ([#102](https://github.com/elementor/elementor-packages/issues/102)) ([d4e1a54](https://github.com/elementor/elementor-packages/commit/d4e1a547cb9ff91c42eb7efe4ce8cfadb54a2922))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.18.2](https://github.com/elementor/elementor-packages/compare/@elementor/editor-site-navigation@0.18.1...@elementor/editor-site-navigation@0.18.2) (2023-08-16)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @elementor/editor-site-navigation
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.18.1](https://github.com/elementor/elementor-packages/compare/@elementor/editor-site-navigation@0.18.0...@elementor/editor-site-navigation@0.18.1) (2023-08-02)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @elementor/editor-site-navigation
|
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -61,7 +61,7 @@ var import_editor_documents3 = require("@elementor/editor-documents");
|
|
|
61
61
|
var React = __toESM(require("react"));
|
|
62
62
|
var import_ui = require("@elementor/ui");
|
|
63
63
|
function Indicator({ title, status }) {
|
|
64
|
-
return /* @__PURE__ */ React.createElement(Tooltip, { title }, /* @__PURE__ */ React.createElement(import_ui.Stack, { direction: "row", alignItems: "center", spacing: 2 }, /* @__PURE__ */ React.createElement(import_ui.Typography, { variant: "body2", sx: { maxWidth: "120px" }, noWrap: true }, title), status.value !== "publish" && /* @__PURE__ */ React.createElement(import_ui.Typography, { variant: "body2", sx: { fontStyle: "italic" } }, "(", status.label, ")")));
|
|
64
|
+
return /* @__PURE__ */ React.createElement(Tooltip, { title }, /* @__PURE__ */ React.createElement(import_ui.Stack, { component: "span", direction: "row", alignItems: "center", spacing: 2 }, /* @__PURE__ */ React.createElement(import_ui.Typography, { component: "span", variant: "body2", sx: { maxWidth: "120px" }, noWrap: true }, title), status.value !== "publish" && /* @__PURE__ */ React.createElement(import_ui.Typography, { component: "span", variant: "body2", sx: { fontStyle: "italic" } }, "(", status.label, ")")));
|
|
65
65
|
}
|
|
66
66
|
function Tooltip(props) {
|
|
67
67
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -125,12 +125,14 @@ function DocTypeChip({ postType, docType, label }) {
|
|
|
125
125
|
return /* @__PURE__ */ React2.createElement(
|
|
126
126
|
import_ui2.Chip,
|
|
127
127
|
{
|
|
128
|
+
component: "span",
|
|
128
129
|
size: "medium",
|
|
129
130
|
variant: "standard",
|
|
130
131
|
label,
|
|
132
|
+
"data-value": docType,
|
|
131
133
|
color,
|
|
132
134
|
icon: /* @__PURE__ */ React2.createElement(Icon, null),
|
|
133
|
-
sx: { ml: 3 }
|
|
135
|
+
sx: { ml: 3, cursor: "inherit" }
|
|
134
136
|
}
|
|
135
137
|
);
|
|
136
138
|
}
|
|
@@ -153,13 +155,35 @@ function useReverseHtmlEntities(escapedHTML = "") {
|
|
|
153
155
|
}
|
|
154
156
|
|
|
155
157
|
// src/components/top-bar/post-list-item.tsx
|
|
156
|
-
function PostListItem({ post, closePopup }) {
|
|
158
|
+
function PostListItem({ post, closePopup, ...props }) {
|
|
157
159
|
const navigateToDocument = (0, import_editor_documents.useNavigateToDocument)();
|
|
158
160
|
const postTitle = useReverseHtmlEntities(post.title);
|
|
159
|
-
return /* @__PURE__ */ React3.createElement(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
return /* @__PURE__ */ React3.createElement(
|
|
162
|
+
import_ui3.MenuItem,
|
|
163
|
+
{
|
|
164
|
+
onClick: async () => {
|
|
165
|
+
closePopup();
|
|
166
|
+
await navigateToDocument(post.id);
|
|
167
|
+
},
|
|
168
|
+
...props
|
|
169
|
+
},
|
|
170
|
+
/* @__PURE__ */ React3.createElement(
|
|
171
|
+
import_ui3.ListItemText,
|
|
172
|
+
{
|
|
173
|
+
sx: { flexGrow: 0 },
|
|
174
|
+
primaryTypographyProps: { noWrap: true },
|
|
175
|
+
primary: postTitle
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
/* @__PURE__ */ React3.createElement(
|
|
179
|
+
DocTypeChip,
|
|
180
|
+
{
|
|
181
|
+
postType: post.type.post_type,
|
|
182
|
+
docType: post.type.doc_type,
|
|
183
|
+
label: post.type.label
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
);
|
|
163
187
|
}
|
|
164
188
|
|
|
165
189
|
// src/components/top-bar/create-post-list-item.tsx
|
|
@@ -192,14 +216,22 @@ async function addNewPage() {
|
|
|
192
216
|
var import_icons3 = require("@elementor/icons");
|
|
193
217
|
var import_i18n = require("@wordpress/i18n");
|
|
194
218
|
var import_editor_documents2 = require("@elementor/editor-documents");
|
|
195
|
-
function CreatePostListItem({ closePopup }) {
|
|
219
|
+
function CreatePostListItem({ closePopup, ...props }) {
|
|
196
220
|
const { create, isLoading } = useCreatePage();
|
|
197
221
|
const navigateToDocument = (0, import_editor_documents2.useNavigateToDocument)();
|
|
198
|
-
return /* @__PURE__ */ React4.createElement(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
222
|
+
return /* @__PURE__ */ React4.createElement(
|
|
223
|
+
import_ui4.MenuItem,
|
|
224
|
+
{
|
|
225
|
+
onClick: async () => {
|
|
226
|
+
const { id } = await create();
|
|
227
|
+
closePopup();
|
|
228
|
+
await navigateToDocument(id);
|
|
229
|
+
},
|
|
230
|
+
...props
|
|
231
|
+
},
|
|
232
|
+
/* @__PURE__ */ React4.createElement(import_ui4.ListItemIcon, null, isLoading ? /* @__PURE__ */ React4.createElement(import_ui4.CircularProgress, null) : /* @__PURE__ */ React4.createElement(import_icons3.PlusIcon, null)),
|
|
233
|
+
/* @__PURE__ */ React4.createElement(import_ui4.ListItemText, { primary: (0, import_i18n.__)("Add new page", "elementor") })
|
|
234
|
+
);
|
|
203
235
|
}
|
|
204
236
|
|
|
205
237
|
// src/components/top-bar/recently-edited.tsx
|
|
@@ -216,7 +248,7 @@ function RecentlyEdited() {
|
|
|
216
248
|
if (!document2) {
|
|
217
249
|
return null;
|
|
218
250
|
}
|
|
219
|
-
return /* @__PURE__ */ React5.createElement(
|
|
251
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
|
|
220
252
|
import_ui5.Button,
|
|
221
253
|
{
|
|
222
254
|
color: "inherit",
|
|
@@ -234,14 +266,25 @@ function RecentlyEdited() {
|
|
|
234
266
|
), /* @__PURE__ */ React5.createElement(
|
|
235
267
|
import_ui5.Menu,
|
|
236
268
|
{
|
|
237
|
-
MenuListProps: {
|
|
238
|
-
|
|
269
|
+
MenuListProps: {
|
|
270
|
+
dense: true,
|
|
271
|
+
subheader: /* @__PURE__ */ React5.createElement(import_ui5.ListSubheader, { sx: { fontStyle: "italic", fontWeight: "300" } }, (0, import_i18n2.__)("Recent", "elementor"))
|
|
272
|
+
},
|
|
273
|
+
PaperProps: { sx: { mt: 4, width: 320 } },
|
|
239
274
|
...(0, import_ui5.bindMenu)(popupState)
|
|
240
275
|
},
|
|
241
|
-
/* @__PURE__ */ React5.createElement(import_ui5.ListSubheader, { sx: { fontSize: 12, fontStyle: "italic", pl: 4 }, component: "div", id: "nested-list-subheader" }, (0, import_i18n2.__)("Recent", "elementor")),
|
|
242
276
|
recentPosts.map((post) => /* @__PURE__ */ React5.createElement(PostListItem, { key: post.id, post, closePopup: popupState.close })),
|
|
243
|
-
recentPosts.length === 0 && /* @__PURE__ */ React5.createElement(import_ui5.
|
|
244
|
-
|
|
277
|
+
recentPosts.length === 0 && /* @__PURE__ */ React5.createElement(import_ui5.MenuItem, { disabled: true }, /* @__PURE__ */ React5.createElement(
|
|
278
|
+
import_ui5.ListItemText,
|
|
279
|
+
{
|
|
280
|
+
primaryTypographyProps: {
|
|
281
|
+
variant: "caption",
|
|
282
|
+
fontStyle: "italic"
|
|
283
|
+
},
|
|
284
|
+
primary: (0, import_i18n2.__)("There are no other pages or templates on this site yet.", "elementor")
|
|
285
|
+
}
|
|
286
|
+
)),
|
|
287
|
+
/* @__PURE__ */ React5.createElement(import_ui5.Divider, { disabled: recentPosts.length === 0 }),
|
|
245
288
|
/* @__PURE__ */ React5.createElement(CreatePostListItem, { closePopup: popupState.close })
|
|
246
289
|
));
|
|
247
290
|
}
|
|
@@ -656,7 +699,7 @@ function ActionMenuItem({ title, icon: Icon, ListItemButtonProps }) {
|
|
|
656
699
|
...ListItemButtonProps
|
|
657
700
|
},
|
|
658
701
|
/* @__PURE__ */ React13.createElement(import_ui9.ListItemIcon, null, /* @__PURE__ */ React13.createElement(Icon, null)),
|
|
659
|
-
/* @__PURE__ */ React13.createElement(import_ui9.ListItemText,
|
|
702
|
+
/* @__PURE__ */ React13.createElement(import_ui9.ListItemText, { primary: title })
|
|
660
703
|
));
|
|
661
704
|
}
|
|
662
705
|
|
package/dist/index.mjs
CHANGED
|
@@ -29,10 +29,10 @@ import {
|
|
|
29
29
|
bindTrigger,
|
|
30
30
|
Menu,
|
|
31
31
|
Button,
|
|
32
|
-
Box,
|
|
33
32
|
ListSubheader,
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
Divider,
|
|
34
|
+
ListItemText as ListItemText3,
|
|
35
|
+
MenuItem as MenuItem3
|
|
36
36
|
} from "@elementor/ui";
|
|
37
37
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
38
38
|
import { useActiveDocument, useHostDocument } from "@elementor/editor-documents";
|
|
@@ -41,7 +41,7 @@ import { useActiveDocument, useHostDocument } from "@elementor/editor-documents"
|
|
|
41
41
|
import * as React from "react";
|
|
42
42
|
import { Typography, Stack, Tooltip as BaseTooltip } from "@elementor/ui";
|
|
43
43
|
function Indicator({ title, status }) {
|
|
44
|
-
return /* @__PURE__ */ React.createElement(Tooltip, { title }, /* @__PURE__ */ React.createElement(Stack, { direction: "row", alignItems: "center", spacing: 2 }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2", sx: { maxWidth: "120px" }, noWrap: true }, title), status.value !== "publish" && /* @__PURE__ */ React.createElement(Typography, { variant: "body2", sx: { fontStyle: "italic" } }, "(", status.label, ")")));
|
|
44
|
+
return /* @__PURE__ */ React.createElement(Tooltip, { title }, /* @__PURE__ */ React.createElement(Stack, { component: "span", direction: "row", alignItems: "center", spacing: 2 }, /* @__PURE__ */ React.createElement(Typography, { component: "span", variant: "body2", sx: { maxWidth: "120px" }, noWrap: true }, title), status.value !== "publish" && /* @__PURE__ */ React.createElement(Typography, { component: "span", variant: "body2", sx: { fontStyle: "italic" } }, "(", status.label, ")")));
|
|
45
45
|
}
|
|
46
46
|
function Tooltip(props) {
|
|
47
47
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -107,18 +107,20 @@ function DocTypeChip({ postType, docType, label }) {
|
|
|
107
107
|
return /* @__PURE__ */ React2.createElement(
|
|
108
108
|
Chip,
|
|
109
109
|
{
|
|
110
|
+
component: "span",
|
|
110
111
|
size: "medium",
|
|
111
112
|
variant: "standard",
|
|
112
113
|
label,
|
|
114
|
+
"data-value": docType,
|
|
113
115
|
color,
|
|
114
116
|
icon: /* @__PURE__ */ React2.createElement(Icon, null),
|
|
115
|
-
sx: { ml: 3 }
|
|
117
|
+
sx: { ml: 3, cursor: "inherit" }
|
|
116
118
|
}
|
|
117
119
|
);
|
|
118
120
|
}
|
|
119
121
|
|
|
120
122
|
// src/components/top-bar/post-list-item.tsx
|
|
121
|
-
import { MenuItem } from "@elementor/ui";
|
|
123
|
+
import { MenuItem, ListItemText } from "@elementor/ui";
|
|
122
124
|
import * as React3 from "react";
|
|
123
125
|
import { useNavigateToDocument } from "@elementor/editor-documents";
|
|
124
126
|
|
|
@@ -135,17 +137,39 @@ function useReverseHtmlEntities(escapedHTML = "") {
|
|
|
135
137
|
}
|
|
136
138
|
|
|
137
139
|
// src/components/top-bar/post-list-item.tsx
|
|
138
|
-
function PostListItem({ post, closePopup }) {
|
|
140
|
+
function PostListItem({ post, closePopup, ...props }) {
|
|
139
141
|
const navigateToDocument = useNavigateToDocument();
|
|
140
142
|
const postTitle = useReverseHtmlEntities(post.title);
|
|
141
|
-
return /* @__PURE__ */ React3.createElement(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
return /* @__PURE__ */ React3.createElement(
|
|
144
|
+
MenuItem,
|
|
145
|
+
{
|
|
146
|
+
onClick: async () => {
|
|
147
|
+
closePopup();
|
|
148
|
+
await navigateToDocument(post.id);
|
|
149
|
+
},
|
|
150
|
+
...props
|
|
151
|
+
},
|
|
152
|
+
/* @__PURE__ */ React3.createElement(
|
|
153
|
+
ListItemText,
|
|
154
|
+
{
|
|
155
|
+
sx: { flexGrow: 0 },
|
|
156
|
+
primaryTypographyProps: { noWrap: true },
|
|
157
|
+
primary: postTitle
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
/* @__PURE__ */ React3.createElement(
|
|
161
|
+
DocTypeChip,
|
|
162
|
+
{
|
|
163
|
+
postType: post.type.post_type,
|
|
164
|
+
docType: post.type.doc_type,
|
|
165
|
+
label: post.type.label
|
|
166
|
+
}
|
|
167
|
+
)
|
|
168
|
+
);
|
|
145
169
|
}
|
|
146
170
|
|
|
147
171
|
// src/components/top-bar/create-post-list-item.tsx
|
|
148
|
-
import { CircularProgress, ListItemIcon, MenuItem as MenuItem2 } from "@elementor/ui";
|
|
172
|
+
import { CircularProgress, ListItemIcon, ListItemText as ListItemText2, MenuItem as MenuItem2 } from "@elementor/ui";
|
|
149
173
|
import * as React4 from "react";
|
|
150
174
|
|
|
151
175
|
// src/hooks/use-create-page.ts
|
|
@@ -174,14 +198,22 @@ async function addNewPage() {
|
|
|
174
198
|
import { PlusIcon } from "@elementor/icons";
|
|
175
199
|
import { __ } from "@wordpress/i18n";
|
|
176
200
|
import { useNavigateToDocument as useNavigateToDocument2 } from "@elementor/editor-documents";
|
|
177
|
-
function CreatePostListItem({ closePopup }) {
|
|
201
|
+
function CreatePostListItem({ closePopup, ...props }) {
|
|
178
202
|
const { create, isLoading } = useCreatePage();
|
|
179
203
|
const navigateToDocument = useNavigateToDocument2();
|
|
180
|
-
return /* @__PURE__ */ React4.createElement(
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
204
|
+
return /* @__PURE__ */ React4.createElement(
|
|
205
|
+
MenuItem2,
|
|
206
|
+
{
|
|
207
|
+
onClick: async () => {
|
|
208
|
+
const { id } = await create();
|
|
209
|
+
closePopup();
|
|
210
|
+
await navigateToDocument(id);
|
|
211
|
+
},
|
|
212
|
+
...props
|
|
213
|
+
},
|
|
214
|
+
/* @__PURE__ */ React4.createElement(ListItemIcon, null, isLoading ? /* @__PURE__ */ React4.createElement(CircularProgress, null) : /* @__PURE__ */ React4.createElement(PlusIcon, null)),
|
|
215
|
+
/* @__PURE__ */ React4.createElement(ListItemText2, { primary: __("Add new page", "elementor") })
|
|
216
|
+
);
|
|
185
217
|
}
|
|
186
218
|
|
|
187
219
|
// src/components/top-bar/recently-edited.tsx
|
|
@@ -198,7 +230,7 @@ function RecentlyEdited() {
|
|
|
198
230
|
if (!document2) {
|
|
199
231
|
return null;
|
|
200
232
|
}
|
|
201
|
-
return /* @__PURE__ */ React5.createElement(
|
|
233
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
|
|
202
234
|
Button,
|
|
203
235
|
{
|
|
204
236
|
color: "inherit",
|
|
@@ -216,14 +248,25 @@ function RecentlyEdited() {
|
|
|
216
248
|
), /* @__PURE__ */ React5.createElement(
|
|
217
249
|
Menu,
|
|
218
250
|
{
|
|
219
|
-
MenuListProps: {
|
|
220
|
-
|
|
251
|
+
MenuListProps: {
|
|
252
|
+
dense: true,
|
|
253
|
+
subheader: /* @__PURE__ */ React5.createElement(ListSubheader, { sx: { fontStyle: "italic", fontWeight: "300" } }, __2("Recent", "elementor"))
|
|
254
|
+
},
|
|
255
|
+
PaperProps: { sx: { mt: 4, width: 320 } },
|
|
221
256
|
...bindMenu(popupState)
|
|
222
257
|
},
|
|
223
|
-
/* @__PURE__ */ React5.createElement(ListSubheader, { sx: { fontSize: 12, fontStyle: "italic", pl: 4 }, component: "div", id: "nested-list-subheader" }, __2("Recent", "elementor")),
|
|
224
258
|
recentPosts.map((post) => /* @__PURE__ */ React5.createElement(PostListItem, { key: post.id, post, closePopup: popupState.close })),
|
|
225
|
-
recentPosts.length === 0 && /* @__PURE__ */ React5.createElement(
|
|
226
|
-
|
|
259
|
+
recentPosts.length === 0 && /* @__PURE__ */ React5.createElement(MenuItem3, { disabled: true }, /* @__PURE__ */ React5.createElement(
|
|
260
|
+
ListItemText3,
|
|
261
|
+
{
|
|
262
|
+
primaryTypographyProps: {
|
|
263
|
+
variant: "caption",
|
|
264
|
+
fontStyle: "italic"
|
|
265
|
+
},
|
|
266
|
+
primary: __2("There are no other pages or templates on this site yet.", "elementor")
|
|
267
|
+
}
|
|
268
|
+
)),
|
|
269
|
+
/* @__PURE__ */ React5.createElement(Divider, { disabled: recentPosts.length === 0 }),
|
|
227
270
|
/* @__PURE__ */ React5.createElement(CreatePostListItem, { closePopup: popupState.close })
|
|
228
271
|
));
|
|
229
272
|
}
|
|
@@ -246,7 +289,7 @@ import { __ as __14 } from "@wordpress/i18n";
|
|
|
246
289
|
// src/components/panel/posts-list/posts-collapsible-list.tsx
|
|
247
290
|
import * as React22 from "react";
|
|
248
291
|
import { PageTypeIcon as PageTypeIcon2 } from "@elementor/icons";
|
|
249
|
-
import { Skeleton, Box as
|
|
292
|
+
import { Skeleton, Box as Box3, List as List2 } from "@elementor/ui";
|
|
250
293
|
|
|
251
294
|
// src/hooks/use-posts.ts
|
|
252
295
|
import { useQuery } from "@elementor/query";
|
|
@@ -356,7 +399,7 @@ function usePostListContext() {
|
|
|
356
399
|
// src/components/panel/posts-list/collapsible-list.tsx
|
|
357
400
|
import * as React7 from "react";
|
|
358
401
|
import { useState as useState4 } from "react";
|
|
359
|
-
import { Collapse, IconButton, List, ListItem, ListItemIcon as ListItemIcon2, ListItemText, styled, Divider as Divider2 } from "@elementor/ui";
|
|
402
|
+
import { Collapse, IconButton, List, ListItem, ListItemIcon as ListItemIcon2, ListItemText as ListItemText4, styled, Divider as Divider2 } from "@elementor/ui";
|
|
360
403
|
import { ChevronDownIcon as ChevronDownIcon2 } from "@elementor/icons";
|
|
361
404
|
var RotateIcon = styled(ChevronDownIcon2, {
|
|
362
405
|
shouldForwardProp: (prop) => prop !== "isOpen"
|
|
@@ -381,7 +424,7 @@ function CollapsibleList({
|
|
|
381
424
|
size: "small"
|
|
382
425
|
},
|
|
383
426
|
/* @__PURE__ */ React7.createElement(RotateIcon, { fontSize: "small", isOpen })
|
|
384
|
-
)), /* @__PURE__ */ React7.createElement(ListItemIcon2, null, /* @__PURE__ */ React7.createElement(Icon, null)), /* @__PURE__ */ React7.createElement(
|
|
427
|
+
)), /* @__PURE__ */ React7.createElement(ListItemIcon2, null, /* @__PURE__ */ React7.createElement(Icon, null)), /* @__PURE__ */ React7.createElement(ListItemText4, { primaryTypographyProps: { variant: "subtitle1", component: "span", sx: { fontWeight: "bold" } }, primary: label })), /* @__PURE__ */ React7.createElement(
|
|
385
428
|
Collapse,
|
|
386
429
|
{
|
|
387
430
|
in: isOpen,
|
|
@@ -438,7 +481,7 @@ function useInvalidatePosts(postTypeSlug) {
|
|
|
438
481
|
import * as React8 from "react";
|
|
439
482
|
import { useState as useState5, useRef } from "react";
|
|
440
483
|
import {
|
|
441
|
-
Box
|
|
484
|
+
Box,
|
|
442
485
|
ListItem as ListItem2,
|
|
443
486
|
TextField,
|
|
444
487
|
IconButton as IconButton2,
|
|
@@ -480,7 +523,7 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
|
480
523
|
sx: { pt: 1, pl: 0 },
|
|
481
524
|
secondaryAction: /* @__PURE__ */ React8.createElement(CloseButton, { isLoading, closeButton })
|
|
482
525
|
},
|
|
483
|
-
/* @__PURE__ */ React8.createElement(
|
|
526
|
+
/* @__PURE__ */ React8.createElement(Box, { width: "100%", sx: { ml: 4, pr: 3 }, component: "form", onSubmit: onFormSubmit }, /* @__PURE__ */ React8.createElement(
|
|
484
527
|
TextField,
|
|
485
528
|
{
|
|
486
529
|
autoFocus: true,
|
|
@@ -589,7 +632,7 @@ import {
|
|
|
589
632
|
ListItem as ListItem3,
|
|
590
633
|
ListItemButton as ListItemButton2,
|
|
591
634
|
ListItemIcon as ListItemIcon4,
|
|
592
|
-
ListItemText as
|
|
635
|
+
ListItemText as ListItemText6,
|
|
593
636
|
Menu as Menu2,
|
|
594
637
|
ToggleButton,
|
|
595
638
|
usePopupState as usePopupState2
|
|
@@ -599,13 +642,13 @@ import { useActiveDocument as useActiveDocument3, useNavigateToDocument as useNa
|
|
|
599
642
|
|
|
600
643
|
// src/components/shared/page-title-and-status.tsx
|
|
601
644
|
import * as React12 from "react";
|
|
602
|
-
import { Box as
|
|
645
|
+
import { Box as Box2, Typography as Typography2 } from "@elementor/ui";
|
|
603
646
|
var PageStatus = ({ status }) => {
|
|
604
647
|
if ("publish" === status) {
|
|
605
648
|
return null;
|
|
606
649
|
}
|
|
607
650
|
return /* @__PURE__ */ React12.createElement(
|
|
608
|
-
|
|
651
|
+
Typography2,
|
|
609
652
|
{
|
|
610
653
|
component: "span",
|
|
611
654
|
variant: "body2",
|
|
@@ -624,7 +667,7 @@ var PageStatus = ({ status }) => {
|
|
|
624
667
|
var PageTitle = ({ title }) => {
|
|
625
668
|
const modifiedTitle = useReverseHtmlEntities(title);
|
|
626
669
|
return /* @__PURE__ */ React12.createElement(
|
|
627
|
-
|
|
670
|
+
Typography2,
|
|
628
671
|
{
|
|
629
672
|
component: "span",
|
|
630
673
|
variant: "body2",
|
|
@@ -637,7 +680,7 @@ var PageTitle = ({ title }) => {
|
|
|
637
680
|
);
|
|
638
681
|
};
|
|
639
682
|
function PageTitleAndStatus({ page }) {
|
|
640
|
-
return /* @__PURE__ */ React12.createElement(
|
|
683
|
+
return /* @__PURE__ */ React12.createElement(Box2, { display: "flex" }, /* @__PURE__ */ React12.createElement(PageTitle, { title: page.title.rendered }), "\xA0", /* @__PURE__ */ React12.createElement(PageStatus, { status: page.status }));
|
|
641
684
|
}
|
|
642
685
|
|
|
643
686
|
// src/components/panel/actions-menu/actions/rename.tsx
|
|
@@ -650,17 +693,17 @@ import * as React13 from "react";
|
|
|
650
693
|
import {
|
|
651
694
|
ListItemButton,
|
|
652
695
|
ListItemIcon as ListItemIcon3,
|
|
653
|
-
ListItemText as
|
|
654
|
-
MenuItem as
|
|
696
|
+
ListItemText as ListItemText5,
|
|
697
|
+
MenuItem as MenuItem4
|
|
655
698
|
} from "@elementor/ui";
|
|
656
699
|
function ActionMenuItem({ title, icon: Icon, ListItemButtonProps }) {
|
|
657
|
-
return /* @__PURE__ */ React13.createElement(
|
|
700
|
+
return /* @__PURE__ */ React13.createElement(MenuItem4, { disableGutters: true }, /* @__PURE__ */ React13.createElement(
|
|
658
701
|
ListItemButton,
|
|
659
702
|
{
|
|
660
703
|
...ListItemButtonProps
|
|
661
704
|
},
|
|
662
705
|
/* @__PURE__ */ React13.createElement(ListItemIcon3, null, /* @__PURE__ */ React13.createElement(Icon, null)),
|
|
663
|
-
/* @__PURE__ */ React13.createElement(
|
|
706
|
+
/* @__PURE__ */ React13.createElement(ListItemText5, { primary: title })
|
|
664
707
|
));
|
|
665
708
|
}
|
|
666
709
|
|
|
@@ -909,7 +952,7 @@ function ListItemView({ post }) {
|
|
|
909
952
|
},
|
|
910
953
|
/* @__PURE__ */ React19.createElement(ListItemIcon4, null),
|
|
911
954
|
/* @__PURE__ */ React19.createElement(
|
|
912
|
-
|
|
955
|
+
ListItemText6,
|
|
913
956
|
{
|
|
914
957
|
disableTypography: true
|
|
915
958
|
},
|
|
@@ -978,21 +1021,21 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
978
1021
|
const { data: posts, isLoading: postsLoading } = usePosts(type);
|
|
979
1022
|
const { data: homepageSettings } = useHomepage();
|
|
980
1023
|
if (!posts || postsLoading) {
|
|
981
|
-
return /* @__PURE__ */ React22.createElement(
|
|
982
|
-
|
|
1024
|
+
return /* @__PURE__ */ React22.createElement(Box3, { sx: { px: 5 } }, /* @__PURE__ */ React22.createElement(
|
|
1025
|
+
Box3,
|
|
983
1026
|
{
|
|
984
1027
|
display: "flex",
|
|
985
1028
|
justifyContent: "flex-end",
|
|
986
1029
|
alignItems: "center"
|
|
987
1030
|
},
|
|
988
1031
|
/* @__PURE__ */ React22.createElement(Skeleton, { sx: { my: 4 }, animation: "wave", variant: "rounded", width: "110px", height: "28px" })
|
|
989
|
-
), /* @__PURE__ */ React22.createElement(
|
|
1032
|
+
), /* @__PURE__ */ React22.createElement(Box3, null, /* @__PURE__ */ React22.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "100%", height: "24px" }), /* @__PURE__ */ React22.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React22.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React22.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" })));
|
|
990
1033
|
}
|
|
991
1034
|
const label = `${postTypesMap[type].labels.plural_name} (${posts.length.toString()})`;
|
|
992
1035
|
const isHomepageSet = homepageSettings?.show_on_front === "page" && !!homepageSettings?.page_on_front;
|
|
993
1036
|
const homepageId = isHomepageSet ? homepageSettings.page_on_front : null;
|
|
994
1037
|
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(
|
|
995
|
-
|
|
1038
|
+
Box3,
|
|
996
1039
|
{
|
|
997
1040
|
display: "flex",
|
|
998
1041
|
justifyContent: "flex-end",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-site-navigation",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@elementor/editor-app-bar": "^0.7.
|
|
35
|
+
"@elementor/editor-app-bar": "^0.7.2",
|
|
36
36
|
"@elementor/editor-documents": "^0.8.3",
|
|
37
37
|
"@elementor/editor-panels": "^0.2.1",
|
|
38
38
|
"@elementor/env": "^0.2.0",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"elementor": {
|
|
50
50
|
"type": "extension"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "363ef377d04515fd96976149cb33e36bc0864351"
|
|
53
53
|
}
|
|
@@ -23,9 +23,7 @@ export default function ActionMenuItem( { title, icon: Icon, ListItemButtonProps
|
|
|
23
23
|
<ListItemIcon>
|
|
24
24
|
<Icon />
|
|
25
25
|
</ListItemIcon>
|
|
26
|
-
<ListItemText
|
|
27
|
-
{ title }
|
|
28
|
-
</ListItemText>
|
|
26
|
+
<ListItemText primary={ title } />
|
|
29
27
|
</ListItemButton>
|
|
30
28
|
</MenuItem>
|
|
31
29
|
);
|
|
@@ -19,12 +19,14 @@ export default function DocTypeChip( { postType, docType, label }: Props ) {
|
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
21
|
<Chip
|
|
22
|
+
component="span"
|
|
22
23
|
size="medium"
|
|
23
24
|
variant="standard"
|
|
24
25
|
label={ label }
|
|
26
|
+
data-value={ docType }
|
|
25
27
|
color={ color }
|
|
26
28
|
icon={ <Icon /> }
|
|
27
|
-
sx={ { ml: 3 } }
|
|
29
|
+
sx={ { ml: 3, cursor: 'inherit' } }
|
|
28
30
|
/>
|
|
29
31
|
);
|
|
30
32
|
}
|
|
@@ -1,26 +1,32 @@
|
|
|
1
|
-
import { CircularProgress, ListItemIcon, MenuItem } from '@elementor/ui';
|
|
1
|
+
import { CircularProgress, ListItemIcon, ListItemText, MenuItem, MenuItemProps } from '@elementor/ui';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useCreatePage from '../../hooks/use-create-page';
|
|
4
4
|
import { PlusIcon } from '@elementor/icons';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
import { useNavigateToDocument } from '@elementor/editor-documents';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
type Props = MenuItemProps & {
|
|
9
|
+
closePopup: () => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function CreatePostListItem( { closePopup, ...props }: Props ) {
|
|
9
13
|
const { create, isLoading } = useCreatePage();
|
|
10
14
|
const navigateToDocument = useNavigateToDocument();
|
|
11
15
|
|
|
12
16
|
return (
|
|
13
|
-
<MenuItem
|
|
14
|
-
|
|
17
|
+
<MenuItem
|
|
18
|
+
onClick={ async () => {
|
|
19
|
+
const { id } = await create();
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
closePopup();
|
|
22
|
+
await navigateToDocument( id );
|
|
23
|
+
} }
|
|
24
|
+
{ ...props }
|
|
25
|
+
>
|
|
19
26
|
<ListItemIcon>
|
|
20
27
|
{ isLoading ? <CircularProgress /> : <PlusIcon /> }
|
|
21
28
|
</ListItemIcon>
|
|
22
|
-
|
|
23
|
-
{ __( 'Add new page', 'elementor' ) }
|
|
29
|
+
<ListItemText primary={ __( 'Add new page', 'elementor' ) } />
|
|
24
30
|
</MenuItem>
|
|
25
31
|
);
|
|
26
32
|
}
|
|
@@ -10,12 +10,12 @@ type Props = {
|
|
|
10
10
|
export default function Indicator( { title, status }: Props ) {
|
|
11
11
|
return (
|
|
12
12
|
<Tooltip title={ title }>
|
|
13
|
-
<Stack direction="row" alignItems="center" spacing={ 2 }>
|
|
14
|
-
<Typography variant="body2" sx={ { maxWidth: '120px' } } noWrap>
|
|
13
|
+
<Stack component="span" direction="row" alignItems="center" spacing={ 2 }>
|
|
14
|
+
<Typography component="span" variant="body2" sx={ { maxWidth: '120px' } } noWrap>
|
|
15
15
|
{ title }
|
|
16
16
|
</Typography>
|
|
17
17
|
{ status.value !== 'publish' &&
|
|
18
|
-
<Typography variant="body2" sx={ { fontStyle: 'italic' } }>
|
|
18
|
+
<Typography component="span" variant="body2" sx={ { fontStyle: 'italic' } }>
|
|
19
19
|
({ status.label })
|
|
20
20
|
</Typography>
|
|
21
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import DocTypeChip from './chip-doc-type';
|
|
2
|
-
import { MenuItem, MenuItemProps } from '@elementor/ui';
|
|
2
|
+
import { MenuItem, MenuItemProps, ListItemText } from '@elementor/ui';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { Post } from '../../hooks/use-recent-posts';
|
|
5
5
|
import { useNavigateToDocument } from '@elementor/editor-documents';
|
|
@@ -10,17 +10,28 @@ type Props = MenuItemProps & {
|
|
|
10
10
|
closePopup: () => void;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export function PostListItem( { post, closePopup }: Props ) {
|
|
13
|
+
export function PostListItem( { post, closePopup, ...props }: Props ) {
|
|
14
14
|
const navigateToDocument = useNavigateToDocument();
|
|
15
15
|
const postTitle = useReverseHtmlEntities( post.title );
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
|
-
<MenuItem
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
<MenuItem
|
|
19
|
+
onClick={ async () => {
|
|
20
|
+
closePopup();
|
|
21
|
+
await navigateToDocument( post.id );
|
|
22
|
+
} }
|
|
23
|
+
{ ...props }
|
|
24
|
+
>
|
|
25
|
+
<ListItemText
|
|
26
|
+
sx={ { flexGrow: 0 } }
|
|
27
|
+
primaryTypographyProps={ { noWrap: true } }
|
|
28
|
+
primary={ postTitle }
|
|
29
|
+
/>
|
|
30
|
+
<DocTypeChip
|
|
31
|
+
postType={ post.type.post_type }
|
|
32
|
+
docType={ post.type.doc_type }
|
|
33
|
+
label={ post.type.label }
|
|
34
|
+
/>
|
|
24
35
|
</MenuItem>
|
|
25
36
|
);
|
|
26
37
|
}
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
bindTrigger,
|
|
6
6
|
Menu,
|
|
7
7
|
Button,
|
|
8
|
-
Box,
|
|
9
8
|
ListSubheader,
|
|
10
|
-
Typography,
|
|
11
9
|
Divider,
|
|
10
|
+
ListItemText,
|
|
11
|
+
MenuItem,
|
|
12
12
|
} from '@elementor/ui';
|
|
13
13
|
import { ChevronDownIcon } from '@elementor/icons';
|
|
14
14
|
import { useActiveDocument, useHostDocument } from '@elementor/editor-documents';
|
|
@@ -40,7 +40,7 @@ export default function RecentlyEdited() {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
return (
|
|
43
|
-
|
|
43
|
+
<>
|
|
44
44
|
<Button
|
|
45
45
|
color="inherit"
|
|
46
46
|
size="small"
|
|
@@ -52,30 +52,39 @@ export default function RecentlyEdited() {
|
|
|
52
52
|
status={ document.status }
|
|
53
53
|
/>
|
|
54
54
|
</Button>
|
|
55
|
-
|
|
56
55
|
<Menu
|
|
57
|
-
MenuListProps={ {
|
|
58
|
-
|
|
56
|
+
MenuListProps={ {
|
|
57
|
+
dense: true,
|
|
58
|
+
subheader: (
|
|
59
|
+
<ListSubheader sx={ { fontStyle: 'italic', fontWeight: '300' } }>
|
|
60
|
+
{ __( 'Recent', 'elementor' ) }
|
|
61
|
+
</ListSubheader>
|
|
62
|
+
),
|
|
63
|
+
} }
|
|
64
|
+
PaperProps={ { sx: { mt: 4, width: 320 } } }
|
|
59
65
|
{ ...bindMenu( popupState ) }
|
|
60
66
|
>
|
|
61
|
-
<ListSubheader sx={ { fontSize: 12, fontStyle: 'italic', pl: 4 } } component="div" id="nested-list-subheader">
|
|
62
|
-
{ __( 'Recent', 'elementor' ) }
|
|
63
|
-
</ListSubheader>
|
|
64
|
-
|
|
65
67
|
{ recentPosts.map( ( post ) => (
|
|
66
68
|
<PostListItem key={ post.id } post={ post } closePopup={ popupState.close } />
|
|
67
69
|
) ) }
|
|
68
70
|
|
|
69
71
|
{ recentPosts.length === 0 && (
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
<MenuItem disabled>
|
|
73
|
+
<ListItemText
|
|
74
|
+
primaryTypographyProps={ {
|
|
75
|
+
variant: 'caption',
|
|
76
|
+
fontStyle: 'italic',
|
|
77
|
+
} }
|
|
78
|
+
primary={ __( 'There are no other pages or templates on this site yet.', 'elementor' ) }
|
|
79
|
+
/>
|
|
80
|
+
</MenuItem>
|
|
73
81
|
) }
|
|
74
82
|
|
|
75
|
-
|
|
83
|
+
{ /* It appears that there might be a bug in Material UI. When the divider is the first active element, it attempts to receive focus instead of the item below it. */ }
|
|
84
|
+
<Divider disabled={ recentPosts.length === 0 } />
|
|
76
85
|
|
|
77
86
|
<CreatePostListItem closePopup={ popupState.close } />
|
|
78
87
|
</Menu>
|
|
79
|
-
|
|
88
|
+
</>
|
|
80
89
|
);
|
|
81
90
|
}
|