@cmssy/next 4.7.2 → 5.0.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.
package/README.md CHANGED
@@ -95,7 +95,7 @@ Language switcher and raw markup helpers live in `@cmssy/react`:
95
95
 
96
96
  `createCmssyPage`, `createDraftRoute`, `cmssyCspHeaders` / `applyCmssyCsp`,
97
97
  `isCmssyEditRequest` / `isCmssyEditMode`, `createCmssyLocaleMiddleware` /
98
- `resolveLocaleFromPathname`, the `CmssyNextConfig` type, and from
98
+ `resolveLocaleFromPathname`, the `CmssyConfig` type, and from
99
99
  `@cmssy/next/client`: `CmssyLink`, `CmssyLocaleProvider`, `useCmssyLocale`.
100
100
 
101
101
  ## License
@@ -0,0 +1,46 @@
1
+ import { CmssyConfig } from '@cmssy/core';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ComponentType } from 'react';
4
+ import { CmssyPageData, CmssyFormDefinition, BlockDefinition } from '@cmssy/react';
5
+ import { EditBridgeConfig } from '@cmssy/react/client';
6
+
7
+ interface CmssyEditorProps {
8
+ page: CmssyPageData;
9
+ locale: string;
10
+ defaultLocale: string;
11
+ enabledLocales?: string[];
12
+ edit: EditBridgeConfig;
13
+ forms?: Record<string, CmssyFormDefinition>;
14
+ }
15
+ interface CreateCmssyPageOptions {
16
+ editor?: ComponentType<CmssyEditorProps>;
17
+ path?: string;
18
+ }
19
+ interface CatchAllParams {
20
+ path?: string[];
21
+ }
22
+ type SearchParams = Record<string, string | string[] | undefined>;
23
+ interface CatchAllProps {
24
+ params?: Promise<CatchAllParams>;
25
+ searchParams?: Promise<SearchParams>;
26
+ }
27
+ /**
28
+ * Public catch-all page. Statically renderable: it never reads
29
+ * `searchParams` or `headers()` - awaiting either forces every route
30
+ * dynamic and kills ISR (CMS-952). Draft-mode preview (the authenticated
31
+ * /api/draft cookie) still works per-request via `draftMode()`, which is
32
+ * static-safe, and renders draft CONTENT without the editor (CMS-948).
33
+ * The editor-iframe flow (`?cmssyEdit=1&cmssySecret=...`) is served by
34
+ * the middleware rewrite (`cmssyEditRewrite`) onto the dynamic edit route
35
+ * mounted with `createCmssyEditPage`.
36
+ */
37
+ declare function createCmssyPage(config: CmssyConfig, blocks: BlockDefinition[], options?: CreateCmssyPageOptions): ({ params, searchParams, }: CatchAllProps) => Promise<react_jsx_runtime.JSX.Element>;
38
+ /**
39
+ * Editor page for the middleware-rewritten edit route
40
+ * (`app/cmssy-edit/[[...path]]/page.tsx`, `dynamic = "force-dynamic"`).
41
+ * Re-verifies the `cmssyEdit` + `cmssySecret` pair itself, so a direct hit
42
+ * on the route path (bypassing the middleware) cannot mount the editor.
43
+ */
44
+ declare function createCmssyEditPage(config: CmssyConfig, blocks: BlockDefinition[], options?: CreateCmssyPageOptions): ({ params, searchParams, }: CatchAllProps) => Promise<react_jsx_runtime.JSX.Element>;
45
+
46
+ export { type CmssyEditorProps as C, type CreateCmssyPageOptions as a, createCmssyPage as b, createCmssyEditPage as c };
@@ -0,0 +1,46 @@
1
+ import { CmssyConfig } from '@cmssy/core';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ComponentType } from 'react';
4
+ import { CmssyPageData, CmssyFormDefinition, BlockDefinition } from '@cmssy/react';
5
+ import { EditBridgeConfig } from '@cmssy/react/client';
6
+
7
+ interface CmssyEditorProps {
8
+ page: CmssyPageData;
9
+ locale: string;
10
+ defaultLocale: string;
11
+ enabledLocales?: string[];
12
+ edit: EditBridgeConfig;
13
+ forms?: Record<string, CmssyFormDefinition>;
14
+ }
15
+ interface CreateCmssyPageOptions {
16
+ editor?: ComponentType<CmssyEditorProps>;
17
+ path?: string;
18
+ }
19
+ interface CatchAllParams {
20
+ path?: string[];
21
+ }
22
+ type SearchParams = Record<string, string | string[] | undefined>;
23
+ interface CatchAllProps {
24
+ params?: Promise<CatchAllParams>;
25
+ searchParams?: Promise<SearchParams>;
26
+ }
27
+ /**
28
+ * Public catch-all page. Statically renderable: it never reads
29
+ * `searchParams` or `headers()` - awaiting either forces every route
30
+ * dynamic and kills ISR (CMS-952). Draft-mode preview (the authenticated
31
+ * /api/draft cookie) still works per-request via `draftMode()`, which is
32
+ * static-safe, and renders draft CONTENT without the editor (CMS-948).
33
+ * The editor-iframe flow (`?cmssyEdit=1&cmssySecret=...`) is served by
34
+ * the middleware rewrite (`cmssyEditRewrite`) onto the dynamic edit route
35
+ * mounted with `createCmssyEditPage`.
36
+ */
37
+ declare function createCmssyPage(config: CmssyConfig, blocks: BlockDefinition[], options?: CreateCmssyPageOptions): ({ params, searchParams, }: CatchAllProps) => Promise<react_jsx_runtime.JSX.Element>;
38
+ /**
39
+ * Editor page for the middleware-rewritten edit route
40
+ * (`app/cmssy-edit/[[...path]]/page.tsx`, `dynamic = "force-dynamic"`).
41
+ * Re-verifies the `cmssyEdit` + `cmssySecret` pair itself, so a direct hit
42
+ * on the route path (bypassing the middleware) cannot mount the editor.
43
+ */
44
+ declare function createCmssyEditPage(config: CmssyConfig, blocks: BlockDefinition[], options?: CreateCmssyPageOptions): ({ params, searchParams, }: CatchAllProps) => Promise<react_jsx_runtime.JSX.Element>;
45
+
46
+ export { type CmssyEditorProps as C, type CreateCmssyPageOptions as a, createCmssyPage as b, createCmssyEditPage as c };