@sitecore-jss/sitecore-jss-react 21.7.0-canary.9 → 21.7.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.txt CHANGED
@@ -1,202 +1,202 @@
1
-
2
- Apache License
3
- Version 2.0, January 2004
4
- http://www.apache.org/licenses/
5
-
6
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
- 1. Definitions.
9
-
10
- "License" shall mean the terms and conditions for use, reproduction,
11
- and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by
14
- the copyright owner that is granting the License.
15
-
16
- "Legal Entity" shall mean the union of the acting entity and all
17
- other entities that control, are controlled by, or are under common
18
- control with that entity. For the purposes of this definition,
19
- "control" means (i) the power, direct or indirect, to cause the
20
- direction or management of such entity, whether by contract or
21
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
- outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
- "You" (or "Your") shall mean an individual or Legal Entity
25
- exercising permissions granted by this License.
26
-
27
- "Source" form shall mean the preferred form for making modifications,
28
- including but not limited to software source code, documentation
29
- source, and configuration files.
30
-
31
- "Object" form shall mean any form resulting from mechanical
32
- transformation or translation of a Source form, including but
33
- not limited to compiled object code, generated documentation,
34
- and conversions to other media types.
35
-
36
- "Work" shall mean the work of authorship, whether in Source or
37
- Object form, made available under the License, as indicated by a
38
- copyright notice that is included in or attached to the work
39
- (an example is provided in the Appendix below).
40
-
41
- "Derivative Works" shall mean any work, whether in Source or Object
42
- form, that is based on (or derived from) the Work and for which the
43
- editorial revisions, annotations, elaborations, or other modifications
44
- represent, as a whole, an original work of authorship. For the purposes
45
- of this License, Derivative Works shall not include works that remain
46
- separable from, or merely link (or bind by name) to the interfaces of,
47
- the Work and Derivative Works thereof.
48
-
49
- "Contribution" shall mean any work of authorship, including
50
- the original version of the Work and any modifications or additions
51
- to that Work or Derivative Works thereof, that is intentionally
52
- submitted to Licensor for inclusion in the Work by the copyright owner
53
- or by an individual or Legal Entity authorized to submit on behalf of
54
- the copyright owner. For the purposes of this definition, "submitted"
55
- means any form of electronic, verbal, or written communication sent
56
- to the Licensor or its representatives, including but not limited to
57
- communication on electronic mailing lists, source code control systems,
58
- and issue tracking systems that are managed by, or on behalf of, the
59
- Licensor for the purpose of discussing and improving the Work, but
60
- excluding communication that is conspicuously marked or otherwise
61
- designated in writing by the copyright owner as "Not a Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
178
-
179
- APPENDIX: How to apply the Apache License to your work.
180
-
181
- To apply the Apache License to your work, attach the following
182
- boilerplate notice, with the fields enclosed by brackets "[]"
183
- replaced with your own identifying information. (Don't include
184
- the brackets!) The text should be enclosed in the appropriate
185
- comment syntax for the file format. We also recommend that a
186
- file or class name and description of purpose be included on the
187
- same "printed page" as the copyright notice for easier
188
- identification within third-party archives.
189
-
190
- Copyright [yyyy] [name of copyright owner]
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
202
- limitations under the License.
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,10 +1,7 @@
1
- # Sitecore JavaScript Rendering SDK for React
2
-
3
- This module is provided as a part of Sitecore JavaScript Rendering SDK (JSS). It contains React components and integration for JSS.
4
-
5
- <!---
6
- @TODO: Update to next version docs before release
7
- -->
8
- [Documentation (Experience Platform)](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/sitecore-javascript-rendering-sdk--jss--for-react.html)
9
-
10
- [API reference documentation](/ref-docs/sitecore-jss-react/)
1
+ # Sitecore JavaScript Rendering SDK for React
2
+
3
+ This module is provided as a part of Sitecore JavaScript Rendering SDK (JSS). It contains React components and integration for JSS.
4
+
5
+ [Documentation (Experience Platform)](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/sitecore-javascript-rendering-sdk--jss--for-react.html)
6
+
7
+ [API reference documentation](/ref-docs/sitecore-jss-react/)
@@ -67,7 +67,7 @@ class BYOCComponent extends react_1.default.Component {
67
67
  this.setState({ error });
68
68
  }
69
69
  render() {
70
- var _a, _b;
70
+ var _a, _b, _c;
71
71
  const props = this.props;
72
72
  if (this.state.error) {
73
73
  return this.props.errorComponent ? (react_1.default.createElement(this.props.errorComponent, { error: this.state.error })) : (react_1.default.createElement(DefaultErrorComponent, { error: this.state.error }));
@@ -87,24 +87,20 @@ 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
- const isNull = props.fetchedData && Object.keys(props.fetchedData).length === 0;
91
- let componentProps = isNull ? null : props.fetchedData;
92
- if (!componentProps) {
93
- if ((_a = props.params) === null || _a === void 0 ? void 0 : _a.ComponentProps) {
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 = {};
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
- else {
103
- componentProps = props.fields ? (0, utils_1.getDataFromFields)(props.fields) : {};
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
+ // apply props from item datasource
101
+ const dataSourcesData = Object.assign(Object.assign({}, props.fetchedData), { _: (0, utils_1.getDataFromFields)((_c = props.fields) !== null && _c !== void 0 ? _c : {}) });
106
102
  // 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)));
103
+ return (react_1.default.createElement(FEAAS.ExternalComponent, Object.assign({ componentName: componentName, clientFallback: fallbackComponent, datasources: dataSourcesData }, componentProps)));
108
104
  }
109
105
  }
110
106
  exports.BYOCComponent = BYOCComponent;
@@ -114,8 +110,8 @@ exports.BYOCComponent = BYOCComponent;
114
110
  */
115
111
  function fetchBYOCComponentServerProps(params) {
116
112
  return __awaiter(this, void 0, void 0, function* () {
117
- const fetchDataOptions = params.ComponentProps
118
- ? JSON.parse(params.ComponentProps)
113
+ const fetchDataOptions = params.ComponentDataOverride
114
+ ? JSON.parse(params.ComponentDataOverride)
119
115
  : {};
120
116
  const fetchedData = yield FEAAS.DataSettings.fetch(fetchDataOptions || {});
121
117
  return {
@@ -57,27 +57,13 @@ const FEaaSComponent = (props) => {
57
57
  // Missing FEaaS component required props
58
58
  return null;
59
59
  }
60
- let data = null;
61
- if (props.fetchedData === null || props.fetchedData === undefined) {
62
- if ((_b = props.params) === null || _b === void 0 ? void 0 : _b.ComponentDataOverride) {
63
- // Use override data if provided
64
- try {
65
- data = JSON.parse(props.params.ComponentDataOverride);
66
- }
67
- catch (e) {
68
- data = null;
69
- }
70
- }
71
- else if (props.fields) {
72
- // Otherwise use datasource data (provided in fields)
73
- data = (0, utils_1.getDataFromFields)(props.fields);
74
- }
75
- }
60
+ // combine fetchedData from server with datasource data (if present)
61
+ const data = Object.assign(Object.assign({}, props.fetchedData), { _: (0, utils_1.getDataFromFields)((_b = props.fields) !== null && _b !== void 0 ? _b : {}) });
76
62
  // FEaaS control would still be hydrated by client
77
63
  // we pass all the props as a workaround to avoid hydration error, until we convert all JSS components to server side
78
64
  // this also allows component to fall back to full client-side rendering when template or src is empty
79
65
  // FEAAS should not fetch anything, since JSS does the fetching - so we pass empty array into fetch param
80
- return (react_1.default.createElement(FEAAS.Component, { data: props.fetchedData || data, template: props.template, cdn: (_c = props.params) === null || _c === void 0 ? void 0 : _c.ComponentHostName, library: (_d = props.params) === null || _d === void 0 ? void 0 : _d.LibraryId, version: (_e = props.params) === null || _e === void 0 ? void 0 : _e.ComponentVersion, component: (_f = props.params) === null || _f === void 0 ? void 0 : _f.ComponentId, instance: (_g = props.params) === null || _g === void 0 ? void 0 : _g.ComponentInstanceId, revision: computedRevision, fetch: [] }));
66
+ return (react_1.default.createElement(FEAAS.Component, { data: data, template: props.template, cdn: (_c = props.params) === null || _c === void 0 ? void 0 : _c.ComponentHostName, library: (_d = props.params) === null || _d === void 0 ? void 0 : _d.LibraryId, version: (_e = props.params) === null || _e === void 0 ? void 0 : _e.ComponentVersion, component: (_f = props.params) === null || _f === void 0 ? void 0 : _f.ComponentId, instance: (_g = props.params) === null || _g === void 0 ? void 0 : _g.ComponentInstanceId, revision: computedRevision, fetch: [] }));
81
67
  };
82
68
  exports.FEaaSComponent = FEaaSComponent;
83
69
  /**
@@ -92,7 +78,7 @@ function fetchFEaaSComponentServerProps(params, pageState, endpointOverride) {
92
78
  const revisionFallback = pageState && pageState !== layout_1.LayoutServicePageState.Normal ? 'staged' : 'published';
93
79
  const src = endpointOverride || (0, exports.composeComponentEndpoint)(params, revisionFallback);
94
80
  let template = '';
95
- let fetchedData = null;
81
+ let fetchedData = {};
96
82
  const fetchDataOptions = params.ComponentDataOverride
97
83
  ? JSON.parse(params.ComponentDataOverride)
98
84
  : {};
@@ -24,14 +24,6 @@ const FEaaSComponent_1 = require("./FEaaSComponent");
24
24
  const FEaaSWrapper_1 = require("./FEaaSWrapper");
25
25
  const BYOCComponent_1 = require("./BYOCComponent");
26
26
  const BYOCWrapper_1 = require("./BYOCWrapper");
27
- /**
28
- * These patterns need for right rendering Dynamic placeholders.
29
- * Must be distinguished Splitter components and another placeholders(containers)
30
- */
31
- const EXCLUDE_PLACEHOLDERS_RENDER = [
32
- new RegExp(/column-(\d{1})-\{\*\}/i),
33
- new RegExp(/row-(\d{1})-\{\*\}/i),
34
- ];
35
27
  class PlaceholderCommon extends react_1.default.Component {
36
28
  constructor(props) {
37
29
  super(props);
@@ -47,9 +39,10 @@ class PlaceholderCommon extends react_1.default.Component {
47
39
  from backend side we get common name of placeholder is called 'nameOfContainer-{*}' where '{*}' marker for replacing **/
48
40
  if (rendering === null || rendering === void 0 ? void 0 : rendering.placeholders) {
49
41
  Object.keys(rendering.placeholders).forEach((placeholder) => {
50
- if (placeholder.indexOf('{*}') !== -1 &&
51
- !EXCLUDE_PLACEHOLDERS_RENDER.some((pattern) => name.search(pattern) !== -1) &&
52
- name.replace(/[^a-zA-Z]*/gi, '') === placeholder.replace(/[^a-zA-Z]*/gi, '')) {
42
+ const patternPlaceholder = placeholder.indexOf('{*}') !== -1
43
+ ? new RegExp(`^${placeholder.replace(/\{\*\}+/i, '\\d+')}$`)
44
+ : null;
45
+ if (patternPlaceholder && patternPlaceholder.test(name)) {
53
46
  rendering.placeholders[name] = rendering.placeholders[placeholder];
54
47
  delete rendering.placeholders[placeholder];
55
48
  }
@@ -7,7 +7,7 @@ exports.SitecoreContext = exports.ComponentFactoryReactContext = exports.Sitecor
7
7
  /* eslint-disable @typescript-eslint/no-explicit-any */
8
8
  const react_1 = __importDefault(require("react"));
9
9
  const prop_types_1 = __importDefault(require("prop-types"));
10
- const deep_equal_1 = __importDefault(require("deep-equal"));
10
+ const react_2 = __importDefault(require("fast-deep-equal/es6/react"));
11
11
  exports.SitecoreContextReactContext = react_1.default.createContext({});
12
12
  exports.ComponentFactoryReactContext = react_1.default.createContext({});
13
13
  class SitecoreContext extends react_1.default.Component {
@@ -43,7 +43,7 @@ class SitecoreContext extends react_1.default.Component {
43
43
  componentDidUpdate(prevProps) {
44
44
  // In case if somebody will manage SitecoreContext state by passing fresh `layoutData` prop
45
45
  // instead of using `updateSitecoreContext`
46
- if (!(0, deep_equal_1.default)(prevProps.layoutData, this.props.layoutData)) {
46
+ if (!(0, react_2.default)(prevProps.layoutData, this.props.layoutData)) {
47
47
  this.setContext(this.props.layoutData);
48
48
  return;
49
49
  }
package/dist/cjs/index.js CHANGED
@@ -1,15 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ComponentBuilder = exports.EditFrame = exports.withDatasourceCheck = exports.withPlaceholder = exports.withEditorChromes = exports.useSitecoreContext = exports.withSitecoreContext = exports.SitecoreContextReactContext = exports.SitecoreContext = exports.VisitorIdentification = exports.File = exports.LinkPropTypes = exports.Link = exports.BYOCWrapper = exports.fetchBYOCComponentServerProps = exports.BYOCComponent = exports.FEaaSWrapper = exports.fetchFEaaSComponentServerProps = exports.FEaaSComponent = exports.DateField = exports.Text = exports.RichTextPropTypes = exports.RichText = exports.getEEMarkup = exports.Image = exports.Placeholder = exports.getFEAASLibraryStylesheetLinks = exports.mediaApi = exports.RestDictionaryService = exports.GraphQLDictionaryService = exports.trackingApi = exports.getFieldValue = exports.getChildPlaceholder = exports.RestLayoutService = exports.GraphQLLayoutService = exports.LayoutServicePageState = exports.DefaultEditFrameButtons = exports.DefaultEditFrameButton = exports.resetEditorChromes = exports.isEditorActive = exports.enableDebug = exports.constants = void 0;
3
+ exports.ComponentBuilder = exports.EditFrame = exports.withDatasourceCheck = exports.withPlaceholder = exports.withEditorChromes = exports.useSitecoreContext = exports.withSitecoreContext = exports.SitecoreContextReactContext = exports.SitecoreContext = exports.VisitorIdentification = exports.File = exports.LinkPropTypes = exports.Link = exports.BYOCWrapper = exports.fetchBYOCComponentServerProps = exports.BYOCComponent = exports.FEaaSWrapper = exports.fetchFEaaSComponentServerProps = exports.FEaaSComponent = exports.DateField = exports.Text = exports.RichTextPropTypes = exports.RichText = exports.getEEMarkup = exports.Image = exports.Placeholder = exports.getFEAASLibraryStylesheetLinks = exports.mediaApi = exports.DefaultRetryStrategy = exports.RestDictionaryService = exports.GraphQLDictionaryService = exports.trackingApi = exports.getFieldValue = exports.getChildPlaceholder = exports.RestLayoutService = exports.GraphQLLayoutService = exports.LayoutServicePageState = exports.getComponentLibraryStylesheetLinks = exports.getContentStylesheetLink = exports.DefaultEditFrameButtons = exports.DefaultEditFrameButton = exports.resetEditorChromes = exports.isEditorActive = exports.ClientError = exports.enableDebug = exports.constants = void 0;
4
4
  var sitecore_jss_1 = require("@sitecore-jss/sitecore-jss");
5
5
  Object.defineProperty(exports, "constants", { enumerable: true, get: function () { return sitecore_jss_1.constants; } });
6
6
  Object.defineProperty(exports, "enableDebug", { enumerable: true, get: function () { return sitecore_jss_1.enableDebug; } });
7
+ Object.defineProperty(exports, "ClientError", { enumerable: true, get: function () { return sitecore_jss_1.ClientError; } });
7
8
  var utils_1 = require("@sitecore-jss/sitecore-jss/utils");
8
9
  Object.defineProperty(exports, "isEditorActive", { enumerable: true, get: function () { return utils_1.isEditorActive; } });
9
10
  Object.defineProperty(exports, "resetEditorChromes", { enumerable: true, get: function () { return utils_1.resetEditorChromes; } });
10
11
  Object.defineProperty(exports, "DefaultEditFrameButton", { enumerable: true, get: function () { return utils_1.DefaultEditFrameButton; } });
11
12
  Object.defineProperty(exports, "DefaultEditFrameButtons", { enumerable: true, get: function () { return utils_1.DefaultEditFrameButtons; } });
12
13
  var layout_1 = require("@sitecore-jss/sitecore-jss/layout");
14
+ Object.defineProperty(exports, "getContentStylesheetLink", { enumerable: true, get: function () { return layout_1.getContentStylesheetLink; } });
15
+ Object.defineProperty(exports, "getComponentLibraryStylesheetLinks", { enumerable: true, get: function () { return layout_1.getComponentLibraryStylesheetLinks; } });
13
16
  Object.defineProperty(exports, "LayoutServicePageState", { enumerable: true, get: function () { return layout_1.LayoutServicePageState; } });
14
17
  Object.defineProperty(exports, "GraphQLLayoutService", { enumerable: true, get: function () { return layout_1.GraphQLLayoutService; } });
15
18
  Object.defineProperty(exports, "RestLayoutService", { enumerable: true, get: function () { return layout_1.RestLayoutService; } });
@@ -20,6 +23,8 @@ Object.defineProperty(exports, "trackingApi", { enumerable: true, get: function
20
23
  var i18n_1 = require("@sitecore-jss/sitecore-jss/i18n");
21
24
  Object.defineProperty(exports, "GraphQLDictionaryService", { enumerable: true, get: function () { return i18n_1.GraphQLDictionaryService; } });
22
25
  Object.defineProperty(exports, "RestDictionaryService", { enumerable: true, get: function () { return i18n_1.RestDictionaryService; } });
26
+ var graphql_1 = require("@sitecore-jss/sitecore-jss/graphql");
27
+ Object.defineProperty(exports, "DefaultRetryStrategy", { enumerable: true, get: function () { return graphql_1.DefaultRetryStrategy; } });
23
28
  var media_1 = require("@sitecore-jss/sitecore-jss/media");
24
29
  Object.defineProperty(exports, "mediaApi", { enumerable: true, get: function () { return media_1.mediaApi; } });
25
30
  var feaas_1 = require("@sitecore-jss/sitecore-jss/feaas");
@@ -38,7 +38,7 @@ export class BYOCComponent extends React.Component {
38
38
  this.setState({ error });
39
39
  }
40
40
  render() {
41
- var _a, _b;
41
+ var _a, _b, _c;
42
42
  const props = this.props;
43
43
  if (this.state.error) {
44
44
  return this.props.errorComponent ? (React.createElement(this.props.errorComponent, { error: this.state.error })) : (React.createElement(DefaultErrorComponent, { error: this.state.error }));
@@ -58,24 +58,20 @@ 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
- const isNull = props.fetchedData && Object.keys(props.fetchedData).length === 0;
62
- let componentProps = isNull ? null : props.fetchedData;
63
- if (!componentProps) {
64
- if ((_a = props.params) === null || _a === void 0 ? void 0 : _a.ComponentProps) {
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 = {};
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
- else {
74
- componentProps = props.fields ? getDataFromFields(props.fields) : {};
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
+ // apply props from item datasource
72
+ const dataSourcesData = Object.assign(Object.assign({}, props.fetchedData), { _: getDataFromFields((_c = props.fields) !== null && _c !== void 0 ? _c : {}) });
77
73
  // 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)));
74
+ return (React.createElement(FEAAS.ExternalComponent, Object.assign({ componentName: componentName, clientFallback: fallbackComponent, datasources: dataSourcesData }, componentProps)));
79
75
  }
80
76
  }
81
77
  /**
@@ -84,8 +80,8 @@ export class BYOCComponent extends React.Component {
84
80
  */
85
81
  export function fetchBYOCComponentServerProps(params) {
86
82
  return __awaiter(this, void 0, void 0, function* () {
87
- const fetchDataOptions = params.ComponentProps
88
- ? JSON.parse(params.ComponentProps)
83
+ const fetchDataOptions = params.ComponentDataOverride
84
+ ? JSON.parse(params.ComponentDataOverride)
89
85
  : {};
90
86
  const fetchedData = yield FEAAS.DataSettings.fetch(fetchDataOptions || {});
91
87
  return {
@@ -28,27 +28,13 @@ export const FEaaSComponent = (props) => {
28
28
  // Missing FEaaS component required props
29
29
  return null;
30
30
  }
31
- let data = null;
32
- if (props.fetchedData === null || props.fetchedData === undefined) {
33
- if ((_b = props.params) === null || _b === void 0 ? void 0 : _b.ComponentDataOverride) {
34
- // Use override data if provided
35
- try {
36
- data = JSON.parse(props.params.ComponentDataOverride);
37
- }
38
- catch (e) {
39
- data = null;
40
- }
41
- }
42
- else if (props.fields) {
43
- // Otherwise use datasource data (provided in fields)
44
- data = getDataFromFields(props.fields);
45
- }
46
- }
31
+ // combine fetchedData from server with datasource data (if present)
32
+ const data = Object.assign(Object.assign({}, props.fetchedData), { _: getDataFromFields((_b = props.fields) !== null && _b !== void 0 ? _b : {}) });
47
33
  // FEaaS control would still be hydrated by client
48
34
  // we pass all the props as a workaround to avoid hydration error, until we convert all JSS components to server side
49
35
  // this also allows component to fall back to full client-side rendering when template or src is empty
50
36
  // FEAAS should not fetch anything, since JSS does the fetching - so we pass empty array into fetch param
51
- return (React.createElement(FEAAS.Component, { data: props.fetchedData || data, template: props.template, cdn: (_c = props.params) === null || _c === void 0 ? void 0 : _c.ComponentHostName, library: (_d = props.params) === null || _d === void 0 ? void 0 : _d.LibraryId, version: (_e = props.params) === null || _e === void 0 ? void 0 : _e.ComponentVersion, component: (_f = props.params) === null || _f === void 0 ? void 0 : _f.ComponentId, instance: (_g = props.params) === null || _g === void 0 ? void 0 : _g.ComponentInstanceId, revision: computedRevision, fetch: [] }));
37
+ return (React.createElement(FEAAS.Component, { data: data, template: props.template, cdn: (_c = props.params) === null || _c === void 0 ? void 0 : _c.ComponentHostName, library: (_d = props.params) === null || _d === void 0 ? void 0 : _d.LibraryId, version: (_e = props.params) === null || _e === void 0 ? void 0 : _e.ComponentVersion, component: (_f = props.params) === null || _f === void 0 ? void 0 : _f.ComponentId, instance: (_g = props.params) === null || _g === void 0 ? void 0 : _g.ComponentInstanceId, revision: computedRevision, fetch: [] }));
52
38
  };
53
39
  /**
54
40
  * Fetches server component props required for server rendering, based on rendering params.
@@ -62,7 +48,7 @@ export function fetchFEaaSComponentServerProps(params, pageState, endpointOverri
62
48
  const revisionFallback = pageState && pageState !== LayoutServicePageState.Normal ? 'staged' : 'published';
63
49
  const src = endpointOverride || composeComponentEndpoint(params, revisionFallback);
64
50
  let template = '';
65
- let fetchedData = null;
51
+ let fetchedData = {};
66
52
  const fetchDataOptions = params.ComponentDataOverride
67
53
  ? JSON.parse(params.ComponentDataOverride)
68
54
  : {};
@@ -18,14 +18,6 @@ import { FEaaSComponent, FEAAS_COMPONENT_RENDERING_NAME } from './FEaaSComponent
18
18
  import { FEaaSWrapper, FEAAS_WRAPPER_RENDERING_NAME } from './FEaaSWrapper';
19
19
  import { BYOCComponent, BYOC_COMPONENT_RENDERING_NAME } from './BYOCComponent';
20
20
  import { BYOCWrapper, BYOC_WRAPPER_RENDERING_NAME } from './BYOCWrapper';
21
- /**
22
- * These patterns need for right rendering Dynamic placeholders.
23
- * Must be distinguished Splitter components and another placeholders(containers)
24
- */
25
- const EXCLUDE_PLACEHOLDERS_RENDER = [
26
- new RegExp(/column-(\d{1})-\{\*\}/i),
27
- new RegExp(/row-(\d{1})-\{\*\}/i),
28
- ];
29
21
  export class PlaceholderCommon extends React.Component {
30
22
  constructor(props) {
31
23
  super(props);
@@ -41,9 +33,10 @@ export class PlaceholderCommon extends React.Component {
41
33
  from backend side we get common name of placeholder is called 'nameOfContainer-{*}' where '{*}' marker for replacing **/
42
34
  if (rendering === null || rendering === void 0 ? void 0 : rendering.placeholders) {
43
35
  Object.keys(rendering.placeholders).forEach((placeholder) => {
44
- if (placeholder.indexOf('{*}') !== -1 &&
45
- !EXCLUDE_PLACEHOLDERS_RENDER.some((pattern) => name.search(pattern) !== -1) &&
46
- name.replace(/[^a-zA-Z]*/gi, '') === placeholder.replace(/[^a-zA-Z]*/gi, '')) {
36
+ const patternPlaceholder = placeholder.indexOf('{*}') !== -1
37
+ ? new RegExp(`^${placeholder.replace(/\{\*\}+/i, '\\d+')}$`)
38
+ : null;
39
+ if (patternPlaceholder && patternPlaceholder.test(name)) {
47
40
  rendering.placeholders[name] = rendering.placeholders[placeholder];
48
41
  delete rendering.placeholders[placeholder];
49
42
  }
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import deepEqual from 'deep-equal';
4
+ import fastDeepEqual from 'fast-deep-equal/es6/react';
5
5
  export const SitecoreContextReactContext = React.createContext({});
6
6
  export const ComponentFactoryReactContext = React.createContext({});
7
7
  export class SitecoreContext extends React.Component {
@@ -37,7 +37,7 @@ export class SitecoreContext extends React.Component {
37
37
  componentDidUpdate(prevProps) {
38
38
  // In case if somebody will manage SitecoreContext state by passing fresh `layoutData` prop
39
39
  // instead of using `updateSitecoreContext`
40
- if (!deepEqual(prevProps.layoutData, this.props.layoutData)) {
40
+ if (!fastDeepEqual(prevProps.layoutData, this.props.layoutData)) {
41
41
  this.setContext(this.props.layoutData);
42
42
  return;
43
43
  }
package/dist/esm/index.js CHANGED
@@ -1,8 +1,9 @@
1
- export { constants, enableDebug } from '@sitecore-jss/sitecore-jss';
1
+ export { constants, enableDebug, ClientError } from '@sitecore-jss/sitecore-jss';
2
2
  export { isEditorActive, resetEditorChromes, DefaultEditFrameButton, DefaultEditFrameButtons, } from '@sitecore-jss/sitecore-jss/utils';
3
- export { LayoutServicePageState, GraphQLLayoutService, RestLayoutService, getChildPlaceholder, getFieldValue, } from '@sitecore-jss/sitecore-jss/layout';
3
+ export { getContentStylesheetLink, getComponentLibraryStylesheetLinks, LayoutServicePageState, GraphQLLayoutService, RestLayoutService, getChildPlaceholder, getFieldValue, } from '@sitecore-jss/sitecore-jss/layout';
4
4
  export { trackingApi, } from '@sitecore-jss/sitecore-jss/tracking';
5
5
  export { GraphQLDictionaryService, RestDictionaryService, } from '@sitecore-jss/sitecore-jss/i18n';
6
+ export { DefaultRetryStrategy, } from '@sitecore-jss/sitecore-jss/graphql';
6
7
  export { mediaApi } from '@sitecore-jss/sitecore-jss/media';
7
8
  export { getFEAASLibraryStylesheetLinks } from '@sitecore-jss/sitecore-jss/feaas';
8
9
  export { Placeholder } from './components/Placeholder';
package/package.json CHANGED
@@ -1,21 +1,20 @@
1
1
  {
2
2
  "name": "@sitecore-jss/sitecore-jss-react",
3
- "version": "21.7.0-canary.9",
3
+ "version": "21.7.0",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "sideEffects": false,
7
7
  "scripts": {
8
8
  "build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
9
9
  "clean": "del-cli dist types",
10
- "lint": "eslint ./src/**/*.tsx ./src/**/*.ts",
10
+ "lint": "eslint \"./src/**/*.tsx\" \"./src/**/*.ts\"",
11
11
  "test": "mocha --require ts-node/register/transpile-only --require ./src/tests/shim.ts ./src/tests/jsdom-setup.ts ./src/tests/enzyme-setup.ts \"./src/**/*.test.ts\" \"./src/**/*.test.tsx\" --exit",
12
12
  "prepublishOnly": "npm run build",
13
13
  "coverage": "nyc npm test",
14
14
  "generate-docs": "npx typedoc --plugin typedoc-plugin-markdown --readme none --out ../../ref-docs/sitecore-jss-react src/index.ts --githubPages false"
15
15
  },
16
16
  "engines": {
17
- "node": ">=12",
18
- "npm": ">=6"
17
+ "node": ">=18"
19
18
  },
20
19
  "author": {
21
20
  "name": "Sitecore Corporation",
@@ -27,10 +26,9 @@
27
26
  "url": "https://github.com/sitecore/jss/issues"
28
27
  },
29
28
  "devDependencies": {
30
- "@sitecore-feaas/clientside": "^0.4.12",
29
+ "@sitecore-feaas/clientside": "^0.5.17",
31
30
  "@types/chai": "^4.3.4",
32
31
  "@types/chai-string": "^1.4.2",
33
- "@types/deep-equal": "^1.0.1",
34
32
  "@types/enzyme": "^3.10.12",
35
33
  "@types/mocha": "^10.0.1",
36
34
  "@types/node": "18.11.10",
@@ -58,19 +56,19 @@
58
56
  "typescript": "~4.9.3"
59
57
  },
60
58
  "peerDependencies": {
61
- "@sitecore-feaas/clientside": "^0.4.12",
59
+ "@sitecore-feaas/clientside": "^0.5.17",
62
60
  "react": "^18.2.0",
63
61
  "react-dom": "^18.2.0"
64
62
  },
65
63
  "dependencies": {
66
- "@sitecore-jss/sitecore-jss": "^21.7.0-canary.9",
67
- "deep-equal": "^2.1.0",
64
+ "@sitecore-jss/sitecore-jss": "21.7.0",
65
+ "fast-deep-equal": "^3.1.3",
68
66
  "prop-types": "^15.8.1",
69
67
  "style-attr": "^1.3.0"
70
68
  },
71
69
  "description": "",
72
70
  "types": "types/index.d.ts",
73
- "gitHead": "9c5abacb6b00f64cdef3dfc022b50685c3205345",
71
+ "gitHead": "cab407f388b2015ea1d4b47bc53eb7b4da39c614",
74
72
  "files": [
75
73
  "dist",
76
74
  "types"
@@ -25,6 +25,10 @@ export type BYOCComponentParams = {
25
25
  * JSON props to pass into rendered component
26
26
  */
27
27
  ComponentProps?: string;
28
+ /**
29
+ * A JSON object with data sources to be fetched and passed to the component
30
+ */
31
+ ComponentDataOverride?: string;
28
32
  /**
29
33
  * A string with classes that can be used to apply themes, via SXA functionality
30
34
  */
package/types/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- export { constants, enableDebug } from '@sitecore-jss/sitecore-jss';
1
+ export { constants, enableDebug, ClientError } from '@sitecore-jss/sitecore-jss';
2
2
  export { isEditorActive, resetEditorChromes, DefaultEditFrameButton, DefaultEditFrameButtons, EditFrameDataSource, FieldEditButton, WebEditButton, EditButtonTypes, } from '@sitecore-jss/sitecore-jss/utils';
3
- export { LayoutService, LayoutServiceData, LayoutServicePageState, LayoutServiceContext, LayoutServiceContextData, GraphQLLayoutService, RestLayoutService, RouteData, Field, Item, HtmlElementRendering, getChildPlaceholder, getFieldValue, ComponentRendering, ComponentFields, ComponentParams, } from '@sitecore-jss/sitecore-jss/layout';
3
+ export { getContentStylesheetLink, getComponentLibraryStylesheetLinks, LayoutService, LayoutServiceData, LayoutServicePageState, LayoutServiceContext, LayoutServiceContextData, GraphQLLayoutService, RestLayoutService, RouteData, Field, Item, HtmlElementRendering, getChildPlaceholder, getFieldValue, ComponentRendering, ComponentFields, ComponentParams, } from '@sitecore-jss/sitecore-jss/layout';
4
4
  export { trackingApi, TrackingRequestOptions, CampaignInstance, GoalInstance, OutcomeInstance, EventInstance, PageViewInstance, } from '@sitecore-jss/sitecore-jss/tracking';
5
5
  export { DictionaryPhrases, DictionaryService, GraphQLDictionaryService, RestDictionaryService, } from '@sitecore-jss/sitecore-jss/i18n';
6
+ export { GraphQLClientError, RetryStrategy, DefaultRetryStrategy, } from '@sitecore-jss/sitecore-jss/graphql';
6
7
  export { mediaApi } from '@sitecore-jss/sitecore-jss/media';
7
8
  export { getFEAASLibraryStylesheetLinks } from '@sitecore-jss/sitecore-jss/feaas';
8
9
  export { ComponentFactory } from './components/sharedTypes';