@sitecore-content-sdk/react 1.2.0-canary.44 → 1.2.0-canary.45
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/FEaaS/BYOCServerWrapper.js +28 -0
- package/dist/cjs/components/{BYOCComponent.js → FEaaS/BYOCWrapper.js} +17 -28
- package/dist/cjs/components/FEaaS/FEaaSSeverWrapper.js +34 -0
- package/dist/cjs/components/FEaaS/FEaaSWrapper.js +78 -0
- package/dist/cjs/components/{FEaaSComponent.js → FEaaS/feaas-utils.js} +18 -35
- package/dist/cjs/components/FEaaS/index.js +21 -0
- package/dist/cjs/components/FEaaS/models.js +7 -0
- package/dist/cjs/components/Placeholder/models.js +0 -1
- package/dist/cjs/components/Placeholder/placeholder-utils.js +12 -13
- package/dist/cjs/index.js +14 -11
- package/dist/esm/components/FEaaS/BYOCServerWrapper.js +21 -0
- package/dist/esm/components/{BYOCComponent.js → FEaaS/BYOCWrapper.js} +15 -26
- package/dist/esm/components/FEaaS/FEaaSSeverWrapper.js +27 -0
- package/dist/esm/components/FEaaS/FEaaSWrapper.js +37 -0
- package/dist/esm/components/{FEaaSComponent.js → FEaaS/feaas-utils.js} +16 -30
- package/dist/esm/components/FEaaS/index.js +6 -0
- package/dist/esm/components/FEaaS/models.js +4 -0
- package/dist/esm/components/Placeholder/models.js +0 -1
- package/dist/esm/components/Placeholder/placeholder-utils.js +4 -5
- package/dist/esm/index.js +3 -4
- package/package.json +3 -3
- package/types/components/FEaaS/BYOCServerWrapper.d.ts +3 -0
- package/types/components/FEaaS/BYOCWrapper.d.ts +25 -0
- package/types/components/FEaaS/FEaaSSeverWrapper.d.ts +8 -0
- package/types/components/FEaaS/FEaaSWrapper.d.ts +7 -0
- package/types/components/FEaaS/feaas-utils.d.ts +21 -0
- package/types/components/FEaaS/index.d.ts +6 -0
- package/types/components/FEaaS/models.d.ts +125 -0
- package/types/components/Placeholder/models.d.ts +1 -1
- package/types/components/Placeholder/placeholder-utils.d.ts +3 -3
- package/types/index.d.ts +2 -4
- package/dist/cjs/components/BYOCWrapper.js +0 -22
- package/dist/cjs/components/FEaaSWrapper.js +0 -19
- package/dist/esm/components/BYOCWrapper.js +0 -15
- package/dist/esm/components/FEaaSWrapper.js +0 -12
- package/types/components/BYOCComponent.d.ts +0 -93
- package/types/components/BYOCWrapper.d.ts +0 -7
- package/types/components/FEaaSComponent.d.ts +0 -72
- package/types/components/FEaaSWrapper.d.ts +0 -4
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.BYOCServerWrapper = void 0;
|
|
16
|
+
const react_1 = __importDefault(require("react"));
|
|
17
|
+
const feaas_utils_1 = require("./feaas-utils");
|
|
18
|
+
const BYOCWrapper_1 = require("./BYOCWrapper");
|
|
19
|
+
const models_1 = require("../Placeholder/models");
|
|
20
|
+
const BYOCServerWrapper = (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
+
var _a;
|
|
22
|
+
const params = ((_a = props.rendering) === null || _a === void 0 ? void 0 : _a.params) || {};
|
|
23
|
+
// only pass serializable props to the client BYOC component
|
|
24
|
+
const serializableProps = Object.fromEntries(Object.entries(props).filter(([key]) => !models_1.nonSerializedPlaceholderProps.includes(key)));
|
|
25
|
+
const finalProps = Object.assign(Object.assign({}, (yield (0, feaas_utils_1.fetchBYOCComponentServerProps)(params))), serializableProps);
|
|
26
|
+
return react_1.default.createElement(BYOCWrapper_1.BYOCWrapper, Object.assign({}, finalProps));
|
|
27
|
+
});
|
|
28
|
+
exports.BYOCServerWrapper = BYOCServerWrapper;
|
|
@@ -33,26 +33,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
return result;
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
36
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
38
|
};
|
|
48
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
-
exports.
|
|
50
|
-
exports.fetchBYOCComponentServerProps = fetchBYOCComponentServerProps;
|
|
40
|
+
exports.BYOCWrapper = exports.BYOCComponent = void 0;
|
|
51
41
|
const react_1 = __importDefault(require("react"));
|
|
52
|
-
const utils_1 = require("../utils");
|
|
53
|
-
const MissingComponent_1 = require("./MissingComponent");
|
|
54
42
|
const FEAAS = __importStar(require("@sitecore-feaas/clientside/react"));
|
|
55
|
-
|
|
43
|
+
const utils_1 = require("../../utils");
|
|
44
|
+
const MissingComponent_1 = require("../MissingComponent");
|
|
56
45
|
const DefaultErrorComponent = (props) => {
|
|
57
46
|
var _a;
|
|
58
47
|
return (react_1.default.createElement("div", null,
|
|
@@ -60,11 +49,12 @@ const DefaultErrorComponent = (props) => {
|
|
|
60
49
|
_a.message,
|
|
61
50
|
"."));
|
|
62
51
|
};
|
|
52
|
+
// BYOCComponent remains for backward compatibility and testing purposes
|
|
63
53
|
/**
|
|
64
54
|
* BYOCComponent facilitate the rendering of external components. It manages potential errors,
|
|
65
55
|
* missing components, and customization of error messages or alternative rendering components.
|
|
66
56
|
* @param {ByocComponentProps} props component props
|
|
67
|
-
* @returns
|
|
57
|
+
* @returns dynamically rendered component or Missing Component error frame
|
|
68
58
|
*/
|
|
69
59
|
class BYOCComponent extends react_1.default.Component {
|
|
70
60
|
constructor(props) {
|
|
@@ -117,17 +107,16 @@ class BYOCComponent extends react_1.default.Component {
|
|
|
117
107
|
}
|
|
118
108
|
exports.BYOCComponent = BYOCComponent;
|
|
119
109
|
/**
|
|
120
|
-
*
|
|
121
|
-
* @param {
|
|
110
|
+
* SXA wrapper for BYOC components
|
|
111
|
+
* @param {BYOCComponentProps} props component props
|
|
112
|
+
* @returns wrapped BYOC component
|
|
122
113
|
*/
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
});
|
|
133
|
-
}
|
|
114
|
+
const BYOCWrapper = (props) => {
|
|
115
|
+
var _a, _b, _c;
|
|
116
|
+
const styles = (_b = (_a = props.params) === null || _a === void 0 ? void 0 : _a.styles) === null || _b === void 0 ? void 0 : _b.trimEnd();
|
|
117
|
+
const id = (_c = props.params) === null || _c === void 0 ? void 0 : _c.RenderingIdentifier;
|
|
118
|
+
return (react_1.default.createElement("div", { className: styles ? styles : undefined, id: id ? id : undefined },
|
|
119
|
+
react_1.default.createElement("div", { className: "component-content" },
|
|
120
|
+
react_1.default.createElement(BYOCComponent, Object.assign({}, props)))));
|
|
121
|
+
};
|
|
122
|
+
exports.BYOCWrapper = BYOCWrapper;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.FEaaSServerWrapper = void 0;
|
|
16
|
+
const react_1 = __importDefault(require("react"));
|
|
17
|
+
const feaas_utils_1 = require("./feaas-utils");
|
|
18
|
+
const FEaaSWrapper_1 = require("./FEaaSWrapper");
|
|
19
|
+
const models_1 = require("../Placeholder/models");
|
|
20
|
+
/**
|
|
21
|
+
* Server component for FEaaS. Retrieves server props and renders client FEaaSWrapper.
|
|
22
|
+
* @param {FEaaSComponentProps} props incoming props
|
|
23
|
+
* @returns {Promise<JSX.Element>} rendered FEaaSWrapper component
|
|
24
|
+
*/
|
|
25
|
+
const FEaaSServerWrapper = (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
const params = ((_a = props.rendering) === null || _a === void 0 ? void 0 : _a.params) || {};
|
|
28
|
+
const isPageStateNormal = (_b = props.page) === null || _b === void 0 ? void 0 : _b.mode.isNormal;
|
|
29
|
+
// only pass serializable props to the client FEaaS component
|
|
30
|
+
const serializableProps = Object.fromEntries(Object.entries(props).filter(([key]) => !models_1.nonSerializedPlaceholderProps.includes(key)));
|
|
31
|
+
const finalProps = Object.assign(Object.assign({}, (yield (0, feaas_utils_1.fetchFEaaSComponentServerProps)(params, isPageStateNormal))), serializableProps);
|
|
32
|
+
return react_1.default.createElement(FEaaSWrapper_1.FEaaSWrapper, Object.assign({}, finalProps));
|
|
33
|
+
});
|
|
34
|
+
exports.FEaaSServerWrapper = FEaaSServerWrapper;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.FEaaSWrapper = exports.FEaaSComponent = void 0;
|
|
41
|
+
const react_1 = __importDefault(require("react"));
|
|
42
|
+
const FEAAS = __importStar(require("@sitecore-feaas/clientside/react"));
|
|
43
|
+
const utils_1 = require("../../utils");
|
|
44
|
+
// FEaaSComponent remains for backward compatibility and testing purposes
|
|
45
|
+
/**
|
|
46
|
+
* @param {FEaaSComponentProps} props component props
|
|
47
|
+
*/
|
|
48
|
+
const FEaaSComponent = (props) => {
|
|
49
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
50
|
+
const computedRevision = ((_a = props.params) === null || _a === void 0 ? void 0 : _a.ComponentRevision) || props.revisionFallback;
|
|
51
|
+
if (!props.template &&
|
|
52
|
+
(!props.params ||
|
|
53
|
+
!props.params.LibraryId ||
|
|
54
|
+
!props.params.ComponentId ||
|
|
55
|
+
!props.params.ComponentVersion ||
|
|
56
|
+
!props.params.ComponentHostName ||
|
|
57
|
+
!computedRevision)) {
|
|
58
|
+
// Missing FEaaS component required props
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
// combine fetchedData from server with datasource data (if present)
|
|
62
|
+
const data = Object.assign(Object.assign({}, props.fetchedData), { _: (0, utils_1.getDataFromFields)((_b = props.fields) !== null && _b !== void 0 ? _b : {}) });
|
|
63
|
+
// FEaaS control would still be hydrated by client
|
|
64
|
+
// we pass all the props as a workaround to avoid hydration error, until we convert all Content SDK components to server side
|
|
65
|
+
// this also allows component to fall back to full client-side rendering when template or src is empty
|
|
66
|
+
// FEAAS should not fetch anything, since Content SDK does the fetching - so we pass empty array into fetch param
|
|
67
|
+
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: [] }));
|
|
68
|
+
};
|
|
69
|
+
exports.FEaaSComponent = FEaaSComponent;
|
|
70
|
+
const FEaaSWrapper = (props) => {
|
|
71
|
+
var _a, _b;
|
|
72
|
+
const styles = `component feaas ${(_a = props.params) === null || _a === void 0 ? void 0 : _a.styles}`.trimEnd();
|
|
73
|
+
const id = (_b = props.params) === null || _b === void 0 ? void 0 : _b.RenderingIdentifier;
|
|
74
|
+
return (react_1.default.createElement("div", { className: styles, id: id ? id : undefined },
|
|
75
|
+
react_1.default.createElement("div", { className: "component-content" },
|
|
76
|
+
react_1.default.createElement(exports.FEaaSComponent, Object.assign({}, props)))));
|
|
77
|
+
};
|
|
78
|
+
exports.FEaaSWrapper = FEaaSWrapper;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
'use client';
|
|
3
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
3
|
if (k2 === undefined) k2 = k;
|
|
5
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -42,52 +41,36 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
42
41
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
42
|
});
|
|
44
43
|
};
|
|
45
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
|
-
};
|
|
48
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
-
exports.composeComponentEndpoint =
|
|
45
|
+
exports.composeComponentEndpoint = void 0;
|
|
46
|
+
exports.fetchBYOCComponentServerProps = fetchBYOCComponentServerProps;
|
|
50
47
|
exports.fetchFEaaSComponentServerProps = fetchFEaaSComponentServerProps;
|
|
51
|
-
const react_1 = __importDefault(require("react"));
|
|
52
48
|
const FEAAS = __importStar(require("@sitecore-feaas/clientside/react"));
|
|
53
|
-
const layout_1 = require("@sitecore-content-sdk/core/layout");
|
|
54
|
-
const utils_1 = require("../utils");
|
|
55
|
-
exports.FEAAS_COMPONENT_RENDERING_NAME = 'FEaaSComponent';
|
|
56
49
|
/**
|
|
57
|
-
*
|
|
50
|
+
* Fetches server component props required for server rendering, based on rendering params.
|
|
51
|
+
* @param {BYOCComponentParams} params component params
|
|
58
52
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
// combine fetchedData from server with datasource data (if present)
|
|
73
|
-
const data = Object.assign(Object.assign({}, props.fetchedData), { _: (0, utils_1.getDataFromFields)((_b = props.fields) !== null && _b !== void 0 ? _b : {}) });
|
|
74
|
-
// FEaaS control would still be hydrated by client
|
|
75
|
-
// we pass all the props as a workaround to avoid hydration error, until we convert all Content SDK components to server side
|
|
76
|
-
// this also allows component to fall back to full client-side rendering when template or src is empty
|
|
77
|
-
// FEAAS should not fetch anything, since Content SDK does the fetching - so we pass empty array into fetch param
|
|
78
|
-
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: [] }));
|
|
79
|
-
};
|
|
80
|
-
exports.FEaaSComponent = FEaaSComponent;
|
|
53
|
+
function fetchBYOCComponentServerProps(params) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const fetchDataOptions = params.ComponentDataOverride
|
|
56
|
+
? JSON.parse(params.ComponentDataOverride)
|
|
57
|
+
: {};
|
|
58
|
+
const fetchedData = yield FEAAS.DataSettings.fetch(fetchDataOptions || {});
|
|
59
|
+
return {
|
|
60
|
+
fetchedData,
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
}
|
|
81
64
|
/**
|
|
82
65
|
* Fetches server component props required for server rendering, based on rendering params.
|
|
83
66
|
* Component endpoint will either be retrieved from params or from endpointOverride
|
|
84
67
|
* @param {FEaaSComponentParams} params component params
|
|
85
|
-
* @param {
|
|
68
|
+
* @param {boolean} [isPageStateNormal] whether page is in normal mode
|
|
86
69
|
* @param {string} [endpointOverride] optional override for component endpoint
|
|
87
70
|
*/
|
|
88
|
-
function fetchFEaaSComponentServerProps(params,
|
|
71
|
+
function fetchFEaaSComponentServerProps(params, isPageStateNormal, endpointOverride) {
|
|
89
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
const revisionFallback =
|
|
73
|
+
const revisionFallback = isPageStateNormal ? 'published' : 'staged';
|
|
91
74
|
const src = endpointOverride || (0, exports.composeComponentEndpoint)(params, revisionFallback);
|
|
92
75
|
let template = '';
|
|
93
76
|
let fetchedData = {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchBYOCComponentServerProps = exports.fetchFEaaSComponentServerProps = exports.BYOCServerWrapper = exports.FEaaSServerWrapper = exports.BYOC_WRAPPER_RENDERING_NAME = exports.FEAAS_WRAPPER_RENDERING_NAME = exports.BYOC_COMPONENT_RENDERING_NAME = exports.FEAAS_COMPONENT_RENDERING_NAME = exports.BYOCComponent = exports.BYOCWrapper = exports.FEaaSComponent = exports.FEaaSWrapper = void 0;
|
|
4
|
+
var FEaaSWrapper_1 = require("./FEaaSWrapper");
|
|
5
|
+
Object.defineProperty(exports, "FEaaSWrapper", { enumerable: true, get: function () { return FEaaSWrapper_1.FEaaSWrapper; } });
|
|
6
|
+
Object.defineProperty(exports, "FEaaSComponent", { enumerable: true, get: function () { return FEaaSWrapper_1.FEaaSComponent; } });
|
|
7
|
+
var BYOCWrapper_1 = require("./BYOCWrapper");
|
|
8
|
+
Object.defineProperty(exports, "BYOCWrapper", { enumerable: true, get: function () { return BYOCWrapper_1.BYOCWrapper; } });
|
|
9
|
+
Object.defineProperty(exports, "BYOCComponent", { enumerable: true, get: function () { return BYOCWrapper_1.BYOCComponent; } });
|
|
10
|
+
var models_1 = require("./models");
|
|
11
|
+
Object.defineProperty(exports, "FEAAS_COMPONENT_RENDERING_NAME", { enumerable: true, get: function () { return models_1.FEAAS_COMPONENT_RENDERING_NAME; } });
|
|
12
|
+
Object.defineProperty(exports, "BYOC_COMPONENT_RENDERING_NAME", { enumerable: true, get: function () { return models_1.BYOC_COMPONENT_RENDERING_NAME; } });
|
|
13
|
+
Object.defineProperty(exports, "FEAAS_WRAPPER_RENDERING_NAME", { enumerable: true, get: function () { return models_1.FEAAS_WRAPPER_RENDERING_NAME; } });
|
|
14
|
+
Object.defineProperty(exports, "BYOC_WRAPPER_RENDERING_NAME", { enumerable: true, get: function () { return models_1.BYOC_WRAPPER_RENDERING_NAME; } });
|
|
15
|
+
var FEaaSSeverWrapper_1 = require("./FEaaSSeverWrapper");
|
|
16
|
+
Object.defineProperty(exports, "FEaaSServerWrapper", { enumerable: true, get: function () { return FEaaSSeverWrapper_1.FEaaSServerWrapper; } });
|
|
17
|
+
var BYOCServerWrapper_1 = require("./BYOCServerWrapper");
|
|
18
|
+
Object.defineProperty(exports, "BYOCServerWrapper", { enumerable: true, get: function () { return BYOCServerWrapper_1.BYOCServerWrapper; } });
|
|
19
|
+
var feaas_utils_1 = require("./feaas-utils");
|
|
20
|
+
Object.defineProperty(exports, "fetchFEaaSComponentServerProps", { enumerable: true, get: function () { return feaas_utils_1.fetchFEaaSComponentServerProps; } });
|
|
21
|
+
Object.defineProperty(exports, "fetchBYOCComponentServerProps", { enumerable: true, get: function () { return feaas_utils_1.fetchBYOCComponentServerProps; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BYOC_COMPONENT_RENDERING_NAME = exports.BYOC_WRAPPER_RENDERING_NAME = exports.FEAAS_COMPONENT_RENDERING_NAME = exports.FEAAS_WRAPPER_RENDERING_NAME = void 0;
|
|
4
|
+
exports.FEAAS_WRAPPER_RENDERING_NAME = 'FEaaSWrapper';
|
|
5
|
+
exports.FEAAS_COMPONENT_RENDERING_NAME = 'FEaaSComponent';
|
|
6
|
+
exports.BYOC_WRAPPER_RENDERING_NAME = 'BYOCWrapper';
|
|
7
|
+
exports.BYOC_COMPONENT_RENDERING_NAME = 'BYOCComponent';
|
|
@@ -21,10 +21,7 @@ const sharedTypes_1 = require("../sharedTypes");
|
|
|
21
21
|
const layout_1 = require("@sitecore-content-sdk/core/layout");
|
|
22
22
|
const core_1 = require("@sitecore-content-sdk/core");
|
|
23
23
|
const HiddenRendering_1 = require("../HiddenRendering");
|
|
24
|
-
const
|
|
25
|
-
const FEaaSWrapper_1 = require("../FEaaSWrapper");
|
|
26
|
-
const BYOCComponent_1 = require("../BYOCComponent");
|
|
27
|
-
const BYOCWrapper_1 = require("../BYOCWrapper");
|
|
24
|
+
const FEaaS_1 = require("../FEaaS");
|
|
28
25
|
/**
|
|
29
26
|
* Get the renderings for the specified placeholder from the rendering data.
|
|
30
27
|
* @param {ComponentRendering | RouteData } rendering rendering data
|
|
@@ -142,26 +139,26 @@ const getComponentForRendering = (renderingDefinition, placeholderName, componen
|
|
|
142
139
|
}
|
|
143
140
|
if (!component) {
|
|
144
141
|
// Fallback/defaults for Sitecore Component renderings (in case not defined in component map)
|
|
145
|
-
if (renderingDefinition.componentName ===
|
|
142
|
+
if (renderingDefinition.componentName === FEaaS_1.FEAAS_COMPONENT_RENDERING_NAME) {
|
|
146
143
|
return {
|
|
147
|
-
component:
|
|
144
|
+
component: FEaaS_1.FEaaSComponent,
|
|
148
145
|
};
|
|
149
146
|
}
|
|
150
|
-
else if (renderingDefinition.componentName ===
|
|
147
|
+
else if (renderingDefinition.componentName === FEaaS_1.FEAAS_WRAPPER_RENDERING_NAME) {
|
|
151
148
|
return {
|
|
152
|
-
component:
|
|
149
|
+
component: FEaaS_1.FEaaSWrapper,
|
|
153
150
|
};
|
|
154
151
|
}
|
|
155
|
-
else if (renderingDefinition.componentName ===
|
|
152
|
+
else if (renderingDefinition.componentName === FEaaS_1.BYOC_COMPONENT_RENDERING_NAME) {
|
|
156
153
|
return {
|
|
157
|
-
component:
|
|
154
|
+
component: FEaaS_1.BYOCComponent,
|
|
158
155
|
};
|
|
159
156
|
}
|
|
160
|
-
else if (renderingDefinition.componentName ===
|
|
157
|
+
else if (renderingDefinition.componentName === FEaaS_1.BYOC_WRAPPER_RENDERING_NAME) {
|
|
161
158
|
// wrapping with error boundary could cause problems in case where parent component uses withPlaceholder HOC and tries to access its children props
|
|
162
159
|
// that's why we need to mark BYOC wrapper dynamic
|
|
163
160
|
return {
|
|
164
|
-
component:
|
|
161
|
+
component: FEaaS_1.BYOCWrapper,
|
|
165
162
|
dynamic: true,
|
|
166
163
|
};
|
|
167
164
|
}
|
|
@@ -177,10 +174,12 @@ const getComponentForRendering = (renderingDefinition, placeholderName, componen
|
|
|
177
174
|
: component.default ||
|
|
178
175
|
component.Default ||
|
|
179
176
|
component;
|
|
177
|
+
const dynamic = !!((_b = renderedComponent.render) === null || _b === void 0 ? void 0 : _b.preload) ||
|
|
178
|
+
renderingDefinition.componentName === FEaaS_1.BYOC_WRAPPER_RENDERING_NAME;
|
|
180
179
|
// all dynamic elements will have a separate render prop
|
|
181
180
|
return {
|
|
182
181
|
component: renderedComponent,
|
|
183
|
-
dynamic
|
|
182
|
+
dynamic,
|
|
184
183
|
componentType: component.componentType,
|
|
185
184
|
};
|
|
186
185
|
};
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DefaultEmptyFieldEditingComponentText = exports.EditingScripts = exports.withEmptyFieldEditingComponent = exports.withFieldMetadata = exports.withDatasourceCheck = exports.withPlaceholder = exports.withEditorChromes = exports.useSitecore = exports.withSitecore = exports.SitecoreProviderReactContext = exports.SitecoreProvider = exports.File = exports.Link = exports.DesignLibrary = exports.BYOCServerWrapper = exports.FEaaSServerWrapper = exports.FEaaSClientWrapper = exports.FEaaSWrapper = exports.BYOCClientWrapper = exports.BYOCWrapper = exports.fetchBYOCComponentServerProps = exports.BYOCComponent = exports.fetchFEaaSComponentServerProps = exports.FEaaSComponent = exports.DateField = exports.Text = exports.RichText = exports.Image = exports.ServerPlaceholder = exports.Placeholder = exports.Form = exports.mediaApi = exports.ErrorPage = exports.GraphQLRequestClient = exports.DefaultRetryStrategy = exports.DictionaryService = exports.EditMode = exports.getFieldValue = exports.getChildPlaceholder = exports.LayoutService = exports.LayoutServicePageState = exports.getDesignLibraryStylesheetLinks = exports.getContentStylesheetLink = exports.resetEditorChromes = exports.isEditorActive = exports.NativeDataFetcher = exports.MemoryCacheClient = exports.ClientError = exports.enableDebug = exports.constants = void 0;
|
|
4
|
+
exports.SitePathService = exports.ClientEditingChromesUpdate = exports.DefaultEmptyFieldEditingComponentImage = void 0;
|
|
4
5
|
var core_1 = require("@sitecore-content-sdk/core");
|
|
5
6
|
Object.defineProperty(exports, "constants", { enumerable: true, get: function () { return core_1.constants; } });
|
|
6
7
|
Object.defineProperty(exports, "enableDebug", { enumerable: true, get: function () { return core_1.enableDebug; } });
|
|
@@ -39,18 +40,20 @@ var Text_1 = require("./components/Text");
|
|
|
39
40
|
Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return Text_1.Text; } });
|
|
40
41
|
var Date_1 = require("./components/Date");
|
|
41
42
|
Object.defineProperty(exports, "DateField", { enumerable: true, get: function () { return Date_1.DateField; } });
|
|
42
|
-
var
|
|
43
|
-
Object.defineProperty(exports, "FEaaSComponent", { enumerable: true, get: function () { return
|
|
44
|
-
Object.defineProperty(exports, "fetchFEaaSComponentServerProps", { enumerable: true, get: function () { return
|
|
45
|
-
|
|
46
|
-
Object.defineProperty(exports, "
|
|
43
|
+
var FEaaS_1 = require("./components/FEaaS");
|
|
44
|
+
Object.defineProperty(exports, "FEaaSComponent", { enumerable: true, get: function () { return FEaaS_1.FEaaSComponent; } });
|
|
45
|
+
Object.defineProperty(exports, "fetchFEaaSComponentServerProps", { enumerable: true, get: function () { return FEaaS_1.fetchFEaaSComponentServerProps; } });
|
|
46
|
+
Object.defineProperty(exports, "BYOCComponent", { enumerable: true, get: function () { return FEaaS_1.BYOCComponent; } });
|
|
47
|
+
Object.defineProperty(exports, "fetchBYOCComponentServerProps", { enumerable: true, get: function () { return FEaaS_1.fetchBYOCComponentServerProps; } });
|
|
48
|
+
// leaving original names for backward compatibility
|
|
49
|
+
Object.defineProperty(exports, "BYOCWrapper", { enumerable: true, get: function () { return FEaaS_1.BYOCWrapper; } });
|
|
50
|
+
Object.defineProperty(exports, "BYOCClientWrapper", { enumerable: true, get: function () { return FEaaS_1.BYOCWrapper; } });
|
|
51
|
+
Object.defineProperty(exports, "FEaaSWrapper", { enumerable: true, get: function () { return FEaaS_1.FEaaSWrapper; } });
|
|
52
|
+
Object.defineProperty(exports, "FEaaSClientWrapper", { enumerable: true, get: function () { return FEaaS_1.FEaaSWrapper; } });
|
|
53
|
+
Object.defineProperty(exports, "FEaaSServerWrapper", { enumerable: true, get: function () { return FEaaS_1.FEaaSServerWrapper; } });
|
|
54
|
+
Object.defineProperty(exports, "BYOCServerWrapper", { enumerable: true, get: function () { return FEaaS_1.BYOCServerWrapper; } });
|
|
47
55
|
var DesignLibrary_1 = require("./components/DesignLibrary");
|
|
48
56
|
Object.defineProperty(exports, "DesignLibrary", { enumerable: true, get: function () { return DesignLibrary_1.DesignLibrary; } });
|
|
49
|
-
var BYOCComponent_1 = require("./components/BYOCComponent");
|
|
50
|
-
Object.defineProperty(exports, "BYOCComponent", { enumerable: true, get: function () { return BYOCComponent_1.BYOCComponent; } });
|
|
51
|
-
Object.defineProperty(exports, "fetchBYOCComponentServerProps", { enumerable: true, get: function () { return BYOCComponent_1.fetchBYOCComponentServerProps; } });
|
|
52
|
-
var BYOCWrapper_1 = require("./components/BYOCWrapper");
|
|
53
|
-
Object.defineProperty(exports, "BYOCWrapper", { enumerable: true, get: function () { return BYOCWrapper_1.BYOCWrapper; } });
|
|
54
57
|
var Link_1 = require("./components/Link");
|
|
55
58
|
Object.defineProperty(exports, "Link", { enumerable: true, get: function () { return Link_1.Link; } });
|
|
56
59
|
var File_1 = require("./components/File");
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { fetchBYOCComponentServerProps } from './feaas-utils';
|
|
12
|
+
import { BYOCWrapper } from './BYOCWrapper';
|
|
13
|
+
import { nonSerializedPlaceholderProps } from '../Placeholder/models';
|
|
14
|
+
export const BYOCServerWrapper = (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
var _a;
|
|
16
|
+
const params = ((_a = props.rendering) === null || _a === void 0 ? void 0 : _a.params) || {};
|
|
17
|
+
// only pass serializable props to the client BYOC component
|
|
18
|
+
const serializableProps = Object.fromEntries(Object.entries(props).filter(([key]) => !nonSerializedPlaceholderProps.includes(key)));
|
|
19
|
+
const finalProps = Object.assign(Object.assign({}, (yield fetchBYOCComponentServerProps(params))), serializableProps);
|
|
20
|
+
return React.createElement(BYOCWrapper, Object.assign({}, finalProps));
|
|
21
|
+
});
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
import React from 'react';
|
|
12
|
-
import { getDataFromFields } from '../utils';
|
|
13
|
-
import { MissingComponent } from './MissingComponent';
|
|
14
3
|
import * as FEAAS from '@sitecore-feaas/clientside/react';
|
|
15
|
-
|
|
4
|
+
import { getDataFromFields } from '../../utils';
|
|
5
|
+
import { MissingComponent } from '../MissingComponent';
|
|
16
6
|
const DefaultErrorComponent = (props) => {
|
|
17
7
|
var _a;
|
|
18
8
|
return (React.createElement("div", null,
|
|
@@ -20,11 +10,12 @@ const DefaultErrorComponent = (props) => {
|
|
|
20
10
|
_a.message,
|
|
21
11
|
"."));
|
|
22
12
|
};
|
|
13
|
+
// BYOCComponent remains for backward compatibility and testing purposes
|
|
23
14
|
/**
|
|
24
15
|
* BYOCComponent facilitate the rendering of external components. It manages potential errors,
|
|
25
16
|
* missing components, and customization of error messages or alternative rendering components.
|
|
26
17
|
* @param {ByocComponentProps} props component props
|
|
27
|
-
* @returns
|
|
18
|
+
* @returns dynamically rendered component or Missing Component error frame
|
|
28
19
|
*/
|
|
29
20
|
export class BYOCComponent extends React.Component {
|
|
30
21
|
constructor(props) {
|
|
@@ -76,17 +67,15 @@ export class BYOCComponent extends React.Component {
|
|
|
76
67
|
}
|
|
77
68
|
}
|
|
78
69
|
/**
|
|
79
|
-
*
|
|
80
|
-
* @param {
|
|
70
|
+
* SXA wrapper for BYOC components
|
|
71
|
+
* @param {BYOCComponentProps} props component props
|
|
72
|
+
* @returns wrapped BYOC component
|
|
81
73
|
*/
|
|
82
|
-
export
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
};
|
|
91
|
-
});
|
|
92
|
-
}
|
|
74
|
+
export const BYOCWrapper = (props) => {
|
|
75
|
+
var _a, _b, _c;
|
|
76
|
+
const styles = (_b = (_a = props.params) === null || _a === void 0 ? void 0 : _a.styles) === null || _b === void 0 ? void 0 : _b.trimEnd();
|
|
77
|
+
const id = (_c = props.params) === null || _c === void 0 ? void 0 : _c.RenderingIdentifier;
|
|
78
|
+
return (React.createElement("div", { className: styles ? styles : undefined, id: id ? id : undefined },
|
|
79
|
+
React.createElement("div", { className: "component-content" },
|
|
80
|
+
React.createElement(BYOCComponent, Object.assign({}, props)))));
|
|
81
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { fetchFEaaSComponentServerProps } from './feaas-utils';
|
|
12
|
+
import { FEaaSWrapper } from './FEaaSWrapper';
|
|
13
|
+
import { nonSerializedPlaceholderProps } from '../Placeholder/models';
|
|
14
|
+
/**
|
|
15
|
+
* Server component for FEaaS. Retrieves server props and renders client FEaaSWrapper.
|
|
16
|
+
* @param {FEaaSComponentProps} props incoming props
|
|
17
|
+
* @returns {Promise<JSX.Element>} rendered FEaaSWrapper component
|
|
18
|
+
*/
|
|
19
|
+
export const FEaaSServerWrapper = (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
const params = ((_a = props.rendering) === null || _a === void 0 ? void 0 : _a.params) || {};
|
|
22
|
+
const isPageStateNormal = (_b = props.page) === null || _b === void 0 ? void 0 : _b.mode.isNormal;
|
|
23
|
+
// only pass serializable props to the client FEaaS component
|
|
24
|
+
const serializableProps = Object.fromEntries(Object.entries(props).filter(([key]) => !nonSerializedPlaceholderProps.includes(key)));
|
|
25
|
+
const finalProps = Object.assign(Object.assign({}, (yield fetchFEaaSComponentServerProps(params, isPageStateNormal))), serializableProps);
|
|
26
|
+
return React.createElement(FEaaSWrapper, Object.assign({}, finalProps));
|
|
27
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import * as FEAAS from '@sitecore-feaas/clientside/react';
|
|
4
|
+
import { getDataFromFields } from '../../utils';
|
|
5
|
+
// FEaaSComponent remains for backward compatibility and testing purposes
|
|
6
|
+
/**
|
|
7
|
+
* @param {FEaaSComponentProps} props component props
|
|
8
|
+
*/
|
|
9
|
+
export const FEaaSComponent = (props) => {
|
|
10
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
11
|
+
const computedRevision = ((_a = props.params) === null || _a === void 0 ? void 0 : _a.ComponentRevision) || props.revisionFallback;
|
|
12
|
+
if (!props.template &&
|
|
13
|
+
(!props.params ||
|
|
14
|
+
!props.params.LibraryId ||
|
|
15
|
+
!props.params.ComponentId ||
|
|
16
|
+
!props.params.ComponentVersion ||
|
|
17
|
+
!props.params.ComponentHostName ||
|
|
18
|
+
!computedRevision)) {
|
|
19
|
+
// Missing FEaaS component required props
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
// combine fetchedData from server with datasource data (if present)
|
|
23
|
+
const data = Object.assign(Object.assign({}, props.fetchedData), { _: getDataFromFields((_b = props.fields) !== null && _b !== void 0 ? _b : {}) });
|
|
24
|
+
// FEaaS control would still be hydrated by client
|
|
25
|
+
// we pass all the props as a workaround to avoid hydration error, until we convert all Content SDK components to server side
|
|
26
|
+
// this also allows component to fall back to full client-side rendering when template or src is empty
|
|
27
|
+
// FEAAS should not fetch anything, since Content SDK does the fetching - so we pass empty array into fetch param
|
|
28
|
+
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: [] }));
|
|
29
|
+
};
|
|
30
|
+
export const FEaaSWrapper = (props) => {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
const styles = `component feaas ${(_a = props.params) === null || _a === void 0 ? void 0 : _a.styles}`.trimEnd();
|
|
33
|
+
const id = (_b = props.params) === null || _b === void 0 ? void 0 : _b.RenderingIdentifier;
|
|
34
|
+
return (React.createElement("div", { className: styles, id: id ? id : undefined },
|
|
35
|
+
React.createElement("div", { className: "component-content" },
|
|
36
|
+
React.createElement(FEaaSComponent, Object.assign({}, props)))));
|
|
37
|
+
};
|