@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.
Files changed (150) hide show
  1. package/dist/{GoToDialog-CR4VOVXT.js → GoToDialog-RU5RP7S2.js} +1 -1
  2. package/dist/chunk-ETE4RC7M.js +1 -0
  3. package/dist/components/auth/AuthHeader.d.ts +6 -1
  4. package/dist/components/auth/AuthHeader.d.ts.map +1 -1
  5. package/dist/components/auth/AuthHeader.js +4 -4
  6. package/dist/components/common/FeatureCard.d.ts +2 -0
  7. package/dist/components/common/FeatureCard.d.ts.map +1 -1
  8. package/dist/components/common/FeatureDisabled.d.ts +1 -0
  9. package/dist/components/common/FeatureDisabled.d.ts.map +1 -1
  10. package/dist/components/common/TechBento.d.ts +1 -0
  11. package/dist/components/common/TechBento.d.ts.map +1 -1
  12. package/dist/components/common/icon.d.ts +1 -0
  13. package/dist/components/common/icon.d.ts.map +1 -1
  14. package/dist/components/cookie-consent/CookieConsent.d.ts +1 -0
  15. package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
  16. package/dist/components/layout/PageConfig.d.ts +25 -0
  17. package/dist/components/layout/PageConfig.d.ts.map +1 -0
  18. package/dist/components/layout/PageConfig.js +47 -0
  19. package/dist/components/layout/components/Breadcrumbs.d.ts +2 -0
  20. package/dist/components/layout/components/Breadcrumbs.d.ts.map +1 -1
  21. package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts +1 -0
  22. package/dist/components/layout/components/FloatingLanguageSwitcher.d.ts.map +1 -1
  23. package/dist/components/layout/components/header/AppBranding.d.ts +1 -0
  24. package/dist/components/layout/components/header/AppBranding.d.ts.map +1 -1
  25. package/dist/components/layout/components/header/AppIcon.d.ts +1 -0
  26. package/dist/components/layout/components/header/AppIcon.d.ts.map +1 -1
  27. package/dist/components/layout/components/header/AppTitle.d.ts +1 -0
  28. package/dist/components/layout/components/header/AppTitle.d.ts.map +1 -1
  29. package/dist/components/layout/components/header/CacheSettings.js +2 -2
  30. package/dist/components/layout/components/header/GameTitle.d.ts +1 -0
  31. package/dist/components/layout/components/header/GameTitle.d.ts.map +1 -1
  32. package/dist/components/layout/components/header/HeaderMenu.d.ts +1 -0
  33. package/dist/components/layout/components/header/HeaderMenu.d.ts.map +1 -1
  34. package/dist/components/layout/components/header/HeaderNavigation.d.ts +1 -0
  35. package/dist/components/layout/components/header/HeaderNavigation.d.ts.map +1 -1
  36. package/dist/components/layout/components/header/SettingsMenu.d.ts +1 -0
  37. package/dist/components/layout/components/header/SettingsMenu.d.ts.map +1 -1
  38. package/dist/components/layout/index.d.ts +1 -0
  39. package/dist/components/layout/index.d.ts.map +1 -1
  40. package/dist/components/layout/index.js +1 -0
  41. package/dist/crud/components/EntityCardList.d.ts +1 -1
  42. package/dist/crud/components/EntityCardList.d.ts.map +1 -1
  43. package/dist/crud/components/EntityCardList.js +32 -21
  44. package/dist/crud/components/EntityDisplayRenderer.d.ts +1 -1
  45. package/dist/crud/components/EntityDisplayRenderer.d.ts.map +1 -1
  46. package/dist/crud/components/EntityDisplayRenderer.js +13 -12
  47. package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
  48. package/dist/crud/components/EntityFormRenderer.js +16 -18
  49. package/dist/crud/components/EntityList.d.ts +1 -1
  50. package/dist/crud/components/EntityList.d.ts.map +1 -1
  51. package/dist/crud/components/EntityList.js +40 -24
  52. package/dist/crud/components/EntityRecommendations.d.ts +1 -1
  53. package/dist/crud/components/EntityRecommendations.d.ts.map +1 -1
  54. package/dist/crud/components/EntityRecommendations.js +4 -4
  55. package/dist/crud/crudImports.d.ts +1 -0
  56. package/dist/crud/crudImports.d.ts.map +1 -1
  57. package/dist/crud/crudImports.js +1 -0
  58. package/dist/dndev-next.css +198 -75
  59. package/dist/dndev.css +228 -74
  60. package/dist/index.js +4 -4
  61. package/dist/internal/common/ErrorFallback.js +1 -1
  62. package/dist/internal/devtools/DebugTools.js +1 -1
  63. package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -1
  64. package/dist/internal/devtools/components/DesignTab.js +6 -2
  65. package/dist/internal/devtools/utils/envVarDiscovery.d.ts.map +1 -1
  66. package/dist/internal/devtools/utils/envVarDiscovery.js +4 -5
  67. package/dist/internal/devtools/utils/virtualModuleInspector.d.ts.map +1 -1
  68. package/dist/internal/devtools/utils/virtualModuleInspector.js +2 -0
  69. package/dist/internal/initializers/BaseStoresInitializer.d.ts.map +1 -1
  70. package/dist/internal/initializers/BaseStoresInitializer.js +11 -2
  71. package/dist/internal/layout/DnDevLayout.d.ts.map +1 -1
  72. package/dist/internal/layout/DnDevLayout.js +39 -16
  73. package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
  74. package/dist/internal/layout/components/AutoMetaTags.js +55 -23
  75. package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts +2 -0
  76. package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts.map +1 -1
  77. package/dist/internal/layout/components/NextJsAutoMetaTags.js +45 -15
  78. package/dist/internal/layout/components/PWAUpdateNotification.d.ts.map +1 -1
  79. package/dist/internal/layout/components/PWAUpdateNotification.js +15 -2
  80. package/dist/internal/layout/zones/DnDevFooter.d.ts +3 -1
  81. package/dist/internal/layout/zones/DnDevFooter.d.ts.map +1 -1
  82. package/dist/internal/layout/zones/DnDevFooter.js +5 -1
  83. package/dist/internal/layout/zones/DnDevHeader.d.ts +3 -1
  84. package/dist/internal/layout/zones/DnDevHeader.d.ts.map +1 -1
  85. package/dist/internal/layout/zones/DnDevHeader.js +7 -2
  86. package/dist/internal/layout/zones/DnDevSidebar.d.ts +3 -1
  87. package/dist/internal/layout/zones/DnDevSidebar.d.ts.map +1 -1
  88. package/dist/internal/layout/zones/DnDevSidebar.js +9 -3
  89. package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
  90. package/dist/providers/NextJsAppProviders.js +3 -1
  91. package/dist/routing/AuthGuard.d.ts +7 -22
  92. package/dist/routing/AuthGuard.d.ts.map +1 -1
  93. package/dist/routing/AuthGuard.js +19 -64
  94. package/dist/routing/AuthReturnTo.d.ts +13 -0
  95. package/dist/routing/AuthReturnTo.d.ts.map +1 -0
  96. package/dist/routing/AuthReturnTo.js +61 -0
  97. package/dist/routing/DnDevNavigationMenu.d.ts +1 -0
  98. package/dist/routing/DnDevNavigationMenu.d.ts.map +1 -1
  99. package/dist/routing/GoTo.d.ts +1 -0
  100. package/dist/routing/GoTo.d.ts.map +1 -1
  101. package/dist/routing/hooks/hooks.next.js +1 -1
  102. package/dist/routing/hooks/hooks.vite.js +1 -1
  103. package/dist/routing/hooks/useNavigate.next.d.ts +8 -0
  104. package/dist/routing/hooks/useNavigate.next.d.ts.map +1 -1
  105. package/dist/routing/hooks/useNavigate.next.js +58 -8
  106. package/dist/routing/hooks/useNavigate.vite.d.ts +8 -0
  107. package/dist/routing/hooks/useNavigate.vite.d.ts.map +1 -1
  108. package/dist/routing/hooks/useNavigate.vite.js +64 -14
  109. package/dist/routing/hooks/useRedirectGuard.next.d.ts +2 -0
  110. package/dist/routing/hooks/useRedirectGuard.next.d.ts.map +1 -1
  111. package/dist/routing/hooks/useRedirectGuard.next.js +11 -27
  112. package/dist/routing/hooks/useRedirectGuard.vite.d.ts +2 -0
  113. package/dist/routing/hooks/useRedirectGuard.vite.d.ts.map +1 -1
  114. package/dist/routing/hooks/useRedirectGuard.vite.js +11 -27
  115. package/dist/routing/index.d.ts +1 -0
  116. package/dist/routing/index.d.ts.map +1 -1
  117. package/dist/routing/index.js +1 -0
  118. package/dist/styles/index.css +228 -74
  119. package/dist/symbol-index.json +1 -0
  120. package/dist/utils/index.d.ts +1 -0
  121. package/dist/utils/index.d.ts.map +1 -1
  122. package/dist/utils/index.js +1 -0
  123. package/dist/utils/sanitizeSvg.d.ts +4 -0
  124. package/dist/utils/sanitizeSvg.d.ts.map +1 -1
  125. package/dist/utils/sanitizeSvg.js +4 -0
  126. package/dist/utils/useAISafe.d.ts +28 -0
  127. package/dist/utils/useAISafe.d.ts.map +1 -0
  128. package/dist/utils/useAISafe.js +53 -0
  129. package/dist/utils/useAuthSafe.d.ts +39 -0
  130. package/dist/utils/useAuthSafe.d.ts.map +1 -1
  131. package/dist/utils/useAuthSafe.js +5 -0
  132. package/dist/utils/useAuthVisibility.d.ts +1 -0
  133. package/dist/utils/useAuthVisibility.d.ts.map +1 -1
  134. package/dist/utils/useBillingVisibility.d.ts +1 -0
  135. package/dist/utils/useBillingVisibility.d.ts.map +1 -1
  136. package/dist/utils/useSeo.d.ts +121 -0
  137. package/dist/utils/useSeo.d.ts.map +1 -0
  138. package/dist/utils/useSeo.js +114 -0
  139. package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
  140. package/dist/vite-routing/AppRoutes.js +14 -4
  141. package/dist/vite-routing/RootLayout.d.ts.map +1 -1
  142. package/dist/vite-routing/RootLayout.js +6 -4
  143. package/guidelines/COMPONENTS.md +136 -0
  144. package/guidelines/GOTCHAS.md +66 -0
  145. package/guidelines/LAYOUTS.md +310 -0
  146. package/guidelines/PAGES.md +205 -0
  147. package/guidelines/ROUTING.md +499 -0
  148. package/guidelines/SEO.md +275 -0
  149. package/package.json +12 -7
  150. package/dist/chunk-XHGRMKOY.js +0 -1
@@ -0,0 +1,275 @@
1
+ # SEO & Meta Tags
2
+
3
+ **Same `PageMeta` works on Vite and Next.js. i18n-first by default.**
4
+
5
+ ---
6
+
7
+ ## How It Works
8
+
9
+ **Vite:** AutoMetaTags reads route manifest + i18n - Helmet renders meta tags
10
+ **Next.js:** Build generates `metadata-manifest.json` - `generateMetadata()` per page
11
+
12
+ **Same code, both platforms. No conditional logic needed.**
13
+
14
+ ---
15
+
16
+ ## Why This Matters: Crawlers & Initial HTML
17
+
18
+ **Problem:** Google/social crawlers don't execute JavaScript. They read the initial HTML.
19
+
20
+ **SPA without SSR:** Meta tags injected client-side - crawlers see empty `<head>` - bad SEO.
21
+
22
+ **With framework:**
23
+
24
+ | Platform | Static Pages | Dynamic Pages |
25
+ |----------|--------------|---------------|
26
+ | **Vite** | Prerender at build - meta in HTML | `<Seo>` + react-helmet-async - meta in prerendered HTML |
27
+ | **Next.js** | `generateMetadata()` - server renders meta | `<Seo>` client-side OR `generateMetadata()` with fetch |
28
+
29
+ **Verify:** View Page Source (not DevTools). Meta tags should be visible without JS.
30
+
31
+ ---
32
+
33
+ ## Vite: Prerendering
34
+
35
+ **Enabled by default** in `vite.config.ts`:
36
+
37
+ ```ts
38
+ export default defineViteConfig({
39
+ prerender: true, // Default: true
40
+ });
41
+ ```
42
+
43
+ **What happens:**
44
+ 1. Build discovers all routes from `src/pages/`
45
+ 2. Renders each page to static HTML
46
+ 3. `<Seo>` and AutoMetaTags populate `<head>` via react-helmet-async
47
+ 4. Output: `dist/about/index.html` with full meta tags
48
+
49
+ **Dynamic routes** (e.g., `/products/:id`): Prerender with known IDs or use client-side `<Seo>`.
50
+
51
+ ---
52
+
53
+ ## Next.js: Server Rendering
54
+
55
+ **Automatic.** Each page's `generateMetadata()` runs server-side.
56
+
57
+ **Static pages:** Meta resolved at build time from `metadata-manifest.json`.
58
+ **Dynamic pages:** Use `generateMetadata()` with `fetch()` or client-side `<Seo>`.
59
+
60
+ ```tsx
61
+ // Server-rendered metadata for dynamic route
62
+ export async function generateMetadata({ params }): Promise<Metadata> {
63
+ const product = await fetch(`/api/products/${params.id}`).then(r => r.json());
64
+ return { title: product.name, description: product.description };
65
+ }
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Standard Use: i18n-First
71
+
72
+ **Pattern:** Define `namespace` in PageMeta, translations provide SEO.
73
+
74
+ ```tsx
75
+ // src/pages/AboutPage.tsx
76
+ export const meta: PageMeta = {
77
+ namespace: 'about',
78
+ };
79
+ ```
80
+
81
+ ```json
82
+ // src/locales/about_en.json
83
+ {
84
+ "title": "About Us",
85
+ "description": "Learn more about our company and mission.",
86
+ "meta": {
87
+ "keywords": ["about", "company", "mission"],
88
+ "image": "/og-about.png"
89
+ }
90
+ }
91
+ ```
92
+
93
+ **Result:** `<title>About Us | SiteName</title>`, meta description, OG tags - all from i18n.
94
+
95
+ ---
96
+
97
+ ## Override: Static SEO
98
+
99
+ **Pattern:** Use `seo` field for static overrides or non-i18n apps.
100
+
101
+ ```tsx
102
+ export const meta: PageMeta = {
103
+ namespace: 'home',
104
+ seo: {
105
+ fullTitle: 'DoNotDev - Build Apps Fast', // Exact title, no "| SiteName"
106
+ description: 'Ship production apps in minutes.',
107
+ image: '/og-home.png',
108
+ type: 'website',
109
+ },
110
+ };
111
+ ```
112
+
113
+ ---
114
+
115
+ ## All SEO Options
116
+
117
+ ```tsx
118
+ export const meta: PageMeta = {
119
+ namespace: 'blog',
120
+ seo: {
121
+ // Title options (pick one)
122
+ title: 'Blog', // "Blog | SiteName"
123
+ fullTitle: 'My Blog', // "My Blog" (exact, no suffix)
124
+ title: null, // "SiteName" only
125
+
126
+ // Description
127
+ description: 'Latest posts',
128
+ description: null, // Omit description entirely
129
+
130
+ // Social sharing
131
+ image: '/og-blog.png', // OG/Twitter image
132
+ type: 'website', // 'website' | 'article' | 'product'
133
+
134
+ // Other
135
+ keywords: ['blog', 'news'],
136
+ noindex: true, // Hide from search engines
137
+ },
138
+ };
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Priority Chain
144
+
145
+ Resolution order (highest to lowest):
146
+
147
+ 1. **`<Seo>` component** - Runtime dynamic data (always wins)
148
+ 2. **i18n `meta.fullTitle`** - Translated, language-aware
149
+ 3. **`seo.fullTitle`** - Static fallback
150
+ 4. **i18n `title`** - "Translated | SiteName"
151
+ 5. **`seo.title`** - "Static | SiteName"
152
+ 6. **SiteName only** - Default fallback
153
+
154
+ ---
155
+
156
+ ## Dynamic Data: `<Seo>` Component
157
+
158
+ **Pattern:** For pages with runtime data (fetched content), use `<Seo>`.
159
+
160
+ ```tsx
161
+ import { Seo } from '@donotdev/ui';
162
+
163
+ export const meta: PageMeta = {
164
+ namespace: 'apartments',
165
+ route: { params: ['id'] },
166
+ };
167
+
168
+ export default function ApartmentPage() {
169
+ const { id } = useParams<{ id: string }>();
170
+ const { data: apartment } = useApartment(id);
171
+
172
+ if (!apartment) return <Loading />;
173
+
174
+ return (
175
+ <>
176
+ <Seo
177
+ fullTitle={`${apartment.reference} - ${apartment.rent} | SiteName`}
178
+ description={apartment.description}
179
+ image={apartment.photos[0]}
180
+ type="product"
181
+ />
182
+ <ApartmentDetails data={apartment} />
183
+ </>
184
+ );
185
+ }
186
+ ```
187
+
188
+ **Works in SSR/prerender** - meta tags are in initial HTML.
189
+
190
+ ---
191
+
192
+ ## `<Seo>` Props
193
+
194
+ ```tsx
195
+ <Seo
196
+ // Title (pick one)
197
+ title="Page Title" // "Page Title | SiteName"
198
+ fullTitle="Exact Title" // "Exact Title"
199
+
200
+ // Content
201
+ description="Page description"
202
+ image="/og-image.png"
203
+ type="website" // 'website' | 'article' | 'product'
204
+ keywords={['key1', 'key2']}
205
+ noindex={false}
206
+
207
+ // Article-specific
208
+ publishDate="2024-01-15T00:00:00Z"
209
+ modifiedDate="2024-01-20T00:00:00Z"
210
+
211
+ // URL
212
+ canonicalUrl="https://example.com/page"
213
+ />
214
+ ```
215
+
216
+ ---
217
+
218
+ ## Hook Alternative
219
+
220
+ ```tsx
221
+ import { useSeo } from '@donotdev/ui';
222
+
223
+ export default function ProductPage() {
224
+ const { data: product } = useProduct(id);
225
+
226
+ const SeoTags = useSeo(product ? {
227
+ title: product.name,
228
+ description: product.description,
229
+ image: product.image,
230
+ } : null);
231
+
232
+ return (
233
+ <>
234
+ <SeoTags />
235
+ <ProductDetails data={product} />
236
+ </>
237
+ );
238
+ }
239
+ ```
240
+
241
+ ---
242
+
243
+ ## Next.js: Manual `generateMetadata`
244
+
245
+ For advanced cases, override in the page file:
246
+
247
+ ```tsx
248
+ // src/app/products/[id]/page.tsx (manual, not generated)
249
+ import type { Metadata } from 'next';
250
+
251
+ export async function generateMetadata({ params }): Promise<Metadata> {
252
+ const product = await fetchProduct(params.id);
253
+ return {
254
+ title: `${product.name} | Store`,
255
+ description: product.description,
256
+ openGraph: { images: [product.image] },
257
+ };
258
+ }
259
+ ```
260
+
261
+ **For static pages, framework handles this automatically.**
262
+
263
+ ---
264
+
265
+ ## Checklist
266
+
267
+ - [ ] Set `namespace` in PageMeta for i18n-driven SEO
268
+ - [ ] Add `title`, `description`, `meta` to translation files
269
+ - [ ] Use `seo.fullTitle` to escape "Page | App" format
270
+ - [ ] Use `<Seo>` for pages with dynamic/fetched data
271
+ - [ ] Verify meta tags: View Source or browser DevTools
272
+
273
+ ---
274
+
275
+ **Drop PageMeta, get SEO. Framework handles the rest.**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donotdev/ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -35,6 +35,7 @@
35
35
  "files": [
36
36
  "dist",
37
37
  "assets",
38
+ "guidelines",
38
39
  "package.json",
39
40
  "README.md",
40
41
  "LICENSE.md"
@@ -58,12 +59,13 @@
58
59
  "react-hook-form": "^7.71.2"
59
60
  },
60
61
  "peerDependencies": {
61
- "@donotdev/auth": "^0.1.0",
62
- "@donotdev/billing": "^0.1.0",
63
- "@donotdev/components": "^0.1.0",
64
- "@donotdev/core": "^0.1.0",
65
- "@donotdev/crud": "^0.1.0",
66
- "@donotdev/oauth": "^0.1.0",
62
+ "@donotdev/ai": "^0.1.1",
63
+ "@donotdev/auth": "^0.1.1",
64
+ "@donotdev/billing": "^0.1.1",
65
+ "@donotdev/components": "^0.1.1",
66
+ "@donotdev/core": "^0.1.1",
67
+ "@donotdev/crud": "^0.1.1",
68
+ "@donotdev/oauth": "^0.1.1",
67
69
  "lucide-react": "^0.575.0",
68
70
  "react": "^19.2.4",
69
71
  "react-dom": "^19.2.4",
@@ -71,6 +73,9 @@
71
73
  "valibot": "^1.2.0"
72
74
  },
73
75
  "peerDependenciesMeta": {
76
+ "@donotdev/ai": {
77
+ "optional": true
78
+ },
74
79
  "@donotdev/auth": {
75
80
  "optional": true
76
81
  },
@@ -1 +0,0 @@
1
- import*as l from"lucide-react";import{isValidElement as P}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 b=({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 P(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})},z=b;import*as E from"@donotdev/auth";import{DEGRADED_AUTH_API as L}from"@donotdev/core";var d=E?.useAuth;function T(e){return L[e]}function y(e){return d?d(e):T(e)}var O=typeof d=="function";import{useMemo as h}from"react";import{useNavigationStore as K}from"@donotdev/core";import{USER_ROLES as F}from"@donotdev/core";import{useLocation as k}from"@donotdev/ui/routing/hooks";function g(){let e=k(),t=y("user"),r=!!t,s=t?.role||F.GUEST,o=K(i=>!i||typeof i.getFilteredRoutes!="function"?[]:i.getFilteredRoutes({authenticated:r,role:s}));return h(()=>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 J(e){let t=g();return h(()=>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 A}from"react";import{useNavigationStore as u}from"@donotdev/core";import{useNavigate as j}from"@donotdev/ui/routing/hooks";var te=()=>{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=A(()=>t.length?t.filter(n=>r.includes(n.path)):[],[r,t]),p=A(()=>t.length?t.filter(C=>s.includes(C.path)).slice(0,5):[],[s,t]),N=f(n=>{o(n)},[o]),R=f(n=>i(n),[i]),I=f(n=>{a(n)},[a]),x=f(n=>{I(n),e(n)},[e,I]);return{navigationItems:t,favoriteItems:v,recentItems:p,toggleFavorite:N,isFavorite:R,navigateToItem:x}};export{b as a,z as b,y as c,O as d,g as e,J as f,te as g};