fimo 0.3.1 → 0.3.2-experimental.1783328062928

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/README.md +6 -12
  2. package/assets/agents-starter/AGENTS.md +14 -2
  3. package/assets/skills/fimo/SKILL.md +1 -1
  4. package/assets/skills/fimo/references/content.md +14 -2
  5. package/assets/skills/fimo/references/setup-plain-vite.md +8 -3
  6. package/assets/skills/fimo/references/setup-react-router.md +13 -6
  7. package/assets/skills/fimo/references/ui.md +1 -1
  8. package/assets/skills/fimo-cli/SKILL.md +30 -18
  9. package/assets/skills/fimo-cli/references/account.md +4 -2
  10. package/assets/skills/fimo-cli/references/agent-setup.md +14 -16
  11. package/assets/skills/fimo-cli/references/agents.md +2 -0
  12. package/assets/skills/fimo-cli/references/analytics.md +2 -0
  13. package/assets/skills/fimo-cli/references/assets.md +2 -0
  14. package/assets/skills/fimo-cli/references/branches.md +2 -0
  15. package/assets/skills/fimo-cli/references/content.md +3 -1
  16. package/assets/skills/fimo-cli/references/credits.md +2 -0
  17. package/assets/skills/fimo-cli/references/deploy.md +10 -4
  18. package/assets/skills/fimo-cli/references/describe.md +2 -0
  19. package/assets/skills/fimo-cli/references/domains.md +2 -0
  20. package/assets/skills/fimo-cli/references/forms.md +2 -0
  21. package/assets/skills/fimo-cli/references/init.md +114 -0
  22. package/assets/skills/fimo-cli/references/integrations/firecrawl.md +2 -0
  23. package/assets/skills/fimo-cli/references/integrations.md +2 -0
  24. package/assets/skills/fimo-cli/references/invite.md +2 -0
  25. package/assets/skills/fimo-cli/references/labels.md +2 -0
  26. package/assets/skills/fimo-cli/references/locales.md +2 -0
  27. package/assets/skills/fimo-cli/references/media.md +2 -0
  28. package/assets/skills/fimo-cli/references/preview.md +2 -0
  29. package/assets/skills/fimo-cli/references/project-vars-and-secrets.md +3 -1
  30. package/assets/skills/fimo-cli/references/projects.md +5 -3
  31. package/assets/skills/fimo-cli/references/schedules.md +2 -0
  32. package/assets/skills/fimo-migration/SKILL.md +16 -1
  33. package/assets/skills/fimo-migration/references/manifest.md +40 -1
  34. package/assets/skills/fimo-migration/references/qa.md +21 -2
  35. package/assets/skills/fimo-migration/references/workflow.md +12 -1
  36. package/assets/skills/fimo-migration/references/wrap.md +155 -0
  37. package/assets/skills/fimo-studio/references/visual-editing.md +5 -3
  38. package/dist/build/vite/index.d.ts.map +1 -1
  39. package/dist/build/vite/index.js +8 -6
  40. package/dist/build/vite/plugins/translations.d.ts +2 -8
  41. package/dist/build/vite/plugins/translations.d.ts.map +1 -1
  42. package/dist/build/vite/plugins/translations.js +3 -121
  43. package/dist/cli/bundle.json +2 -2
  44. package/dist/cli/index.js +4547 -3255
  45. package/dist/runtime/app/FimoProviders.d.ts +1 -11
  46. package/dist/runtime/app/FimoProviders.d.ts.map +1 -1
  47. package/dist/runtime/app/FimoProviders.js +2 -23
  48. package/dist/runtime/i18n/FimoLocaleContext.d.ts.map +1 -1
  49. package/dist/runtime/i18n/FimoLocaleContext.js +1 -0
  50. package/dist/runtime/next/FimoFileLink.d.ts +17 -0
  51. package/dist/runtime/next/FimoFileLink.d.ts.map +1 -0
  52. package/dist/runtime/next/FimoFileLink.js +19 -0
  53. package/dist/runtime/next/FimoMediaImage.d.ts +14 -0
  54. package/dist/runtime/next/FimoMediaImage.d.ts.map +1 -0
  55. package/dist/runtime/next/FimoMediaImage.js +20 -0
  56. package/dist/runtime/next/FimoMediaVideo.d.ts +14 -0
  57. package/dist/runtime/next/FimoMediaVideo.d.ts.map +1 -0
  58. package/dist/runtime/next/FimoMediaVideo.js +20 -0
  59. package/dist/runtime/next/FimoNextProviders.d.ts +30 -0
  60. package/dist/runtime/next/FimoNextProviders.d.ts.map +1 -0
  61. package/dist/runtime/next/FimoNextProviders.js +106 -0
  62. package/dist/runtime/next/FimoNextScripts.d.ts +10 -0
  63. package/dist/runtime/next/FimoNextScripts.d.ts.map +1 -0
  64. package/dist/runtime/next/FimoNextScripts.js +19 -0
  65. package/dist/runtime/next/FimoRichTextBlock.d.ts +23 -0
  66. package/dist/runtime/next/FimoRichTextBlock.d.ts.map +1 -0
  67. package/dist/runtime/next/FimoRichTextBlock.js +22 -0
  68. package/dist/runtime/next/FimoText.d.ts +22 -0
  69. package/dist/runtime/next/FimoText.d.ts.map +1 -0
  70. package/dist/runtime/next/FimoText.js +20 -0
  71. package/dist/runtime/next/WrappedContentContext.d.ts +28 -0
  72. package/dist/runtime/next/WrappedContentContext.d.ts.map +1 -0
  73. package/dist/runtime/next/WrappedContentContext.js +30 -0
  74. package/dist/runtime/next/index.d.ts +14 -0
  75. package/dist/runtime/next/index.d.ts.map +1 -0
  76. package/dist/runtime/next/index.js +14 -0
  77. package/dist/runtime/next/server.d.ts +33 -0
  78. package/dist/runtime/next/server.d.ts.map +1 -0
  79. package/dist/runtime/next/server.js +107 -0
  80. package/dist/runtime/primitives/labels-hook.d.ts +33 -0
  81. package/dist/runtime/primitives/labels-hook.d.ts.map +1 -0
  82. package/dist/runtime/primitives/labels-hook.js +41 -0
  83. package/dist/runtime/primitives/labels-store.d.ts +12 -0
  84. package/dist/runtime/primitives/labels-store.d.ts.map +1 -0
  85. package/dist/runtime/primitives/labels-store.js +60 -0
  86. package/dist/runtime/primitives/labels-store.test.d.ts +2 -0
  87. package/dist/runtime/primitives/labels-store.test.d.ts.map +1 -0
  88. package/dist/runtime/primitives/labels-store.test.js +66 -0
  89. package/dist/runtime/primitives/lib/useFimoLiveValue.d.ts +5 -3
  90. package/dist/runtime/primitives/lib/useFimoLiveValue.d.ts.map +1 -1
  91. package/dist/runtime/primitives/lib/useFimoLiveValue.js +8 -4
  92. package/dist/runtime/primitives/translations.d.ts +1 -27
  93. package/dist/runtime/primitives/translations.d.ts.map +1 -1
  94. package/dist/runtime/primitives/translations.js +7 -85
  95. package/dist/runtime/react/index.d.ts +24 -0
  96. package/dist/runtime/react/index.d.ts.map +1 -0
  97. package/dist/runtime/react/index.js +28 -0
  98. package/dist/runtime/shared/display-routes.d.ts +14 -0
  99. package/dist/runtime/shared/display-routes.d.ts.map +1 -0
  100. package/dist/runtime/shared/display-routes.js +25 -0
  101. package/dist/runtime/shared/fimo-config.server.d.ts.map +1 -1
  102. package/dist/runtime/shared/fimo-config.server.js +1 -0
  103. package/dist/runtime/shared/fimo-config.types.d.ts +2 -0
  104. package/dist/runtime/shared/fimo-config.types.d.ts.map +1 -1
  105. package/dist/runtime/shared/labels-fetch.server.d.ts +14 -0
  106. package/dist/runtime/shared/labels-fetch.server.d.ts.map +1 -0
  107. package/dist/runtime/shared/labels-fetch.server.js +145 -0
  108. package/dist/scripts/detect-framework.d.ts +12 -0
  109. package/dist/scripts/detect-framework.js +32 -0
  110. package/dist/scripts/detect-framework.test.d.ts +1 -0
  111. package/dist/scripts/detect-framework.test.js +39 -0
  112. package/dist/scripts/lib/discover-next-routes.d.ts +11 -0
  113. package/dist/scripts/lib/discover-next-routes.js +76 -0
  114. package/dist/scripts/lib/discover-next-routes.test.d.ts +1 -0
  115. package/dist/scripts/lib/discover-next-routes.test.js +40 -0
  116. package/dist/scripts/scan-wrappable.d.ts +29 -0
  117. package/dist/scripts/scan-wrappable.js +191 -0
  118. package/dist/scripts/scan-wrappable.test.d.ts +1 -0
  119. package/dist/scripts/scan-wrappable.test.js +48 -0
  120. package/dist/scripts/validate-route-metadata.js +11 -0
  121. package/dist/scripts/validate-schemas.d.ts +13 -0
  122. package/dist/scripts/validate-schemas.js +113 -0
  123. package/dist/scripts/validate-schemas.test.d.ts +1 -0
  124. package/dist/scripts/validate-schemas.test.js +132 -0
  125. package/package.json +29 -1
  126. package/release.json +2 -2
  127. package/scripts/postinstall.mjs +10 -54
  128. package/templates/react-router/package.json +1 -1
  129. package/assets/agents-starter/claude/settings.json +0 -19
  130. package/assets/skills/fimo-cli/references/create.md +0 -90
@@ -1,15 +1,5 @@
1
1
  import React from 'react';
2
- export interface ParamInfo {
3
- schema: string;
4
- queryField: string;
5
- displayField: string;
6
- }
7
- export interface DisplayRoute {
8
- id: string;
9
- name: string;
10
- path: string;
11
- params?: Record<string, ParamInfo>;
12
- }
2
+ export type { DisplayRoute, ParamInfo } from '../shared/display-routes.js';
13
3
  export interface FimoProvidersProps {
14
4
  children?: React.ReactNode;
15
5
  locale?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"FimoProviders.d.ts","sourceRoot":"","sources":["../../../src/runtime/app/FimoProviders.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAezE,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC;AAwFD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,kBAAkB,2CAwCrE"}
1
+ {"version":3,"file":"FimoProviders.d.ts","sourceRoot":"","sources":["../../../src/runtime/app/FimoProviders.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAgBzE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AA+D3E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,kBAAkB,2CAwCrE"}
@@ -11,31 +11,10 @@ import { ViteLifecycles } from '../core/ViteLifecycles.js';
11
11
  import { FimoLocaleProvider } from '../i18n/FimoLocaleContext.js';
12
12
  import { getFimoTextDirection, resolveFimoLocale, toHtmlLang } from '../i18n/locale.js';
13
13
  import { ScreenshotProvider } from '../iframe/ScreenshotProvider.js';
14
+ import { getDisplayRoutes as getDisplayRoutesFromConfig } from '../shared/display-routes.js';
14
15
  import { OptionalTracking } from '../t/OptionalTracking.js';
15
- const titleCase = (seg) => seg
16
- .replace(/[_\-]+/g, ' ')
17
- .replace(/([a-z])([A-Z])/g, '$1 $2')
18
- .split(/\s+/)
19
- .filter(Boolean)
20
- .map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
21
- .join(' ');
22
- const generateRouteName = (path) => {
23
- if (path === '/') {
24
- return 'Home';
25
- }
26
- const firstSegment = path.replace(/^\//, '').split('/')[0];
27
- return titleCase(firstSegment);
28
- };
29
16
  function getDisplayRoutes() {
30
- const configRoutes = fimoConfig.routes ?? {};
31
- return Object.entries(configRoutes)
32
- .filter(([, route]) => route.path)
33
- .map(([id, route]) => ({
34
- id,
35
- path: route.path,
36
- name: route.name || generateRouteName(route.path),
37
- params: route.params,
38
- }));
17
+ return getDisplayRoutesFromConfig(fimoConfig);
39
18
  }
40
19
  function PreviewBridge() {
41
20
  const navigate = useNavigate();
@@ -1 +1 @@
1
- {"version":3,"file":"FimoLocaleContext.d.ts","sourceRoot":"","sources":["../../../src/runtime/i18n/FimoLocaleContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,oBAAoB,EACpB,QAAQ,GAAG,eAAe,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,KAAK,CAC1E,CAAC;AAaF,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,KAAK,EAAE,sBAAsB,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAEpH;AAED,wBAAgB,SAAS,IAAI,sBAAsB,CAElD"}
1
+ {"version":3,"file":"FimoLocaleContext.d.ts","sourceRoot":"","sources":["../../../src/runtime/i18n/FimoLocaleContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,oBAAoB,EACpB,QAAQ,GAAG,eAAe,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,KAAK,CAC1E,CAAC;AAaF,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,KAAK,EAAE,sBAAsB,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAEpH;AAED,wBAAgB,SAAS,IAAI,sBAAsB,CAElD"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { createContext, useContext } from 'react';
3
4
  const fallbackLocale = {
@@ -0,0 +1,17 @@
1
+ import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
2
+ type FimoFileLinkProps = Omit<ComponentPropsWithoutRef<'a'>, 'id'> & {
3
+ /** WrappedMedia entry key, e.g. `home.whitepaper`. Seeded at migration time. */
4
+ id: string;
5
+ children?: ReactNode;
6
+ };
7
+ /**
8
+ * Wraps a hardcoded file link (pdf, zip, ...) so the file becomes replaceable
9
+ * in Fimo. The original `href` stays in code as the fallback:
10
+ *
11
+ * <FimoFileLink id="home.whitepaper" href="/whitepaper.pdf">
12
+ * <FimoText id="home.whitepaper.cta">Download the whitepaper</FimoText>
13
+ * </FimoFileLink>
14
+ */
15
+ export declare function FimoFileLink({ id, href, children, ...props }: FimoFileLinkProps): import("react/jsx-runtime").JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=FimoFileLink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FimoFileLink.d.ts","sourceRoot":"","sources":["../../../src/runtime/next/FimoFileLink.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKtE,KAAK,iBAAiB,GAAG,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG;IACnE,gFAAgF;IAChF,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,2CAgB/E"}
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { FIMO_SOURCE } from '../primitives/lib/index.js';
4
+ import { useWrappedMedia } from './WrappedContentContext.js';
5
+ /**
6
+ * Wraps a hardcoded file link (pdf, zip, ...) so the file becomes replaceable
7
+ * in Fimo. The original `href` stays in code as the fallback:
8
+ *
9
+ * <FimoFileLink id="home.whitepaper" href="/whitepaper.pdf">
10
+ * <FimoText id="home.whitepaper.cta">Download the whitepaper</FimoText>
11
+ * </FimoFileLink>
12
+ */
13
+ export function FimoFileLink({ id, href, children, ...props }) {
14
+ const media = useWrappedMedia(id);
15
+ if (media) {
16
+ return (_jsx("a", { href: media.url, "data-fimo-source": media[FIMO_SOURCE], ...props, children: children }));
17
+ }
18
+ return (_jsx("a", { href: href, ...props, children: children }));
19
+ }
@@ -0,0 +1,14 @@
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
+ type FimoMediaImageProps = Omit<ComponentPropsWithoutRef<'img'>, 'id' | 'children'> & {
3
+ /** WrappedMedia entry key, e.g. `home.hero.image`. Seeded at migration time. */
4
+ id: string;
5
+ };
6
+ /**
7
+ * Wraps a hardcoded image so it becomes replaceable in Fimo. The original
8
+ * `src` stays in code as the fallback until the WrappedMedia entry resolves:
9
+ *
10
+ * <FimoMediaImage id="home.hero.image" src="/images/dashboard.png" alt="Dashboard" width={1200} height={630} />
11
+ */
12
+ export declare function FimoMediaImage({ id, src, alt, ...props }: FimoMediaImageProps): import("react/jsx-runtime").JSX.Element | null;
13
+ export {};
14
+ //# sourceMappingURL=FimoMediaImage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FimoMediaImage.d.ts","sourceRoot":"","sources":["../../../src/runtime/next/FimoMediaImage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAKtD,KAAK,mBAAmB,GAAG,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,UAAU,CAAC,GAAG;IACpF,gFAAgF;IAChF,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,kDAY7E"}
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Image } from '../primitives/components/Image.js';
4
+ import { useWrappedMedia } from './WrappedContentContext.js';
5
+ /**
6
+ * Wraps a hardcoded image so it becomes replaceable in Fimo. The original
7
+ * `src` stays in code as the fallback until the WrappedMedia entry resolves:
8
+ *
9
+ * <FimoMediaImage id="home.hero.image" src="/images/dashboard.png" alt="Dashboard" width={1200} height={630} />
10
+ */
11
+ export function FimoMediaImage({ id, src, alt, ...props }) {
12
+ const media = useWrappedMedia(id);
13
+ if (media) {
14
+ return _jsx(Image, { value: media, alt: alt, ...props });
15
+ }
16
+ if (!src) {
17
+ return null;
18
+ }
19
+ return _jsx("img", { src: src, alt: alt, ...props });
20
+ }
@@ -0,0 +1,14 @@
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
+ type FimoMediaVideoProps = Omit<ComponentPropsWithoutRef<'video'>, 'id' | 'children'> & {
3
+ /** WrappedMedia entry key, e.g. `home.demo.video`. Seeded at migration time. */
4
+ id: string;
5
+ };
6
+ /**
7
+ * Wraps a hardcoded video so it becomes replaceable in Fimo. The original
8
+ * `src` stays in code as the fallback until the WrappedMedia entry resolves:
9
+ *
10
+ * <FimoMediaVideo id="home.demo.video" src="/demo.mp4" autoPlay muted loop />
11
+ */
12
+ export declare function FimoMediaVideo({ id, src, autoPlay, loop, muted, playsInline, ...props }: FimoMediaVideoProps): import("react/jsx-runtime").JSX.Element | null;
13
+ export {};
14
+ //# sourceMappingURL=FimoMediaVideo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FimoMediaVideo.d.ts","sourceRoot":"","sources":["../../../src/runtime/next/FimoMediaVideo.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAKtD,KAAK,mBAAmB,GAAG,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,IAAI,GAAG,UAAU,CAAC,GAAG;IACtF,gFAAgF;IAChF,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,kDAY5G"}
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Video } from '../primitives/components/Video.js';
4
+ import { useWrappedMedia } from './WrappedContentContext.js';
5
+ /**
6
+ * Wraps a hardcoded video so it becomes replaceable in Fimo. The original
7
+ * `src` stays in code as the fallback until the WrappedMedia entry resolves:
8
+ *
9
+ * <FimoMediaVideo id="home.demo.video" src="/demo.mp4" autoPlay muted loop />
10
+ */
11
+ export function FimoMediaVideo({ id, src, autoPlay, loop, muted, playsInline, ...props }) {
12
+ const media = useWrappedMedia(id);
13
+ if (media) {
14
+ return _jsx(Video, { value: media, autoPlay: autoPlay, loop: loop, muted: muted, playsInline: playsInline, ...props });
15
+ }
16
+ if (!src) {
17
+ return null;
18
+ }
19
+ return _jsx("video", { src: src, autoPlay: autoPlay, loop: loop, muted: muted, playsInline: playsInline, ...props });
20
+ }
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import type { FimoConfig } from '../shared/fimo-config.types.js';
3
+ import { type WrappedMediaEntry, type WrappedRichTextEntry } from './WrappedContentContext.js';
4
+ export interface FimoNextLabels {
5
+ dictionaries: Record<string, Record<string, string>>;
6
+ defaultLocale: string;
7
+ locales?: string[];
8
+ updatedAt?: string | null;
9
+ signature: string;
10
+ }
11
+ export interface FimoNextProvidersProps {
12
+ config: FimoConfig;
13
+ labels?: FimoNextLabels;
14
+ media?: Record<string, WrappedMediaEntry>;
15
+ richText?: Record<string, WrappedRichTextEntry>;
16
+ locale?: string;
17
+ children?: React.ReactNode;
18
+ }
19
+ /**
20
+ * Fimo providers for wrapped Next.js apps. Mount once in the root layout:
21
+ *
22
+ * const config = loadFimoConfig();
23
+ * const labels = await loadFimoLabels();
24
+ * <FimoNextProviders config={config} labels={labels}>{children}</FimoNextProviders>
25
+ *
26
+ * Unlike the react-router flavor there are no Vite virtual modules: config and
27
+ * content arrive as serializable props from `fimo/next/server` loaders.
28
+ */
29
+ export declare function FimoNextProviders({ config, labels, media, richText, locale, children }: FimoNextProvidersProps): import("react/jsx-runtime").JSX.Element;
30
+ //# sourceMappingURL=FimoNextProviders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FimoNextProviders.d.ts","sourceRoot":"","sources":["../../../src/runtime/next/FimoNextProviders.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA8D,MAAM,OAAO,CAAC;AAUnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAA0B,KAAK,iBAAiB,EAAE,KAAK,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEvH,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAgED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,sBAAsB,2CAqD9G"}
@@ -0,0 +1,106 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
4
+ import { usePathname, useRouter } from 'next/navigation';
5
+ import { Suspense, useCallback, useEffect, useMemo, useState } from 'react';
6
+ import { ErrorBoundary } from 'react-error-boundary';
7
+ import { DataSourcesProvider } from '../content/DataSourcesProvider.js';
8
+ import { AppErrorBoundary, onError } from '../core/AppErrorBoundary.js';
9
+ import { FimoLocaleProvider } from '../i18n/FimoLocaleContext.js';
10
+ import { getFimoTextDirection, resolveFimoLocale, toHtmlLang } from '../i18n/locale.js';
11
+ import { ScreenshotProvider } from '../iframe/ScreenshotProvider.js';
12
+ import { hydrateLabels } from '../primitives/labels-store.js';
13
+ import { getDisplayRoutes } from '../shared/display-routes.js';
14
+ import { WrappedContentProvider } from './WrappedContentContext.js';
15
+ function toLabelState(labels) {
16
+ return {
17
+ dictionaries: labels.dictionaries,
18
+ defaultLocale: labels.defaultLocale,
19
+ signature: labels.signature,
20
+ updatedAt: labels.updatedAt ?? null,
21
+ };
22
+ }
23
+ function PreviewBridge({ config }) {
24
+ const router = useRouter();
25
+ const pathname = usePathname();
26
+ const localeResolution = useMemo(() => resolveFimoLocale({ pathname }, config), [pathname, config]);
27
+ const sendRoutes = useCallback(() => {
28
+ window.parent.postMessage({ type: 'nav/routes', payload: { routes: getDisplayRoutes(config) } }, '*');
29
+ }, [config]);
30
+ const sendLocationChange = useCallback(() => {
31
+ window.parent.postMessage({
32
+ type: 'nav/locationChange',
33
+ payload: {
34
+ path: pathname,
35
+ routePath: localeResolution.routePath,
36
+ locale: localeResolution.locale,
37
+ },
38
+ }, '*');
39
+ }, [pathname, localeResolution.locale, localeResolution.routePath]);
40
+ useEffect(sendRoutes, [sendRoutes]);
41
+ useEffect(sendLocationChange, [sendLocationChange]);
42
+ useEffect(() => {
43
+ const handleMessage = (event) => {
44
+ const type = event.data?.type;
45
+ const payload = event.data?.payload;
46
+ switch (type) {
47
+ case 'nav/navigate':
48
+ if (payload?.to) {
49
+ router.push(payload.to);
50
+ }
51
+ return;
52
+ case 'nav/read-routes':
53
+ sendRoutes();
54
+ sendLocationChange();
55
+ return;
56
+ }
57
+ };
58
+ window.addEventListener('message', handleMessage);
59
+ return () => {
60
+ window.removeEventListener('message', handleMessage);
61
+ };
62
+ }, [router, sendRoutes, sendLocationChange]);
63
+ return null;
64
+ }
65
+ /**
66
+ * Fimo providers for wrapped Next.js apps. Mount once in the root layout:
67
+ *
68
+ * const config = loadFimoConfig();
69
+ * const labels = await loadFimoLabels();
70
+ * <FimoNextProviders config={config} labels={labels}>{children}</FimoNextProviders>
71
+ *
72
+ * Unlike the react-router flavor there are no Vite virtual modules: config and
73
+ * content arrive as serializable props from `fimo/next/server` loaders.
74
+ */
75
+ export function FimoNextProviders({ config, labels, media, richText, locale, children }) {
76
+ // Wrapped apps have no QueryClientProvider of their own; ScreenshotProvider
77
+ // (and future data-refresh machinery) need one, so the adapter owns it.
78
+ const [queryClient] = useState(() => new QueryClient());
79
+ useState(() => {
80
+ if (labels) {
81
+ hydrateLabels(toLabelState(labels));
82
+ }
83
+ return null;
84
+ });
85
+ useEffect(() => {
86
+ if (labels) {
87
+ hydrateLabels(toLabelState(labels));
88
+ }
89
+ }, [labels]);
90
+ const pathname = usePathname();
91
+ const localeResolution = useMemo(() => resolveFimoLocale({ pathname }, config), [pathname, config]);
92
+ const activeLocale = locale ?? localeResolution.locale;
93
+ const activeDir = getFimoTextDirection(activeLocale);
94
+ useEffect(() => {
95
+ if (typeof document === 'undefined') {
96
+ return;
97
+ }
98
+ document.documentElement.lang = toHtmlLang(activeLocale);
99
+ document.documentElement.dir = activeDir;
100
+ }, [activeDir, activeLocale]);
101
+ return (_jsx(ErrorBoundary, { FallbackComponent: AppErrorBoundary, onError: onError, children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(FimoLocaleProvider, { value: {
102
+ ...localeResolution,
103
+ locale: activeLocale,
104
+ dir: activeDir,
105
+ }, children: _jsx(WrappedContentProvider, { media: media, richText: richText, children: _jsx(DataSourcesProvider, { children: _jsxs(ScreenshotProvider, { children: [_jsx(PreviewBridge, { config: config }), _jsx(Suspense, { children: children })] }) }) }) }) }) }));
106
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Renders the Fimo preview client script in development so the Fimo Studio
3
+ * preview can select/edit elements. Mount inside <head> in the root layout.
4
+ *
5
+ * The script URL comes from NEXT_PUBLIC_FIMO_PREVIEW_SCRIPT_URL (written by
6
+ * `fimo init` for wrapped projects, pointing at `<apiUrl>/preview.js`).
7
+ * Renders nothing in production builds.
8
+ */
9
+ export declare function FimoNextScripts(): import("react/jsx-runtime").JSX.Element | null;
10
+ //# sourceMappingURL=FimoNextScripts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FimoNextScripts.d.ts","sourceRoot":"","sources":["../../../src/runtime/next/FimoNextScripts.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,eAAe,mDAW9B"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Renders the Fimo preview client script in development so the Fimo Studio
4
+ * preview can select/edit elements. Mount inside <head> in the root layout.
5
+ *
6
+ * The script URL comes from NEXT_PUBLIC_FIMO_PREVIEW_SCRIPT_URL (written by
7
+ * `fimo init` for wrapped projects, pointing at `<apiUrl>/preview.js`).
8
+ * Renders nothing in production builds.
9
+ */
10
+ export function FimoNextScripts() {
11
+ if (process.env.NODE_ENV !== 'development') {
12
+ return null;
13
+ }
14
+ const previewScriptUrl = process.env.NEXT_PUBLIC_FIMO_PREVIEW_SCRIPT_URL;
15
+ if (!previewScriptUrl) {
16
+ return null;
17
+ }
18
+ return _jsx("script", { type: "module", src: previewScriptUrl });
19
+ }
@@ -0,0 +1,23 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type FimoRichTextComponents } from '../primitives/lib/index.js';
3
+ interface FimoRichTextBlockProps {
4
+ /** WrappedRichText entry key, e.g. `home.hero.subtitle`. Seeded at migration time. */
5
+ id: string;
6
+ /** The original formatted markup — rendered when the entry is absent. */
7
+ children?: ReactNode;
8
+ components?: FimoRichTextComponents;
9
+ className?: string;
10
+ }
11
+ /**
12
+ * Wraps formatted text (bold, italic, underline, links) so it becomes
13
+ * editable with marks in Fimo. Seeding converts the original markup to
14
+ * TipTap JSON; the renderer emits the same tags back. The original JSX
15
+ * stays in code as the fallback:
16
+ *
17
+ * <FimoRichTextBlock id="home.hero.subtitle">
18
+ * <p>We help teams <strong>ship faster</strong> and <em>stay safe</em>.</p>
19
+ * </FimoRichTextBlock>
20
+ */
21
+ export declare function FimoRichTextBlock({ id, children, components, className }: FimoRichTextBlockProps): import("react/jsx-runtime").JSX.Element;
22
+ export {};
23
+ //# sourceMappingURL=FimoRichTextBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FimoRichTextBlock.d.ts","sourceRoot":"","sources":["../../../src/runtime/next/FimoRichTextBlock.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAgB,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGvF,UAAU,sBAAsB;IAC9B,sFAAsF;IACtF,EAAE,EAAE,MAAM,CAAC;IACX,yEAAyE;IACzE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,sBAAsB,2CAUhG"}
@@ -0,0 +1,22 @@
1
+ 'use client';
2
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
3
+ import { RichText } from '../primitives/components/RichText.js';
4
+ import { FimoRichText } from '../primitives/lib/index.js';
5
+ import { useWrappedRichText } from './WrappedContentContext.js';
6
+ /**
7
+ * Wraps formatted text (bold, italic, underline, links) so it becomes
8
+ * editable with marks in Fimo. Seeding converts the original markup to
9
+ * TipTap JSON; the renderer emits the same tags back. The original JSX
10
+ * stays in code as the fallback:
11
+ *
12
+ * <FimoRichTextBlock id="home.hero.subtitle">
13
+ * <p>We help teams <strong>ship faster</strong> and <em>stay safe</em>.</p>
14
+ * </FimoRichTextBlock>
15
+ */
16
+ export function FimoRichTextBlock({ id, children, components, className }) {
17
+ const entry = useWrappedRichText(id);
18
+ if (!entry) {
19
+ return _jsx(_Fragment, { children: children });
20
+ }
21
+ return (_jsx(RichText, { value: new FimoRichText(entry.content, entry.source), components: components, className: className }));
22
+ }
@@ -0,0 +1,22 @@
1
+ import { type ComponentPropsWithoutRef, type ElementType } from 'react';
2
+ type FimoTextProps<T extends ElementType = 'span'> = {
3
+ /** Label key, e.g. `home.hero.title`. Seeded at migration time. */
4
+ id: string;
5
+ /** The original hardcoded string — rendered when the key has no value. */
6
+ children?: string;
7
+ as?: T;
8
+ } & Omit<ComponentPropsWithoutRef<T>, 'id' | 'as' | 'children'>;
9
+ /**
10
+ * Wraps a hardcoded string so it becomes editable in Fimo. The original
11
+ * string stays in code as the fallback:
12
+ *
13
+ * <h1><FimoText id="home.hero.title">Ship your site in hours</FimoText></h1>
14
+ *
15
+ * For attribute strings use the two-argument label function instead:
16
+ *
17
+ * const { t } = useLabels();
18
+ * <input placeholder={String(t('home.newsletter.placeholder', 'Your work email'))} />
19
+ */
20
+ export declare function FimoText<T extends ElementType = 'span'>({ id, children, as, ...props }: FimoTextProps<T>): import("react/jsx-runtime").JSX.Element;
21
+ export {};
22
+ //# sourceMappingURL=FimoText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FimoText.d.ts","sourceRoot":"","sources":["../../../src/runtime/next/FimoText.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAKxE,KAAK,aAAa,CAAC,CAAC,SAAS,WAAW,GAAG,MAAM,IAAI;IACnD,mEAAmE;IACnE,EAAE,EAAE,MAAM,CAAC;IACX,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,CAAC,CAAC;CACR,GAAG,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,UAAU,CAAC,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,WAAW,GAAG,MAAM,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC,2CAIxG"}
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Text } from '../primitives/components/Text.js';
4
+ import { useLabels } from '../primitives/labels-hook.js';
5
+ /**
6
+ * Wraps a hardcoded string so it becomes editable in Fimo. The original
7
+ * string stays in code as the fallback:
8
+ *
9
+ * <h1><FimoText id="home.hero.title">Ship your site in hours</FimoText></h1>
10
+ *
11
+ * For attribute strings use the two-argument label function instead:
12
+ *
13
+ * const { t } = useLabels();
14
+ * <input placeholder={String(t('home.newsletter.placeholder', 'Your work email'))} />
15
+ */
16
+ export function FimoText({ id, children, as, ...props }) {
17
+ const { t } = useLabels();
18
+ const textProps = { value: t(id, children), as, ...props };
19
+ return _jsx(Text, { ...textProps });
20
+ }
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { FIMO_SOURCE, FimoMedia, type FimoRichTextContent } from '../primitives/lib/index.js';
3
+ export interface WrappedMediaEntry {
4
+ url: string;
5
+ alt?: string;
6
+ name?: string;
7
+ mime?: string;
8
+ width?: number;
9
+ height?: number;
10
+ /** data-fimo-source path, e.g. `WrappedMedia.<entryId>.image` */
11
+ source: string;
12
+ }
13
+ export interface WrappedRichTextEntry {
14
+ content: FimoRichTextContent;
15
+ /** data-fimo-source path, e.g. `WrappedRichText.<entryId>.body` */
16
+ source: string;
17
+ }
18
+ export interface WrappedContentValue {
19
+ media: Record<string, WrappedMediaEntry>;
20
+ richText: Record<string, WrappedRichTextEntry>;
21
+ }
22
+ export declare function WrappedContentProvider({ media, richText, children, }: Partial<WrappedContentValue> & {
23
+ children?: React.ReactNode;
24
+ }): import("react/jsx-runtime").JSX.Element;
25
+ export declare function useWrappedMedia(id: string): FimoMedia | null;
26
+ export declare function useWrappedRichText(id: string): WrappedRichTextEntry | null;
27
+ export { FIMO_SOURCE };
28
+ //# sourceMappingURL=WrappedContentContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WrappedContentContext.d.ts","sourceRoot":"","sources":["../../../src/runtime/next/WrappedContentContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAE9F,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;CAChD;AAMD,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAG/D;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAiB5D;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAG1E;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,30 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { createContext, useContext, useMemo } from 'react';
4
+ import { FIMO_SOURCE, FimoMedia } from '../primitives/lib/index.js';
5
+ const emptyValue = { media: {}, richText: {} };
6
+ const WrappedContentContext = createContext(emptyValue);
7
+ export function WrappedContentProvider({ media, richText, children, }) {
8
+ const value = useMemo(() => ({ media: media ?? {}, richText: richText ?? {} }), [media, richText]);
9
+ return _jsx(WrappedContentContext.Provider, { value: value, children: children });
10
+ }
11
+ export function useWrappedMedia(id) {
12
+ const { media } = useContext(WrappedContentContext);
13
+ const entry = media[id];
14
+ if (!entry) {
15
+ return null;
16
+ }
17
+ return new FimoMedia({
18
+ url: entry.url,
19
+ alt: entry.alt ?? '',
20
+ name: entry.name ?? id,
21
+ mime: entry.mime ?? '',
22
+ width: entry.width,
23
+ height: entry.height,
24
+ }, entry.source);
25
+ }
26
+ export function useWrappedRichText(id) {
27
+ const { richText } = useContext(WrappedContentContext);
28
+ return richText[id] ?? null;
29
+ }
30
+ export { FIMO_SOURCE };
@@ -0,0 +1,14 @@
1
+ export { FimoNextProviders } from './FimoNextProviders.js';
2
+ export type { FimoNextLabels, FimoNextProvidersProps } from './FimoNextProviders.js';
3
+ export { FimoNextScripts } from './FimoNextScripts.js';
4
+ export { FimoText } from './FimoText.js';
5
+ export { FimoRichTextBlock } from './FimoRichTextBlock.js';
6
+ export { FimoMediaImage } from './FimoMediaImage.js';
7
+ export { FimoMediaVideo } from './FimoMediaVideo.js';
8
+ export { FimoFileLink } from './FimoFileLink.js';
9
+ export { useWrappedMedia, useWrappedRichText } from './WrappedContentContext.js';
10
+ export type { WrappedMediaEntry, WrappedRichTextEntry } from './WrappedContentContext.js';
11
+ export { useLabels, useTranslations } from '../primitives/labels-hook.js';
12
+ export { Text, Image, Video, RichText } from '../react/index.js';
13
+ export type { FimoConfig } from '../shared/fimo-config.types.js';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/next/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACjF,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAI1F,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,14 @@
1
+ // fimo/next — the Next.js adapter for wrapped (migrated) sites.
2
+ // Client components; server loaders live in fimo/next/server.
3
+ export { FimoNextProviders } from './FimoNextProviders.js';
4
+ export { FimoNextScripts } from './FimoNextScripts.js';
5
+ export { FimoText } from './FimoText.js';
6
+ export { FimoRichTextBlock } from './FimoRichTextBlock.js';
7
+ export { FimoMediaImage } from './FimoMediaImage.js';
8
+ export { FimoMediaVideo } from './FimoMediaVideo.js';
9
+ export { FimoFileLink } from './FimoFileLink.js';
10
+ export { useWrappedMedia, useWrappedRichText } from './WrappedContentContext.js';
11
+ // Framework-neutral React surface, re-exported for convenience so wrapped
12
+ // apps import everything from fimo/next.
13
+ export { useLabels, useTranslations } from '../primitives/labels-hook.js';
14
+ export { Text, Image, Video, RichText } from '../react/index.js';
@@ -0,0 +1,33 @@
1
+ import type { FimoConfig } from '../shared/fimo-config.types.js';
2
+ import type { FimoNextLabels } from './FimoNextProviders.js';
3
+ import type { WrappedMediaEntry, WrappedRichTextEntry } from './WrappedContentContext.js';
4
+ export interface FimoServerOptions {
5
+ /** Project root (where fimo-config.json and .env live). Defaults to cwd. */
6
+ rootDir?: string;
7
+ /** Tenant API base URL. Defaults to NEXT_PUBLIC_FIMO_API_URL / VITE_API_URL. */
8
+ apiUrl?: string;
9
+ }
10
+ export declare function loadFimoConfig(rootDir?: string): FimoConfig;
11
+ export declare function loadFimoLabels(options?: FimoServerOptions): Promise<FimoNextLabels>;
12
+ export interface FimoEntry {
13
+ id: string;
14
+ data: Record<string, unknown>;
15
+ }
16
+ /**
17
+ * Fetch published entries of a content type from the public tenant API.
18
+ * Returns [] when the API is unreachable so the wrapped site keeps rendering
19
+ * its fallbacks.
20
+ */
21
+ export declare function fetchEntries(typeName: string, options?: FimoServerOptions): Promise<FimoEntry[]>;
22
+ /**
23
+ * Load the WrappedMedia entries (key → media) seeded by the wrap migration.
24
+ * Each entry has a `key` (the FimoMediaImage/Video/FileLink id) and an
25
+ * asset-typed `image` field.
26
+ */
27
+ export declare function loadWrappedMedia(options?: FimoServerOptions): Promise<Record<string, WrappedMediaEntry>>;
28
+ /**
29
+ * Load the WrappedRichText entries (key → TipTap JSON) seeded by the wrap
30
+ * migration for formatted text (bold/italic/underline/links).
31
+ */
32
+ export declare function loadWrappedRichText(options?: FimoServerOptions): Promise<Record<string, WrappedRichTextEntry>>;
33
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/runtime/next/server.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAQjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAE1F,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,cAAc,CAAC,OAAO,GAAE,MAAsB,GAAG,UAAU,CAE1E;AAED,wBAAsB,cAAc,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC,CAI7F;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAUD;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAuB1G;AAUD;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CA2BlH;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAiB/C"}