@sitecore-jss/sitecore-jss-react 22.6.0-canary.33 → 22.6.0-canary.35
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.
|
@@ -147,9 +147,13 @@ class PlaceholderCommon extends react_1.default.Component {
|
|
|
147
147
|
if (!isEmpty) {
|
|
148
148
|
// assign type based on passed element - type='text/sitecore' should be ignored when renderEach Placeholder prop function is being used
|
|
149
149
|
const type = rendered.props.type === 'text/sitecore' ? rendered.props.type : '';
|
|
150
|
+
// the registered BYOC components are imported using dynamic(), so we need to account for that when passing the isDynamic prop to ErrorBoundary
|
|
151
|
+
const isByocWrapper = componentRendering.componentName === BYOCWrapper_1.BYOC_WRAPPER_RENDERING_NAME;
|
|
152
|
+
// all dynamic elements will have a separate render prop
|
|
153
|
+
const isDynamicComponent = !!((_a = component.render) === null || _a === void 0 ? void 0 : _a.preload);
|
|
150
154
|
// wrapping with error boundary could cause problems in case where parent component uses withPlaceholder HOC and tries to access its children props
|
|
151
155
|
// that's why we need to expose element's props here
|
|
152
|
-
rendered = (react_1.default.createElement(ErrorBoundary_1.default, Object.assign({ key: rendered.type + '-' + index, errorComponent: this.props.errorComponent, componentLoadingMessage: this.props.componentLoadingMessage, type: type, isDynamic:
|
|
156
|
+
rendered = (react_1.default.createElement(ErrorBoundary_1.default, Object.assign({ key: rendered.type + '-' + index, errorComponent: this.props.errorComponent, componentLoadingMessage: this.props.componentLoadingMessage, type: type, isDynamic: isDynamicComponent || isByocWrapper }, rendered.props), rendered));
|
|
153
157
|
}
|
|
154
158
|
// if editMode is equal to 'metadata' then emit shallow chromes for hydration in Pages
|
|
155
159
|
if (((_b = this.props.sitecoreContext) === null || _b === void 0 ? void 0 : _b.editMode) === layout_1.EditMode.Metadata) {
|
|
@@ -141,9 +141,13 @@ export class PlaceholderCommon extends React.Component {
|
|
|
141
141
|
if (!isEmpty) {
|
|
142
142
|
// assign type based on passed element - type='text/sitecore' should be ignored when renderEach Placeholder prop function is being used
|
|
143
143
|
const type = rendered.props.type === 'text/sitecore' ? rendered.props.type : '';
|
|
144
|
+
// the registered BYOC components are imported using dynamic(), so we need to account for that when passing the isDynamic prop to ErrorBoundary
|
|
145
|
+
const isByocWrapper = componentRendering.componentName === BYOC_WRAPPER_RENDERING_NAME;
|
|
146
|
+
// all dynamic elements will have a separate render prop
|
|
147
|
+
const isDynamicComponent = !!((_a = component.render) === null || _a === void 0 ? void 0 : _a.preload);
|
|
144
148
|
// wrapping with error boundary could cause problems in case where parent component uses withPlaceholder HOC and tries to access its children props
|
|
145
149
|
// that's why we need to expose element's props here
|
|
146
|
-
rendered = (React.createElement(ErrorBoundary, Object.assign({ key: rendered.type + '-' + index, errorComponent: this.props.errorComponent, componentLoadingMessage: this.props.componentLoadingMessage, type: type, isDynamic:
|
|
150
|
+
rendered = (React.createElement(ErrorBoundary, Object.assign({ key: rendered.type + '-' + index, errorComponent: this.props.errorComponent, componentLoadingMessage: this.props.componentLoadingMessage, type: type, isDynamic: isDynamicComponent || isByocWrapper }, rendered.props), rendered));
|
|
147
151
|
}
|
|
148
152
|
// if editMode is equal to 'metadata' then emit shallow chromes for hydration in Pages
|
|
149
153
|
if (((_b = this.props.sitecoreContext) === null || _b === void 0 ? void 0 : _b.editMode) === EditMode.Metadata) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-jss/sitecore-jss-react",
|
|
3
|
-
"version": "22.6.0-canary.
|
|
3
|
+
"version": "22.6.0-canary.35",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
"react-dom": "^18.2.0"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@sitecore-jss/sitecore-jss": "22.6.0-canary.
|
|
65
|
+
"@sitecore-jss/sitecore-jss": "22.6.0-canary.35",
|
|
66
66
|
"fast-deep-equal": "^3.1.3",
|
|
67
67
|
"prop-types": "^15.8.1",
|
|
68
68
|
"style-attr": "^1.3.0"
|
|
69
69
|
},
|
|
70
70
|
"description": "",
|
|
71
71
|
"types": "types/index.d.ts",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "5894627d1e8a23b0487f6bc4a405d88c22cddfc6",
|
|
73
73
|
"files": [
|
|
74
74
|
"dist",
|
|
75
75
|
"types"
|