@dotcms/react 0.0.1-alpha.36 → 0.0.1-alpha.37
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/index.esm.js
CHANGED
|
@@ -4606,6 +4606,17 @@ const BlockQuote = ({
|
|
|
4606
4606
|
});
|
|
4607
4607
|
};
|
|
4608
4608
|
|
|
4609
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
4610
|
+
if (null == r) return {};
|
|
4611
|
+
var t = {};
|
|
4612
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
4613
|
+
if (e.includes(n)) continue;
|
|
4614
|
+
t[n] = r[n];
|
|
4615
|
+
}
|
|
4616
|
+
return t;
|
|
4617
|
+
}
|
|
4618
|
+
|
|
4619
|
+
const _excluded = ["customRenderers"];
|
|
4609
4620
|
/**
|
|
4610
4621
|
* Renders the default content for an unknown content type.
|
|
4611
4622
|
*/
|
|
@@ -4618,18 +4629,21 @@ const DefaultContent = () => jsx("div", {
|
|
|
4618
4629
|
* @param {DotContentProps} props - The props for the DotContent component.
|
|
4619
4630
|
* @returns {JSX.Element} The rendered DotContent component.
|
|
4620
4631
|
*/
|
|
4621
|
-
const DotContent =
|
|
4632
|
+
const DotContent = _ref => {
|
|
4622
4633
|
var _customRenderers$data;
|
|
4634
|
+
let {
|
|
4635
|
+
customRenderers
|
|
4636
|
+
} = _ref,
|
|
4637
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
4623
4638
|
const {
|
|
4624
|
-
attrs
|
|
4625
|
-
customRenderers
|
|
4639
|
+
attrs
|
|
4626
4640
|
} = props;
|
|
4627
4641
|
const data = attrs == null ? void 0 : attrs.data;
|
|
4628
4642
|
const Component = (_customRenderers$data = customRenderers == null ? void 0 : customRenderers[data == null ? void 0 : data.contentType]) != null ? _customRenderers$data : DefaultContent;
|
|
4629
4643
|
if (!data) {
|
|
4630
4644
|
console.error('DotContent: No data provided');
|
|
4631
4645
|
}
|
|
4632
|
-
return jsx(Component, Object.assign({},
|
|
4646
|
+
return jsx(Component, Object.assign({}, props));
|
|
4633
4647
|
};
|
|
4634
4648
|
|
|
4635
4649
|
/**
|
|
@@ -4941,7 +4955,7 @@ const BlockEditorBlock = ({
|
|
|
4941
4955
|
return content == null ? void 0 : content.map((node, index) => {
|
|
4942
4956
|
const CustomRendererComponent = customRenderers == null ? void 0 : customRenderers[node.type];
|
|
4943
4957
|
if (CustomRendererComponent) {
|
|
4944
|
-
return jsx(CustomRendererComponent, Object.assign({}, node
|
|
4958
|
+
return jsx(CustomRendererComponent, Object.assign({}, node, {
|
|
4945
4959
|
content: node.content,
|
|
4946
4960
|
children: jsx(BlockEditorBlock, {
|
|
4947
4961
|
content: node.content,
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotcms/react",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.37",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": ">=18",
|
|
6
6
|
"react-dom": ">=18",
|
|
7
|
-
"@dotcms/client": "0.0.1-alpha.
|
|
7
|
+
"@dotcms/client": "0.0.1-alpha.37",
|
|
8
8
|
"@tinymce/tinymce-react": "^5.1.1"
|
|
9
9
|
},
|
|
10
10
|
"description": "Official React Components library to render a dotCMS page.",
|
|
@@ -38,4 +38,4 @@ export interface Contentlet {
|
|
|
38
38
|
* @param {DotContentProps} props - The props for the DotContent component.
|
|
39
39
|
* @returns {JSX.Element} The rendered DotContent component.
|
|
40
40
|
*/
|
|
41
|
-
export declare const DotContent: (props: DotContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare const DotContent: ({ customRenderers, ...props }: DotContentProps) => import("react/jsx-runtime").JSX.Element;
|