@donotdev/ui 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
  2. package/dist/components/cookie-consent/CookieConsent.js +1 -1
  3. package/dist/components/layout/components/Breadcrumbs.d.ts +8 -1
  4. package/dist/components/layout/components/Breadcrumbs.d.ts.map +1 -1
  5. package/dist/components/layout/components/Breadcrumbs.js +1 -1
  6. package/dist/crud/components/useRecordBreadcrumb.d.ts +1 -1
  7. package/dist/crud/components/useRecordBreadcrumb.d.ts.map +1 -1
  8. package/dist/dndev.css +591 -99
  9. package/dist/internal/common/DnDevErrorBoundary.d.ts +3 -1
  10. package/dist/internal/common/DnDevErrorBoundary.d.ts.map +1 -1
  11. package/dist/internal/common/DnDevErrorBoundary.js +1 -1
  12. package/dist/internal/devtools/DebugTools.d.ts.map +1 -1
  13. package/dist/internal/devtools/DebugTools.js +1 -1
  14. package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
  15. package/dist/internal/layout/components/AutoMetaTags.js +1 -1
  16. package/dist/internal/providers/UIProviders.d.ts.map +1 -1
  17. package/dist/internal/providers/UIProviders.js +1 -1
  18. package/dist/routing/AuthGuard.d.ts +3 -0
  19. package/dist/routing/AuthGuard.d.ts.map +1 -1
  20. package/dist/routing/AuthGuard.js +1 -1
  21. package/dist/routing/hooks/hooks.next.d.ts +1 -1
  22. package/dist/routing/hooks/hooks.next.d.ts.map +1 -1
  23. package/dist/routing/hooks/hooks.next.js +1 -1
  24. package/dist/routing/hooks/hooks.vite.d.ts +1 -1
  25. package/dist/routing/hooks/hooks.vite.d.ts.map +1 -1
  26. package/dist/routing/hooks/hooks.vite.js +1 -1
  27. package/dist/routing/hooks/types.d.ts +10 -0
  28. package/dist/routing/hooks/types.d.ts.map +1 -1
  29. package/dist/routing/hooks/useNavigate.next.d.ts +9 -3
  30. package/dist/routing/hooks/useNavigate.next.d.ts.map +1 -1
  31. package/dist/routing/hooks/useNavigate.next.js +1 -1
  32. package/dist/routing/hooks/useNavigate.vite.d.ts +9 -3
  33. package/dist/routing/hooks/useNavigate.vite.d.ts.map +1 -1
  34. package/dist/routing/hooks/useNavigate.vite.js +1 -1
  35. package/dist/routing/index.d.ts +1 -1
  36. package/dist/routing/index.d.ts.map +1 -1
  37. package/dist/routing/index.js +1 -1
  38. package/dist/routing/parentRoute.d.ts +7 -21
  39. package/dist/routing/parentRoute.d.ts.map +1 -1
  40. package/dist/routing/parentRoute.js +1 -1
  41. package/dist/styles/index.css +591 -99
  42. package/dist/symbol-index.json +1 -1
  43. package/guidelines/COMPONENTS.md +1 -1
  44. package/guidelines/LAYOUTS.md +2 -0
  45. package/guidelines/PAGES.md +3 -0
  46. package/guidelines/ROUTING.md +41 -0
  47. package/guidelines/SEO.md +5 -5
  48. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"CookieConsent.d.ts","sourceRoot":"","sources":["../../../src/components/cookie-consent/CookieConsent.tsx"],"names":[],"mappings":"AA8BA,6CAA6C;AAC7C,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,iBAAS,aAAa,CAAC,EACrB,QAAmB,EACnB,SAAc,GACf,EAAE,kBAAkB,sCAgVpB;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"CookieConsent.d.ts","sourceRoot":"","sources":["../../../src/components/cookie-consent/CookieConsent.tsx"],"names":[],"mappings":"AA8BA,6CAA6C;AAC7C,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,iBAAS,aAAa,CAAC,EACrB,QAAmB,EACnB,SAAc,GACf,EAAE,kBAAkB,sCA+UpB;AAED,eAAe,aAAa,CAAC"}
@@ -1 +1 @@
1
- "use client";import{Cookie as w,Settings as W,Shield as G,BarChart3 as K,Target as V}from"lucide-react";import{useState as v,useEffect as y,useRef as q}from"react";import{Accordion as X,Button as m,BUTTON_VARIANT as f,Card as $,Switch as J,Text as u,cn as Q,Stack as s}from"@donotdev/components";import{handleError as Z,useConsent as d,getCookieExamples as S,hasOptionalCookies as ee}from"@donotdev/core";import{CONSENT_CATEGORY as r}from"@donotdev/core";import{useTranslation as te}from"@donotdev/core";import{isClient as ne}from"@donotdev/core";import{Fragment as se,jsx as n,jsxs as a}from"react/jsx-runtime";var oe=480;function ie({position:N="bottom",className:O=""}){let p=d("hasConsented"),g=d("categories"),D=d("acceptAll"),B=d("declineAll"),I=d("updateCategory"),k=d("showBanner"),{t:e}=te("cookies"),[C,E]=v(!1),[h,l]=v(!p||k),[A,b]=v(g),T=q(null),[L,P]=v(!1);y(()=>P(!0),[]),y(()=>{k&&l(!0)},[k]);let R=Object.keys(g),U=[{id:r.NECESSARY,icon:G,title:e("essentialCookies"),description:e("essentialDescription"),examples:S("necessary")||e("essentialExamples"),locked:!0},{id:r.FUNCTIONAL,icon:w,title:e("functionalCookies"),description:e("functionalDescription"),examples:S("functional")||e("functionalExamples"),legalNotice:e("functionalLegalNotice"),locked:!1},{id:r.ANALYTICS,icon:K,title:e("analyticsCookies"),description:e("analyticsDescription"),examples:S("analytics")||e("analyticsExamples"),locked:!1},{id:r.MARKETING,icon:V,title:e("marketingCookies"),description:e("marketingDescription"),examples:S("marketing")||e("marketingExamples"),locked:!1}].filter(t=>R.includes(t.id)),x=ee(),c=!x;if(y(()=>{let t={...g};if(C){let o=t;Object.keys(o).forEach(i=>{i!==r.NECESSARY&&o[i]===!1&&(o[i]=!0)})}b(t)},[g,C]),y(()=>{if(!ne()||p||!h||c)return;let t=i=>{T.current&&!T.current.contains(i.target)&&l(!1)},o=setTimeout(()=>{document.addEventListener("mousedown",t)},100);return()=>{clearTimeout(o),document.removeEventListener("mousedown",t)}},[p,h,c]),!L||p&&!k)return null;let M=()=>{try{Object.entries(A).forEach(([t,o])=>{if(t!==r.NECESSARY&&o!==void 0){let i=t;Object.values(r).includes(i)&&I(i,!!o)}}),E(!1),l(!1)}catch(t){Z(t,{userMessage:"Error saving preferences",context:{operation:"save_preferences"},severity:"warning",log:!0,reportToSentry:!1,showNotification:!1})}},z=()=>{D(),l(!1)},H=()=>{B(),l(!1)},Y=a(s,{gap:"medium",children:[n(u,{as:"p",variant:"muted",level:"small",style:{lineHeight:1.55},children:e(c?"necessaryOnlyDescription":"cookieBannerDescription")}),x&&n(X,{type:"single",collapsible:!0,value:C?"preferences":"",onValueChange:t=>E(t==="preferences"),items:[{value:"preferences",trigger:a(s,{direction:"row",align:"center",gap:"tight",children:[n(W,{className:"dndev-size-sm"}),n(u,{as:"span",level:"small",weight:"medium",children:e("customize")})]}),content:n(s,{gap:"tight",children:U.map(t=>{let o=t.icon,i=A[t.id]??!1;return a(s,{direction:"row",align:"start",justify:"between",gap:"medium",style:{padding:"0.75rem",borderRadius:"var(--radius-surface, 0.5rem)",background:"var(--muted)"},children:[a(s,{direction:"row",align:"start",gap:"tight",style:{flex:1,minWidth:0},children:[n(o,{className:"dndev-size-sm",style:{color:"var(--primary)",marginTop:"0.15rem",flexShrink:0}}),a(s,{gap:"none",style:{minWidth:0},children:[n(u,{as:"span",level:"small",weight:"semibold",children:t.title}),n(u,{as:"span",variant:"muted",level:"caption",style:{lineHeight:1.45},children:t.description})]})]}),t.locked?n(u,{as:"span",variant:"muted",level:"caption",weight:"medium",style:{flexShrink:0},children:e("alwaysOn")}):n(J,{checked:i,onCheckedChange:F=>b(_=>({..._,[t.id]:F}))})]},t.id)})})}]})]}),j=C?a(s,{direction:"row",gap:"tight",style:{width:"100%"},children:[n(m,{onClick:()=>E(!1),variant:f.OUTLINE,style:{flex:1},children:e("form.cancel","Cancel")}),n(m,{onClick:M,variant:f.DEFAULT,style:{flex:1},children:e("savePreferences","Save Preferences")})]}):a(s,{direction:"row",gap:"tight",style:{width:"100%"},children:[x&&n(m,{onClick:H,variant:f.OUTLINE,style:{flex:1},children:e("declineOptional")}),n(m,{onClick:z,variant:f.DEFAULT,style:{flex:1},children:e(c?"acknowledge":"acceptAll")})]});return a(se,{children:[h&&n($,{ref:T,elevated:!0,icon:w,title:e(c?"necessaryOnlyTitle":"cookiePreferences"),content:Y,footer:j,className:Q("dndev-fixed dndev-z-modal",O),style:{[N==="top"?"top":"bottom"]:"var(--gap-md)",insetInlineStart:"var(--gap-md)",width:`min(${oe}px, calc(100vw - var(--gap-md) * 2))`,height:"auto"}}),!h&&!p&&!c&&n(m,{onClick:()=>l(!0),variant:f.OUTLINE,floating:!0,icon:w,display:"compact",tooltip:e("cookiePreferences"),"aria-label":e("cookiePreferences"),className:"dndev-fixed dndev-z-toast",style:{[N==="top"?"top":"bottom"]:"var(--gap-md)",insetInlineStart:"var(--gap-md)"}})]})}var fe=ie;export{fe as default};
1
+ "use client";import{Cookie as w,Settings as W,Shield as G,BarChart3 as K,Target as V}from"lucide-react";import{useState as v,useEffect as y,useRef as q}from"react";import{Accordion as X,Button as m,BUTTON_VARIANT as f,Card as $,Switch as J,Text as u,cn as Q,Stack as s}from"@donotdev/components";import{handleError as Z,useConsent as d,getCookieExamples as S,hasOptionalCookies as ee}from"@donotdev/core";import{CONSENT_CATEGORY as r}from"@donotdev/core";import{useTranslation as te}from"@donotdev/core";import{isClient as ne}from"@donotdev/core";import{Fragment as se,jsx as n,jsxs as a}from"react/jsx-runtime";var oe=480;function ie({position:N="bottom",className:O=""}){let p=d("hasConsented"),g=d("categories"),D=d("acceptAll"),B=d("declineAll"),I=d("updateCategory"),k=d("showBanner"),{t:e}=te("cookies"),[C,E]=v(!1),[h,l]=v(!p||k),[A,b]=v(g),T=q(null),[L,P]=v(!1);y(()=>P(!0),[]),y(()=>{k&&l(!0)},[k]);let R=Object.keys(g),U=[{id:r.NECESSARY,icon:G,title:e("essentialCookies"),description:e("essentialDescription"),examples:S("necessary")||e("essentialExamples"),locked:!0},{id:r.FUNCTIONAL,icon:w,title:e("functionalCookies"),description:e("functionalDescription"),examples:S("functional")||e("functionalExamples"),legalNotice:e("functionalLegalNotice"),locked:!1},{id:r.ANALYTICS,icon:K,title:e("analyticsCookies"),description:e("analyticsDescription"),examples:S("analytics")||e("analyticsExamples"),locked:!1},{id:r.MARKETING,icon:V,title:e("marketingCookies"),description:e("marketingDescription"),examples:S("marketing")||e("marketingExamples"),locked:!1}].filter(t=>R.includes(t.id)),x=ee(),c=!x;if(y(()=>{let t={...g};if(C){let o=t;Object.keys(o).forEach(i=>{i!==r.NECESSARY&&o[i]===!1&&(o[i]=!0)})}b(t)},[g,C]),y(()=>{if(!ne()||p||!h||c)return;let t=i=>{T.current&&!T.current.contains(i.target)&&l(!1)},o=setTimeout(()=>{document.addEventListener("mousedown",t)},100);return()=>{clearTimeout(o),document.removeEventListener("mousedown",t)}},[p,h,c]),!L||p&&!k)return null;let M=()=>{try{Object.entries(A).forEach(([t,o])=>{if(t!==r.NECESSARY&&o!==void 0){let i=t;Object.values(r).includes(i)&&I(i,!!o)}}),E(!1),l(!1)}catch(t){Z(t,{userMessage:"Error saving preferences",context:{operation:"save_preferences"},severity:"warning",log:!0,reportToSentry:!1,showNotification:!1})}},z=()=>{D(),l(!1)},H=()=>{B(),l(!1)},Y=a(s,{gap:"medium",children:[n(u,{as:"p",variant:"muted",level:"small",style:{lineHeight:1.55},children:e(c?"necessaryOnlyDescription":"cookieBannerDescription")}),x&&n(X,{type:"single",collapsible:!0,value:C?"preferences":"",onValueChange:t=>E(t==="preferences"),items:[{value:"preferences",trigger:a(s,{direction:"row",align:"center",gap:"tight",children:[n(W,{className:"dndev-size-sm"}),n(u,{as:"span",level:"small",weight:"medium",children:e("customize")})]}),content:n(s,{gap:"tight",children:U.map(t=>{let o=t.icon,i=A[t.id]??!1;return a(s,{direction:"row",align:"start",justify:"between",gap:"medium",style:{padding:"0.75rem",borderRadius:"var(--radius-surface, 0.5rem)",background:"var(--muted)"},children:[a(s,{direction:"row",align:"start",gap:"tight",style:{flex:1,minWidth:0},children:[n(o,{className:"dndev-size-sm",style:{color:"var(--primary)",marginTop:"0.15rem",flexShrink:0}}),a(s,{gap:"none",style:{minWidth:0},children:[n(u,{as:"span",level:"small",weight:"semibold",children:t.title}),n(u,{as:"span",variant:"muted",level:"caption",style:{lineHeight:1.45},children:t.description})]})]}),t.locked?n(u,{as:"span",variant:"muted",level:"caption",weight:"medium",style:{flexShrink:0},children:e("alwaysOn")}):n(J,{checked:i,onCheckedChange:F=>b(_=>({..._,[t.id]:F}))})]},t.id)})})}]})]}),j=C?a(s,{direction:"row",gap:"tight",style:{width:"100%"},children:[n(m,{onClick:()=>E(!1),variant:f.OUTLINE,style:{flex:1},children:e("form.cancel","Cancel")}),n(m,{onClick:M,variant:f.DEFAULT,style:{flex:1},children:e("savePreferences","Save Preferences")})]}):a(s,{direction:"row",gap:"tight",style:{width:"100%"},children:[x&&n(m,{onClick:H,variant:f.OUTLINE,style:{flex:1},children:e("declineOptional")}),n(m,{onClick:z,variant:f.DEFAULT,style:{flex:1},children:e(c?"acknowledge":"acceptAll")})]});return a(se,{children:[h&&n($,{ref:T,elevated:!0,icon:w,title:e(c?"necessaryOnlyTitle":"cookiePreferences"),content:Y,footer:j,className:Q("dndev-fixed dndev-z-modal",O),style:{[N==="top"?"top":"bottom"]:"var(--gap-md)",insetInlineStart:"var(--gap-md)",width:`min(${oe}px, calc(100vw - var(--gap-md) * 2))`,height:"auto"}}),!h&&!p&&!c&&n(m,{onClick:()=>l(!0),variant:f.OUTLINE,icon:w,display:"compact",tooltip:e("cookiePreferences"),"aria-label":e("cookiePreferences"),className:"dndev-fixed dndev-z-toast",style:{[N==="top"?"top":"bottom"]:"var(--gap-md)",insetInlineStart:"var(--gap-md)"}})]})}var fe=ie;export{fe as default};
@@ -32,7 +32,14 @@ export interface BreadcrumbsProps {
32
32
  * @author AMBROISE PARK Consulting
33
33
  *
34
34
  * Automatically generates breadcrumbs from current route or accepts custom items.
35
- * Renders no generated trail inside a NotFoundDocument (the 404, served for any URL).
35
+ * Generated trail: home, the page's ancestors (`routeAncestors`, the chain of the
36
+ * BreadcrumbList JSON-LD and the forms' parent path), linked, then the page, each named by
37
+ * its route's title (`routeLabel`: `seo.title`, else `<namespace>:title`, as its
38
+ * `<title>`); the page reads as the shown record's name (`useRecordBreadcrumb`) when its
39
+ * last URL segment names it. A URL prefix that is no route is no crumb. Routes are the
40
+ * build's route manifest (not auth-filtered): the server render and the browser build the
41
+ * same trail. Renders no generated trail inside a NotFoundDocument (the 404, served for
42
+ * any URL).
36
43
  */
37
44
  declare const Breadcrumbs: ComponentType<BreadcrumbsProps>;
38
45
  export default Breadcrumbs;
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/components/Breadcrumbs.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAY3C,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;;;;;;;;;GASG;AACH,QAAA,MAAM,WAAW,EAAE,aAAa,CAAC,gBAAgB,CA0FhD,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/components/Breadcrumbs.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AA6B3C,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;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,WAAW,EAAE,aAAa,CAAC,gBAAgB,CA+FhD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1 +1 @@
1
- "use client";import{ChevronRight as C}from"lucide-react";import{useMemo as L}from"react";import{cn as R}from"@donotdev/components";import{useLayout as P,useTranslation as T}from"@donotdev/core";import{useRoutePath as k}from"@donotdev/ui/routing/hooks";import{Link as A}from"../../../routing/Link.js";import{useIsNotFoundDocument as D}from"../../../routing/NotFoundDocument.js";import{getPathPrefixes as F}from"../../../routing/parentRoute.js";import{useAllRoutes as H}from"../../../routing/useRouteDiscovery.js";import{jsx as t,jsxs as z}from"react/jsx-runtime";var x=({items:o,separator:d=C,showHome:b=!0,homeHref:f="/",variant:h="default",className:g})=>{let{t:v}=T("dndev"),n=k(),c=H(),s=P("routeRecordLabel"),B=L(()=>new Set(c.map(e=>e.path)),[c]);if(D()&&!o)return null;let l=o||(()=>{let e=n.split("/").filter(Boolean),r=F(n),m=[];return e.forEach((a,N)=>{let u=r[N]??"",I=s&&decodeURIComponent(a)===s.id?s.label:a.split("-").map(p=>p.charAt(0).toUpperCase()+p.slice(1)).join(" "),y=B.has(u)?u:void 0;m.push({label:I,href:y})}),m})(),i=b?[{label:v("navigation.home","Home"),href:f},...l]:l;return h==="smart"&&n.split("/").filter(Boolean).length<2?null:t("nav",{role:"navigation","aria-label":"Breadcrumb navigation",className:R("breadcrumbs",g),children:i.map((e,r)=>{let a=r===i.length-1||!e.href;return z("span",{className:"breadcrumb-item",children:[r>0&&t(d,{className:"dndev-size-md separator"}),e.icon&&t(e.icon,{className:"dndev-size-md icon"}),e.href&&!a?t(A,{path:e.href,className:"breadcrumb-link",children:e.label}):t("span",{className:"breadcrumb-label",children:e.label})]},r)})})},O=x;export{O as default};
1
+ "use client";import{ChevronRight as y}from"lucide-react";import{useMemo as L}from"react";import{cn as R}from"@donotdev/components";import{breadcrumbNamespaces as T,getRoutes as k,matchRoute as A,routeAncestors as D,routeLabel as f,useAppConfig as F,useLayout as H,useSeoConfig as P,useTranslation as S}from"@donotdev/core";import{useRoutePath as z}from"@donotdev/ui/routing/hooks";import{Link as M}from"../../../routing/Link.js";import{useIsNotFoundDocument as w}from"../../../routing/NotFoundDocument.js";import{jsx as o,jsxs as x}from"react/jsx-runtime";function U(t){try{return decodeURIComponent(t)}catch{return t}}var q=({items:t,separator:g=y,showHome:h=!0,homeHref:N="/",variant:v="default",className:B})=>{let a=z(),n=k(),C=L(()=>T(a,n),[a,n]),{t:u}=S(["dndev",...C]),s=P(),I=F("app"),c=H("routeRecordLabel");if(w()&&!t)return null;let i=t||(()=>{let e={t:u,defaultNs:s&&s.defaultNamespace||"home",siteName:s&&s.siteName||I?.name||""},r=D(a,n).map(b=>({label:f(b,e),href:b.path})),l=A(n,a)?.route,m=a.split("/").filter(Boolean).at(-1),d=c&&m&&U(m)===c.id?c.label:l?f(l,e):void 0;return d&&r.push({label:d}),r})(),p=h?[{label:u("navigation.home","Home"),href:N},...i]:i;return v==="smart"&&a.split("/").filter(Boolean).length<2?null:o("nav",{role:"navigation","aria-label":"Breadcrumb navigation",className:R("breadcrumbs",B),children:p.map((e,r)=>{let m=r===p.length-1||!e.href;return x("span",{className:"breadcrumb-item",children:[r>0&&o(g,{className:"dndev-size-md separator"}),e.icon&&o(e.icon,{className:"dndev-size-md icon"}),e.href&&!m?o(M,{path:e.href,className:"breadcrumb-link",children:e.label}):o("span",{className:"breadcrumb-label",children:e.label})]},r)})})},X=q;export{X as default};
@@ -4,7 +4,7 @@ import type { AnyEntity } from '@donotdev/core';
4
4
  * the card (the same title `deriveEntitySeo` gives the entity page's metadata and the last
5
5
  * BreadcrumbList item), on the segment naming the record ({@link recordSegment}: its slug
6
6
  * on `/produits/:slug`, its id on `/products/:id`). Cleared when the page unmounts or the record
7
- * has no title, unless another component replaced it meanwhile (its label stays). Client effect: the server render keeps the URL segment.
7
+ * has no title, unless another component replaced it meanwhile (its label stays). Client effect: the server render names the page by its route title (`routeLabel`).
8
8
  *
9
9
  * @param entity - Entity of the record
10
10
  * @param record - Loaded record (`undefined` / `null` while loading)
@@ -1 +1 @@
1
- {"version":3,"file":"useRecordBreadcrumb.d.ts","sourceRoot":"","sources":["../../../src/crud/components/useRecordBreadcrumb.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAoChD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GACjD,IAAI,CAuBN"}
1
+ {"version":3,"file":"useRecordBreadcrumb.d.ts","sourceRoot":"","sources":["../../../src/crud/components/useRecordBreadcrumb.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAoChD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GACjD,IAAI,CAuBN"}