@sitecore-jss/sitecore-jss-react 21.5.0-canary.9 → 21.6.0-beta.1
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/dist/cjs/components/BYOCComponent.js +2 -1
- package/dist/cjs/components/FEaaSComponent.js +2 -1
- package/dist/cjs/components/PlaceholderCommon.js +2 -1
- package/dist/esm/components/BYOCComponent.js +2 -1
- package/dist/esm/components/FEaaSComponent.js +2 -1
- package/dist/esm/components/PlaceholderCommon.js +2 -1
- package/package.json +5 -5
- package/types/ComponentBuilder.d.ts +1 -0
- package/types/components/BYOCComponent.d.ts +1 -0
- package/types/components/Date.d.ts +1 -0
- package/types/components/EditFrame.d.ts +1 -0
- package/types/components/File.d.ts +1 -0
- package/types/components/HiddenRendering.d.ts +1 -0
- package/types/components/Image.d.ts +1 -0
- package/types/components/Link.d.ts +1 -0
- package/types/components/MissingComponent.d.ts +1 -0
- package/types/components/Placeholder.d.ts +1 -0
- package/types/components/PlaceholderCommon.d.ts +1 -0
- package/types/components/RichText.d.ts +1 -0
- package/types/components/SitecoreContext.d.ts +1 -0
- package/types/components/Text.d.ts +1 -0
- package/types/components/VisitorIdentification.d.ts +1 -0
- package/types/components/sharedTypes.d.ts +1 -0
- package/types/enhancers/withComponentFactory.d.ts +1 -0
- package/types/enhancers/withDatasourceCheck.d.ts +1 -0
- package/types/enhancers/withEditorChromes.d.ts +1 -0
- package/types/enhancers/withSitecoreContext.d.ts +1 -0
|
@@ -103,7 +103,8 @@ class BYOCComponent extends react_1.default.Component {
|
|
|
103
103
|
componentProps = props.fields ? (0, utils_1.getDataFromFields)(props.fields) : {};
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
// 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)));
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
exports.BYOCComponent = BYOCComponent;
|
|
@@ -76,7 +76,8 @@ const FEaaSComponent = (props) => {
|
|
|
76
76
|
// FEaaS control would still be hydrated by client
|
|
77
77
|
// we pass all the props as a workaround to avoid hydration error, until we convert all JSS components to server side
|
|
78
78
|
// this also allows component to fall back to full client-side rendering when template or src is empty
|
|
79
|
-
|
|
79
|
+
// 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: [] }));
|
|
80
81
|
};
|
|
81
82
|
exports.FEaaSComponent = FEaaSComponent;
|
|
82
83
|
/**
|
|
@@ -48,7 +48,8 @@ class PlaceholderCommon extends react_1.default.Component {
|
|
|
48
48
|
if (rendering === null || rendering === void 0 ? void 0 : rendering.placeholders) {
|
|
49
49
|
Object.keys(rendering.placeholders).forEach((placeholder) => {
|
|
50
50
|
if (placeholder.indexOf('{*}') !== -1 &&
|
|
51
|
-
!EXCLUDE_PLACEHOLDERS_RENDER.some((pattern) => name.search(pattern) !== -1)
|
|
51
|
+
!EXCLUDE_PLACEHOLDERS_RENDER.some((pattern) => name.search(pattern) !== -1) &&
|
|
52
|
+
name.replace(/[^a-zA-Z]*/gi, '') === placeholder.replace(/[^a-zA-Z]*/gi, '')) {
|
|
52
53
|
rendering.placeholders[name] = rendering.placeholders[placeholder];
|
|
53
54
|
delete rendering.placeholders[placeholder];
|
|
54
55
|
}
|
|
@@ -74,7 +74,8 @@ export class BYOCComponent extends React.Component {
|
|
|
74
74
|
componentProps = props.fields ? getDataFromFields(props.fields) : {};
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
// 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)));
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
/**
|
|
@@ -47,7 +47,8 @@ export const FEaaSComponent = (props) => {
|
|
|
47
47
|
// FEaaS control would still be hydrated by client
|
|
48
48
|
// we pass all the props as a workaround to avoid hydration error, until we convert all JSS components to server side
|
|
49
49
|
// this also allows component to fall back to full client-side rendering when template or src is empty
|
|
50
|
-
|
|
50
|
+
// 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: [] }));
|
|
51
52
|
};
|
|
52
53
|
/**
|
|
53
54
|
* Fetches server component props required for server rendering, based on rendering params.
|
|
@@ -42,7 +42,8 @@ export class PlaceholderCommon extends React.Component {
|
|
|
42
42
|
if (rendering === null || rendering === void 0 ? void 0 : rendering.placeholders) {
|
|
43
43
|
Object.keys(rendering.placeholders).forEach((placeholder) => {
|
|
44
44
|
if (placeholder.indexOf('{*}') !== -1 &&
|
|
45
|
-
!EXCLUDE_PLACEHOLDERS_RENDER.some((pattern) => name.search(pattern) !== -1)
|
|
45
|
+
!EXCLUDE_PLACEHOLDERS_RENDER.some((pattern) => name.search(pattern) !== -1) &&
|
|
46
|
+
name.replace(/[^a-zA-Z]*/gi, '') === placeholder.replace(/[^a-zA-Z]*/gi, '')) {
|
|
46
47
|
rendering.placeholders[name] = rendering.placeholders[placeholder];
|
|
47
48
|
delete rendering.placeholders[placeholder];
|
|
48
49
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-jss/sitecore-jss-react",
|
|
3
|
-
"version": "21.
|
|
3
|
+
"version": "21.6.0-beta.1",
|
|
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.4.12",
|
|
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.4.12",
|
|
62
62
|
"react": "^18.2.0",
|
|
63
63
|
"react-dom": "^18.2.0"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@sitecore-jss/sitecore-jss": "^21.
|
|
66
|
+
"@sitecore-jss/sitecore-jss": "^21.6.0-beta.1",
|
|
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": "b14b3dc875d5e822d97232843b5fd2b760fe2c8d",
|
|
74
74
|
"files": [
|
|
75
75
|
"dist",
|
|
76
76
|
"types"
|