@webiny/website-builder-react 6.0.0-alpha.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/LICENSE +21 -0
- package/README.md +3 -0
- package/components/ConnectToEditor.d.ts +8 -0
- package/components/ConnectToEditor.js +25 -0
- package/components/ConnectToEditor.js.map +1 -0
- package/components/DocumentFragment.d.ts +6 -0
- package/components/DocumentFragment.js +10 -0
- package/components/DocumentFragment.js.map +1 -0
- package/components/DocumentRenderer.d.ts +9 -0
- package/components/DocumentRenderer.js +47 -0
- package/components/DocumentRenderer.js.map +1 -0
- package/components/DocumentStoreProvider.d.ts +8 -0
- package/components/DocumentStoreProvider.js +27 -0
- package/components/DocumentStoreProvider.js.map +1 -0
- package/components/EditingElementRenderer/EditingElementRenderer.d.ts +9 -0
- package/components/EditingElementRenderer/EditingElementRenderer.js +47 -0
- package/components/EditingElementRenderer/EditingElementRenderer.js.map +1 -0
- package/components/EditingElementRenderer/EditingElementRenderer.presenter.d.ts +14 -0
- package/components/EditingElementRenderer/EditingElementRenderer.presenter.js +43 -0
- package/components/EditingElementRenderer/EditingElementRenderer.presenter.js.map +1 -0
- package/components/EditingElementRenderer/index.d.ts +1 -0
- package/components/EditingElementRenderer/index.js +3 -0
- package/components/EditingElementRenderer/index.js.map +1 -0
- package/components/ElementIndexProvider.d.ts +8 -0
- package/components/ElementIndexProvider.js +18 -0
- package/components/ElementIndexProvider.js.map +1 -0
- package/components/ElementRenderer.d.ts +8 -0
- package/components/ElementRenderer.js +27 -0
- package/components/ElementRenderer.js.map +1 -0
- package/components/ElementSlot.d.ts +7 -0
- package/components/ElementSlot.js +16 -0
- package/components/ElementSlot.js.map +1 -0
- package/components/ElementSlotDepthProvider.d.ts +8 -0
- package/components/ElementSlotDepthProvider.js +18 -0
- package/components/ElementSlotDepthProvider.js.map +1 -0
- package/components/FragmentsProvider.d.ts +9 -0
- package/components/FragmentsProvider.js +30 -0
- package/components/FragmentsProvider.js.map +1 -0
- package/components/LiveElementRenderer.d.ts +10 -0
- package/components/LiveElementRenderer.js +78 -0
- package/components/LiveElementRenderer.js.map +1 -0
- package/components/LiveElementSlot.d.ts +3 -0
- package/components/LiveElementSlot.js +21 -0
- package/components/LiveElementSlot.js.map +1 -0
- package/components/PreviewElementSlot.d.ts +8 -0
- package/components/PreviewElementSlot.js +30 -0
- package/components/PreviewElementSlot.js.map +1 -0
- package/components/index.d.ts +4 -0
- package/components/index.js +6 -0
- package/components/index.js.map +1 -0
- package/components/useBindingsForElement.d.ts +746 -0
- package/components/useBindingsForElement.js +19 -0
- package/components/useBindingsForElement.js.map +1 -0
- package/components/useDocumentState.d.ts +1 -0
- package/components/useDocumentState.js +8 -0
- package/components/useDocumentState.js.map +1 -0
- package/components/useSelectFromState.d.ts +9 -0
- package/components/useSelectFromState.js +39 -0
- package/components/useSelectFromState.js.map +1 -0
- package/components/useViewportInfo.d.ts +1 -0
- package/components/useViewportInfo.js +11 -0
- package/components/useViewportInfo.js.map +1 -0
- package/createComponent.d.ts +2 -0
- package/createComponent.js +16 -0
- package/createComponent.js.map +1 -0
- package/editorComponents/Box.d.ts +3 -0
- package/editorComponents/Box.js +8 -0
- package/editorComponents/Box.js.map +1 -0
- package/editorComponents/Box.manifest.d.ts +1 -0
- package/editorComponents/Box.manifest.js +21 -0
- package/editorComponents/Box.manifest.js.map +1 -0
- package/editorComponents/Fragment.d.ts +7 -0
- package/editorComponents/Fragment.js +33 -0
- package/editorComponents/Fragment.js.map +1 -0
- package/editorComponents/Fragment.manifest.d.ts +1 -0
- package/editorComponents/Fragment.manifest.js +19 -0
- package/editorComponents/Fragment.manifest.js.map +1 -0
- package/editorComponents/Grid.d.ts +18 -0
- package/editorComponents/Grid.js +65 -0
- package/editorComponents/Grid.js.map +1 -0
- package/editorComponents/Grid.manifest.d.ts +5 -0
- package/editorComponents/Grid.manifest.js +174 -0
- package/editorComponents/Grid.manifest.js.map +1 -0
- package/editorComponents/GridColumn.d.ts +5 -0
- package/editorComponents/GridColumn.js +8 -0
- package/editorComponents/GridColumn.js.map +1 -0
- package/editorComponents/GridColumn.manifest.d.ts +1 -0
- package/editorComponents/GridColumn.manifest.js +25 -0
- package/editorComponents/GridColumn.manifest.js.map +1 -0
- package/editorComponents/Image.d.ts +15 -0
- package/editorComponents/Image.js +126 -0
- package/editorComponents/Image.js.map +1 -0
- package/editorComponents/Image.manifest.d.ts +1 -0
- package/editorComponents/Image.manifest.js +40 -0
- package/editorComponents/Image.manifest.js.map +1 -0
- package/editorComponents/Lexical.d.ts +13 -0
- package/editorComponents/Lexical.js +30 -0
- package/editorComponents/Lexical.js.map +1 -0
- package/editorComponents/Lexical.manifest.d.ts +1 -0
- package/editorComponents/Lexical.manifest.js +22 -0
- package/editorComponents/Lexical.manifest.js.map +1 -0
- package/editorComponents/Root.d.ts +3 -0
- package/editorComponents/Root.js +8 -0
- package/editorComponents/Root.js.map +1 -0
- package/editorComponents/Root.manifest.d.ts +1 -0
- package/editorComponents/Root.manifest.js +12 -0
- package/editorComponents/Root.manifest.js.map +1 -0
- package/editorComponents/index.d.ts +1 -0
- package/editorComponents/index.js +10 -0
- package/editorComponents/index.js.map +1 -0
- package/index.d.ts +4 -0
- package/index.js +5 -0
- package/index.js.map +1 -0
- package/package.json +42 -0
- package/types.d.ts +11 -0
- package/types.js +3 -0
- package/types.js.map +1 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { StyleSettings } from "@webiny/app-website-builder/sdk";
|
|
4
|
+
import { createComponent } from "../createComponent";
|
|
5
|
+
import { GridColumnComponent } from "./GridColumn";
|
|
6
|
+
export const GridColumn = createComponent(GridColumnComponent, {
|
|
7
|
+
name: "Webiny/GridColumn",
|
|
8
|
+
label: "Column",
|
|
9
|
+
image: `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="M600-120q-33 0-56.5-23.5T520-200v-560q0-33 23.5-56.5T600-840h160q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H600Zm0-640v560h160v-560H600ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h160q33 0 56.5 23.5T440-760v560q0 33-23.5 56.5T360-120H200Zm0-640v560h160v-560H200Zm560 0H600h160Zm-400 0H200h160Z"/></svg>`,
|
|
10
|
+
canDrag: false,
|
|
11
|
+
canDelete: false,
|
|
12
|
+
acceptsChildren: true,
|
|
13
|
+
hideFromToolbar: true,
|
|
14
|
+
hideStyleSettings: [StyleSettings.Visibility],
|
|
15
|
+
defaults: {
|
|
16
|
+
styles: {
|
|
17
|
+
paddingTop: "10px",
|
|
18
|
+
paddingRight: "10px",
|
|
19
|
+
paddingBottom: "10px",
|
|
20
|
+
paddingLeft: "10px"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=GridColumn.manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSettings","createComponent","GridColumnComponent","GridColumn","name","label","image","canDrag","canDelete","acceptsChildren","hideFromToolbar","hideStyleSettings","Visibility","defaults","styles","paddingTop","paddingRight","paddingBottom","paddingLeft"],"sources":["GridColumn.manifest.ts"],"sourcesContent":["\"use client\";\nimport { StyleSettings } from \"@webiny/app-website-builder/sdk\";\nimport { createComponent } from \"~/createComponent\";\nimport { GridColumnComponent } from \"./GridColumn\";\n\nexport const GridColumn = createComponent(GridColumnComponent, {\n name: \"Webiny/GridColumn\",\n label: \"Column\",\n image: `<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#e8eaed\"><path d=\"M600-120q-33 0-56.5-23.5T520-200v-560q0-33 23.5-56.5T600-840h160q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H600Zm0-640v560h160v-560H600ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h160q33 0 56.5 23.5T440-760v560q0 33-23.5 56.5T360-120H200Zm0-640v560h160v-560H200Zm560 0H600h160Zm-400 0H200h160Z\"/></svg>`,\n canDrag: false,\n canDelete: false,\n acceptsChildren: true,\n hideFromToolbar: true,\n hideStyleSettings: [StyleSettings.Visibility],\n defaults: {\n styles: {\n paddingTop: \"10px\",\n paddingRight: \"10px\",\n paddingBottom: \"10px\",\n paddingLeft: \"10px\"\n }\n }\n});\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,aAAa,QAAQ,iCAAiC;AAC/D,SAASC,eAAe;AACxB,SAASC,mBAAmB;AAE5B,OAAO,MAAMC,UAAU,GAAGF,eAAe,CAACC,mBAAmB,EAAE;EAC3DE,IAAI,EAAE,mBAAmB;EACzBC,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE,4bAA4b;EACncC,OAAO,EAAE,KAAK;EACdC,SAAS,EAAE,KAAK;EAChBC,eAAe,EAAE,IAAI;EACrBC,eAAe,EAAE,IAAI;EACrBC,iBAAiB,EAAE,CAACX,aAAa,CAACY,UAAU,CAAC;EAC7CC,QAAQ,EAAE;IACNC,MAAM,EAAE;MACJC,UAAU,EAAE,MAAM;MAClBC,YAAY,EAAE,MAAM;MACpBC,aAAa,EAAE,MAAM;MACrBC,WAAW,EAAE;IACjB;EACJ;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentPropsWithChildren } from "../types";
|
|
3
|
+
type ImageProps = ComponentPropsWithChildren<{
|
|
4
|
+
title: string;
|
|
5
|
+
altText: string;
|
|
6
|
+
image: {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
size: number;
|
|
10
|
+
mimeType: string;
|
|
11
|
+
src: string;
|
|
12
|
+
};
|
|
13
|
+
}>;
|
|
14
|
+
export declare const ImageComponent: (props: ImageProps) => React.JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useState } from "react";
|
|
2
|
+
import { contentSdk } from "@webiny/app-website-builder/sdk";
|
|
3
|
+
const SUPPORTED_IMAGE_RESIZE_WIDTHS = [100, 300, 500, 750, 1000, 1500, 2500];
|
|
4
|
+
export const ImageComponent = props => {
|
|
5
|
+
const image = useImage(props);
|
|
6
|
+
if (!image.src) {
|
|
7
|
+
return /*#__PURE__*/React.createElement(ImagePlaceholder, {
|
|
8
|
+
style: props.styles
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
if (image.tag === "object") {
|
|
12
|
+
return /*#__PURE__*/React.createElement("object", {
|
|
13
|
+
style: image.styles,
|
|
14
|
+
title: image.title,
|
|
15
|
+
data: image.src
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !image.isLoaded && /*#__PURE__*/React.createElement(ImagePlaceholder, {
|
|
19
|
+
style: image.styles
|
|
20
|
+
}), /*#__PURE__*/React.createElement("img", {
|
|
21
|
+
alt: image.altText,
|
|
22
|
+
onLoad: image.onLoad,
|
|
23
|
+
title: image.title,
|
|
24
|
+
src: image.src,
|
|
25
|
+
srcSet: image.srcSet,
|
|
26
|
+
style: image.styles
|
|
27
|
+
}));
|
|
28
|
+
};
|
|
29
|
+
const ImagePlaceholder = ({
|
|
30
|
+
style
|
|
31
|
+
}) => {
|
|
32
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
style: {
|
|
34
|
+
display: "flex",
|
|
35
|
+
height: "200px",
|
|
36
|
+
backgroundColor: "#f4f4f4",
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
fill: "#ffffff",
|
|
40
|
+
...style
|
|
41
|
+
}
|
|
42
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
43
|
+
style: {
|
|
44
|
+
width: "70px",
|
|
45
|
+
height: "70px",
|
|
46
|
+
filter: "drop-shadow(rgba(0, 0, 0, 0.16) 0px 1px 0px)"
|
|
47
|
+
},
|
|
48
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
49
|
+
height: "24px",
|
|
50
|
+
viewBox: "0 -960 960 960",
|
|
51
|
+
width: "24px"
|
|
52
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
53
|
+
d: "M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"
|
|
54
|
+
})));
|
|
55
|
+
};
|
|
56
|
+
const getSrcSet = (src, srcSetWidths) => {
|
|
57
|
+
return srcSetWidths.map(item => `${src}?width=${item} ${item}w`).join(", ");
|
|
58
|
+
};
|
|
59
|
+
const useImage = ({
|
|
60
|
+
inputs,
|
|
61
|
+
styles
|
|
62
|
+
}) => {
|
|
63
|
+
const [isLoaded, setIsLoaded] = useState(contentSdk.isEditing() ? false : true);
|
|
64
|
+
const {
|
|
65
|
+
title = "",
|
|
66
|
+
altText,
|
|
67
|
+
image
|
|
68
|
+
} = inputs;
|
|
69
|
+
const src = image?.src;
|
|
70
|
+
const tag = src && src.endsWith(".svg") ? "object" : "img";
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (!src) {
|
|
73
|
+
setIsLoaded(false);
|
|
74
|
+
}
|
|
75
|
+
}, [src]);
|
|
76
|
+
|
|
77
|
+
// If a fixed image width in pixels was set, let's filter out unneeded
|
|
78
|
+
// image resize widths. For example, if 155px was set as the fixed image
|
|
79
|
+
// width, then we want the `srcset` attribute to only contain 100w and 300w.
|
|
80
|
+
let srcSetWidths = [];
|
|
81
|
+
const width = styles.width?.toString();
|
|
82
|
+
if (width && width.endsWith("px")) {
|
|
83
|
+
const imageWidthInt = parseInt(width);
|
|
84
|
+
for (let i = 0; i < SUPPORTED_IMAGE_RESIZE_WIDTHS.length; i++) {
|
|
85
|
+
const supportedResizeWidth = SUPPORTED_IMAGE_RESIZE_WIDTHS[i];
|
|
86
|
+
if (imageWidthInt > supportedResizeWidth) {
|
|
87
|
+
srcSetWidths.push(supportedResizeWidth);
|
|
88
|
+
} else {
|
|
89
|
+
srcSetWidths.push(supportedResizeWidth);
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
// If a fixed image width was not provided, we
|
|
95
|
+
// rely on all the supported image resize widths.
|
|
96
|
+
srcSetWidths = SUPPORTED_IMAGE_RESIZE_WIDTHS;
|
|
97
|
+
}
|
|
98
|
+
const srcSet = src ? getSrcSet(src, srcSetWidths) : "";
|
|
99
|
+
const imageStyles = {
|
|
100
|
+
maxWidth: "100%",
|
|
101
|
+
opacity: isLoaded ? 1 : 0,
|
|
102
|
+
transition: "opacity 0.3s ease",
|
|
103
|
+
...styles
|
|
104
|
+
};
|
|
105
|
+
const onLoad = useCallback(() => {
|
|
106
|
+
if (contentSdk.isEditing()) {
|
|
107
|
+
setTimeout(() => {
|
|
108
|
+
setIsLoaded(true);
|
|
109
|
+
}, 100);
|
|
110
|
+
} else {
|
|
111
|
+
setIsLoaded(true);
|
|
112
|
+
}
|
|
113
|
+
}, []);
|
|
114
|
+
return {
|
|
115
|
+
altText,
|
|
116
|
+
isLoaded,
|
|
117
|
+
onLoad,
|
|
118
|
+
src: inputs.image?.src,
|
|
119
|
+
srcSet,
|
|
120
|
+
styles: imageStyles,
|
|
121
|
+
tag,
|
|
122
|
+
title
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
//# sourceMappingURL=Image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useState","contentSdk","SUPPORTED_IMAGE_RESIZE_WIDTHS","ImageComponent","props","image","useImage","src","createElement","ImagePlaceholder","style","styles","tag","title","data","Fragment","isLoaded","alt","altText","onLoad","srcSet","display","height","backgroundColor","justifyContent","alignItems","fill","width","filter","xmlns","viewBox","d","getSrcSet","srcSetWidths","map","item","join","inputs","setIsLoaded","isEditing","endsWith","toString","imageWidthInt","parseInt","i","length","supportedResizeWidth","push","imageStyles","maxWidth","opacity","transition","setTimeout"],"sources":["Image.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from \"react\";\nimport { contentSdk, CssProperties } from \"@webiny/app-website-builder/sdk\";\nimport type { ComponentPropsWithChildren } from \"~/types\";\n\nconst SUPPORTED_IMAGE_RESIZE_WIDTHS = [100, 300, 500, 750, 1000, 1500, 2500];\n\ntype ImageProps = ComponentPropsWithChildren<{\n title: string;\n altText: string;\n image: {\n id: string;\n name: string;\n size: number;\n mimeType: string;\n src: string;\n };\n}>;\n\nexport const ImageComponent = (props: ImageProps) => {\n const image = useImage(props);\n\n if (!image.src) {\n return <ImagePlaceholder style={props.styles} />;\n }\n\n if (image.tag === \"object\") {\n return <object style={image.styles} title={image.title} data={image.src} />;\n }\n\n return (\n <>\n {!image.isLoaded && <ImagePlaceholder style={image.styles} />}\n <img\n alt={image.altText}\n onLoad={image.onLoad}\n title={image.title}\n src={image.src}\n srcSet={image.srcSet}\n style={image.styles}\n />\n </>\n );\n};\n\nconst ImagePlaceholder = ({ style }: { style: CssProperties }) => {\n return (\n <div\n style={{\n display: \"flex\",\n height: \"200px\",\n backgroundColor: \"#f4f4f4\",\n justifyContent: \"center\",\n alignItems: \"center\",\n fill: \"#ffffff\",\n ...style\n }}\n >\n <svg\n style={{\n width: \"70px\",\n height: \"70px\",\n filter: \"drop-shadow(rgba(0, 0, 0, 0.16) 0px 1px 0px)\"\n }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n >\n <path d=\"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z\" />\n </svg>\n </div>\n );\n};\n\nconst getSrcSet = (src: string, srcSetWidths: number[]) => {\n return srcSetWidths.map(item => `${src}?width=${item} ${item}w`).join(\", \");\n};\n\nconst useImage = ({ inputs, styles }: ImageProps) => {\n const [isLoaded, setIsLoaded] = useState(contentSdk.isEditing() ? false : true);\n const { title = \"\", altText, image } = inputs;\n const src = image?.src;\n\n const tag = src && src.endsWith(\".svg\") ? \"object\" : \"img\";\n\n useEffect(() => {\n if (!src) {\n setIsLoaded(false);\n }\n }, [src]);\n\n // If a fixed image width in pixels was set, let's filter out unneeded\n // image resize widths. For example, if 155px was set as the fixed image\n // width, then we want the `srcset` attribute to only contain 100w and 300w.\n let srcSetWidths: number[] = [];\n\n const width = styles.width?.toString();\n\n if (width && width.endsWith(\"px\")) {\n const imageWidthInt = parseInt(width);\n for (let i = 0; i < SUPPORTED_IMAGE_RESIZE_WIDTHS.length; i++) {\n const supportedResizeWidth = SUPPORTED_IMAGE_RESIZE_WIDTHS[i];\n if (imageWidthInt > supportedResizeWidth) {\n srcSetWidths.push(supportedResizeWidth);\n } else {\n srcSetWidths.push(supportedResizeWidth);\n break;\n }\n }\n } else {\n // If a fixed image width was not provided, we\n // rely on all the supported image resize widths.\n srcSetWidths = SUPPORTED_IMAGE_RESIZE_WIDTHS;\n }\n\n const srcSet = src ? getSrcSet(src, srcSetWidths) : \"\";\n\n const imageStyles = {\n maxWidth: \"100%\",\n opacity: isLoaded ? 1 : 0,\n transition: \"opacity 0.3s ease\",\n ...styles\n };\n\n const onLoad = useCallback(() => {\n if (contentSdk.isEditing()) {\n setTimeout(() => {\n setIsLoaded(true);\n }, 100);\n } else {\n setIsLoaded(true);\n }\n }, []);\n\n return {\n altText,\n isLoaded,\n onLoad,\n src: inputs.image?.src,\n srcSet,\n styles: imageStyles,\n tag,\n title\n };\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,O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ACRG,MAAM;IACNZ,GAAG,EAAE8B,MAAM,CAAChC,KAAK,EAAEE,GAAG;IACtBa,MAAM;IACNT,MAAM,EAAEqC,WAAW;IACnBpC,GAAG;IACHC;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Image: import("@webiny/app-website-builder/sdk").Component;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { createFileInput, createTextInput } from "@webiny/app-website-builder/sdk";
|
|
4
|
+
import { createComponent } from "../createComponent";
|
|
5
|
+
import { ImageComponent } from "./Image";
|
|
6
|
+
export const Image = createComponent(ImageComponent, {
|
|
7
|
+
name: "Webiny/Image",
|
|
8
|
+
label: "Image",
|
|
9
|
+
group: "basic",
|
|
10
|
+
image: `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"/></svg>`,
|
|
11
|
+
autoApplyStyles: false,
|
|
12
|
+
inputs: [createFileInput({
|
|
13
|
+
name: "image",
|
|
14
|
+
label: "Image",
|
|
15
|
+
allowedFileTypes: ["image/*"],
|
|
16
|
+
onChange: ({
|
|
17
|
+
inputs
|
|
18
|
+
}) => {
|
|
19
|
+
if (inputs.image) {
|
|
20
|
+
inputs.title = inputs.image.name;
|
|
21
|
+
inputs.altText = inputs.image.name;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}), createTextInput({
|
|
25
|
+
name: "title",
|
|
26
|
+
label: "Title",
|
|
27
|
+
description: "Title of the image"
|
|
28
|
+
}), createTextInput({
|
|
29
|
+
name: "altText",
|
|
30
|
+
label: "Alternate Text",
|
|
31
|
+
description: "Shown when the user has disabled images"
|
|
32
|
+
})],
|
|
33
|
+
defaults: {
|
|
34
|
+
styles: {
|
|
35
|
+
width: "100%"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=Image.manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createFileInput","createTextInput","createComponent","ImageComponent","Image","name","label","group","image","autoApplyStyles","inputs","allowedFileTypes","onChange","title","altText","description","defaults","styles","width"],"sources":["Image.manifest.ts"],"sourcesContent":["\"use client\";\nimport { createFileInput, createTextInput } from \"@webiny/app-website-builder/sdk\";\nimport { createComponent } from \"~/createComponent\";\nimport { ImageComponent } from \"./Image\";\n\nexport const Image = createComponent(ImageComponent, {\n name: \"Webiny/Image\",\n label: \"Image\",\n group: \"basic\",\n image: `<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z\"/></svg>`,\n autoApplyStyles: false,\n inputs: [\n createFileInput({\n name: \"image\",\n label: \"Image\",\n allowedFileTypes: [\"image/*\"],\n onChange: ({ inputs }) => {\n if (inputs.image) {\n inputs.title = inputs.image.name;\n inputs.altText = inputs.image.name;\n }\n }\n }),\n createTextInput({\n name: \"title\",\n label: \"Title\",\n description: \"Title of the image\"\n }),\n createTextInput({\n name: \"altText\",\n label: \"Alternate Text\",\n description: \"Shown when the user has disabled images\"\n })\n ],\n defaults: {\n styles: {\n width: \"100%\"\n }\n }\n});\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,eAAe,EAAEC,eAAe,QAAQ,iCAAiC;AAClF,SAASC,eAAe;AACxB,SAASC,cAAc;AAEvB,OAAO,MAAMC,KAAK,GAAGF,eAAe,CAACC,cAAc,EAAE;EACjDE,IAAI,EAAE,cAAc;EACpBC,KAAK,EAAE,OAAO;EACdC,KAAK,EAAE,OAAO;EACdC,KAAK,EAAE,0TAA0T;EACjUC,eAAe,EAAE,KAAK;EACtBC,MAAM,EAAE,CACJV,eAAe,CAAC;IACZK,IAAI,EAAE,OAAO;IACbC,KAAK,EAAE,OAAO;IACdK,gBAAgB,EAAE,CAAC,SAAS,CAAC;IAC7BC,QAAQ,EAAEA,CAAC;MAAEF;IAAO,CAAC,KAAK;MACtB,IAAIA,MAAM,CAACF,KAAK,EAAE;QACdE,MAAM,CAACG,KAAK,GAAGH,MAAM,CAACF,KAAK,CAACH,IAAI;QAChCK,MAAM,CAACI,OAAO,GAAGJ,MAAM,CAACF,KAAK,CAACH,IAAI;MACtC;IACJ;EACJ,CAAC,CAAC,EACFJ,eAAe,CAAC;IACZI,IAAI,EAAE,OAAO;IACbC,KAAK,EAAE,OAAO;IACdS,WAAW,EAAE;EACjB,CAAC,CAAC,EACFd,eAAe,CAAC;IACZI,IAAI,EAAE,SAAS;IACfC,KAAK,EAAE,gBAAgB;IACvBS,WAAW,EAAE;EACjB,CAAC,CAAC,CACL;EACDC,QAAQ,EAAE;IACNC,MAAM,EAAE;MACJC,KAAK,EAAE;IACX;EACJ;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "../types";
|
|
3
|
+
export declare const createLexicalValue: (value: string) => {
|
|
4
|
+
state: string;
|
|
5
|
+
};
|
|
6
|
+
type LexicalProps = ComponentProps<{
|
|
7
|
+
content: {
|
|
8
|
+
state: string;
|
|
9
|
+
html?: string;
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
12
|
+
export declare const LexicalComponent: ({ inputs }: LexicalProps) => React.JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { LexicalHtmlRenderer } from "@webiny/lexical-editor";
|
|
5
|
+
export const createLexicalValue = value => {
|
|
6
|
+
return {
|
|
7
|
+
state: `{\"root\":{\"children\":[{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"${value}\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"paragraph-element\",\"version\":1,\"textFormat\":0,\"textStyle\":\"\",\"styles\":[{\"styleId\":\"paragraph1\",\"type\":\"typography\"}]}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"root\",\"version\":1}}`
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export const LexicalComponent = ({
|
|
11
|
+
inputs
|
|
12
|
+
}) => {
|
|
13
|
+
const {
|
|
14
|
+
state,
|
|
15
|
+
html
|
|
16
|
+
} = inputs.content;
|
|
17
|
+
if (html) {
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
dangerouslySetInnerHTML: {
|
|
20
|
+
__html: html
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return /*#__PURE__*/React.createElement(LexicalHtmlRenderer, {
|
|
25
|
+
value: state,
|
|
26
|
+
theme: {}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=Lexical.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","LexicalHtmlRenderer","createLexicalValue","value","state","LexicalComponent","inputs","html","content","createElement","dangerouslySetInnerHTML","__html","theme"],"sources":["Lexical.tsx"],"sourcesContent":["\"use client\";\nimport React from \"react\";\nimport { LexicalHtmlRenderer } from \"@webiny/lexical-editor\";\nimport type { ComponentProps } from \"~/types\";\n\nexport const createLexicalValue = (value: string) => {\n return {\n state: `{\\\"root\\\":{\\\"children\\\":[{\\\"children\\\":[{\\\"detail\\\":0,\\\"format\\\":0,\\\"mode\\\":\\\"normal\\\",\\\"style\\\":\\\"\\\",\\\"text\\\":\\\"${value}\\\",\\\"type\\\":\\\"text\\\",\\\"version\\\":1}],\\\"direction\\\":\\\"ltr\\\",\\\"format\\\":\\\"\\\",\\\"indent\\\":0,\\\"type\\\":\\\"paragraph-element\\\",\\\"version\\\":1,\\\"textFormat\\\":0,\\\"textStyle\\\":\\\"\\\",\\\"styles\\\":[{\\\"styleId\\\":\\\"paragraph1\\\",\\\"type\\\":\\\"typography\\\"}]}],\\\"direction\\\":\\\"ltr\\\",\\\"format\\\":\\\"\\\",\\\"indent\\\":0,\\\"type\\\":\\\"root\\\",\\\"version\\\":1}}`\n };\n};\n\ntype LexicalProps = ComponentProps<{\n content: {\n state: string;\n html?: string;\n };\n}>;\n\nexport const LexicalComponent = ({ inputs }: LexicalProps) => {\n const { state, html } = inputs.content;\n\n if (html) {\n return <div dangerouslySetInnerHTML={{ __html: html }}></div>;\n }\n\n return <LexicalHtmlRenderer value={state} theme={{}} />;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,mBAAmB,QAAQ,wBAAwB;AAG5D,OAAO,MAAMC,kBAAkB,GAAIC,KAAa,IAAK;EACjD,OAAO;IACHC,KAAK,EAAE,oHAAoHD,KAAK;EACpI,CAAC;AACL,CAAC;AASD,OAAO,MAAME,gBAAgB,GAAGA,CAAC;EAAEC;AAAqB,CAAC,KAAK;EAC1D,MAAM;IAAEF,KAAK;IAAEG;EAAK,CAAC,GAAGD,MAAM,CAACE,OAAO;EAEtC,IAAID,IAAI,EAAE;IACN,oBAAOP,KAAA,CAAAS,aAAA;MAAKC,uBAAuB,EAAE;QAAEC,MAAM,EAAEJ;MAAK;IAAE,CAAM,CAAC;EACjE;EAEA,oBAAOP,KAAA,CAAAS,aAAA,CAACR,mBAAmB;IAACE,KAAK,EAAEC,KAAM;IAACQ,KAAK,EAAE,CAAC;EAAE,CAAE,CAAC;AAC3D,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Lexical: import("@webiny/app-website-builder/sdk").Component;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { createLexicalInput } from "@webiny/app-website-builder/sdk";
|
|
4
|
+
import { createComponent } from "../createComponent";
|
|
5
|
+
import { LexicalComponent, createLexicalValue } from "./Lexical";
|
|
6
|
+
export const Lexical = createComponent(LexicalComponent, {
|
|
7
|
+
name: "Webiny/Lexical",
|
|
8
|
+
label: "Rich Text",
|
|
9
|
+
group: "basic",
|
|
10
|
+
image: `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M280-160v-520H80v-120h520v120H400v520H280Zm360 0v-320H520v-120h360v120H760v320H640Z"/></svg>`,
|
|
11
|
+
inputs: [createLexicalInput({
|
|
12
|
+
name: "content",
|
|
13
|
+
label: "Content"
|
|
14
|
+
})],
|
|
15
|
+
defaults: {
|
|
16
|
+
inputs: {
|
|
17
|
+
content: createLexicalValue("Examine she brother prudent add day ham. Far stairs now coming bed oppose hunted become his. You zealously departure had procuring suspicion. Books whose front would purse if be do decay. Quitting you way formerly disposed perceive ladyship are. Common turned boy direct and yet.")
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=Lexical.manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createLexicalInput","createComponent","LexicalComponent","createLexicalValue","Lexical","name","label","group","image","inputs","defaults","content"],"sources":["Lexical.manifest.ts"],"sourcesContent":["\"use client\";\nimport { createLexicalInput } from \"@webiny/app-website-builder/sdk\";\nimport { createComponent } from \"~/createComponent\";\nimport { LexicalComponent, createLexicalValue } from \"./Lexical\";\n\nexport const Lexical = createComponent(LexicalComponent, {\n name: \"Webiny/Lexical\",\n label: \"Rich Text\",\n group: \"basic\",\n image: `<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M280-160v-520H80v-120h520v120H400v520H280Zm360 0v-320H520v-120h360v120H760v320H640Z\"/></svg>`,\n inputs: [\n createLexicalInput({\n name: \"content\",\n label: \"Content\"\n })\n ],\n defaults: {\n inputs: {\n content: createLexicalValue(\n \"Examine she brother prudent add day ham. Far stairs now coming bed oppose hunted become his. You zealously departure had procuring suspicion. Books whose front would purse if be do decay. Quitting you way formerly disposed perceive ladyship are. Common turned boy direct and yet.\"\n )\n }\n }\n});\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,eAAe;AACxB,SAASC,gBAAgB,EAAEC,kBAAkB;AAE7C,OAAO,MAAMC,OAAO,GAAGH,eAAe,CAACC,gBAAgB,EAAE;EACrDG,IAAI,EAAE,gBAAgB;EACtBC,KAAK,EAAE,WAAW;EAClBC,KAAK,EAAE,OAAO;EACdC,KAAK,EAAE,mMAAmM;EAC1MC,MAAM,EAAE,CACJT,kBAAkB,CAAC;IACfK,IAAI,EAAE,SAAS;IACfC,KAAK,EAAE;EACX,CAAC,CAAC,CACL;EACDI,QAAQ,EAAE;IACND,MAAM,EAAE;MACJE,OAAO,EAAER,kBAAkB,CACvB,yRACJ;IACJ;EACJ;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","RootComponent","inputs","createElement","Fragment","children"],"sources":["Root.tsx"],"sourcesContent":["import React from \"react\";\nimport type { ComponentPropsWithChildren } from \"~/types\";\n\nexport const RootComponent = ({ inputs }: ComponentPropsWithChildren) => {\n return <>{inputs.children}</>;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,OAAO,MAAMC,aAAa,GAAGA,CAAC;EAAEC;AAAmC,CAAC,KAAK;EACrE,oBAAOF,KAAA,CAAAG,aAAA,CAAAH,KAAA,CAAAI,QAAA,QAAGF,MAAM,CAACG,QAAW,CAAC;AACjC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Root: import("@webiny/app-website-builder/sdk").Component;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { createComponent } from "../createComponent";
|
|
4
|
+
import { RootComponent } from "./Root";
|
|
5
|
+
export const Root = createComponent(RootComponent, {
|
|
6
|
+
name: "Webiny/Root",
|
|
7
|
+
label: "Main Content",
|
|
8
|
+
acceptsChildren: true,
|
|
9
|
+
hideFromToolbar: true
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=Root.manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createComponent","RootComponent","Root","name","label","acceptsChildren","hideFromToolbar"],"sources":["Root.manifest.ts"],"sourcesContent":["\"use client\";\nimport { createComponent } from \"~/createComponent\";\nimport { RootComponent } from \"./Root\";\n\nexport const Root = createComponent(RootComponent, {\n name: \"Webiny/Root\",\n label: \"Main Content\",\n acceptsChildren: true,\n hideFromToolbar: true\n})\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,eAAe;AACxB,SAASC,aAAa;AAEtB,OAAO,MAAMC,IAAI,GAAGF,eAAe,CAACC,aAAa,EAAE;EAC/CE,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAE,cAAc;EACrBC,eAAe,EAAE,IAAI;EACrBC,eAAe,EAAE;AACrB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const editorComponents: import("@webiny/app-website-builder/sdk/types.js").Component[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Box } from "./Box.manifest.js";
|
|
2
|
+
import { Grid } from "./Grid.manifest.js";
|
|
3
|
+
import { Image } from "./Image.manifest.js";
|
|
4
|
+
import { Lexical } from "./Lexical.manifest.js";
|
|
5
|
+
import { Root } from "./Root.manifest.js";
|
|
6
|
+
import { GridColumn } from "./GridColumn.manifest";
|
|
7
|
+
import { Fragment } from "./Fragment.manifest";
|
|
8
|
+
export const editorComponents = [Root, Box, Grid, GridColumn, Image, Lexical, Fragment];
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Box","Grid","Image","Lexical","Root","GridColumn","Fragment","editorComponents"],"sources":["index.ts"],"sourcesContent":["import { Box } from \"./Box.manifest.js\";\nimport { Grid } from \"./Grid.manifest.js\";\nimport { Image } from \"./Image.manifest.js\";\nimport { Lexical } from \"./Lexical.manifest.js\";\nimport { Root } from \"./Root.manifest.js\";\nimport { GridColumn } from \"./GridColumn.manifest\";\nimport { Fragment } from \"./Fragment.manifest\";\n\nexport const editorComponents = [Root, Box, Grid, GridColumn, Image, Lexical, Fragment];\n"],"mappings":"AAAA,SAASA,GAAG;AACZ,SAASC,IAAI;AACb,SAASC,KAAK;AACd,SAASC,OAAO;AAChB,SAASC,IAAI;AACb,SAASC,UAAU;AACnB,SAASC,QAAQ;AAEjB,OAAO,MAAMC,gBAAgB,GAAG,CAACH,IAAI,EAAEJ,GAAG,EAAEC,IAAI,EAAEI,UAAU,EAAEH,KAAK,EAAEC,OAAO,EAAEG,QAAQ,CAAC","ignoreList":[]}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * from "./components/index.js";
|
|
2
|
+
export * from "./createComponent.js";
|
|
3
|
+
export { createTextInput, createLongTextInput, createNumberInput, createBooleanInput, createColorInput, createFileInput, createDateInput, createLexicalInput, createSelectInput, createRadioInput, createObjectInput, createTagsInput, createSlotInput, createInput, createElement, contentSdk, environment, setHeadersProvider, getHeadersProvider, registerComponentGroup, type Document, type DocumentElement, type Breakpoint, type CreateElementParams, type ContentSDKConfig, type ComponentManifest, type ComponentInput, StyleSettings } from "@webiny/app-website-builder/sdk";
|
|
4
|
+
export type { ComponentProps, ComponentPropsWithChildren } from "./types.js";
|
package/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "./components/index.js";
|
|
2
|
+
export * from "./createComponent.js";
|
|
3
|
+
export { createTextInput, createLongTextInput, createNumberInput, createBooleanInput, createColorInput, createFileInput, createDateInput, createLexicalInput, createSelectInput, createRadioInput, createObjectInput, createTagsInput, createSlotInput, createInput, createElement, contentSdk, environment, setHeadersProvider, getHeadersProvider, registerComponentGroup, StyleSettings } from "@webiny/app-website-builder/sdk";
|
|
4
|
+
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createTextInput","createLongTextInput","createNumberInput","createBooleanInput","createColorInput","createFileInput","createDateInput","createLexicalInput","createSelectInput","createRadioInput","createObjectInput","createTagsInput","createSlotInput","createInput","createElement","contentSdk","environment","setHeadersProvider","getHeadersProvider","registerComponentGroup","StyleSettings"],"sources":["index.ts"],"sourcesContent":["export * from \"./components/index.js\";\nexport * from \"./createComponent.js\";\n\nexport {\n createTextInput,\n createLongTextInput,\n createNumberInput,\n createBooleanInput,\n createColorInput,\n createFileInput,\n createDateInput,\n createLexicalInput,\n createSelectInput,\n createRadioInput,\n createObjectInput,\n createTagsInput,\n createSlotInput,\n createInput,\n createElement,\n contentSdk,\n environment,\n setHeadersProvider,\n getHeadersProvider,\n registerComponentGroup,\n type Document,\n type DocumentElement,\n type Breakpoint,\n type CreateElementParams,\n type ContentSDKConfig,\n type ComponentManifest,\n type ComponentInput,\n StyleSettings\n} from \"@webiny/app-website-builder/sdk\";\n\nexport type { ComponentProps, ComponentPropsWithChildren } from \"./types.js\";\n"],"mappings":"AAAA;AACA;AAEA,SACIA,eAAe,EACfC,mBAAmB,EACnBC,iBAAiB,EACjBC,kBAAkB,EAClBC,gBAAgB,EAChBC,eAAe,EACfC,eAAe,EACfC,kBAAkB,EAClBC,iBAAiB,EACjBC,gBAAgB,EAChBC,iBAAiB,EACjBC,eAAe,EACfC,eAAe,EACfC,WAAW,EACXC,aAAa,EACbC,UAAU,EACVC,WAAW,EACXC,kBAAkB,EAClBC,kBAAkB,EAClBC,sBAAsB,EAQtBC,aAAa,QACV,iCAAiC","ignoreList":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webiny/website-builder-react",
|
|
3
|
+
"version": "6.0.0-alpha.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/webiny/webiny-js.git"
|
|
8
|
+
},
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./index.js"
|
|
11
|
+
},
|
|
12
|
+
"description": "A React frontend integration SDK for Webiny Website Builder.",
|
|
13
|
+
"contributors": [
|
|
14
|
+
"Pavel Denisjuk <pavel@webiny.com>",
|
|
15
|
+
"Sven Al Hamad <sven@webiny.com>",
|
|
16
|
+
"Adrian Smijulj <adrian@webiny.com>"
|
|
17
|
+
],
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@webiny/app-website-builder": "6.0.0-alpha.0",
|
|
21
|
+
"@webiny/lexical-editor": "6.0.0-alpha.0",
|
|
22
|
+
"deep-equal": "2.2.3",
|
|
23
|
+
"mobx": "6.9.0",
|
|
24
|
+
"mobx-react-lite": "3.4.3",
|
|
25
|
+
"react": "18.2.0",
|
|
26
|
+
"react-dom": "18.2.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/react": "18.2.79",
|
|
30
|
+
"@webiny/project-utils": "6.0.0-alpha.0",
|
|
31
|
+
"typescript": "5.3.3"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public",
|
|
35
|
+
"directory": "dist"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "node ../cli/bin.js run build",
|
|
39
|
+
"watch": "node ../cli/bin.js run watch"
|
|
40
|
+
},
|
|
41
|
+
"gitHead": "a5b28fed7a242d8f56712197a8ea83aa6d2ed101"
|
|
42
|
+
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CssProperties, DocumentElement } from "@webiny/app-website-builder/sdk";
|
|
3
|
+
export type ComponentProps<TInputs = unknown> = {
|
|
4
|
+
inputs: TInputs;
|
|
5
|
+
styles: CssProperties;
|
|
6
|
+
element: DocumentElement;
|
|
7
|
+
breakpoint: string;
|
|
8
|
+
};
|
|
9
|
+
export type ComponentPropsWithChildren<TInputs = unknown> = ComponentProps<TInputs & {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}>;
|
package/types.js
ADDED
package/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { CssProperties, DocumentElement } from \"@webiny/app-website-builder/sdk\";\n\nexport type ComponentProps<TInputs = unknown> = {\n inputs: TInputs;\n styles: CssProperties;\n element: DocumentElement;\n breakpoint: string;\n};\n\nexport type ComponentPropsWithChildren<TInputs = unknown> = ComponentProps<\n TInputs & { children: React.ReactNode }\n>;\n"],"mappings":"","ignoreList":[]}
|