fimo-react 2.10.4-staging.2 → 2.11.0-staging.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # fimo-react
2
2
 
3
+ [Fimo](https://fimo.ai) is the website platform for sites built with coding
4
+ agents: CMS, previews, site agents, and hosting. To create a site, run
5
+ `npx fimo@latest init my-site`, or `npx fimo@latest new my-site` if you have no
6
+ account yet. Coding agents can follow the setup guide at
7
+ [fimo.new](https://fimo.new), and the
8
+ [quickstart](https://fimo.ai/docs/get-started/quickstart) covers the rest.
9
+
3
10
  The React runtime for Fimo projects. Install it alongside `fimo` at the same
4
11
  version:
5
12
 
@@ -1,4 +1,11 @@
1
1
  import { FimoString } from 'fimo/primitives';
2
+ interface LabelHotContext {
3
+ on(event: string, cb: (payload: unknown) => void): void;
4
+ off(event: string, cb: (payload: unknown) => void): void;
5
+ send(event: string, data: unknown): void;
6
+ dispose(cb: () => void): void;
7
+ }
8
+ export declare function listenForLabelUpdates(hot: LabelHotContext): void;
2
9
  /**
3
10
  * Hook to provide a label function (`t`).
4
11
  *
@@ -25,4 +32,5 @@ export declare function useTranslations(): {
25
32
  t: (fullKey: string) => FimoString;
26
33
  locale: string;
27
34
  };
35
+ export {};
28
36
  //# sourceMappingURL=translations.d.ts.map
@@ -56,18 +56,22 @@ function applyLabelUpdate(payload) {
56
56
  const updatedAt = typeof payload.updatedAt === 'string' ? payload.updatedAt : null;
57
57
  setLabelState({ dictionaries, defaultLocale, signature, updatedAt });
58
58
  }
59
+ export function listenForLabelUpdates(hot) {
60
+ const requestLabels = () => {
61
+ hot.send('fimo:labels-sync', { signature: labelState.signature });
62
+ };
63
+ hot.on('fimo:labels-updated', applyLabelUpdate);
64
+ hot.on('vite:ws:connect', requestLabels);
65
+ hot.dispose(() => {
66
+ hot.off('fimo:labels-updated', applyLabelUpdate);
67
+ hot.off('vite:ws:connect', requestLabels);
68
+ });
69
+ requestLabels();
70
+ }
59
71
  // @ts-ignore - import.meta.hot is provided by Vite during development.
60
72
  if (import.meta.hot) {
61
- const onLabelsUpdated = (payload) => {
62
- applyLabelUpdate(payload);
63
- };
64
- // @ts-ignore - import.meta.hot is provided by Vite during development.
65
- import.meta.hot.on('fimo:labels-updated', onLabelsUpdated);
66
73
  // @ts-ignore - import.meta.hot is provided by Vite during development.
67
- import.meta.hot.dispose(() => {
68
- // @ts-ignore - import.meta.hot is provided by Vite during development.
69
- import.meta.hot.off('fimo:labels-updated', onLabelsUpdated);
70
- });
74
+ listenForLabelUpdates(import.meta.hot);
71
75
  }
72
76
  /**
73
77
  * Hook to provide a label function (`t`).
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "fimo-react",
3
- "version": "2.10.4-staging.2",
4
- "description": "Fimo React runtime: content clients, labels, and source-tracked primitives.",
3
+ "version": "2.11.0-staging.1",
4
+ "description": "React runtime for Fimo, the website platform for sites built with coding agents: CMS, previews, site agents, and hosting. Provides content clients, labels, and source-tracked primitives.",
5
+ "keywords": [
6
+ "cms",
7
+ "fimo",
8
+ "headless-cms",
9
+ "react",
10
+ "website-platform"
11
+ ],
12
+ "homepage": "https://fimo.ai",
5
13
  "files": [
6
14
  "dist/",
7
15
  "!dist/**/*.d.ts.map",
@@ -43,12 +51,12 @@
43
51
  "test:watch": "vitest"
44
52
  },
45
53
  "devDependencies": {
46
- "@fimo/tsconfig": "2.10.4-staging.2",
54
+ "@fimo/tsconfig": "2.11.0-staging.1",
47
55
  "@tanstack/react-query": "^5.80.6",
48
56
  "@types/node": "22.18.6",
49
57
  "@types/react": "19.2.14",
50
58
  "@types/react-dom": "19.2.3",
51
- "fimo": "2.10.4-staging.2",
59
+ "fimo": "2.11.0-staging.1",
52
60
  "react": "19.2.4",
53
61
  "react-dom": "19.2.4",
54
62
  "typescript": "7.0.2",
@@ -57,7 +65,7 @@
57
65
  },
58
66
  "peerDependencies": {
59
67
  "@tanstack/react-query": "^5.80.6",
60
- "fimo": "2.10.4-staging.2",
68
+ "fimo": "2.11.0-staging.1",
61
69
  "react": "^18.2.0 || ^19.0.0",
62
70
  "react-dom": "^18.2.0 || ^19.0.0"
63
71
  },