fimo 0.20.0 → 0.21.0-experimental.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 (322) hide show
  1. package/README.md +1 -1
  2. package/assets/agent-templates/_default/GOAL.md +10 -0
  3. package/assets/agent-templates/_default/capabilities.yaml +10 -0
  4. package/assets/content-templates/shared/types.eta +1 -1
  5. package/assets/skills/fimo-cli/SKILL.md +2 -1
  6. package/assets/skills/fimo-cli/references/agents.md +136 -36
  7. package/assets/skills/fimo-cli/references/branches.md +8 -5
  8. package/assets/skills/fimo-cli/references/deploy.md +11 -2
  9. package/assets/skills/fimo-cli/references/domains.md +12 -0
  10. package/assets/skills/fimo-cli/references/forms.md +1 -1
  11. package/assets/skills/fimo-cli/references/init.md +9 -2
  12. package/assets/skills/fimo-cli/references/locales.md +1 -1
  13. package/assets/skills/fimo-cli/references/mcp.md +1 -1
  14. package/assets/skills/fimo-cli/references/media.md +18 -1
  15. package/assets/skills/fimo-cli/references/project-vars-and-secrets.md +3 -1
  16. package/assets/skills/fimo-cli/references/projects.md +7 -7
  17. package/assets/skills/fimo-code/assets/react-router-locales/navigation.tsx +1 -1
  18. package/assets/skills/fimo-code/references/assets.md +2 -2
  19. package/assets/skills/fimo-code/references/best-practices/next.md +1 -1
  20. package/assets/skills/fimo-code/references/content/schema.md +23 -0
  21. package/assets/skills/fimo-code/references/forms.md +1 -1
  22. package/assets/skills/fimo-code/references/frameworks/astro.md +8 -2
  23. package/assets/skills/fimo-code/references/frameworks/compatibility.md +9 -9
  24. package/assets/skills/fimo-code/references/frameworks/hosting.md +17 -13
  25. package/assets/skills/fimo-code/references/frameworks/next/app-router.md +8 -9
  26. package/assets/skills/fimo-code/references/frameworks/next/locales.md +5 -5
  27. package/assets/skills/fimo-code/references/frameworks/next/pages-router.md +5 -5
  28. package/assets/skills/fimo-code/references/frameworks/next.md +41 -32
  29. package/assets/skills/fimo-code/references/frameworks/react-router.md +10 -7
  30. package/assets/skills/fimo-code/references/frameworks/sveltekit.md +22 -15
  31. package/assets/skills/fimo-code/references/frameworks/vite-react.md +7 -5
  32. package/assets/skills/fimo-code/references/labels.md +4 -4
  33. package/assets/skills/fimo-code/references/locales.md +2 -2
  34. package/assets/skills/fimo-code/references/ui.md +4 -4
  35. package/assets/skills/fimo-migration/SKILL.md +51 -30
  36. package/assets/skills/fimo-migration/references/frameworks/nextjs.md +12 -15
  37. package/assets/skills/fimo-migration/references/media.md +12 -8
  38. package/assets/skills/fimo-migration/references/qa.md +12 -11
  39. package/assets/skills/fimo-migration/references/workers/content-planner.md +33 -4
  40. package/assets/skills/fimo-migration/references/workers/validator.md +10 -0
  41. package/assets/skills/fimo-migration/references/workers.md +19 -10
  42. package/assets/skills/fimo-migration/references/workflow.md +29 -11
  43. package/assets/skills/fimo-studio/references/ai-chat.md +1 -1
  44. package/assets/skills/fimo-studio/references/billing-and-credits.md +18 -1
  45. package/assets/skills/fimo-studio/references/cms.md +2 -0
  46. package/assets/skills/fimo-studio/references/preview-and-responsive.md +1 -0
  47. package/assets/starters/fimo-site/template/src/pages/Contact.tsx +1 -1
  48. package/assets/starters/fimo-site/template/src/pages/SiteContent.tsx +1 -1
  49. package/assets/starters/fimo-site/template/src/schemas/HomePage.ts +3 -3
  50. package/assets/starters/fimo-site/template/src/schemas/HomePage.types.ts +1 -1
  51. package/dist/build/astro/config.d.ts +13 -2
  52. package/dist/build/astro/config.js +9 -24
  53. package/dist/build/next/moved.d.ts +2 -0
  54. package/dist/build/next/moved.js +2 -0
  55. package/dist/build/react/router-moved.d.ts +2 -0
  56. package/dist/build/react/router-moved.js +2 -0
  57. package/dist/build/react/router-preset-moved.d.ts +2 -0
  58. package/dist/build/react/router-preset-moved.js +2 -0
  59. package/dist/build/react/router-routes-moved.d.ts +2 -0
  60. package/dist/build/react/router-routes-moved.js +2 -0
  61. package/dist/build/react/ui-moved.d.ts +2 -0
  62. package/dist/build/react/ui-moved.js +2 -0
  63. package/dist/build/react/vite-moved.d.ts +2 -0
  64. package/dist/build/react/vite-moved.js +2 -0
  65. package/dist/build/sveltekit/config.d.ts +5 -4
  66. package/dist/build/sveltekit/config.js +6 -15
  67. package/dist/build/sveltekit/moved.d.ts +13 -0
  68. package/dist/build/sveltekit/moved.js +3 -0
  69. package/dist/build/vite/data-id.d.ts +11 -0
  70. package/dist/build/vite/data-id.js +20 -0
  71. package/dist/build/vite/plugins/runtime-env.d.ts +1 -1
  72. package/dist/build/vite/plugins/runtime-env.js +6 -2
  73. package/dist/build/vite/runtime-env.d.ts +2 -0
  74. package/dist/build/vite/runtime-env.js +1 -0
  75. package/dist/cli/bundle.json +1 -1
  76. package/dist/cli/index.js +115 -110
  77. package/dist/runtime/content/client/internal.js +1 -1
  78. package/dist/runtime/content/index.d.ts +6 -1
  79. package/dist/runtime/content/index.js +6 -0
  80. package/dist/runtime/i18n/index.d.ts +2 -0
  81. package/dist/runtime/i18n/index.js +1 -0
  82. package/dist/runtime/labels/index.d.ts +3 -0
  83. package/dist/runtime/labels/index.js +2 -0
  84. package/dist/runtime/preview/index.d.ts +5 -0
  85. package/dist/runtime/preview/index.js +4 -0
  86. package/dist/runtime/preview/script.d.ts +3 -0
  87. package/dist/runtime/preview/script.js +14 -0
  88. package/dist/runtime/primitives/lib/index.d.ts +2 -0
  89. package/dist/runtime/primitives/lib/index.js +2 -0
  90. package/dist/runtime/seo/index.d.ts +0 -8
  91. package/dist/runtime/seo/index.js +0 -8
  92. package/dist/runtime/shared/config.d.ts +6 -0
  93. package/dist/runtime/shared/config.js +4 -0
  94. package/dist/runtime/shared/local-runtime-env.d.ts +2 -2
  95. package/dist/runtime/shared/local-runtime-env.js +7 -5
  96. package/dist/runtime/templates.d.ts +20 -4
  97. package/dist/runtime/templates.js +60 -18
  98. package/dist/scripts/extract-translations.js +8 -3
  99. package/dist/scripts/index.d.ts +3 -0
  100. package/dist/scripts/index.js +2 -0
  101. package/dist/scripts/sync-forms.js +21 -9
  102. package/dist/scripts/sync-schemas.js +129 -21
  103. package/dist/scripts/validate-schemas.js +63 -2
  104. package/package.json +72 -71
  105. package/release.json +2 -2
  106. package/templates/astro/AGENTS.md +1 -1
  107. package/templates/astro/astro.config.mjs +1 -1
  108. package/templates/astro/package.json +4 -2
  109. package/templates/astro/pnpm-workspace.yaml +6 -2
  110. package/templates/nextjs/.fimo/config.json +1 -2
  111. package/templates/nextjs/AGENTS.md +6 -16
  112. package/templates/nextjs/next.config.ts +4 -2
  113. package/templates/nextjs/package.json +4 -2
  114. package/templates/nextjs/pnpm-workspace.yaml +6 -2
  115. package/templates/nextjs/src/app/layout.tsx +16 -0
  116. package/templates/nextjs/src/locales.ts +3 -6
  117. package/templates/react-router/AGENTS.md +1 -1
  118. package/templates/react-router/package.json +5 -2
  119. package/templates/react-router/pnpm-workspace.yaml +6 -6
  120. package/templates/react-router/react-router.config.ts +1 -1
  121. package/templates/react-router/src/pages/legal/LegalPage.tsx +1 -1
  122. package/templates/react-router/src/root.tsx +1 -1
  123. package/templates/react-router/src/vite-env.d.ts +0 -1
  124. package/templates/react-router/vite.config.ts +1 -1
  125. package/templates/sveltekit/AGENTS.md +1 -1
  126. package/templates/sveltekit/package.json +4 -2
  127. package/templates/sveltekit/pnpm-workspace.yaml +6 -2
  128. package/templates/sveltekit/src/routes/+layout.server.ts +1 -1
  129. package/templates/sveltekit/src/routes/+layout.svelte +1 -1
  130. package/templates/sveltekit/svelte.config.js +1 -1
  131. package/templates/sveltekit/vite.config.ts +1 -1
  132. package/assets/sveltekit/components/Boolean.svelte +0 -19
  133. package/assets/sveltekit/components/Date.svelte +0 -33
  134. package/assets/sveltekit/components/DateTime.svelte +0 -35
  135. package/assets/sveltekit/components/FimoProvider.svelte +0 -35
  136. package/assets/sveltekit/components/Image.svelte +0 -80
  137. package/assets/sveltekit/components/Json.svelte +0 -18
  138. package/assets/sveltekit/components/Label.svelte +0 -16
  139. package/assets/sveltekit/components/Number.svelte +0 -21
  140. package/assets/sveltekit/components/RichText.svelte +0 -19
  141. package/assets/sveltekit/components/Text.svelte +0 -30
  142. package/assets/sveltekit/components/Video.svelte +0 -37
  143. package/assets/sveltekit/components/index.d.ts +0 -11
  144. package/assets/sveltekit/components/index.js +0 -11
  145. package/dist/build/next/config.d.ts +0 -17
  146. package/dist/build/next/config.js +0 -66
  147. package/dist/build/sveltekit/data-id.d.ts +0 -3
  148. package/dist/build/sveltekit/data-id.js +0 -171
  149. package/dist/build/sveltekit/files/edge.js +0 -68
  150. package/dist/build/sveltekit/files/serverless.js +0 -42
  151. package/dist/build/sveltekit/vite.d.ts +0 -12
  152. package/dist/build/sveltekit/vite.js +0 -14
  153. package/dist/build/vite/index.d.ts +0 -42
  154. package/dist/build/vite/index.js +0 -160
  155. package/dist/build/vite/plugins/content-sync.d.ts +0 -11
  156. package/dist/build/vite/plugins/content-sync.js +0 -41
  157. package/dist/build/vite/plugins/data-id.d.ts +0 -12
  158. package/dist/build/vite/plugins/data-id.js +0 -109
  159. package/dist/build/vite/plugins/fimo-config.d.ts +0 -12
  160. package/dist/build/vite/plugins/fimo-config.js +0 -68
  161. package/dist/build/vite/plugins/overlay.d.ts +0 -3
  162. package/dist/build/vite/plugins/overlay.js +0 -154
  163. package/dist/build/vite/plugins/robots.d.ts +0 -10
  164. package/dist/build/vite/plugins/robots.js +0 -56
  165. package/dist/build/vite/plugins/seo.d.ts +0 -3
  166. package/dist/build/vite/plugins/seo.js +0 -112
  167. package/dist/build/vite/plugins/server-config.d.ts +0 -3
  168. package/dist/build/vite/plugins/server-config.js +0 -36
  169. package/dist/build/vite/plugins/sitemap.d.ts +0 -3
  170. package/dist/build/vite/plugins/sitemap.js +0 -73
  171. package/dist/build/vite/plugins/translations.d.ts +0 -11
  172. package/dist/build/vite/plugins/translations.js +0 -601
  173. package/dist/runtime/app/FimoProviders.d.ts +0 -30
  174. package/dist/runtime/app/FimoProviders.js +0 -186
  175. package/dist/runtime/app/FimoScripts.d.ts +0 -14
  176. package/dist/runtime/app/FimoScripts.js +0 -48
  177. package/dist/runtime/app/index.d.ts +0 -8
  178. package/dist/runtime/app/index.js +0 -4
  179. package/dist/runtime/app/prefetch.d.ts +0 -9
  180. package/dist/runtime/app/prefetch.js +0 -39
  181. package/dist/runtime/content/DataSourcesProvider.d.ts +0 -4
  182. package/dist/runtime/content/DataSourcesProvider.js +0 -63
  183. package/dist/runtime/content/RefreshContentProvider.d.ts +0 -19
  184. package/dist/runtime/content/RefreshContentProvider.js +0 -71
  185. package/dist/runtime/content/client/createContentClient.d.ts +0 -7
  186. package/dist/runtime/content/client/createContentClient.js +0 -7
  187. package/dist/runtime/content/client/createSingletonClient.d.ts +0 -5
  188. package/dist/runtime/content/client/createSingletonClient.js +0 -6
  189. package/dist/runtime/content/client/react-content-client.d.ts +0 -10
  190. package/dist/runtime/content/client/react-content-client.js +0 -165
  191. package/dist/runtime/content/client/react-singleton-client.d.ts +0 -7
  192. package/dist/runtime/content/client/react-singleton-client.js +0 -38
  193. package/dist/runtime/content/client/types.d.ts +0 -42
  194. package/dist/runtime/content/client/types.js +0 -1
  195. package/dist/runtime/content/client/useQueryLocale.d.ts +0 -2
  196. package/dist/runtime/content/client/useQueryLocale.js +0 -5
  197. package/dist/runtime/content/client/vite-runtime.d.ts +0 -3
  198. package/dist/runtime/content/client/vite-runtime.js +0 -23
  199. package/dist/runtime/content/utils/retrieve-data-sources.d.ts +0 -29
  200. package/dist/runtime/content/utils/retrieve-data-sources.js +0 -107
  201. package/dist/runtime/core/AppErrorBoundary.d.ts +0 -10
  202. package/dist/runtime/core/AppErrorBoundary.js +0 -27
  203. package/dist/runtime/core/ViteLifecycles.d.ts +0 -5
  204. package/dist/runtime/core/ViteLifecycles.js +0 -35
  205. package/dist/runtime/i18n/FimoLocaleContext.d.ts +0 -9
  206. package/dist/runtime/i18n/FimoLocaleContext.js +0 -17
  207. package/dist/runtime/iframe/ConsoleErrorProvider.d.ts +0 -3
  208. package/dist/runtime/iframe/ConsoleErrorProvider.js +0 -103
  209. package/dist/runtime/iframe/ScreenshotProvider.d.ts +0 -3
  210. package/dist/runtime/iframe/ScreenshotProvider.js +0 -60
  211. package/dist/runtime/iframe/runtime/overlay-hmr.d.ts +0 -2
  212. package/dist/runtime/iframe/runtime/overlay-hmr.js +0 -27
  213. package/dist/runtime/iframe/runtime/overlay-runtime.d.ts +0 -2
  214. package/dist/runtime/iframe/runtime/overlay-runtime.js +0 -103
  215. package/dist/runtime/index.d.ts +0 -22
  216. package/dist/runtime/index.js +0 -23
  217. package/dist/runtime/next/client-runtime.d.ts +0 -3
  218. package/dist/runtime/next/client-runtime.js +0 -24
  219. package/dist/runtime/next/client.d.ts +0 -28
  220. package/dist/runtime/next/client.js +0 -25
  221. package/dist/runtime/next/facade.d.ts +0 -8
  222. package/dist/runtime/next/facade.js +0 -34
  223. package/dist/runtime/next/labels.d.ts +0 -7
  224. package/dist/runtime/next/labels.js +0 -9
  225. package/dist/runtime/next/preview.d.ts +0 -13
  226. package/dist/runtime/next/preview.js +0 -34
  227. package/dist/runtime/next/primitives/Text.d.ts +0 -10
  228. package/dist/runtime/next/primitives/Text.js +0 -18
  229. package/dist/runtime/next/primitives/server.d.ts +0 -11
  230. package/dist/runtime/next/primitives/server.js +0 -54
  231. package/dist/runtime/next/provider.d.ts +0 -18
  232. package/dist/runtime/next/provider.js +0 -39
  233. package/dist/runtime/next/server-runtime.d.ts +0 -3
  234. package/dist/runtime/next/server-runtime.js +0 -23
  235. package/dist/runtime/next/server.d.ts +0 -21
  236. package/dist/runtime/next/server.js +0 -16
  237. package/dist/runtime/primitives/index.d.ts +0 -16
  238. package/dist/runtime/primitives/index.js +0 -17
  239. package/dist/runtime/react/primitives/contracts.d.ts +0 -94
  240. package/dist/runtime/react/primitives/contracts.js +0 -1
  241. package/dist/runtime/react/primitives/editable/Boolean.d.ts +0 -5
  242. package/dist/runtime/react/primitives/editable/Boolean.js +0 -11
  243. package/dist/runtime/react/primitives/editable/Date.d.ts +0 -4
  244. package/dist/runtime/react/primitives/editable/Date.js +0 -12
  245. package/dist/runtime/react/primitives/editable/DateTime.d.ts +0 -4
  246. package/dist/runtime/react/primitives/editable/DateTime.js +0 -13
  247. package/dist/runtime/react/primitives/editable/Image.d.ts +0 -4
  248. package/dist/runtime/react/primitives/editable/Image.js +0 -10
  249. package/dist/runtime/react/primitives/editable/Json.d.ts +0 -5
  250. package/dist/runtime/react/primitives/editable/Json.js +0 -11
  251. package/dist/runtime/react/primitives/editable/RichText.d.ts +0 -4
  252. package/dist/runtime/react/primitives/editable/RichText.js +0 -11
  253. package/dist/runtime/react/primitives/editable/Text.d.ts +0 -20
  254. package/dist/runtime/react/primitives/editable/Text.js +0 -36
  255. package/dist/runtime/react/primitives/editable/Video.d.ts +0 -4
  256. package/dist/runtime/react/primitives/editable/Video.js +0 -10
  257. package/dist/runtime/react/primitives/renderers/DateRenderer.d.ts +0 -17
  258. package/dist/runtime/react/primitives/renderers/DateRenderer.js +0 -17
  259. package/dist/runtime/react/primitives/renderers/ImageRenderer.d.ts +0 -8
  260. package/dist/runtime/react/primitives/renderers/ImageRenderer.js +0 -31
  261. package/dist/runtime/react/primitives/renderers/RichTextRenderer.d.ts +0 -12
  262. package/dist/runtime/react/primitives/renderers/RichTextRenderer.js +0 -135
  263. package/dist/runtime/react/primitives/renderers/StaticImage.d.ts +0 -35
  264. package/dist/runtime/react/primitives/renderers/StaticImage.js +0 -58
  265. package/dist/runtime/react/primitives/renderers/VideoRenderer.d.ts +0 -8
  266. package/dist/runtime/react/primitives/renderers/VideoRenderer.js +0 -10
  267. package/dist/runtime/react/useFimoLiveValue.d.ts +0 -20
  268. package/dist/runtime/react/useFimoLiveValue.js +0 -43
  269. package/dist/runtime/react-router/active-routes.d.ts +0 -12
  270. package/dist/runtime/react-router/active-routes.js +0 -60
  271. package/dist/runtime/react-router/index.d.ts +0 -16
  272. package/dist/runtime/react-router/index.js +0 -20
  273. package/dist/runtime/react-router/legacy/routes.d.ts +0 -35
  274. package/dist/runtime/react-router/legacy/routes.js +0 -86
  275. package/dist/runtime/react-router/navigation-utils.d.ts +0 -8
  276. package/dist/runtime/react-router/navigation-utils.js +0 -36
  277. package/dist/runtime/react-router/navigation.d.ts +0 -12
  278. package/dist/runtime/react-router/navigation.js +0 -28
  279. package/dist/runtime/react-router/preset.d.ts +0 -30
  280. package/dist/runtime/react-router/preset.js +0 -33
  281. package/dist/runtime/routing/AppResetScrollOnNavigate.d.ts +0 -2
  282. package/dist/runtime/routing/AppResetScrollOnNavigate.js +0 -12
  283. package/dist/runtime/routing/AppRoutesProvider.d.ts +0 -25
  284. package/dist/runtime/routing/AppRoutesProvider.js +0 -112
  285. package/dist/runtime/seo/buildSeoForPath.d.ts +0 -74
  286. package/dist/runtime/seo/buildSeoForPath.js +0 -55
  287. package/dist/runtime/seo/htmlProps.d.ts +0 -13
  288. package/dist/runtime/seo/htmlProps.js +0 -15
  289. package/dist/runtime/sveltekit/content.d.ts +0 -25
  290. package/dist/runtime/sveltekit/content.js +0 -33
  291. package/dist/runtime/sveltekit/context-contract.d.ts +0 -5
  292. package/dist/runtime/sveltekit/context-contract.js +0 -2
  293. package/dist/runtime/sveltekit/context.d.ts +0 -8
  294. package/dist/runtime/sveltekit/context.js +0 -25
  295. package/dist/runtime/sveltekit/forms.d.ts +0 -15
  296. package/dist/runtime/sveltekit/forms.js +0 -15
  297. package/dist/runtime/sveltekit/index.d.ts +0 -9
  298. package/dist/runtime/sveltekit/index.js +0 -5
  299. package/dist/runtime/sveltekit/internal.d.ts +0 -6
  300. package/dist/runtime/sveltekit/internal.js +0 -12
  301. package/dist/runtime/sveltekit/labels.d.ts +0 -20
  302. package/dist/runtime/sveltekit/labels.js +0 -13
  303. package/dist/runtime/sveltekit/preview.d.ts +0 -28
  304. package/dist/runtime/sveltekit/preview.js +0 -82
  305. package/dist/runtime/sveltekit/runtime.d.ts +0 -9
  306. package/dist/runtime/sveltekit/runtime.js +0 -26
  307. package/dist/runtime/t/OptionalTracking.d.ts +0 -13
  308. package/dist/runtime/t/OptionalTracking.js +0 -28
  309. package/dist/runtime/t/Pageview.d.ts +0 -9
  310. package/dist/runtime/t/Pageview.js +0 -118
  311. package/dist/runtime/vite/Label.d.ts +0 -13
  312. package/dist/runtime/vite/Label.js +0 -16
  313. package/dist/runtime/vite/primitives/Images.d.ts +0 -4
  314. package/dist/runtime/vite/primitives/Images.js +0 -12
  315. package/dist/runtime/vite/translations.d.ts +0 -28
  316. package/dist/runtime/vite/translations.js +0 -103
  317. package/templates/nextjs/src/app/(default)/layout.tsx +0 -10
  318. package/templates/nextjs/src/app/[locale]/layout.tsx +0 -22
  319. package/templates/nextjs/src/app/[locale]/page.tsx +0 -1
  320. package/templates/nextjs/src/components/Document.tsx +0 -26
  321. package/templates/nextjs/src/components/FimoPreviewBridge.tsx +0 -13
  322. /package/templates/nextjs/src/app/{(default)/page.tsx → page.tsx} +0 -0
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- export { getPreviewLocationChange, getPreviewLocationPath } from '../preview/location.js';
3
- export interface ParamInfo {
4
- schema: string;
5
- queryField: string;
6
- displayField: string;
7
- }
8
- export interface DisplayRoute {
9
- id: string;
10
- name: string;
11
- path: string;
12
- params?: Record<string, ParamInfo>;
13
- }
14
- /**
15
- * The routes the running app can actually navigate to right now.
16
- *
17
- * Studio gates preview navigation on this list, so it must come from the
18
- * router that is currently loaded rather than the build-time config: after a
19
- * merge, config metadata can describe a page whose route module has not
20
- * reached this iframe yet. Names and params still come from config, which is
21
- * where authored metadata lives. Falls back to config when the framework
22
- * manifest is unreadable (SSR pass, non-framework mode).
23
- */
24
- export declare function getDisplayRoutes(frameworkManifest: unknown): DisplayRoute[];
25
- export interface FimoProvidersProps {
26
- children?: React.ReactNode;
27
- locale?: string;
28
- }
29
- export declare function FimoProviders({ children, locale }: FimoProvidersProps): import("react/jsx-runtime").JSX.Element;
30
- //# sourceMappingURL=FimoProviders.d.ts.map
@@ -1,186 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { QueryClient, QueryClientContext, QueryClientProvider } from '@tanstack/react-query';
3
- import { Suspense, useCallback, useContext, useEffect, useMemo, useRef } from 'react';
4
- import { ErrorBoundary } from 'react-error-boundary';
5
- import { UNSAFE_FrameworkContext, useLocation, useNavigate } from 'react-router';
6
- // @ts-ignore - virtual module provided by fimoConfigPlugin in fimo/vite
7
- import fimoConfig from 'virtual:fimo-config';
8
- import { DataSourcesProvider } from '../content/DataSourcesProvider.js';
9
- import { RefreshContentProvider } from '../content/RefreshContentProvider.js';
10
- import { AppErrorBoundary, onError } from '../core/AppErrorBoundary.js';
11
- import { ViteLifecycles } from '../core/ViteLifecycles.js';
12
- import { FimoLocaleProvider } from '../i18n/FimoLocaleContext.js';
13
- import { getFimoTextDirection, resolveFimoLocale, toHtmlLang } from '../i18n/locale.js';
14
- import { ScreenshotProvider } from '../iframe/ScreenshotProvider.js';
15
- import { getSafePreviewNavigationPath, isPreviewRuntimeEnabled } from '../preview/bridge.js';
16
- import { getPreviewLocationChange, getPreviewParentOrigin } from '../preview/location.js';
17
- import { getActiveRouterRoutes } from '../react-router/active-routes.js';
18
- import { matchFimoRoute } from '../routes/index.js';
19
- import { OptionalTracking } from '../t/OptionalTracking.js';
20
- export { getPreviewLocationChange, getPreviewLocationPath } from '../preview/location.js';
21
- const titleCase = (seg) => seg
22
- .replace(/[_-]+/g, ' ')
23
- .replace(/([a-z])([A-Z])/g, '$1 $2')
24
- .split(/\s+/)
25
- .filter(Boolean)
26
- .map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
27
- .join(' ');
28
- const generateRouteName = (path) => {
29
- if (path === '/') {
30
- return 'Home';
31
- }
32
- const firstSegment = path.replace(/^\//, '').split('/')[0];
33
- return titleCase(firstSegment);
34
- };
35
- function getConfigDisplayRoutes() {
36
- const configRoutes = fimoConfig.routes ?? {};
37
- return Object.entries(configRoutes)
38
- .filter(([, route]) => route.path)
39
- .map(([id, route]) => ({
40
- id,
41
- path: route.path,
42
- name: route.name || generateRouteName(route.path),
43
- params: route.params,
44
- }));
45
- }
46
- function getCanonicalRoutePath(path) {
47
- return resolveFimoLocale({ pathname: path }, fimoConfig).routePath;
48
- }
49
- /**
50
- * The locale a pathname renders.
51
- *
52
- * The declared route decides it. A route that declares no `:locale` segment is
53
- * app-owned and renders the default locale whatever its first segment spells,
54
- * which is what stops `/fr` from switching the page to French when `fr` is
55
- * really an entry slug under a top-level `/:slug` route.
56
- *
57
- * Only a URL that no declared route answers falls back to the compatibility
58
- * prefix resolver. Existing apps can still rely on that inference while new
59
- * route-owned integrations pass an explicit locale to `FimoProviders`.
60
- */
61
- function getRouteLocale(pathname) {
62
- return (matchFimoRoute(pathname, fimoConfig)?.locale ?? resolveFimoLocale({ pathname }, fimoConfig).locale);
63
- }
64
- function hasReadableFrameworkManifest(manifest) {
65
- return Boolean(manifest &&
66
- typeof manifest === 'object' &&
67
- 'routes' in manifest &&
68
- manifest.routes &&
69
- typeof manifest.routes === 'object');
70
- }
71
- /**
72
- * The routes the running app can actually navigate to right now.
73
- *
74
- * Studio gates preview navigation on this list, so it must come from the
75
- * router that is currently loaded rather than the build-time config: after a
76
- * merge, config metadata can describe a page whose route module has not
77
- * reached this iframe yet. Names and params still come from config, which is
78
- * where authored metadata lives. Falls back to config when the framework
79
- * manifest is unreadable (SSR pass, non-framework mode).
80
- */
81
- export function getDisplayRoutes(frameworkManifest) {
82
- const configRoutes = getConfigDisplayRoutes();
83
- if (!hasReadableFrameworkManifest(frameworkManifest)) {
84
- return configRoutes;
85
- }
86
- const configByPath = new Map(configRoutes.map((route) => [getCanonicalRoutePath(route.path), route]));
87
- return getActiveRouterRoutes(frameworkManifest).map((route) => {
88
- const metadata = configByPath.get(getCanonicalRoutePath(route.path));
89
- return {
90
- id: metadata?.id ?? route.id,
91
- path: route.path,
92
- name: metadata?.name ?? generateRouteName(route.path),
93
- ...(metadata?.params ? { params: metadata.params } : {}),
94
- };
95
- });
96
- }
97
- /**
98
- * Studio's window into the running app. Framework-neutral on purpose: it
99
- * speaks only postMessage (`nav/routes`, `nav/locationChange`, `nav/navigate`,
100
- * `nav/read-routes`) and reads routes through the `readRoutes` callback, so a
101
- * future non-React-Router runtime reuses it by supplying its own reader.
102
- */
103
- function PreviewBridge({ readRoutes, locale }) {
104
- const navigate = useNavigate();
105
- const location = useLocation();
106
- const sendRoutes = useCallback(() => {
107
- // Read at send time: the router can change its route table in place
108
- // during HMR, so an explicit nav/read-routes must see the current state.
109
- window.parent.postMessage({ type: 'nav/routes', payload: { routes: readRoutes() } }, getPreviewParentOrigin() ?? '*');
110
- }, [readRoutes]);
111
- // `locale` is a dependency on purpose: an app that settles a new locale
112
- // without moving the pathname still has to tell Studio about it.
113
- const sendLocationChange = useCallback(() => {
114
- const parentOrigin = getPreviewParentOrigin();
115
- window.parent.postMessage({ type: 'nav/locationChange', payload: getPreviewLocationChange(location, locale, parentOrigin) }, parentOrigin ?? '*');
116
- }, [location.hash, location.pathname, location.search, locale]);
117
- useEffect(sendRoutes, [sendRoutes]);
118
- useEffect(sendLocationChange, [sendLocationChange]);
119
- useEffect(() => {
120
- const handleMessage = (event) => {
121
- const parentOrigin = getPreviewParentOrigin();
122
- if (event.source !== window.parent || !parentOrigin || event.origin !== parentOrigin) {
123
- return;
124
- }
125
- const type = event.data?.type;
126
- const payload = event.data?.payload;
127
- switch (type) {
128
- case 'nav/navigate':
129
- {
130
- const target = getSafePreviewNavigationPath(payload?.to, window.location.origin);
131
- if (target) {
132
- navigate(target);
133
- }
134
- }
135
- return;
136
- case 'nav/read-routes':
137
- sendRoutes();
138
- sendLocationChange();
139
- return;
140
- }
141
- };
142
- window.addEventListener('message', handleMessage);
143
- return () => {
144
- window.removeEventListener('message', handleMessage);
145
- };
146
- }, [navigate, sendRoutes, sendLocationChange]);
147
- return null;
148
- }
149
- function EnsureQueryClient({ children }) {
150
- const existingQueryClient = useContext(QueryClientContext);
151
- const fallbackQueryClientRef = useRef(null);
152
- if (existingQueryClient) {
153
- return _jsx(_Fragment, { children: children });
154
- }
155
- const fallbackQueryClient = fallbackQueryClientRef.current ?? (fallbackQueryClientRef.current = new QueryClient());
156
- return _jsx(QueryClientProvider, { client: fallbackQueryClient, children: children });
157
- }
158
- export function FimoProviders({ children, locale }) {
159
- const location = useLocation();
160
- // The React-Router-specific part of the bridge, isolated here: the live
161
- // route table lives on the framework context's manifest, which React Router
162
- // may update in place during HMR — hence reading it per render/send instead
163
- // of caching. A different framework runtime would swap this reader only.
164
- const frameworkContext = useContext(UNSAFE_FrameworkContext);
165
- const readRoutes = useCallback(() => getDisplayRoutes(frameworkContext?.manifest), [frameworkContext?.manifest]);
166
- const routes = readRoutes();
167
- const localeResolution = useMemo(() => resolveFimoLocale({ pathname: location.pathname }, fimoConfig), [location.pathname]);
168
- // The app is authoritative: an explicit `locale` wins over anything Fimo can
169
- // infer, and inference itself goes through the declared route contract.
170
- const activeLocale = useMemo(() => locale ?? getRouteLocale(location.pathname), [locale, location.pathname]);
171
- const activeDir = getFimoTextDirection(activeLocale);
172
- // @ts-ignore - import.meta.env is provided by Vite and React Router.
173
- const previewEnabled = isPreviewRuntimeEnabled(import.meta.env.VITE_PREVIEW_SCRIPT_URL);
174
- useEffect(() => {
175
- if (typeof document === 'undefined') {
176
- return;
177
- }
178
- document.documentElement.lang = toHtmlLang(activeLocale);
179
- document.documentElement.dir = activeDir;
180
- }, [activeDir, activeLocale]);
181
- return (_jsx(ErrorBoundary, { FallbackComponent: AppErrorBoundary, onError: onError, children: _jsx(EnsureQueryClient, { children: _jsx(FimoLocaleProvider, { value: {
182
- ...localeResolution,
183
- locale: activeLocale,
184
- dir: activeDir,
185
- }, children: _jsx(DataSourcesProvider, { children: _jsx(ScreenshotProvider, { children: _jsx(ViteLifecycles, { children: _jsxs(RefreshContentProvider, { children: [previewEnabled ? _jsx(PreviewBridge, { readRoutes: readRoutes, locale: activeLocale }) : null, _jsx(OptionalTracking, { routes: routes }), _jsx(Suspense, { children: children })] }) }) }) }) }) }) }));
186
- }
@@ -1,14 +0,0 @@
1
- import 'virtual:fimo-overlay-hmr';
2
- /**
3
- * Renders extra <script> tags in <head>:
4
- * - Dev overlay runtime (window.error / unhandledrejection bridge to parent)
5
- * - JSON-LD Schema.org Organization + WebSite (when seo.siteName + seo.url set)
6
- * - Preview script (when VITE_PREVIEW_SCRIPT_URL is set, e.g. iframe preview mode)
7
- *
8
- * The overlay runtime is embedded inline via the `virtual:fimo-overlay-runtime`
9
- * module (resolved by `overlayPlugin` in `fimo/vite`). The previous approach
10
- * used `transformIndexHtml`, which doesn't fire in react-router framework mode
11
- * since framework mode bypasses `index.html` entirely.
12
- */
13
- export declare function FimoScripts(): import("react/jsx-runtime").JSX.Element;
14
- //# sourceMappingURL=FimoScripts.d.ts.map
@@ -1,48 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // @ts-ignore - virtual module provided by fimoConfigPlugin in fimo/vite
3
- import rawConfig from 'virtual:fimo-config';
4
- // @ts-ignore - virtual module provided by overlayPlugin in fimo/vite; empty in prod
5
- import overlayRuntime from 'virtual:fimo-overlay-runtime';
6
- // @ts-ignore - side-effect import; vite-served so import.meta.hot works inside
7
- import 'virtual:fimo-overlay-hmr';
8
- const config = rawConfig;
9
- const runtime = overlayRuntime;
10
- function buildSiteSchemas() {
11
- const seo = config.seo;
12
- if (!seo?.siteName || !seo?.url) {
13
- return [];
14
- }
15
- const organization = {
16
- '@context': 'https://schema.org',
17
- '@type': 'Organization',
18
- name: seo.siteName,
19
- url: seo.url,
20
- };
21
- if (seo.favicon) {
22
- organization.logo = seo.favicon;
23
- }
24
- const website = {
25
- '@context': 'https://schema.org',
26
- '@type': 'WebSite',
27
- name: seo.siteName,
28
- url: seo.url,
29
- };
30
- return [organization, website];
31
- }
32
- /**
33
- * Renders extra <script> tags in <head>:
34
- * - Dev overlay runtime (window.error / unhandledrejection bridge to parent)
35
- * - JSON-LD Schema.org Organization + WebSite (when seo.siteName + seo.url set)
36
- * - Preview script (when VITE_PREVIEW_SCRIPT_URL is set, e.g. iframe preview mode)
37
- *
38
- * The overlay runtime is embedded inline via the `virtual:fimo-overlay-runtime`
39
- * module (resolved by `overlayPlugin` in `fimo/vite`). The previous approach
40
- * used `transformIndexHtml`, which doesn't fire in react-router framework mode
41
- * since framework mode bypasses `index.html` entirely.
42
- */
43
- export function FimoScripts() {
44
- // @ts-ignore - import.meta.env is a Vite feature
45
- const previewScriptUrl = import.meta.env.VITE_PREVIEW_SCRIPT_URL;
46
- const siteSchemas = buildSiteSchemas();
47
- return (_jsxs(_Fragment, { children: [runtime ? _jsx("script", { type: "module", dangerouslySetInnerHTML: { __html: runtime } }) : null, previewScriptUrl ? _jsx("script", { src: previewScriptUrl, defer: true }) : null, siteSchemas.map((schema, index) => (_jsx("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: JSON.stringify(schema) } }, index)))] }));
48
- }
@@ -1,8 +0,0 @@
1
- export { FimoProviders } from './FimoProviders.js';
2
- export { FimoScripts } from './FimoScripts.js';
3
- export { useLocale } from '../i18n/FimoLocaleContext.js';
4
- export { localizeFimoPath, resolveFimoLocale } from '../i18n/locale.js';
5
- export type { DisplayRoute, FimoProvidersProps, ParamInfo } from './FimoProviders.js';
6
- export type { FimoLocaleContextValue } from '../i18n/FimoLocaleContext.js';
7
- export type { FimoLocaleResolution } from '../i18n/locale.js';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- export { FimoProviders } from './FimoProviders.js';
2
- export { FimoScripts } from './FimoScripts.js';
3
- export { useLocale } from '../i18n/FimoLocaleContext.js';
4
- export { localizeFimoPath, resolveFimoLocale } from '../i18n/locale.js';
@@ -1,9 +0,0 @@
1
- export declare function resolveFimoLocaleForUrl(url: string): import("./index.js").FimoLocaleResolution;
2
- /**
3
- * Fetch route data for SEO meta resolution.
4
- *
5
- * Only entry params are fetched: a locale param is resolved from the URL and
6
- * never corresponds to a CMS schema, so it must not produce a request.
7
- */
8
- export declare function resolveMetaEntries(url: string): Promise<Record<string, unknown> | undefined>;
9
- //# sourceMappingURL=prefetch.d.ts.map
@@ -1,39 +0,0 @@
1
- // @ts-ignore - virtual module provided by fimoConfigPlugin in fimo/vite
2
- import fimoConfig from 'virtual:fimo-config';
3
- import { resolveFimoLocale } from '../i18n/locale.js';
4
- import { matchFimoRoute } from '../routes/index.js';
5
- export function resolveFimoLocaleForUrl(url) {
6
- return resolveFimoLocale(url, fimoConfig);
7
- }
8
- /**
9
- * Fetch route data for SEO meta resolution.
10
- *
11
- * Only entry params are fetched: a locale param is resolved from the URL and
12
- * never corresponds to a CMS schema, so it must not produce a request.
13
- */
14
- export async function resolveMetaEntries(url) {
15
- // @ts-ignore – import.meta.env is a Vite feature, replaced at build time for both client and SSR
16
- const base = import.meta.env.VITE_API_URL;
17
- if (!base) {
18
- return undefined;
19
- }
20
- const match = matchFimoRoute(url, fimoConfig);
21
- if (!match || match.contract.entryParams.length === 0) {
22
- return undefined;
23
- }
24
- const data = {};
25
- await Promise.all(match.contract.entryParams.map(async (param) => {
26
- const value = match.entryParams[param.name];
27
- if (!value) {
28
- return;
29
- }
30
- const entryUrl = new URL(`${base}/entries/${param.schema}/field/${encodeURIComponent(param.queryField)}/${encodeURIComponent(value)}`);
31
- entryUrl.searchParams.set('locale', match.locale);
32
- const res = await fetch(entryUrl);
33
- if (res.ok) {
34
- const json = await res.json();
35
- data[param.name] = json.data;
36
- }
37
- }));
38
- return Object.keys(data).length > 0 ? data : undefined;
39
- }
@@ -1,4 +0,0 @@
1
- export declare function DataSourcesProvider({ children }: {
2
- children: React.ReactNode;
3
- }): import("react/jsx-runtime").JSX.Element;
4
- //# sourceMappingURL=DataSourcesProvider.d.ts.map
@@ -1,63 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
- import { useCallback, useEffect } from 'react';
3
- import { retrieveVisibleDataSources } from './utils/retrieve-data-sources.js';
4
- const VISIBLE_TRANSLATIONS_SELECTORS = 'h1, h2, h3, nav a, button';
5
- const MAX_VISIBLE_TRANSLATIONS_ITEMS = 20;
6
- const MAX_TEXT_LENGTH = 60;
7
- function isInViewport(el) {
8
- const rect = el.getBoundingClientRect();
9
- return (rect.bottom > 0 &&
10
- rect.top < window.innerHeight &&
11
- rect.right > 0 &&
12
- rect.left < window.innerWidth &&
13
- rect.width > 0 &&
14
- rect.height > 0);
15
- }
16
- function extractVisibleTranslations() {
17
- const elements = document.querySelectorAll(VISIBLE_TRANSLATIONS_SELECTORS);
18
- const seen = new Set();
19
- const items = [];
20
- for (const el of elements) {
21
- if (items.length >= MAX_VISIBLE_TRANSLATIONS_ITEMS)
22
- break;
23
- if (!isInViewport(el))
24
- continue;
25
- const raw = el.textContent?.trim();
26
- if (!raw)
27
- continue;
28
- // Deduplicate (e.g. nav repeated in header + footer)
29
- const key = `${el.tagName.toLowerCase()}:${raw}`;
30
- if (seen.has(key))
31
- continue;
32
- seen.add(key);
33
- const text = raw.length > MAX_TEXT_LENGTH ? raw.slice(0, MAX_TEXT_LENGTH) + '…' : raw;
34
- items.push({ tag: el.tagName.toLowerCase(), text });
35
- }
36
- return items;
37
- }
38
- export function DataSourcesProvider({ children }) {
39
- const sendDataSources = useCallback(() => {
40
- const dataSources = retrieveVisibleDataSources();
41
- window.parent.postMessage({ type: 'content/send-visible', payload: { dataSources } }, '*');
42
- }, []);
43
- const sendVisibleTranslations = useCallback(() => {
44
- const visibleTranslations = extractVisibleTranslations();
45
- window.parent.postMessage({ type: 'content/send-visible-translations', payload: { visibleTranslations } }, '*');
46
- }, []);
47
- // Handle data requests from parent
48
- useEffect(() => {
49
- const handleMessage = (event) => {
50
- if (event.data?.type === 'content/read-visible') {
51
- sendDataSources();
52
- }
53
- if (event.data?.type === 'content/read-visible-translations') {
54
- sendVisibleTranslations();
55
- }
56
- };
57
- window.addEventListener('message', handleMessage);
58
- return () => {
59
- window.removeEventListener('message', handleMessage);
60
- };
61
- }, [sendDataSources, sendVisibleTranslations]);
62
- return _jsx(_Fragment, { children: children });
63
- }
@@ -1,19 +0,0 @@
1
- import type { FC, PropsWithChildren } from 'react';
2
- interface ContentRefreshPayload {
3
- changes?: Array<{
4
- contentType?: string;
5
- documentId?: string;
6
- id?: string;
7
- locale?: string;
8
- }>;
9
- contentType?: string;
10
- documentId?: string;
11
- id?: string;
12
- locale?: string;
13
- }
14
- export declare function normalizeContentQueryRoot(contentType: string): string;
15
- export declare function getContentRefreshPayload(data: unknown): ContentRefreshPayload | null;
16
- export declare function shouldInvalidateContentQuery(queryKey: readonly unknown[], payload: ContentRefreshPayload | null): boolean;
17
- export declare const RefreshContentProvider: FC<PropsWithChildren>;
18
- export {};
19
- //# sourceMappingURL=RefreshContentProvider.d.ts.map
@@ -1,71 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
- import { useQueryClient } from '@tanstack/react-query';
3
- import { useEffect } from 'react';
4
- export function normalizeContentQueryRoot(contentType) {
5
- return contentType
6
- .split(/[^a-zA-Z0-9]+/)
7
- .filter(Boolean)
8
- .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
9
- .join('');
10
- }
11
- export function getContentRefreshPayload(data) {
12
- if (!data || typeof data !== 'object') {
13
- return null;
14
- }
15
- const payload = data.payload ?? data;
16
- if (!payload || typeof payload !== 'object') {
17
- return null;
18
- }
19
- return payload;
20
- }
21
- function getContentTypes(payload) {
22
- if (!payload) {
23
- return [];
24
- }
25
- const contentTypes = new Set();
26
- if (payload.contentType) {
27
- contentTypes.add(payload.contentType);
28
- }
29
- for (const change of payload.changes ?? []) {
30
- if (change.contentType) {
31
- contentTypes.add(change.contentType);
32
- }
33
- }
34
- return [...contentTypes];
35
- }
36
- export function shouldInvalidateContentQuery(queryKey, payload) {
37
- const contentTypes = getContentTypes(payload);
38
- if (contentTypes.length === 0) {
39
- return true;
40
- }
41
- const queryRoots = new Set(contentTypes.flatMap((contentType) => [contentType, normalizeContentQueryRoot(contentType)]));
42
- return queryRoots.has(String(queryKey[0]));
43
- }
44
- export const RefreshContentProvider = ({ children }) => {
45
- const queryClient = useQueryClient();
46
- useEffect(() => {
47
- const invalidateContent = (payload) => {
48
- void queryClient.invalidateQueries({
49
- predicate(query) {
50
- return shouldInvalidateContentQuery(query.queryKey, payload);
51
- },
52
- });
53
- };
54
- const onMessage = (e) => {
55
- if (e.data?.type === 'content/refresh') {
56
- invalidateContent(getContentRefreshPayload(e.data));
57
- }
58
- };
59
- const hot = import.meta.hot;
60
- const onContentUpdated = (payload) => {
61
- invalidateContent(getContentRefreshPayload(payload));
62
- };
63
- window.addEventListener('message', onMessage);
64
- hot?.on('fimo:content-updated', onContentUpdated);
65
- return () => {
66
- window.removeEventListener('message', onMessage);
67
- hot?.off('fimo:content-updated', onContentUpdated);
68
- };
69
- }, [queryClient]);
70
- return _jsx(_Fragment, { children: children });
71
- };
@@ -1,7 +0,0 @@
1
- import { SOURCE_TRACKED_QUERY_OPTIONS } from './react-content-client.js';
2
- import type { ContentClientConfig, CollectionContentClient } from './types.js';
3
- export { SOURCE_TRACKED_QUERY_OPTIONS };
4
- export declare function createContentClient<T extends {
5
- id: string;
6
- }, TInput extends object>(config: ContentClientConfig): CollectionContentClient<T, TInput>;
7
- //# sourceMappingURL=createContentClient.d.ts.map
@@ -1,7 +0,0 @@
1
- import { createReactContentClient, SOURCE_TRACKED_QUERY_OPTIONS } from './react-content-client.js';
2
- import { useQueryLocale } from './useQueryLocale.js';
3
- import { viteContentRuntime } from './vite-runtime.js';
4
- export { SOURCE_TRACKED_QUERY_OPTIONS };
5
- export function createContentClient(config) {
6
- return createReactContentClient(config, viteContentRuntime, (requested, fallback) => useQueryLocale(requested, fallback));
7
- }
@@ -1,5 +0,0 @@
1
- import type { ContentClientConfig, SingletonContentClient } from './types.js';
2
- export declare function createSingletonClient<T extends {
3
- id: string;
4
- }, TInput extends object>(config: ContentClientConfig): SingletonContentClient<T, TInput>;
5
- //# sourceMappingURL=createSingletonClient.d.ts.map
@@ -1,6 +0,0 @@
1
- import { createReactSingletonClient } from './react-singleton-client.js';
2
- import { useQueryLocale } from './useQueryLocale.js';
3
- import { viteContentRuntime } from './vite-runtime.js';
4
- export function createSingletonClient(config) {
5
- return createReactSingletonClient(config, viteContentRuntime, (requested, fallback) => useQueryLocale(requested, fallback));
6
- }
@@ -1,10 +0,0 @@
1
- import type { ContentRuntime } from './runtime.js';
2
- import type { CollectionContentClient, ContentClientConfig } from './types.js';
3
- export declare const SOURCE_TRACKED_QUERY_OPTIONS: {
4
- readonly structuralSharing: false;
5
- };
6
- export type UseContentLocale = (requestedLocale: string | undefined, defaultLocale: string) => string;
7
- export declare function createReactContentClient<T extends {
8
- id: string;
9
- }, TInput extends object>(config: ContentClientConfig, runtime: ContentRuntime, useContentLocale: UseContentLocale): CollectionContentClient<T, TInput>;
10
- //# sourceMappingURL=react-content-client.d.ts.map