@plumile/backoffice-react 0.1.115 → 0.1.117

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.
Files changed (72) hide show
  1. package/lib/esm/auth/authRefreshNotice.css.js +1 -0
  2. package/lib/esm/components/backoffice/billing/BackofficeBillingUsageChart.js +60 -0
  3. package/lib/esm/components/backoffice/billing/BackofficeBillingUsageChart.js.map +1 -0
  4. package/lib/esm/components/backoffice/billing/backofficeBillingUsageChart.css.js +7 -0
  5. package/lib/esm/components/backoffice/billing/backofficeBillingUsageChart.css.js.map +1 -0
  6. package/lib/esm/components/backoffice/columns/buildDataTableColumns.js +6 -6
  7. package/lib/esm/components/backoffice/detail/BackofficeDetailFlagTag.css.js +0 -1
  8. package/lib/esm/components/backoffice/layout/buildSidebarSections.js +154 -135
  9. package/lib/esm/components/backoffice/layout/buildSidebarSections.js.map +1 -1
  10. package/lib/esm/components/backoffice/layout/sidebarUtils.js +24 -21
  11. package/lib/esm/components/backoffice/layout/sidebarUtils.js.map +1 -1
  12. package/lib/esm/components/backoffice/links/resolveBackofficeLink.js +62 -54
  13. package/lib/esm/components/backoffice/links/resolveBackofficeLink.js.map +1 -1
  14. package/lib/esm/components/backoffice/links/resolveBackofficeTargetIcon.js +1 -1
  15. package/lib/esm/components/backoffice/links/resolveBackofficeTargetIcon.js.map +1 -1
  16. package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js +271 -263
  17. package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js.map +1 -1
  18. package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js +2 -2
  19. package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js.map +1 -1
  20. package/lib/esm/components/backoffice/scaffolds/backofficeListScrollMode.js +6 -0
  21. package/lib/esm/components/backoffice/scaffolds/backofficeListScrollMode.js.map +1 -0
  22. package/lib/esm/index.js +75 -74
  23. package/lib/esm/pages/BackofficeDashboardPage.helpers.js +1 -0
  24. package/lib/esm/pages/BackofficeDashboardPage.helpers.js.map +1 -1
  25. package/lib/esm/pages/BackofficeDashboardPage.js +181 -154
  26. package/lib/esm/pages/BackofficeDashboardPage.js.map +1 -1
  27. package/lib/esm/pages/BackofficeEntityDetailPage.js +12 -12
  28. package/lib/esm/pages/BackofficeLayoutPage.js +134 -129
  29. package/lib/esm/pages/BackofficeLayoutPage.js.map +1 -1
  30. package/lib/esm/provider/BackofficeConfigContext.js.map +1 -1
  31. package/lib/esm/provider/BackofficeProvider.js +126 -121
  32. package/lib/esm/provider/BackofficeProvider.js.map +1 -1
  33. package/lib/esm/provider/dashboardRegistrations.js +17 -0
  34. package/lib/esm/provider/dashboardRegistrations.js.map +1 -0
  35. package/lib/esm/router/createBackofficeRoutes.js +148 -131
  36. package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
  37. package/lib/types/components/backoffice/billing/BackofficeBillingUsageChart.d.ts +25 -0
  38. package/lib/types/components/backoffice/billing/BackofficeBillingUsageChart.d.ts.map +1 -0
  39. package/lib/types/components/backoffice/billing/BackofficeBillingUsageChart.stories.d.ts +41 -0
  40. package/lib/types/components/backoffice/billing/BackofficeBillingUsageChart.stories.d.ts.map +1 -0
  41. package/lib/types/components/backoffice/billing/backofficeBillingUsageChart.css.d.ts +4 -0
  42. package/lib/types/components/backoffice/billing/backofficeBillingUsageChart.css.d.ts.map +1 -0
  43. package/lib/types/components/backoffice/layout/buildSidebarSections.d.ts +2 -1
  44. package/lib/types/components/backoffice/layout/buildSidebarSections.d.ts.map +1 -1
  45. package/lib/types/components/backoffice/layout/sidebarUtils.d.ts +1 -0
  46. package/lib/types/components/backoffice/layout/sidebarUtils.d.ts.map +1 -1
  47. package/lib/types/components/backoffice/links/resolveBackofficeLink.d.ts.map +1 -1
  48. package/lib/types/components/backoffice/links/types.d.ts +1 -0
  49. package/lib/types/components/backoffice/links/types.d.ts.map +1 -1
  50. package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts.map +1 -1
  51. package/lib/types/components/backoffice/scaffolds/backofficeEntityListScaffold.css.d.ts +1 -0
  52. package/lib/types/components/backoffice/scaffolds/backofficeEntityListScaffold.css.d.ts.map +1 -1
  53. package/lib/types/components/backoffice/scaffolds/backofficeListScrollMode.d.ts +2 -0
  54. package/lib/types/components/backoffice/scaffolds/backofficeListScrollMode.d.ts.map +1 -0
  55. package/lib/types/index.d.ts +2 -1
  56. package/lib/types/index.d.ts.map +1 -1
  57. package/lib/types/pages/BackofficeDashboardPage.d.ts +5 -1
  58. package/lib/types/pages/BackofficeDashboardPage.d.ts.map +1 -1
  59. package/lib/types/pages/BackofficeDashboardPage.helpers.d.ts.map +1 -1
  60. package/lib/types/pages/BackofficeDashboardPage.stories.d.ts +9 -0
  61. package/lib/types/pages/BackofficeDashboardPage.stories.d.ts.map +1 -0
  62. package/lib/types/pages/BackofficeLayoutPage.d.ts.map +1 -1
  63. package/lib/types/provider/BackofficeConfigContext.d.ts +2 -1
  64. package/lib/types/provider/BackofficeConfigContext.d.ts.map +1 -1
  65. package/lib/types/provider/BackofficeProvider.d.ts.map +1 -1
  66. package/lib/types/provider/dashboardRegistrations.d.ts +4 -0
  67. package/lib/types/provider/dashboardRegistrations.d.ts.map +1 -0
  68. package/lib/types/provider/types.d.ts +8 -1
  69. package/lib/types/provider/types.d.ts.map +1 -1
  70. package/lib/types/router/createBackofficeRoutes.d.ts +8 -2
  71. package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
  72. package/package.json +13 -13
@@ -1,3 +1,4 @@
1
+ /* empty css */
1
2
  /* empty css */
2
3
  //#region src/auth/authRefreshNotice.css.ts
3
4
  var e = "tc0xii0 txvbqbptp txvbqb9ip txvbqbcp txvbqbaog txvbqb8y txvbqbuwp", t = "tc0xii1", n = "txvbqbfcp";
@@ -0,0 +1,60 @@
1
+ import { rangeText as e, root as t, totalValue as n } from "./backofficeBillingUsageChart.css.js";
2
+ import { useMemo as r } from "react";
3
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
4
+ import { FormattedDate as o } from "@plumile/ui/atomic/atoms/formatted-date/FormattedDate.js";
5
+ import { TimeSeriesLineChart as s } from "@plumile/ui/components/charts/TimeSeriesLineChart.js";
6
+ import { formatCurrencyAmount as c } from "@plumile/ui/shared/currencyAmount.js";
7
+ import { toUtcDailyCategorySeries as l } from "@plumile/ui/shared/timeSeries.js";
8
+ //#region src/components/backoffice/billing/BackofficeBillingUsageChart.tsx
9
+ var u = "->", d = ({ ariaLabel: d, buckets: f, categories: p, currency: m, emptyLabel: h, from: g, rangePrefix: _, to: v, totalAmount: y }) => {
10
+ let b = r(() => p.map((e) => e.id), [p]), x = r(() => Object.fromEntries(p.map((e) => [e.id, e.color])), [p]), S = r(() => Object.fromEntries(p.map((e) => [e.id, e.label])), [p]), C = r(() => g == null || v == null ? [] : l({
11
+ fromIsoDateTime: g,
12
+ toIsoDateTime: v,
13
+ buckets: f,
14
+ categories: b
15
+ }), [
16
+ f,
17
+ b,
18
+ g,
19
+ v
20
+ ]), w = (e) => c({
21
+ amount: e,
22
+ currency: m
23
+ });
24
+ return f.length === 0 ? /* @__PURE__ */ i("p", {
25
+ className: e,
26
+ children: h
27
+ }) : /* @__PURE__ */ a("div", {
28
+ className: t,
29
+ children: [
30
+ /* @__PURE__ */ i("p", {
31
+ className: n,
32
+ children: w(y)
33
+ }),
34
+ g != null && v != null && /* @__PURE__ */ a("p", {
35
+ className: "txvbqb8p txvbqbva3 txvbqbfcp",
36
+ children: [
37
+ _,
38
+ " ",
39
+ /* @__PURE__ */ i(o, { value: g }),
40
+ " ",
41
+ u,
42
+ " ",
43
+ /* @__PURE__ */ i(o, { value: v })
44
+ ]
45
+ }),
46
+ /* @__PURE__ */ i(s, {
47
+ ariaLabel: d,
48
+ categoryColorById: x,
49
+ categoryLabel: (e) => S[e] ?? e,
50
+ categoryOrder: b,
51
+ formatValue: w,
52
+ series: C
53
+ })
54
+ ]
55
+ });
56
+ };
57
+ //#endregion
58
+ export { d as BackofficeBillingUsageChart, d as default };
59
+
60
+ //# sourceMappingURL=BackofficeBillingUsageChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BackofficeBillingUsageChart.js","names":[],"sources":["../../../../../src/components/backoffice/billing/BackofficeBillingUsageChart.tsx"],"sourcesContent":["import { useMemo, type JSX } from 'react';\nimport { FormattedDate } from '@plumile/ui/atomic/atoms/formatted-date/FormattedDate.js';\nimport { TimeSeriesLineChart } from '@plumile/ui/components/charts/TimeSeriesLineChart.js';\nimport { formatCurrencyAmount } from '@plumile/ui/shared/currencyAmount.js';\nimport { toUtcDailyCategorySeries } from '@plumile/ui/shared/timeSeries.js';\n\nimport * as styles from './backofficeBillingUsageChart.css.js';\n\nexport type BackofficeBillingUsageChartBucket = {\n readonly day: string;\n readonly category: string;\n readonly value: number;\n};\n\nexport type BackofficeBillingUsageChartCategory = {\n readonly id: string;\n readonly label: string;\n readonly color: string;\n};\n\nexport type BackofficeBillingUsageChartProps = {\n readonly currency: string;\n readonly totalAmount: number;\n readonly from: string | null;\n readonly to: string | null;\n readonly buckets: readonly BackofficeBillingUsageChartBucket[];\n readonly categories: readonly BackofficeBillingUsageChartCategory[];\n readonly emptyLabel: string;\n readonly rangePrefix: string;\n readonly ariaLabel: string;\n};\n\nconst dateSeparator = '->';\n\nexport const BackofficeBillingUsageChart = ({\n ariaLabel,\n buckets,\n categories,\n currency,\n emptyLabel,\n from,\n rangePrefix,\n to,\n totalAmount,\n}: BackofficeBillingUsageChartProps): JSX.Element => {\n const categoryOrder = useMemo(() => {\n return categories.map((category) => {\n return category.id;\n });\n }, [categories]);\n\n const categoryColorById = useMemo(() => {\n return Object.fromEntries(\n categories.map((category) => {\n return [category.id, category.color];\n }),\n );\n }, [categories]);\n\n const categoryLabelById = useMemo(() => {\n return Object.fromEntries(\n categories.map((category) => {\n return [category.id, category.label];\n }),\n );\n }, [categories]);\n\n const series = useMemo(() => {\n if (from == null || to == null) {\n return [];\n }\n\n return toUtcDailyCategorySeries({\n fromIsoDateTime: from,\n toIsoDateTime: to,\n buckets,\n categories: categoryOrder,\n });\n }, [buckets, categoryOrder, from, to]);\n\n const formatChartValue = (value: number): string => {\n return formatCurrencyAmount({\n amount: value,\n currency,\n });\n };\n\n if (buckets.length === 0) {\n return <p className={styles.rangeText}>{emptyLabel}</p>;\n }\n\n return (\n <div className={styles.root}>\n <p className={styles.totalValue}>{formatChartValue(totalAmount)}</p>\n {from != null && to != null && (\n <p className={styles.rangeText}>\n {rangePrefix} <FormattedDate value={from} /> {dateSeparator}{' '}\n <FormattedDate value={to} />\n </p>\n )}\n <TimeSeriesLineChart\n ariaLabel={ariaLabel}\n categoryColorById={categoryColorById}\n categoryLabel={(category) => {\n return categoryLabelById[category] ?? category;\n }}\n categoryOrder={categoryOrder}\n formatValue={formatChartValue}\n series={series}\n />\n </div>\n );\n};\n\nexport default BackofficeBillingUsageChart;\n"],"mappings":";;;;;;;;AAgCA,IAAM,IAAgB,MAET,KAA+B,EAC1C,cACA,YACA,eACA,aACA,eACA,SACA,gBACA,OACA,qBACmD;CACnD,IAAM,IAAgB,QACb,EAAW,KAAK,MACd,EAAS,GAChB,EACD,CAAC,EAAW,CAAC,EAEV,IAAoB,QACjB,OAAO,YACZ,EAAW,KAAK,MACP,CAAC,EAAS,IAAI,EAAS,MAAM,CACpC,CACH,EACA,CAAC,EAAW,CAAC,EAEV,IAAoB,QACjB,OAAO,YACZ,EAAW,KAAK,MACP,CAAC,EAAS,IAAI,EAAS,MAAM,CACpC,CACH,EACA,CAAC,EAAW,CAAC,EAEV,IAAS,QACT,KAAQ,QAAQ,KAAM,OACjB,EAAE,GAGJ,EAAyB;EAC9B,iBAAiB;EACjB,eAAe;EACf;EACA,YAAY;EACb,CAAC,EACD;EAAC;EAAS;EAAe;EAAM;EAAG,CAAC,EAEhC,KAAoB,MACjB,EAAqB;EAC1B,QAAQ;EACR;EACD,CAAC;CAOJ,OAJI,EAAQ,WAAW,IACd,kBAAC,KAAD;EAAG,WAAW;YAAmB;EAAe,CAAA,GAIvD,kBAAC,OAAD;EAAK,WAAW;YAAhB;GACE,kBAAC,KAAD;IAAG,WAAW;cAAoB,EAAiB,EAAY;IAAK,CAAA;GACnE,KAAQ,QAAQ,KAAM,QACrB,kBAAC,KAAD;IAAG,WAAW;cAAd;KACG;KAAY;KAAC,kBAAC,GAAD,EAAe,OAAO,GAAQ,CAAA;;KAAE;KAAe;KAC7D,kBAAC,GAAD,EAAe,OAAO,GAAM,CAAA;KAC1B;;GAEN,kBAAC,GAAD;IACa;IACQ;IACnB,gBAAgB,MACP,EAAkB,MAAa;IAEzB;IACf,aAAa;IACL;IACR,CAAA;GACE"}
@@ -0,0 +1,7 @@
1
+ /* empty css */
2
+ //#region src/components/backoffice/billing/backofficeBillingUsageChart.css.ts
3
+ var e = "txvbqb9ip txvbqbai7 txvbqbaog", t = "txvbqb9y txvbqba9 txvbqbamp txvbqbv9z txvbqbfcp", n = "txvbqb8p txvbqbva3 txvbqbfcp";
4
+ //#endregion
5
+ export { n as rangeText, e as root, t as totalValue };
6
+
7
+ //# sourceMappingURL=backofficeBillingUsageChart.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backofficeBillingUsageChart.css.js","names":[],"sources":["../../../../../src/components/backoffice/billing/backofficeBillingUsageChart.css.ts"],"sourcesContent":["import { sprinkles } from '@plumile/ui/theme/sprinkles.css.js';\n\nexport const root = sprinkles({\n display: 'flex',\n flexDirection: 'column',\n gap: 3,\n});\n\nexport const totalValue = sprinkles({\n fontSize: {\n base: '2xl',\n md: '3xl',\n },\n fontWeight: 'semibold',\n color: 'text',\n margin: 0,\n});\n\nexport const rangeText = sprinkles({\n fontSize: 'xs',\n color: 'textMuted',\n margin: 0,\n});\n"],"mappings":""}
@@ -1,8 +1,8 @@
1
1
  import { BackofficeInlineLink as e } from "../links/BackofficeInlineLink.js";
2
2
  import { Fragment as t, jsx as n } from "react/jsx-runtime";
3
- import { BACKOFFICE_DATE_TIME_OPTIONS as r } from "@plumile/backoffice-core/constants.js";
4
- import i from "@plumile/router/routing/Link.js";
5
- import { FormattedDate as a } from "@plumile/ui/atomic/atoms/formatted-date/FormattedDate.js";
3
+ import { FormattedDate as r } from "@plumile/ui/atomic/atoms/formatted-date/FormattedDate.js";
4
+ import { BACKOFFICE_DATE_TIME_OPTIONS as i } from "@plumile/backoffice-core/constants.js";
5
+ import a from "@plumile/router/routing/Link.js";
6
6
  import { Tag as o } from "@plumile/ui/backoffice/atoms/tag/Tag.js";
7
7
  //#region src/components/backoffice/columns/buildDataTableColumns.tsx
8
8
  var s = (e, t) => e(t), c = (e, t) => e == null || typeof e == "string" && e.trim() === "" ? t : String(e), l = (e) => {
@@ -25,7 +25,7 @@ function u(u, d) {
25
25
  case "text": return c(l.value(s), m);
26
26
  case "link": {
27
27
  let e = l.value(s);
28
- return e == null || typeof e == "string" && e.trim() === "" ? m : /* @__PURE__ */ n(i, {
28
+ return e == null || typeof e == "string" && e.trim() === "" ? m : /* @__PURE__ */ n(a, {
29
29
  to: l.to(s),
30
30
  children: e
31
31
  });
@@ -39,10 +39,10 @@ function u(u, d) {
39
39
  children: e
40
40
  });
41
41
  }
42
- case "dateTime": return /* @__PURE__ */ n(a, {
42
+ case "dateTime": return /* @__PURE__ */ n(r, {
43
43
  value: l.value(s),
44
44
  fallback: m,
45
- options: r
45
+ options: i
46
46
  });
47
47
  case "entityRef": {
48
48
  let t = l.value(s);
@@ -1,4 +1,3 @@
1
- /* empty css */
2
1
  /* empty css */
3
2
  //#region src/components/backoffice/detail/BackofficeDetailFlagTag.css.ts
4
3
  var e = "txvbqb9ip txvbqbcp txvbqbao7", t = "_1lzrtns0 txvbqb9ip txvbqbcp", n = "_1lzrtns1";
@@ -1,74 +1,80 @@
1
- import { buildEntityGroupLookup as e, isActivePath as t, resolveGroupItems as n, resolveHubEntityIds as r, resolveLabel as i, resolveSidebarGroups as a, resolveSidebarHub as o } from "./sidebarUtils.js";
2
- import { actionButton as s } from "./backofficeSidebarActions.css.js";
3
- import { jsx as c } from "react/jsx-runtime";
4
- import { SidebarTasksSvg as l } from "@plumile/ui/icons/SidebarTasksSvg.js";
5
- import { SidebarHomeSvg as u } from "@plumile/ui/icons/SidebarHomeSvg.js";
6
- import { BackofficeSidebarHistorySvg as d } from "@plumile/ui/icons/backoffice/BackofficeSidebarHistorySvg.js";
7
- import { GripDotsSvg as f } from "@plumile/ui/icons/GripDotsSvg.js";
8
- import { PinFilledSvg as p } from "@plumile/ui/icons/PinFilledSvg.js";
9
- import { PinSvg as m } from "@plumile/ui/icons/PinSvg.js";
1
+ import { buildEntityGroupLookup as e, isActivePath as t, joinBackofficePath as n, resolveGroupItems as r, resolveHubEntityIds as i, resolveLabel as a, resolveSidebarGroups as o, resolveSidebarHub as s } from "./sidebarUtils.js";
2
+ import { actionButton as c } from "./backofficeSidebarActions.css.js";
3
+ import { findBackofficeDashboardRegistration as l } from "../../../provider/dashboardRegistrations.js";
4
+ import { jsx as u } from "react/jsx-runtime";
5
+ import { SidebarTasksSvg as d } from "@plumile/ui/icons/SidebarTasksSvg.js";
6
+ import { SidebarHomeSvg as f } from "@plumile/ui/icons/SidebarHomeSvg.js";
7
+ import { BackofficeSidebarHistorySvg as p } from "@plumile/ui/icons/backoffice/BackofficeSidebarHistorySvg.js";
8
+ import { GripDotsSvg as m } from "@plumile/ui/icons/GripDotsSvg.js";
9
+ import { PinFilledSvg as h } from "@plumile/ui/icons/PinFilledSvg.js";
10
+ import { PinSvg as g } from "@plumile/ui/icons/PinSvg.js";
10
11
  //#region src/components/backoffice/layout/buildSidebarSections.tsx
11
- var h = (e, t, n = 18) => e == null ? t ?? null : /* @__PURE__ */ c(e, {
12
+ var _ = (e, t, n = 18) => e == null ? t ?? null : /* @__PURE__ */ u(e, {
12
13
  width: n,
13
14
  height: n,
14
15
  "aria-hidden": "true"
15
16
  });
16
- function g(g) {
17
- let { basePath: _, pathname: v, entities: y, sidebar: b, permissions: x, searchQuery: S, tApp: C, t: w, pinnedEntityIds: T = [], recentItems: E = [], onTogglePin: D, onReorderPin: O, collapsedByGroupId: k, onGroupCollapsedChange: A, sidebarCollapsed: j = !1 } = g, M = a(y, b), N = Object.entries(M), P = new Set(T), F = w("sidebar.actions.pin"), I = w("sidebar.actions.unpin"), L = w("sidebar.actions.reorder"), R = e(M, b), z = S?.trim().toLowerCase() ?? "", B = (e) => z === "" || e.toLowerCase().includes(z), V = (e) => {
18
- if (D == null) return null;
19
- let t = P.has(e), n = F, r = m;
20
- return t && (n = I, r = p), /* @__PURE__ */ c("button", {
17
+ function v(v) {
18
+ let { basePath: y, pathname: b, entities: x, dashboards: S = [], sidebar: C, permissions: w, searchQuery: T, tApp: E, t: D, pinnedEntityIds: O = [], recentItems: k = [], onTogglePin: A, onReorderPin: j, collapsedByGroupId: M, onGroupCollapsedChange: N, sidebarCollapsed: P = !1 } = v, F = o(x, C), I = Object.entries(F), L = new Set(O), R = D("sidebar.actions.pin"), z = D("sidebar.actions.unpin"), B = D("sidebar.actions.reorder"), V = e(F, C), H = T?.trim().toLowerCase() ?? "", U = (e) => H === "" || e.toLowerCase().includes(H), W = (e) => {
19
+ if (A == null) return null;
20
+ let t = L.has(e), n = R, r = g;
21
+ return t && (n = z, r = h), /* @__PURE__ */ u("button", {
21
22
  type: "button",
22
- className: s,
23
+ className: c,
23
24
  "aria-pressed": t,
24
25
  "aria-label": n,
25
26
  title: n,
26
27
  onClick: (t) => {
27
- t.preventDefault(), t.stopPropagation(), D(e);
28
+ t.preventDefault(), t.stopPropagation(), A(e);
28
29
  },
29
- children: /* @__PURE__ */ c(r, {
30
+ children: /* @__PURE__ */ u(r, {
30
31
  width: 14,
31
32
  height: 14,
32
33
  "aria-hidden": "true"
33
34
  })
34
35
  });
35
- }, H = (e) => {
36
- if (b?.isItemVisible?.({
36
+ }, G = (e, r) => {
37
+ let i = e?.id ?? "dashboard", o = {
37
38
  kind: "dashboard",
38
- id: "dashboard"
39
- }, x) === !1) return null;
40
- let n = w("sidebar.items.dashboard");
41
- return B(n) ? {
42
- id: "dashboard",
39
+ id: i
40
+ };
41
+ if (C?.isItemVisible?.(o, w) === !1) return null;
42
+ let s = l(S, i), c = e?.label;
43
+ if (c == null && s != null && (c = a(s.label, E)), c ??= D("sidebar.items.dashboard"), !U(c)) return null;
44
+ let d = y, p = "dashboard";
45
+ i !== "dashboard" && (d = n(y, `dashboard/${i}`), p = `dashboard-${i}`);
46
+ let m = t(b, d);
47
+ return i === "dashboard" && (m = b === y || b === `${y}/dashboard`), {
48
+ id: p,
43
49
  data: {
44
50
  kind: "dashboard",
45
- id: "dashboard",
46
- groupId: e
51
+ id: i,
52
+ groupId: r
47
53
  },
48
- label: n,
49
- href: _,
50
- icon: h(void 0, /* @__PURE__ */ c(u, {
54
+ label: c,
55
+ href: d,
56
+ icon: _(e?.icon ?? s?.icon, /* @__PURE__ */ u(f, {
51
57
  width: 18,
52
58
  height: 18,
53
59
  "aria-hidden": "true"
54
60
  })),
55
- isActive: t(v, _),
56
- ariaLabel: n
57
- } : null;
58
- }, U = (e) => {
59
- let { entityId: n, groupId: r, groupIcon: a, itemIcon: o, itemLabel: s, enableReorder: u } = e, d = y[n];
60
- if (d == null) return null;
61
- let p = {
61
+ isActive: m,
62
+ ariaLabel: c
63
+ };
64
+ }, K = (e) => {
65
+ let { entityId: n, groupId: r, groupIcon: i, itemIcon: o, itemLabel: s, enableReorder: c } = e, l = x[n];
66
+ if (l == null) return null;
67
+ let f = {
62
68
  kind: "entity",
63
69
  id: n
64
70
  };
65
- if (d.kind === "tool" && (p = {
71
+ if (l.kind === "tool" && (f = {
66
72
  kind: "tool",
67
73
  id: n
68
- }), b?.isItemVisible?.(p, x) === !1) return null;
69
- if (d.kind === "tool") {
70
- let e = s ?? i(d.label, C);
71
- return z !== "" && !e.toLowerCase().includes(z) ? null : {
74
+ }), C?.isItemVisible?.(f, w) === !1) return null;
75
+ if (l.kind === "tool") {
76
+ let e = s ?? a(l.label, E);
77
+ return H !== "" && !e.toLowerCase().includes(H) ? null : {
72
78
  id: `tool-${n}`,
73
79
  data: {
74
80
  kind: "tool",
@@ -76,69 +82,69 @@ function g(g) {
76
82
  groupId: r
77
83
  },
78
84
  label: e,
79
- href: d.routes.list,
80
- icon: h(o ?? a, /* @__PURE__ */ c(l, {
85
+ href: l.routes.list,
86
+ icon: _(o ?? i, /* @__PURE__ */ u(d, {
81
87
  width: 18,
82
88
  height: 18,
83
89
  "aria-hidden": "true"
84
90
  })),
85
- isActive: t(v, d.routes.list),
91
+ isActive: t(b, l.routes.list),
86
92
  ariaLabel: e,
87
- actionSlot: V(n)
93
+ actionSlot: W(n)
88
94
  };
89
95
  }
90
- if (!d.hasList) return null;
91
- let m = s ?? i(d.label, C);
92
- if (z !== "" && !m.toLowerCase().includes(z)) return null;
93
- let g, _, S, w, T = !1;
94
- u === !0 && O != null && (T = !0, g = /* @__PURE__ */ c(f, {
96
+ if (!l.hasList) return null;
97
+ let p = s ?? a(l.label, E);
98
+ if (H !== "" && !p.toLowerCase().includes(H)) return null;
99
+ let h, g, v, y, S = !1;
100
+ c === !0 && j != null && (S = !0, h = /* @__PURE__ */ u(m, {
95
101
  width: 14,
96
102
  height: 14,
97
103
  "aria-hidden": "true"
98
- }), _ = (e) => {
104
+ }), g = (e) => {
99
105
  let { dataTransfer: t } = e;
100
106
  t.effectAllowed = "move", t.setData("text/plain", n);
101
- }, S = (e) => {
107
+ }, v = (e) => {
102
108
  e.preventDefault();
103
109
  let { dataTransfer: t } = e;
104
110
  t.dropEffect = "move";
105
- }, w = (e) => {
111
+ }, y = (e) => {
106
112
  e.preventDefault();
107
113
  let t = e.dataTransfer.getData("text/plain");
108
- t === "" || t === n || O(t, n);
114
+ t === "" || t === n || j(t, n);
109
115
  });
110
- let E;
111
- return g != null && (E = L), {
116
+ let T;
117
+ return h != null && (T = B), {
112
118
  id: n,
113
119
  data: {
114
120
  kind: "entity",
115
121
  id: n,
116
122
  groupId: r
117
123
  },
118
- label: m,
119
- href: d.routes.list,
120
- icon: h(o ?? a, /* @__PURE__ */ c(l, {
124
+ label: p,
125
+ href: l.routes.list,
126
+ icon: _(o ?? i, /* @__PURE__ */ u(d, {
121
127
  width: 18,
122
128
  height: 18,
123
129
  "aria-hidden": "true"
124
130
  })),
125
- isActive: t(v, d.routes.list),
126
- ariaLabel: m,
127
- actionSlot: V(n),
128
- dragHandleSlot: g,
129
- dragHandleLabel: E,
130
- draggable: T,
131
- onDragStart: _,
132
- onDragOver: S,
133
- onDrop: w
131
+ isActive: t(b, l.routes.list),
132
+ ariaLabel: p,
133
+ actionSlot: W(n),
134
+ dragHandleSlot: h,
135
+ dragHandleLabel: T,
136
+ draggable: S,
137
+ onDragStart: g,
138
+ onDragOver: v,
139
+ onDrop: y
134
140
  };
135
- }, W = (e) => {
136
- let { hub: n, groupId: a, icon: o } = e, s = {
141
+ }, q = (e) => {
142
+ let { hub: n, groupId: r, icon: o } = e, s = {
137
143
  kind: "hub",
138
144
  id: n.id
139
145
  };
140
- if (b?.isItemVisible?.(s, x) === !1) return null;
141
- let u = r(n), d = u.map((e) => y[e] ?? null).filter((e) => {
146
+ if (C?.isItemVisible?.(s, w) === !1) return null;
147
+ let c = i(n), l = c.map((e) => x[e] ?? null).filter((e) => {
142
148
  if (e == null) return !1;
143
149
  let t = "entity";
144
150
  e.kind === "tool" && (t = "tool");
@@ -146,54 +152,61 @@ function g(g) {
146
152
  kind: t,
147
153
  id: e.id
148
154
  };
149
- return !(b?.isItemVisible?.(n, x) === !1 || e.kind !== "tool" && !e.hasList);
155
+ return !(C?.isItemVisible?.(n, w) === !1 || e.kind !== "tool" && !e.hasList);
150
156
  });
151
- if (u.length > 0 && d.length === 0) return null;
152
- let f = i(n.title, C), p = B(f), m = d.some((e) => B(i(e.label, C)));
157
+ if (c.length > 0 && l.length === 0) return null;
158
+ let f = a(n.title, E), p = U(f), m = l.some((e) => U(a(e.label, E)));
153
159
  if (!p && !m) return null;
154
- let g = t(v, n.href) || d.some((e) => t(v, e.routes.list));
160
+ let h = t(b, n.href) || l.some((e) => t(b, e.routes.list));
155
161
  return {
156
162
  id: `hub-${n.id}`,
157
163
  data: {
158
164
  kind: "hub",
159
165
  id: n.id,
160
- groupId: a
166
+ groupId: r
161
167
  },
162
168
  label: f,
163
169
  href: n.href,
164
- icon: h(o, /* @__PURE__ */ c(l, {
170
+ icon: _(o, /* @__PURE__ */ u(d, {
165
171
  width: 18,
166
172
  height: 18,
167
173
  "aria-hidden": "true"
168
174
  })),
169
- isActive: g,
175
+ isActive: h,
170
176
  ariaLabel: f
171
177
  };
172
- }, G = [], K = b?.primaryItems ?? [];
173
- if (K.length > 0) {
174
- let e = K.map((e) => {
175
- if (e.kind === "dashboard") return H();
176
- if (e.kind === "hub") return W({
177
- hub: o(e, b),
178
+ }, J = [], Y = C?.primaryItems ?? [];
179
+ if (Y.length > 0) {
180
+ let e = Y.map((e) => {
181
+ if (e.kind === "dashboard") {
182
+ let t;
183
+ return e.label != null && (t = a(e.label, E)), G({
184
+ id: e.id,
185
+ icon: e.icon,
186
+ label: t
187
+ });
188
+ }
189
+ if (e.kind === "hub") return q({
190
+ hub: s(e, C),
178
191
  icon: e.icon
179
192
  });
180
193
  let t;
181
- return e.label != null && (t = i(e.label, C)), U({
194
+ return e.label != null && (t = a(e.label, E)), K({
182
195
  entityId: e.id,
183
196
  itemIcon: e.icon,
184
197
  itemLabel: t
185
198
  });
186
199
  }).filter((e) => e != null);
187
- e.length > 0 && G.push({
200
+ e.length > 0 && J.push({
188
201
  id: "primary",
189
202
  items: e,
190
203
  collapsible: !1
191
204
  });
192
205
  }
193
- if (T.length > 0) {
194
- let e = T.map((e) => {
195
- let t = R.get(e);
196
- return U({
206
+ if (O.length > 0) {
207
+ let e = O.map((e) => {
208
+ let t = V.get(e);
209
+ return K({
197
210
  entityId: e,
198
211
  groupId: t?.groupId,
199
212
  groupIcon: t?.groupIcon,
@@ -201,10 +214,10 @@ function g(g) {
201
214
  enableReorder: !0
202
215
  });
203
216
  }).filter((e) => e != null);
204
- e.length > 0 && G.push({
217
+ e.length > 0 && J.push({
205
218
  id: "pinned",
206
- title: w("sidebar.sections.pinned"),
207
- icon: h(void 0, /* @__PURE__ */ c(m, {
219
+ title: D("sidebar.sections.pinned"),
220
+ icon: _(void 0, /* @__PURE__ */ u(g, {
208
221
  width: 16,
209
222
  height: 16,
210
223
  "aria-hidden": "true"
@@ -213,15 +226,15 @@ function g(g) {
213
226
  collapsible: !1
214
227
  });
215
228
  }
216
- if (E.length > 0) {
217
- let e = E.map((e) => {
218
- if (y[e.id] == null) return null;
229
+ if (k.length > 0) {
230
+ let e = k.map((e) => {
231
+ if (x[e.id] == null) return null;
219
232
  let n = {
220
233
  kind: e.kind,
221
234
  id: e.id
222
235
  };
223
- if (b?.isItemVisible?.(n, x) === !1 || z !== "" && !e.label.toLowerCase().includes(z)) return null;
224
- let r = R.get(e.id);
236
+ if (C?.isItemVisible?.(n, w) === !1 || H !== "" && !e.label.toLowerCase().includes(H)) return null;
237
+ let r = V.get(e.id);
225
238
  return {
226
239
  id: `recent-${e.kind}-${e.id}`,
227
240
  data: {
@@ -231,19 +244,19 @@ function g(g) {
231
244
  },
232
245
  label: e.label,
233
246
  href: e.href,
234
- icon: h(r?.itemIcon ?? r?.groupIcon, /* @__PURE__ */ c(l, {
247
+ icon: _(r?.itemIcon ?? r?.groupIcon, /* @__PURE__ */ u(d, {
235
248
  width: 18,
236
249
  height: 18,
237
250
  "aria-hidden": "true"
238
251
  })),
239
- isActive: t(v, e.href),
252
+ isActive: t(b, e.href),
240
253
  ariaLabel: e.label
241
254
  };
242
255
  }).filter((e) => e != null);
243
- e.length > 0 && G.push({
256
+ e.length > 0 && J.push({
244
257
  id: "recent",
245
- title: w("sidebar.sections.recent"),
246
- icon: h(void 0, /* @__PURE__ */ c(d, {
258
+ title: D("sidebar.sections.recent"),
259
+ icon: _(void 0, /* @__PURE__ */ u(p, {
247
260
  width: 16,
248
261
  height: 16,
249
262
  "aria-hidden": "true"
@@ -252,55 +265,61 @@ function g(g) {
252
265
  collapsible: !1
253
266
  });
254
267
  }
255
- return N.forEach(([e, t]) => {
256
- if (t.isVisible != null && !t.isVisible(x)) return;
257
- let r = [], a = n(t);
258
- a.length > 0 && a.forEach((n) => {
259
- if (n.kind === "dashboard") {
260
- let t = H(e);
261
- t != null && r.push(t);
268
+ return I.forEach(([e, t]) => {
269
+ if (t.isVisible != null && !t.isVisible(w)) return;
270
+ let n = [], i = r(t);
271
+ i.length > 0 && i.forEach((r) => {
272
+ if (r.kind === "dashboard") {
273
+ let i;
274
+ r.label != null && (i = a(r.label, E));
275
+ let o = G({
276
+ id: r.id,
277
+ icon: r.icon ?? t.icon,
278
+ label: i
279
+ }, e);
280
+ o != null && n.push(o);
262
281
  return;
263
282
  }
264
- if (n.kind === "hub") {
265
- let i = W({
266
- hub: o(n, b),
283
+ if (r.kind === "hub") {
284
+ let i = q({
285
+ hub: s(r, C),
267
286
  groupId: e,
268
- icon: n.icon ?? t.icon
287
+ icon: r.icon ?? t.icon
269
288
  });
270
- i != null && r.push(i);
289
+ i != null && n.push(i);
271
290
  return;
272
291
  }
273
- let a;
274
- n.label != null && (a = i(n.label, C));
275
- let s = U({
276
- entityId: n.id,
292
+ let i;
293
+ r.label != null && (i = a(r.label, E));
294
+ let o = K({
295
+ entityId: r.id,
277
296
  groupId: e,
278
297
  groupIcon: t.icon,
279
- itemIcon: n.icon,
280
- itemLabel: a
298
+ itemIcon: r.icon,
299
+ itemLabel: i
281
300
  });
282
- s != null && r.push(s);
301
+ o != null && n.push(o);
283
302
  });
284
- let s = r;
285
- if (j && t.behavior?.showInCollapsedRail !== !0 && (s = r.filter((e) => e.id === "dashboard" || e.isActive === !0)), s.length === 0) return;
303
+ let o = n;
304
+ if (P && t.behavior?.showInCollapsedRail !== !0 && (o = n.filter((e) => e.data?.kind === "dashboard" || e.isActive === !0)), o.length === 0) return;
286
305
  let c;
287
- t.title != null && (c = i(t.title, C));
288
- let l = k?.[e], u;
289
- A != null && (u = (t) => {
290
- A(e, t);
291
- }), G.push({
306
+ t.title != null && (c = a(t.title, E));
307
+ let l = M?.[e], u;
308
+ N != null && (u = (t) => {
309
+ N(e, t);
310
+ }), J.push({
292
311
  id: e,
293
312
  title: c,
294
- icon: h(t.icon, void 0, 16),
295
- items: s,
313
+ icon: _(t.icon, void 0, 16),
314
+ items: o,
296
315
  collapsible: t.behavior?.collapsible ?? !0,
297
316
  defaultCollapsed: t.behavior?.defaultCollapsed ?? !0,
298
317
  isCollapsed: l,
299
318
  onCollapsedChange: u
300
319
  });
301
- }), G;
320
+ }), J;
302
321
  }
303
322
  //#endregion
304
- export { g as buildSidebarSections };
323
+ export { v as buildSidebarSections };
305
324
 
306
325
  //# sourceMappingURL=buildSidebarSections.js.map