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
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { CollectionContentCore, ContentClientConfig, SingletonContentCore } from '../content/client/core-types.js';
|
|
2
|
-
export { StaticImage } from '../react/primitives/renderers/StaticImage.js';
|
|
3
|
-
export { Text } from './primitives/Text.js';
|
|
4
|
-
export { Boolean, Date, DateTime, Image, Json, RichText, Video } from './primitives/server.js';
|
|
5
|
-
export { createFimo } from './facade.js';
|
|
6
|
-
export type { CreateFimoOptions, NextContentRegistry } from './facade.js';
|
|
7
|
-
export { getLabels } from './labels.js';
|
|
8
|
-
export { type FormClient, type FormSubmissionResult } from '../forms/index.js';
|
|
9
|
-
export type { GetLabelsOptions } from '../labels/fetch.js';
|
|
10
|
-
export type { Labels, LabelsSnapshot } from '../labels/core.js';
|
|
11
|
-
export type { FimoRichTextComponents, FimoRichTextMarkProps, FimoRichTextNodeProps, } from '../react/primitives/contracts.js';
|
|
12
|
-
export declare function createContentClient<T extends {
|
|
13
|
-
id: string;
|
|
14
|
-
}, TInput extends object>(config: ContentClientConfig): CollectionContentCore<T, TInput>;
|
|
15
|
-
export declare function createSingletonClient<T extends {
|
|
16
|
-
id: string;
|
|
17
|
-
}, TInput extends object>(config: ContentClientConfig): SingletonContentCore<T, TInput>;
|
|
18
|
-
export declare const formClient: import("./client.js").FormClient;
|
|
19
|
-
export type { CollectionContentCore as CollectionContentClient, SingletonContentCore as SingletonContentClient, } from '../content/client/core-types.js';
|
|
20
|
-
export * from '../content/index.js';
|
|
21
|
-
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { createServerContentClient, createServerSingletonClient } from '../content/client/server-content-client.js';
|
|
2
|
-
import { createFormClient } from '../forms/index.js';
|
|
3
|
-
import { nextServerContentRuntime } from './server-runtime.js';
|
|
4
|
-
export { StaticImage } from '../react/primitives/renderers/StaticImage.js';
|
|
5
|
-
export { Text } from './primitives/Text.js';
|
|
6
|
-
export { Boolean, Date, DateTime, Image, Json, RichText, Video } from './primitives/server.js';
|
|
7
|
-
export { createFimo } from './facade.js';
|
|
8
|
-
export { getLabels } from './labels.js';
|
|
9
|
-
export function createContentClient(config) {
|
|
10
|
-
return createServerContentClient(config, nextServerContentRuntime);
|
|
11
|
-
}
|
|
12
|
-
export function createSingletonClient(config) {
|
|
13
|
-
return createServerSingletonClient(config, nextServerContentRuntime);
|
|
14
|
-
}
|
|
15
|
-
export const formClient = createFormClient(nextServerContentRuntime);
|
|
16
|
-
export * from '../content/index.js';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export { Text } from '../react/primitives/editable/Text.js';
|
|
2
|
-
export { Image, StaticImage } from '../vite/primitives/Images.js';
|
|
3
|
-
export { Video } from '../react/primitives/editable/Video.js';
|
|
4
|
-
export { Date } from '../react/primitives/editable/Date.js';
|
|
5
|
-
export { DateTime } from '../react/primitives/editable/DateTime.js';
|
|
6
|
-
export { Boolean } from '../react/primitives/editable/Boolean.js';
|
|
7
|
-
export { Json } from '../react/primitives/editable/Json.js';
|
|
8
|
-
export { RichText } from '../react/primitives/editable/RichText.js';
|
|
9
|
-
export { Label } from '../vite/Label.js';
|
|
10
|
-
export type { LabelProps } from '../vite/Label.js';
|
|
11
|
-
export { useLabels, useTranslations } from '../vite/translations.js';
|
|
12
|
-
export { FimoString, FimoDate, FimoMedia, FimoBoolean, FimoRichText, type FimoPolymorphicReference, type FimoReference, type FimoSource, type FimoPart, type FimoRichTextContent, FIMO_SOURCE, FIMO_PARTS, isFimoString, isFimoDate, hasFimoSource, getFimoSource, getFimoParts, fimo, } from './lib/index.js';
|
|
13
|
-
export type { FimoRichTextComponents, FimoRichTextMarkProps, FimoRichTextNodeProps, } from '../react/primitives/contracts.js';
|
|
14
|
-
export { useFimoLiveValue } from '../react/useFimoLiveValue.js';
|
|
15
|
-
export type { BoolOps, DateOps, Field, Fields, FilterFor, NullOnlyOps, NumberOps, Populate, Populated, PopulatedResult, Projected, ProjectedWithPopulate, Query, ReferenceField, ReferenceMap, ScalarOps, Sort, SortField, StringOps, WithReferences, Where, } from './lib/index.js';
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// Fimo UI — components and primitives for source-tracked inline editing
|
|
2
|
-
// This module is auto-synced and should not be modified by agents or users.
|
|
3
|
-
// Components
|
|
4
|
-
export { Text } from '../react/primitives/editable/Text.js';
|
|
5
|
-
export { Image, StaticImage } from '../vite/primitives/Images.js';
|
|
6
|
-
export { Video } from '../react/primitives/editable/Video.js';
|
|
7
|
-
export { Date } from '../react/primitives/editable/Date.js';
|
|
8
|
-
export { DateTime } from '../react/primitives/editable/DateTime.js';
|
|
9
|
-
export { Boolean } from '../react/primitives/editable/Boolean.js';
|
|
10
|
-
export { Json } from '../react/primitives/editable/Json.js';
|
|
11
|
-
export { RichText } from '../react/primitives/editable/RichText.js';
|
|
12
|
-
// Labels
|
|
13
|
-
export { Label } from '../vite/Label.js';
|
|
14
|
-
export { useLabels, useTranslations } from '../vite/translations.js';
|
|
15
|
-
// Primitives & utilities
|
|
16
|
-
export { FimoString, FimoDate, FimoMedia, FimoBoolean, FimoRichText, FIMO_SOURCE, FIMO_PARTS, isFimoString, isFimoDate, hasFimoSource, getFimoSource, getFimoParts, fimo, } from './lib/index.js';
|
|
17
|
-
export { useFimoLiveValue } from '../react/useFimoLiveValue.js';
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, ComponentType, ElementType, ReactNode } from 'react';
|
|
2
|
-
import type { ImageFit } from '../../primitives/lib/image-optimization.js';
|
|
3
|
-
import type { FimoBoolean, FimoDate, FimoMedia, FimoRichText, FimoRichTextContent, FimoString } from '../../primitives/lib/index.js';
|
|
4
|
-
export interface FimoRichTextNodeProps {
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
node: FimoRichTextContent;
|
|
7
|
-
}
|
|
8
|
-
export interface FimoRichTextMarkProps {
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
mark: {
|
|
11
|
-
type: string;
|
|
12
|
-
attrs?: Record<string, unknown>;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export interface FimoRichTextComponents {
|
|
16
|
-
paragraph?: ComponentType<FimoRichTextNodeProps>;
|
|
17
|
-
heading?: ComponentType<FimoRichTextNodeProps>;
|
|
18
|
-
bulletList?: ComponentType<FimoRichTextNodeProps>;
|
|
19
|
-
orderedList?: ComponentType<FimoRichTextNodeProps>;
|
|
20
|
-
listItem?: ComponentType<FimoRichTextNodeProps>;
|
|
21
|
-
blockquote?: ComponentType<FimoRichTextNodeProps>;
|
|
22
|
-
codeBlock?: ComponentType<FimoRichTextNodeProps>;
|
|
23
|
-
horizontalRule?: ComponentType<FimoRichTextNodeProps>;
|
|
24
|
-
hardBreak?: ComponentType<FimoRichTextNodeProps>;
|
|
25
|
-
image?: ComponentType<FimoRichTextNodeProps>;
|
|
26
|
-
table?: ComponentType<FimoRichTextNodeProps>;
|
|
27
|
-
tableRow?: ComponentType<FimoRichTextNodeProps>;
|
|
28
|
-
tableCell?: ComponentType<FimoRichTextNodeProps>;
|
|
29
|
-
tableHeader?: ComponentType<FimoRichTextNodeProps>;
|
|
30
|
-
iframe?: ComponentType<FimoRichTextNodeProps>;
|
|
31
|
-
bold?: ComponentType<FimoRichTextMarkProps>;
|
|
32
|
-
italic?: ComponentType<FimoRichTextMarkProps>;
|
|
33
|
-
underline?: ComponentType<FimoRichTextMarkProps>;
|
|
34
|
-
strike?: ComponentType<FimoRichTextMarkProps>;
|
|
35
|
-
code?: ComponentType<FimoRichTextMarkProps>;
|
|
36
|
-
link?: ComponentType<FimoRichTextMarkProps>;
|
|
37
|
-
}
|
|
38
|
-
export type BooleanProps<T extends ElementType = 'span'> = {
|
|
39
|
-
value: FimoBoolean;
|
|
40
|
-
as?: T;
|
|
41
|
-
children?: (value: boolean) => ReactNode;
|
|
42
|
-
} & Omit<ComponentPropsWithoutRef<T>, 'value' | 'as' | 'children'>;
|
|
43
|
-
export interface DateProps {
|
|
44
|
-
value: FimoDate | FimoString | Date | string;
|
|
45
|
-
children?: (date: Date) => ReactNode;
|
|
46
|
-
className?: string;
|
|
47
|
-
}
|
|
48
|
-
export interface BaseImageProps extends Omit<ComponentPropsWithoutRef<'img'>, 'src' | 'alt' | 'children'> {
|
|
49
|
-
quality?: number;
|
|
50
|
-
fit?: ImageFit;
|
|
51
|
-
unoptimized?: boolean;
|
|
52
|
-
overrideSrc?: string;
|
|
53
|
-
hostSuffixes?: readonly string[];
|
|
54
|
-
}
|
|
55
|
-
export interface ImageProps extends BaseImageProps {
|
|
56
|
-
value: FimoMedia;
|
|
57
|
-
alt?: string;
|
|
58
|
-
children?: (media: FimoMedia) => ReactNode;
|
|
59
|
-
}
|
|
60
|
-
export type JsonProps<T extends ElementType = 'span'> = {
|
|
61
|
-
value: unknown;
|
|
62
|
-
as?: T;
|
|
63
|
-
children?: (value: unknown) => ReactNode;
|
|
64
|
-
} & Omit<ComponentPropsWithoutRef<T>, 'value' | 'as' | 'children'>;
|
|
65
|
-
export interface RichTextProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
66
|
-
value: FimoRichText | null | undefined;
|
|
67
|
-
components?: FimoRichTextComponents;
|
|
68
|
-
}
|
|
69
|
-
export type StaticImageProps = Omit<ComponentPropsWithoutRef<'img'>, 'children'> & {
|
|
70
|
-
/** Image quality (1-100). Defaults to 85. */
|
|
71
|
-
quality?: number;
|
|
72
|
-
/** Resize fit mode. Also maps to CSS object-fit. Defaults to 'scale-down'. */
|
|
73
|
-
fit?: ImageFit;
|
|
74
|
-
/** Skip optimization and use the original URL. */
|
|
75
|
-
unoptimized?: boolean;
|
|
76
|
-
hostSuffixes?: readonly string[];
|
|
77
|
-
};
|
|
78
|
-
export type TextProps<T extends ElementType = 'span'> = {
|
|
79
|
-
value: unknown;
|
|
80
|
-
as?: T;
|
|
81
|
-
children?: (value: string) => ReactNode;
|
|
82
|
-
} & Omit<ComponentPropsWithoutRef<T>, 'value' | 'as' | 'children'>;
|
|
83
|
-
export type LabelProps<T extends ElementType = 'span'> = Omit<TextProps<T>, 'value'> & {
|
|
84
|
-
/** Literal label key, e.g. `hero.title`. Dynamic keys cannot be validated. */
|
|
85
|
-
value: string;
|
|
86
|
-
};
|
|
87
|
-
export interface BaseVideoProps extends Omit<ComponentPropsWithoutRef<'video'>, 'src' | 'children'> {
|
|
88
|
-
overrideSrc?: string;
|
|
89
|
-
}
|
|
90
|
-
export interface VideoProps extends BaseVideoProps {
|
|
91
|
-
value: FimoMedia;
|
|
92
|
-
children?: (media: FimoMedia) => ReactNode;
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type ElementType } from 'react';
|
|
2
|
-
import type { BooleanProps } from '../contracts.js';
|
|
3
|
-
export type { BooleanProps } from '../contracts.js';
|
|
4
|
-
export declare function Boolean<T extends ElementType = 'span'>({ value, as, children, ...props }: BooleanProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
5
|
-
//# sourceMappingURL=Boolean.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { FIMO_SOURCE } from '../../../primitives/lib/index.js';
|
|
3
|
-
import { useFimoLiveValue } from '../../useFimoLiveValue.js';
|
|
4
|
-
export function Boolean({ value, as, children, ...props }) {
|
|
5
|
-
const Component = as || 'span';
|
|
6
|
-
const { value: liveValue, ref } = useFimoLiveValue(value ? value.valueOf() : false);
|
|
7
|
-
if (!value) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
return (_jsx(Component, { ref: ref, ...props, "data-fimo-source": value[FIMO_SOURCE], children: children ? children(liveValue) : String(liveValue) }));
|
|
11
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { FIMO_SOURCE } from '../../../primitives/lib/index.js';
|
|
3
|
-
import { useFimoLiveValue } from '../../useFimoLiveValue.js';
|
|
4
|
-
import { DateRenderer } from '../renderers/DateRenderer.js';
|
|
5
|
-
export function Date({ value, ...props }) {
|
|
6
|
-
const { value: liveValue, ref } = useFimoLiveValue(value ?? null);
|
|
7
|
-
if (!liveValue) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
const source = typeof value === 'object' && FIMO_SOURCE in value ? (value[FIMO_SOURCE] ?? undefined) : undefined;
|
|
11
|
-
return _jsx(DateRenderer, { ...props, value: liveValue, source: source, elementRef: ref });
|
|
12
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DateProps } from '../contracts.js';
|
|
2
|
-
/** Renders a `datetime` field: the `dateTime` attribute keeps the whole instant. */
|
|
3
|
-
export declare function DateTime({ value, ...props }: DateProps): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
-
//# sourceMappingURL=DateTime.d.ts.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { FIMO_SOURCE } from '../../../primitives/lib/index.js';
|
|
3
|
-
import { useFimoLiveValue } from '../../useFimoLiveValue.js';
|
|
4
|
-
import { DateRenderer } from '../renderers/DateRenderer.js';
|
|
5
|
-
/** Renders a `datetime` field: the `dateTime` attribute keeps the whole instant. */
|
|
6
|
-
export function DateTime({ value, ...props }) {
|
|
7
|
-
const { value: liveValue, ref } = useFimoLiveValue(value ?? null);
|
|
8
|
-
if (!liveValue) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
const source = typeof value === 'object' && FIMO_SOURCE in value ? (value[FIMO_SOURCE] ?? undefined) : undefined;
|
|
12
|
-
return _jsx(DateRenderer, { ...props, value: liveValue, source: source, precision: "instant", elementRef: ref });
|
|
13
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ImageProps } from '../contracts.js';
|
|
2
|
-
export type { BaseImageProps, ImageProps } from '../contracts.js';
|
|
3
|
-
export declare function Image({ value: media, ...props }: ImageProps): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
-
//# sourceMappingURL=Image.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useFimoLiveValue } from '../../useFimoLiveValue.js';
|
|
3
|
-
import { ImageRenderer } from '../renderers/ImageRenderer.js';
|
|
4
|
-
export function Image({ value: media, ...props }) {
|
|
5
|
-
const { value: liveMedia, ref } = useFimoLiveValue(media ?? null);
|
|
6
|
-
if (!liveMedia) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
return _jsx(ImageRenderer, { ...props, value: liveMedia, elementRef: ref });
|
|
10
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type ElementType } from 'react';
|
|
2
|
-
import type { JsonProps } from '../contracts.js';
|
|
3
|
-
export type { JsonProps } from '../contracts.js';
|
|
4
|
-
export declare function Json<T extends ElementType = 'span'>({ value, as, children, ...props }: JsonProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
5
|
-
//# sourceMappingURL=Json.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { getFimoSource } from '../../../primitives/lib/index.js';
|
|
3
|
-
import { useFimoLiveValue } from '../../useFimoLiveValue.js';
|
|
4
|
-
export function Json({ value, as, children, ...props }) {
|
|
5
|
-
const Component = as || 'span';
|
|
6
|
-
const { value: liveValue, ref } = useFimoLiveValue(value);
|
|
7
|
-
if (value === null || value === undefined) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
return (_jsx(Component, { ref: ref, ...props, "data-fimo-source": getFimoSource(value), children: children ? children(liveValue) : JSON.stringify(liveValue) }));
|
|
11
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { RichTextProps } from '../contracts.js';
|
|
2
|
-
export type { RichTextProps } from '../contracts.js';
|
|
3
|
-
export declare function RichText({ value, components, ...props }: RichTextProps): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
-
//# sourceMappingURL=RichText.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { FIMO_SOURCE } from '../../../primitives/lib/index.js';
|
|
3
|
-
import { useFimoLiveValue } from '../../useFimoLiveValue.js';
|
|
4
|
-
import { RichTextRenderer } from '../renderers/RichTextRenderer.js';
|
|
5
|
-
export function RichText({ value, components, ...props }) {
|
|
6
|
-
const { value: liveContent, ref } = useFimoLiveValue(value?.content ?? null);
|
|
7
|
-
if (!value) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
return (_jsx(RichTextRenderer, { ...props, document: liveContent, source: value[FIMO_SOURCE], components: components, elementRef: ref }));
|
|
11
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type ElementType } from 'react';
|
|
2
|
-
import type { TextProps } from '../contracts.js';
|
|
3
|
-
export type { TextProps } from '../contracts.js';
|
|
4
|
-
/**
|
|
5
|
-
* Text component for rendering text with source tracking
|
|
6
|
-
*
|
|
7
|
-
* Works with both schema data (FimoString) and translations.
|
|
8
|
-
* The `as` prop changes the rendered element (polymorphic).
|
|
9
|
-
* Use children render function for custom formatting.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* <Text value={post.title} />
|
|
13
|
-
* <Text value={post.title} as="h1" className="text-4xl" />
|
|
14
|
-
* <Text value={t('welcome')} as="p" />
|
|
15
|
-
*
|
|
16
|
-
* // With render function for formatting
|
|
17
|
-
* <Text value={product.price}>{(p) => `$${Number(p).toLocaleString()}`}</Text>
|
|
18
|
-
*/
|
|
19
|
-
export declare function Text<T extends ElementType = 'span'>({ value, as, children, ...props }: TextProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment } from 'react';
|
|
3
|
-
import { getFimoParts, getFimoSource } from '../../../primitives/lib/index.js';
|
|
4
|
-
import { useFimoLiveValue } from '../../useFimoLiveValue.js';
|
|
5
|
-
/**
|
|
6
|
-
* Text component for rendering text with source tracking
|
|
7
|
-
*
|
|
8
|
-
* Works with both schema data (FimoString) and translations.
|
|
9
|
-
* The `as` prop changes the rendered element (polymorphic).
|
|
10
|
-
* Use children render function for custom formatting.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* <Text value={post.title} />
|
|
14
|
-
* <Text value={post.title} as="h1" className="text-4xl" />
|
|
15
|
-
* <Text value={t('welcome')} as="p" />
|
|
16
|
-
*
|
|
17
|
-
* // With render function for formatting
|
|
18
|
-
* <Text value={product.price}>{(p) => `$${Number(p).toLocaleString()}`}</Text>
|
|
19
|
-
*/
|
|
20
|
-
export function Text({ value, as, children, ...props }) {
|
|
21
|
-
const Component = as || 'span';
|
|
22
|
-
const parts = getFimoParts(value);
|
|
23
|
-
const source = getFimoSource(value);
|
|
24
|
-
const { value: liveValue, ref } = useFimoLiveValue(String(value));
|
|
25
|
-
// Composed fimo value with parts — decompose into individually tracked spans
|
|
26
|
-
if (parts && parts.length > 1 && !children) {
|
|
27
|
-
return (_jsx(Component, { ...props, children: parts.map((part, i) => part.source ? (_jsx(TextPart, { part: part }, i)) : (_jsx(Fragment, { children: part.text }, i))) }));
|
|
28
|
-
}
|
|
29
|
-
// Use render function if provided, otherwise display raw value
|
|
30
|
-
const content = children ? children(liveValue) : liveValue;
|
|
31
|
-
return (_jsx(Component, { ref: ref, ...props, "data-fimo-source": source, children: content }));
|
|
32
|
-
}
|
|
33
|
-
function TextPart({ part }) {
|
|
34
|
-
const { value: liveText, ref } = useFimoLiveValue(part.text);
|
|
35
|
-
return (_jsx("span", { ref: ref, "data-fimo-source": part.source, children: liveText }));
|
|
36
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { VideoProps } from '../contracts.js';
|
|
2
|
-
export type { BaseVideoProps, VideoProps } from '../contracts.js';
|
|
3
|
-
export declare function Video({ value: media, ...props }: VideoProps): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
-
//# sourceMappingURL=Video.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useFimoLiveValue } from '../../useFimoLiveValue.js';
|
|
3
|
-
import { VideoRenderer } from '../renderers/VideoRenderer.js';
|
|
4
|
-
export function Video({ value: media, ...props }) {
|
|
5
|
-
const { value: liveMedia, ref } = useFimoLiveValue(media ?? null);
|
|
6
|
-
if (!liveMedia) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
return _jsx(VideoRenderer, { ...props, value: liveMedia, elementRef: ref });
|
|
10
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type ReactNode, type Ref } from 'react';
|
|
2
|
-
import type { FimoDate, FimoString } from '../../../primitives/lib/index.js';
|
|
3
|
-
export interface DateRendererProps {
|
|
4
|
-
value: FimoDate | FimoString | Date | string | number;
|
|
5
|
-
source: string | undefined;
|
|
6
|
-
/**
|
|
7
|
-
* `day` emits the calendar day in `dateTime`; `instant` keeps the full ISO
|
|
8
|
-
* instant, which is the whole point of a `datetime` field. Defaults to `day`
|
|
9
|
-
* so `<Date>` renders exactly what it always has.
|
|
10
|
-
*/
|
|
11
|
-
precision?: 'day' | 'instant';
|
|
12
|
-
children?: (date: Date) => ReactNode;
|
|
13
|
-
className?: string;
|
|
14
|
-
elementRef?: Ref<HTMLTimeElement>;
|
|
15
|
-
}
|
|
16
|
-
export declare function DateRenderer({ value, source, precision, children, className, elementRef }: DateRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
//# sourceMappingURL=DateRenderer.d.ts.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export function DateRenderer({ value, source, precision = 'day', children, className, elementRef }) {
|
|
3
|
-
const rawValue = value instanceof String ? value.toString() : value;
|
|
4
|
-
const dateValue = new globalThis.Date(rawValue);
|
|
5
|
-
const iso = dateValue.toISOString();
|
|
6
|
-
const dateTime = precision === 'instant' ? iso : iso.split('T')[0];
|
|
7
|
-
const content = children
|
|
8
|
-
? children(dateValue)
|
|
9
|
-
: precision === 'instant'
|
|
10
|
-
? dateValue.toLocaleString(undefined, { dateStyle: 'medium', timeStyle: 'short' })
|
|
11
|
-
: dateValue.toLocaleDateString(undefined, {
|
|
12
|
-
year: 'numeric',
|
|
13
|
-
month: 'short',
|
|
14
|
-
day: 'numeric',
|
|
15
|
-
});
|
|
16
|
-
return (_jsx("time", { ref: elementRef, dateTime: dateTime, className: className, "data-fimo-source": source, children: content }));
|
|
17
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type RefObject } from 'react';
|
|
2
|
-
import type { ImageProps } from '../contracts.js';
|
|
3
|
-
interface ImageRendererProps extends ImageProps {
|
|
4
|
-
elementRef?: RefObject<HTMLElement | null>;
|
|
5
|
-
}
|
|
6
|
-
export declare function ImageRenderer({ value: media, children, quality, unoptimized, fit, width, height, alt: altOverride, overrideSrc, srcSet: srcSetOverride, sizes, style, hostSuffixes, elementRef, ...imgProps }: ImageRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=ImageRenderer.d.ts.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { resolveImagePresentation } from '../../../primitives/lib/image-optimization.js';
|
|
3
|
-
import { FIMO_SOURCE } from '../../../primitives/lib/primitives.js';
|
|
4
|
-
export function ImageRenderer({ value: media, children, quality, unoptimized = false, fit, width, height, alt: altOverride, overrideSrc, srcSet: srcSetOverride, sizes, style, hostSuffixes, elementRef, ...imgProps }) {
|
|
5
|
-
const mediaSource = media[FIMO_SOURCE];
|
|
6
|
-
if (children) {
|
|
7
|
-
return (_jsx("span", { ref: elementRef, "data-fimo-source": mediaSource, children: children(media) }));
|
|
8
|
-
}
|
|
9
|
-
const image = resolveImagePresentation({
|
|
10
|
-
src: media.url,
|
|
11
|
-
alt: altOverride ?? media.alt,
|
|
12
|
-
mediaWidth: media.width,
|
|
13
|
-
mediaHeight: media.height,
|
|
14
|
-
quality,
|
|
15
|
-
fit,
|
|
16
|
-
unoptimized,
|
|
17
|
-
overrideSrc,
|
|
18
|
-
width,
|
|
19
|
-
height,
|
|
20
|
-
sizes,
|
|
21
|
-
srcSet: srcSetOverride,
|
|
22
|
-
hostSuffixes,
|
|
23
|
-
});
|
|
24
|
-
const finalStyle = style?.objectFit
|
|
25
|
-
? style
|
|
26
|
-
: {
|
|
27
|
-
...style,
|
|
28
|
-
objectFit: image.objectFit,
|
|
29
|
-
};
|
|
30
|
-
return (_jsx("img", { ref: elementRef, src: image.src, alt: image.alt, width: image.width, height: image.height, style: finalStyle, sizes: image.sizes, srcSet: image.srcSet, ...imgProps, "data-fimo-source": mediaSource }));
|
|
31
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef, type Ref } from 'react';
|
|
2
|
-
import type { FimoRichTextContent } from '../../../primitives/lib/index.js';
|
|
3
|
-
import type { FimoRichTextComponents } from '../contracts.js';
|
|
4
|
-
interface RichTextRendererProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
5
|
-
document: FimoRichTextContent | null | undefined;
|
|
6
|
-
source: string | undefined;
|
|
7
|
-
components?: FimoRichTextComponents;
|
|
8
|
-
elementRef?: Ref<HTMLDivElement>;
|
|
9
|
-
}
|
|
10
|
-
export declare function RichTextRenderer({ document, source, components, elementRef, ...props }: RichTextRendererProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=RichTextRenderer.d.ts.map
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment } from 'react';
|
|
3
|
-
function DefaultParagraph({ children }) {
|
|
4
|
-
return _jsx("p", { children: children });
|
|
5
|
-
}
|
|
6
|
-
function DefaultHeading({ node, children }) {
|
|
7
|
-
const level = node.attrs?.level ?? 1;
|
|
8
|
-
const Tag = `h${level}`;
|
|
9
|
-
return _jsx(Tag, { children: children });
|
|
10
|
-
}
|
|
11
|
-
function DefaultBulletList({ children }) {
|
|
12
|
-
return _jsx("ul", { children: children });
|
|
13
|
-
}
|
|
14
|
-
function DefaultOrderedList({ children }) {
|
|
15
|
-
return _jsx("ol", { children: children });
|
|
16
|
-
}
|
|
17
|
-
function DefaultListItem({ children }) {
|
|
18
|
-
return _jsx("li", { children: children });
|
|
19
|
-
}
|
|
20
|
-
function DefaultBlockquote({ children }) {
|
|
21
|
-
return _jsx("blockquote", { children: children });
|
|
22
|
-
}
|
|
23
|
-
function DefaultCodeBlock({ children }) {
|
|
24
|
-
return (_jsx("pre", { children: _jsx("code", { children: children }) }));
|
|
25
|
-
}
|
|
26
|
-
function DefaultHorizontalRule() {
|
|
27
|
-
return _jsx("hr", {});
|
|
28
|
-
}
|
|
29
|
-
function DefaultHardBreak() {
|
|
30
|
-
return _jsx("br", {});
|
|
31
|
-
}
|
|
32
|
-
function DefaultImage({ node }) {
|
|
33
|
-
const src = node.attrs?.src;
|
|
34
|
-
const alt = node.attrs?.alt ?? '';
|
|
35
|
-
return _jsx("img", { src: src, alt: alt });
|
|
36
|
-
}
|
|
37
|
-
function DefaultIframe({ node }) {
|
|
38
|
-
const src = node.attrs?.src;
|
|
39
|
-
return (_jsx("div", { style: {
|
|
40
|
-
position: 'relative',
|
|
41
|
-
width: '100%',
|
|
42
|
-
paddingBottom: '56.25%',
|
|
43
|
-
borderRadius: '0.375rem',
|
|
44
|
-
overflow: 'hidden',
|
|
45
|
-
}, children: _jsx("iframe", { src: src, style: { position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', border: 0 }, allowFullScreen: true }) }));
|
|
46
|
-
}
|
|
47
|
-
function DefaultTable({ children }) {
|
|
48
|
-
return (_jsx("table", { className: "border-border w-full border-collapse border", children: _jsx("tbody", { children: children }) }));
|
|
49
|
-
}
|
|
50
|
-
function DefaultTableRow({ children }) {
|
|
51
|
-
return _jsx("tr", { className: "border-border border-b last:border-b-0", children: children });
|
|
52
|
-
}
|
|
53
|
-
function DefaultTableCell({ children }) {
|
|
54
|
-
return _jsx("td", { className: "border-border border px-3 py-2 align-top", children: children });
|
|
55
|
-
}
|
|
56
|
-
function DefaultTableHeader({ children }) {
|
|
57
|
-
return _jsx("th", { className: "border-border bg-muted border px-3 py-2 text-left align-top font-semibold", children: children });
|
|
58
|
-
}
|
|
59
|
-
function DefaultBold({ children }) {
|
|
60
|
-
return _jsx("strong", { children: children });
|
|
61
|
-
}
|
|
62
|
-
function DefaultItalic({ children }) {
|
|
63
|
-
return _jsx("em", { children: children });
|
|
64
|
-
}
|
|
65
|
-
function DefaultUnderline({ children }) {
|
|
66
|
-
return _jsx("u", { children: children });
|
|
67
|
-
}
|
|
68
|
-
function DefaultStrike({ children }) {
|
|
69
|
-
return _jsx("s", { children: children });
|
|
70
|
-
}
|
|
71
|
-
function DefaultCode({ children }) {
|
|
72
|
-
return _jsx("code", { children: children });
|
|
73
|
-
}
|
|
74
|
-
function DefaultLink({ mark, children }) {
|
|
75
|
-
const href = mark.attrs?.href;
|
|
76
|
-
const target = mark.attrs?.target;
|
|
77
|
-
const rel = mark.attrs?.rel;
|
|
78
|
-
return (_jsx("a", { href: href, target: target, rel: rel, children: children }));
|
|
79
|
-
}
|
|
80
|
-
const DEFAULT_NODES = {
|
|
81
|
-
paragraph: DefaultParagraph,
|
|
82
|
-
heading: DefaultHeading,
|
|
83
|
-
bulletList: DefaultBulletList,
|
|
84
|
-
orderedList: DefaultOrderedList,
|
|
85
|
-
listItem: DefaultListItem,
|
|
86
|
-
blockquote: DefaultBlockquote,
|
|
87
|
-
codeBlock: DefaultCodeBlock,
|
|
88
|
-
horizontalRule: DefaultHorizontalRule,
|
|
89
|
-
hardBreak: DefaultHardBreak,
|
|
90
|
-
image: DefaultImage,
|
|
91
|
-
table: DefaultTable,
|
|
92
|
-
tableRow: DefaultTableRow,
|
|
93
|
-
tableCell: DefaultTableCell,
|
|
94
|
-
tableHeader: DefaultTableHeader,
|
|
95
|
-
iframe: DefaultIframe,
|
|
96
|
-
};
|
|
97
|
-
const DEFAULT_MARKS = {
|
|
98
|
-
bold: DefaultBold,
|
|
99
|
-
strong: DefaultBold,
|
|
100
|
-
italic: DefaultItalic,
|
|
101
|
-
em: DefaultItalic,
|
|
102
|
-
underline: DefaultUnderline,
|
|
103
|
-
strike: DefaultStrike,
|
|
104
|
-
code: DefaultCode,
|
|
105
|
-
link: DefaultLink,
|
|
106
|
-
};
|
|
107
|
-
function renderNode(node, components, key) {
|
|
108
|
-
if (node.type === 'text') {
|
|
109
|
-
let result = node.text ?? '';
|
|
110
|
-
if (node.marks) {
|
|
111
|
-
for (const mark of node.marks) {
|
|
112
|
-
const MarkComponent = components?.[mark.type] ?? DEFAULT_MARKS[mark.type];
|
|
113
|
-
if (MarkComponent) {
|
|
114
|
-
result = _jsx(MarkComponent, { mark: mark, children: result });
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return _jsx(Fragment, { children: result }, key);
|
|
119
|
-
}
|
|
120
|
-
const children = node.content?.map((child, index) => renderNode(child, components, index)) ?? null;
|
|
121
|
-
if (node.type === 'doc') {
|
|
122
|
-
return _jsx(Fragment, { children: children }, key);
|
|
123
|
-
}
|
|
124
|
-
const NodeComponent = components?.[node.type] ?? DEFAULT_NODES[node.type];
|
|
125
|
-
if (NodeComponent) {
|
|
126
|
-
return (_jsx(NodeComponent, { node: node, children: children }, key));
|
|
127
|
-
}
|
|
128
|
-
return _jsx(Fragment, { children: children }, key);
|
|
129
|
-
}
|
|
130
|
-
export function RichTextRenderer({ document, source, components, elementRef, ...props }) {
|
|
131
|
-
if (!document) {
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
return (_jsx("div", { ref: elementRef, ...props, "data-fimo-source": source, "data-fimo-richtext": "", children: renderNode(document, components, 0) }));
|
|
135
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { StaticImageProps } from '../contracts.js';
|
|
2
|
-
export type { StaticImageProps } from '../contracts.js';
|
|
3
|
-
/**
|
|
4
|
-
* Optimized image component for non-schema images.
|
|
5
|
-
*
|
|
6
|
-
* Use `StaticImage` for images that don't come from the database —
|
|
7
|
-
* decorative images, hardcoded URLs, generated assets, or any image
|
|
8
|
-
* where you have a direct URL string rather than a `FimoMedia` value
|
|
9
|
-
* from schema hooks.
|
|
10
|
-
*
|
|
11
|
-
* Provides the same Cloudflare Image Resizing optimization as `<Image>`
|
|
12
|
-
* (responsive srcset, quality, format=auto) but without requiring a
|
|
13
|
-
* `FimoMedia` instance or database source tracking.
|
|
14
|
-
*
|
|
15
|
-
* For schema-backed media, use `<Image value={post.cover} />` instead.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* // Basic usage
|
|
19
|
-
* <StaticImage src="/images/hero.jpg" alt="Hero background" width={1200} height={630} />
|
|
20
|
-
*
|
|
21
|
-
* // With Cloudflare optimization
|
|
22
|
-
* <StaticImage src="https://...fimo.site/uploads/photo.jpg" alt="Team" width={800} fit="cover" />
|
|
23
|
-
*
|
|
24
|
-
* // Responsive mode
|
|
25
|
-
* <StaticImage
|
|
26
|
-
* src="https://...fimo.site/uploads/banner.jpg"
|
|
27
|
-
* alt="Banner"
|
|
28
|
-
* sizes="(max-width: 768px) 100vw, 50vw"
|
|
29
|
-
* />
|
|
30
|
-
*
|
|
31
|
-
* // Skip optimization
|
|
32
|
-
* <StaticImage src="/images/logo.svg" alt="Logo" unoptimized />
|
|
33
|
-
*/
|
|
34
|
-
export declare function StaticImage(props: StaticImageProps): import("react/jsx-runtime").JSX.Element | null;
|
|
35
|
-
//# sourceMappingURL=StaticImage.d.ts.map
|