@commercetools-demo/puck-content-manager 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/index.d.mts +44 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +1125 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1105 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +57 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { PuckContentListItem, PuckData } from '@commercetools-demo/puck-types';
|
|
3
|
+
import { Config } from '@measured/puck';
|
|
4
|
+
|
|
5
|
+
interface ContentManagerProps {
|
|
6
|
+
baseURL: string;
|
|
7
|
+
projectKey: string;
|
|
8
|
+
businessUnitKey: string;
|
|
9
|
+
jwtToken: string;
|
|
10
|
+
defaultContentType?: string;
|
|
11
|
+
onEdit: (item: PuckContentListItem) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const ContentManager: React.FC<ContentManagerProps>;
|
|
14
|
+
|
|
15
|
+
interface ContentEditorProps {
|
|
16
|
+
baseURL: string;
|
|
17
|
+
projectKey: string;
|
|
18
|
+
businessUnitKey: string;
|
|
19
|
+
jwtToken: string;
|
|
20
|
+
contentKey: string;
|
|
21
|
+
/** Puck component config — must match what's used in the renderer */
|
|
22
|
+
config: Config;
|
|
23
|
+
onPublish?: (data: PuckData) => void;
|
|
24
|
+
onSave?: (data: PuckData) => void;
|
|
25
|
+
onError?: (error: Error) => void;
|
|
26
|
+
}
|
|
27
|
+
declare const ContentEditor: React.FC<ContentEditorProps>;
|
|
28
|
+
|
|
29
|
+
interface ContentManagerRouterProps {
|
|
30
|
+
/** URL path where this manager is mounted, e.g. "/content" — used as router basename */
|
|
31
|
+
parentUrl: string;
|
|
32
|
+
baseURL: string;
|
|
33
|
+
projectKey: string;
|
|
34
|
+
businessUnitKey: string;
|
|
35
|
+
jwtToken: string;
|
|
36
|
+
/** Puck component config — must match what's used in the renderer */
|
|
37
|
+
config: Config;
|
|
38
|
+
defaultContentType?: string;
|
|
39
|
+
/** Optional element rendered before the breadcrumb in the editor header */
|
|
40
|
+
backButton?: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
declare const ContentManagerRouter: React.FC<ContentManagerRouterProps>;
|
|
43
|
+
|
|
44
|
+
export { ContentEditor, type ContentEditorProps, ContentManager, type ContentManagerProps, ContentManagerRouter, type ContentManagerRouterProps };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { PuckContentListItem, PuckData } from '@commercetools-demo/puck-types';
|
|
3
|
+
import { Config } from '@measured/puck';
|
|
4
|
+
|
|
5
|
+
interface ContentManagerProps {
|
|
6
|
+
baseURL: string;
|
|
7
|
+
projectKey: string;
|
|
8
|
+
businessUnitKey: string;
|
|
9
|
+
jwtToken: string;
|
|
10
|
+
defaultContentType?: string;
|
|
11
|
+
onEdit: (item: PuckContentListItem) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const ContentManager: React.FC<ContentManagerProps>;
|
|
14
|
+
|
|
15
|
+
interface ContentEditorProps {
|
|
16
|
+
baseURL: string;
|
|
17
|
+
projectKey: string;
|
|
18
|
+
businessUnitKey: string;
|
|
19
|
+
jwtToken: string;
|
|
20
|
+
contentKey: string;
|
|
21
|
+
/** Puck component config — must match what's used in the renderer */
|
|
22
|
+
config: Config;
|
|
23
|
+
onPublish?: (data: PuckData) => void;
|
|
24
|
+
onSave?: (data: PuckData) => void;
|
|
25
|
+
onError?: (error: Error) => void;
|
|
26
|
+
}
|
|
27
|
+
declare const ContentEditor: React.FC<ContentEditorProps>;
|
|
28
|
+
|
|
29
|
+
interface ContentManagerRouterProps {
|
|
30
|
+
/** URL path where this manager is mounted, e.g. "/content" — used as router basename */
|
|
31
|
+
parentUrl: string;
|
|
32
|
+
baseURL: string;
|
|
33
|
+
projectKey: string;
|
|
34
|
+
businessUnitKey: string;
|
|
35
|
+
jwtToken: string;
|
|
36
|
+
/** Puck component config — must match what's used in the renderer */
|
|
37
|
+
config: Config;
|
|
38
|
+
defaultContentType?: string;
|
|
39
|
+
/** Optional element rendered before the breadcrumb in the editor header */
|
|
40
|
+
backButton?: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
declare const ContentManagerRouter: React.FC<ContentManagerRouterProps>;
|
|
43
|
+
|
|
44
|
+
export { ContentEditor, type ContentEditorProps, ContentManager, type ContentManagerProps, ContentManagerRouter, type ContentManagerRouterProps };
|