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.
- package/README.md +1 -1
- package/assets/agent-templates/_default/GOAL.md +10 -0
- package/assets/agent-templates/_default/capabilities.yaml +10 -0
- package/assets/content-templates/shared/types.eta +1 -1
- package/assets/skills/fimo-cli/SKILL.md +2 -1
- package/assets/skills/fimo-cli/references/agents.md +136 -36
- package/assets/skills/fimo-cli/references/branches.md +8 -5
- package/assets/skills/fimo-cli/references/deploy.md +11 -2
- package/assets/skills/fimo-cli/references/domains.md +12 -0
- package/assets/skills/fimo-cli/references/forms.md +1 -1
- package/assets/skills/fimo-cli/references/init.md +9 -2
- package/assets/skills/fimo-cli/references/locales.md +1 -1
- package/assets/skills/fimo-cli/references/mcp.md +1 -1
- package/assets/skills/fimo-cli/references/media.md +18 -1
- package/assets/skills/fimo-cli/references/project-vars-and-secrets.md +3 -1
- package/assets/skills/fimo-cli/references/projects.md +7 -7
- package/assets/skills/fimo-code/assets/react-router-locales/navigation.tsx +1 -1
- package/assets/skills/fimo-code/references/assets.md +2 -2
- package/assets/skills/fimo-code/references/best-practices/next.md +1 -1
- package/assets/skills/fimo-code/references/content/schema.md +23 -0
- package/assets/skills/fimo-code/references/forms.md +1 -1
- package/assets/skills/fimo-code/references/frameworks/astro.md +8 -2
- package/assets/skills/fimo-code/references/frameworks/compatibility.md +9 -9
- package/assets/skills/fimo-code/references/frameworks/hosting.md +17 -13
- package/assets/skills/fimo-code/references/frameworks/next/app-router.md +8 -9
- package/assets/skills/fimo-code/references/frameworks/next/locales.md +5 -5
- package/assets/skills/fimo-code/references/frameworks/next/pages-router.md +5 -5
- package/assets/skills/fimo-code/references/frameworks/next.md +41 -32
- package/assets/skills/fimo-code/references/frameworks/react-router.md +10 -7
- package/assets/skills/fimo-code/references/frameworks/sveltekit.md +22 -15
- package/assets/skills/fimo-code/references/frameworks/vite-react.md +7 -5
- package/assets/skills/fimo-code/references/labels.md +4 -4
- package/assets/skills/fimo-code/references/locales.md +2 -2
- package/assets/skills/fimo-code/references/ui.md +4 -4
- package/assets/skills/fimo-migration/SKILL.md +51 -30
- package/assets/skills/fimo-migration/references/frameworks/nextjs.md +12 -15
- package/assets/skills/fimo-migration/references/media.md +12 -8
- package/assets/skills/fimo-migration/references/qa.md +12 -11
- package/assets/skills/fimo-migration/references/workers/content-planner.md +33 -4
- package/assets/skills/fimo-migration/references/workers/validator.md +10 -0
- package/assets/skills/fimo-migration/references/workers.md +19 -10
- package/assets/skills/fimo-migration/references/workflow.md +29 -11
- package/assets/skills/fimo-studio/references/ai-chat.md +1 -1
- package/assets/skills/fimo-studio/references/billing-and-credits.md +18 -1
- package/assets/skills/fimo-studio/references/cms.md +2 -0
- package/assets/skills/fimo-studio/references/preview-and-responsive.md +1 -0
- package/assets/starters/fimo-site/template/src/pages/Contact.tsx +1 -1
- package/assets/starters/fimo-site/template/src/pages/SiteContent.tsx +1 -1
- package/assets/starters/fimo-site/template/src/schemas/HomePage.ts +3 -3
- package/assets/starters/fimo-site/template/src/schemas/HomePage.types.ts +1 -1
- package/dist/build/astro/config.d.ts +13 -2
- package/dist/build/astro/config.js +9 -24
- package/dist/build/next/moved.d.ts +2 -0
- package/dist/build/next/moved.js +2 -0
- package/dist/build/react/router-moved.d.ts +2 -0
- package/dist/build/react/router-moved.js +2 -0
- package/dist/build/react/router-preset-moved.d.ts +2 -0
- package/dist/build/react/router-preset-moved.js +2 -0
- package/dist/build/react/router-routes-moved.d.ts +2 -0
- package/dist/build/react/router-routes-moved.js +2 -0
- package/dist/build/react/ui-moved.d.ts +2 -0
- package/dist/build/react/ui-moved.js +2 -0
- package/dist/build/react/vite-moved.d.ts +2 -0
- package/dist/build/react/vite-moved.js +2 -0
- package/dist/build/sveltekit/config.d.ts +5 -4
- package/dist/build/sveltekit/config.js +6 -15
- package/dist/build/sveltekit/moved.d.ts +13 -0
- package/dist/build/sveltekit/moved.js +3 -0
- package/dist/build/vite/data-id.d.ts +11 -0
- package/dist/build/vite/data-id.js +20 -0
- package/dist/build/vite/plugins/runtime-env.d.ts +1 -1
- package/dist/build/vite/plugins/runtime-env.js +6 -2
- package/dist/build/vite/runtime-env.d.ts +2 -0
- package/dist/build/vite/runtime-env.js +1 -0
- package/dist/cli/bundle.json +1 -1
- package/dist/cli/index.js +115 -110
- package/dist/runtime/content/client/internal.js +1 -1
- package/dist/runtime/content/index.d.ts +6 -1
- package/dist/runtime/content/index.js +6 -0
- package/dist/runtime/i18n/index.d.ts +2 -0
- package/dist/runtime/i18n/index.js +1 -0
- package/dist/runtime/labels/index.d.ts +3 -0
- package/dist/runtime/labels/index.js +2 -0
- package/dist/runtime/preview/index.d.ts +5 -0
- package/dist/runtime/preview/index.js +4 -0
- package/dist/runtime/preview/script.d.ts +3 -0
- package/dist/runtime/preview/script.js +14 -0
- package/dist/runtime/primitives/lib/index.d.ts +2 -0
- package/dist/runtime/primitives/lib/index.js +2 -0
- package/dist/runtime/seo/index.d.ts +0 -8
- package/dist/runtime/seo/index.js +0 -8
- package/dist/runtime/shared/config.d.ts +6 -0
- package/dist/runtime/shared/config.js +4 -0
- package/dist/runtime/shared/local-runtime-env.d.ts +2 -2
- package/dist/runtime/shared/local-runtime-env.js +7 -5
- package/dist/runtime/templates.d.ts +20 -4
- package/dist/runtime/templates.js +60 -18
- package/dist/scripts/extract-translations.js +8 -3
- package/dist/scripts/index.d.ts +3 -0
- package/dist/scripts/index.js +2 -0
- package/dist/scripts/sync-forms.js +21 -9
- package/dist/scripts/sync-schemas.js +129 -21
- package/dist/scripts/validate-schemas.js +63 -2
- package/package.json +72 -71
- package/release.json +2 -2
- package/templates/astro/AGENTS.md +1 -1
- package/templates/astro/astro.config.mjs +1 -1
- package/templates/astro/package.json +4 -2
- package/templates/astro/pnpm-workspace.yaml +6 -2
- package/templates/nextjs/.fimo/config.json +1 -2
- package/templates/nextjs/AGENTS.md +6 -16
- package/templates/nextjs/next.config.ts +4 -2
- package/templates/nextjs/package.json +4 -2
- package/templates/nextjs/pnpm-workspace.yaml +6 -2
- package/templates/nextjs/src/app/layout.tsx +16 -0
- package/templates/nextjs/src/locales.ts +3 -6
- package/templates/react-router/AGENTS.md +1 -1
- package/templates/react-router/package.json +5 -2
- package/templates/react-router/pnpm-workspace.yaml +6 -6
- package/templates/react-router/react-router.config.ts +1 -1
- package/templates/react-router/src/pages/legal/LegalPage.tsx +1 -1
- package/templates/react-router/src/root.tsx +1 -1
- package/templates/react-router/src/vite-env.d.ts +0 -1
- package/templates/react-router/vite.config.ts +1 -1
- package/templates/sveltekit/AGENTS.md +1 -1
- package/templates/sveltekit/package.json +4 -2
- package/templates/sveltekit/pnpm-workspace.yaml +6 -2
- package/templates/sveltekit/src/routes/+layout.server.ts +1 -1
- package/templates/sveltekit/src/routes/+layout.svelte +1 -1
- package/templates/sveltekit/svelte.config.js +1 -1
- package/templates/sveltekit/vite.config.ts +1 -1
- package/assets/sveltekit/components/Boolean.svelte +0 -19
- package/assets/sveltekit/components/Date.svelte +0 -33
- package/assets/sveltekit/components/DateTime.svelte +0 -35
- package/assets/sveltekit/components/FimoProvider.svelte +0 -35
- package/assets/sveltekit/components/Image.svelte +0 -80
- package/assets/sveltekit/components/Json.svelte +0 -18
- package/assets/sveltekit/components/Label.svelte +0 -16
- package/assets/sveltekit/components/Number.svelte +0 -21
- package/assets/sveltekit/components/RichText.svelte +0 -19
- package/assets/sveltekit/components/Text.svelte +0 -30
- package/assets/sveltekit/components/Video.svelte +0 -37
- package/assets/sveltekit/components/index.d.ts +0 -11
- package/assets/sveltekit/components/index.js +0 -11
- package/dist/build/next/config.d.ts +0 -17
- package/dist/build/next/config.js +0 -66
- package/dist/build/sveltekit/data-id.d.ts +0 -3
- package/dist/build/sveltekit/data-id.js +0 -171
- package/dist/build/sveltekit/files/edge.js +0 -68
- package/dist/build/sveltekit/files/serverless.js +0 -42
- package/dist/build/sveltekit/vite.d.ts +0 -12
- package/dist/build/sveltekit/vite.js +0 -14
- package/dist/build/vite/index.d.ts +0 -42
- package/dist/build/vite/index.js +0 -160
- package/dist/build/vite/plugins/content-sync.d.ts +0 -11
- package/dist/build/vite/plugins/content-sync.js +0 -41
- package/dist/build/vite/plugins/data-id.d.ts +0 -12
- package/dist/build/vite/plugins/data-id.js +0 -109
- package/dist/build/vite/plugins/fimo-config.d.ts +0 -12
- package/dist/build/vite/plugins/fimo-config.js +0 -68
- package/dist/build/vite/plugins/overlay.d.ts +0 -3
- package/dist/build/vite/plugins/overlay.js +0 -154
- package/dist/build/vite/plugins/robots.d.ts +0 -10
- package/dist/build/vite/plugins/robots.js +0 -56
- package/dist/build/vite/plugins/seo.d.ts +0 -3
- package/dist/build/vite/plugins/seo.js +0 -112
- package/dist/build/vite/plugins/server-config.d.ts +0 -3
- package/dist/build/vite/plugins/server-config.js +0 -36
- package/dist/build/vite/plugins/sitemap.d.ts +0 -3
- package/dist/build/vite/plugins/sitemap.js +0 -73
- package/dist/build/vite/plugins/translations.d.ts +0 -11
- package/dist/build/vite/plugins/translations.js +0 -601
- package/dist/runtime/app/FimoProviders.d.ts +0 -30
- package/dist/runtime/app/FimoProviders.js +0 -186
- package/dist/runtime/app/FimoScripts.d.ts +0 -14
- package/dist/runtime/app/FimoScripts.js +0 -48
- package/dist/runtime/app/index.d.ts +0 -8
- package/dist/runtime/app/index.js +0 -4
- package/dist/runtime/app/prefetch.d.ts +0 -9
- package/dist/runtime/app/prefetch.js +0 -39
- package/dist/runtime/content/DataSourcesProvider.d.ts +0 -4
- package/dist/runtime/content/DataSourcesProvider.js +0 -63
- package/dist/runtime/content/RefreshContentProvider.d.ts +0 -19
- package/dist/runtime/content/RefreshContentProvider.js +0 -71
- package/dist/runtime/content/client/createContentClient.d.ts +0 -7
- package/dist/runtime/content/client/createContentClient.js +0 -7
- package/dist/runtime/content/client/createSingletonClient.d.ts +0 -5
- package/dist/runtime/content/client/createSingletonClient.js +0 -6
- package/dist/runtime/content/client/react-content-client.d.ts +0 -10
- package/dist/runtime/content/client/react-content-client.js +0 -165
- package/dist/runtime/content/client/react-singleton-client.d.ts +0 -7
- package/dist/runtime/content/client/react-singleton-client.js +0 -38
- package/dist/runtime/content/client/types.d.ts +0 -42
- package/dist/runtime/content/client/types.js +0 -1
- package/dist/runtime/content/client/useQueryLocale.d.ts +0 -2
- package/dist/runtime/content/client/useQueryLocale.js +0 -5
- package/dist/runtime/content/client/vite-runtime.d.ts +0 -3
- package/dist/runtime/content/client/vite-runtime.js +0 -23
- package/dist/runtime/content/utils/retrieve-data-sources.d.ts +0 -29
- package/dist/runtime/content/utils/retrieve-data-sources.js +0 -107
- package/dist/runtime/core/AppErrorBoundary.d.ts +0 -10
- package/dist/runtime/core/AppErrorBoundary.js +0 -27
- package/dist/runtime/core/ViteLifecycles.d.ts +0 -5
- package/dist/runtime/core/ViteLifecycles.js +0 -35
- package/dist/runtime/i18n/FimoLocaleContext.d.ts +0 -9
- package/dist/runtime/i18n/FimoLocaleContext.js +0 -17
- package/dist/runtime/iframe/ConsoleErrorProvider.d.ts +0 -3
- package/dist/runtime/iframe/ConsoleErrorProvider.js +0 -103
- package/dist/runtime/iframe/ScreenshotProvider.d.ts +0 -3
- package/dist/runtime/iframe/ScreenshotProvider.js +0 -60
- package/dist/runtime/iframe/runtime/overlay-hmr.d.ts +0 -2
- package/dist/runtime/iframe/runtime/overlay-hmr.js +0 -27
- package/dist/runtime/iframe/runtime/overlay-runtime.d.ts +0 -2
- package/dist/runtime/iframe/runtime/overlay-runtime.js +0 -103
- package/dist/runtime/index.d.ts +0 -22
- package/dist/runtime/index.js +0 -23
- package/dist/runtime/next/client-runtime.d.ts +0 -3
- package/dist/runtime/next/client-runtime.js +0 -24
- package/dist/runtime/next/client.d.ts +0 -28
- package/dist/runtime/next/client.js +0 -25
- package/dist/runtime/next/facade.d.ts +0 -8
- package/dist/runtime/next/facade.js +0 -34
- package/dist/runtime/next/labels.d.ts +0 -7
- package/dist/runtime/next/labels.js +0 -9
- package/dist/runtime/next/preview.d.ts +0 -13
- package/dist/runtime/next/preview.js +0 -34
- package/dist/runtime/next/primitives/Text.d.ts +0 -10
- package/dist/runtime/next/primitives/Text.js +0 -18
- package/dist/runtime/next/primitives/server.d.ts +0 -11
- package/dist/runtime/next/primitives/server.js +0 -54
- package/dist/runtime/next/provider.d.ts +0 -18
- package/dist/runtime/next/provider.js +0 -39
- package/dist/runtime/next/server-runtime.d.ts +0 -3
- package/dist/runtime/next/server-runtime.js +0 -23
- package/dist/runtime/next/server.d.ts +0 -21
- package/dist/runtime/next/server.js +0 -16
- package/dist/runtime/primitives/index.d.ts +0 -16
- package/dist/runtime/primitives/index.js +0 -17
- package/dist/runtime/react/primitives/contracts.d.ts +0 -94
- package/dist/runtime/react/primitives/contracts.js +0 -1
- package/dist/runtime/react/primitives/editable/Boolean.d.ts +0 -5
- package/dist/runtime/react/primitives/editable/Boolean.js +0 -11
- package/dist/runtime/react/primitives/editable/Date.d.ts +0 -4
- package/dist/runtime/react/primitives/editable/Date.js +0 -12
- package/dist/runtime/react/primitives/editable/DateTime.d.ts +0 -4
- package/dist/runtime/react/primitives/editable/DateTime.js +0 -13
- package/dist/runtime/react/primitives/editable/Image.d.ts +0 -4
- package/dist/runtime/react/primitives/editable/Image.js +0 -10
- package/dist/runtime/react/primitives/editable/Json.d.ts +0 -5
- package/dist/runtime/react/primitives/editable/Json.js +0 -11
- package/dist/runtime/react/primitives/editable/RichText.d.ts +0 -4
- package/dist/runtime/react/primitives/editable/RichText.js +0 -11
- package/dist/runtime/react/primitives/editable/Text.d.ts +0 -20
- package/dist/runtime/react/primitives/editable/Text.js +0 -36
- package/dist/runtime/react/primitives/editable/Video.d.ts +0 -4
- package/dist/runtime/react/primitives/editable/Video.js +0 -10
- package/dist/runtime/react/primitives/renderers/DateRenderer.d.ts +0 -17
- package/dist/runtime/react/primitives/renderers/DateRenderer.js +0 -17
- package/dist/runtime/react/primitives/renderers/ImageRenderer.d.ts +0 -8
- package/dist/runtime/react/primitives/renderers/ImageRenderer.js +0 -31
- package/dist/runtime/react/primitives/renderers/RichTextRenderer.d.ts +0 -12
- package/dist/runtime/react/primitives/renderers/RichTextRenderer.js +0 -135
- package/dist/runtime/react/primitives/renderers/StaticImage.d.ts +0 -35
- package/dist/runtime/react/primitives/renderers/StaticImage.js +0 -58
- package/dist/runtime/react/primitives/renderers/VideoRenderer.d.ts +0 -8
- package/dist/runtime/react/primitives/renderers/VideoRenderer.js +0 -10
- package/dist/runtime/react/useFimoLiveValue.d.ts +0 -20
- package/dist/runtime/react/useFimoLiveValue.js +0 -43
- package/dist/runtime/react-router/active-routes.d.ts +0 -12
- package/dist/runtime/react-router/active-routes.js +0 -60
- package/dist/runtime/react-router/index.d.ts +0 -16
- package/dist/runtime/react-router/index.js +0 -20
- package/dist/runtime/react-router/legacy/routes.d.ts +0 -35
- package/dist/runtime/react-router/legacy/routes.js +0 -86
- package/dist/runtime/react-router/navigation-utils.d.ts +0 -8
- package/dist/runtime/react-router/navigation-utils.js +0 -36
- package/dist/runtime/react-router/navigation.d.ts +0 -12
- package/dist/runtime/react-router/navigation.js +0 -28
- package/dist/runtime/react-router/preset.d.ts +0 -30
- package/dist/runtime/react-router/preset.js +0 -33
- package/dist/runtime/routing/AppResetScrollOnNavigate.d.ts +0 -2
- package/dist/runtime/routing/AppResetScrollOnNavigate.js +0 -12
- package/dist/runtime/routing/AppRoutesProvider.d.ts +0 -25
- package/dist/runtime/routing/AppRoutesProvider.js +0 -112
- package/dist/runtime/seo/buildSeoForPath.d.ts +0 -74
- package/dist/runtime/seo/buildSeoForPath.js +0 -55
- package/dist/runtime/seo/htmlProps.d.ts +0 -13
- package/dist/runtime/seo/htmlProps.js +0 -15
- package/dist/runtime/sveltekit/content.d.ts +0 -25
- package/dist/runtime/sveltekit/content.js +0 -33
- package/dist/runtime/sveltekit/context-contract.d.ts +0 -5
- package/dist/runtime/sveltekit/context-contract.js +0 -2
- package/dist/runtime/sveltekit/context.d.ts +0 -8
- package/dist/runtime/sveltekit/context.js +0 -25
- package/dist/runtime/sveltekit/forms.d.ts +0 -15
- package/dist/runtime/sveltekit/forms.js +0 -15
- package/dist/runtime/sveltekit/index.d.ts +0 -9
- package/dist/runtime/sveltekit/index.js +0 -5
- package/dist/runtime/sveltekit/internal.d.ts +0 -6
- package/dist/runtime/sveltekit/internal.js +0 -12
- package/dist/runtime/sveltekit/labels.d.ts +0 -20
- package/dist/runtime/sveltekit/labels.js +0 -13
- package/dist/runtime/sveltekit/preview.d.ts +0 -28
- package/dist/runtime/sveltekit/preview.js +0 -82
- package/dist/runtime/sveltekit/runtime.d.ts +0 -9
- package/dist/runtime/sveltekit/runtime.js +0 -26
- package/dist/runtime/t/OptionalTracking.d.ts +0 -13
- package/dist/runtime/t/OptionalTracking.js +0 -28
- package/dist/runtime/t/Pageview.d.ts +0 -9
- package/dist/runtime/t/Pageview.js +0 -118
- package/dist/runtime/vite/Label.d.ts +0 -13
- package/dist/runtime/vite/Label.js +0 -16
- package/dist/runtime/vite/primitives/Images.d.ts +0 -4
- package/dist/runtime/vite/primitives/Images.js +0 -12
- package/dist/runtime/vite/translations.d.ts +0 -28
- package/dist/runtime/vite/translations.js +0 -103
- package/templates/nextjs/src/app/(default)/layout.tsx +0 -10
- package/templates/nextjs/src/app/[locale]/layout.tsx +0 -22
- package/templates/nextjs/src/app/[locale]/page.tsx +0 -1
- package/templates/nextjs/src/components/Document.tsx +0 -26
- package/templates/nextjs/src/components/FimoPreviewBridge.tsx +0 -13
- /package/templates/nextjs/src/app/{(default)/page.tsx → page.tsx} +0 -0
|
@@ -19,7 +19,7 @@ a code-only task, or use `npx fimo@latest` for project-local code generation and
|
|
|
19
19
|
|
|
20
20
|
## Never hardcode editable values
|
|
21
21
|
|
|
22
|
-
- **Content**: declare a schema, push it, use its generated client, and render with `fimo
|
|
22
|
+
- **Content**: declare a schema, push it, use its generated client, and render with `fimo-next` or `fimo-next/client`.
|
|
23
23
|
- **Strings**: use labels and `t('key')`.
|
|
24
24
|
- **Media**: use the active framework adapter's `Image` / `Video` primitives.
|
|
25
25
|
- **Forms**: use the generated Zod schema and submit helper.
|
|
@@ -35,24 +35,14 @@ The scaffolded homepage is disposable. Replace it on the first real generation.
|
|
|
35
35
|
## Project rules
|
|
36
36
|
|
|
37
37
|
- **Deploy is on-demand**, not a save step. Batch related edits into one deploy.
|
|
38
|
-
-
|
|
39
|
-
- Treat the user's language request as part of setup. The first explicitly requested locale is the primary locale; put it first and set it as `i18n.defaultLocale` in `.fimo/config.json`, with every requested locale in `i18n.locales`. If no language is requested, keep `en` and state that choice. That file is the only place to change: `src/locales.ts` reads it, so the served language
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
- Keep `.fimo/config.json#routes` as Studio metadata, not as the Next.js router.
|
|
38
|
+
- Use the selected package manager's committed build-script policy. pnpm projects pin `pnpm@10.26.0` and approve `esbuild` and `fimo` through `pnpm-workspace.yaml#allowBuilds`; Bun projects trust the same packages through `package.json#trustedDependencies`. Run a plain install with the selected manager so local installation matches Preview and production publishing. Review new dependencies before extending the policy; all three paths stop on unreviewed scripts.
|
|
39
|
+
- Treat the user's language request as part of setup. The first explicitly requested locale is the primary locale; put it first and set it as `i18n.defaultLocale` in `.fimo/config.json`, with every requested locale in `i18n.locales`. If no language is requested, keep `en` and state that choice. That file is the only place to change: `src/locales.ts` reads it, so the served language and `<html lang>` follow. It does not create locale URLs; implement a URL strategy only when the product asks for one. Never introduce a default-locale environment variable.
|
|
40
|
+
- Next's `app` tree is the router and stays authoritative: the starter is one ordinary root layout plus `/` as the homepage, and unknown paths get Next's native 404. When a product requires locale URLs, implement the framework-native strategy (`[locale]` segments, middleware, cookies, domains, or an i18n library), pass the resolved locale into Fimo server reads and `FimoProvider`, and load `fimo skills get fimo-code --ref frameworks/next/locales` first. Do not impose locale-prefixed URLs on a default-only project.
|
|
41
|
+
- `FimoProvider` owns the optional Studio preview runtime. Do not add a preview bridge component, read Fimo preview environment variables, or inject Fimo scripts in application code.
|
|
42
|
+
- Keep `.fimo/config.json#routes` as Studio metadata, not as the Next.js router. Describe only URLs the application actually serves; add a `:locale` segment to a route's metadata only after the application implements that locale routing. There, `params.locale.optional: true` means omit the configured default locale from the URL; use `optional: false` only when every locale, including the default, must be prefixed.
|
|
43
43
|
- The application owns routes, locale resolution, links, HTML language/direction, and SEO. Fimo connects to those decisions.
|
|
44
44
|
- Do not add a second deployment platform.
|
|
45
45
|
- Never edit `.fimo/project.json`; it links this directory to the remote project.
|
|
46
46
|
- Keep `.fimo/config.json#runtime` true to the code: framework, `dev`/`build`/`install` commands, output directory. Update it when you rename a package script, move the build output, or change framework; the reference is `fimo skills get fimo-code --ref frameworks/hosting`.
|
|
47
47
|
- Keep secrets in the Fimo dashboard, not in committed environment files.
|
|
48
48
|
- Pass flags to interactive Fimo commands when scripting them.
|
|
49
|
-
|
|
50
|
-
<!-- BEGIN:nextjs-agent-rules -->
|
|
51
|
-
|
|
52
|
-
# This is NOT the Next.js you know
|
|
53
|
-
|
|
54
|
-
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
|
|
55
|
-
|
|
56
|
-
This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
|
|
57
|
-
|
|
58
|
-
<!-- END:nextjs-agent-rules -->
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { NextConfig } from 'next';
|
|
2
|
-
import { withFimo } from 'fimo
|
|
2
|
+
import { withFimo } from 'fimo-next/config';
|
|
3
3
|
|
|
4
|
-
const nextConfig: NextConfig = {
|
|
4
|
+
const nextConfig: NextConfig = {
|
|
5
|
+
agentRules: false,
|
|
6
|
+
};
|
|
5
7
|
|
|
6
8
|
export default withFimo(nextConfig);
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@tanstack/react-query": "^5.80.6",
|
|
15
|
-
"fimo": "
|
|
15
|
+
"fimo": "0.21.0-experimental.1",
|
|
16
|
+
"fimo-next": "0.21.0-experimental.1",
|
|
16
17
|
"next": "^16.3.0",
|
|
17
18
|
"react": "^19.2.7",
|
|
18
19
|
"react-dom": "^19.2.7"
|
|
@@ -26,5 +27,6 @@
|
|
|
26
27
|
},
|
|
27
28
|
"engines": {
|
|
28
29
|
"node": ">=22.22.0"
|
|
29
|
-
}
|
|
30
|
+
},
|
|
31
|
+
"packageManager": "pnpm@10.26.0"
|
|
30
32
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# Keep dependency-script decisions explicit across local, Preview, and production installs.
|
|
2
|
+
|
|
3
|
+
strictDepBuilds: true
|
|
4
|
+
allowBuilds:
|
|
5
|
+
esbuild: true
|
|
6
|
+
fimo: true
|
|
3
7
|
|
|
4
8
|
packages: []
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FimoProvider } from 'fimo-next';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
import { defaultLocale } from '../locales';
|
|
5
|
+
|
|
6
|
+
import './globals.css';
|
|
7
|
+
|
|
8
|
+
export default function RootLayout({ children }: Readonly<{ children: ReactNode }>) {
|
|
9
|
+
return (
|
|
10
|
+
<html lang={defaultLocale}>
|
|
11
|
+
<body>
|
|
12
|
+
<FimoProvider locale={defaultLocale}>{children}</FimoProvider>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -3,11 +3,8 @@ import fimoConfig from '../.fimo/config.json';
|
|
|
3
3
|
/**
|
|
4
4
|
* Locale policy read from the same file Fimo and Studio read, so the site
|
|
5
5
|
* language cannot drift from the project configuration. Change the locales in
|
|
6
|
-
* `.fimo/config.json#i18n`; nothing here needs editing.
|
|
6
|
+
* `.fimo/config.json#i18n`; nothing here needs editing. Configured locales are
|
|
7
|
+
* content configuration only — URL locale routing is a separate application
|
|
8
|
+
* decision implemented in the `app` tree when the product asks for it.
|
|
7
9
|
*/
|
|
8
10
|
export const defaultLocale: string = fimoConfig.i18n.defaultLocale;
|
|
9
|
-
|
|
10
|
-
/** Only non-default locales carry a URL prefix; the default locale stays at the site root. */
|
|
11
|
-
export const prefixedLocales: ReadonlySet<string> = new Set(
|
|
12
|
-
fimoConfig.i18n.locales.filter((locale) => locale !== defaultLocale)
|
|
13
|
-
);
|
|
@@ -40,7 +40,7 @@ breaks that. Load `fimo-code` for the exact primitives, but the rule is:
|
|
|
40
40
|
## Project rules
|
|
41
41
|
|
|
42
42
|
- **Deploy is on-demand**, not a save step. Batch related edits into one deploy.
|
|
43
|
-
-
|
|
43
|
+
- Use the selected package manager's committed build-script policy. pnpm projects pin `pnpm@10.26.0` and approve `esbuild` and `fimo` through `pnpm-workspace.yaml#allowBuilds`; Bun projects trust the same packages through `package.json#trustedDependencies`. Run a plain install with the selected manager so local installation matches Preview and production publishing. Review new dependencies before extending the policy; all three paths stop on unreviewed scripts.
|
|
44
44
|
- Treat the user's language request as part of setup. The first explicitly requested locale is the primary locale; put it first and set it as `i18n.defaultLocale` in `.fimo/config.json`. If no language is requested, keep `en` and state that choice.
|
|
45
45
|
- Preserve the application-owned `:locale?` route boundary in `src/routes.ts` and pass its route parameter to `FimoProviders` in `LocaleLayout.tsx`. The missing parameter uses the configured default, so a one-locale site stays at `/`. Add locales in `.fimo/config.json` without rebuilding the route tree; use `:locale` without `?` only when every locale must be prefixed.
|
|
46
46
|
- Keep `.fimo/config.json#routes` aligned as Studio metadata, not as the React Router source of truth. Do not add a global locale-routing strategy, a Fimo route helper, or a Fimo-owned route tree.
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
"cmdk": "^1.1.1",
|
|
22
22
|
"date-fns": "^4.1.0",
|
|
23
23
|
"embla-carousel-react": "^8.6.0",
|
|
24
|
-
"fimo": "0.
|
|
24
|
+
"fimo": "0.21.0-experimental.1",
|
|
25
|
+
"fimo-react": "0.21.0-experimental.1",
|
|
26
|
+
"fimo-react-router": "0.21.0-experimental.1",
|
|
25
27
|
"input-otp": "^1.4.2",
|
|
26
28
|
"isbot": "^5",
|
|
27
29
|
"lucide-react": "^0.577.0",
|
|
@@ -55,5 +57,6 @@
|
|
|
55
57
|
},
|
|
56
58
|
"engines": {
|
|
57
59
|
"node": ">=22.22.0"
|
|
58
|
-
}
|
|
60
|
+
},
|
|
61
|
+
"packageManager": "pnpm@10.26.0"
|
|
59
62
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
# Keep dependency-script decisions explicit across local, Preview, and production installs.
|
|
2
|
+
|
|
3
|
+
strictDepBuilds: true
|
|
4
|
+
allowBuilds:
|
|
5
|
+
esbuild: true
|
|
6
|
+
fimo: true
|
|
7
7
|
|
|
8
8
|
packages: []
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
2
|
-
import { FimoScripts, loadFimoMetaData, buildFimoMeta, fimoHtmlProps } from 'fimo
|
|
2
|
+
import { FimoProviders, FimoScripts, loadFimoMetaData, buildFimoMeta, fimoHtmlProps } from 'fimo-react-router';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import type { MetaFunction } from 'react-router';
|
|
5
5
|
import { Links, Meta, Outlet, Scripts, ScrollRestoration } from 'react-router';
|
|
@@ -27,7 +27,7 @@ a code-only task, or use `npx fimo@latest` for project-local code generation and
|
|
|
27
27
|
## Project rules
|
|
28
28
|
|
|
29
29
|
- **Deploy is on-demand**, not a save step. Batch related edits into one deploy.
|
|
30
|
-
-
|
|
30
|
+
- Use the selected package manager's committed build-script policy. pnpm projects pin `pnpm@10.26.0` and approve `esbuild` and `fimo` through `pnpm-workspace.yaml#allowBuilds`; Bun projects trust the same packages through `package.json#trustedDependencies`. Run a plain install with the selected manager so local installation matches Preview and production publishing. Review new dependencies before extending the policy; all three paths stop on unreviewed scripts.
|
|
31
31
|
- Treat the user's language request as part of setup. The first explicitly requested locale is the primary locale; put it first and set it as `i18n.defaultLocale` in `.fimo/config.json`. If no language is requested, keep `en` and state that choice. `src/locales.ts` derives the default and prefixed locale set from that config.
|
|
32
32
|
- Preserve the native `[[locale=locale]]` route boundary. The optional parameter keeps the default locale at `/`; the matcher prevents ordinary top-level routes from being mistaken for locales. The root server layout passes the tracked `event.params` through `resolveLocale`, then sends that locale to `getLabels` and `FimoProvider`. Remove the extra brackets only when every locale must be prefixed.
|
|
33
33
|
- Keep the document language request-aware: `src/hooks.server.ts` renders the initial `<html lang>`, and the root layout updates it after client navigation.
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"prepare": "svelte-kit sync"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"fimo": "
|
|
14
|
+
"fimo": "0.21.0-experimental.1",
|
|
15
|
+
"fimo-sveltekit": "0.21.0-experimental.1"
|
|
15
16
|
},
|
|
16
17
|
"devDependencies": {
|
|
17
18
|
"@sveltejs/kit": "^2.70.2",
|
|
@@ -24,5 +25,6 @@
|
|
|
24
25
|
},
|
|
25
26
|
"engines": {
|
|
26
27
|
"node": ">=22.22.0"
|
|
27
|
-
}
|
|
28
|
+
},
|
|
29
|
+
"packageManager": "pnpm@10.26.0"
|
|
28
30
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# Keep dependency-script decisions explicit across local, Preview, and production installs.
|
|
2
|
+
|
|
3
|
+
strictDepBuilds: true
|
|
4
|
+
allowBuilds:
|
|
5
|
+
esbuild: true
|
|
6
|
+
fimo: true
|
|
3
7
|
|
|
4
8
|
packages: []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { afterNavigate } from '$app/navigation';
|
|
3
|
-
import { FimoProvider } from 'fimo
|
|
3
|
+
import { FimoProvider } from 'fimo-sveltekit/components';
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
5
|
|
|
6
6
|
import type { LayoutData } from './$types';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { HTMLAttributes, SvelteHTMLElements } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
import type { FimoBoolean } from 'fimo/sveltekit';
|
|
5
|
-
import { getFimoSource } from 'fimo/sveltekit';
|
|
6
|
-
|
|
7
|
-
type Props = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
8
|
-
value: FimoBoolean | boolean | null | undefined;
|
|
9
|
-
as?: keyof SvelteHTMLElements;
|
|
10
|
-
[key: string]: unknown;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
let { value, as = 'span', ...props }: Props = $props();
|
|
14
|
-
const source = $derived(getFimoSource(value));
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
{#if value != null}
|
|
18
|
-
<svelte:element this={as} {...props} data-fimo-source={source}>{String(value.valueOf())}</svelte:element>
|
|
19
|
-
{/if}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { HTMLTimeAttributes } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
import type { FimoString } from 'fimo/sveltekit';
|
|
5
|
-
import { getFimoSource } from 'fimo/sveltekit';
|
|
6
|
-
|
|
7
|
-
type Props = Omit<HTMLTimeAttributes, 'datetime' | 'children'> & {
|
|
8
|
-
value: FimoString | globalThis.Date | string | number | null | undefined;
|
|
9
|
-
locale?: string;
|
|
10
|
-
options?: Intl.DateTimeFormatOptions;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
let { value, locale, options, ...props }: Props = $props();
|
|
14
|
-
const source = $derived(getFimoSource(value));
|
|
15
|
-
const rendered = $derived.by(() => {
|
|
16
|
-
if (value == null) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
const raw = value instanceof String ? value.toString() : value;
|
|
20
|
-
const date = new globalThis.Date(raw as string | number | globalThis.Date);
|
|
21
|
-
if (Number.isNaN(date.getTime())) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
return {
|
|
25
|
-
datetime: date.toISOString().split('T')[0],
|
|
26
|
-
text: date.toLocaleDateString(locale, options ?? { year: 'numeric', month: 'short', day: 'numeric' }),
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
{#if rendered}
|
|
32
|
-
<time {...props} datetime={rendered.datetime} data-fimo-source={source}>{rendered.text}</time>
|
|
33
|
-
{/if}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { HTMLTimeAttributes } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
import type { FimoString } from 'fimo/sveltekit';
|
|
5
|
-
import { getFimoSource } from 'fimo/sveltekit';
|
|
6
|
-
|
|
7
|
-
type Props = Omit<HTMLTimeAttributes, 'datetime' | 'children'> & {
|
|
8
|
-
value: FimoString | globalThis.Date | string | number | null | undefined;
|
|
9
|
-
locale?: string;
|
|
10
|
-
options?: Intl.DateTimeFormatOptions;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
let { value, locale, options, ...props }: Props = $props();
|
|
14
|
-
const source = $derived(getFimoSource(value));
|
|
15
|
-
const rendered = $derived.by(() => {
|
|
16
|
-
if (value == null) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
const raw = value instanceof String ? value.toString() : value;
|
|
20
|
-
const date = new globalThis.Date(raw as string | number | globalThis.Date);
|
|
21
|
-
if (Number.isNaN(date.getTime())) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
return {
|
|
25
|
-
// The whole instant, not just the day: a `datetime` field exists to name
|
|
26
|
-
// a moment, and truncating it here would throw the time away.
|
|
27
|
-
datetime: date.toISOString(),
|
|
28
|
-
text: date.toLocaleString(locale, options ?? { dateStyle: 'medium', timeStyle: 'short' }),
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
|
-
{#if rendered}
|
|
34
|
-
<time {...props} datetime={rendered.datetime} data-fimo-source={source}>{rendered.text}</time>
|
|
35
|
-
{/if}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { afterNavigate, goto, invalidateAll } from '$app/navigation';
|
|
3
|
-
import { env } from '$env/dynamic/public';
|
|
4
|
-
import type { LabelsSnapshot } from 'fimo/sveltekit';
|
|
5
|
-
import {
|
|
6
|
-
connectPreview,
|
|
7
|
-
ensurePreviewScript,
|
|
8
|
-
LABELS_KEY,
|
|
9
|
-
sendPreviewLocation,
|
|
10
|
-
type LabelsSource,
|
|
11
|
-
} from 'fimo/sveltekit/internal';
|
|
12
|
-
import { onMount, setContext, type Snippet } from 'svelte';
|
|
13
|
-
|
|
14
|
-
let { labels, children }: { labels: LabelsSnapshot; children: Snippet } = $props();
|
|
15
|
-
let previewEnabled = false;
|
|
16
|
-
|
|
17
|
-
setContext<LabelsSource>(LABELS_KEY, () => labels);
|
|
18
|
-
|
|
19
|
-
onMount(() => {
|
|
20
|
-
previewEnabled = ensurePreviewScript(env.PUBLIC_FIMO_PREVIEW_SCRIPT_URL);
|
|
21
|
-
if (!previewEnabled) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return connectPreview({ goto, invalidateAll, locale: () => labels.locale });
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
afterNavigate(() => {
|
|
29
|
-
if (previewEnabled) {
|
|
30
|
-
sendPreviewLocation(labels.locale);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
|
-
{@render children()}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { HTMLImgAttributes } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
import type { FimoMedia } from 'fimo/sveltekit';
|
|
5
|
-
import { getFimoSource } from 'fimo/sveltekit';
|
|
6
|
-
import {
|
|
7
|
-
mergeSvelteImageStyle,
|
|
8
|
-
resolveImagePresentation,
|
|
9
|
-
type ImageFit,
|
|
10
|
-
} from 'fimo/sveltekit/internal';
|
|
11
|
-
|
|
12
|
-
type Props = Omit<HTMLImgAttributes, 'src' | 'alt' | 'width' | 'height' | 'sizes' | 'srcset'> & {
|
|
13
|
-
value: FimoMedia | null | undefined;
|
|
14
|
-
alt?: string;
|
|
15
|
-
quality?: number;
|
|
16
|
-
fit?: ImageFit;
|
|
17
|
-
unoptimized?: boolean;
|
|
18
|
-
overrideSrc?: string;
|
|
19
|
-
width?: string | number;
|
|
20
|
-
height?: string | number;
|
|
21
|
-
sizes?: string;
|
|
22
|
-
srcset?: string;
|
|
23
|
-
srcSet?: string;
|
|
24
|
-
hostSuffixes?: readonly string[];
|
|
25
|
-
style?: string;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
let {
|
|
29
|
-
value,
|
|
30
|
-
alt,
|
|
31
|
-
quality,
|
|
32
|
-
fit,
|
|
33
|
-
unoptimized,
|
|
34
|
-
overrideSrc,
|
|
35
|
-
width,
|
|
36
|
-
height,
|
|
37
|
-
sizes,
|
|
38
|
-
srcset,
|
|
39
|
-
srcSet,
|
|
40
|
-
hostSuffixes,
|
|
41
|
-
style,
|
|
42
|
-
...props
|
|
43
|
-
}: Props = $props();
|
|
44
|
-
|
|
45
|
-
const image = $derived(
|
|
46
|
-
value
|
|
47
|
-
? resolveImagePresentation({
|
|
48
|
-
src: value.url,
|
|
49
|
-
alt: alt ?? value.alt,
|
|
50
|
-
mediaWidth: value.width,
|
|
51
|
-
mediaHeight: value.height,
|
|
52
|
-
quality,
|
|
53
|
-
fit,
|
|
54
|
-
unoptimized,
|
|
55
|
-
overrideSrc,
|
|
56
|
-
width,
|
|
57
|
-
height,
|
|
58
|
-
sizes,
|
|
59
|
-
srcSet: srcset ?? srcSet,
|
|
60
|
-
hostSuffixes,
|
|
61
|
-
})
|
|
62
|
-
: null,
|
|
63
|
-
);
|
|
64
|
-
const imageStyle = $derived(image ? mergeSvelteImageStyle(style, image.objectFit) : style);
|
|
65
|
-
const source = $derived(getFimoSource(value));
|
|
66
|
-
</script>
|
|
67
|
-
|
|
68
|
-
{#if image}
|
|
69
|
-
<img
|
|
70
|
-
{...props}
|
|
71
|
-
src={image.src}
|
|
72
|
-
alt={image.alt}
|
|
73
|
-
width={image.width}
|
|
74
|
-
height={image.height}
|
|
75
|
-
sizes={image.sizes}
|
|
76
|
-
srcset={image.srcSet}
|
|
77
|
-
style={imageStyle}
|
|
78
|
-
data-fimo-source={source}
|
|
79
|
-
/>
|
|
80
|
-
{/if}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { HTMLAttributes, SvelteHTMLElements } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
import { getFimoSource } from 'fimo/sveltekit';
|
|
5
|
-
|
|
6
|
-
type Props = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
7
|
-
value: unknown;
|
|
8
|
-
as?: keyof SvelteHTMLElements;
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
let { value, as = 'span', ...props }: Props = $props();
|
|
13
|
-
const source = $derived(getFimoSource(value));
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
{#if value != null}
|
|
17
|
-
<svelte:element this={as} {...props} data-fimo-source={source}>{JSON.stringify(value)}</svelte:element>
|
|
18
|
-
{/if}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { useLabels } from 'fimo/sveltekit';
|
|
3
|
-
import type { ComponentProps } from 'svelte';
|
|
4
|
-
|
|
5
|
-
import Text from './Text.svelte';
|
|
6
|
-
|
|
7
|
-
type Props = Omit<ComponentProps<typeof Text>, 'value'> & {
|
|
8
|
-
value: string;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
let { value, ...props }: Props = $props();
|
|
12
|
-
const labels = useLabels();
|
|
13
|
-
const label = $derived(labels.t(value));
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<Text {...props} value={label} />
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { HTMLAttributes, SvelteHTMLElements } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
// Content numbers stay plain JS numbers (there is no FimoNumber wrapper), so
|
|
5
|
-
// this primitive has no source to expose: it formats for display only and is
|
|
6
|
-
// not editable in the preview.
|
|
7
|
-
type Props = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
8
|
-
value: number | null | undefined;
|
|
9
|
-
as?: keyof SvelteHTMLElements;
|
|
10
|
-
locale?: string;
|
|
11
|
-
options?: Intl.NumberFormatOptions;
|
|
12
|
-
[key: string]: unknown;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
let { value, as = 'span', locale, options, ...props }: Props = $props();
|
|
16
|
-
const rendered = $derived(value != null && !Number.isNaN(value) ? value.toLocaleString(locale, options) : null);
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
{#if rendered != null}
|
|
20
|
-
<svelte:element this={as} {...props}>{rendered}</svelte:element>
|
|
21
|
-
{/if}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
import type { FimoRichText } from 'fimo/sveltekit';
|
|
5
|
-
import { getFimoSource } from 'fimo/sveltekit';
|
|
6
|
-
import { renderRichTextHtml } from 'fimo/sveltekit/internal';
|
|
7
|
-
|
|
8
|
-
type Props = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
9
|
-
value: FimoRichText | null | undefined;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
let { value, ...props }: Props = $props();
|
|
13
|
-
const source = $derived(getFimoSource(value));
|
|
14
|
-
const html = $derived(renderRichTextHtml(value?.content));
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
{#if value}
|
|
18
|
-
<div {...props} data-fimo-source={source} data-fimo-richtext="">{@html html}</div>
|
|
19
|
-
{/if}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { HTMLAttributes, SvelteHTMLElements } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
import type { FimoString } from 'fimo/sveltekit';
|
|
5
|
-
import { getFimoParts, getFimoSource } from 'fimo/sveltekit';
|
|
6
|
-
|
|
7
|
-
type Props = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
8
|
-
value: FimoString | string | null | undefined;
|
|
9
|
-
as?: keyof SvelteHTMLElements;
|
|
10
|
-
[key: string]: unknown;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
let { value, as = 'span', ...props }: Props = $props();
|
|
14
|
-
const parts = $derived(getFimoParts(value));
|
|
15
|
-
const source = $derived(getFimoSource(value));
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<svelte:element this={as} {...props} data-fimo-source={source}>
|
|
19
|
-
{#if parts && parts.length > 1}
|
|
20
|
-
{#each parts as part}
|
|
21
|
-
{#if part.source}
|
|
22
|
-
<span data-fimo-source={part.source}>{part.text}</span>
|
|
23
|
-
{:else}
|
|
24
|
-
{part.text}
|
|
25
|
-
{/if}
|
|
26
|
-
{/each}
|
|
27
|
-
{:else}
|
|
28
|
-
{String(value ?? '')}
|
|
29
|
-
{/if}
|
|
30
|
-
</svelte:element>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { HTMLVideoAttributes } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
import type { FimoMedia } from 'fimo/sveltekit';
|
|
5
|
-
import { getFimoSource } from 'fimo/sveltekit';
|
|
6
|
-
|
|
7
|
-
type Props = Omit<HTMLVideoAttributes, 'src' | 'width' | 'height' | 'children'> & {
|
|
8
|
-
value: FimoMedia | null | undefined;
|
|
9
|
-
overrideSrc?: string;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
let {
|
|
13
|
-
value,
|
|
14
|
-
overrideSrc,
|
|
15
|
-
autoplay = true,
|
|
16
|
-
loop = true,
|
|
17
|
-
muted = true,
|
|
18
|
-
playsinline = true,
|
|
19
|
-
...props
|
|
20
|
-
}: Props = $props();
|
|
21
|
-
const source = $derived(getFimoSource(value));
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
{#if value}
|
|
25
|
-
<!-- svelte-ignore a11y_media_has_caption -->
|
|
26
|
-
<video
|
|
27
|
-
{...props}
|
|
28
|
-
src={overrideSrc ?? value.url}
|
|
29
|
-
width={value.width}
|
|
30
|
-
height={value.height}
|
|
31
|
-
{autoplay}
|
|
32
|
-
{loop}
|
|
33
|
-
{muted}
|
|
34
|
-
{playsinline}
|
|
35
|
-
data-fimo-source={source}
|
|
36
|
-
></video>
|
|
37
|
-
{/if}
|