@elementor/editor-site-navigation 4.5.0-1209 → 4.5.0-1210

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/dist/index.js CHANGED
@@ -65,7 +65,7 @@ var React26 = __toESM(require("react"));
65
65
  var import_react9 = require("react");
66
66
  var import_editor_panels = require("@elementor/editor-panels");
67
67
  var import_ui16 = require("@elementor/ui");
68
- var import_i18n17 = require("@wordpress/i18n");
68
+ var import_i18n18 = require("@wordpress/i18n");
69
69
 
70
70
  // src/contexts/content-panel-coordinator.tsx
71
71
  var React = __toESM(require("react"));
@@ -476,7 +476,7 @@ function usePostListContext() {
476
476
  var React23 = __toESM(require("react"));
477
477
  var import_react8 = require("react");
478
478
  var import_ui13 = require("@elementor/ui");
479
- var import_i18n15 = require("@wordpress/i18n");
479
+ var import_i18n16 = require("@wordpress/i18n");
480
480
 
481
481
  // src/hooks/use-homepage.ts
482
482
  var import_query2 = require("@elementor/query");
@@ -1002,11 +1002,12 @@ var React21 = __toESM(require("react"));
1002
1002
  var import_editor_documents5 = require("@elementor/editor-documents");
1003
1003
  var import_icons12 = require("@elementor/icons");
1004
1004
  var import_ui12 = require("@elementor/ui");
1005
- var import_i18n14 = require("@wordpress/i18n");
1005
+ var import_i18n15 = require("@wordpress/i18n");
1006
1006
 
1007
1007
  // src/components/shared/page-title-and-status.tsx
1008
1008
  var React14 = __toESM(require("react"));
1009
1009
  var import_ui8 = require("@elementor/ui");
1010
+ var import_i18n9 = require("@wordpress/i18n");
1010
1011
 
1011
1012
  // src/hooks/use-reverse-html-entities.ts
1012
1013
  var import_react6 = require("react");
@@ -1027,27 +1028,67 @@ function useReverseHtmlEntities(escapedHTML = "") {
1027
1028
  }
1028
1029
 
1029
1030
  // src/components/shared/page-title-and-status.tsx
1031
+ function humanizeStatusSlug(status) {
1032
+ return status.replace(/[-_]+/g, " ").trim();
1033
+ }
1034
+ var statusChipConfig = {
1035
+ draft: {
1036
+ color: "default",
1037
+ label: (0, import_i18n9.__)("Draft", "elementor")
1038
+ },
1039
+ future: {
1040
+ color: "default",
1041
+ label: (0, import_i18n9.__)("Scheduled", "elementor")
1042
+ },
1043
+ pending: {
1044
+ color: "warning",
1045
+ label: (0, import_i18n9.__)("Pending Review", "elementor")
1046
+ },
1047
+ private: {
1048
+ color: "default",
1049
+ label: (0, import_i18n9.__)("Private", "elementor")
1050
+ }
1051
+ };
1052
+ function getStatusChipConfig(status) {
1053
+ const known = statusChipConfig[status];
1054
+ if (known) {
1055
+ return known;
1056
+ }
1057
+ return {
1058
+ color: "default",
1059
+ label: humanizeStatusSlug(status)
1060
+ };
1061
+ }
1062
+ function isKnownPanelStatus(status) {
1063
+ return status in statusChipConfig;
1064
+ }
1030
1065
  var PageStatus = ({ status }) => {
1031
1066
  if ("publish" === status) {
1032
1067
  return null;
1033
1068
  }
1069
+ const { color, label } = getStatusChipConfig(status);
1070
+ const isKnownStatus = isKnownPanelStatus(status);
1034
1071
  return /* @__PURE__ */ React14.createElement(
1035
- import_ui8.Typography,
1072
+ import_ui8.Chip,
1036
1073
  {
1074
+ color,
1037
1075
  component: "span",
1038
- variant: "body2",
1039
- color: "text.secondary",
1076
+ label,
1077
+ size: "tiny",
1040
1078
  sx: {
1041
- ...contentPanelListRowTitleSx,
1042
- textTransform: "capitalize",
1043
- fontStyle: "italic",
1044
- whiteSpace: "nowrap",
1045
- flexBasis: "content"
1046
- }
1047
- },
1048
- "(",
1049
- status,
1050
- ")"
1079
+ flexShrink: isKnownStatus ? 0 : 1,
1080
+ maxWidth: isKnownStatus ? void 0 : "45%",
1081
+ minWidth: 0,
1082
+ ml: 0.5,
1083
+ "& .MuiChip-label": {
1084
+ overflow: "hidden",
1085
+ textOverflow: "ellipsis",
1086
+ whiteSpace: "nowrap"
1087
+ }
1088
+ },
1089
+ title: label,
1090
+ variant: "standard"
1091
+ }
1051
1092
  );
1052
1093
  };
1053
1094
  var PageTitle = ({ title }) => {
@@ -1068,7 +1109,7 @@ var PageTitle = ({ title }) => {
1068
1109
  );
1069
1110
  };
1070
1111
  function PageTitleAndStatus({ title, status }) {
1071
- return /* @__PURE__ */ React14.createElement(import_ui8.Box, { display: "flex" }, /* @__PURE__ */ React14.createElement(PageTitle, { title }), "\xA0", /* @__PURE__ */ React14.createElement(PageStatus, { status }));
1112
+ return /* @__PURE__ */ React14.createElement(import_ui8.Box, { alignItems: "center", display: "flex", minWidth: 0 }, /* @__PURE__ */ React14.createElement(PageTitle, { title }), /* @__PURE__ */ React14.createElement(PageStatus, { status }));
1072
1113
  }
1073
1114
 
1074
1115
  // src/components/panel/actions-menu/actions/delete.tsx
@@ -1077,7 +1118,7 @@ var import_react7 = require("react");
1077
1118
  var import_editor_documents4 = require("@elementor/editor-documents");
1078
1119
  var import_icons7 = require("@elementor/icons");
1079
1120
  var import_ui10 = require("@elementor/ui");
1080
- var import_i18n9 = require("@wordpress/i18n");
1121
+ var import_i18n10 = require("@wordpress/i18n");
1081
1122
 
1082
1123
  // src/components/panel/actions-menu/action-menu-item.tsx
1083
1124
  var React15 = __toESM(require("react"));
@@ -1104,7 +1145,7 @@ function Delete({ post }) {
1104
1145
  return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
1105
1146
  ActionMenuItem,
1106
1147
  {
1107
- title: (0, import_i18n9.__)("Delete", "elementor"),
1148
+ title: (0, import_i18n10.__)("Delete", "elementor"),
1108
1149
  icon: import_icons7.TrashIcon,
1109
1150
  MenuItemProps: {
1110
1151
  disabled: isDisabled,
@@ -1121,11 +1162,11 @@ function DeleteDialog({
1121
1162
  const { type } = usePostListContext();
1122
1163
  const { deletePost } = usePostActions(type);
1123
1164
  const { setError } = usePostListContext();
1124
- const dialogTitle = (0, import_i18n9.sprintf)((0, import_i18n9.__)('Delete "%s"?', "elementor"), post.title.rendered);
1125
- const dialogBody = type === "post" ? (0, import_i18n9.__)(
1165
+ const dialogTitle = (0, import_i18n10.sprintf)((0, import_i18n10.__)('Delete "%s"?', "elementor"), post.title.rendered);
1166
+ const dialogBody = type === "post" ? (0, import_i18n10.__)(
1126
1167
  "The post and its content will be deleted forever and we won\u2019t be able to recover them.",
1127
1168
  "elementor"
1128
- ) : (0, import_i18n9.__)(
1169
+ ) : (0, import_i18n10.__)(
1129
1170
  "The page and its content will be deleted forever and we won\u2019t be able to recover them.",
1130
1171
  "elementor"
1131
1172
  );
@@ -1151,14 +1192,14 @@ function DeleteDialog({
1151
1192
  onClick: handleCancel,
1152
1193
  disabled: deletePost.isPending
1153
1194
  },
1154
- (0, import_i18n9.__)("Cancel", "elementor")
1155
- ), /* @__PURE__ */ React16.createElement(import_ui10.Button, { variant: "contained", color: "error", onClick: deletePage, disabled: deletePost.isPending }, !deletePost.isPending ? (0, import_i18n9.__)("Delete", "elementor") : /* @__PURE__ */ React16.createElement(import_ui10.CircularProgress, null))));
1195
+ (0, import_i18n10.__)("Cancel", "elementor")
1196
+ ), /* @__PURE__ */ React16.createElement(import_ui10.Button, { variant: "contained", color: "error", onClick: deletePage, disabled: deletePost.isPending }, !deletePost.isPending ? (0, import_i18n10.__)("Delete", "elementor") : /* @__PURE__ */ React16.createElement(import_ui10.CircularProgress, null))));
1156
1197
  }
1157
1198
 
1158
1199
  // src/components/panel/actions-menu/actions/duplicate.tsx
1159
1200
  var React17 = __toESM(require("react"));
1160
1201
  var import_icons8 = require("@elementor/icons");
1161
- var import_i18n10 = require("@wordpress/i18n");
1202
+ var import_i18n11 = require("@wordpress/i18n");
1162
1203
  function Duplicate({ post, popupState }) {
1163
1204
  const { setEditMode, type } = usePostListContext();
1164
1205
  const canCreate = useCanCreate(type);
@@ -1176,7 +1217,7 @@ function Duplicate({ post, popupState }) {
1176
1217
  return /* @__PURE__ */ React17.createElement(
1177
1218
  ActionMenuItem,
1178
1219
  {
1179
- title: (0, import_i18n10.__)("Duplicate", "elementor"),
1220
+ title: (0, import_i18n11.__)("Duplicate", "elementor"),
1180
1221
  icon: import_icons8.CopyIcon,
1181
1222
  MenuItemProps: {
1182
1223
  disabled: isDisabled,
@@ -1189,13 +1230,13 @@ function Duplicate({ post, popupState }) {
1189
1230
  // src/components/panel/actions-menu/actions/rename.tsx
1190
1231
  var React18 = __toESM(require("react"));
1191
1232
  var import_icons9 = require("@elementor/icons");
1192
- var import_i18n11 = require("@wordpress/i18n");
1233
+ var import_i18n12 = require("@wordpress/i18n");
1193
1234
  function Rename({ post }) {
1194
1235
  const { setEditMode } = usePostListContext();
1195
1236
  return /* @__PURE__ */ React18.createElement(
1196
1237
  ActionMenuItem,
1197
1238
  {
1198
- title: (0, import_i18n11.__)("Rename", "elementor"),
1239
+ title: (0, import_i18n12.__)("Rename", "elementor"),
1199
1240
  icon: import_icons9.EraseIcon,
1200
1241
  MenuItemProps: {
1201
1242
  disabled: !post.user_can.edit,
@@ -1216,7 +1257,7 @@ function Rename({ post }) {
1216
1257
  var React19 = __toESM(require("react"));
1217
1258
  var import_icons10 = require("@elementor/icons");
1218
1259
  var import_ui11 = require("@elementor/ui");
1219
- var import_i18n12 = require("@wordpress/i18n");
1260
+ var import_i18n13 = require("@wordpress/i18n");
1220
1261
 
1221
1262
  // src/hooks/use-homepage-actions.ts
1222
1263
  var import_query6 = require("@elementor/query");
@@ -1258,7 +1299,7 @@ function SetHome({ post, closeMenu }) {
1258
1299
  return /* @__PURE__ */ React19.createElement(
1259
1300
  ActionMenuItem,
1260
1301
  {
1261
- title: (0, import_i18n12.__)("Set as homepage", "elementor"),
1302
+ title: (0, import_i18n13.__)("Set as homepage", "elementor"),
1262
1303
  icon: !updateSettingsMutation.isPending ? import_icons10.HomeIcon : import_ui11.CircularProgress,
1263
1304
  MenuItemProps: {
1264
1305
  disabled: isDisabled,
@@ -1271,10 +1312,10 @@ function SetHome({ post, closeMenu }) {
1271
1312
  // src/components/panel/actions-menu/actions/view.tsx
1272
1313
  var React20 = __toESM(require("react"));
1273
1314
  var import_icons11 = require("@elementor/icons");
1274
- var import_i18n13 = require("@wordpress/i18n");
1315
+ var import_i18n14 = require("@wordpress/i18n");
1275
1316
  function View({ post }) {
1276
1317
  const { type } = usePostListContext();
1277
- const title = (0, import_i18n13.__)("View %s", "elementor").replace("%s", postTypesMap[type].labels.singular_name);
1318
+ const title = (0, import_i18n14.__)("View %s", "elementor").replace("%s", postTypesMap[type].labels.singular_name);
1278
1319
  return /* @__PURE__ */ React20.createElement(
1279
1320
  ActionMenuItem,
1280
1321
  {
@@ -1294,7 +1335,7 @@ var DisabledPostTooltip = ({
1294
1335
  postTypeSlug
1295
1336
  }) => {
1296
1337
  if (isDisabled) {
1297
- const title = /* @__PURE__ */ React21.createElement(import_ui12.Typography, { variant: "caption" }, getCannotEditPanelItemMessage(postTypeSlug), /* @__PURE__ */ React21.createElement("br", null), (0, import_i18n14.__)("To edit it directly, contact the site owner", "elementor"));
1338
+ const title = /* @__PURE__ */ React21.createElement(import_ui12.Typography, { variant: "caption" }, getCannotEditPanelItemMessage(postTypeSlug), /* @__PURE__ */ React21.createElement("br", null), (0, import_i18n15.__)("To edit it directly, contact the site owner", "elementor"));
1298
1339
  return /* @__PURE__ */ React21.createElement(import_ui12.Tooltip, { title, placement: "bottom", arrow: false }, /* @__PURE__ */ React21.createElement("span", null, children));
1299
1340
  }
1300
1341
  return /* @__PURE__ */ React21.createElement(React21.Fragment, null, children);
@@ -1321,7 +1362,7 @@ function ListItemView({ post }) {
1321
1362
  secondaryAction: /* @__PURE__ */ React21.createElement(
1322
1363
  import_ui12.IconButton,
1323
1364
  {
1324
- "aria-label": (0, import_i18n14.__)("More actions", "elementor"),
1365
+ "aria-label": (0, import_i18n15.__)("More actions", "elementor"),
1325
1366
  size: "tiny",
1326
1367
  ...menuTriggerProps,
1327
1368
  onClick: (event) => {
@@ -1348,7 +1389,7 @@ function ListItemView({ post }) {
1348
1389
  sx: contentPanelListItemButtonSx
1349
1390
  },
1350
1391
  /* @__PURE__ */ React21.createElement(import_ui12.ListItemText, { disableTypography: true, sx: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React21.createElement(PageTitleAndStatus, { title, status })),
1351
- post.isHome && /* @__PURE__ */ React21.createElement(import_icons12.HomeIcon, { titleAccess: (0, import_i18n14.__)("Homepage", "elementor"), color: "disabled" })
1392
+ post.isHome && /* @__PURE__ */ React21.createElement(import_icons12.HomeIcon, { titleAccess: (0, import_i18n15.__)("Homepage", "elementor"), color: "disabled" })
1352
1393
  )
1353
1394
  )), /* @__PURE__ */ React21.createElement(
1354
1395
  import_ui12.Menu,
@@ -1451,7 +1492,7 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
1451
1492
  title: sectionTitle,
1452
1493
  trailingActions: /* @__PURE__ */ React23.createElement(SectionAddButton, { onBeforeCreate: () => setIsOpen(true) })
1453
1494
  },
1454
- showNoResults && /* @__PURE__ */ React23.createElement(import_ui13.Box, { sx: { py: 2, px: 2 } }, /* @__PURE__ */ React23.createElement(import_ui13.Typography, { variant: "body2", color: "text.secondary" }, (0, import_i18n15.__)("No results found", "elementor"))),
1495
+ showNoResults && /* @__PURE__ */ React23.createElement(import_ui13.Box, { sx: { py: 2, px: 2 } }, /* @__PURE__ */ React23.createElement(import_ui13.Typography, { variant: "body2", color: "text.secondary" }, (0, import_i18n16.__)("No results found", "elementor"))),
1455
1496
  filteredPosts.map((post) => {
1456
1497
  return /* @__PURE__ */ React23.createElement(PostListItem, { key: post.id, post });
1457
1498
  }),
@@ -1464,7 +1505,7 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
1464
1505
  justifyContent: "center"
1465
1506
  }
1466
1507
  },
1467
- /* @__PURE__ */ React23.createElement(import_ui13.Button, { onClick: fetchNextPage, color: "secondary" }, isFetchingNextPage ? /* @__PURE__ */ React23.createElement(import_ui13.CircularProgress, null) : (0, import_i18n15.__)("Load more", "elementor"))
1508
+ /* @__PURE__ */ React23.createElement(import_ui13.Button, { onClick: fetchNextPage, color: "secondary" }, isFetchingNextPage ? /* @__PURE__ */ React23.createElement(import_ui13.CircularProgress, null) : (0, import_i18n16.__)("Load more", "elementor"))
1468
1509
  )
1469
1510
  );
1470
1511
  }
@@ -1472,9 +1513,9 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
1472
1513
  // src/components/panel/user-load-error.tsx
1473
1514
  var React24 = __toESM(require("react"));
1474
1515
  var import_ui14 = require("@elementor/ui");
1475
- var import_i18n16 = require("@wordpress/i18n");
1516
+ var import_i18n17 = require("@wordpress/i18n");
1476
1517
  function UserLoadError() {
1477
- return /* @__PURE__ */ React24.createElement(import_ui14.Box, { sx: { px: 2, py: 2 } }, /* @__PURE__ */ React24.createElement(import_ui14.Typography, { variant: "body2", color: "text.secondary" }, (0, import_i18n16.__)(
1518
+ return /* @__PURE__ */ React24.createElement(import_ui14.Box, { sx: { px: 2, py: 2 } }, /* @__PURE__ */ React24.createElement(import_ui14.Typography, { variant: "body2", color: "text.secondary" }, (0, import_i18n17.__)(
1478
1519
  "We couldn\u2019t load your content permissions. Try closing and reopening this panel.",
1479
1520
  "elementor"
1480
1521
  )));
@@ -1510,7 +1551,7 @@ var Shell = () => {
1510
1551
  ...contentPanelHeaderStackSx
1511
1552
  }
1512
1553
  },
1513
- /* @__PURE__ */ React26.createElement(import_editor_panels.PanelHeaderTitle, { sx: { flex: 1, minWidth: 0, textAlign: "start" } }, (0, import_i18n17.__)("Site content", "elementor")),
1554
+ /* @__PURE__ */ React26.createElement(import_editor_panels.PanelHeaderTitle, { sx: { flex: 1, minWidth: 0, textAlign: "start" } }, (0, import_i18n18.__)("Site content", "elementor")),
1514
1555
  /* @__PURE__ */ React26.createElement(ContentPanelHeaderAdd, null)
1515
1556
  )), /* @__PURE__ */ React26.createElement(import_ui16.Divider, null), /* @__PURE__ */ React26.createElement(import_editor_panels.PanelBody, null, /* @__PURE__ */ React26.createElement(ContentPanelSearch, null), /* @__PURE__ */ React26.createElement(
1516
1557
  ShellPanelBodyContent,
@@ -1535,7 +1576,7 @@ var React31 = __toESM(require("react"));
1535
1576
  var import_editor_documents8 = require("@elementor/editor-documents");
1536
1577
  var import_icons15 = require("@elementor/icons");
1537
1578
  var import_ui21 = require("@elementor/ui");
1538
- var import_i18n19 = require("@wordpress/i18n");
1579
+ var import_i18n20 = require("@wordpress/i18n");
1539
1580
 
1540
1581
  // src/components/top-bar/create-post-list-item.tsx
1541
1582
  var React27 = __toESM(require("react"));
@@ -1543,7 +1584,7 @@ var import_editor_documents6 = require("@elementor/editor-documents");
1543
1584
  var import_events = require("@elementor/events");
1544
1585
  var import_icons13 = require("@elementor/icons");
1545
1586
  var import_ui17 = require("@elementor/ui");
1546
- var import_i18n18 = require("@wordpress/i18n");
1587
+ var import_i18n19 = require("@wordpress/i18n");
1547
1588
 
1548
1589
  // src/hooks/use-create-page.ts
1549
1590
  var import_react10 = require("react");
@@ -1602,7 +1643,7 @@ function CreatePostListItem({ closePopup, ...props }) {
1602
1643
  import_ui17.ListItemText,
1603
1644
  {
1604
1645
  primaryTypographyProps: { variant: "body2" },
1605
- primary: (0, import_i18n18.__)("Add new page", "elementor")
1646
+ primary: (0, import_i18n19.__)("Add new page", "elementor")
1606
1647
  }
1607
1648
  )
1608
1649
  );
@@ -1750,7 +1791,7 @@ function RecentlyEdited() {
1750
1791
  import_ui21.Menu,
1751
1792
  {
1752
1793
  MenuListProps: {
1753
- subheader: /* @__PURE__ */ React31.createElement(import_ui21.ListSubheader, { sx: { color: "accent.main", fontStyle: "italic", fontWeight: "300" } }, (0, import_i18n19.__)("Recent", "elementor"))
1794
+ subheader: /* @__PURE__ */ React31.createElement(import_ui21.ListSubheader, { sx: { color: "accent.main", fontStyle: "italic", fontWeight: "300" } }, (0, import_i18n20.__)("Recent", "elementor"))
1754
1795
  },
1755
1796
  PaperProps: { sx: { mt: 2.5, width: 320 } },
1756
1797
  ...(0, import_ui21.bindMenu)(popupState)
@@ -1763,7 +1804,7 @@ function RecentlyEdited() {
1763
1804
  variant: "caption",
1764
1805
  fontStyle: "italic"
1765
1806
  },
1766
- primary: (0, import_i18n19.__)("There are no other pages or templates on this site yet.", "elementor")
1807
+ primary: (0, import_i18n20.__)("There are no other pages or templates on this site yet.", "elementor")
1767
1808
  }
1768
1809
  )),
1769
1810
  /* @__PURE__ */ React31.createElement(import_ui21.Divider, { disabled: recentPosts.length === 0 }),
@@ -1773,12 +1814,12 @@ function RecentlyEdited() {
1773
1814
 
1774
1815
  // src/hooks/use-toggle-button-props.ts
1775
1816
  var import_icons16 = require("@elementor/icons");
1776
- var import_i18n20 = require("@wordpress/i18n");
1817
+ var import_i18n21 = require("@wordpress/i18n");
1777
1818
  function useToggleButtonProps() {
1778
1819
  const { isOpen: selectedState, isBlocked } = usePanelStatus();
1779
1820
  const { open, close } = usePanelActions();
1780
1821
  return {
1781
- title: (0, import_i18n20.__)("Site content", "elementor"),
1822
+ title: (0, import_i18n21.__)("Site content", "elementor"),
1782
1823
  icon: import_icons16.PagesIcon,
1783
1824
  onClick: () => {
1784
1825
  const extendedWindow = window;
package/dist/index.mjs CHANGED
@@ -34,7 +34,7 @@ import * as React26 from "react";
34
34
  import { useState as useState6 } from "react";
35
35
  import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
36
36
  import { Divider as Divider4, Stack as Stack3 } from "@elementor/ui";
37
- import { __ as __17 } from "@wordpress/i18n";
37
+ import { __ as __18 } from "@wordpress/i18n";
38
38
 
39
39
  // src/contexts/content-panel-coordinator.tsx
40
40
  import * as React from "react";
@@ -445,7 +445,7 @@ function usePostListContext() {
445
445
  import * as React23 from "react";
446
446
  import { useEffect, useMemo as useMemo4, useState as useState5 } from "react";
447
447
  import { Box as Box6, Button as Button2, CircularProgress as CircularProgress4, Skeleton, Typography as Typography5 } from "@elementor/ui";
448
- import { __ as __15 } from "@wordpress/i18n";
448
+ import { __ as __16 } from "@wordpress/i18n";
449
449
 
450
450
  // src/hooks/use-homepage.ts
451
451
  import { useQuery as useQuery2 } from "@elementor/query";
@@ -986,11 +986,12 @@ import {
986
986
  Typography as Typography4,
987
987
  usePopupState as usePopupState2
988
988
  } from "@elementor/ui";
989
- import { __ as __14 } from "@wordpress/i18n";
989
+ import { __ as __15 } from "@wordpress/i18n";
990
990
 
991
991
  // src/components/shared/page-title-and-status.tsx
992
992
  import * as React14 from "react";
993
- import { Box as Box5, Typography as Typography3 } from "@elementor/ui";
993
+ import { Box as Box5, Chip as Chip2, Typography as Typography3 } from "@elementor/ui";
994
+ import { __ as __9 } from "@wordpress/i18n";
994
995
 
995
996
  // src/hooks/use-reverse-html-entities.ts
996
997
  import { useMemo as useMemo3 } from "react";
@@ -1011,27 +1012,67 @@ function useReverseHtmlEntities(escapedHTML = "") {
1011
1012
  }
1012
1013
 
1013
1014
  // src/components/shared/page-title-and-status.tsx
1015
+ function humanizeStatusSlug(status) {
1016
+ return status.replace(/[-_]+/g, " ").trim();
1017
+ }
1018
+ var statusChipConfig = {
1019
+ draft: {
1020
+ color: "default",
1021
+ label: __9("Draft", "elementor")
1022
+ },
1023
+ future: {
1024
+ color: "default",
1025
+ label: __9("Scheduled", "elementor")
1026
+ },
1027
+ pending: {
1028
+ color: "warning",
1029
+ label: __9("Pending Review", "elementor")
1030
+ },
1031
+ private: {
1032
+ color: "default",
1033
+ label: __9("Private", "elementor")
1034
+ }
1035
+ };
1036
+ function getStatusChipConfig(status) {
1037
+ const known = statusChipConfig[status];
1038
+ if (known) {
1039
+ return known;
1040
+ }
1041
+ return {
1042
+ color: "default",
1043
+ label: humanizeStatusSlug(status)
1044
+ };
1045
+ }
1046
+ function isKnownPanelStatus(status) {
1047
+ return status in statusChipConfig;
1048
+ }
1014
1049
  var PageStatus = ({ status }) => {
1015
1050
  if ("publish" === status) {
1016
1051
  return null;
1017
1052
  }
1053
+ const { color, label } = getStatusChipConfig(status);
1054
+ const isKnownStatus = isKnownPanelStatus(status);
1018
1055
  return /* @__PURE__ */ React14.createElement(
1019
- Typography3,
1056
+ Chip2,
1020
1057
  {
1058
+ color,
1021
1059
  component: "span",
1022
- variant: "body2",
1023
- color: "text.secondary",
1060
+ label,
1061
+ size: "tiny",
1024
1062
  sx: {
1025
- ...contentPanelListRowTitleSx,
1026
- textTransform: "capitalize",
1027
- fontStyle: "italic",
1028
- whiteSpace: "nowrap",
1029
- flexBasis: "content"
1030
- }
1031
- },
1032
- "(",
1033
- status,
1034
- ")"
1063
+ flexShrink: isKnownStatus ? 0 : 1,
1064
+ maxWidth: isKnownStatus ? void 0 : "45%",
1065
+ minWidth: 0,
1066
+ ml: 0.5,
1067
+ "& .MuiChip-label": {
1068
+ overflow: "hidden",
1069
+ textOverflow: "ellipsis",
1070
+ whiteSpace: "nowrap"
1071
+ }
1072
+ },
1073
+ title: label,
1074
+ variant: "standard"
1075
+ }
1035
1076
  );
1036
1077
  };
1037
1078
  var PageTitle = ({ title }) => {
@@ -1052,7 +1093,7 @@ var PageTitle = ({ title }) => {
1052
1093
  );
1053
1094
  };
1054
1095
  function PageTitleAndStatus({ title, status }) {
1055
- return /* @__PURE__ */ React14.createElement(Box5, { display: "flex" }, /* @__PURE__ */ React14.createElement(PageTitle, { title }), "\xA0", /* @__PURE__ */ React14.createElement(PageStatus, { status }));
1096
+ return /* @__PURE__ */ React14.createElement(Box5, { alignItems: "center", display: "flex", minWidth: 0 }, /* @__PURE__ */ React14.createElement(PageTitle, { title }), /* @__PURE__ */ React14.createElement(PageStatus, { status }));
1056
1097
  }
1057
1098
 
1058
1099
  // src/components/panel/actions-menu/actions/delete.tsx
@@ -1070,7 +1111,7 @@ import {
1070
1111
  DialogTitle,
1071
1112
  Divider as Divider2
1072
1113
  } from "@elementor/ui";
1073
- import { __ as __9, sprintf as sprintf3 } from "@wordpress/i18n";
1114
+ import { __ as __10, sprintf as sprintf3 } from "@wordpress/i18n";
1074
1115
 
1075
1116
  // src/components/panel/actions-menu/action-menu-item.tsx
1076
1117
  import * as React15 from "react";
@@ -1097,7 +1138,7 @@ function Delete({ post }) {
1097
1138
  return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
1098
1139
  ActionMenuItem,
1099
1140
  {
1100
- title: __9("Delete", "elementor"),
1141
+ title: __10("Delete", "elementor"),
1101
1142
  icon: TrashIcon,
1102
1143
  MenuItemProps: {
1103
1144
  disabled: isDisabled,
@@ -1114,11 +1155,11 @@ function DeleteDialog({
1114
1155
  const { type } = usePostListContext();
1115
1156
  const { deletePost } = usePostActions(type);
1116
1157
  const { setError } = usePostListContext();
1117
- const dialogTitle = sprintf3(__9('Delete "%s"?', "elementor"), post.title.rendered);
1118
- const dialogBody = type === "post" ? __9(
1158
+ const dialogTitle = sprintf3(__10('Delete "%s"?', "elementor"), post.title.rendered);
1159
+ const dialogBody = type === "post" ? __10(
1119
1160
  "The post and its content will be deleted forever and we won\u2019t be able to recover them.",
1120
1161
  "elementor"
1121
- ) : __9(
1162
+ ) : __10(
1122
1163
  "The page and its content will be deleted forever and we won\u2019t be able to recover them.",
1123
1164
  "elementor"
1124
1165
  );
@@ -1144,14 +1185,14 @@ function DeleteDialog({
1144
1185
  onClick: handleCancel,
1145
1186
  disabled: deletePost.isPending
1146
1187
  },
1147
- __9("Cancel", "elementor")
1148
- ), /* @__PURE__ */ React16.createElement(Button, { variant: "contained", color: "error", onClick: deletePage, disabled: deletePost.isPending }, !deletePost.isPending ? __9("Delete", "elementor") : /* @__PURE__ */ React16.createElement(CircularProgress2, null))));
1188
+ __10("Cancel", "elementor")
1189
+ ), /* @__PURE__ */ React16.createElement(Button, { variant: "contained", color: "error", onClick: deletePage, disabled: deletePost.isPending }, !deletePost.isPending ? __10("Delete", "elementor") : /* @__PURE__ */ React16.createElement(CircularProgress2, null))));
1149
1190
  }
1150
1191
 
1151
1192
  // src/components/panel/actions-menu/actions/duplicate.tsx
1152
1193
  import * as React17 from "react";
1153
1194
  import { CopyIcon } from "@elementor/icons";
1154
- import { __ as __10 } from "@wordpress/i18n";
1195
+ import { __ as __11 } from "@wordpress/i18n";
1155
1196
  function Duplicate({ post, popupState }) {
1156
1197
  const { setEditMode, type } = usePostListContext();
1157
1198
  const canCreate = useCanCreate(type);
@@ -1169,7 +1210,7 @@ function Duplicate({ post, popupState }) {
1169
1210
  return /* @__PURE__ */ React17.createElement(
1170
1211
  ActionMenuItem,
1171
1212
  {
1172
- title: __10("Duplicate", "elementor"),
1213
+ title: __11("Duplicate", "elementor"),
1173
1214
  icon: CopyIcon,
1174
1215
  MenuItemProps: {
1175
1216
  disabled: isDisabled,
@@ -1182,13 +1223,13 @@ function Duplicate({ post, popupState }) {
1182
1223
  // src/components/panel/actions-menu/actions/rename.tsx
1183
1224
  import * as React18 from "react";
1184
1225
  import { EraseIcon } from "@elementor/icons";
1185
- import { __ as __11 } from "@wordpress/i18n";
1226
+ import { __ as __12 } from "@wordpress/i18n";
1186
1227
  function Rename({ post }) {
1187
1228
  const { setEditMode } = usePostListContext();
1188
1229
  return /* @__PURE__ */ React18.createElement(
1189
1230
  ActionMenuItem,
1190
1231
  {
1191
- title: __11("Rename", "elementor"),
1232
+ title: __12("Rename", "elementor"),
1192
1233
  icon: EraseIcon,
1193
1234
  MenuItemProps: {
1194
1235
  disabled: !post.user_can.edit,
@@ -1209,7 +1250,7 @@ function Rename({ post }) {
1209
1250
  import * as React19 from "react";
1210
1251
  import { HomeIcon } from "@elementor/icons";
1211
1252
  import { CircularProgress as CircularProgress3 } from "@elementor/ui";
1212
- import { __ as __12 } from "@wordpress/i18n";
1253
+ import { __ as __13 } from "@wordpress/i18n";
1213
1254
 
1214
1255
  // src/hooks/use-homepage-actions.ts
1215
1256
  import { useMutation as useMutation2, useQueryClient as useQueryClient2 } from "@elementor/query";
@@ -1251,7 +1292,7 @@ function SetHome({ post, closeMenu }) {
1251
1292
  return /* @__PURE__ */ React19.createElement(
1252
1293
  ActionMenuItem,
1253
1294
  {
1254
- title: __12("Set as homepage", "elementor"),
1295
+ title: __13("Set as homepage", "elementor"),
1255
1296
  icon: !updateSettingsMutation.isPending ? HomeIcon : CircularProgress3,
1256
1297
  MenuItemProps: {
1257
1298
  disabled: isDisabled,
@@ -1264,10 +1305,10 @@ function SetHome({ post, closeMenu }) {
1264
1305
  // src/components/panel/actions-menu/actions/view.tsx
1265
1306
  import * as React20 from "react";
1266
1307
  import { EyeIcon } from "@elementor/icons";
1267
- import { __ as __13 } from "@wordpress/i18n";
1308
+ import { __ as __14 } from "@wordpress/i18n";
1268
1309
  function View({ post }) {
1269
1310
  const { type } = usePostListContext();
1270
- const title = __13("View %s", "elementor").replace("%s", postTypesMap[type].labels.singular_name);
1311
+ const title = __14("View %s", "elementor").replace("%s", postTypesMap[type].labels.singular_name);
1271
1312
  return /* @__PURE__ */ React20.createElement(
1272
1313
  ActionMenuItem,
1273
1314
  {
@@ -1287,7 +1328,7 @@ var DisabledPostTooltip = ({
1287
1328
  postTypeSlug
1288
1329
  }) => {
1289
1330
  if (isDisabled) {
1290
- const title = /* @__PURE__ */ React21.createElement(Typography4, { variant: "caption" }, getCannotEditPanelItemMessage(postTypeSlug), /* @__PURE__ */ React21.createElement("br", null), __14("To edit it directly, contact the site owner", "elementor"));
1331
+ const title = /* @__PURE__ */ React21.createElement(Typography4, { variant: "caption" }, getCannotEditPanelItemMessage(postTypeSlug), /* @__PURE__ */ React21.createElement("br", null), __15("To edit it directly, contact the site owner", "elementor"));
1291
1332
  return /* @__PURE__ */ React21.createElement(Tooltip, { title, placement: "bottom", arrow: false }, /* @__PURE__ */ React21.createElement("span", null, children));
1292
1333
  }
1293
1334
  return /* @__PURE__ */ React21.createElement(React21.Fragment, null, children);
@@ -1314,7 +1355,7 @@ function ListItemView({ post }) {
1314
1355
  secondaryAction: /* @__PURE__ */ React21.createElement(
1315
1356
  IconButton3,
1316
1357
  {
1317
- "aria-label": __14("More actions", "elementor"),
1358
+ "aria-label": __15("More actions", "elementor"),
1318
1359
  size: "tiny",
1319
1360
  ...menuTriggerProps,
1320
1361
  onClick: (event) => {
@@ -1341,7 +1382,7 @@ function ListItemView({ post }) {
1341
1382
  sx: contentPanelListItemButtonSx
1342
1383
  },
1343
1384
  /* @__PURE__ */ React21.createElement(ListItemText5, { disableTypography: true, sx: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React21.createElement(PageTitleAndStatus, { title, status })),
1344
- post.isHome && /* @__PURE__ */ React21.createElement(HomeIcon2, { titleAccess: __14("Homepage", "elementor"), color: "disabled" })
1385
+ post.isHome && /* @__PURE__ */ React21.createElement(HomeIcon2, { titleAccess: __15("Homepage", "elementor"), color: "disabled" })
1345
1386
  )
1346
1387
  )), /* @__PURE__ */ React21.createElement(
1347
1388
  Menu2,
@@ -1444,7 +1485,7 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
1444
1485
  title: sectionTitle,
1445
1486
  trailingActions: /* @__PURE__ */ React23.createElement(SectionAddButton, { onBeforeCreate: () => setIsOpen(true) })
1446
1487
  },
1447
- showNoResults && /* @__PURE__ */ React23.createElement(Box6, { sx: { py: 2, px: 2 } }, /* @__PURE__ */ React23.createElement(Typography5, { variant: "body2", color: "text.secondary" }, __15("No results found", "elementor"))),
1488
+ showNoResults && /* @__PURE__ */ React23.createElement(Box6, { sx: { py: 2, px: 2 } }, /* @__PURE__ */ React23.createElement(Typography5, { variant: "body2", color: "text.secondary" }, __16("No results found", "elementor"))),
1448
1489
  filteredPosts.map((post) => {
1449
1490
  return /* @__PURE__ */ React23.createElement(PostListItem, { key: post.id, post });
1450
1491
  }),
@@ -1457,7 +1498,7 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
1457
1498
  justifyContent: "center"
1458
1499
  }
1459
1500
  },
1460
- /* @__PURE__ */ React23.createElement(Button2, { onClick: fetchNextPage, color: "secondary" }, isFetchingNextPage ? /* @__PURE__ */ React23.createElement(CircularProgress4, null) : __15("Load more", "elementor"))
1501
+ /* @__PURE__ */ React23.createElement(Button2, { onClick: fetchNextPage, color: "secondary" }, isFetchingNextPage ? /* @__PURE__ */ React23.createElement(CircularProgress4, null) : __16("Load more", "elementor"))
1461
1502
  )
1462
1503
  );
1463
1504
  }
@@ -1465,9 +1506,9 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
1465
1506
  // src/components/panel/user-load-error.tsx
1466
1507
  import * as React24 from "react";
1467
1508
  import { Box as Box7, Typography as Typography6 } from "@elementor/ui";
1468
- import { __ as __16 } from "@wordpress/i18n";
1509
+ import { __ as __17 } from "@wordpress/i18n";
1469
1510
  function UserLoadError() {
1470
- return /* @__PURE__ */ React24.createElement(Box7, { sx: { px: 2, py: 2 } }, /* @__PURE__ */ React24.createElement(Typography6, { variant: "body2", color: "text.secondary" }, __16(
1511
+ return /* @__PURE__ */ React24.createElement(Box7, { sx: { px: 2, py: 2 } }, /* @__PURE__ */ React24.createElement(Typography6, { variant: "body2", color: "text.secondary" }, __17(
1471
1512
  "We couldn\u2019t load your content permissions. Try closing and reopening this panel.",
1472
1513
  "elementor"
1473
1514
  )));
@@ -1503,7 +1544,7 @@ var Shell = () => {
1503
1544
  ...contentPanelHeaderStackSx
1504
1545
  }
1505
1546
  },
1506
- /* @__PURE__ */ React26.createElement(PanelHeaderTitle, { sx: { flex: 1, minWidth: 0, textAlign: "start" } }, __17("Site content", "elementor")),
1547
+ /* @__PURE__ */ React26.createElement(PanelHeaderTitle, { sx: { flex: 1, minWidth: 0, textAlign: "start" } }, __18("Site content", "elementor")),
1507
1548
  /* @__PURE__ */ React26.createElement(ContentPanelHeaderAdd, null)
1508
1549
  )), /* @__PURE__ */ React26.createElement(Divider4, null), /* @__PURE__ */ React26.createElement(PanelBody, null, /* @__PURE__ */ React26.createElement(ContentPanelSearch, null), /* @__PURE__ */ React26.createElement(
1509
1550
  ShellPanelBodyContent,
@@ -1541,7 +1582,7 @@ import {
1541
1582
  MenuItem as MenuItem5,
1542
1583
  usePopupState as usePopupState3
1543
1584
  } from "@elementor/ui";
1544
- import { __ as __19 } from "@wordpress/i18n";
1585
+ import { __ as __20 } from "@wordpress/i18n";
1545
1586
 
1546
1587
  // src/components/top-bar/create-post-list-item.tsx
1547
1588
  import * as React27 from "react";
@@ -1549,7 +1590,7 @@ import { __useNavigateToDocument as useNavigateToDocument4 } from "@elementor/ed
1549
1590
  import { useMixpanel } from "@elementor/events";
1550
1591
  import { PlusIcon as PlusIcon2 } from "@elementor/icons";
1551
1592
  import { CircularProgress as CircularProgress5, ListItemIcon as ListItemIcon3, ListItemText as ListItemText6, MenuItem as MenuItem3 } from "@elementor/ui";
1552
- import { __ as __18 } from "@wordpress/i18n";
1593
+ import { __ as __19 } from "@wordpress/i18n";
1553
1594
 
1554
1595
  // src/hooks/use-create-page.ts
1555
1596
  import { useState as useState7 } from "react";
@@ -1608,7 +1649,7 @@ function CreatePostListItem({ closePopup, ...props }) {
1608
1649
  ListItemText6,
1609
1650
  {
1610
1651
  primaryTypographyProps: { variant: "body2" },
1611
- primary: __18("Add new page", "elementor")
1652
+ primary: __19("Add new page", "elementor")
1612
1653
  }
1613
1654
  )
1614
1655
  );
@@ -1645,13 +1686,13 @@ import { ListItemText as ListItemText7, MenuItem as MenuItem4 } from "@elementor
1645
1686
  // src/components/top-bar/chip-doc-type.tsx
1646
1687
  import * as React29 from "react";
1647
1688
  import { PostTypeIcon as PostTypeIcon3 } from "@elementor/icons";
1648
- import { Chip as Chip2 } from "@elementor/ui";
1689
+ import { Chip as Chip3 } from "@elementor/ui";
1649
1690
  var iconsMap2 = getIconsMap();
1650
1691
  function DocTypeChip({ postType, docType, label }) {
1651
1692
  const color = "elementor_library" === postType ? "global" : "accent";
1652
1693
  const Icon = iconsMap2[docType] || PostTypeIcon3;
1653
1694
  return /* @__PURE__ */ React29.createElement(
1654
- Chip2,
1695
+ Chip3,
1655
1696
  {
1656
1697
  component: "span",
1657
1698
  size: "small",
@@ -1756,7 +1797,7 @@ function RecentlyEdited() {
1756
1797
  Menu3,
1757
1798
  {
1758
1799
  MenuListProps: {
1759
- subheader: /* @__PURE__ */ React31.createElement(ListSubheader, { sx: { color: "accent.main", fontStyle: "italic", fontWeight: "300" } }, __19("Recent", "elementor"))
1800
+ subheader: /* @__PURE__ */ React31.createElement(ListSubheader, { sx: { color: "accent.main", fontStyle: "italic", fontWeight: "300" } }, __20("Recent", "elementor"))
1760
1801
  },
1761
1802
  PaperProps: { sx: { mt: 2.5, width: 320 } },
1762
1803
  ...bindMenu3(popupState)
@@ -1769,7 +1810,7 @@ function RecentlyEdited() {
1769
1810
  variant: "caption",
1770
1811
  fontStyle: "italic"
1771
1812
  },
1772
- primary: __19("There are no other pages or templates on this site yet.", "elementor")
1813
+ primary: __20("There are no other pages or templates on this site yet.", "elementor")
1773
1814
  }
1774
1815
  )),
1775
1816
  /* @__PURE__ */ React31.createElement(Divider5, { disabled: recentPosts.length === 0 }),
@@ -1779,12 +1820,12 @@ function RecentlyEdited() {
1779
1820
 
1780
1821
  // src/hooks/use-toggle-button-props.ts
1781
1822
  import { PagesIcon } from "@elementor/icons";
1782
- import { __ as __20 } from "@wordpress/i18n";
1823
+ import { __ as __21 } from "@wordpress/i18n";
1783
1824
  function useToggleButtonProps() {
1784
1825
  const { isOpen: selectedState, isBlocked } = usePanelStatus();
1785
1826
  const { open, close } = usePanelActions();
1786
1827
  return {
1787
- title: __20("Site content", "elementor"),
1828
+ title: __21("Site content", "elementor"),
1788
1829
  icon: PagesIcon,
1789
1830
  onClick: () => {
1790
1831
  const extendedWindow = window;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-site-navigation",
3
- "version": "4.5.0-1209",
3
+ "version": "4.5.0-1210",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,16 +39,16 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor-app-bar": "4.5.0-1209",
43
- "@elementor/editor-documents": "4.5.0-1209",
44
- "@elementor/editor-panels": "4.5.0-1209",
45
- "@elementor/editor-sidebar": "4.5.0-1209",
46
- "@elementor/editor-ui": "4.5.0-1209",
47
- "@elementor/editor-v1-adapters": "4.5.0-1209",
48
- "@elementor/env": "4.5.0-1209",
42
+ "@elementor/editor-app-bar": "4.5.0-1210",
43
+ "@elementor/editor-documents": "4.5.0-1210",
44
+ "@elementor/editor-panels": "4.5.0-1210",
45
+ "@elementor/editor-sidebar": "4.5.0-1210",
46
+ "@elementor/editor-ui": "4.5.0-1210",
47
+ "@elementor/editor-v1-adapters": "4.5.0-1210",
48
+ "@elementor/env": "4.5.0-1210",
49
49
  "@elementor/icons": "~1.78.1",
50
- "@elementor/events": "4.5.0-1209",
51
- "@elementor/query": "4.5.0-1209",
50
+ "@elementor/events": "4.5.0-1210",
51
+ "@elementor/query": "4.5.0-1210",
52
52
  "@elementor/ui": "1.41.4",
53
53
  "@wordpress/api-fetch": "^6.42.0",
54
54
  "@wordpress/i18n": "^5.13.0"
@@ -1,29 +1,83 @@
1
1
  import * as React from 'react';
2
- import { Box, Typography } from '@elementor/ui';
2
+ import { Box, Chip, type ChipProps, Typography } from '@elementor/ui';
3
+ import { __ } from '@wordpress/i18n';
3
4
 
4
5
  import { useReverseHtmlEntities } from '../../hooks/use-reverse-html-entities';
5
6
  import { contentPanelListRowTitleSx } from '../panel/content-panel-chrome';
6
7
 
8
+ type StatusChipConfig = {
9
+ color: ChipProps[ 'color' ];
10
+ label: string;
11
+ };
12
+
13
+ function humanizeStatusSlug( status: string ): string {
14
+ return status.replace( /[-_]+/g, ' ' ).trim();
15
+ }
16
+
17
+ const statusChipConfig: Record< string, StatusChipConfig > = {
18
+ draft: {
19
+ color: 'default',
20
+ label: __( 'Draft', 'elementor' ),
21
+ },
22
+ future: {
23
+ color: 'default',
24
+ label: __( 'Scheduled', 'elementor' ),
25
+ },
26
+ pending: {
27
+ color: 'warning',
28
+ label: __( 'Pending Review', 'elementor' ),
29
+ },
30
+ private: {
31
+ color: 'default',
32
+ label: __( 'Private', 'elementor' ),
33
+ },
34
+ };
35
+
36
+ export function getStatusChipConfig( status: string ): StatusChipConfig {
37
+ const known = statusChipConfig[ status ];
38
+
39
+ if ( known ) {
40
+ return known;
41
+ }
42
+
43
+ return {
44
+ color: 'default',
45
+ label: humanizeStatusSlug( status ),
46
+ };
47
+ }
48
+
49
+ function isKnownPanelStatus( status: string ): boolean {
50
+ return status in statusChipConfig;
51
+ }
52
+
7
53
  const PageStatus = ( { status }: { status: string } ) => {
8
54
  if ( 'publish' === status ) {
9
55
  return null;
10
56
  }
11
57
 
58
+ const { color, label } = getStatusChipConfig( status );
59
+ const isKnownStatus = isKnownPanelStatus( status );
60
+
12
61
  return (
13
- <Typography
62
+ <Chip
63
+ color={ color }
14
64
  component="span"
15
- variant="body2"
16
- color="text.secondary"
65
+ label={ label }
66
+ size="tiny"
17
67
  sx={ {
18
- ...contentPanelListRowTitleSx,
19
- textTransform: 'capitalize',
20
- fontStyle: 'italic',
21
- whiteSpace: 'nowrap',
22
- flexBasis: 'content',
68
+ flexShrink: isKnownStatus ? 0 : 1,
69
+ maxWidth: isKnownStatus ? undefined : '45%',
70
+ minWidth: 0,
71
+ ml: 0.5,
72
+ '& .MuiChip-label': {
73
+ overflow: 'hidden',
74
+ textOverflow: 'ellipsis',
75
+ whiteSpace: 'nowrap',
76
+ },
23
77
  } }
24
- >
25
- ({ status })
26
- </Typography>
78
+ title={ label }
79
+ variant="standard"
80
+ />
27
81
  );
28
82
  };
29
83
 
@@ -48,9 +102,8 @@ const PageTitle = ( { title }: { title: string } ) => {
48
102
 
49
103
  export default function PageTitleAndStatus( { title, status }: { title: string; status: string } ) {
50
104
  return (
51
- <Box display="flex">
105
+ <Box alignItems="center" display="flex" minWidth={ 0 }>
52
106
  <PageTitle title={ title } />
53
- &nbsp;
54
107
  <PageStatus status={ status } />
55
108
  </Box>
56
109
  );