@cmssy/react 0.1.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/dist/client.cjs +696 -0
- package/dist/client.d.cts +77 -0
- package/dist/client.d.ts +77 -0
- package/dist/client.js +690 -0
- package/dist/index.cjs +529 -0
- package/dist/index.d.cts +166 -0
- package/dist/index.d.ts +166 -0
- package/dist/index.js +503 -0
- package/dist/registry-BoxAyw4_.d.cts +189 -0
- package/dist/registry-BoxAyw4_.d.ts +189 -0
- package/package.json +47 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { B as BlockSchema, a as BlockMeta, C as CmssyPageData, b as BlockDefinition, c as CmssyLayoutGroup } from './registry-BoxAyw4_.cjs';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
interface EditBridgeConfig {
|
|
6
|
+
editorOrigin: string;
|
|
7
|
+
schemas?: Record<string, BlockSchema>;
|
|
8
|
+
blockMeta?: Record<string, BlockMeta>;
|
|
9
|
+
}
|
|
10
|
+
type PatchMap = Partial<Record<string, Record<string, unknown>>>;
|
|
11
|
+
interface InsertedBlock {
|
|
12
|
+
blockId: string;
|
|
13
|
+
blockType: string;
|
|
14
|
+
content: Record<string, unknown>;
|
|
15
|
+
index: number;
|
|
16
|
+
}
|
|
17
|
+
interface EditBridgeState {
|
|
18
|
+
patches: PatchMap;
|
|
19
|
+
selected: string | null;
|
|
20
|
+
inserted: InsertedBlock[];
|
|
21
|
+
order: string[] | null;
|
|
22
|
+
removed: string[];
|
|
23
|
+
}
|
|
24
|
+
interface BridgePage {
|
|
25
|
+
id: string;
|
|
26
|
+
blocks: ReadonlyArray<{
|
|
27
|
+
id: string;
|
|
28
|
+
type: string;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
declare function useEditBridge(page: BridgePage, config: EditBridgeConfig): EditBridgeState;
|
|
32
|
+
|
|
33
|
+
interface CmssyEditablePageProps {
|
|
34
|
+
page: CmssyPageData | null;
|
|
35
|
+
blocks: BlockDefinition[];
|
|
36
|
+
locale?: string;
|
|
37
|
+
defaultLocale?: string;
|
|
38
|
+
edit: EditBridgeConfig;
|
|
39
|
+
category?: string;
|
|
40
|
+
}
|
|
41
|
+
declare function CmssyEditablePage({ page, blocks, locale, defaultLocale, edit, category, }: CmssyEditablePageProps): react_jsx_runtime.JSX.Element | null;
|
|
42
|
+
|
|
43
|
+
interface CmssyLazyEditorProps {
|
|
44
|
+
page: CmssyPageData | null;
|
|
45
|
+
locale?: string;
|
|
46
|
+
defaultLocale?: string;
|
|
47
|
+
edit: EditBridgeConfig;
|
|
48
|
+
load: () => Promise<{
|
|
49
|
+
blocks: BlockDefinition[];
|
|
50
|
+
category?: string;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
declare function CmssyLazyEditor({ load, ...props }: CmssyLazyEditorProps): react_jsx_runtime.JSX.Element | null;
|
|
54
|
+
|
|
55
|
+
interface CmssyEditableLayoutProps {
|
|
56
|
+
groups: CmssyLayoutGroup[];
|
|
57
|
+
blocks: BlockDefinition[];
|
|
58
|
+
position: string;
|
|
59
|
+
locale?: string;
|
|
60
|
+
defaultLocale?: string;
|
|
61
|
+
edit: EditBridgeConfig;
|
|
62
|
+
}
|
|
63
|
+
declare function CmssyEditableLayout({ groups, blocks, position, locale, defaultLocale, edit, }: CmssyEditableLayoutProps): react_jsx_runtime.JSX.Element | null;
|
|
64
|
+
|
|
65
|
+
interface CmssyLazyLayoutProps {
|
|
66
|
+
groups: CmssyLayoutGroup[];
|
|
67
|
+
position: string;
|
|
68
|
+
locale?: string;
|
|
69
|
+
defaultLocale?: string;
|
|
70
|
+
edit: EditBridgeConfig;
|
|
71
|
+
load: () => Promise<{
|
|
72
|
+
blocks: BlockDefinition[];
|
|
73
|
+
}>;
|
|
74
|
+
}
|
|
75
|
+
declare function CmssyLazyLayout({ load, ...props }: CmssyLazyLayoutProps): react_jsx_runtime.JSX.Element | null;
|
|
76
|
+
|
|
77
|
+
export { CmssyEditableLayout, type CmssyEditableLayoutProps, CmssyEditablePage, type CmssyEditablePageProps, CmssyLazyEditor, type CmssyLazyEditorProps, CmssyLazyLayout, type CmssyLazyLayoutProps, type EditBridgeConfig, type EditBridgeState, type PatchMap, useEditBridge };
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { B as BlockSchema, a as BlockMeta, C as CmssyPageData, b as BlockDefinition, c as CmssyLayoutGroup } from './registry-BoxAyw4_.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
interface EditBridgeConfig {
|
|
6
|
+
editorOrigin: string;
|
|
7
|
+
schemas?: Record<string, BlockSchema>;
|
|
8
|
+
blockMeta?: Record<string, BlockMeta>;
|
|
9
|
+
}
|
|
10
|
+
type PatchMap = Partial<Record<string, Record<string, unknown>>>;
|
|
11
|
+
interface InsertedBlock {
|
|
12
|
+
blockId: string;
|
|
13
|
+
blockType: string;
|
|
14
|
+
content: Record<string, unknown>;
|
|
15
|
+
index: number;
|
|
16
|
+
}
|
|
17
|
+
interface EditBridgeState {
|
|
18
|
+
patches: PatchMap;
|
|
19
|
+
selected: string | null;
|
|
20
|
+
inserted: InsertedBlock[];
|
|
21
|
+
order: string[] | null;
|
|
22
|
+
removed: string[];
|
|
23
|
+
}
|
|
24
|
+
interface BridgePage {
|
|
25
|
+
id: string;
|
|
26
|
+
blocks: ReadonlyArray<{
|
|
27
|
+
id: string;
|
|
28
|
+
type: string;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
declare function useEditBridge(page: BridgePage, config: EditBridgeConfig): EditBridgeState;
|
|
32
|
+
|
|
33
|
+
interface CmssyEditablePageProps {
|
|
34
|
+
page: CmssyPageData | null;
|
|
35
|
+
blocks: BlockDefinition[];
|
|
36
|
+
locale?: string;
|
|
37
|
+
defaultLocale?: string;
|
|
38
|
+
edit: EditBridgeConfig;
|
|
39
|
+
category?: string;
|
|
40
|
+
}
|
|
41
|
+
declare function CmssyEditablePage({ page, blocks, locale, defaultLocale, edit, category, }: CmssyEditablePageProps): react_jsx_runtime.JSX.Element | null;
|
|
42
|
+
|
|
43
|
+
interface CmssyLazyEditorProps {
|
|
44
|
+
page: CmssyPageData | null;
|
|
45
|
+
locale?: string;
|
|
46
|
+
defaultLocale?: string;
|
|
47
|
+
edit: EditBridgeConfig;
|
|
48
|
+
load: () => Promise<{
|
|
49
|
+
blocks: BlockDefinition[];
|
|
50
|
+
category?: string;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
declare function CmssyLazyEditor({ load, ...props }: CmssyLazyEditorProps): react_jsx_runtime.JSX.Element | null;
|
|
54
|
+
|
|
55
|
+
interface CmssyEditableLayoutProps {
|
|
56
|
+
groups: CmssyLayoutGroup[];
|
|
57
|
+
blocks: BlockDefinition[];
|
|
58
|
+
position: string;
|
|
59
|
+
locale?: string;
|
|
60
|
+
defaultLocale?: string;
|
|
61
|
+
edit: EditBridgeConfig;
|
|
62
|
+
}
|
|
63
|
+
declare function CmssyEditableLayout({ groups, blocks, position, locale, defaultLocale, edit, }: CmssyEditableLayoutProps): react_jsx_runtime.JSX.Element | null;
|
|
64
|
+
|
|
65
|
+
interface CmssyLazyLayoutProps {
|
|
66
|
+
groups: CmssyLayoutGroup[];
|
|
67
|
+
position: string;
|
|
68
|
+
locale?: string;
|
|
69
|
+
defaultLocale?: string;
|
|
70
|
+
edit: EditBridgeConfig;
|
|
71
|
+
load: () => Promise<{
|
|
72
|
+
blocks: BlockDefinition[];
|
|
73
|
+
}>;
|
|
74
|
+
}
|
|
75
|
+
declare function CmssyLazyLayout({ load, ...props }: CmssyLazyLayoutProps): react_jsx_runtime.JSX.Element | null;
|
|
76
|
+
|
|
77
|
+
export { CmssyEditableLayout, type CmssyEditableLayoutProps, CmssyEditablePage, type CmssyEditablePageProps, CmssyLazyEditor, type CmssyLazyEditorProps, CmssyLazyLayout, type CmssyLazyLayoutProps, type EditBridgeConfig, type EditBridgeState, type PatchMap, useEditBridge };
|