@elementor/editor-site-navigation 0.18.2 → 0.18.4

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 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.4](https://github.com/elementor/elementor-packages/compare/@elementor/editor-site-navigation@0.18.3...@elementor/editor-site-navigation@0.18.4) (2023-08-22)
7
+
8
+ **Note:** Version bump only for package @elementor/editor-site-navigation
9
+
10
+
11
+
12
+
13
+
14
+ ## [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)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **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))
20
+
21
+
22
+
23
+
24
+
6
25
  ## [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)
7
26
 
8
27
  **Note:** Version bump only for package @elementor/editor-site-navigation
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,13 +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,
131
132
  "data-value": docType,
132
133
  color,
133
134
  icon: /* @__PURE__ */ React2.createElement(Icon, null),
134
- sx: { ml: 3 }
135
+ sx: { ml: 3, cursor: "inherit" }
135
136
  }
136
137
  );
137
138
  }
@@ -154,13 +155,35 @@ function useReverseHtmlEntities(escapedHTML = "") {
154
155
  }
155
156
 
156
157
  // src/components/top-bar/post-list-item.tsx
157
- function PostListItem({ post, closePopup }) {
158
+ function PostListItem({ post, closePopup, ...props }) {
158
159
  const navigateToDocument = (0, import_editor_documents.useNavigateToDocument)();
159
160
  const postTitle = useReverseHtmlEntities(post.title);
160
- return /* @__PURE__ */ React3.createElement(import_ui3.MenuItem, { dense: true, sx: { width: "100%" }, onClick: () => {
161
- closePopup();
162
- navigateToDocument(post.id);
163
- } }, postTitle, /* @__PURE__ */ React3.createElement(DocTypeChip, { postType: post.type.post_type, docType: post.type.doc_type, label: post.type.label }));
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
+ );
164
187
  }
165
188
 
166
189
  // src/components/top-bar/create-post-list-item.tsx
@@ -193,14 +216,22 @@ async function addNewPage() {
193
216
  var import_icons3 = require("@elementor/icons");
194
217
  var import_i18n = require("@wordpress/i18n");
195
218
  var import_editor_documents2 = require("@elementor/editor-documents");
196
- function CreatePostListItem({ closePopup }) {
219
+ function CreatePostListItem({ closePopup, ...props }) {
197
220
  const { create, isLoading } = useCreatePage();
198
221
  const navigateToDocument = (0, import_editor_documents2.useNavigateToDocument)();
199
- return /* @__PURE__ */ React4.createElement(import_ui4.MenuItem, { dense: true, size: "small", color: "inherit", component: "div", onClick: async () => {
200
- const { id } = await create();
201
- closePopup();
202
- navigateToDocument(id);
203
- } }, /* @__PURE__ */ React4.createElement(import_ui4.ListItemIcon, null, isLoading ? /* @__PURE__ */ React4.createElement(import_ui4.CircularProgress, null) : /* @__PURE__ */ React4.createElement(import_icons3.PlusIcon, null)), (0, import_i18n.__)("Add new page", "elementor"));
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
+ );
204
235
  }
205
236
 
206
237
  // src/components/top-bar/recently-edited.tsx
@@ -217,7 +248,7 @@ function RecentlyEdited() {
217
248
  if (!document2) {
218
249
  return null;
219
250
  }
220
- return /* @__PURE__ */ React5.createElement(import_ui5.Box, { sx: { cursor: "default" } }, /* @__PURE__ */ React5.createElement(
251
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
221
252
  import_ui5.Button,
222
253
  {
223
254
  color: "inherit",
@@ -235,14 +266,25 @@ function RecentlyEdited() {
235
266
  ), /* @__PURE__ */ React5.createElement(
236
267
  import_ui5.Menu,
237
268
  {
238
- MenuListProps: { component: "div" },
239
- PaperProps: { sx: { mt: 4, minWidth: 314 } },
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 } },
240
274
  ...(0, import_ui5.bindMenu)(popupState)
241
275
  },
242
- /* @__PURE__ */ React5.createElement(import_ui5.ListSubheader, { sx: { fontSize: 12, fontStyle: "italic", pl: 4 }, component: "div", id: "nested-list-subheader" }, (0, import_i18n2.__)("Recent", "elementor")),
243
276
  recentPosts.map((post) => /* @__PURE__ */ React5.createElement(PostListItem, { key: post.id, post, closePopup: popupState.close })),
244
- recentPosts.length === 0 && /* @__PURE__ */ React5.createElement(import_ui5.Typography, { variant: "caption", sx: { color: "grey.500", fontStyle: "italic", p: 4 }, component: "div", "aria-label": void 0 }, (0, import_i18n2.__)("There are no other pages or templates on this site yet.", "elementor")),
245
- /* @__PURE__ */ React5.createElement(import_ui5.Divider, null),
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 }),
246
288
  /* @__PURE__ */ React5.createElement(CreatePostListItem, { closePopup: popupState.close })
247
289
  ));
248
290
  }
@@ -657,7 +699,7 @@ function ActionMenuItem({ title, icon: Icon, ListItemButtonProps }) {
657
699
  ...ListItemButtonProps
658
700
  },
659
701
  /* @__PURE__ */ React13.createElement(import_ui9.ListItemIcon, null, /* @__PURE__ */ React13.createElement(Icon, null)),
660
- /* @__PURE__ */ React13.createElement(import_ui9.ListItemText, null, title)
702
+ /* @__PURE__ */ React13.createElement(import_ui9.ListItemText, { primary: title })
661
703
  ));
662
704
  }
663
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
- Typography as Typography2,
35
- Divider
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,19 +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,
113
114
  "data-value": docType,
114
115
  color,
115
116
  icon: /* @__PURE__ */ React2.createElement(Icon, null),
116
- sx: { ml: 3 }
117
+ sx: { ml: 3, cursor: "inherit" }
117
118
  }
118
119
  );
119
120
  }
120
121
 
121
122
  // src/components/top-bar/post-list-item.tsx
122
- import { MenuItem } from "@elementor/ui";
123
+ import { MenuItem, ListItemText } from "@elementor/ui";
123
124
  import * as React3 from "react";
124
125
  import { useNavigateToDocument } from "@elementor/editor-documents";
125
126
 
@@ -136,17 +137,39 @@ function useReverseHtmlEntities(escapedHTML = "") {
136
137
  }
137
138
 
138
139
  // src/components/top-bar/post-list-item.tsx
139
- function PostListItem({ post, closePopup }) {
140
+ function PostListItem({ post, closePopup, ...props }) {
140
141
  const navigateToDocument = useNavigateToDocument();
141
142
  const postTitle = useReverseHtmlEntities(post.title);
142
- return /* @__PURE__ */ React3.createElement(MenuItem, { dense: true, sx: { width: "100%" }, onClick: () => {
143
- closePopup();
144
- navigateToDocument(post.id);
145
- } }, postTitle, /* @__PURE__ */ React3.createElement(DocTypeChip, { postType: post.type.post_type, docType: post.type.doc_type, label: post.type.label }));
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
+ );
146
169
  }
147
170
 
148
171
  // src/components/top-bar/create-post-list-item.tsx
149
- import { CircularProgress, ListItemIcon, MenuItem as MenuItem2 } from "@elementor/ui";
172
+ import { CircularProgress, ListItemIcon, ListItemText as ListItemText2, MenuItem as MenuItem2 } from "@elementor/ui";
150
173
  import * as React4 from "react";
151
174
 
152
175
  // src/hooks/use-create-page.ts
@@ -175,14 +198,22 @@ async function addNewPage() {
175
198
  import { PlusIcon } from "@elementor/icons";
176
199
  import { __ } from "@wordpress/i18n";
177
200
  import { useNavigateToDocument as useNavigateToDocument2 } from "@elementor/editor-documents";
178
- function CreatePostListItem({ closePopup }) {
201
+ function CreatePostListItem({ closePopup, ...props }) {
179
202
  const { create, isLoading } = useCreatePage();
180
203
  const navigateToDocument = useNavigateToDocument2();
181
- return /* @__PURE__ */ React4.createElement(MenuItem2, { dense: true, size: "small", color: "inherit", component: "div", onClick: async () => {
182
- const { id } = await create();
183
- closePopup();
184
- navigateToDocument(id);
185
- } }, /* @__PURE__ */ React4.createElement(ListItemIcon, null, isLoading ? /* @__PURE__ */ React4.createElement(CircularProgress, null) : /* @__PURE__ */ React4.createElement(PlusIcon, null)), __("Add new page", "elementor"));
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
+ );
186
217
  }
187
218
 
188
219
  // src/components/top-bar/recently-edited.tsx
@@ -199,7 +230,7 @@ function RecentlyEdited() {
199
230
  if (!document2) {
200
231
  return null;
201
232
  }
202
- return /* @__PURE__ */ React5.createElement(Box, { sx: { cursor: "default" } }, /* @__PURE__ */ React5.createElement(
233
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
203
234
  Button,
204
235
  {
205
236
  color: "inherit",
@@ -217,14 +248,25 @@ function RecentlyEdited() {
217
248
  ), /* @__PURE__ */ React5.createElement(
218
249
  Menu,
219
250
  {
220
- MenuListProps: { component: "div" },
221
- PaperProps: { sx: { mt: 4, minWidth: 314 } },
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 } },
222
256
  ...bindMenu(popupState)
223
257
  },
224
- /* @__PURE__ */ React5.createElement(ListSubheader, { sx: { fontSize: 12, fontStyle: "italic", pl: 4 }, component: "div", id: "nested-list-subheader" }, __2("Recent", "elementor")),
225
258
  recentPosts.map((post) => /* @__PURE__ */ React5.createElement(PostListItem, { key: post.id, post, closePopup: popupState.close })),
226
- recentPosts.length === 0 && /* @__PURE__ */ React5.createElement(Typography2, { variant: "caption", sx: { color: "grey.500", fontStyle: "italic", p: 4 }, component: "div", "aria-label": void 0 }, __2("There are no other pages or templates on this site yet.", "elementor")),
227
- /* @__PURE__ */ React5.createElement(Divider, null),
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 }),
228
270
  /* @__PURE__ */ React5.createElement(CreatePostListItem, { closePopup: popupState.close })
229
271
  ));
230
272
  }
@@ -247,7 +289,7 @@ import { __ as __14 } from "@wordpress/i18n";
247
289
  // src/components/panel/posts-list/posts-collapsible-list.tsx
248
290
  import * as React22 from "react";
249
291
  import { PageTypeIcon as PageTypeIcon2 } from "@elementor/icons";
250
- import { Skeleton, Box as Box4, List as List2 } from "@elementor/ui";
292
+ import { Skeleton, Box as Box3, List as List2 } from "@elementor/ui";
251
293
 
252
294
  // src/hooks/use-posts.ts
253
295
  import { useQuery } from "@elementor/query";
@@ -357,7 +399,7 @@ function usePostListContext() {
357
399
  // src/components/panel/posts-list/collapsible-list.tsx
358
400
  import * as React7 from "react";
359
401
  import { useState as useState4 } from "react";
360
- 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";
361
403
  import { ChevronDownIcon as ChevronDownIcon2 } from "@elementor/icons";
362
404
  var RotateIcon = styled(ChevronDownIcon2, {
363
405
  shouldForwardProp: (prop) => prop !== "isOpen"
@@ -382,7 +424,7 @@ function CollapsibleList({
382
424
  size: "small"
383
425
  },
384
426
  /* @__PURE__ */ React7.createElement(RotateIcon, { fontSize: "small", isOpen })
385
- )), /* @__PURE__ */ React7.createElement(ListItemIcon2, null, /* @__PURE__ */ React7.createElement(Icon, null)), /* @__PURE__ */ React7.createElement(ListItemText, { primaryTypographyProps: { variant: "subtitle1", component: "span", sx: { fontWeight: "bold" } }, primary: label })), /* @__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(
386
428
  Collapse,
387
429
  {
388
430
  in: isOpen,
@@ -439,7 +481,7 @@ function useInvalidatePosts(postTypeSlug) {
439
481
  import * as React8 from "react";
440
482
  import { useState as useState5, useRef } from "react";
441
483
  import {
442
- Box as Box2,
484
+ Box,
443
485
  ListItem as ListItem2,
444
486
  TextField,
445
487
  IconButton as IconButton2,
@@ -481,7 +523,7 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
481
523
  sx: { pt: 1, pl: 0 },
482
524
  secondaryAction: /* @__PURE__ */ React8.createElement(CloseButton, { isLoading, closeButton })
483
525
  },
484
- /* @__PURE__ */ React8.createElement(Box2, { width: "100%", sx: { ml: 4, pr: 3 }, component: "form", onSubmit: onFormSubmit }, /* @__PURE__ */ React8.createElement(
526
+ /* @__PURE__ */ React8.createElement(Box, { width: "100%", sx: { ml: 4, pr: 3 }, component: "form", onSubmit: onFormSubmit }, /* @__PURE__ */ React8.createElement(
485
527
  TextField,
486
528
  {
487
529
  autoFocus: true,
@@ -590,7 +632,7 @@ import {
590
632
  ListItem as ListItem3,
591
633
  ListItemButton as ListItemButton2,
592
634
  ListItemIcon as ListItemIcon4,
593
- ListItemText as ListItemText3,
635
+ ListItemText as ListItemText6,
594
636
  Menu as Menu2,
595
637
  ToggleButton,
596
638
  usePopupState as usePopupState2
@@ -600,13 +642,13 @@ import { useActiveDocument as useActiveDocument3, useNavigateToDocument as useNa
600
642
 
601
643
  // src/components/shared/page-title-and-status.tsx
602
644
  import * as React12 from "react";
603
- import { Box as Box3, Typography as Typography3 } from "@elementor/ui";
645
+ import { Box as Box2, Typography as Typography2 } from "@elementor/ui";
604
646
  var PageStatus = ({ status }) => {
605
647
  if ("publish" === status) {
606
648
  return null;
607
649
  }
608
650
  return /* @__PURE__ */ React12.createElement(
609
- Typography3,
651
+ Typography2,
610
652
  {
611
653
  component: "span",
612
654
  variant: "body2",
@@ -625,7 +667,7 @@ var PageStatus = ({ status }) => {
625
667
  var PageTitle = ({ title }) => {
626
668
  const modifiedTitle = useReverseHtmlEntities(title);
627
669
  return /* @__PURE__ */ React12.createElement(
628
- Typography3,
670
+ Typography2,
629
671
  {
630
672
  component: "span",
631
673
  variant: "body2",
@@ -638,7 +680,7 @@ var PageTitle = ({ title }) => {
638
680
  );
639
681
  };
640
682
  function PageTitleAndStatus({ page }) {
641
- return /* @__PURE__ */ React12.createElement(Box3, { display: "flex" }, /* @__PURE__ */ React12.createElement(PageTitle, { title: page.title.rendered }), "\xA0", /* @__PURE__ */ React12.createElement(PageStatus, { status: page.status }));
683
+ return /* @__PURE__ */ React12.createElement(Box2, { display: "flex" }, /* @__PURE__ */ React12.createElement(PageTitle, { title: page.title.rendered }), "\xA0", /* @__PURE__ */ React12.createElement(PageStatus, { status: page.status }));
642
684
  }
643
685
 
644
686
  // src/components/panel/actions-menu/actions/rename.tsx
@@ -651,17 +693,17 @@ import * as React13 from "react";
651
693
  import {
652
694
  ListItemButton,
653
695
  ListItemIcon as ListItemIcon3,
654
- ListItemText as ListItemText2,
655
- MenuItem as MenuItem3
696
+ ListItemText as ListItemText5,
697
+ MenuItem as MenuItem4
656
698
  } from "@elementor/ui";
657
699
  function ActionMenuItem({ title, icon: Icon, ListItemButtonProps }) {
658
- return /* @__PURE__ */ React13.createElement(MenuItem3, { disableGutters: true }, /* @__PURE__ */ React13.createElement(
700
+ return /* @__PURE__ */ React13.createElement(MenuItem4, { disableGutters: true }, /* @__PURE__ */ React13.createElement(
659
701
  ListItemButton,
660
702
  {
661
703
  ...ListItemButtonProps
662
704
  },
663
705
  /* @__PURE__ */ React13.createElement(ListItemIcon3, null, /* @__PURE__ */ React13.createElement(Icon, null)),
664
- /* @__PURE__ */ React13.createElement(ListItemText2, null, title)
706
+ /* @__PURE__ */ React13.createElement(ListItemText5, { primary: title })
665
707
  ));
666
708
  }
667
709
 
@@ -910,7 +952,7 @@ function ListItemView({ post }) {
910
952
  },
911
953
  /* @__PURE__ */ React19.createElement(ListItemIcon4, null),
912
954
  /* @__PURE__ */ React19.createElement(
913
- ListItemText3,
955
+ ListItemText6,
914
956
  {
915
957
  disableTypography: true
916
958
  },
@@ -979,21 +1021,21 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
979
1021
  const { data: posts, isLoading: postsLoading } = usePosts(type);
980
1022
  const { data: homepageSettings } = useHomepage();
981
1023
  if (!posts || postsLoading) {
982
- return /* @__PURE__ */ React22.createElement(Box4, { sx: { px: 5 } }, /* @__PURE__ */ React22.createElement(
983
- Box4,
1024
+ return /* @__PURE__ */ React22.createElement(Box3, { sx: { px: 5 } }, /* @__PURE__ */ React22.createElement(
1025
+ Box3,
984
1026
  {
985
1027
  display: "flex",
986
1028
  justifyContent: "flex-end",
987
1029
  alignItems: "center"
988
1030
  },
989
1031
  /* @__PURE__ */ React22.createElement(Skeleton, { sx: { my: 4 }, animation: "wave", variant: "rounded", width: "110px", height: "28px" })
990
- ), /* @__PURE__ */ React22.createElement(Box4, 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" })));
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" })));
991
1033
  }
992
1034
  const label = `${postTypesMap[type].labels.plural_name} (${posts.length.toString()})`;
993
1035
  const isHomepageSet = homepageSettings?.show_on_front === "page" && !!homepageSettings?.page_on_front;
994
1036
  const homepageId = isHomepageSet ? homepageSettings.page_on_front : null;
995
1037
  return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(
996
- Box4,
1038
+ Box3,
997
1039
  {
998
1040
  display: "flex",
999
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.2",
3
+ "version": "0.18.4",
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.1",
35
+ "@elementor/editor-app-bar": "^0.7.3",
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": "2b3966576de0a266d74564706aa011833fccda8f"
52
+ "gitHead": "dd77d56ac1157b6287657ae652f1579e1f362b49"
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,13 +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 }
25
26
  data-value={ docType }
26
27
  color={ color }
27
28
  icon={ <Icon /> }
28
- sx={ { ml: 3 } }
29
+ sx={ { ml: 3, cursor: 'inherit' } }
29
30
  />
30
31
  );
31
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
- export function CreatePostListItem( { closePopup }: { closePopup: () => void } ) {
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 dense size="small" color="inherit" component="div" onClick={ async () => {
14
- const { id } = await create();
17
+ <MenuItem
18
+ onClick={ async () => {
19
+ const { id } = await create();
15
20
 
16
- closePopup();
17
- navigateToDocument( id );
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 dense sx={ { width: '100%' } } onClick={ () => {
19
- closePopup();
20
- navigateToDocument( post.id );
21
- } }>
22
- { postTitle }
23
- <DocTypeChip postType={ post.type.post_type } docType={ post.type.doc_type } label={ post.type.label } />
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
- <Box sx={ { cursor: 'default' } }>
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={ { component: 'div' } }
58
- PaperProps={ { sx: { mt: 4, minWidth: 314 } } }
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
- <Typography variant="caption" sx={ { color: 'grey.500', fontStyle: 'italic', p: 4 } } component="div" aria-label={ undefined }>
71
- { __( 'There are no other pages or templates on this site yet.', 'elementor' ) }
72
- </Typography>
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
- <Divider />
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
- </Box>
88
+ </>
80
89
  );
81
90
  }