@cmssy/next 4.7.2 → 5.0.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/dist/index-D-mfavEO.d.cts +46 -0
- package/dist/index-D-mfavEO.d.ts +46 -0
- package/dist/index.cjs +31 -2070
- package/dist/index.d.cts +6 -330
- package/dist/index.d.ts +6 -330
- package/dist/index.js +1 -2024
- package/dist/middleware.cjs +185 -0
- package/dist/middleware.d.cts +106 -0
- package/dist/middleware.d.ts +106 -0
- package/dist/middleware.js +156 -0
- package/dist/server.cjs +1063 -0
- package/dist/server.d.cts +206 -0
- package/dist/server.d.ts +206 -0
- package/dist/server.js +1044 -0
- package/dist/testing.cjs +7 -60
- package/dist/testing.d.cts +1 -39
- package/dist/testing.d.ts +1 -39
- package/dist/testing.js +1 -61
- package/package.json +16 -10
- package/dist/config-DNaPqq1f.d.cts +0 -63
- package/dist/config-DNaPqq1f.d.ts +0 -63
- package/dist/preset.cjs +0 -235
- package/dist/preset.d.cts +0 -81
- package/dist/preset.d.ts +0 -81
- package/dist/preset.js +0 -231
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 `
|
|
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 };
|