@easy-cms/next 0.4.0 → 0.6.0

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.
@@ -0,0 +1,18 @@
1
+ import { LivePreviewOptions } from '@easy-cms/core/live-preview';
2
+
3
+ /**
4
+ * Live preview for a Client Component: returns `initial` (e.g. the document a Server Component
5
+ * loaded), replaced by the document being edited while the page is shown in the admin's
6
+ * preview. Elsewhere it returns `initial` unchanged.
7
+ *
8
+ * ```tsx
9
+ * 'use client'
10
+ * export function PostView({ post }: { post: Post }) {
11
+ * const live = useLivePreview(post)
12
+ * return <h1>{live.title}</h1>
13
+ * }
14
+ * ```
15
+ */
16
+ declare function useLivePreview<T>(initial: T, options?: LivePreviewOptions): T;
17
+
18
+ export { useLivePreview };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/next",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Next.js adapter for Easy CMS",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,19 +26,19 @@
26
26
  "node": ">=22.12"
27
27
  },
28
28
  "dependencies": {
29
- "@easy-cms/admin": "^0.4.0"
29
+ "@easy-cms/admin": "^0.6.0"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "next": ">=15.0.0",
33
33
  "react": ">=19.0.0",
34
- "@easy-cms/core": "^0.4.0"
34
+ "@easy-cms/core": "^0.6.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/react": "^19.2.0",
38
38
  "next": "^16.3.6",
39
39
  "react": "^19.2.0",
40
- "@easy-cms/core": "^0.4.0",
41
- "@easy-cms/db-sqlite": "^0.4.0"
40
+ "@easy-cms/core": "^0.6.0",
41
+ "@easy-cms/db-sqlite": "^0.6.0"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public"