@sitecore-jss/sitecore-jss-react 22.5.5-canary.1 → 22.5.5-canary.2

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: ((_a = component.render) === null || _a === void 0 ? void 0 : _a.preload) ? true : false }, rendered.props), rendered));
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: ((_a = component.render) === null || _a === void 0 ? void 0 : _a.preload) ? true : false }, rendered.props), rendered));
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.5.5-canary.1",
3
+ "version": "22.5.5-canary.2",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "sideEffects": false,
@@ -61,14 +61,14 @@
61
61
  "react-dom": "^18.2.0"
62
62
  },
63
63
  "dependencies": {
64
- "@sitecore-jss/sitecore-jss": "22.5.5-canary.1",
64
+ "@sitecore-jss/sitecore-jss": "22.5.5-canary.2",
65
65
  "fast-deep-equal": "^3.1.3",
66
66
  "prop-types": "^15.8.1",
67
67
  "style-attr": "^1.3.0"
68
68
  },
69
69
  "description": "",
70
70
  "types": "types/index.d.ts",
71
- "gitHead": "93b71154460b7ab17dafadc000e517877b70f6dc",
71
+ "gitHead": "1945baf205e8115644e974c2ad6ecaa3515cbc61",
72
72
  "files": [
73
73
  "dist",
74
74
  "types"