@donotdev/ui 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{GoToDialog-CICRYHHG.js → GoToDialog-KSBGOIWO.js} +1 -1
- package/dist/chunk-MS7ZIW5Z.js +1 -0
- package/dist/components/auth/AuthHeader.d.ts.map +1 -1
- package/dist/components/auth/AuthHeader.js +0 -2
- package/dist/components/auth/AuthMenu.d.ts.map +1 -1
- package/dist/components/auth/AuthMenu.js +6 -40
- package/dist/components/common/TechBento.d.ts +2 -6
- package/dist/components/common/TechBento.d.ts.map +1 -1
- package/dist/components/common/TechBento.js +14 -16
- package/dist/components/common/icon.d.ts.map +1 -1
- package/dist/components/common/icon.js +2 -1
- package/dist/components/common/lucideIconByName.d.ts +9 -0
- package/dist/components/common/lucideIconByName.d.ts.map +1 -0
- package/dist/components/common/lucideIconByName.js +32 -0
- package/dist/components/layout/GameFlow.d.ts.map +1 -1
- package/dist/components/layout/components/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/layout/components/Breadcrumbs.js +14 -9
- package/dist/components/layout/components/header/CacheSettings.d.ts.map +1 -1
- package/dist/components/layout/components/header/CacheSettings.js +6 -4
- package/dist/components/layout/components/header/SettingsMenu.d.ts.map +1 -1
- package/dist/components/layout/components/header/SettingsMenu.js +2 -1
- package/dist/components/layout/components/header/ThemeToggle.d.ts.map +1 -1
- package/dist/components/layout/components/header/ThemeToggle.js +2 -1
- package/dist/crud/components/CrudCardLink.d.ts +6 -6
- package/dist/crud/components/CrudCardLink.d.ts.map +1 -1
- package/dist/crud/components/CrudCardLink.js +3 -9
- package/dist/crud/components/EntityCardList.d.ts.map +1 -1
- package/dist/crud/components/EntityCardList.js +3 -11
- package/dist/crud/components/EntityDisplayRenderer.d.ts +1 -1
- package/dist/crud/components/EntityDisplayRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityDisplayRenderer.js +17 -58
- package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityFormRenderer.js +27 -5
- package/dist/crud/components/EntityList.d.ts +4 -4
- package/dist/crud/components/EntityList.d.ts.map +1 -1
- package/dist/crud/components/EntityList.js +136 -59
- package/dist/crud/components/Form.d.ts +1 -1
- package/dist/crud/components/Form.d.ts.map +1 -1
- package/dist/crud/components/Form.js +2 -2
- package/dist/crud/components/cellEditFor.d.ts +28 -0
- package/dist/crud/components/cellEditFor.d.ts.map +1 -0
- package/dist/crud/components/cellEditFor.js +54 -0
- package/dist/crud/components/entityParent.d.ts +40 -0
- package/dist/crud/components/entityParent.d.ts.map +1 -0
- package/dist/crud/components/entityParent.js +54 -0
- package/dist/crud/components/useRecordBreadcrumb.d.ts +11 -0
- package/dist/crud/components/useRecordBreadcrumb.d.ts.map +1 -0
- package/dist/crud/components/useRecordBreadcrumb.js +34 -0
- package/dist/crud/crudImports.d.ts +3 -0
- package/dist/crud/crudImports.d.ts.map +1 -1
- package/dist/crud/crudImports.js +3 -0
- package/dist/dndev-next.css +483 -145
- package/dist/dndev.css +483 -145
- package/dist/index.js +4 -4
- package/dist/internal/common/RouteErrorFallback.d.ts.map +1 -1
- package/dist/internal/common/RouteErrorFallback.js +2 -4
- package/dist/internal/devtools/components/ConfigTab.d.ts.map +1 -1
- package/dist/internal/devtools/components/ConfigTab.js +1 -1
- package/dist/internal/devtools/components/CookieTab.d.ts.map +1 -1
- package/dist/internal/devtools/components/CookieTab.js +1 -5
- package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -1
- package/dist/internal/devtools/components/DesignTab.js +18 -7
- package/dist/internal/devtools/components/StoresTab.d.ts.map +1 -1
- package/dist/internal/devtools/components/StoresTab.js +17 -3
- package/dist/internal/devtools/types.d.ts +3 -3
- package/dist/internal/devtools/types.d.ts.map +1 -1
- package/dist/internal/devtools/utils/maskSensitive.d.ts +1 -1
- package/dist/internal/devtools/utils/maskSensitive.d.ts.map +1 -1
- package/dist/internal/layout/DnDevLayout.d.ts.map +1 -1
- package/dist/internal/layout/DnDevLayout.js +21 -21
- package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/AutoMetaTags.js +45 -58
- package/dist/internal/layout/components/footer/FooterLegalLinks.js +2 -2
- package/dist/internal/layout/components/footer/useLegalLinks.d.ts +0 -2
- package/dist/internal/layout/components/footer/useLegalLinks.d.ts.map +1 -1
- package/dist/internal/layout/components/footer/useLegalLinks.js +0 -2
- package/dist/internal/layout/components/i18nSeoMeta.d.ts +54 -0
- package/dist/internal/layout/components/i18nSeoMeta.d.ts.map +1 -0
- package/dist/internal/layout/components/i18nSeoMeta.js +53 -0
- package/dist/internal/layout/components/index.d.ts +1 -1
- package/dist/internal/layout/components/index.js +1 -1
- package/dist/internal/layout/zones/DnDevMergedBar.js +3 -3
- package/dist/internal/providers/UIProviders.d.ts.map +1 -1
- package/dist/internal/providers/UIProviders.js +7 -2
- package/dist/providers/NextJsAppProviders.d.ts +5 -1
- package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
- package/dist/providers/NextJsAppProviders.js +36 -6
- package/dist/providers/ViteAppProviders.d.ts.map +1 -1
- package/dist/providers/ViteAppProviders.js +42 -4
- package/dist/routing/404.js +4 -4
- package/dist/routing/AuthGuard.d.ts +0 -4
- package/dist/routing/AuthGuard.d.ts.map +1 -1
- package/dist/routing/AuthGuard.js +0 -4
- package/dist/routing/AuthGuardFallback.d.ts.map +1 -1
- package/dist/routing/AuthGuardFallback.js +1 -2
- package/dist/routing/AuthReturnTo.d.ts.map +1 -1
- package/dist/routing/AuthReturnTo.js +9 -2
- package/dist/routing/GoTo.d.ts +0 -6
- package/dist/routing/GoTo.d.ts.map +1 -1
- package/dist/routing/GoTo.js +5 -8
- package/dist/routing/Link.d.ts +4 -2
- package/dist/routing/Link.d.ts.map +1 -1
- package/dist/routing/Link.js +8 -5
- package/dist/routing/SignedInRedirect.d.ts +27 -0
- package/dist/routing/SignedInRedirect.d.ts.map +1 -0
- package/dist/routing/SignedInRedirect.js +47 -0
- package/dist/routing/hooks/hooks.next.d.ts +2 -0
- package/dist/routing/hooks/hooks.next.d.ts.map +1 -1
- package/dist/routing/hooks/hooks.next.js +1 -1
- package/dist/routing/hooks/hooks.vite.d.ts +2 -0
- package/dist/routing/hooks/hooks.vite.d.ts.map +1 -1
- package/dist/routing/hooks/hooks.vite.js +1 -1
- package/dist/routing/hooks/useLocation.next.d.ts +12 -0
- package/dist/routing/hooks/useLocation.next.d.ts.map +1 -1
- package/dist/routing/hooks/useLocation.next.js +17 -4
- package/dist/routing/hooks/useMatch.next.d.ts +6 -0
- package/dist/routing/hooks/useMatch.next.d.ts.map +1 -1
- package/dist/routing/hooks/useMatch.next.js +8 -2
- package/dist/routing/hooks/useNavigate.next.d.ts +6 -1
- package/dist/routing/hooks/useNavigate.next.d.ts.map +1 -1
- package/dist/routing/hooks/useNavigate.next.js +13 -4
- package/dist/routing/hooks/useNavigate.vite.d.ts +7 -1
- package/dist/routing/hooks/useNavigate.vite.d.ts.map +1 -1
- package/dist/routing/hooks/useNavigate.vite.js +20 -4
- package/dist/routing/hooks/useRedirectGuard.next.d.ts.map +1 -1
- package/dist/routing/hooks/useRedirectGuard.next.js +7 -1
- package/dist/routing/hooks/useRedirectGuard.vite.d.ts.map +1 -1
- package/dist/routing/hooks/useRedirectGuard.vite.js +7 -1
- package/dist/routing/hooks/useRoutePath.next.d.ts +23 -0
- package/dist/routing/hooks/useRoutePath.next.d.ts.map +1 -0
- package/dist/routing/hooks/useRoutePath.next.js +36 -0
- package/dist/routing/hooks/useRoutePath.vite.d.ts +13 -0
- package/dist/routing/hooks/useRoutePath.vite.d.ts.map +1 -0
- package/dist/routing/hooks/useRoutePath.vite.js +25 -0
- package/dist/routing/hooks/useUrlLanguage.next.d.ts +28 -0
- package/dist/routing/hooks/useUrlLanguage.next.d.ts.map +1 -0
- package/dist/routing/hooks/useUrlLanguage.next.js +50 -0
- package/dist/routing/hooks/useUrlLanguage.vite.d.ts +22 -0
- package/dist/routing/hooks/useUrlLanguage.vite.d.ts.map +1 -0
- package/dist/routing/hooks/useUrlLanguage.vite.js +41 -0
- package/dist/routing/index.d.ts +3 -1
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/index.js +2 -1
- package/dist/routing/useNavigation.js +4 -4
- package/dist/styles/index.css +483 -145
- package/dist/symbol-index.json +1 -1
- package/dist/utils/assetResolver.d.ts.map +1 -1
- package/dist/utils/assetResolver.js +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -0
- package/dist/utils/useDeleteAccountSafe.d.ts +17 -0
- package/dist/utils/useDeleteAccountSafe.d.ts.map +1 -0
- package/dist/utils/useDeleteAccountSafe.js +52 -0
- package/dist/utils/useFormStoreSafe.d.ts.map +1 -1
- package/dist/utils/useFormStoreSafe.js +1 -0
- package/dist/utils/useSeo.d.ts +10 -2
- package/dist/utils/useSeo.d.ts.map +1 -1
- package/dist/utils/useSeo.js +44 -9
- package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
- package/dist/vite-routing/AppRoutes.js +37 -4
- package/guidelines/COMPONENTS.md +2 -1
- package/guidelines/PAGES.md +7 -0
- package/guidelines/ROUTING.md +4 -0
- package/guidelines/SEO.md +64 -0
- package/package.json +9 -9
- package/dist/CookieConsent-5NH5DNTP.js +0 -1
- package/dist/CookieConsent-W7UE647Y.js +0 -1
- package/dist/GoToDialog-YGBON6FR.js +0 -1
- package/dist/chunk-DRFM6WXH.js +0 -1
- package/dist/chunk-MIPTBUWY.js +0 -1
- package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts +0 -57
- package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts.map +0 -1
- package/dist/internal/layout/components/NextJsAutoMetaTags.js +0 -182
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as u,i as T}from"./chunk-MS7ZIW5Z.js";import"./chunk-O2XFH626.js";import{Link as G,Star as I}from"lucide-react";import{useCallback as k,useEffect as D,useRef as O}from"react";import{Badge as S,Command as R,CommandDialog as F}from"@donotdev/components";import{useOverlayStore as v,useTranslation as A}from"@donotdev/core";import{jsx as o,jsxs as t}from"react/jsx-runtime";var E=()=>{let{t:e}=A("dndev"),d=O(null),m=v(a=>a.isCommandDialogOpen),r=v(a=>a.closeCommandDialog),{navigationItems:f,favoriteItems:s,recentItems:i,toggleFavorite:b,isFavorite:c,navigateToItem:h}=T();D(()=>{m&&requestAnimationFrame(()=>{d.current?.focus()})},[m]);let C=k(a=>{h(a),r()},[h,r]),p=k((a,g=!0)=>a.map(n=>({label:n.label,value:n.path,description:n.path!==n.label?n.path:void 0,icon:o(u,{icon:n.icon,fallback:G}),badge:n.badge?o(S,{children:n.badge}):void 0,onSelect:()=>C(n.path),rightSlot:g?o("button",{type:"button",onClick:y=>{y.stopPropagation(),b(n.path)},className:"dndev-command-favorite-button","data-favorited":c(n.path),"aria-label":c(n.path)?e("globalGoTo.unfavorite","Remove from favorites"):e("globalGoTo.favorite","Add to favorites"),children:o(u,{icon:I,className:"dndev-size-sm"})}):void 0})),[C,b,c,e]),l=[];if(s.length>0&&l.push({heading:e("globalGoTo.favorites","Favorites"),items:p(s,!1)}),i.length>0){let a=i.flatMap(g=>p([g],!0));a.length>0&&l.push({heading:e("globalGoTo.recent","Recent"),separator:s.length>0,items:a})}l.push({heading:e("globalGoTo.allPages","All Pages"),separator:s.length>0||i.length>0,items:p(f)});let N=f.length>0;return t(F,{open:m,onOpenChange:a=>a?null:r(),children:[o(R,{placeholder:e("globalGoTo.placeholder","Search pages..."),emptyMessage:N?e("globalGoTo.noResults","No results found."):e("globalGoTo.empty","No pages available."),groups:l}),o("div",{className:"dndev-command-footer",children:t("div",{className:"dndev-command-footer-shortcuts",children:[t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"\u2318K"}),o("span",{children:e("globalGoTo.shortcutOpen","Open")})]}),t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"\u2191"}),o("kbd",{className:"dndev-command-footer-key",children:"\u2193"}),o("span",{children:e("globalGoTo.shortcutNavigate","Navigate")})]}),t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"\u21B5"}),o("span",{children:e("globalGoTo.shortcutSelect","Select")})]}),t("div",{className:"dndev-command-footer-shortcut",children:[o("kbd",{className:"dndev-command-footer-key",children:"Esc"}),o("span",{children:e("globalGoTo.shortcutClose","Close")})]})]})})]})},L=()=>v(d=>d.isCommandDialogOpen)?o(E,{}):null,K=L;export{K as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as p from"lucide-react";import{isValidElement as P}from"react";import{cn as f}from"@donotdev/components";import*as b from"lucide-react";var x=b;function C(e){return typeof e=="function"||typeof e=="object"&&e!==null&&"render"in e}function y(e){let t=x[e];return C(t)?t:void 0}import{jsx as c}from"react/jsx-runtime";function E(e){if(!e)return p.Palette;let t=e.replace(/['"]/g,"");return y(t)||p.Palette}var S=({icon:e,fallback:t,className:i,ariaHidden:s=!1})=>{let o=e||t;if(!o)return null;let a="dndev-size-md";if(typeof o=="function"||typeof o=="object"&&o!==null&&"render"in o)return c(o,{className:f(a,i),style:{flexShrink:0},"aria-hidden":s});if(typeof o=="string"){if(!/^[a-zA-Z0-9_-]+$/.test(o))return c("span",{className:f(a,i),style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":s,children:o});let d=E(o);return c(d,{className:f(a,i),style:{flexShrink:0},"aria-hidden":s})}return P(o)?c("span",{className:i,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":s,children:o}):c("span",{className:i,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":s,children:o})},$=S;import*as v from"@donotdev/auth";import{DEGRADED_AUTH_API as k}from"@donotdev/core";var m=v?.useAuth;function T(e){return k[e]}function h(e){return m?m(e):T(e)}var q=typeof m=="function",B=v?.PasswordResetCallback??(()=>null);import{useMemo as A}from"react";import{useNavigationStore as K,useTranslation as F}from"@donotdev/core";import{USER_ROLES as w}from"@donotdev/core";import{useRoutePath as _}from"@donotdev/ui/routing/hooks";function g(){let e=_(),t=h("user"),i=!!t,{t:s}=F(),o=t?.role||w.GUEST,a=K(r=>!r||typeof r.getFilteredRoutes!="function"?[]:r.getFilteredRoutes({authenticated:i,role:o}));return A(()=>Array.isArray(a)?a.map(r=>({...r,label:j(r,s),isActive:D(r.path,e),hasChildren:!1,children:void 0})).sort((r,l)=>r.label.localeCompare(l.label,void 0,{sensitivity:"base"})):[],[a,e,s])}function ne(e){let t=g();return A(()=>t.find(i=>i.path===e),[t,e])}function j(e,t){let i=e.meta?.namespace;return typeof i!="string"||i===""?e.label:t(`${i}:title`,{defaultValue:e.label})}function D(e,t){return e==="/"?t==="/":t===e?!0:t.startsWith(e+"/")}import{useCallback as V}from"react";import{useNavigationStore as u}from"@donotdev/core";import{useNavigate as U}from"@donotdev/ui/routing/hooks";var ce=()=>{let e=U(),t=g()??[],i=u(n=>n.favorites),s=u(n=>n.recent),o=u(n=>n.toggleFavorite),a=u(n=>n.isFavorite),r=u(n=>n.addRecent),l=t.length?t.filter(n=>i.includes(n.path)):[],d=t.length?t.filter(n=>s.includes(n.path)).slice(0,5):[],R=n=>{o(n)},N=n=>a(n),I=n=>{r(n)},L=V(n=>{I(n),e(n)},[e,I]);return{navigationItems:t,favoriteItems:l,recentItems:d,toggleFavorite:R,isFavorite:N,navigateToItem:L}};export{y as a,S as b,$ as c,h as d,q as e,B as f,g,ne as h,ce as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthHeader.d.ts","sourceRoot":"","sources":["../../../src/components/auth/AuthHeader.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"AuthHeader.d.ts","sourceRoot":"","sources":["../../../src/components/auth/AuthHeader.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAEL,cAAc,EAGd,OAAO,EACR,MAAM,sBAAsB,CAAC;AAuE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;IAC/D,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,eAAe,CAqJrD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -23,7 +23,6 @@ const NullComponent = () => null;
|
|
|
23
23
|
function SignInButton({ display, variant = BUTTON_VARIANT.OUTLINE, signInLabel, className, style, children, ...props }) {
|
|
24
24
|
return (_jsx(Button, { variant: variant, icon: User, display: display, tooltip: signInLabel, className: className, style: style, ...props, children: children ?? signInLabel }));
|
|
25
25
|
}
|
|
26
|
-
// @ts-expect-error - lazy() type doesn't account for graceful degradation fallback
|
|
27
26
|
const AuthPartnerButton = lazy(async () => {
|
|
28
27
|
try {
|
|
29
28
|
const module = await import('@donotdev/auth');
|
|
@@ -33,7 +32,6 @@ const AuthPartnerButton = lazy(async () => {
|
|
|
33
32
|
return { default: NullComponent };
|
|
34
33
|
}
|
|
35
34
|
});
|
|
36
|
-
// @ts-expect-error - lazy() type doesn't account for graceful degradation fallback
|
|
37
35
|
const MultipleAuthProviders = lazy(async () => {
|
|
38
36
|
try {
|
|
39
37
|
const module = await import('@donotdev/auth');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthMenu.d.ts","sourceRoot":"","sources":["../../../src/components/auth/AuthMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuthMenu.d.ts","sourceRoot":"","sources":["../../../src/components/auth/AuthMenu.tsx"],"names":[],"mappings":"AAyEA,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAML,OAAO,EACR,MAAM,sBAAsB,CAAC;AAwC9B;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB;IACjC,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IAEjD,sBAAsB;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAEnC,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AA4BD,eAAO,MAAM,QAAQ,GAAI,iFAOtB,aAAa,6BAyOf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -70,17 +70,17 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
70
70
|
* @author AMBROISE PARK Consulting
|
|
71
71
|
*/
|
|
72
72
|
import { User, LogOut, Settings, UserCheck, Trash2 } from 'lucide-react';
|
|
73
|
-
import * as LucideIcons from 'lucide-react';
|
|
74
73
|
import React, { useMemo, lazy, Suspense } from 'react';
|
|
75
74
|
import { Avatar, Button, BUTTON_VARIANT, DropdownMenu, Text, DISPLAY, } from '@donotdev/components';
|
|
76
75
|
import { useTranslation } from '@donotdev/core';
|
|
77
|
-
import { getEnabledAuthPartners, useAuthConfig
|
|
76
|
+
import { getEnabledAuthPartners, useAuthConfig } from '@donotdev/core';
|
|
78
77
|
import { useBreakpoint } from '@donotdev/core';
|
|
79
78
|
import { useNavigate } from '@donotdev/ui/routing/hooks';
|
|
80
79
|
import { useNavigationItems } from '../../routing';
|
|
81
80
|
import { useAuthSafe, useAuthVisibility } from '../../utils';
|
|
81
|
+
import { useDeleteAccountSafe } from '../../utils/useDeleteAccountSafe';
|
|
82
|
+
import { findLucideIcon } from '../common/lucideIconByName';
|
|
82
83
|
const NullComponent = () => null;
|
|
83
|
-
// @ts-expect-error - lazy() type doesn't account for graceful degradation fallback
|
|
84
84
|
const ReauthDialog = lazy(async () => {
|
|
85
85
|
try {
|
|
86
86
|
const module = await import('@donotdev/auth');
|
|
@@ -90,7 +90,6 @@ const ReauthDialog = lazy(async () => {
|
|
|
90
90
|
return { default: NullComponent };
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
-
// @ts-expect-error - lazy() type doesn't account for graceful degradation fallback
|
|
94
93
|
const ConfirmDeleteDialog = lazy(async () => {
|
|
95
94
|
try {
|
|
96
95
|
const module = await import('@donotdev/auth');
|
|
@@ -100,39 +99,6 @@ const ConfirmDeleteDialog = lazy(async () => {
|
|
|
100
99
|
return { default: NullComponent };
|
|
101
100
|
}
|
|
102
101
|
});
|
|
103
|
-
// Graceful degradation for useDeleteAccount hook
|
|
104
|
-
// Resolved at module level (not render level) to avoid Rules of Hooks violation.
|
|
105
|
-
// Once set, useDeleteAccount never changes identity during the app lifecycle.
|
|
106
|
-
let useDeleteAccount = () => {
|
|
107
|
-
// Fallback: always call useState to maintain stable hook order
|
|
108
|
-
const [showConfirmDialog] = React.useState(false);
|
|
109
|
-
const [showPasswordDialog] = React.useState(false);
|
|
110
|
-
const [isDeleting] = React.useState(false);
|
|
111
|
-
const [error] = React.useState(null);
|
|
112
|
-
return {
|
|
113
|
-
showConfirmDialog,
|
|
114
|
-
showPasswordDialog,
|
|
115
|
-
isDeleting,
|
|
116
|
-
error,
|
|
117
|
-
startDeleteFlow: () => { },
|
|
118
|
-
confirmDelete: async () => { },
|
|
119
|
-
cancel: () => { },
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
// Preload useDeleteAccount (non-blocking)
|
|
123
|
-
// The hook reference is swapped before the first render in practice,
|
|
124
|
-
// but if the import resolves after first render, the fallback remains
|
|
125
|
-
// stable for that session to avoid hook order changes mid-lifecycle.
|
|
126
|
-
if (isClient()) {
|
|
127
|
-
import('@donotdev/auth')
|
|
128
|
-
.then((module) => {
|
|
129
|
-
useDeleteAccount = module.useDeleteAccount;
|
|
130
|
-
})
|
|
131
|
-
.catch((e) => {
|
|
132
|
-
if (process.env.NODE_ENV === 'development')
|
|
133
|
-
console.warn('Failed to load @donotdev/auth:', e);
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
102
|
/**
|
|
137
103
|
* Resolves Lucide icon component from string name or component reference
|
|
138
104
|
*
|
|
@@ -150,7 +116,7 @@ const getIcon = (iconName) => {
|
|
|
150
116
|
if (typeof iconName === 'function')
|
|
151
117
|
return iconName;
|
|
152
118
|
const cleanIconName = iconName.replace(/['"]/g, '');
|
|
153
|
-
const resolved =
|
|
119
|
+
const resolved = findLucideIcon(cleanIconName);
|
|
154
120
|
if (!resolved && process.env.NODE_ENV === 'development') {
|
|
155
121
|
console.warn(`[AuthMenu] Icon name "${cleanIconName}" not found in Lucide icons, falling back to Settings.`);
|
|
156
122
|
}
|
|
@@ -170,8 +136,8 @@ export const AuthMenu = ({ loginPath, display = DISPLAY.AUTO, 'no-tooltip': noTo
|
|
|
170
136
|
const configMenuItems = authConfig.authMenuItems || [];
|
|
171
137
|
// Extract role from user (declared early so getUserTooltip can reference it)
|
|
172
138
|
const role = user?.role;
|
|
173
|
-
// Account deletion flow - managed by
|
|
174
|
-
const deletion =
|
|
139
|
+
// Account deletion flow - managed by useDeleteAccountSafe hook
|
|
140
|
+
const deletion = useDeleteAccountSafe();
|
|
175
141
|
/**
|
|
176
142
|
* Get user display name with fallbacks
|
|
177
143
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BentoGap, CardVariant, ResponsiveCols, Tone } from '@donotdev/components';
|
|
2
2
|
import { type TechKey } from '../../data/techLogos';
|
|
3
3
|
/** Props for the TechBento component. */
|
|
4
4
|
export type TechBentoProps = {
|
|
@@ -17,10 +17,6 @@ export type TechBentoProps = {
|
|
|
17
17
|
* @example [1, 1, 2, 3] - 1 col mobile/tablet, 2 laptop, 3 desktop
|
|
18
18
|
*/
|
|
19
19
|
cols?: number | ResponsiveCols;
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated Use `cols` prop instead. Kept for backward compatibility.
|
|
22
|
-
*/
|
|
23
|
-
columns?: BentoColumns;
|
|
24
20
|
gap?: BentoGap;
|
|
25
21
|
separator?: boolean;
|
|
26
22
|
/** Tone system for background colors (matches Section/CallToAction) */
|
|
@@ -37,6 +33,6 @@ export type TechBentoProps = {
|
|
|
37
33
|
defaultOpen?: boolean;
|
|
38
34
|
className?: string;
|
|
39
35
|
};
|
|
40
|
-
export declare function TechBento({ title, techs, cols,
|
|
36
|
+
export declare function TechBento({ title, techs, cols, gap, separator, tone, align, collapsible, open, onOpenChange, defaultOpen, className, }: TechBentoProps): import("react").JSX.Element;
|
|
41
37
|
export default TechBento;
|
|
42
38
|
//# sourceMappingURL=TechBento.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TechBento.d.ts","sourceRoot":"","sources":["../../../src/components/common/TechBento.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"TechBento.d.ts","sourceRoot":"","sources":["../../../src/components/common/TechBento.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAEV,QAAQ,EACR,WAAW,EACX,cAAc,EACd,IAAI,EACL,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/D,yCAAyC;AACzC,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;QACX,IAAI,EAAE,OAAO,CAAC;QACd,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;QAC3C,OAAO,CAAC,EAAE,WAAW,CAAC;KACvB,CAAC,CAAC;IACH;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC;IAC/B,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uEAAuE;IACvE,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,0CAA0C;IAC1C,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACnC,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,0DAA0D;IAC1D,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AA0CF,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,IAAQ,EACR,GAAc,EACd,SAAiB,EACjB,IAAiB,EACjB,KAAK,EACL,WAAW,EACX,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,SAAS,GACV,EAAE,cAAc,+BA0DhB;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -13,25 +13,23 @@ function TechCard({ techKey, variant, }) {
|
|
|
13
13
|
const decodedSvg = sanitizeSvg(rawSvg);
|
|
14
14
|
return (_jsx(Card, { variant: variant, className: "dndev-tech-card", style: { '--tech-color': logo.color }, "data-hover": isHovered, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: _jsxs(Stack, { direction: "column", align: "center", gap: "tight", children: [_jsx("div", { className: "dndev-tech-card-logo", "data-tech": techKey, dangerouslySetInnerHTML: { __html: decodedSvg } }), _jsx(Text, { as: "span", level: "small", children: logo.name })] }) }));
|
|
15
15
|
}
|
|
16
|
-
export function TechBento({ title, techs, cols = 3,
|
|
16
|
+
export function TechBento({ title, techs, cols = 3, gap = 'medium', separator = false, tone = TONE.GHOST, align, collapsible, open, onOpenChange, defaultOpen, className, }) {
|
|
17
17
|
// Convert Grid's cols format to Bento's columns format
|
|
18
18
|
// Grid: [mobile, tablet, laptop, desktop]
|
|
19
19
|
// Bento: { mobile, tablet, desktop, wide }
|
|
20
|
-
const bentoColumns =
|
|
21
|
-
?
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
wide: cols[3], // Grid's desktop → Bento's wide
|
|
34
|
-
};
|
|
20
|
+
const bentoColumns = typeof cols === 'number'
|
|
21
|
+
? {
|
|
22
|
+
mobile: cols,
|
|
23
|
+
tablet: cols,
|
|
24
|
+
desktop: cols,
|
|
25
|
+
wide: cols,
|
|
26
|
+
}
|
|
27
|
+
: {
|
|
28
|
+
mobile: cols[0],
|
|
29
|
+
tablet: cols[1],
|
|
30
|
+
desktop: cols[2], // Grid's laptop → Bento's desktop
|
|
31
|
+
wide: cols[3], // Grid's desktop → Bento's wide
|
|
32
|
+
};
|
|
35
33
|
const getSpan = (size) => {
|
|
36
34
|
if (size === 'long')
|
|
37
35
|
return { cols: 2, rows: 1 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/components/common/icon.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/components/common/icon.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAYtD,oCAAoC;AACpC,MAAM,WAAW,SAAS;IACxB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC;IACvD,kEAAkE;IAClE,QAAQ,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,IAAI,EAAE,aAAa,CAAC,SAAS,CAyFlC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -11,11 +11,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
11
|
import * as LucideIcons from 'lucide-react';
|
|
12
12
|
import { isValidElement } from 'react';
|
|
13
13
|
import { cn } from '@donotdev/components';
|
|
14
|
+
import { findLucideIcon } from './lucideIconByName';
|
|
14
15
|
function getLucideIcon(name) {
|
|
15
16
|
if (!name)
|
|
16
17
|
return LucideIcons.Palette;
|
|
17
18
|
const cleanIconName = name.replace(/['"]/g, '');
|
|
18
|
-
return
|
|
19
|
+
return findLucideIcon(cleanIconName) || LucideIcons.Palette;
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
* Icon - Unified icon component (FLEXIBLE RUNTIME COMPONENT)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LucideIcon } from 'lucide-react';
|
|
2
|
+
/**
|
|
3
|
+
* Finds a Lucide icon component by its export name (e.g. `"Rocket"`).
|
|
4
|
+
*
|
|
5
|
+
* @param name - Lucide export name
|
|
6
|
+
* @returns The icon component, or undefined when no icon export has that name
|
|
7
|
+
*/
|
|
8
|
+
export declare function findLucideIcon(name: string): LucideIcon | undefined;
|
|
9
|
+
//# sourceMappingURL=lucideIconByName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lucideIconByName.d.ts","sourceRoot":"","sources":["../../../src/components/common/lucideIconByName.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAkB/C;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAGnE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// packages/ui/src/components/common/lucideIconByName.ts
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Runtime Lucide icon lookup by export name
|
|
4
|
+
* @description Typed replacement for `(LucideIcons as any)[name]`. Internal to @donotdev/ui (not re-exported).
|
|
5
|
+
*
|
|
6
|
+
* @version 0.1.0
|
|
7
|
+
* @since 0.2.2
|
|
8
|
+
* @author AMBROISE PARK Consulting
|
|
9
|
+
*/
|
|
10
|
+
import * as LucideIcons from 'lucide-react';
|
|
11
|
+
/** The lucide-react namespace viewed as a name-indexed lookup table. */
|
|
12
|
+
const LUCIDE_EXPORTS = LucideIcons;
|
|
13
|
+
/**
|
|
14
|
+
* Narrows a lucide-react export to an icon component (function or forwardRef object).
|
|
15
|
+
*
|
|
16
|
+
* @param value - Any lucide-react export
|
|
17
|
+
* @returns True when the export is renderable as an icon component
|
|
18
|
+
*/
|
|
19
|
+
function isLucideIcon(value) {
|
|
20
|
+
return (typeof value === 'function' ||
|
|
21
|
+
(typeof value === 'object' && value !== null && 'render' in value));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Finds a Lucide icon component by its export name (e.g. `"Rocket"`).
|
|
25
|
+
*
|
|
26
|
+
* @param name - Lucide export name
|
|
27
|
+
* @returns The icon component, or undefined when no icon export has that name
|
|
28
|
+
*/
|
|
29
|
+
export function findLucideIcon(name) {
|
|
30
|
+
const candidate = LUCIDE_EXPORTS[name];
|
|
31
|
+
return isLucideIcon(candidate) ? candidate : undefined;
|
|
32
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GameFlow.d.ts","sourceRoot":"","sources":["../../../src/components/layout/GameFlow.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CACjC,MAAM,
|
|
1
|
+
{"version":3,"file":"GameFlow.d.ts","sourceRoot":"","sources":["../../../src/components/layout/GameFlow.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CACjC,MAAM,EAEN,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC,CAC/C,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,6DAA6D;IAC7D,cAAc,EAAE,cAAc,CAAC;IAC/B,oCAAoC;IACpC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,iDAAiD;IACjD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAsCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,QAAQ,CAAC,EACvB,cAAc,EACd,aAAa,EACb,UAAU,EACV,QAAe,GAChB,EAAE,aAAa,sCAgCf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/components/Breadcrumbs.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAU3C,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9C;AAED,2CAA2C;AAC3C,MAAM,WAAW,gBAAgB;IAC/B,+EAA+E;IAC/E,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,iCAAiC;IACjC,SAAS,CAAC,EAAE,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,QAAA,MAAM,WAAW,EAAE,aAAa,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/components/Breadcrumbs.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAU3C,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9C;AAED,2CAA2C;AAC3C,MAAM,WAAW,gBAAgB;IAC/B,+EAA+E;IAC/E,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,iCAAiC;IACjC,SAAS,CAAC,EAAE,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,QAAA,MAAM,WAAW,EAAE,aAAa,CAAC,gBAAgB,CAqFhD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -19,9 +19,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
19
19
|
import { ChevronRight } from 'lucide-react';
|
|
20
20
|
import { useMemo } from 'react';
|
|
21
21
|
import { cn } from '@donotdev/components';
|
|
22
|
-
import { useTranslation } from '@donotdev/core';
|
|
22
|
+
import { useLayout, useTranslation } from '@donotdev/core';
|
|
23
23
|
// Platform-specific hooks via conditional exports
|
|
24
|
-
import {
|
|
24
|
+
import { useRoutePath } from '@donotdev/ui/routing/hooks';
|
|
25
25
|
import { Link } from '../../../routing/Link';
|
|
26
26
|
import { useAllRoutes } from '../../../routing/useRouteDiscovery';
|
|
27
27
|
/**
|
|
@@ -35,8 +35,10 @@ import { useAllRoutes } from '../../../routing/useRouteDiscovery';
|
|
|
35
35
|
*/
|
|
36
36
|
const Breadcrumbs = ({ items, separator: Separator = ChevronRight, showHome = true, homeHref = '/', variant = 'default', className, }) => {
|
|
37
37
|
const { t } = useTranslation('dndev');
|
|
38
|
-
const
|
|
38
|
+
const pathname = useRoutePath();
|
|
39
39
|
const allRoutes = useAllRoutes();
|
|
40
|
+
// Record shown by the page (set by EntityFormRenderer / EntityDisplayRenderer)
|
|
41
|
+
const recordLabel = useLayout('routeRecordLabel');
|
|
40
42
|
// Build set of valid route paths for existence checking
|
|
41
43
|
const validRoutes = useMemo(() => {
|
|
42
44
|
return new Set(allRoutes.map((route) => route.path));
|
|
@@ -45,15 +47,18 @@ const Breadcrumbs = ({ items, separator: Separator = ChevronRight, showHome = tr
|
|
|
45
47
|
const breadcrumbItems = items
|
|
46
48
|
? items
|
|
47
49
|
: (() => {
|
|
48
|
-
const pathSegments =
|
|
50
|
+
const pathSegments = pathname.split('/').filter(Boolean);
|
|
49
51
|
const breadcrumbs = [];
|
|
50
52
|
let currentPath = '';
|
|
51
53
|
pathSegments.forEach((segment) => {
|
|
52
54
|
currentPath += `/${segment}`;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
// A record id segment shows the record's name, not the raw id
|
|
56
|
+
const label = recordLabel && decodeURIComponent(segment) === recordLabel.id
|
|
57
|
+
? recordLabel.label
|
|
58
|
+
: segment
|
|
59
|
+
.split('-')
|
|
60
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
61
|
+
.join(' ');
|
|
57
62
|
// Only add href if route actually exists
|
|
58
63
|
const href = validRoutes.has(currentPath) ? currentPath : undefined;
|
|
59
64
|
breadcrumbs.push({ label, href });
|
|
@@ -69,7 +74,7 @@ const Breadcrumbs = ({ items, separator: Separator = ChevronRight, showHome = tr
|
|
|
69
74
|
: breadcrumbItems;
|
|
70
75
|
// Smart variant: Hide breadcrumbs on simple pages (root or single segment)
|
|
71
76
|
if (variant === 'smart') {
|
|
72
|
-
const segments =
|
|
77
|
+
const segments = pathname.split('/').filter(Boolean);
|
|
73
78
|
if (segments.length < 2) {
|
|
74
79
|
return null; // Don't render breadcrumbs on simple pages
|
|
75
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CacheSettings.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/CacheSettings.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CacheSettings.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/CacheSettings.tsx"],"names":[],"mappings":"AAqDA;;;;;;;;;GASG;AACH,iBAAS,aAAa,gCAgQrB;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -15,6 +15,7 @@ import { Button, BUTTON_VARIANT, Checkbox, Stack, useToast, } from '@donotdev/co
|
|
|
15
15
|
import { useTranslation } from '@donotdev/core';
|
|
16
16
|
// Platform-specific hooks via conditional exports
|
|
17
17
|
import { useRefresh } from '@donotdev/ui/routing/hooks';
|
|
18
|
+
const legacyGlobals = globalThis;
|
|
18
19
|
/**
|
|
19
20
|
* CacheSettings - Cache settings component for clearing various caches
|
|
20
21
|
*
|
|
@@ -91,9 +92,10 @@ function CacheSettings() {
|
|
|
91
92
|
}
|
|
92
93
|
if (cacheOptions.webSQL &&
|
|
93
94
|
typeof window !== 'undefined' &&
|
|
94
|
-
'openDatabase' in window
|
|
95
|
+
'openDatabase' in window &&
|
|
96
|
+
typeof legacyGlobals.openDatabase === 'function') {
|
|
95
97
|
try {
|
|
96
|
-
const db =
|
|
98
|
+
const db = legacyGlobals.openDatabase('', '', '', '');
|
|
97
99
|
if (db && db.transaction) {
|
|
98
100
|
db.transaction((tx) => {
|
|
99
101
|
tx.executeSql('SELECT name FROM sqlite_master WHERE type="table"', [], (tx, results) => {
|
|
@@ -171,8 +173,8 @@ function CacheSettings() {
|
|
|
171
173
|
if (cacheOptions.memoryCache) {
|
|
172
174
|
try {
|
|
173
175
|
// Force garbage collection if available (Chrome DevTools)
|
|
174
|
-
if ('gc' in window && typeof
|
|
175
|
-
|
|
176
|
+
if ('gc' in window && typeof legacyGlobals.gc === 'function') {
|
|
177
|
+
legacyGlobals.gc();
|
|
176
178
|
}
|
|
177
179
|
clearedItems.push('Memory Cache');
|
|
178
180
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/SettingsMenu.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"SettingsMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/SettingsMenu.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,sBAAsB,CAAC;AAahF,4CAA4C;AAC5C,MAAM,WAAW,iBAAiB;IAChC,qBAAqB;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;;;;GAMG;AACH,iBAAS,YAAY,CAAC,EACpB,OAAgC,GACjC,GAAE,iBAAsB,+BA+FxB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -14,6 +14,7 @@ import { Button, BUTTON_VARIANT, DropdownMenu, Stack, DISPLAY, } from '@donotdev
|
|
|
14
14
|
import { useTranslation } from '@donotdev/core';
|
|
15
15
|
import { useLanguageSelector, useTheme, Flag, } from '@donotdev/core';
|
|
16
16
|
import CacheSettings from './CacheSettings';
|
|
17
|
+
import { findLucideIcon } from '../../../common/lucideIconByName';
|
|
17
18
|
import { AuthHeader } from '../../../auth/AuthHeader';
|
|
18
19
|
/**
|
|
19
20
|
* SettingsMenu with fixed hooks order and error protection
|
|
@@ -32,7 +33,7 @@ function SettingsMenu({ variant = BUTTON_VARIANT.OUTLINE, } = {}) {
|
|
|
32
33
|
if (!iconName)
|
|
33
34
|
return LucideIcons.Palette;
|
|
34
35
|
const cleanIconName = iconName.replace(/['"]/g, '');
|
|
35
|
-
return
|
|
36
|
+
return findLucideIcon(cleanIconName) || LucideIcons.Palette;
|
|
36
37
|
};
|
|
37
38
|
const themeItems = availableThemes.map((themeInfo) => {
|
|
38
39
|
const Icon = getIcon(themeInfo.meta?.icon);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeToggle.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/ThemeToggle.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,OAAO,CAAC;AAEtD,OAAO,EAIL,OAAO,EACR,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeToggle.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/ThemeToggle.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,OAAO,CAAC;AAEtD,OAAO,EAIL,OAAO,EACR,MAAM,sBAAsB,CAAC;AAQ9B,UAAU,gBAAgB;IACxB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAUD;;;;;;;;;GASG;AACH,QAAA,MAAM,WAAW,EAAE,aAAa,CAAC,gBAAgB,CA8FhD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -13,11 +13,12 @@ import * as LucideIcons from 'lucide-react';
|
|
|
13
13
|
import { Button, BUTTON_VARIANT, DropdownMenu, DISPLAY, } from '@donotdev/components';
|
|
14
14
|
import { useTranslation } from '@donotdev/core';
|
|
15
15
|
import { useTheme } from '@donotdev/core';
|
|
16
|
+
import { findLucideIcon } from '../../../common/lucideIconByName';
|
|
16
17
|
const getIcon = (iconName) => {
|
|
17
18
|
if (!iconName)
|
|
18
19
|
return LucideIcons.Palette;
|
|
19
20
|
const cleanIconName = iconName.replace(/['"]/g, '');
|
|
20
|
-
return
|
|
21
|
+
return findLucideIcon(cleanIconName) || LucideIcons.Palette;
|
|
21
22
|
};
|
|
22
23
|
/**
|
|
23
24
|
* ThemeToggle - Theme switching component
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview UI CrudCard wrapper
|
|
3
|
-
* @description Thin wrapper around @donotdev/crud CrudCard
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @version 0.
|
|
3
|
+
* @description Thin wrapper around @donotdev/crud CrudCard for web navigation.
|
|
4
|
+
* detailHref becomes the card's `href`: a real `<a href>` rendered through the app
|
|
5
|
+
* router's link (registered by UIProviders), with controls kept outside the link.
|
|
6
|
+
* @version 0.2.0
|
|
7
7
|
* @since 0.0.1
|
|
8
8
|
* @author AMBROISE PARK Consulting
|
|
9
9
|
*/
|
|
10
10
|
import type { CrudCardProps } from '@donotdev/core';
|
|
11
11
|
/**
|
|
12
|
-
* CrudCard with
|
|
13
|
-
* When detailHref is provided,
|
|
12
|
+
* CrudCard with link navigation.
|
|
13
|
+
* When detailHref is provided, the card links to it (crawlable, client-side navigation).
|
|
14
14
|
*/
|
|
15
15
|
export declare function CrudCard({ detailHref, onClick, ...rest }: CrudCardProps & {
|
|
16
16
|
detailHref?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrudCardLink.d.ts","sourceRoot":"","sources":["../../../src/crud/components/CrudCardLink.tsx"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"CrudCardLink.d.ts","sourceRoot":"","sources":["../../../src/crud/components/CrudCardLink.tsx"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAOpD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,EACvB,UAAU,EACV,OAAO,EACP,GAAG,IAAI,EACR,EAAE,aAAa,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,sCAUzC;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Link } from '../../routing';
|
|
4
3
|
import { isCrudModuleAvailable, CrudCard as BaseCrudCard, } from '../crudImports';
|
|
5
4
|
/**
|
|
6
|
-
* CrudCard with
|
|
7
|
-
* When detailHref is provided,
|
|
5
|
+
* CrudCard with link navigation.
|
|
6
|
+
* When detailHref is provided, the card links to it (crawlable, client-side navigation).
|
|
8
7
|
*/
|
|
9
8
|
export function CrudCard({ detailHref, onClick, ...rest }) {
|
|
10
9
|
// Safe guard: isCrudModuleAvailable is a module-level constant (immutable after load).
|
|
11
10
|
if (!isCrudModuleAvailable)
|
|
12
11
|
return null;
|
|
13
|
-
|
|
14
|
-
const card = (_jsx(BaseCrudCard, { ...rest, onClick: detailHref ? undefined : onClick }));
|
|
15
|
-
if (detailHref) {
|
|
16
|
-
return (_jsx(Link, { path: detailHref, "aria-label": rest.item?.id ? `View ${rest.item.id}` : undefined, children: card }));
|
|
17
|
-
}
|
|
18
|
-
return card;
|
|
12
|
+
return detailHref ? (_jsx(BaseCrudCard, { ...rest, href: detailHref })) : (_jsx(BaseCrudCard, { ...rest, onClick: onClick }));
|
|
19
13
|
}
|
|
20
14
|
export default CrudCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityCardList.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityCardList.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,mBAAmB,EAAgB,MAAM,gBAAgB,CAAC;AAYxE,YAAY,EAAE,mBAAmB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"EntityCardList.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityCardList.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,mBAAmB,EAAgB,MAAM,gBAAgB,CAAC;AAYxE,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAwGpC;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,QAAQ,EACR,OAAO,EACP,IAAmB,EACnB,SAA0B,EAAE,2BAA2B;AACvD,YAAY,EACZ,MAAM,EACN,WAAmB,EACnB,WAAW,EACX,IAAI,EACJ,iBAAiB,EACjB,UAAU,EACV,WAAmB,EACnB,WAAW,EACX,OAAO,GACR,EAAE,mBAAmB,sCAsOrB"}
|
|
@@ -63,9 +63,7 @@ const BREAKPOINT_INDEX = {
|
|
|
63
63
|
function CardListSkeleton({ cols, entity, }) {
|
|
64
64
|
const slots = resolveSkeletonSlots(entity);
|
|
65
65
|
const bp = useBreakpoint('current');
|
|
66
|
-
const currentCols = (Array.isArray(cols)
|
|
67
|
-
? cols[BREAKPOINT_INDEX[bp] ?? 3]
|
|
68
|
-
: cols) ?? 1;
|
|
66
|
+
const currentCols = (Array.isArray(cols) ? cols[BREAKPOINT_INDEX[bp] ?? 3] : cols) ?? 1;
|
|
69
67
|
const count = currentCols * 3;
|
|
70
68
|
const isImage = (name) => {
|
|
71
69
|
const type = entity.fields[name]?.type;
|
|
@@ -163,15 +161,9 @@ queryOptions, filter, hideFilters = false, resultLabel, tone, renderCardOverlay,
|
|
|
163
161
|
defaultValue: data.length === 1
|
|
164
162
|
? 'Found 1 occurrence'
|
|
165
163
|
: `Found ${data.length} occurrences`,
|
|
166
|
-
}), collapsible: collapsible, defaultOpen: collapsible ? true : undefined, tone: tone, children: loading ? (_jsx(CardListSkeleton, { cols: cols, entity: entity })) : fetchError ? (_jsxs(Stack, { align: "center", justify: "center", style: { padding: 'var(--gap-3xl)', textAlign: 'center' }, children: [_jsx(Text, { level: "h3", style: { color: 'var(--destructive)' }, children: tCrud('errors.fetchFailed', {
|
|
167
|
-
defaultValue: `Failed to load ${entity.name.toLowerCase()}`,
|
|
168
|
-
}) }), _jsx(Text, { level: "small", style: { color: 'var(--destructive)' }, children: fetchError instanceof Error
|
|
164
|
+
}), collapsible: collapsible, defaultOpen: collapsible ? true : undefined, tone: tone, children: loading ? (_jsx(CardListSkeleton, { cols: cols, entity: entity })) : fetchError ? (_jsxs(Stack, { align: "center", justify: "center", style: { padding: 'var(--gap-3xl)', textAlign: 'center' }, children: [_jsx(Text, { level: "h3", style: { color: 'var(--destructive)' }, children: tCrud('errors.fetchFailed', { entity: entityName }) }), _jsx(Text, { level: "small", style: { color: 'var(--destructive)' }, children: fetchError instanceof Error
|
|
169
165
|
? fetchError.message
|
|
170
|
-
: String(fetchError) })] })) : data.length === 0 ? (_jsxs(Stack, { align: "center", justify: "center", style: { padding: 'var(--gap-3xl)', textAlign: 'center' }, children: [_jsx(Text, { level: "h3", style: { color: 'var(--muted-foreground)' }, children: tCrud('emptyState.title', {
|
|
171
|
-
defaultValue: `No ${entity.name.toLowerCase()} found`,
|
|
172
|
-
}) }), _jsx(Text, { style: { color: 'var(--muted-foreground)' }, children: tCrud('emptyState.description', {
|
|
173
|
-
defaultValue: `No ${entity.name.toLowerCase()} available at this time.`,
|
|
174
|
-
}) })] })) : (_jsx(Grid, { cols: cols, children: data.map((item) => {
|
|
166
|
+
: String(fetchError) })] })) : data.length === 0 ? (_jsxs(Stack, { align: "center", justify: "center", style: { padding: 'var(--gap-3xl)', textAlign: 'center' }, children: [_jsx(Text, { level: "h3", style: { color: 'var(--muted-foreground)' }, children: tCrud('emptyState.title') }), _jsx(Text, { style: { color: 'var(--muted-foreground)' }, children: tCrud('emptyState.description') })] })) : (_jsx(Grid, { cols: cols, children: data.map((item) => {
|
|
175
167
|
const itemIsFavorite = isFavorite(item.id);
|
|
176
168
|
const detailHref = isPreview || onClick ? undefined : `${base}/${item.id}`;
|
|
177
169
|
return (_jsx(CrudCard, { item: item, entity: entity, detailHref: detailHref, onClick: isPreview
|
|
@@ -4,7 +4,7 @@ export type { EntityDisplayRendererProps };
|
|
|
4
4
|
* EntityDisplayRenderer - Automatically fetches and displays entity data
|
|
5
5
|
*
|
|
6
6
|
* Features:
|
|
7
|
-
* -
|
|
7
|
+
* - Reactive data fetching using useCrudDoc (stays in sync with edits)
|
|
8
8
|
* - Loading state handling
|
|
9
9
|
* - Error handling
|
|
10
10
|
* - Automatic field rendering (respects visibility rules)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityDisplayRenderer.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityDisplayRenderer.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"EntityDisplayRenderer.d.ts","sourceRoot":"","sources":["../../../src/crud/components/EntityDisplayRenderer.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAU/E,YAAY,EAAE,0BAA0B,EAAE,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,EAC3E,MAAM,EACN,EAAE,EACF,CAAC,EACD,SAAc,EACd,cAAc,EACd,eAAe,EACf,UAAU,EAAE,cAAc,EAC1B,aAAa,EACb,OAAO,GACR,EAAE,0BAA0B,CAAC,CAAC,CAAC,sCAoK/B;AAED,eAAe,qBAAqB,CAAC"}
|