@donotdev/ui 0.1.0 → 0.1.1
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-CR4VOVXT.js → GoToDialog-RU5RP7S2.js} +1 -1
- package/dist/chunk-ETE4RC7M.js +1 -0
- package/dist/components/auth/AuthHeader.d.ts +6 -1
- package/dist/components/auth/AuthHeader.d.ts.map +1 -1
- package/dist/components/auth/AuthHeader.js +4 -4
- package/dist/components/common/FeatureCard.d.ts +2 -0
- package/dist/components/common/FeatureCard.d.ts.map +1 -1
- package/dist/components/common/FeatureDisabled.d.ts +1 -0
- package/dist/components/common/FeatureDisabled.d.ts.map +1 -1
- package/dist/components/common/TechBento.d.ts +1 -0
- package/dist/components/common/TechBento.d.ts.map +1 -1
- package/dist/components/common/icon.d.ts +1 -0
- package/dist/components/common/icon.d.ts.map +1 -1
- package/dist/components/cookie-consent/CookieConsent.d.ts +1 -0
- package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
- package/dist/components/layout/PageConfig.d.ts +25 -0
- package/dist/components/layout/PageConfig.d.ts.map +1 -0
- package/dist/components/layout/PageConfig.js +47 -0
- package/dist/components/layout/components/Breadcrumbs.d.ts +2 -0
- package/dist/components/layout/components/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts +1 -0
- package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppBranding.d.ts +1 -0
- package/dist/components/layout/components/header/AppBranding.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppIcon.d.ts +1 -0
- package/dist/components/layout/components/header/AppIcon.d.ts.map +1 -1
- package/dist/components/layout/components/header/AppTitle.d.ts +1 -0
- package/dist/components/layout/components/header/AppTitle.d.ts.map +1 -1
- package/dist/components/layout/components/header/CacheSettings.js +2 -2
- package/dist/components/layout/components/header/GameTitle.d.ts +1 -0
- package/dist/components/layout/components/header/GameTitle.d.ts.map +1 -1
- package/dist/components/layout/components/header/HeaderMenu.d.ts +1 -0
- package/dist/components/layout/components/header/HeaderMenu.d.ts.map +1 -1
- package/dist/components/layout/components/header/HeaderNavigation.d.ts +1 -0
- package/dist/components/layout/components/header/HeaderNavigation.d.ts.map +1 -1
- package/dist/components/layout/components/header/SettingsMenu.d.ts +1 -0
- package/dist/components/layout/components/header/SettingsMenu.d.ts.map +1 -1
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +1 -0
- package/dist/crud/components/EntityCardList.d.ts +1 -1
- package/dist/crud/components/EntityCardList.d.ts.map +1 -1
- package/dist/crud/components/EntityCardList.js +32 -21
- 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 +13 -12
- package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityFormRenderer.js +16 -18
- package/dist/crud/components/EntityList.d.ts +1 -1
- package/dist/crud/components/EntityList.d.ts.map +1 -1
- package/dist/crud/components/EntityList.js +40 -24
- package/dist/crud/components/EntityRecommendations.d.ts +1 -1
- package/dist/crud/components/EntityRecommendations.d.ts.map +1 -1
- package/dist/crud/components/EntityRecommendations.js +4 -4
- package/dist/crud/crudImports.d.ts +1 -0
- package/dist/crud/crudImports.d.ts.map +1 -1
- package/dist/crud/crudImports.js +1 -0
- package/dist/dndev-next.css +198 -75
- package/dist/dndev.css +228 -74
- package/dist/index.js +4 -4
- package/dist/internal/common/ErrorFallback.js +1 -1
- package/dist/internal/devtools/DebugTools.js +1 -1
- package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -1
- package/dist/internal/devtools/components/DesignTab.js +6 -2
- package/dist/internal/devtools/utils/envVarDiscovery.d.ts.map +1 -1
- package/dist/internal/devtools/utils/envVarDiscovery.js +4 -5
- package/dist/internal/devtools/utils/virtualModuleInspector.d.ts.map +1 -1
- package/dist/internal/devtools/utils/virtualModuleInspector.js +2 -0
- package/dist/internal/initializers/BaseStoresInitializer.d.ts.map +1 -1
- package/dist/internal/initializers/BaseStoresInitializer.js +11 -2
- package/dist/internal/layout/DnDevLayout.d.ts.map +1 -1
- package/dist/internal/layout/DnDevLayout.js +39 -16
- package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/AutoMetaTags.js +55 -23
- package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts +2 -0
- package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/NextJsAutoMetaTags.js +45 -15
- package/dist/internal/layout/components/PWAUpdateNotification.d.ts.map +1 -1
- package/dist/internal/layout/components/PWAUpdateNotification.js +15 -2
- package/dist/internal/layout/zones/DnDevFooter.d.ts +3 -1
- package/dist/internal/layout/zones/DnDevFooter.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevFooter.js +5 -1
- package/dist/internal/layout/zones/DnDevHeader.d.ts +3 -1
- package/dist/internal/layout/zones/DnDevHeader.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevHeader.js +7 -2
- package/dist/internal/layout/zones/DnDevSidebar.d.ts +3 -1
- package/dist/internal/layout/zones/DnDevSidebar.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevSidebar.js +9 -3
- package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
- package/dist/providers/NextJsAppProviders.js +3 -1
- package/dist/routing/AuthGuard.d.ts +7 -22
- package/dist/routing/AuthGuard.d.ts.map +1 -1
- package/dist/routing/AuthGuard.js +19 -64
- package/dist/routing/AuthReturnTo.d.ts +13 -0
- package/dist/routing/AuthReturnTo.d.ts.map +1 -0
- package/dist/routing/AuthReturnTo.js +61 -0
- package/dist/routing/DnDevNavigationMenu.d.ts +1 -0
- package/dist/routing/DnDevNavigationMenu.d.ts.map +1 -1
- package/dist/routing/GoTo.d.ts +1 -0
- package/dist/routing/GoTo.d.ts.map +1 -1
- package/dist/routing/hooks/hooks.next.js +1 -1
- package/dist/routing/hooks/hooks.vite.js +1 -1
- package/dist/routing/hooks/useNavigate.next.d.ts +8 -0
- package/dist/routing/hooks/useNavigate.next.d.ts.map +1 -1
- package/dist/routing/hooks/useNavigate.next.js +58 -8
- package/dist/routing/hooks/useNavigate.vite.d.ts +8 -0
- package/dist/routing/hooks/useNavigate.vite.d.ts.map +1 -1
- package/dist/routing/hooks/useNavigate.vite.js +64 -14
- package/dist/routing/hooks/useRedirectGuard.next.d.ts +2 -0
- package/dist/routing/hooks/useRedirectGuard.next.d.ts.map +1 -1
- package/dist/routing/hooks/useRedirectGuard.next.js +11 -27
- package/dist/routing/hooks/useRedirectGuard.vite.d.ts +2 -0
- package/dist/routing/hooks/useRedirectGuard.vite.d.ts.map +1 -1
- package/dist/routing/hooks/useRedirectGuard.vite.js +11 -27
- package/dist/routing/index.d.ts +1 -0
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/index.js +1 -0
- package/dist/styles/index.css +228 -74
- package/dist/symbol-index.json +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/sanitizeSvg.d.ts +4 -0
- package/dist/utils/sanitizeSvg.d.ts.map +1 -1
- package/dist/utils/sanitizeSvg.js +4 -0
- package/dist/utils/useAISafe.d.ts +28 -0
- package/dist/utils/useAISafe.d.ts.map +1 -0
- package/dist/utils/useAISafe.js +53 -0
- package/dist/utils/useAuthSafe.d.ts +39 -0
- package/dist/utils/useAuthSafe.d.ts.map +1 -1
- package/dist/utils/useAuthSafe.js +5 -0
- package/dist/utils/useAuthVisibility.d.ts +1 -0
- package/dist/utils/useAuthVisibility.d.ts.map +1 -1
- package/dist/utils/useBillingVisibility.d.ts +1 -0
- package/dist/utils/useBillingVisibility.d.ts.map +1 -1
- package/dist/utils/useSeo.d.ts +121 -0
- package/dist/utils/useSeo.d.ts.map +1 -0
- package/dist/utils/useSeo.js +114 -0
- package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
- package/dist/vite-routing/AppRoutes.js +14 -4
- package/dist/vite-routing/RootLayout.d.ts.map +1 -1
- package/dist/vite-routing/RootLayout.js +6 -4
- package/guidelines/COMPONENTS.md +136 -0
- package/guidelines/GOTCHAS.md +66 -0
- package/guidelines/LAYOUTS.md +310 -0
- package/guidelines/PAGES.md +205 -0
- package/guidelines/ROUTING.md +499 -0
- package/guidelines/SEO.md +275 -0
- package/package.json +12 -7
- package/dist/chunk-XHGRMKOY.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u,
|
|
1
|
+
import{a as u,h as T}from"./chunk-ETE4RC7M.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:N=>{N.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 y=f.length>0;return t(F,{open:m,onOpenChange:a=>a?null:r(),children:[o(R,{placeholder:e("globalGoTo.placeholder","Search pages..."),emptyMessage:y?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 l from"lucide-react";import{isValidElement as b}from"react";import{cn as m}from"@donotdev/components";import{jsx as c}from"react/jsx-runtime";function S(e){if(!e)return l.Palette;let t=e.replace(/['"]/g,"");return l[t]||l.Palette}var E=({icon:e,fallback:t,className:r,ariaHidden:s=!1})=>{let o=e||t;if(!o)return null;let i="dndev-size-md";if(typeof o=="function"||typeof o=="object"&&o!==null&&"render"in o)return c(o,{className:m(i,r),style:{flexShrink:0},"aria-hidden":s});if(typeof o=="string"){if(!/^[a-zA-Z0-9_-]+$/.test(o))return c("span",{className:m(i,r),style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":s,children:o});let p=S(o);return c(p,{className:m(i,r),style:{flexShrink:0},"aria-hidden":s})}return b(o)?c("span",{className:r,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":s,children:o}):c("span",{className:r,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-hidden":s,children:o})},w=E;import*as y from"@donotdev/auth";import{DEGRADED_AUTH_API as L}from"@donotdev/core";var d=y?.useAuth;function T(e){return L[e]}function h(e){return d?d(e):T(e)}var M=typeof d=="function",O=y?.PasswordResetCallback??(()=>null);import{useMemo as A}from"react";import{useNavigationStore as k}from"@donotdev/core";import{USER_ROLES as K}from"@donotdev/core";import{useLocation as F}from"@donotdev/ui/routing/hooks";function g(){let e=F(),t=h("user"),r=!!t,s=t?.role||K.GUEST,o=k(i=>!i||typeof i.getFilteredRoutes!="function"?[]:i.getFilteredRoutes({authenticated:r,role:s}));return A(()=>Array.isArray(o)?o.map(i=>({...i,isActive:_(i.path,e.pathname),hasChildren:!1,children:void 0})).sort((i,a)=>i.label.localeCompare(a.label,void 0,{sensitivity:"base"})):[],[o,e.pathname])}function Q(e){let t=g();return A(()=>t.find(r=>r.path===e),[t,e])}function _(e,t){return e==="/"?t==="/":t===e?!0:t.startsWith(e+"/")}import{useCallback as f,useMemo as N}from"react";import{useNavigationStore as u}from"@donotdev/core";import{useNavigate as j}from"@donotdev/ui/routing/hooks";var ne=()=>{let e=j(),t=g()??[],r=u(n=>n.favorites),s=u(n=>n.recent),o=u(n=>n.toggleFavorite),i=u(n=>n.isFavorite),a=u(n=>n.addRecent),v=N(()=>t.length?t.filter(n=>r.includes(n.path)):[],[r,t]),p=N(()=>t.length?t.filter(P=>s.includes(P.path)).slice(0,5):[],[s,t]),R=f(n=>{o(n)},[o]),x=f(n=>i(n),[i]),I=f(n=>{a(n)},[a]),C=f(n=>{I(n),e(n)},[e,I]);return{navigationItems:t,favoriteItems:v,recentItems:p,toggleFavorite:R,isFavorite:x,navigateToItem:C}};export{E as a,w as b,h as c,M as d,O as e,g as f,Q as g,ne as h};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DISPLAY } from '@donotdev/components';
|
|
1
|
+
import { BUTTON_VARIANT, DISPLAY } from '@donotdev/components';
|
|
2
2
|
import type { CSSProperties } from 'react';
|
|
3
3
|
import type { ComponentType } from 'react';
|
|
4
4
|
/**
|
|
@@ -47,6 +47,11 @@ export interface AuthHeaderProps {
|
|
|
47
47
|
* @default 'auto'
|
|
48
48
|
*/
|
|
49
49
|
display?: (typeof DISPLAY)[keyof typeof DISPLAY];
|
|
50
|
+
/**
|
|
51
|
+
* Button variant for the sign-in trigger.
|
|
52
|
+
* @default 'outline'
|
|
53
|
+
*/
|
|
54
|
+
variant?: (typeof BUTTON_VARIANT)[keyof typeof BUTTON_VARIANT];
|
|
50
55
|
/** Optional className for styling the button */
|
|
51
56
|
className?: string;
|
|
52
57
|
/** Optional inline styles for the button */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthHeader.d.ts","sourceRoot":"","sources":["../../../src/components/auth/AuthHeader.tsx"],"names":[],"mappings":"AAeA,OAAO,
|
|
1
|
+
{"version":3,"file":"AuthHeader.d.ts","sourceRoot":"","sources":["../../../src/components/auth/AuthHeader.tsx"],"names":[],"mappings":"AAeA,OAAO,EAEL,cAAc,EAGd,OAAO,EACR,MAAM,sBAAsB,CAAC;AAU9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAyD3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
|
|
@@ -20,8 +20,8 @@ import { Link } from '../../routing';
|
|
|
20
20
|
import { useAuthSafe, useAuthVisibility } from '../../utils';
|
|
21
21
|
// Lazy load auth components for code splitting; degrade to null if auth pkg missing
|
|
22
22
|
const NullComponent = () => null;
|
|
23
|
-
function SignInButton({ display, signInLabel, className, style, children, ...props }) {
|
|
24
|
-
return (_jsx(Button, { variant:
|
|
23
|
+
function SignInButton({ display, variant = BUTTON_VARIANT.OUTLINE, signInLabel, className, style, children, ...props }) {
|
|
24
|
+
return (_jsx(Button, { variant: variant, icon: User, display: display, tooltip: signInLabel, className: className, style: style, ...props, children: children ?? signInLabel }));
|
|
25
25
|
}
|
|
26
26
|
// @ts-expect-error - lazy() type doesn't account for graceful degradation fallback
|
|
27
27
|
const AuthPartnerButton = lazy(async () => {
|
|
@@ -50,7 +50,7 @@ const MultipleAuthProviders = lazy(async () => {
|
|
|
50
50
|
* @since 0.0.1
|
|
51
51
|
* @author AMBROISE PARK Consulting
|
|
52
52
|
*/
|
|
53
|
-
export const AuthHeader = ({ display = DISPLAY.AUTO, className, style, }) => {
|
|
53
|
+
export const AuthHeader = ({ display = DISPLAY.AUTO, variant = BUTTON_VARIANT.OUTLINE, className, style, }) => {
|
|
54
54
|
const { t } = useTranslation('dndev');
|
|
55
55
|
const { shouldHide, isLoading, isReady, isAuthenticated } = useAuthVisibility();
|
|
56
56
|
const authConfig = useAuthConfig();
|
|
@@ -67,7 +67,7 @@ export const AuthHeader = ({ display = DISPLAY.AUTO, className, style, }) => {
|
|
|
67
67
|
// Button's display prop + CSS container queries handle responsive label visibility
|
|
68
68
|
if (!isAuthenticated) {
|
|
69
69
|
if (loginPath !== undefined) {
|
|
70
|
-
return (_jsx(Link, { path: loginPath, prefetch: true, children: _jsx(SignInButton, { display: display, signInLabel: signInLabel, className: className, style: style }) }));
|
|
70
|
+
return (_jsx(Link, { path: loginPath, prefetch: true, children: _jsx(SignInButton, { display: display, variant: variant, signInLabel: signInLabel, className: className, style: style }) }));
|
|
71
71
|
}
|
|
72
72
|
const targetProvider = enabled[0];
|
|
73
73
|
// Use Dialog if password/emailLink provider is present (better UX for forms)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { CardProps, CardVariant, CardContent } from '@donotdev/components';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
+
/** Variant type alias for FeatureCard (matches CardVariant). */
|
|
3
4
|
export type FeatureCardVariant = CardVariant;
|
|
5
|
+
/** Props for the FeatureCard component. */
|
|
4
6
|
export interface FeatureCardProps extends Omit<CardProps, 'content' | 'href' | 'title' | 'subtitle' | 'children'> {
|
|
5
7
|
/** Title (required) - 2 rows max with ellipsis */
|
|
6
8
|
title: string | ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureCard.d.ts","sourceRoot":"","sources":["../../../src/components/common/FeatureCard.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIhF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAE7C,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAC5C,SAAS,EACT,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CACvD;IACC,kDAAkD;IAClD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,qDAAqD;IACrD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uHAAuH;IACvH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;GAMG;AACH,QAAA,MAAM,WAAW,GAAI,yHAclB,gBAAgB,4CA8HlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"FeatureCard.d.ts","sourceRoot":"","sources":["../../../src/components/common/FeatureCard.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIhF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,gEAAgE;AAChE,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAE7C,2CAA2C;AAC3C,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAC5C,SAAS,EACT,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CACvD;IACC,kDAAkD;IAClD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,qDAAqD;IACrD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uHAAuH;IACvH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;GAMG;AACH,QAAA,MAAM,WAAW,GAAI,yHAclB,gBAAgB,4CA8HlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureDisabled.d.ts","sourceRoot":"","sources":["../../../src/components/common/FeatureDisabled.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAE7B;;OAEG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,iBAAS,eAAe,CAAC,EACvB,WAAW,EACX,KAAK,EACL,WAAW,EACX,iBAAyB,EACzB,kBAAyB,EACzB,SAAiB,EACjB,YAAoC,EACpC,OAAO,EACP,eAAe,EACf,aAAa,EACb,SAAc,GACf,EAAE,oBAAoB,2CAoGtB;AAED,eAAe,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"FeatureDisabled.d.ts","sourceRoot":"","sources":["../../../src/components/common/FeatureDisabled.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,+CAA+C;AAC/C,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAE7B;;OAEG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,iBAAS,eAAe,CAAC,EACvB,WAAW,EACX,KAAK,EACL,WAAW,EACX,iBAAyB,EACzB,kBAAyB,EACzB,SAAiB,EACjB,YAAoC,EACpC,OAAO,EACP,eAAe,EACf,aAAa,EACb,SAAc,GACf,EAAE,oBAAoB,2CAoGtB;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TechBento.d.ts","sourceRoot":"","sources":["../../../src/components/common/TechBento.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,cAAc,EACd,IAAI,EACL,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAK/D,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;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,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,OAAO,EACP,GAAc,EACd,SAAiB,EACjB,IAAiB,EACjB,KAAK,EACL,WAAW,EACX,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,SAAS,GACV,EAAE,cAAc,2CA4DhB;AAED,eAAe,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"TechBento.d.ts","sourceRoot":"","sources":["../../../src/components/common/TechBento.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,cAAc,EACd,IAAI,EACL,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAK/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;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,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,OAAO,EACP,GAAc,EACd,SAAiB,EACjB,IAAiB,EACjB,KAAK,EACL,WAAW,EACX,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,SAAS,GACV,EAAE,cAAc,2CA4DhB;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/components/common/icon.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQtD,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"}
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/components/common/icon.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQtD,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CookieConsent.d.ts","sourceRoot":"","sources":["../../../src/components/cookie-consent/CookieConsent.tsx"],"names":[],"mappings":"AA6BA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,aAAa,CAAC,EACrB,QAAmB,EACnB,YAAmB,EACnB,YAA8C,EAC9C,SAAc,GACf,EAAE,kBAAkB,kDAqUpB;AAED,eAAe,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"CookieConsent.d.ts","sourceRoot":"","sources":["../../../src/components/cookie-consent/CookieConsent.tsx"],"names":[],"mappings":"AA6BA,6CAA6C;AAC7C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,aAAa,CAAC,EACrB,QAAmB,EACnB,YAAmB,EACnB,YAA8C,EAC9C,SAAc,GACf,EAAE,kBAAkB,kDAqUpB;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { LayoutPreset } from '@donotdev/core';
|
|
2
|
+
/**
|
|
3
|
+
* PageConfig - Declarative per-page layout overrides
|
|
4
|
+
*
|
|
5
|
+
* Sets route-level overrides (preset, hideBreadcrumbs) in the theme store.
|
|
6
|
+
* Cleans up on unmount (resets to defaults).
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* // In a Next.js page component:
|
|
11
|
+
* export default function MyPage() {
|
|
12
|
+
* return (
|
|
13
|
+
* <>
|
|
14
|
+
* <PageConfig hideBreadcrumbs />
|
|
15
|
+
* <PageContainer>...</PageContainer>
|
|
16
|
+
* </>
|
|
17
|
+
* );
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function PageConfig({ hideBreadcrumbs, preset, }: {
|
|
22
|
+
hideBreadcrumbs?: boolean;
|
|
23
|
+
preset?: LayoutPreset;
|
|
24
|
+
}): null;
|
|
25
|
+
//# sourceMappingURL=PageConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageConfig.d.ts","sourceRoot":"","sources":["../../../src/components/layout/PageConfig.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,EACzB,eAAe,EACf,MAAM,GACP,EAAE;IACD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,QAcA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// packages/ui/src/components/layout/PageConfig.tsx
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview PageConfig - Declarative per-page layout overrides (Next.js)
|
|
4
|
+
* @description Tiny component that sets route-level overrides in the theme store.
|
|
5
|
+
* For Vite, LayoutRoute handles this automatically from PageMeta.
|
|
6
|
+
* For Next.js, drop <PageConfig hideBreadcrumbs /> in your page component.
|
|
7
|
+
*
|
|
8
|
+
* @version 0.1.0
|
|
9
|
+
* @since 0.2.0
|
|
10
|
+
* @author AMBROISE PARK Consulting
|
|
11
|
+
*/
|
|
12
|
+
import { useLayoutEffect } from 'react';
|
|
13
|
+
import { useLayout } from '@donotdev/core';
|
|
14
|
+
/**
|
|
15
|
+
* PageConfig - Declarative per-page layout overrides
|
|
16
|
+
*
|
|
17
|
+
* Sets route-level overrides (preset, hideBreadcrumbs) in the theme store.
|
|
18
|
+
* Cleans up on unmount (resets to defaults).
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* // In a Next.js page component:
|
|
23
|
+
* export default function MyPage() {
|
|
24
|
+
* return (
|
|
25
|
+
* <>
|
|
26
|
+
* <PageConfig hideBreadcrumbs />
|
|
27
|
+
* <PageContainer>...</PageContainer>
|
|
28
|
+
* </>
|
|
29
|
+
* );
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export function PageConfig({ hideBreadcrumbs, preset, }) {
|
|
34
|
+
const setHide = useLayout('setRouteHideBreadcrumbs');
|
|
35
|
+
const setPreset = useLayout('setRoutePresetOverride');
|
|
36
|
+
useLayoutEffect(() => {
|
|
37
|
+
if (hideBreadcrumbs != null)
|
|
38
|
+
setHide(hideBreadcrumbs);
|
|
39
|
+
if (preset != null)
|
|
40
|
+
setPreset(preset);
|
|
41
|
+
return () => {
|
|
42
|
+
setHide(false);
|
|
43
|
+
setPreset(null);
|
|
44
|
+
};
|
|
45
|
+
}, [hideBreadcrumbs, preset, setHide, setPreset]);
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
|
+
/** Single breadcrumb navigation item. */
|
|
2
3
|
export interface BreadcrumbItem {
|
|
3
4
|
label: string;
|
|
4
5
|
href?: string;
|
|
@@ -6,6 +7,7 @@ export interface BreadcrumbItem {
|
|
|
6
7
|
className?: string;
|
|
7
8
|
}>;
|
|
8
9
|
}
|
|
10
|
+
/** Props for the Breadcrumbs component. */
|
|
9
11
|
export interface BreadcrumbsProps {
|
|
10
12
|
/** Custom breadcrumb items - if not provided, will auto-generate from route */
|
|
11
13
|
items?: BreadcrumbItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/components/Breadcrumbs.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,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,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,CA+EhD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/components/Breadcrumbs.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,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,CA+EhD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingLanguageSwitcher.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/components/FloatingLanguageSwitcher.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,QAAA,MAAM,wBAAwB,EAAE,aAAa,CAC3C,6BAA6B,CAqC9B,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"FloatingLanguageSwitcher.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/components/FloatingLanguageSwitcher.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,wDAAwD;AACxD,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,QAAA,MAAM,wBAAwB,EAAE,aAAa,CAC3C,6BAA6B,CAqC9B,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppBranding.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/AppBranding.tsx"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,EAAM,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAOnD,MAAM,WAAW,gBAAgB;IAC/B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,WAAW,GAAI,qCAIzB,gBAAgB,4CA2ClB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"AppBranding.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/AppBranding.tsx"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,EAAM,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAOnD,2CAA2C;AAC3C,MAAM,WAAW,gBAAgB;IAC/B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,WAAW,GAAI,qCAIzB,gBAAgB,4CA2ClB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppIcon.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/AppIcon.tsx"],"names":[],"mappings":"AAmBA,MAAM,WAAW,YAAY;IAC3B,uDAAuD;IACvD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;IACrD,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAUD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,GAAI,0BAAqC,YAAY,4CA2CxE,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"AppIcon.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/AppIcon.tsx"],"names":[],"mappings":"AAmBA,uCAAuC;AACvC,MAAM,WAAW,YAAY;IAC3B,uDAAuD;IACvD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;IACrD,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAUD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,GAAI,0BAAqC,YAAY,4CA2CxE,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppTitle.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/AppTitle.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,aAAa;IAC5B,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GAAI,mCAItB,aAAa,4CAiCf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"AppTitle.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/AppTitle.tsx"],"names":[],"mappings":"AAgBA,wCAAwC;AACxC,MAAM,WAAW,aAAa;IAC5B,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GAAI,mCAItB,aAAa,4CAiCf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -89,7 +89,7 @@ function CacheSettings() {
|
|
|
89
89
|
console.error('Failed to clear IndexedDB:', err);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
if (cacheOptions.webSQL && 'openDatabase' in window) {
|
|
92
|
+
if (cacheOptions.webSQL && typeof window !== 'undefined' && 'openDatabase' in window) {
|
|
93
93
|
try {
|
|
94
94
|
const db = globalThis.openDatabase('', '', '', '');
|
|
95
95
|
if (db && db.transaction) {
|
|
@@ -111,7 +111,7 @@ function CacheSettings() {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
// Clear Application Cache API
|
|
114
|
-
if (cacheOptions.applicationCache && 'caches' in window) {
|
|
114
|
+
if (cacheOptions.applicationCache && typeof window !== 'undefined' && 'caches' in window) {
|
|
115
115
|
try {
|
|
116
116
|
const keys = await caches.keys();
|
|
117
117
|
await Promise.all(keys.map(async (key) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GameTitle.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/GameTitle.tsx"],"names":[],"mappings":"AAoBA,MAAM,WAAW,cAAc;IAC7B,4DAA4D;IAC5D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,SAAS,GAAI,uBAA+B,cAAc,4CA+EtE,CAAC"}
|
|
1
|
+
{"version":3,"file":"GameTitle.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/GameTitle.tsx"],"names":[],"mappings":"AAoBA,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,4DAA4D;IAC5D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,SAAS,GAAI,uBAA+B,cAAc,4CA+EtE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/HeaderMenu.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,QAAQ,EAAE,SAAS,CAAC;IACpB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,UAAU,GAAI,yBAAyB,eAAe,4CAclE,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"HeaderMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/HeaderMenu.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,0CAA0C;AAC1C,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,QAAQ,EAAE,SAAS,CAAC;IACpB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,UAAU,GAAI,yBAAyB,eAAe,4CAclE,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderNavigation.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/HeaderNavigation.tsx"],"names":[],"mappings":"AAqBA,OAAO,EACL,OAAO,EAIR,MAAM,sBAAsB,CAAC;AAa9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,WAAW,qBAAqB;IACpC,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,gBAAgB,EAAE,aAAa,CAAC,qBAAqB,CA4E1D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"HeaderNavigation.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/HeaderNavigation.tsx"],"names":[],"mappings":"AAqBA,OAAO,EACL,OAAO,EAIR,MAAM,sBAAsB,CAAC;AAa9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,gDAAgD;AAChD,MAAM,WAAW,qBAAqB;IACpC,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,gBAAgB,EAAE,aAAa,CAAC,qBAAqB,CA4E1D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/SettingsMenu.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,sBAAsB,CAAC;AAchF,MAAM,WAAW,iBAAiB;IAChC,qBAAqB;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;;;;GAMG;AACH,iBAAS,YAAY,CAAC,EACpB,OAAgC,GACjC,GAAE,iBAAsB,2CA+FxB;AAED,eAAe,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"SettingsMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/SettingsMenu.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,sBAAsB,CAAC;AAchF,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,2CA+FxB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/layout/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/layout/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
|
@@ -12,5 +12,5 @@ export type { EntityCardListProps };
|
|
|
12
12
|
* - Auto-routing when handler not provided
|
|
13
13
|
*/
|
|
14
14
|
export declare function EntityCardList({ entity, basePath, onClick, cols, staleTime, // 30 minutes default cache
|
|
15
|
-
queryOptions, filter, hideFilters, resultLabel, tone, collapsible, defaultOpen, }: EntityCardListProps): import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
queryOptions, filter, hideFilters, resultLabel, tone, renderCardOverlay, clientSort, collapsible, defaultOpen, preview, }: EntityCardListProps): import("react/jsx-runtime").JSX.Element | null;
|
|
16
16
|
//# sourceMappingURL=EntityCardList.d.ts.map
|
|
@@ -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;AA0GpC;;;;;;;;;;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,WAAmB,EACnB,WAAW,
|
|
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;AA0GpC;;;;;;;;;;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,kDA2MrB"}
|
|
@@ -87,15 +87,18 @@ function CardListSkeleton({ cols, entity, }) {
|
|
|
87
87
|
* - Auto-routing when handler not provided
|
|
88
88
|
*/
|
|
89
89
|
export function EntityCardList({ entity, basePath, onClick, cols = [1, 2, 3, 4], staleTime = 1000 * 60 * 30, // 30 minutes default cache
|
|
90
|
-
queryOptions, filter, hideFilters = false, resultLabel, tone, collapsible = false, defaultOpen, }) {
|
|
90
|
+
queryOptions, filter, hideFilters = false, resultLabel, tone, renderCardOverlay, clientSort, collapsible = false, defaultOpen, preview, }) {
|
|
91
91
|
// Safe guard: isCrudModuleAvailable is a module-level constant (immutable after load).
|
|
92
92
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
93
93
|
if (!isCrudModuleAvailable)
|
|
94
94
|
return null;
|
|
95
|
+
const isPreview = !!preview;
|
|
95
96
|
const navigate = useNavigate();
|
|
96
97
|
const base = basePath ?? `/${entity.collection}`;
|
|
97
98
|
// useCrudCardList -> handles fetching + client-side filter/search/sort via `processed`
|
|
98
|
-
const { items: rawData, processed, loading, } = useCrudCardList(entity, { staleTime, queryOptions });
|
|
99
|
+
const { items: rawData, processed, loading: fetchLoading, } = useCrudCardList(entity, { enabled: !isPreview, staleTime, queryOptions, clientSort });
|
|
100
|
+
// In preview mode: use preview data, skip loading state
|
|
101
|
+
const loading = isPreview ? false : fetchLoading;
|
|
99
102
|
// Favorites - always enabled, no props needed
|
|
100
103
|
const { isFavorite, toggleFavorite, favoritesFilter } = useEntityFavorites({
|
|
101
104
|
collection: entity.collection,
|
|
@@ -106,42 +109,48 @@ queryOptions, filter, hideFilters = false, resultLabel, tone, collapsible = fals
|
|
|
106
109
|
});
|
|
107
110
|
// Apply UI-specific filters (favorites, consumer filter prop) on top of processed
|
|
108
111
|
// Favorites always sort to front; when showFavoritesOnly, only favorites are shown
|
|
109
|
-
let data =
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
let data = isPreview
|
|
113
|
+
? preview
|
|
114
|
+
: processed;
|
|
115
|
+
if (!isPreview) {
|
|
116
|
+
if (showFavoritesOnly) {
|
|
117
|
+
data = data.filter(favoritesFilter);
|
|
118
|
+
}
|
|
119
|
+
if (filter) {
|
|
120
|
+
data = data.filter(filter);
|
|
121
|
+
}
|
|
122
|
+
// Sort favorites to front (stable sort preserves relative order within each group)
|
|
123
|
+
data = data.toSorted((a, b) => {
|
|
124
|
+
const aFav = isFavorite(String(a.id)) ? 0 : 1;
|
|
125
|
+
const bFav = isFavorite(String(b.id)) ? 0 : 1;
|
|
126
|
+
return aFav - bFav;
|
|
127
|
+
});
|
|
115
128
|
}
|
|
116
|
-
// Sort favorites to front (stable sort preserves relative order within each group)
|
|
117
|
-
data = data.toSorted((a, b) => {
|
|
118
|
-
const aFav = isFavorite(String(a.id)) ? 0 : 1;
|
|
119
|
-
const bFav = isFavorite(String(b.id)) ? 0 : 1;
|
|
120
|
-
return aFav - bFav;
|
|
121
|
-
});
|
|
122
129
|
// Entity + crud namespaces so formatValue can resolve crud:price.* etc.
|
|
123
130
|
const { t } = useTranslation([entity.namespace, 'crud']);
|
|
124
131
|
const { t: tCrud } = useTranslation('crud');
|
|
125
132
|
// Card click: onClick(id) if provided, else navigate to basePath/:id
|
|
126
133
|
const handleView = useCallback((id) => {
|
|
134
|
+
if (isPreview)
|
|
135
|
+
return;
|
|
127
136
|
if (onClick) {
|
|
128
137
|
onClick(id);
|
|
129
138
|
}
|
|
130
139
|
else {
|
|
131
140
|
navigate(`${base}/${id}`);
|
|
132
141
|
}
|
|
133
|
-
}, [base, navigate, onClick]);
|
|
142
|
+
}, [base, navigate, onClick, isPreview]);
|
|
134
143
|
// Flat field names for filters (works with both string[] and ListCardLayout)
|
|
135
144
|
const fieldsToFilter = useMemo(() => getListCardFieldNames(entity), [entity]);
|
|
136
145
|
const entityName = t('name', { defaultValue: entity.name });
|
|
137
146
|
return (_jsxs(_Fragment, { children: [!hideFilters && (_jsx(Section, { title: tCrud('filters.title', {
|
|
138
147
|
entity: entityName,
|
|
139
148
|
defaultValue: `Browse ${entityName} - Filters`,
|
|
140
|
-
}), collapsible: collapsible, defaultOpen: defaultOpen, tone: tone, children: _jsx(Card, { children: _jsxs(Stack, { direction: "column", children: [_jsx(Button, { variant: showFavoritesOnly ? 'primary' : 'outline', icon: _jsx(Heart, { size: 18 }), onClick: () => setShowFavoritesOnly(!showFavoritesOnly), children: showFavoritesOnly
|
|
149
|
+
}), collapsible: collapsible, defaultOpen: defaultOpen, tone: tone, children: _jsx(Card, { children: _jsxs(Stack, { direction: "column", children: [_jsx(Button, { variant: !isPreview && showFavoritesOnly ? 'primary' : 'outline', icon: _jsx(Heart, { size: 18 }), onClick: () => setShowFavoritesOnly(!showFavoritesOnly), disabled: isPreview, children: showFavoritesOnly
|
|
141
150
|
? tCrud('favorites.showAll', { defaultValue: 'Show All' })
|
|
142
151
|
: tCrud('favorites.showFavorites', {
|
|
143
152
|
defaultValue: 'Show Favorites',
|
|
144
|
-
}) }), _jsx(EntityFilters, { entity: entity, data: rawData, fieldsToFilter: fieldsToFilter })] }) }) })), _jsx(Section, { title: loading
|
|
153
|
+
}) }), !isPreview && (_jsx(EntityFilters, { entity: entity, data: rawData, fieldsToFilter: fieldsToFilter }))] }) }) })), _jsx(Section, { title: loading
|
|
145
154
|
? tCrud('results.title.fetching', { defaultValue: 'Fetching...' })
|
|
146
155
|
: resultLabel
|
|
147
156
|
? resultLabel(data.length)
|
|
@@ -156,16 +165,18 @@ queryOptions, filter, hideFilters = false, resultLabel, tone, collapsible = fals
|
|
|
156
165
|
defaultValue: `No ${entity.name.toLowerCase()} available at this time.`,
|
|
157
166
|
}) })] })) : (_jsx(Grid, { cols: cols, children: data.map((item) => {
|
|
158
167
|
const itemIsFavorite = isFavorite(item.id);
|
|
159
|
-
const detailHref = onClick ? undefined : `${base}/${item.id}`;
|
|
160
|
-
return (_jsx(CrudCard, { item: item, entity: entity, detailHref: detailHref, onClick: onClick ? () => handleView(item.id) : undefined, renderActions: _jsx(Heart, { fill: itemIsFavorite ? '#ef4444' : '#ffffff', stroke: itemIsFavorite ? '#ef4444' : 'var(--muted-foreground)', onClick: (e) => {
|
|
168
|
+
const detailHref = isPreview || onClick ? undefined : `${base}/${item.id}`;
|
|
169
|
+
return (_jsx(CrudCard, { item: item, entity: entity, detailHref: detailHref, onClick: isPreview ? undefined : (onClick ? () => handleView(item.id) : undefined), renderOverlay: renderCardOverlay?.(item), renderActions: _jsx(Heart, { fill: itemIsFavorite ? '#ef4444' : '#ffffff', stroke: itemIsFavorite ? '#ef4444' : 'var(--muted-foreground)', onClick: (e) => {
|
|
161
170
|
e.preventDefault();
|
|
162
171
|
e.stopPropagation();
|
|
163
|
-
|
|
172
|
+
if (!isPreview)
|
|
173
|
+
toggleFavorite(item.id);
|
|
164
174
|
}, style: {
|
|
165
|
-
cursor: 'pointer',
|
|
175
|
+
cursor: isPreview ? 'default' : 'pointer',
|
|
166
176
|
width: 'var(--icon-md)',
|
|
167
177
|
height: 'var(--icon-md)',
|
|
168
178
|
transition: 'fill 0.2s, stroke 0.2s',
|
|
179
|
+
opacity: isPreview ? 0.5 : 1,
|
|
169
180
|
}, "aria-label": itemIsFavorite
|
|
170
181
|
? tCrud('favorites.remove', {
|
|
171
182
|
defaultValue: 'Remove from favorites',
|
|
@@ -16,6 +16,6 @@ export type { EntityDisplayRendererProps };
|
|
|
16
16
|
* <EntityDisplayRenderer entity={carEntity} id={carId} />
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
-
export declare function EntityDisplayRenderer<T extends EntityRecord = EntityRecord>({ entity, id, t, className, loadingMessage, notFoundMessage, viewerRole: viewerRoleProp, excludeFields, }: EntityDisplayRendererProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
19
|
+
export declare function EntityDisplayRenderer<T extends EntityRecord = EntityRecord>({ entity, id, t, className, loadingMessage, notFoundMessage, viewerRole: viewerRoleProp, excludeFields, preview, }: EntityDisplayRendererProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
20
20
|
export default EntityDisplayRenderer;
|
|
21
21
|
//# sourceMappingURL=EntityDisplayRenderer.d.ts.map
|
|
@@ -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;AAS/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,
|
|
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;AAS/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,kDAgN/B;AAED,eAAe,qBAAqB,CAAC"}
|