@grapesjs/studio-sdk-plugins 1.0.26-rc.0 → 1.0.26
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.
|
@@ -17,7 +17,7 @@ export type EditorRenderProps = (props: {
|
|
|
17
17
|
export interface ComponentConfig extends Omit<ComponentConfigSchema, 'component' | 'props' | 'model' | 'wrapperStyle' | 'editorRender'> {
|
|
18
18
|
/**
|
|
19
19
|
* React Component
|
|
20
|
-
* @
|
|
20
|
+
* @example
|
|
21
21
|
* component: ({ id, className, children, title, ...rest }) => {
|
|
22
22
|
* return (
|
|
23
23
|
* <div id={id} className={className} {...rest}>
|
|
@@ -30,7 +30,7 @@ export interface ComponentConfig extends Omit<ComponentConfigSchema, 'component'
|
|
|
30
30
|
component: ComponentType<any>;
|
|
31
31
|
/**
|
|
32
32
|
* Return an array of properties in a shape of GrapesJS traits.
|
|
33
|
-
* @
|
|
33
|
+
* @example
|
|
34
34
|
* props: () => [
|
|
35
35
|
* {
|
|
36
36
|
* type: 'text',
|
|
@@ -42,7 +42,7 @@ export interface ComponentConfig extends Omit<ComponentConfigSchema, 'component'
|
|
|
42
42
|
props?: () => TraitProperties[];
|
|
43
43
|
/**
|
|
44
44
|
* GrapesJS component model definition.
|
|
45
|
-
* @
|
|
45
|
+
* @example
|
|
46
46
|
* model: {
|
|
47
47
|
* defaults: {
|
|
48
48
|
* draggable: false,
|
|
@@ -59,7 +59,7 @@ export interface ComponentConfig extends Omit<ComponentConfigSchema, 'component'
|
|
|
59
59
|
* For most cases, styling the wrapper is sufficient. If you need deeper customization
|
|
60
60
|
* (e.g., changing the wrapper element type or structure), use the `editorRender` option instead.
|
|
61
61
|
*
|
|
62
|
-
* @
|
|
62
|
+
* @example
|
|
63
63
|
* wrapperStyle: { display: 'block' }
|
|
64
64
|
*/
|
|
65
65
|
wrapperStyle?: CSSProperties;
|
|
@@ -72,7 +72,7 @@ export interface ComponentConfig extends Omit<ComponentConfigSchema, 'component'
|
|
|
72
72
|
* The `connectDom` function must be passed to the element that should be treated as the
|
|
73
73
|
* component root (for selection, dragging, etc.).
|
|
74
74
|
*
|
|
75
|
-
* @
|
|
75
|
+
* @example
|
|
76
76
|
* component: MyComponent,
|
|
77
77
|
* editorRender: ({ connectDom, editor, component, children, props }) => {
|
|
78
78
|
* return (
|
|
@@ -105,7 +105,7 @@ export interface RootComponentProps extends WithEditorProps {
|
|
|
105
105
|
export interface RendererReactOptions extends Omit<RendererReactOptionsSchema, 'components' | 'errorComponent' | 'rootComponent' | 'headAfter' | 'bodyAfter'> {
|
|
106
106
|
/**
|
|
107
107
|
* Map of custom components.
|
|
108
|
-
* @
|
|
108
|
+
* @example
|
|
109
109
|
* components: {
|
|
110
110
|
* MyComponent: {
|
|
111
111
|
* allowPropId: true,
|
|
@@ -126,20 +126,20 @@ export interface RendererReactOptions extends Omit<RendererReactOptionsSchema, '
|
|
|
126
126
|
/**
|
|
127
127
|
* Custom error component.
|
|
128
128
|
* This is used when, for example, you're trying to render a page with an invalid id.
|
|
129
|
-
* @
|
|
129
|
+
* @example
|
|
130
130
|
* errorComponent: ({ errorType }) => <div>Error: {errorType}</div>
|
|
131
131
|
*/
|
|
132
132
|
errorComponent?: ComponentType<RenderErrorProps>;
|
|
133
133
|
/**
|
|
134
134
|
* Custom root component that wraps the entire rendered project.
|
|
135
135
|
* Usually used to provide a layout or context for the entire application.
|
|
136
|
-
* @
|
|
136
|
+
* @example
|
|
137
137
|
* rootComponent: ({ children }) => <div>{children}</div>
|
|
138
138
|
*/
|
|
139
139
|
rootComponent?: ComponentType<RootComponentProps>;
|
|
140
140
|
/**
|
|
141
141
|
* Custom react component to append at the end of the `<head>` element.
|
|
142
|
-
* @
|
|
142
|
+
* @example
|
|
143
143
|
* headAfter: () => (<>
|
|
144
144
|
* <meta/>
|
|
145
145
|
* <script src="path/to/analytics.js"></script>
|
|
@@ -148,7 +148,7 @@ export interface RendererReactOptions extends Omit<RendererReactOptionsSchema, '
|
|
|
148
148
|
headAfter?: ComponentType<WithEditorProps>;
|
|
149
149
|
/**
|
|
150
150
|
* Custom react component to append at the end of the `<body>` element.
|
|
151
|
-
* @
|
|
151
|
+
* @example
|
|
152
152
|
* bodyAfter: () => <div>Powered by MyApp</div>
|
|
153
153
|
*/
|
|
154
154
|
bodyAfter?: ComponentType<WithEditorProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grapesjs/studio-sdk-plugins",
|
|
3
|
-
"version": "1.0.26
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org"
|
|
6
6
|
},
|
|
@@ -35,6 +35,18 @@
|
|
|
35
35
|
"types": "./dist/index.d.ts",
|
|
36
36
|
"umd": "./dist/index.umd.js"
|
|
37
37
|
},
|
|
38
|
+
"./dist/rendererReact/rendererProject": {
|
|
39
|
+
"require": "./dist/rendererReact/rendererProject/index.cjs.js",
|
|
40
|
+
"import": "./dist/rendererReact/rendererProject/index.es.js",
|
|
41
|
+
"types": "./dist/rendererReact/rendererProject/index.d.ts",
|
|
42
|
+
"umd": "./dist/rendererReact/rendererProject/index.umd.js"
|
|
43
|
+
},
|
|
44
|
+
"./dist/rendererReact": {
|
|
45
|
+
"require": "./dist/rendererReact/index.cjs.js",
|
|
46
|
+
"import": "./dist/rendererReact/index.es.js",
|
|
47
|
+
"types": "./dist/rendererReact/index.d.ts",
|
|
48
|
+
"umd": "./dist/rendererReact/index.umd.js"
|
|
49
|
+
},
|
|
38
50
|
"./*": "./*"
|
|
39
51
|
},
|
|
40
52
|
"dependencies": {
|