@sitecore-jss/sitecore-jss-react 21.7.0-canary.13 → 21.7.0-canary.15
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.
|
@@ -87,24 +87,21 @@ class BYOCComponent extends react_1.default.Component {
|
|
|
87
87
|
};
|
|
88
88
|
const fallbackComponent = this.props.missingComponentComponent ? (react_1.default.createElement(this.props.missingComponentComponent, Object.assign({}, unRegisteredComponentProps))) : (react_1.default.createElement(MissingComponent_1.MissingComponent, Object.assign({}, unRegisteredComponentProps)));
|
|
89
89
|
const ErrorComponent = this.props.errorComponent;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
try {
|
|
95
|
-
componentProps = (_b = JSON.parse(props.params.ComponentProps)) !== null && _b !== void 0 ? _b : {};
|
|
96
|
-
}
|
|
97
|
-
catch (e) {
|
|
98
|
-
console.error(`Parsing props for ${componentName} component from rendering params failed. Error: ${e}`);
|
|
99
|
-
return ErrorComponent ? (react_1.default.createElement(ErrorComponent, { error: e })) : (react_1.default.createElement(DefaultErrorComponent, { error: e }));
|
|
100
|
-
}
|
|
90
|
+
let componentProps = null;
|
|
91
|
+
if ((_a = props.params) === null || _a === void 0 ? void 0 : _a.ComponentProps) {
|
|
92
|
+
try {
|
|
93
|
+
componentProps = (_b = JSON.parse(props.params.ComponentProps)) !== null && _b !== void 0 ? _b : {};
|
|
101
94
|
}
|
|
102
|
-
|
|
103
|
-
|
|
95
|
+
catch (e) {
|
|
96
|
+
console.error(`Parsing props for ${componentName} component from rendering params failed. Error: ${e}`);
|
|
97
|
+
return ErrorComponent ? (react_1.default.createElement(ErrorComponent, { error: e })) : (react_1.default.createElement(DefaultErrorComponent, { error: e }));
|
|
104
98
|
}
|
|
105
99
|
}
|
|
100
|
+
else {
|
|
101
|
+
componentProps = props.fields ? (0, utils_1.getDataFromFields)(props.fields) : {};
|
|
102
|
+
}
|
|
106
103
|
// we render fallback on client to avoid problems with client-only components
|
|
107
|
-
return (react_1.default.createElement(FEAAS.ExternalComponent, Object.assign({ componentName: componentName, clientFallback: fallbackComponent }, componentProps)));
|
|
104
|
+
return (react_1.default.createElement(FEAAS.ExternalComponent, Object.assign({ componentName: componentName, clientFallback: fallbackComponent, datasources: props.fetchedData }, componentProps)));
|
|
108
105
|
}
|
|
109
106
|
}
|
|
110
107
|
exports.BYOCComponent = BYOCComponent;
|
|
@@ -58,24 +58,21 @@ export class BYOCComponent extends React.Component {
|
|
|
58
58
|
};
|
|
59
59
|
const fallbackComponent = this.props.missingComponentComponent ? (React.createElement(this.props.missingComponentComponent, Object.assign({}, unRegisteredComponentProps))) : (React.createElement(MissingComponent, Object.assign({}, unRegisteredComponentProps)));
|
|
60
60
|
const ErrorComponent = this.props.errorComponent;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
try {
|
|
66
|
-
componentProps = (_b = JSON.parse(props.params.ComponentProps)) !== null && _b !== void 0 ? _b : {};
|
|
67
|
-
}
|
|
68
|
-
catch (e) {
|
|
69
|
-
console.error(`Parsing props for ${componentName} component from rendering params failed. Error: ${e}`);
|
|
70
|
-
return ErrorComponent ? (React.createElement(ErrorComponent, { error: e })) : (React.createElement(DefaultErrorComponent, { error: e }));
|
|
71
|
-
}
|
|
61
|
+
let componentProps = null;
|
|
62
|
+
if ((_a = props.params) === null || _a === void 0 ? void 0 : _a.ComponentProps) {
|
|
63
|
+
try {
|
|
64
|
+
componentProps = (_b = JSON.parse(props.params.ComponentProps)) !== null && _b !== void 0 ? _b : {};
|
|
72
65
|
}
|
|
73
|
-
|
|
74
|
-
|
|
66
|
+
catch (e) {
|
|
67
|
+
console.error(`Parsing props for ${componentName} component from rendering params failed. Error: ${e}`);
|
|
68
|
+
return ErrorComponent ? (React.createElement(ErrorComponent, { error: e })) : (React.createElement(DefaultErrorComponent, { error: e }));
|
|
75
69
|
}
|
|
76
70
|
}
|
|
71
|
+
else {
|
|
72
|
+
componentProps = props.fields ? getDataFromFields(props.fields) : {};
|
|
73
|
+
}
|
|
77
74
|
// we render fallback on client to avoid problems with client-only components
|
|
78
|
-
return (React.createElement(FEAAS.ExternalComponent, Object.assign({ componentName: componentName, clientFallback: fallbackComponent }, componentProps)));
|
|
75
|
+
return (React.createElement(FEAAS.ExternalComponent, Object.assign({ componentName: componentName, clientFallback: fallbackComponent, datasources: props.fetchedData }, componentProps)));
|
|
79
76
|
}
|
|
80
77
|
}
|
|
81
78
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-jss/sitecore-jss-react",
|
|
3
|
-
"version": "21.7.0-canary.
|
|
3
|
+
"version": "21.7.0-canary.15",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"url": "https://github.com/sitecore/jss/issues"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@sitecore-feaas/clientside": "^0.
|
|
30
|
+
"@sitecore-feaas/clientside": "^0.5.0",
|
|
31
31
|
"@types/chai": "^4.3.4",
|
|
32
32
|
"@types/chai-string": "^1.4.2",
|
|
33
33
|
"@types/deep-equal": "^1.0.1",
|
|
@@ -58,19 +58,19 @@
|
|
|
58
58
|
"typescript": "~4.9.3"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@sitecore-feaas/clientside": "^0.
|
|
61
|
+
"@sitecore-feaas/clientside": "^0.5.0",
|
|
62
62
|
"react": "^18.2.0",
|
|
63
63
|
"react-dom": "^18.2.0"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@sitecore-jss/sitecore-jss": "^21.7.0-canary.
|
|
66
|
+
"@sitecore-jss/sitecore-jss": "^21.7.0-canary.15",
|
|
67
67
|
"deep-equal": "^2.1.0",
|
|
68
68
|
"prop-types": "^15.8.1",
|
|
69
69
|
"style-attr": "^1.3.0"
|
|
70
70
|
},
|
|
71
71
|
"description": "",
|
|
72
72
|
"types": "types/index.d.ts",
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "6874ec1d45dcd8356ff8eacab80cddca6daca045",
|
|
74
74
|
"files": [
|
|
75
75
|
"dist",
|
|
76
76
|
"types"
|