@tailor-platform/app-shell 0.27.2 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -318,6 +318,40 @@ export declare type ContextData = AppShellRegister extends {
318
318
  contextData: infer T;
319
319
  } ? T : Record<string, unknown>;
320
320
 
321
+ /**
322
+ * Create an enhanced authentication client.
323
+ *
324
+ * This wrapper around the original createAuthClient adds convenience methods
325
+ * to reduce duplication of the appUri across your application.
326
+ *
327
+ * @example
328
+ * ```tsx
329
+ * import { createAuthClient, AuthProvider } from '@tailor-platform/app-shell';
330
+ * import { createClient, Provider } from 'urql';
331
+ *
332
+ * // Create auth client at module level
333
+ * const authClient = createAuthClient({
334
+ * clientId: 'your-client-id',
335
+ * appUri: 'https://xyz.erp.dev',
336
+ * });
337
+ *
338
+ * // Create urql client using the auth client's fetch
339
+ * const urqlClient = createClient({
340
+ * url: `${authClient.getAppUri()}/query`,
341
+ * fetch: authClient.fetch,
342
+ * });
343
+ *
344
+ * function App() {
345
+ * return (
346
+ * <AuthProvider client={authClient}>
347
+ * <Provider value={urqlClient}>
348
+ * <YourAppComponents />
349
+ * </Provider>
350
+ * </AuthProvider>
351
+ * );
352
+ * }
353
+ * ```
354
+ */
321
355
  export declare function createAuthClient(config: AuthClientConfig): EnhancedAuthClient;
322
356
 
323
357
  /**
@@ -635,16 +669,10 @@ export declare interface EnhancedAuthClient extends AuthClient {
635
669
  */
636
670
  getAppUri(): string;
637
671
  /**
638
- * Get Authorization and DPoP headers for protected resource requests.
639
- * This version automatically uses the appUri for the /query endpoint.
640
- *
641
- * @param path - Optional path to append to appUri (default: "/query")
642
- * @param method - HTTP method (default: "POST")
672
+ * Authenticated fetch with built-in DPoP proof generation and token refresh.
673
+ * Same signature as the standard `fetch` API.
643
674
  */
644
- getAuthHeadersForQuery(path?: string, method?: string): Promise<{
645
- Authorization: string;
646
- DPoP: string;
647
- }>;
675
+ fetch: AuthClient["fetch"];
648
676
  }
649
677
 
650
678
  /**
@@ -850,7 +878,7 @@ declare type LabelValue = string | ((props: any) => string);
850
878
  * </Layout>
851
879
  * ```
852
880
  */
853
- export declare function Layout({ columns, className, gap, title, actions, children, }: LayoutProps): JSX.Element;
881
+ export declare function Layout({ columns, className, gap, title, actions, children }: LayoutProps): JSX.Element;
854
882
 
855
883
  export declare namespace Layout {
856
884
  var Column: React_2.ForwardRefExoticComponent<ColumnProps & React_2.RefAttributes<HTMLDivElement>>;
package/dist/app-shell.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import { jsx as a, jsxs as c, Fragment as S } from "react/jsx-runtime";
2
2
  import { capitalCase as D } from "change-case";
3
- import { useRouteError as ue, isRouteErrorResponse as we, redirect as me, Outlet as nt, NavLink as he, Navigate as pe, useRouteLoaderData as fe, createMemoryRouter as ge, createBrowserRouter as be, RouterProvider as xe, useLocation as Y, Link as $, Await as zt, useMatch as ve, useNavigate as ye } from "react-router";
3
+ import { useRouteError as ue, isRouteErrorResponse as we, redirect as me, Outlet as nt, NavLink as he, Navigate as pe, useRouteLoaderData as fe, createMemoryRouter as ge, createBrowserRouter as be, RouterProvider as xe, useLocation as Q, Link as $, Await as zt, useMatch as ve, useNavigate as ye } from "react-router";
4
4
  import { Link as er, useLocation as ar, useNavigate as sr, useParams as rr, useRouteError as nr, useSearchParams as or } from "react-router";
5
5
  import { cva as ot } from "class-variance-authority";
6
6
  import { useRender as j } from "@base-ui/react/use-render";
7
7
  import { clsx as Ne } from "clsx";
8
8
  import { twMerge as Se } from "tailwind-merge";
9
- import { AlertCircle as yt, Table as Ce, XIcon as _t, PanelLeftIcon as Te, ExternalLink as $t, ChevronRight as W, SunIcon as ke, SearchIcon as Re, Check as Pe, Copy as Ae } from "lucide-react";
9
+ import { AlertCircle as yt, Table as Ce, XIcon as _t, PanelLeftIcon as Te, ExternalLink as $t, ChevronRight as W, SunIcon as ke, SearchIcon as Re, Check as Pe, Copy as Ee } from "lucide-react";
10
10
  import * as f from "react";
11
11
  import { createContext as X, useContext as L, useState as H, useMemo as B, useEffect as F, useSyncExternalStore as Wt, Suspense as it, useRef as Ft, useCallback as M } from "react";
12
- import { Toaster as Ee, toast as Me } from "sonner";
12
+ import { Toaster as Ae, toast as Me } from "sonner";
13
13
  import { parsePath as Be } from "@tailor-platform/app-shell-vite-plugin/parser";
14
14
  import { Dialog as v } from "@base-ui/react/dialog";
15
- import { Tooltip as A } from "@base-ui/react/tooltip";
15
+ import { Tooltip as E } from "@base-ui/react/tooltip";
16
16
  import { Collapsible as lt } from "@base-ui/react/collapsible";
17
17
  import { createAuthClient as De } from "@tailor-platform/auth-public-client";
18
18
  function m(...t) {
@@ -202,8 +202,8 @@ const G = "en", Ie = () => {
202
202
  commandPaletteSearch: "ページを検索...",
203
203
  commandPaletteNoResults: "結果が見つかりません"
204
204
  }
205
- }), E = We.useT, _ = () => {
206
- const t = ue(), e = E(), s = {
205
+ }), A = We.useT, _ = () => {
206
+ const t = ue(), e = A(), s = {
207
207
  role: "alert",
208
208
  "aria-label": "default-error-boundary"
209
209
  };
@@ -281,10 +281,7 @@ function $s(t) {
281
281
  throw new Error(
282
282
  `Module "${e}" has no component. Either provide a \`component\` or use \`guards\` with \`redirectTo()\` or \`hidden()\` to control access. A guard that only returns \`pass()\` without a component will result in a blank page.`
283
283
  );
284
- const w = i && i.length > 0 ? Vt(i) : void 0, d = r ? Ht(
285
- { metaTitle: l, fallbackTitle: u },
286
- (h) => r({ title: h, resources: n })
287
- ) : void 0;
284
+ const w = i && i.length > 0 ? Vt(i) : void 0, d = r ? Ht({ metaTitle: l, fallbackTitle: u }, (h) => r({ title: h, resources: n })) : void 0;
288
285
  return {
289
286
  path: e,
290
287
  type: "component",
@@ -325,16 +322,16 @@ function Ws(t) {
325
322
  };
326
323
  }
327
324
  const Oe = () => {
328
- const t = E();
325
+ const t = A();
329
326
  return /* @__PURE__ */ c(S, { children: [
330
327
  /* @__PURE__ */ a("p", { className: "astw:font-semibold astw:leading-none astw:tracking-tight", children: t("welcomeTitle") }),
331
328
  /* @__PURE__ */ a("p", { className: "pt-4", children: t("welcomeBody") })
332
329
  ] });
333
330
  }, Nt = () => /* @__PURE__ */ c(S, { children: [
334
331
  /* @__PURE__ */ a(nt, {}),
335
- /* @__PURE__ */ a(Ee, {})
332
+ /* @__PURE__ */ a(Ae, {})
336
333
  ] }), je = () => {
337
- const { configurations: t } = jt(), e = E(), s = _e();
334
+ const { configurations: t } = jt(), e = A(), s = _e();
338
335
  return /* @__PURE__ */ c("div", { className: "astw:mx-auto astw:flex-col astw:flex astw:md:flex-row astw:max-w-5xl astw:gap-[10px] astw:w-full", children: [
339
336
  /* @__PURE__ */ a("div", { children: /* @__PURE__ */ c("nav", { className: "astw:bg-card astw:md:w-xs astw:rounded-md astw:border astw:p-3 astw:shadow-xs", children: [
340
337
  /* @__PURE__ */ a("h2", { className: "astw:text-sm astw:leading-[36px] astw:mb-2 astw:font-bold ", children: e("settings") }),
@@ -374,9 +371,7 @@ const Oe = () => {
374
371
  children: [n]
375
372
  } : {}
376
373
  };
377
- }, Ue = (t) => t.map(
378
- (e) => Gt(e, e.resources, e.errorBoundary)
379
- ), Ke = ({
374
+ }, Ue = (t) => t.map((e) => Gt(e, e.resources, e.errorBoundary)), Ke = ({
380
375
  modules: t,
381
376
  settingsResources: e,
382
377
  rootComponent: s
@@ -388,14 +383,7 @@ const Oe = () => {
388
383
  {
389
384
  path: "settings",
390
385
  index: !0,
391
- Component: () => /* @__PURE__ */ a(
392
- pe,
393
- {
394
- to: e[0].path,
395
- relative: "path",
396
- replace: !0
397
- }
398
- )
386
+ Component: () => /* @__PURE__ */ a(pe, { to: e[0].path, relative: "path", replace: !0 })
399
387
  },
400
388
  {
401
389
  path: "settings",
@@ -429,12 +417,12 @@ const Oe = () => {
429
417
  }, qt = "appshell-root-nav", Ve = (t) => ({
430
418
  loaderID: qt,
431
419
  loader: async () => ({ navItems: He(t) })
432
- }), Qt = () => fe(qt)?.navItems, He = async (t) => {
420
+ }), Yt = () => fe(qt)?.navItems, He = async (t) => {
433
421
  const e = Ot(t.locale);
434
422
  return (await Promise.all(
435
423
  t.modules.map(async (r) => {
436
424
  if (r.path.startsWith(":") || (await ut(r.guards)).type !== "pass") return null;
437
- const o = await Yt(
425
+ const o = await Qt(
438
426
  r.resources,
439
427
  r.path,
440
428
  e
@@ -447,14 +435,10 @@ const Oe = () => {
447
435
  icon: r.meta.icon || /* @__PURE__ */ a(Ce, {}),
448
436
  items: n
449
437
  }));
450
- }, Yt = async (t, e, s) => (await Promise.all(
438
+ }, Qt = async (t, e, s) => (await Promise.all(
451
439
  t.map(async (n) => {
452
440
  if (n.path.startsWith(":") || (await ut(n.guards)).type !== "pass") return null;
453
- const i = `${e}/${n.path}`, l = s(n.meta.title, n.path), u = n.subResources ? await Yt(
454
- n.subResources,
455
- i,
456
- s
457
- ) : void 0;
441
+ const i = `${e}/${n.path}`, l = s(n.meta.title, n.path), u = n.subResources ? await Qt(n.subResources, i, s) : void 0;
458
442
  return {
459
443
  title: l,
460
444
  url: i,
@@ -499,7 +483,7 @@ const Oe = () => {
499
483
  theme: "system",
500
484
  setTheme: () => null
501
485
  }, Xt = X(qe);
502
- function Qe({
486
+ function Ye({
503
487
  children: t,
504
488
  storageKey: e,
505
489
  defaultTheme: s = "system",
@@ -521,19 +505,14 @@ function Qe({
521
505
  };
522
506
  return /* @__PURE__ */ a(Xt.Provider, { ...r, value: l, children: t });
523
507
  }
524
- const Ye = () => {
508
+ const Qe = () => {
525
509
  const t = L(Xt);
526
- if (t === void 0)
527
- throw new Error("useTheme must be used within a ThemeProvider");
510
+ if (t === void 0) throw new Error("useTheme must be used within a ThemeProvider");
528
511
  return t;
529
512
  }, Xe = () => () => {
530
513
  }, Ze = () => !0, Je = () => !1;
531
514
  function ta() {
532
- return Wt(
533
- Xe,
534
- Ze,
535
- Je
536
- );
515
+ return Wt(Xe, Ze, Je);
537
516
  }
538
517
  function ea(t) {
539
518
  const e = {
@@ -631,13 +610,7 @@ const te = (t) => {
631
610
  errorBoundary: t.errorBoundary,
632
611
  locale: t.locale
633
612
  }) : null,
634
- [
635
- r,
636
- t.settingsResources,
637
- t.basePath,
638
- t.errorBoundary,
639
- t.locale
640
- ]
613
+ [r, t.settingsResources, t.basePath, t.errorBoundary, t.locale]
641
614
  ), o = B(
642
615
  () => n ? { title: t.title, icon: t.icon, configurations: n } : null,
643
616
  [t.title, t.icon, n]
@@ -652,7 +625,7 @@ const te = (t) => {
652
625
  /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: l })
653
626
  ] }) });
654
627
  }
655
- return e ? /* @__PURE__ */ a(ct.Provider, { value: o, children: /* @__PURE__ */ a(dt.Provider, { value: i, children: /* @__PURE__ */ a(Qe, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(Ge, { rootComponent: t.rootComponent, children: t.children }) }) }) }) : null;
628
+ return e ? /* @__PURE__ */ a(ct.Provider, { value: o, children: /* @__PURE__ */ a(dt.Provider, { value: i, children: /* @__PURE__ */ a(Ye, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(Ge, { rootComponent: t.rootComponent, children: t.children }) }) }) }) : null;
656
629
  };
657
630
  function sa(t) {
658
631
  const e = aa(t), s = e.find((o) => o.path === ""), r = e.filter((o) => o.path !== "");
@@ -668,9 +641,7 @@ function sa(t) {
668
641
  te.WithPages = sa;
669
642
  const J = 768;
670
643
  function ra() {
671
- const [t, e] = f.useState(
672
- void 0
673
- );
644
+ const [t, e] = f.useState(void 0);
674
645
  return f.useEffect(() => {
675
646
  const s = window.matchMedia(`(max-width: ${J - 1}px)`), r = () => {
676
647
  e(window.innerWidth < J);
@@ -680,9 +651,7 @@ function ra() {
680
651
  }
681
652
  const tt = 768, et = 1199;
682
653
  function na() {
683
- const [t, e] = f.useState(
684
- void 0
685
- );
654
+ const [t, e] = f.useState(void 0);
686
655
  return f.useEffect(() => {
687
656
  const s = window.matchMedia(
688
657
  `(min-width: ${tt}px) and (max-width: ${et}px)`
@@ -737,15 +706,10 @@ function ia({
737
706
  function Ct({ ...t }) {
738
707
  return /* @__PURE__ */ a(v.Root, { "data-slot": "sheet", ...t });
739
708
  }
740
- function la({
741
- ...t
742
- }) {
709
+ function la({ ...t }) {
743
710
  return /* @__PURE__ */ a(v.Portal, { "data-slot": "sheet-portal", ...t });
744
711
  }
745
- function ca({
746
- className: t,
747
- ...e
748
- }) {
712
+ function ca({ className: t, ...e }) {
749
713
  return /* @__PURE__ */ a(
750
714
  v.Backdrop,
751
715
  {
@@ -800,10 +764,7 @@ function kt({ className: t, ...e }) {
800
764
  }
801
765
  );
802
766
  }
803
- function Rt({
804
- className: t,
805
- ...e
806
- }) {
767
+ function Rt({ className: t, ...e }) {
807
768
  return /* @__PURE__ */ a(
808
769
  v.Title,
809
770
  {
@@ -831,23 +792,13 @@ function mt({
831
792
  children: e,
832
793
  ...s
833
794
  }) {
834
- return /* @__PURE__ */ a(
835
- A.Provider,
836
- {
837
- "data-slot": "tooltip-provider",
838
- delay: t,
839
- ...s,
840
- children: e
841
- }
842
- );
795
+ return /* @__PURE__ */ a(E.Provider, { "data-slot": "tooltip-provider", delay: t, ...s, children: e });
843
796
  }
844
797
  function ht({ children: t, ...e }) {
845
- return /* @__PURE__ */ a(mt, { children: /* @__PURE__ */ a(A.Root, { "data-slot": "tooltip", ...e, children: t }) });
798
+ return /* @__PURE__ */ a(mt, { children: /* @__PURE__ */ a(E.Root, { "data-slot": "tooltip", ...e, children: t }) });
846
799
  }
847
- function pt({
848
- ...t
849
- }) {
850
- return /* @__PURE__ */ a(A.Trigger, { "data-slot": "tooltip-trigger", ...t });
800
+ function pt({ ...t }) {
801
+ return /* @__PURE__ */ a(E.Trigger, { "data-slot": "tooltip-trigger", ...t });
851
802
  }
852
803
  function ft({
853
804
  className: t,
@@ -857,8 +808,8 @@ function ft({
857
808
  children: n,
858
809
  ...o
859
810
  }) {
860
- return /* @__PURE__ */ a(A.Portal, { children: /* @__PURE__ */ a(A.Positioner, { sideOffset: e, side: s, align: r, children: /* @__PURE__ */ c(
861
- A.Popup,
811
+ return /* @__PURE__ */ a(E.Portal, { children: /* @__PURE__ */ a(E.Positioner, { sideOffset: e, side: s, align: r, children: /* @__PURE__ */ c(
812
+ E.Popup,
862
813
  {
863
814
  "data-slot": "tooltip-content",
864
815
  className: m(
@@ -868,7 +819,7 @@ function ft({
868
819
  ...o,
869
820
  children: [
870
821
  n,
871
- /* @__PURE__ */ a(A.Arrow, { className: "astw:bg-primary astw:fill-primary astw:z-50 astw:size-2.5 astw:translate-y-[calc(-50%_-_2px)] astw:rotate-45 astw:rounded-[2px]" })
822
+ /* @__PURE__ */ a(E.Arrow, { className: "astw:bg-primary astw:fill-primary astw:z-50 astw:size-2.5 astw:translate-y-[calc(-50%_-_2px)] astw:rotate-45 astw:rounded-[2px]" })
872
823
  ]
873
824
  }
874
825
  ) }) });
@@ -954,15 +905,7 @@ function ha({
954
905
  children: n,
955
906
  ...o
956
907
  }) {
957
- const {
958
- isMobile: i,
959
- state: l,
960
- openMobile: u,
961
- setOpenMobile: w,
962
- isIconMode: d,
963
- openIconMode: h,
964
- setOpenIconMode: p
965
- } = K();
908
+ const { isMobile: i, state: l, openMobile: u, setOpenMobile: w, isIconMode: d, openIconMode: h, setOpenIconMode: p } = K();
966
909
  return s === "none" ? /* @__PURE__ */ a(
967
910
  "div",
968
911
  {
@@ -1108,11 +1051,7 @@ function ha({
1108
1051
  }
1109
1052
  );
1110
1053
  }
1111
- function se({
1112
- className: t,
1113
- onClick: e,
1114
- ...s
1115
- }) {
1054
+ function se({ className: t, onClick: e, ...s }) {
1116
1055
  const { toggleSidebar: r } = K();
1117
1056
  return /* @__PURE__ */ c(
1118
1057
  O,
@@ -1154,18 +1093,12 @@ function fa({ className: t, ...e }) {
1154
1093
  {
1155
1094
  "data-slot": "sidebar-header",
1156
1095
  "data-sidebar": "header",
1157
- className: m(
1158
- "astw:flex astw:flex-row astw:items-center astw:gap-0.5 astw:p-2",
1159
- t
1160
- ),
1096
+ className: m("astw:flex astw:flex-row astw:items-center astw:gap-0.5 astw:p-2", t),
1161
1097
  ...e
1162
1098
  }
1163
1099
  );
1164
1100
  }
1165
- function ga({
1166
- className: t,
1167
- ...e
1168
- }) {
1101
+ function ga({ className: t, ...e }) {
1169
1102
  return /* @__PURE__ */ a(
1170
1103
  ia,
1171
1104
  {
@@ -1210,10 +1143,7 @@ function bt({ className: t, ...e }) {
1210
1143
  {
1211
1144
  "data-slot": "sidebar-menu",
1212
1145
  "data-sidebar": "menu",
1213
- className: m(
1214
- "astw:flex astw:w-full astw:min-w-0 astw:flex-col astw:gap-1",
1215
- t
1216
- ),
1146
+ className: m("astw:flex astw:w-full astw:min-w-0 astw:flex-col astw:gap-1", t),
1217
1147
  ...e
1218
1148
  }
1219
1149
  );
@@ -1331,10 +1261,7 @@ function at({ className: t, ...e }) {
1331
1261
  }
1332
1262
  );
1333
1263
  }
1334
- function va({
1335
- className: t,
1336
- ...e
1337
- }) {
1264
+ function va({ className: t, ...e }) {
1338
1265
  return /* @__PURE__ */ a(
1339
1266
  "li",
1340
1267
  {
@@ -1378,20 +1305,15 @@ const Na = (t) => {
1378
1305
  const { configurations: e } = C(), { modules: s, locale: r } = e;
1379
1306
  return Sa(t) ? null : Ca(t, s, r);
1380
1307
  }, Sa = (t) => t.startsWith("http://") || t.startsWith("https://"), Ca = (t, e, s) => {
1381
- const r = U(s), n = At(t);
1308
+ const r = U(s), n = Et(t);
1382
1309
  for (const o of e) {
1383
- const i = At(o.path);
1310
+ const i = Et(o.path);
1384
1311
  if (re(n, i))
1385
1312
  return {
1386
1313
  title: r(o.meta.title, o.path),
1387
1314
  icon: o.meta.icon
1388
1315
  };
1389
- const l = ne(
1390
- n,
1391
- i,
1392
- o.resources,
1393
- r
1394
- );
1316
+ const l = ne(n, i, o.resources, r);
1395
1317
  if (l)
1396
1318
  return l;
1397
1319
  }
@@ -1399,10 +1321,8 @@ const Na = (t) => {
1399
1321
  }, re = (t, e) => {
1400
1322
  if (t === e) return !0;
1401
1323
  const s = t.split("/"), r = e.split("/");
1402
- return s.length !== r.length ? !1 : r.every(
1403
- (n, o) => n.startsWith(":") || n === s[o]
1404
- );
1405
- }, At = (t) => {
1324
+ return s.length !== r.length ? !1 : r.every((n, o) => n.startsWith(":") || n === s[o]);
1325
+ }, Et = (t) => {
1406
1326
  let e = t;
1407
1327
  return e.startsWith("/") || (e = `/${e}`), e.length > 1 && e.endsWith("/") && (e = e.slice(0, -1)), e;
1408
1328
  }, ne = (t, e, s, r) => {
@@ -1414,12 +1334,7 @@ const Na = (t) => {
1414
1334
  icon: n.meta.icon
1415
1335
  };
1416
1336
  if (n.subResources) {
1417
- const i = ne(
1418
- t,
1419
- o,
1420
- n.subResources,
1421
- r
1422
- );
1337
+ const i = ne(t, o, n.subResources, r);
1423
1338
  if (i)
1424
1339
  return i;
1425
1340
  }
@@ -1433,7 +1348,7 @@ const Na = (t) => {
1433
1348
  activeMatch: n = "prefix",
1434
1349
  title: o,
1435
1350
  icon: i
1436
- } = t, { pathname: l } = Y(), u = Na(e), w = n === "exact" ? l === e : l === e || l.startsWith(`${e}/`), d = o ?? u?.title ?? Ta(e), h = i ?? u?.icon, p = {
1351
+ } = t, { pathname: l } = Q(), u = Na(e), w = n === "exact" ? l === e : l === e || l.startsWith(`${e}/`), d = o ?? u?.title ?? Ta(e), h = i ?? u?.icon, p = {
1437
1352
  title: d,
1438
1353
  url: e,
1439
1354
  icon: h,
@@ -1442,14 +1357,17 @@ const Na = (t) => {
1442
1357
  return s || oe(e) ? /* @__PURE__ */ a(I, { children: /* @__PURE__ */ a(
1443
1358
  z,
1444
1359
  {
1445
- render: /* @__PURE__ */ a(
1446
- "a",
1447
- {
1448
- href: e,
1449
- target: "_blank",
1450
- rel: "noopener noreferrer",
1451
- className: w ? "astw:bg-sidebar-accent astw:font-medium" : void 0
1452
- }
1360
+ render: (
1361
+ // oxlint-disable-next-line jsx-a11y/anchor-has-content -- content is provided by SidebarMenuButton's children
1362
+ /* @__PURE__ */ a(
1363
+ "a",
1364
+ {
1365
+ href: e,
1366
+ target: "_blank",
1367
+ rel: "noopener noreferrer",
1368
+ className: w ? "astw:bg-sidebar-accent astw:font-medium" : void 0
1369
+ }
1370
+ )
1453
1371
  ),
1454
1372
  tooltip: d,
1455
1373
  children: r ? r(p) : /* @__PURE__ */ c(S, { children: [
@@ -1484,23 +1402,17 @@ const Na = (t) => {
1484
1402
  const e = t.split("/").filter(Boolean);
1485
1403
  return (e[e.length - 1] ?? t).split("-").map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join(" ");
1486
1404
  };
1487
- function st({
1488
- ...t
1489
- }) {
1405
+ function st({ ...t }) {
1490
1406
  return /* @__PURE__ */ a(lt.Root, { "data-slot": "collapsible", ...t });
1491
1407
  }
1492
- function Q({
1493
- ...t
1494
- }) {
1408
+ function Y({ ...t }) {
1495
1409
  return /* @__PURE__ */ a(lt.Trigger, { "data-slot": "collapsible-trigger", ...t });
1496
1410
  }
1497
- function rt({
1498
- ...t
1499
- }) {
1411
+ function rt({ ...t }) {
1500
1412
  return /* @__PURE__ */ a(lt.Panel, { "data-slot": "collapsible-content", ...t });
1501
1413
  }
1502
1414
  const Os = (t) => {
1503
- const { title: e, icon: s, to: r, defaultOpen: n = !0, children: o } = t, { pathname: i } = Y(), { configurations: l } = C(), u = U(l.locale), w = E(), d = u(e, typeof e == "string" ? e : ""), h = r ? i === r : !1;
1415
+ const { title: e, icon: s, to: r, defaultOpen: n = !0, children: o } = t, { pathname: i } = Q(), { configurations: l } = C(), u = U(l.locale), w = A(), d = u(e, typeof e == "string" ? e : ""), h = r ? i === r : !1;
1504
1416
  return r ? /* @__PURE__ */ c(st, { render: /* @__PURE__ */ a(I, {}), defaultOpen: n, children: [
1505
1417
  /* @__PURE__ */ c(
1506
1418
  z,
@@ -1520,7 +1432,7 @@ const Os = (t) => {
1520
1432
  }
1521
1433
  ),
1522
1434
  /* @__PURE__ */ c(
1523
- Q,
1435
+ Y,
1524
1436
  {
1525
1437
  render: /* @__PURE__ */ a(q, { className: "astw:data-panel-open:rotate-90" }),
1526
1438
  children: [
@@ -1531,7 +1443,7 @@ const Os = (t) => {
1531
1443
  ),
1532
1444
  /* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(at, { children: o }) })
1533
1445
  ] }) : /* @__PURE__ */ c(st, { render: /* @__PURE__ */ a(I, {}), defaultOpen: n, children: [
1534
- /* @__PURE__ */ c(Q, { className: "astw:flex astw:w-full astw:[&[data-panel-open]_.astw-rotate-target]:rotate-90", children: [
1446
+ /* @__PURE__ */ c(Y, { className: "astw:flex astw:w-full astw:[&[data-panel-open]_.astw-rotate-target]:rotate-90", children: [
1535
1447
  /* @__PURE__ */ c(
1536
1448
  z,
1537
1449
  {
@@ -1551,18 +1463,9 @@ const Os = (t) => {
1551
1463
  /* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(at, { children: o }) })
1552
1464
  ] });
1553
1465
  }, js = () => /* @__PURE__ */ a(ga, {}), ka = (t) => {
1554
- const { title: e, icon: s } = C(), { pathname: r } = Y(), { isIconMode: n } = K(), o = /* @__PURE__ */ c(fa, { children: [
1466
+ const { title: e, icon: s } = C(), { pathname: r } = Q(), { isIconMode: n } = K(), o = /* @__PURE__ */ c(fa, { children: [
1555
1467
  s,
1556
- /* @__PURE__ */ a(
1557
- "h1",
1558
- {
1559
- className: m(
1560
- "astw:text-sm astw:mb-2 astw:mt-2 astw:px-2",
1561
- n && "astw:hidden"
1562
- ),
1563
- children: e
1564
- }
1565
- )
1468
+ /* @__PURE__ */ a("h1", { className: m("astw:text-sm astw:mb-2 astw:mt-2 astw:px-2", n && "astw:hidden"), children: e })
1566
1469
  ] });
1567
1470
  return /* @__PURE__ */ c(ha, { variant: "inset", collapsible: n ? "icon" : "offcanvas", children: [
1568
1471
  !n && /* @__PURE__ */ c("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
@@ -1574,91 +1477,76 @@ const Os = (t) => {
1574
1477
  /* @__PURE__ */ a(gt, { children: /* @__PURE__ */ a(bt, { children: t.children }) })
1575
1478
  ) : (
1576
1479
  // Existing behavior: auto-generation from resources
1577
- /* @__PURE__ */ a(it, { fallback: /* @__PURE__ */ a(Ea, {}), children: /* @__PURE__ */ a(Ra, { currentPath: r }) })
1480
+ /* @__PURE__ */ a(it, { fallback: /* @__PURE__ */ a(Aa, {}), children: /* @__PURE__ */ a(Ra, { currentPath: r }) })
1578
1481
  ) }),
1579
1482
  t.footer ?? null
1580
1483
  ] });
1581
1484
  }, Ra = ({ currentPath: t }) => {
1582
- const e = Qt();
1485
+ const e = Yt();
1583
1486
  return /* @__PURE__ */ a(zt, { resolve: e, children: (s) => /* @__PURE__ */ a(Pa, { items: s ?? [], currentPath: t }) });
1584
1487
  }, Pa = (t) => {
1585
- const e = E();
1586
- return /* @__PURE__ */ a(gt, { children: /* @__PURE__ */ a(bt, { children: t.items.map((s) => /* @__PURE__ */ c(
1587
- st,
1588
- {
1589
- render: /* @__PURE__ */ a(I, {}),
1590
- defaultOpen: !0,
1591
- children: [
1592
- s.url ? /* @__PURE__ */ c(S, { children: [
1593
- /* @__PURE__ */ c(
1594
- z,
1595
- {
1596
- render: /* @__PURE__ */ a(
1597
- $,
1598
- {
1599
- to: s.url,
1600
- className: s.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0
1601
- }
1602
- ),
1603
- tooltip: s.title,
1604
- children: [
1605
- s.icon,
1606
- /* @__PURE__ */ a("span", { children: s.title })
1607
- ]
1608
- }
1609
- ),
1610
- !!s.items?.length && /* @__PURE__ */ c(
1611
- Q,
1612
- {
1613
- render: /* @__PURE__ */ a(q, { className: "astw:data-panel-open:rotate-90" }),
1614
- children: [
1615
- /* @__PURE__ */ a(W, {}),
1616
- /* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
1617
- ]
1618
- }
1619
- )
1620
- ] }) : /* @__PURE__ */ a(S, { children: /* @__PURE__ */ c(Q, { className: "astw:flex astw:w-full astw:[&[data-panel-open]_.astw-rotate-target]:rotate-90", children: [
1621
- /* @__PURE__ */ c(
1622
- z,
1488
+ const e = A();
1489
+ return /* @__PURE__ */ a(gt, { children: /* @__PURE__ */ a(bt, { children: t.items.map((s) => /* @__PURE__ */ c(st, { render: /* @__PURE__ */ a(I, {}), defaultOpen: !0, children: [
1490
+ s.url ? /* @__PURE__ */ c(S, { children: [
1491
+ /* @__PURE__ */ c(
1492
+ z,
1493
+ {
1494
+ render: /* @__PURE__ */ a(
1495
+ $,
1623
1496
  {
1624
- render: /* @__PURE__ */ a("span", { className: "astw:flex astw:w-full" }),
1625
- tooltip: s.title,
1626
- children: [
1627
- s.icon,
1628
- /* @__PURE__ */ a("span", { children: s.title })
1629
- ]
1497
+ to: s.url,
1498
+ className: s.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0
1630
1499
  }
1631
1500
  ),
1632
- !!s.items?.length && /* @__PURE__ */ c(
1633
- q,
1634
- {
1635
- className: "astw-rotate-target",
1636
- render: /* @__PURE__ */ a("span", {}),
1637
- children: [
1638
- /* @__PURE__ */ a(W, {}),
1639
- /* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
1640
- ]
1641
- }
1642
- )
1643
- ] }) }),
1644
- !!s.items?.length && /* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(at, { children: s.items?.map((r) => /* @__PURE__ */ a(va, { children: /* @__PURE__ */ a(
1645
- ya,
1501
+ tooltip: s.title,
1502
+ children: [
1503
+ s.icon,
1504
+ /* @__PURE__ */ a("span", { children: s.title })
1505
+ ]
1506
+ }
1507
+ ),
1508
+ !!s.items?.length && /* @__PURE__ */ c(
1509
+ Y,
1510
+ {
1511
+ render: /* @__PURE__ */ a(q, { className: "astw:data-panel-open:rotate-90" }),
1512
+ children: [
1513
+ /* @__PURE__ */ a(W, {}),
1514
+ /* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
1515
+ ]
1516
+ }
1517
+ )
1518
+ ] }) : /* @__PURE__ */ a(S, { children: /* @__PURE__ */ c(Y, { className: "astw:flex astw:w-full astw:[&[data-panel-open]_.astw-rotate-target]:rotate-90", children: [
1519
+ /* @__PURE__ */ c(
1520
+ z,
1521
+ {
1522
+ render: /* @__PURE__ */ a("span", { className: "astw:flex astw:w-full" }),
1523
+ tooltip: s.title,
1524
+ children: [
1525
+ s.icon,
1526
+ /* @__PURE__ */ a("span", { children: s.title })
1527
+ ]
1528
+ }
1529
+ ),
1530
+ !!s.items?.length && /* @__PURE__ */ c(q, { className: "astw-rotate-target", render: /* @__PURE__ */ a("span", {}), children: [
1531
+ /* @__PURE__ */ a(W, {}),
1532
+ /* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
1533
+ ] })
1534
+ ] }) }),
1535
+ !!s.items?.length && /* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(at, { children: s.items?.map((r) => /* @__PURE__ */ a(va, { children: /* @__PURE__ */ a(
1536
+ ya,
1537
+ {
1538
+ render: /* @__PURE__ */ a(
1539
+ $,
1646
1540
  {
1647
- render: /* @__PURE__ */ a(
1648
- $,
1649
- {
1650
- to: r.url,
1651
- className: r.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0
1652
- }
1653
- ),
1654
- children: /* @__PURE__ */ a("span", { children: r.title })
1541
+ to: r.url,
1542
+ className: r.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0
1655
1543
  }
1656
- ) }, r.title)) }) })
1657
- ]
1658
- },
1659
- s.title
1660
- )) }) });
1661
- }, Aa = [104, 80, 112, 88, 96, 100, 84, 92], Ea = () => /* @__PURE__ */ a(gt, { children: /* @__PURE__ */ a(bt, { className: "astw:px-2", children: Aa.map((t, e) => /* @__PURE__ */ a(I, { children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
1544
+ ),
1545
+ children: /* @__PURE__ */ a("span", { children: r.title })
1546
+ }
1547
+ ) }, r.title)) }) })
1548
+ ] }, s.title)) }) });
1549
+ }, Ea = [104, 80, 112, 88, 96, 100, 84, 92], Aa = () => /* @__PURE__ */ a(gt, { children: /* @__PURE__ */ a(bt, { className: "astw:px-2", children: Ea.map((t, e) => /* @__PURE__ */ a(I, { children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
1662
1550
  /* @__PURE__ */ a("div", { className: "astw:h-4 astw:w-4 astw:rounded-md astw:bg-muted" }),
1663
1551
  /* @__PURE__ */ a(
1664
1552
  "div",
@@ -1668,7 +1556,7 @@ const Os = (t) => {
1668
1556
  }
1669
1557
  )
1670
1558
  ] }) }, e)) }) });
1671
- function Et({ ...t }) {
1559
+ function At({ ...t }) {
1672
1560
  return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...t });
1673
1561
  }
1674
1562
  function Mt({ className: t, ...e }) {
@@ -1689,10 +1577,7 @@ function Bt({ className: t, ...e }) {
1689
1577
  "li",
1690
1578
  {
1691
1579
  "data-slot": "breadcrumb-item",
1692
- className: m(
1693
- "astw:inline-flex astw:items-center astw:gap-1.5",
1694
- t
1695
- ),
1580
+ className: m("astw:inline-flex astw:items-center astw:gap-1.5", t),
1696
1581
  ...e
1697
1582
  }
1698
1583
  );
@@ -1704,10 +1589,7 @@ function Dt({
1704
1589
  to: r,
1705
1590
  ...n
1706
1591
  }) {
1707
- const o = m(
1708
- "astw:hover:text-foreground astw:transition-colors",
1709
- e
1710
- );
1592
+ const o = m("astw:hover:text-foreground astw:transition-colors", e);
1711
1593
  return j({
1712
1594
  defaultTagName: "a",
1713
1595
  render: t ?? /* @__PURE__ */ a($, { to: r }),
@@ -1719,11 +1601,7 @@ function Dt({
1719
1601
  }
1720
1602
  });
1721
1603
  }
1722
- function Ma({
1723
- children: t,
1724
- className: e,
1725
- ...s
1726
- }) {
1604
+ function Ma({ children: t, className: e, ...s }) {
1727
1605
  return /* @__PURE__ */ a(
1728
1606
  "li",
1729
1607
  {
@@ -1755,18 +1633,12 @@ const Da = (t, e) => {
1755
1633
  };
1756
1634
  const i = (l, u) => {
1757
1635
  !l || l.length === 0 || l.forEach((w) => {
1758
- const d = `${u}/${w.path}`, h = s(
1759
- w.meta.title,
1760
- w.path
1761
- );
1636
+ const d = `${u}/${w.path}`, h = s(w.meta.title, w.path);
1762
1637
  r[d] = {
1763
1638
  title: h,
1764
1639
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- breadcrumbTitle exists at runtime but not in CommonPageResource type
1765
1640
  breadcrumbTitle: w.meta.breadcrumbTitle
1766
- }, w.subResources && w.subResources.length > 0 && i(
1767
- w.subResources,
1768
- d
1769
- );
1641
+ }, w.subResources && w.subResources.length > 0 && i(w.subResources, d);
1770
1642
  });
1771
1643
  };
1772
1644
  return n.resources && n.resources.length > 0 && i(n.resources, n.path), r;
@@ -1779,12 +1651,10 @@ function La(t, e, s, r) {
1779
1651
  const d = o.slice(0, w + 1).join("/");
1780
1652
  let h = i[d];
1781
1653
  if (!h) {
1782
- const g = Object.entries(i).find(
1783
- ([x]) => {
1784
- const b = x.split("/").map((R) => R.startsWith(":") ? "[^/]+" : R).join("/");
1785
- return new RegExp(`^${b}$`).test(d);
1786
- }
1787
- )?.[1];
1654
+ const g = Object.entries(i).find(([x]) => {
1655
+ const b = x.split("/").map((R) => R.startsWith(":") ? "[^/]+" : R).join("/");
1656
+ return new RegExp(`^${b}$`).test(d);
1657
+ })?.[1];
1788
1658
  g && (h = g);
1789
1659
  }
1790
1660
  let p;
@@ -1800,7 +1670,7 @@ function La(t, e, s, r) {
1800
1670
  };
1801
1671
  }
1802
1672
  const Ia = () => {
1803
- const { configurations: t } = C(), e = Y();
1673
+ const { configurations: t } = C(), e = Q();
1804
1674
  return La(
1805
1675
  e.pathname,
1806
1676
  t.basePath,
@@ -1808,8 +1678,8 @@ const Ia = () => {
1808
1678
  t.locale
1809
1679
  );
1810
1680
  }, za = () => {
1811
- const { segments: t } = Ia(), e = ve("/:prefix/settings/:suffix"), s = E();
1812
- return e ? /* @__PURE__ */ a(Et, { children: /* @__PURE__ */ a(Mt, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(Bt, { children: /* @__PURE__ */ a(Dt, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(Et, { children: /* @__PURE__ */ a(Mt, { children: t.map((r, n) => /* @__PURE__ */ c(
1681
+ const { segments: t } = Ia(), e = ve("/:prefix/settings/:suffix"), s = A();
1682
+ return e ? /* @__PURE__ */ a(At, { children: /* @__PURE__ */ a(Mt, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(Bt, { children: /* @__PURE__ */ a(Dt, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(At, { children: /* @__PURE__ */ a(Mt, { children: t.map((r, n) => /* @__PURE__ */ c(
1813
1683
  "div",
1814
1684
  {
1815
1685
  className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground",
@@ -1824,7 +1694,7 @@ const Ia = () => {
1824
1694
  const { open: t, isIconMode: e } = K();
1825
1695
  return /* @__PURE__ */ a("div", { className: t && !e ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(se, { className: "astw:-ml-2.5" }) });
1826
1696
  }, Us = (t) => {
1827
- const e = t.children ? t.children({ Outlet: Nt }) : null, s = Ye(), r = () => {
1697
+ const e = t.children ? t.children({ Outlet: Nt }) : null, s = Qe(), r = () => {
1828
1698
  s.setTheme(s.theme === "dark" ? "light" : "dark");
1829
1699
  };
1830
1700
  return /* @__PURE__ */ a(ma, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:flex-1", children: [
@@ -1841,20 +1711,13 @@ const Ia = () => {
1841
1711
  ] })
1842
1712
  ] }) });
1843
1713
  };
1844
- function $a({
1845
- ...t
1846
- }) {
1714
+ function $a({ ...t }) {
1847
1715
  return /* @__PURE__ */ a(v.Root, { "data-slot": "dialog", ...t });
1848
1716
  }
1849
- function Wa({
1850
- ...t
1851
- }) {
1717
+ function Wa({ ...t }) {
1852
1718
  return /* @__PURE__ */ a(v.Portal, { "data-slot": "dialog-portal", ...t });
1853
1719
  }
1854
- function Fa({
1855
- className: t,
1856
- ...e
1857
- }) {
1720
+ function Fa({ className: t, ...e }) {
1858
1721
  return /* @__PURE__ */ a(
1859
1722
  v.Backdrop,
1860
1723
  {
@@ -1894,10 +1757,7 @@ function Oa({
1894
1757
  )
1895
1758
  ] });
1896
1759
  }
1897
- function ja({
1898
- className: t,
1899
- ...e
1900
- }) {
1760
+ function ja({ className: t, ...e }) {
1901
1761
  return /* @__PURE__ */ a(
1902
1762
  v.Title,
1903
1763
  {
@@ -1928,13 +1788,8 @@ function Ua(t) {
1928
1788
  }), s(r.items, r.icon, [r.title]);
1929
1789
  }), e;
1930
1790
  }
1931
- function Ka({
1932
- routes: t
1933
- }) {
1934
- const e = ye(), s = Ft(null), [r, n] = H(!1), [o, i] = H(""), [l, u] = H(0), w = B(
1935
- () => Ba(t, o),
1936
- [t, o]
1937
- ), d = M((x) => {
1791
+ function Ka({ routes: t }) {
1792
+ const e = ye(), s = Ft(null), [r, n] = H(!1), [o, i] = H(""), [l, u] = H(0), w = B(() => Ba(t, o), [t, o]), d = M((x) => {
1938
1793
  i(x), u(0);
1939
1794
  }, []);
1940
1795
  F(() => {
@@ -1959,9 +1814,7 @@ function Ka({
1959
1814
  if (!x.nativeEvent.isComposing)
1960
1815
  switch (x.key) {
1961
1816
  case "ArrowDown":
1962
- x.preventDefault(), u(
1963
- (b) => b < w.length - 1 ? b + 1 : b
1964
- );
1817
+ x.preventDefault(), u((b) => b < w.length - 1 ? b + 1 : b);
1965
1818
  break;
1966
1819
  case "ArrowUp":
1967
1820
  x.preventDefault(), u((b) => b > 0 ? b - 1 : b);
@@ -1985,10 +1838,8 @@ function Ka({
1985
1838
  listRef: s
1986
1839
  };
1987
1840
  }
1988
- function Va({
1989
- navItems: t
1990
- }) {
1991
- const e = E(), s = B(() => Ua(t), [t]), {
1841
+ function Va({ navItems: t }) {
1842
+ const e = A(), s = B(() => Ua(t), [t]), {
1992
1843
  open: r,
1993
1844
  handleOpenChange: n,
1994
1845
  search: o,
@@ -2020,43 +1871,36 @@ function Va({
2020
1871
  }
2021
1872
  )
2022
1873
  ] }),
2023
- /* @__PURE__ */ a(
2024
- "div",
1874
+ /* @__PURE__ */ a("div", { ref: h, className: "astw:max-h-75 astw:overflow-y-auto astw:overflow-x-hidden", children: u.length === 0 ? /* @__PURE__ */ a("div", { className: "astw:py-6 astw:text-center astw:text-sm astw:text-muted-foreground", children: e("commandPaletteNoResults") }) : /* @__PURE__ */ a("div", { className: "astw:p-1", children: u.map((p, g) => /* @__PURE__ */ c(
1875
+ "button",
2025
1876
  {
2026
- ref: h,
2027
- className: "astw:max-h-75 astw:overflow-y-auto astw:overflow-x-hidden",
2028
- children: u.length === 0 ? /* @__PURE__ */ a("div", { className: "astw:py-6 astw:text-center astw:text-sm astw:text-muted-foreground", children: e("commandPaletteNoResults") }) : /* @__PURE__ */ a("div", { className: "astw:p-1", children: u.map((p, g) => /* @__PURE__ */ c(
2029
- "button",
2030
- {
2031
- "data-index": g,
2032
- onClick: () => w(p),
2033
- className: m(
2034
- "astw:relative astw:flex astw:flex-col astw:w-full astw:cursor-pointer astw:select-none astw:items-start astw:rounded-sm astw:px-2 astw:py-2 astw:text-sm astw:outline-none astw:text-left",
2035
- g === l ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
2036
- ),
2037
- children: [
2038
- /* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children: p.breadcrumb.join(" > ") }),
2039
- /* @__PURE__ */ c("span", { className: "astw:text-[11px] astw:text-muted-foreground astw:truncate astw:w-full astw:text-left", children: [
2040
- "/",
2041
- p.path
2042
- ] })
2043
- ]
2044
- },
2045
- p.path
2046
- )) })
2047
- }
2048
- )
1877
+ "data-index": g,
1878
+ onClick: () => w(p),
1879
+ className: m(
1880
+ "astw:relative astw:flex astw:flex-col astw:w-full astw:cursor-pointer astw:select-none astw:items-start astw:rounded-sm astw:px-2 astw:py-2 astw:text-sm astw:outline-none astw:text-left",
1881
+ g === l ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
1882
+ ),
1883
+ children: [
1884
+ /* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children: p.breadcrumb.join(" > ") }),
1885
+ /* @__PURE__ */ c("span", { className: "astw:text-[11px] astw:text-muted-foreground astw:truncate astw:w-full astw:text-left", children: [
1886
+ "/",
1887
+ p.path
1888
+ ] })
1889
+ ]
1890
+ },
1891
+ p.path
1892
+ )) }) })
2049
1893
  ]
2050
1894
  }
2051
1895
  ) });
2052
1896
  }
2053
1897
  function Ks() {
2054
- const t = Qt();
1898
+ const t = Yt();
2055
1899
  return /* @__PURE__ */ a(it, { fallback: null, children: /* @__PURE__ */ a(zt, { resolve: t, children: (e) => /* @__PURE__ */ a(Va, { navItems: e ?? [] }) }) });
2056
1900
  }
2057
1901
  function Ha(t, e, s) {
2058
1902
  if (s.current === null || s.current.contextData !== e || s.current.guards !== t) {
2059
- const r = Qa(t, e), n = {
1903
+ const r = Ya(t, e), n = {
2060
1904
  contextData: e,
2061
1905
  guards: t,
2062
1906
  promise: r,
@@ -2086,8 +1930,8 @@ function Ga(t) {
2086
1930
  }
2087
1931
  const Vs = (t) => {
2088
1932
  const { guards: e, children: s, fallback: r = null, loading: n = null } = t, { contextData: o } = jt(), i = Ft(null), l = Ha(e, o, i);
2089
- return /* @__PURE__ */ a(it, { fallback: n, children: /* @__PURE__ */ a(qa, { cache: l, children: s, fallback: r }) });
2090
- }, qa = (t) => Ga(t.cache).type === "pass" ? /* @__PURE__ */ a(S, { children: t.children }) : /* @__PURE__ */ a(S, { children: t.fallback }), Qa = async (t, e) => {
1933
+ return /* @__PURE__ */ a(it, { fallback: n, children: /* @__PURE__ */ a(qa, { cache: l, fallback: r, children: s }) });
1934
+ }, qa = (t) => Ga(t.cache).type === "pass" ? /* @__PURE__ */ a(S, { children: t.children }) : /* @__PURE__ */ a(S, { children: t.fallback }), Ya = async (t, e) => {
2091
1935
  const s = { context: e };
2092
1936
  for (const r of t) {
2093
1937
  const n = await r(s);
@@ -2096,25 +1940,21 @@ const Vs = (t) => {
2096
1940
  }
2097
1941
  return { type: "pass" };
2098
1942
  };
2099
- function Ya(t) {
2100
- const e = new URLSearchParams(t.search);
2101
- e.delete("code"), e.delete("state");
2102
- const s = e.toString();
2103
- return t.pathname + (s ? `?${s}` : "") + t.hash;
2104
- }
2105
1943
  function Hs(t) {
2106
1944
  const e = De(t), { appUri: s } = t;
2107
1945
  return {
2108
1946
  ...e,
2109
1947
  getAppUri() {
2110
1948
  return s;
2111
- },
2112
- async getAuthHeadersForQuery(n = "/query", o = "POST") {
2113
- const i = `${s}${n}`;
2114
- return e.getAuthHeaders(i, o);
2115
1949
  }
2116
1950
  };
2117
1951
  }
1952
+ function Qa(t) {
1953
+ const e = new URLSearchParams(t.search);
1954
+ e.delete("code"), e.delete("state");
1955
+ const s = e.toString();
1956
+ return t.pathname + (s ? `?${s}` : "") + t.hash;
1957
+ }
2118
1958
  const ie = X(null), Gs = (t) => {
2119
1959
  const e = t.client, s = M(
2120
1960
  (l) => e.addEventListener((u) => {
@@ -2127,9 +1967,7 @@ const ie = X(null), Gs = (t) => {
2127
1967
  if (new URLSearchParams(window.location.search).has("code"))
2128
1968
  try {
2129
1969
  await e.handleCallback();
2130
- const w = Ya(
2131
- new URL(window.location.href)
2132
- );
1970
+ const w = Qa(new URL(window.location.href));
2133
1971
  window.history.replaceState({}, "", w);
2134
1972
  } catch (w) {
2135
1973
  console.error("Failed to handle callback:", w);
@@ -2157,9 +1995,7 @@ const ie = X(null), Gs = (t) => {
2157
1995
  }, le = () => {
2158
1996
  const t = L(ie);
2159
1997
  if (!t)
2160
- throw new Error(
2161
- "useAuth/useAuthSuspense must be used within an AuthProvider"
2162
- );
1998
+ throw new Error("useAuth/useAuthSuspense must be used within an AuthProvider");
2163
1999
  return t;
2164
2000
  }, qs = () => {
2165
2001
  const t = le(), { isAuthenticated: e, error: s, isReady: r } = t.authState;
@@ -2171,7 +2007,7 @@ const ie = X(null), Gs = (t) => {
2171
2007
  logout: t.logout,
2172
2008
  checkAuthStatus: t.checkAuthStatus
2173
2009
  };
2174
- }, Qs = () => {
2010
+ }, Ys = () => {
2175
2011
  const t = le();
2176
2012
  if (!t.authState.isReady)
2177
2013
  throw t.ready();
@@ -2183,7 +2019,7 @@ const ie = X(null), Gs = (t) => {
2183
2019
  logout: t.logout,
2184
2020
  checkAuthStatus: t.checkAuthStatus
2185
2021
  };
2186
- }, Ys = () => Me, Xa = ot(
2022
+ }, Qs = () => Me, Xa = ot(
2187
2023
  "astw:inline-flex astw:items-center astw:rounded-md astw:border astw:px-2 astw:py-0.5 astw:text-xs astw:font-medium astw:transition-colors astw:focus:outline-none astw:focus:ring-2 astw:focus:ring-ring astw:focus:ring-offset-2",
2188
2024
  {
2189
2025
  variants: {
@@ -2293,11 +2129,7 @@ function os(t) {
2293
2129
  if (typeof t == "object" && t !== null) {
2294
2130
  const e = t, s = [];
2295
2131
  e.line1 && s.push(String(e.line1)), e.line2 && s.push(String(e.line2));
2296
- const r = [
2297
- e.city,
2298
- e.state || e.province,
2299
- e.zip || e.postalCode
2300
- ].filter(Boolean).join(", ");
2132
+ const r = [e.city, e.state || e.province, e.zip || e.postalCode].filter(Boolean).join(", ");
2301
2133
  return r && s.push(r), e.country && s.push(String(e.country)), s;
2302
2134
  }
2303
2135
  return [String(t)];
@@ -2321,7 +2153,7 @@ function ce({ value: t }) {
2321
2153
  className: "astw:ml-0.5 astw:inline-flex astw:items-center astw:justify-center astw:p-1 astw:rounded astw:hover:bg-muted astw:transition-colors astw:text-muted-foreground astw:hover:text-foreground"
2322
2154
  }
2323
2155
  ),
2324
- children: e ? /* @__PURE__ */ a(Pe, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 }) : /* @__PURE__ */ a(Ae, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 })
2156
+ children: e ? /* @__PURE__ */ a(Pe, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 }) : /* @__PURE__ */ a(Ee, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 })
2325
2157
  }
2326
2158
  ),
2327
2159
  /* @__PURE__ */ a(ft, { side: "top", children: e ? "Copied!" : "Copy" })
@@ -2423,14 +2255,7 @@ function ms({ field: t }) {
2423
2255
  if (!r || !s)
2424
2256
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
2425
2257
  const o = s.replace("{id}", r);
2426
- return /* @__PURE__ */ a(
2427
- "a",
2428
- {
2429
- href: o,
2430
- className: "astw:text-sm astw:text-primary astw:hover:underline",
2431
- children: n
2432
- }
2433
- );
2258
+ return /* @__PURE__ */ a("a", { href: o, className: "astw:text-sm astw:text-primary astw:hover:underline", children: n });
2434
2259
  }
2435
2260
  function Lt(t) {
2436
2261
  switch (t.type) {
@@ -2542,13 +2367,7 @@ function Xs({
2542
2367
  o && /* @__PURE__ */ a("div", { children: o })
2543
2368
  ] }),
2544
2369
  /* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: l ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: i.map((d, h) => /* @__PURE__ */ c(f.Fragment, { children: [
2545
- h > 0 && /* @__PURE__ */ a(
2546
- "div",
2547
- {
2548
- className: "astw:h-px astw:bg-border",
2549
- role: "separator"
2550
- }
2551
- ),
2370
+ h > 0 && /* @__PURE__ */ a("div", { className: "astw:h-px astw:bg-border", role: "separator" }),
2552
2371
  w(d)
2553
2372
  ] }, d.id)) }) : /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: "No information available" }) })
2554
2373
  ]
@@ -2567,14 +2386,7 @@ const xt = f.forwardRef(
2567
2386
  )
2568
2387
  );
2569
2388
  xt.displayName = "Layout.Column";
2570
- function bs({
2571
- columns: t,
2572
- className: e,
2573
- gap: s = 4,
2574
- title: r,
2575
- actions: n,
2576
- children: o
2577
- }) {
2389
+ function bs({ columns: t, className: e, gap: s = 4, title: r, actions: n, children: o }) {
2578
2390
  if (process.env.NODE_ENV !== "production") {
2579
2391
  const h = f.Children.toArray(o).reduce((p, g) => f.isValidElement(g) && g.type === xt ? p + 1 : p, 0);
2580
2392
  if (h !== t)
@@ -2589,16 +2401,10 @@ function bs({
2589
2401
  t === 1 && "astw:flex-col",
2590
2402
  // 2 columns: Stack on mobile, side-by-side on desktop (lg: ≥1024px)
2591
2403
  // Main column flexible, side column fixed 360px
2592
- t === 2 && [
2593
- "astw:flex-col",
2594
- "astw:lg:flex-row"
2595
- ],
2404
+ t === 2 && ["astw:flex-col", "astw:lg:flex-row"],
2596
2405
  // 3 columns: Stack on mobile, 3 columns side-by-side on desktop (xl: ≥1280px)
2597
2406
  // Outer columns fixed 360px, middle column flexible
2598
- t === 3 && [
2599
- "astw:flex-col",
2600
- "astw:xl:flex-row"
2601
- ],
2407
+ t === 3 && ["astw:flex-col", "astw:xl:flex-row"],
2602
2408
  e
2603
2409
  ), u = f.useMemo(() => t === 1 ? f.Children.map(o, (d) => d) : t === 2 ? f.Children.map(o, (d, h) => f.isValidElement(d) ? f.cloneElement(d, {
2604
2410
  className: m(
@@ -2622,14 +2428,14 @@ function bs({
2622
2428
  "header",
2623
2429
  {
2624
2430
  className: "astw:w-full astw:flex astw:justify-between astw:items-center",
2625
- style: { padding: "1.5rem", paddingBottom: "1rem" },
2431
+ style: { paddingTop: "1rem", paddingBottom: "1rem" },
2626
2432
  children: [
2627
2433
  r && /* @__PURE__ */ a("h1", { style: { fontSize: "1.5rem", fontWeight: "bold" }, children: r }),
2628
2434
  n && n.length > 0 && /* @__PURE__ */ a("div", { className: "astw:flex astw:gap-2 astw:items-center", children: n.map((d, h) => /* @__PURE__ */ a(f.Fragment, { children: d }, h)) })
2629
2435
  ]
2630
2436
  }
2631
2437
  ),
2632
- /* @__PURE__ */ a("div", { style: { padding: w ? "0 1.5rem 1.5rem 1.5rem" : "1.5rem" }, children: /* @__PURE__ */ a("div", { className: l, children: u }) })
2438
+ /* @__PURE__ */ a("div", { style: { padding: w ? "0 0 1rem 0" : "1rem 0 1rem 0" }, children: /* @__PURE__ */ a("div", { className: l, children: u }) })
2633
2439
  ] });
2634
2440
  }
2635
2441
  bs.Column = xt;
@@ -2668,13 +2474,13 @@ export {
2668
2474
  C as useAppShellConfig,
2669
2475
  Ls as useAppShellData,
2670
2476
  qs as useAuth,
2671
- Qs as useAuthSuspense,
2477
+ Ys as useAuthSuspense,
2672
2478
  ar as useLocation,
2673
2479
  sr as useNavigate,
2674
2480
  Na as usePageMeta,
2675
2481
  rr as useParams,
2676
2482
  nr as useRouteError,
2677
2483
  or as useSearchParams,
2678
- Ye as useTheme,
2679
- Ys as useToast
2484
+ Qe as useTheme,
2485
+ Qs as useToast
2680
2486
  };
package/package.json CHANGED
@@ -1,30 +1,30 @@
1
1
  {
2
2
  "name": "@tailor-platform/app-shell",
3
- "version": "0.27.2",
3
+ "version": "0.28.0",
4
4
  "description": "An opinionated React application framework for building ERP applications on Tailor Platform",
5
5
  "keywords": [
6
- "react",
7
6
  "app-shell",
8
- "tailor-platform",
9
7
  "erp",
10
- "vite",
8
+ "react",
9
+ "routing",
11
10
  "sidebar",
12
- "routing"
11
+ "tailor-platform",
12
+ "vite"
13
13
  ],
14
- "license": "MIT",
15
14
  "homepage": "https://github.com/tailor-platform/app-shell/tree/main/packages/core#readme",
16
15
  "bugs": {
17
16
  "url": "https://github.com/tailor-platform"
18
17
  },
19
- "type": "module",
18
+ "license": "MIT",
20
19
  "repository": {
21
20
  "type": "git",
22
21
  "url": "https://github.com/tailor-platform/app-shell",
23
22
  "directory": "packages/core"
24
23
  },
25
- "publishConfig": {
26
- "access": "public"
27
- },
24
+ "files": [
25
+ "dist/**"
26
+ ],
27
+ "type": "module",
28
28
  "exports": {
29
29
  "./styles": "./dist/app-shell.css",
30
30
  "./theme.css": "./dist/theme.css",
@@ -37,25 +37,20 @@
37
37
  "default": "./dist/vite-plugin.js"
38
38
  }
39
39
  },
40
- "files": [
41
- "dist/**"
42
- ],
43
- "peerDependencies": {
44
- "react": ">= 19",
45
- "react-dom": ">= 19"
40
+ "publishConfig": {
41
+ "access": "public"
46
42
  },
47
43
  "dependencies": {
48
44
  "@base-ui/react": "^1.2.0",
49
- "@tailor-platform/auth-public-client": "^0.4.1",
45
+ "@tailor-platform/auth-public-client": "^0.5.0",
50
46
  "@tanstack/react-table": "^8.21.3",
51
47
  "change-case": "^5.4.4",
52
48
  "class-variance-authority": "^0.7.1",
53
49
  "clsx": "^2.1.1",
54
- "es-toolkit": "^1.44.0",
50
+ "es-toolkit": "^1.45.1",
55
51
  "graphql": "^16.13.0",
56
52
  "lucide-react": "^0.562.0",
57
53
  "next-themes": "^0.4.6",
58
- "oauth4webapi": "^3.8.5",
59
54
  "react": "^19.2.4",
60
55
  "react-dom": "^19.2.4",
61
56
  "react-hook-form": "^7.71.2",
@@ -83,6 +78,10 @@
83
78
  "vite-tsconfig-paths": "^6.0.4",
84
79
  "vitest": "^4.0.18"
85
80
  },
81
+ "peerDependencies": {
82
+ "react": ">= 19",
83
+ "react-dom": ">= 19"
84
+ },
86
85
  "scripts": {
87
86
  "dev": "vite build --watch --mode development",
88
87
  "build": "vite build",