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,60 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useIsFetching } from '@tanstack/react-query';
3
- import { useCallback, useEffect, useRef } from 'react';
4
- // Wait for all running CSS/JS animations to complete
5
- const waitForAnimations = async () => {
6
- const animations = document.getAnimations();
7
- if (animations.length === 0) {
8
- return;
9
- }
10
- await Promise.all(animations.map((a) => a.finished.catch(() => { })));
11
- // Small buffer for final paint after animations
12
- await new Promise((r) => setTimeout(r, 100));
13
- };
14
- // This internal component tracks query status and signals when it's safe to screenshot.
15
- const ScreenshotReadySignaler = () => {
16
- const isFetching = useIsFetching();
17
- const hasSeenFetching = useRef(false);
18
- const hasSignaledReady = useRef(false);
19
- const fallbackTimerRef = useRef(null);
20
- const signalReady = useCallback(async () => {
21
- if (hasSignaledReady.current) {
22
- return;
23
- }
24
- hasSignaledReady.current = true;
25
- await waitForAnimations();
26
- document.body.setAttribute('data-screenshot-ready', 'true');
27
- }, []);
28
- // This effect handles the primary logic for pages with data fetching.
29
- useEffect(() => {
30
- if (hasSignaledReady.current) {
31
- return;
32
- }
33
- if (isFetching > 0) {
34
- hasSeenFetching.current = true;
35
- // A query is active, so we can clear the fallback timer.
36
- if (fallbackTimerRef.current) {
37
- clearTimeout(fallbackTimerRef.current);
38
- }
39
- }
40
- if (hasSeenFetching.current && isFetching === 0) {
41
- signalReady();
42
- }
43
- }, [isFetching, signalReady]);
44
- // This effect sets up a fallback for static pages without queries.
45
- useEffect(() => {
46
- fallbackTimerRef.current = setTimeout(() => {
47
- signalReady();
48
- }, 1500); // Wait 1.5 seconds for static pages.
49
- // Cleanup the timer on unmount.
50
- return () => {
51
- if (fallbackTimerRef.current) {
52
- clearTimeout(fallbackTimerRef.current);
53
- }
54
- };
55
- }, [signalReady]); // Run only once on mount.
56
- return null;
57
- };
58
- export const ScreenshotProvider = ({ children }) => {
59
- return (_jsxs(_Fragment, { children: [_jsx(ScreenshotReadySignaler, {}), children] }));
60
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=overlay-hmr.d.ts.map
@@ -1,27 +0,0 @@
1
- // Vite HMR build-error bridge.
2
- //
3
- // This file is served by vite (not embedded inline) so that vite's plugin
4
- // pipeline transforms `import.meta.hot` into a real hot-context — inline
5
- // `<script type="module">` blocks bypass that pipeline and `import.meta.hot`
6
- // stays `undefined`. The inline overlay runtime (overlay-runtime.ts) exposes
7
- // its helpers on `window.__fimoOverlay`, which we call here.
8
- function api() {
9
- if (typeof window === 'undefined') {
10
- return undefined;
11
- }
12
- return window.__fimoOverlay;
13
- }
14
- if (import.meta && import.meta.hot) {
15
- import.meta.hot.on('vite:error', (data) => {
16
- const a = api();
17
- if (!a)
18
- return;
19
- const d = a.getErrorDetails(data);
20
- a.mount();
21
- a.notify('Build Error', d.message, d.stack);
22
- });
23
- import.meta.hot.on('vite:afterUpdate', () => {
24
- api()?.unmount();
25
- });
26
- }
27
- export {};
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=overlay-runtime.d.ts.map
@@ -1,103 +0,0 @@
1
- const ID = 'fimo-error-overlay';
2
- function ensureStyles() {
3
- if (document.getElementById(ID + '-styles')) {
4
- return;
5
- }
6
- const s = document.createElement('style');
7
- s.id = ID + '-styles';
8
- s.textContent =
9
- 'vite-error-overlay, #vite-error-overlay, vite-overlay { display: none !important; }' +
10
- '#' +
11
- ID +
12
- ' { position: fixed; inset: 0; background: #000; z-index: 2147483647; display: none; }';
13
- document.head.appendChild(s);
14
- }
15
- function mountBlack() {
16
- ensureStyles();
17
- let el = document.getElementById(ID);
18
- if (!el) {
19
- el = document.createElement('div');
20
- el.id = ID;
21
- document.body.appendChild(el);
22
- }
23
- el.style.display = 'block';
24
- }
25
- function unmount() {
26
- const el = document.getElementById(ID);
27
- if (el) {
28
- el.style.display = 'none';
29
- }
30
- }
31
- function getErrorDetails(e) {
32
- try {
33
- // Preserve the original loose extraction logic but in typed form
34
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
- const anyErr = e && e.error ? e.error : e;
36
- let err = null;
37
- if (!anyErr) {
38
- err = null;
39
- }
40
- else if (anyErr.error) {
41
- err = anyErr.error;
42
- }
43
- else if (anyErr.reason) {
44
- err = anyErr.reason;
45
- }
46
- else if (anyErr.err) {
47
- err = anyErr.err;
48
- }
49
- else {
50
- err = anyErr;
51
- }
52
- const message = typeof err === 'string' ? err : err && err.message ? err.message : String(err || 'Unknown error');
53
- const stack = err && err.stack ? String(err.stack) : '';
54
- return { message, stack };
55
- }
56
- catch {
57
- return { message: 'Unknown error', stack: '' };
58
- }
59
- }
60
- function postToTargets(type, payload) {
61
- const data = { type, payload };
62
- try {
63
- if (window.parent && window.parent !== window) {
64
- window.parent.postMessage(data, '*');
65
- }
66
- }
67
- catch {
68
- // ignore
69
- }
70
- try {
71
- if (window.top && window.top !== window && window.top !== window.parent) {
72
- window.top.postMessage(data, '*');
73
- }
74
- }
75
- catch {
76
- // ignore
77
- }
78
- }
79
- function notify(heading, message, stack) {
80
- const payload = { heading, message, stack };
81
- // First, send a preview-level error so the parent can perform a minimal handshake
82
- // and lock onto the sandbox origin in build-error scenarios.
83
- postToTargets('preview/error', payload);
84
- // Then, send the existing app-level error used by the UI overlay.
85
- postToTargets('app/error', payload);
86
- }
87
- window.addEventListener('error', (e) => {
88
- const d = getErrorDetails(e);
89
- mountBlack();
90
- notify('Runtime Error', d.message, d.stack);
91
- });
92
- window.addEventListener('unhandledrejection', (e) => {
93
- const d = getErrorDetails(e);
94
- mountBlack();
95
- notify('Runtime Error', d.message, d.stack);
96
- });
97
- window.__fimoOverlay = {
98
- mount: mountBlack,
99
- unmount,
100
- notify,
101
- getErrorDetails,
102
- };
103
- export {};
@@ -1,22 +0,0 @@
1
- export { AppRoutesProvider } from './routing/AppRoutesProvider.js';
2
- export type { AppRoute, DisplayRoute, SlugInfo } from './routing/AppRoutesProvider.js';
3
- export { useLocale } from './i18n/FimoLocaleContext.js';
4
- export { localizeFimoPath, resolveFimoLocale } from './i18n/locale.js';
5
- export type { FimoLocaleContextValue } from './i18n/FimoLocaleContext.js';
6
- export type { FimoLocaleResolution } from './i18n/locale.js';
7
- export { DataSourcesProvider } from './content/DataSourcesProvider.js';
8
- export { RefreshContentProvider } from './content/RefreshContentProvider.js';
9
- export { parseCollectionResponse } from './content/parseCollectionResponse.js';
10
- export type { CollectionResponse } from './content/parseCollectionResponse.js';
11
- export { createContentClient } from './content/client/createContentClient.js';
12
- export { createSingletonClient } from './content/client/createSingletonClient.js';
13
- export { createFormClient, type FormClient, type FormSubmissionResult } from './forms/index.js';
14
- export declare const formClient: import("./index.js").FormClient;
15
- export type { CollectionContentClient, CollectionPage, CollectionPageInfo, ContentClientConfig, ContentClientHandle, ContentModuleMeta, ContentModuleRef, ContentReadOptions, ContentResult, ContentSchema, ContentSchemaField, InfiniteListResult, SingletonContentClient, } from './content/client/types.js';
16
- export { AppErrorBoundary } from './core/AppErrorBoundary.js';
17
- export { ViteLifecycles } from './core/ViteLifecycles.js';
18
- export { Pageview } from './t/Pageview.js';
19
- export { ConsoleErrorProvider } from './iframe/ConsoleErrorProvider.js';
20
- export { ScreenshotProvider } from './iframe/ScreenshotProvider.js';
21
- export * from './primitives/index.js';
22
- //# sourceMappingURL=index.d.ts.map
@@ -1,23 +0,0 @@
1
- import { viteContentRuntime } from './content/client/vite-runtime.js';
2
- import { createFormClient } from './forms/index.js';
3
- // Routing
4
- export { AppRoutesProvider } from './routing/AppRoutesProvider.js';
5
- export { useLocale } from './i18n/FimoLocaleContext.js';
6
- export { localizeFimoPath, resolveFimoLocale } from './i18n/locale.js';
7
- // Content
8
- export { DataSourcesProvider } from './content/DataSourcesProvider.js';
9
- export { RefreshContentProvider } from './content/RefreshContentProvider.js';
10
- export { parseCollectionResponse } from './content/parseCollectionResponse.js';
11
- export { createContentClient } from './content/client/createContentClient.js';
12
- export { createSingletonClient } from './content/client/createSingletonClient.js';
13
- export { createFormClient } from './forms/index.js';
14
- export const formClient = createFormClient(viteContentRuntime);
15
- // Core
16
- export { AppErrorBoundary } from './core/AppErrorBoundary.js';
17
- export { ViteLifecycles } from './core/ViteLifecycles.js';
18
- // Tracking
19
- export { Pageview } from './t/Pageview.js';
20
- // Iframe
21
- export { ConsoleErrorProvider } from './iframe/ConsoleErrorProvider.js';
22
- export { ScreenshotProvider } from './iframe/ScreenshotProvider.js';
23
- export * from './primitives/index.js';
@@ -1,3 +0,0 @@
1
- import { type ContentRuntime } from '../content/client/runtime.js';
2
- export declare const nextClientContentRuntime: ContentRuntime;
3
- //# sourceMappingURL=client-runtime.d.ts.map
@@ -1,24 +0,0 @@
1
- import { requireContentApiUrl } from '../content/client/runtime.js';
2
- export const nextClientContentRuntime = {
3
- apiBase() {
4
- return requireContentApiUrl(process.env.NEXT_PUBLIC_FIMO_API_URL, 'NEXT_PUBLIC_FIMO_API_URL');
5
- },
6
- defaultLocale() {
7
- // The application resolves locale from its own configuration and routes and
8
- // passes it through `FimoProvider`. `undefined` leaves `locale` off the
9
- // request so the API answers with the project default; an environment
10
- // variable must never become the project's source of truth for it.
11
- return undefined;
12
- },
13
- headers(extra) {
14
- const headers = { ...extra };
15
- const env = process.env.NEXT_PUBLIC_FIMO_ENV?.trim();
16
- if (env) {
17
- headers['X-Fimo-Env'] = env;
18
- }
19
- return headers;
20
- },
21
- fetch(input, init) {
22
- return globalThis.fetch(input, init);
23
- },
24
- };
@@ -1,28 +0,0 @@
1
- import type { CollectionContentClient, ContentClientConfig, SingletonContentClient } from '../content/client/types.js';
2
- export declare function createContentClient<T extends {
3
- id: string;
4
- }, TInput extends object>(config: ContentClientConfig): CollectionContentClient<T, TInput>;
5
- export declare function createSingletonClient<T extends {
6
- id: string;
7
- }, TInput extends object>(config: ContentClientConfig): SingletonContentClient<T, TInput>;
8
- export type { CollectionContentClient, InfiniteListResult, SingletonContentClient } from '../content/client/types.js';
9
- export { type FormClient, type FormSubmissionResult } from '../forms/index.js';
10
- export declare const formClient: import("./client.js").FormClient;
11
- export { createContentCore, createSingletonCore } from '../content/index.js';
12
- export type { CollectionContentCore, CollectionPage, CollectionPageInfo, ContentClientConfig, ContentClientHandle, ContentModuleMeta, ContentModuleRef, ContentReadOptions, ContentResult, ContentRuntime, ContentSchema, ContentSchemaField, SingletonContentCore, } from '../content/index.js';
13
- export { FIMO_PARTS, FIMO_SOURCE, FimoBoolean, FimoDate, FimoMedia, FimoRichText, FimoString, getFimoParts, getFimoSource, hasFimoSource, isFimoDate, isFimoString, } from '../content/index.js';
14
- export { Boolean } from '../react/primitives/editable/Boolean.js';
15
- export { Date } from '../react/primitives/editable/Date.js';
16
- export { DateTime } from '../react/primitives/editable/DateTime.js';
17
- export { Image } from '../react/primitives/editable/Image.js';
18
- export { Json } from '../react/primitives/editable/Json.js';
19
- export { RichText } from '../react/primitives/editable/RichText.js';
20
- export { StaticImage } from '../react/primitives/renderers/StaticImage.js';
21
- export { Text } from '../react/primitives/editable/Text.js';
22
- export { Video } from '../react/primitives/editable/Video.js';
23
- export type { BoolOps, DateOps, Field, Fields, FilterFor, FimoPart, FimoPolymorphicReference, FimoReference, FimoRichTextContent, FimoSource, NullOnlyOps, NumberOps, Populate, Populated, PopulatedResult, Projected, ProjectedWithPopulate, Query, ReferenceField, ReferenceMap, ScalarOps, Sort, SortField, StringOps, Where, WithReferences, } from '../content/index.js';
24
- export type { FimoRichTextComponents, FimoRichTextMarkProps, FimoRichTextNodeProps, } from '../react/primitives/contracts.js';
25
- export { FimoPreviewBridge, FimoProvider, useLabels } from './provider.js';
26
- export type { FimoPreviewBridgeProps, FimoProviderProps } from './provider.js';
27
- export type { Labels, LabelsSnapshot } from '../labels/core.js';
28
- //# sourceMappingURL=client.d.ts.map
@@ -1,25 +0,0 @@
1
- 'use client';
2
- import { createReactContentClient } from '../content/client/react-content-client.js';
3
- import { createReactSingletonClient } from '../content/client/react-singleton-client.js';
4
- import { createFormClient } from '../forms/index.js';
5
- import { nextClientContentRuntime } from './client-runtime.js';
6
- import { useNextContentLocale } from './provider.js';
7
- export function createContentClient(config) {
8
- return createReactContentClient(config, nextClientContentRuntime, useNextContentLocale);
9
- }
10
- export function createSingletonClient(config) {
11
- return createReactSingletonClient(config, nextClientContentRuntime, useNextContentLocale);
12
- }
13
- export const formClient = createFormClient(nextClientContentRuntime);
14
- export { createContentCore, createSingletonCore } from '../content/index.js';
15
- export { FIMO_PARTS, FIMO_SOURCE, FimoBoolean, FimoDate, FimoMedia, FimoRichText, FimoString, getFimoParts, getFimoSource, hasFimoSource, isFimoDate, isFimoString, } from '../content/index.js';
16
- export { Boolean } from '../react/primitives/editable/Boolean.js';
17
- export { Date } from '../react/primitives/editable/Date.js';
18
- export { DateTime } from '../react/primitives/editable/DateTime.js';
19
- export { Image } from '../react/primitives/editable/Image.js';
20
- export { Json } from '../react/primitives/editable/Json.js';
21
- export { RichText } from '../react/primitives/editable/RichText.js';
22
- export { StaticImage } from '../react/primitives/renderers/StaticImage.js';
23
- export { Text } from '../react/primitives/editable/Text.js';
24
- export { Video } from '../react/primitives/editable/Video.js';
25
- export { FimoPreviewBridge, FimoProvider, useLabels } from './provider.js';
@@ -1,8 +0,0 @@
1
- import type { ContentClientHandle } from '../content/client/core-types.js';
2
- export type NextContentRegistry = Readonly<Record<string, ContentClientHandle>>;
3
- export interface CreateFimoOptions<TContent extends NextContentRegistry> {
4
- content: TContent;
5
- locale?: string;
6
- }
7
- export declare function createFimo<const TContent extends NextContentRegistry>({ content, locale, }: CreateFimoOptions<TContent>): TContent;
8
- //# sourceMappingURL=facade.d.ts.map
@@ -1,34 +0,0 @@
1
- function withLocale(options, locale) {
2
- return { ...options, locale: options?.locale ?? locale };
3
- }
4
- function isCollectionClient(client) {
5
- return 'list' in client && typeof client.list === 'function';
6
- }
7
- function isSingletonClient(client) {
8
- return 'get' in client && typeof client.get === 'function';
9
- }
10
- function bindLocale(client, locale) {
11
- if (isCollectionClient(client)) {
12
- return {
13
- ...client,
14
- getById: (id, options) => client.getById(id, withLocale(options, locale)),
15
- getBySlug: (slug, options) => client.getBySlug(slug, withLocale(options, locale)),
16
- getByField: (fieldName, value, options) => client.getByField(fieldName, value, withLocale(options, locale)),
17
- list: (params) => client.list(withLocale(params, locale)),
18
- get: (params) => client.get(withLocale(params, locale)),
19
- };
20
- }
21
- if (isSingletonClient(client)) {
22
- return {
23
- ...client,
24
- get: (options) => client.get(withLocale(options, locale)),
25
- };
26
- }
27
- return client;
28
- }
29
- export function createFimo({ content, locale, }) {
30
- if (locale === undefined) {
31
- return content;
32
- }
33
- return Object.fromEntries(Object.entries(content).map(([key, client]) => [key, bindLocale(client, locale)]));
34
- }
@@ -1,7 +0,0 @@
1
- import { type GetLabelsOptions } from '../labels/fetch.js';
2
- /**
3
- * Read the labels for an application-resolved locale. When omitted, the request
4
- * carries no locale and the Fimo API answers with the project default locale.
5
- */
6
- export declare function getLabels(options?: GetLabelsOptions): Promise<import("./client.js").Labels>;
7
- //# sourceMappingURL=labels.d.ts.map
@@ -1,9 +0,0 @@
1
- import { fetchLabels } from '../labels/fetch.js';
2
- import { nextServerContentRuntime } from './server-runtime.js';
3
- /**
4
- * Read the labels for an application-resolved locale. When omitted, the request
5
- * carries no locale and the Fimo API answers with the project default locale.
6
- */
7
- export function getLabels(options) {
8
- return fetchLabels(nextServerContentRuntime, options);
9
- }
@@ -1,13 +0,0 @@
1
- interface NextPreviewBrowser {
2
- readonly window: Pick<Window, 'addEventListener' | 'location' | 'parent' | 'removeEventListener' | 'sessionStorage'>;
3
- readonly document: Pick<Document, 'referrer'>;
4
- }
5
- type NextPreviewConnection = {
6
- readonly locale: string;
7
- readonly navigate: (to: string) => unknown;
8
- readonly pathname: string;
9
- readonly previewScriptUrl: string | undefined;
10
- };
11
- export declare function connectNextPreview({ locale, navigate, pathname, previewScriptUrl }: NextPreviewConnection, browser?: NextPreviewBrowser): () => void;
12
- export {};
13
- //# sourceMappingURL=preview.d.ts.map
@@ -1,34 +0,0 @@
1
- import { getSafePreviewNavigationPath, isPreviewRuntimeEnabled } from '../preview/bridge.js';
2
- import { getPreviewLocationChange, getPreviewParentOrigin } from '../preview/location.js';
3
- export function connectNextPreview({ locale, navigate, pathname, previewScriptUrl }, browser = { window, document }) {
4
- if (!isPreviewRuntimeEnabled(previewScriptUrl)) {
5
- return () => undefined;
6
- }
7
- const parentOrigin = getPreviewParentOrigin(browser);
8
- const sendLocationChange = () => {
9
- browser.window.parent.postMessage({
10
- type: 'nav/locationChange',
11
- payload: getPreviewLocationChange({ pathname, search: browser.window.location.search, hash: browser.window.location.hash }, locale, parentOrigin),
12
- }, parentOrigin ?? '*');
13
- };
14
- const handleMessage = (event) => {
15
- if (event.source !== browser.window.parent || !parentOrigin || event.origin !== parentOrigin) {
16
- return;
17
- }
18
- if (event.data?.type === 'nav/navigate') {
19
- const target = getSafePreviewNavigationPath(event.data?.payload?.to, browser.window.location.origin);
20
- if (target) {
21
- navigate(target);
22
- }
23
- return;
24
- }
25
- if (event.data?.type === 'nav/read-routes') {
26
- sendLocationChange();
27
- }
28
- };
29
- browser.window.addEventListener('message', handleMessage);
30
- sendLocationChange();
31
- return () => {
32
- browser.window.removeEventListener('message', handleMessage);
33
- };
34
- }
@@ -1,10 +0,0 @@
1
- import { type ElementType } from 'react';
2
- import type { TextProps } from '../../react/primitives/contracts.js';
3
- /**
4
- * Server-safe text primitive for Next.js Server Components.
5
- *
6
- * It intentionally shares the same public props as the interactive React
7
- * primitive while rendering source metadata without client hooks.
8
- */
9
- export declare function Text<T extends ElementType = 'span'>({ value, as, children, ...props }: TextProps<T>): import("react/jsx-runtime").JSX.Element;
10
- //# sourceMappingURL=Text.d.ts.map
@@ -1,18 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Fragment } from 'react';
3
- import { getFimoParts, getFimoSource } from '../../content/index.js';
4
- /**
5
- * Server-safe text primitive for Next.js Server Components.
6
- *
7
- * It intentionally shares the same public props as the interactive React
8
- * primitive while rendering source metadata without client hooks.
9
- */
10
- export function Text({ value, as, children, ...props }) {
11
- const Component = as || 'span';
12
- const parts = getFimoParts(value);
13
- if (parts && parts.length > 1 && !children) {
14
- return (_jsx(Component, { ...props, children: parts.map((part, index) => part.source ? (_jsx("span", { "data-fimo-source": part.source, children: part.text }, index)) : (_jsx(Fragment, { children: part.text }, index))) }));
15
- }
16
- const text = String(value);
17
- return (_jsx(Component, { ...props, "data-fimo-source": getFimoSource(value), children: children ? children(text) : text }));
18
- }
@@ -1,11 +0,0 @@
1
- import { type ElementType } from 'react';
2
- import type { BooleanProps, DateProps, ImageProps, JsonProps, RichTextProps, VideoProps } from '../../react/primitives/contracts.js';
3
- export declare function Boolean<T extends ElementType = 'span'>({ value, as, children, ...props }: BooleanProps<T>): import("react/jsx-runtime").JSX.Element | null;
4
- export declare function Date({ value, ...props }: DateProps): import("react/jsx-runtime").JSX.Element | null;
5
- /** Renders a `datetime` field: the `dateTime` attribute keeps the whole instant. */
6
- export declare function DateTime({ value, ...props }: DateProps): import("react/jsx-runtime").JSX.Element | null;
7
- export declare function Image(props: ImageProps): import("react/jsx-runtime").JSX.Element | null;
8
- export declare function Json<T extends ElementType = 'span'>({ value, as, children, ...props }: JsonProps<T>): import("react/jsx-runtime").JSX.Element | null;
9
- export declare function RichText({ value, components, ...props }: RichTextProps): import("react/jsx-runtime").JSX.Element | null;
10
- export declare function Video(props: VideoProps): import("react/jsx-runtime").JSX.Element | null;
11
- //# sourceMappingURL=server.d.ts.map
@@ -1,54 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { FIMO_SOURCE, getFimoSource } from '../../content/index.js';
3
- import { DateRenderer } from '../../react/primitives/renderers/DateRenderer.js';
4
- import { ImageRenderer } from '../../react/primitives/renderers/ImageRenderer.js';
5
- import { RichTextRenderer } from '../../react/primitives/renderers/RichTextRenderer.js';
6
- import { VideoRenderer } from '../../react/primitives/renderers/VideoRenderer.js';
7
- export function Boolean({ value, as, children, ...props }) {
8
- if (!value) {
9
- return null;
10
- }
11
- const Component = as || 'span';
12
- const booleanValue = value.valueOf();
13
- return (_jsx(Component, { ...props, "data-fimo-source": value[FIMO_SOURCE], children: children ? children(booleanValue) : String(booleanValue) }));
14
- }
15
- export function Date({ value, ...props }) {
16
- if (!value) {
17
- return null;
18
- }
19
- const source = typeof value === 'object' && FIMO_SOURCE in value ? (value[FIMO_SOURCE] ?? undefined) : undefined;
20
- return _jsx(DateRenderer, { ...props, value: value, source: source });
21
- }
22
- /** Renders a `datetime` field: the `dateTime` attribute keeps the whole instant. */
23
- export function DateTime({ value, ...props }) {
24
- if (!value) {
25
- return null;
26
- }
27
- const source = typeof value === 'object' && FIMO_SOURCE in value ? (value[FIMO_SOURCE] ?? undefined) : undefined;
28
- return _jsx(DateRenderer, { ...props, value: value, source: source, precision: "instant" });
29
- }
30
- export function Image(props) {
31
- if (!props.value) {
32
- return null;
33
- }
34
- return _jsx(ImageRenderer, { ...props });
35
- }
36
- export function Json({ value, as, children, ...props }) {
37
- if (value === null || value === undefined) {
38
- return null;
39
- }
40
- const Component = as || 'span';
41
- return (_jsx(Component, { ...props, "data-fimo-source": getFimoSource(value), children: children ? children(value) : JSON.stringify(value) }));
42
- }
43
- export function RichText({ value, components, ...props }) {
44
- if (!value) {
45
- return null;
46
- }
47
- return _jsx(RichTextRenderer, { ...props, document: value.content, source: value[FIMO_SOURCE], components: components });
48
- }
49
- export function Video(props) {
50
- if (!props.value) {
51
- return null;
52
- }
53
- return _jsx(VideoRenderer, { ...props });
54
- }
@@ -1,18 +0,0 @@
1
- import { QueryClient } from '@tanstack/react-query';
2
- import { type ReactNode } from 'react';
3
- import { type Labels, type LabelsSnapshot } from '../labels/core.js';
4
- export interface FimoProviderProps {
5
- children: ReactNode;
6
- labels?: LabelsSnapshot;
7
- locale?: string;
8
- queryClient?: QueryClient;
9
- }
10
- export declare function FimoProvider({ children, labels, locale, queryClient }: FimoProviderProps): import("react/jsx-runtime").JSX.Element;
11
- export interface FimoPreviewBridgeProps {
12
- readonly navigate: (to: string) => unknown;
13
- readonly pathname: string;
14
- }
15
- export declare function FimoPreviewBridge({ navigate, pathname }: FimoPreviewBridgeProps): ReactNode;
16
- export declare function useNextContentLocale(requestedLocale: string | undefined, defaultLocale: string): string;
17
- export declare function useLabels(): Labels;
18
- //# sourceMappingURL=provider.d.ts.map
@@ -1,39 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
4
- import { createContext, useContext, useEffect, useMemo, useState } from 'react';
5
- import { createLabels } from '../labels/core.js';
6
- import { connectNextPreview } from './preview.js';
7
- /**
8
- * Last resort when an application renders `FimoProvider` without a locale and
9
- * without labels. The project's default locale lives in
10
- * `.fimo/config.json#i18n.defaultLocale`, which the application reads and passes
11
- * in; no environment variable participates.
12
- */
13
- const UNRESOLVED_LOCALE = 'en';
14
- const FimoNextContext = createContext({});
15
- export function FimoProvider({ children, labels, locale, queryClient }) {
16
- const [client] = useState(() => queryClient ?? new QueryClient());
17
- const activeLocale = locale?.trim() || labels?.locale;
18
- const value = useMemo(() => ({ labels, locale: activeLocale }), [activeLocale, labels]);
19
- return (_jsx(FimoNextContext.Provider, { value: value, children: _jsx(QueryClientProvider, { client: client, children: children }) }));
20
- }
21
- export function FimoPreviewBridge({ navigate, pathname }) {
22
- const context = useContext(FimoNextContext);
23
- const locale = context.locale ?? UNRESOLVED_LOCALE;
24
- const previewScriptUrl = process.env.NEXT_PUBLIC_FIMO_PREVIEW_SCRIPT_URL;
25
- useEffect(() => connectNextPreview({ locale, navigate, pathname, previewScriptUrl }), [locale, navigate, pathname, previewScriptUrl]);
26
- return null;
27
- }
28
- export function useNextContentLocale(requestedLocale, defaultLocale) {
29
- const context = useContext(FimoNextContext);
30
- return requestedLocale ?? context.locale ?? defaultLocale;
31
- }
32
- export function useLabels() {
33
- const context = useContext(FimoNextContext);
34
- const locale = context.locale ?? UNRESOLVED_LOCALE;
35
- const snapshot = context.labels?.locale === locale
36
- ? context.labels
37
- : { locale, labels: {}, updatedAt: null };
38
- return useMemo(() => createLabels(snapshot), [snapshot]);
39
- }
@@ -1,3 +0,0 @@
1
- import { type ContentRuntime } from '../content/client/runtime.js';
2
- export declare const nextServerContentRuntime: ContentRuntime;
3
- //# sourceMappingURL=server-runtime.d.ts.map
@@ -1,23 +0,0 @@
1
- import { requireContentApiUrl } from '../content/client/runtime.js';
2
- export const nextServerContentRuntime = {
3
- apiBase() {
4
- return requireContentApiUrl(process.env.FIMO_CONTENT_API_URL, 'FIMO_CONTENT_API_URL');
5
- },
6
- defaultLocale() {
7
- // `undefined` leaves `locale` off the request so the tenant API answers with
8
- // the project default declared in `.fimo/config.json#i18n.defaultLocale`.
9
- // Route-resolved locales reach Fimo through `createFimo`/`getLabels`.
10
- return undefined;
11
- },
12
- headers(extra) {
13
- const headers = { ...extra };
14
- const env = process.env.FIMO_ENV?.trim();
15
- if (env) {
16
- headers['X-Fimo-Env'] = env;
17
- }
18
- return headers;
19
- },
20
- fetch(input, init) {
21
- return globalThis.fetch(input, init);
22
- },
23
- };