@sitecore-content-sdk/react 2.0.0-canary.9 → 2.0.2-canary.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.
Files changed (44) hide show
  1. package/dist/cjs/components/DesignLibrary/DesignLibrary.js +2 -2
  2. package/dist/cjs/components/DesignLibrary/DesignLibraryErrorBoundary.js +6 -0
  3. package/dist/cjs/components/DesignLibrary/index.js +3 -3
  4. package/dist/cjs/components/ErrorBoundary.js +1 -0
  5. package/dist/cjs/components/Form.js +4 -2
  6. package/dist/cjs/components/Placeholder/PlaceholderMetadata.js +1 -0
  7. package/dist/cjs/index.js +6 -3
  8. package/dist/esm/components/DesignLibrary/DesignLibrary.js +2 -2
  9. package/dist/esm/components/DesignLibrary/DesignLibraryErrorBoundary.js +6 -0
  10. package/dist/esm/components/DesignLibrary/index.js +1 -1
  11. package/dist/esm/components/ErrorBoundary.js +1 -0
  12. package/dist/esm/components/Form.js +4 -2
  13. package/dist/esm/components/Placeholder/PlaceholderMetadata.js +1 -0
  14. package/dist/esm/index.js +3 -2
  15. package/package.json +7 -6
  16. package/types/components/DesignLibrary/DesignLibraryErrorBoundary.d.ts +13 -0
  17. package/types/components/DesignLibrary/DesignLibraryErrorBoundary.d.ts.map +1 -1
  18. package/types/components/DesignLibrary/index.d.ts +2 -1
  19. package/types/components/DesignLibrary/index.d.ts.map +1 -1
  20. package/types/components/DesignLibrary/models.d.ts +13 -55
  21. package/types/components/DesignLibrary/models.d.ts.map +1 -1
  22. package/types/components/ErrorBoundary.d.ts +1 -0
  23. package/types/components/ErrorBoundary.d.ts.map +1 -1
  24. package/types/components/Form.d.ts.map +1 -1
  25. package/types/components/Placeholder/PlaceholderMetadata.d.ts +1 -0
  26. package/types/components/Placeholder/PlaceholderMetadata.d.ts.map +1 -1
  27. package/types/index.d.ts +3 -2
  28. package/types/index.d.ts.map +1 -1
  29. package/dist/cjs/components/DesignLibrary/DesignLibraryApp.js +0 -31
  30. package/dist/cjs/components/DesignLibrary/DesignLibraryClientEvents.js +0 -139
  31. package/dist/cjs/components/DesignLibrary/DesignLibraryServer.js +0 -212
  32. package/dist/cjs/server-actions/update-server-component-action.js +0 -51
  33. package/dist/esm/components/DesignLibrary/DesignLibraryApp.js +0 -24
  34. package/dist/esm/components/DesignLibrary/DesignLibraryClientEvents.js +0 -100
  35. package/dist/esm/components/DesignLibrary/DesignLibraryServer.js +0 -169
  36. package/dist/esm/server-actions/update-server-component-action.js +0 -47
  37. package/types/components/DesignLibrary/DesignLibraryApp.d.ts +0 -14
  38. package/types/components/DesignLibrary/DesignLibraryApp.d.ts.map +0 -1
  39. package/types/components/DesignLibrary/DesignLibraryClientEvents.d.ts +0 -21
  40. package/types/components/DesignLibrary/DesignLibraryClientEvents.d.ts.map +0 -1
  41. package/types/components/DesignLibrary/DesignLibraryServer.d.ts +0 -38
  42. package/types/components/DesignLibrary/DesignLibraryServer.d.ts.map +0 -1
  43. package/types/server-actions/update-server-component-action.d.ts +0 -58
  44. package/types/server-actions/update-server-component-action.d.ts.map +0 -1
@@ -119,7 +119,7 @@ const DesignLibrary = () => {
119
119
  let unsubscribe;
120
120
  (async () => {
121
121
  if (!loadImportMap) {
122
- sendErrorEvent(uid, 'No loadImportMap provided', codegen.DesignLibraryPreviewError.RenderInit);
122
+ sendErrorEvent(uid, 'No loadImportMap provided', codegen.DesignLibraryPreviewError.ImportMapMissing);
123
123
  return;
124
124
  }
125
125
  let importMap;
@@ -128,7 +128,7 @@ const DesignLibrary = () => {
128
128
  importMap = mod.default;
129
129
  }
130
130
  catch (e) {
131
- sendErrorEvent(uid, `Error loading import map: ${e}`, codegen.DesignLibraryPreviewError.RenderInit);
131
+ sendErrorEvent(uid, `Error loading import map: ${e}`, codegen.DesignLibraryPreviewError.ImportMapLoad);
132
132
  return;
133
133
  }
134
134
  // account for component being unmounted while resolving async import map
@@ -37,6 +37,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.DesignLibraryErrorBoundary = void 0;
38
38
  const react_1 = __importStar(require("react"));
39
39
  const codegen_1 = require("@sitecore-content-sdk/content/codegen");
40
+ /**
41
+ * Error boundary for the Design Library component.
42
+ * Catches errors during rendering and sends them to the Design Library
43
+ * @param {DesignLibraryErrorBoundaryProps} props - The props for the error boundary, including the component UID and children to render.
44
+ * @internal
45
+ */
40
46
  class DesignLibraryErrorBoundary extends react_1.default.Component {
41
47
  constructor() {
42
48
  super(...arguments);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DesignLibraryApp = exports.DesignLibrary = void 0;
3
+ exports.DesignLibraryErrorBoundary = exports.DesignLibrary = void 0;
4
4
  var DesignLibrary_1 = require("./DesignLibrary");
5
5
  Object.defineProperty(exports, "DesignLibrary", { enumerable: true, get: function () { return DesignLibrary_1.DesignLibrary; } });
6
- var DesignLibraryApp_1 = require("./DesignLibraryApp");
7
- Object.defineProperty(exports, "DesignLibraryApp", { enumerable: true, get: function () { return DesignLibraryApp_1.DesignLibraryApp; } });
6
+ var DesignLibraryErrorBoundary_1 = require("./DesignLibraryErrorBoundary");
7
+ Object.defineProperty(exports, "DesignLibraryErrorBoundary", { enumerable: true, get: function () { return DesignLibraryErrorBoundary_1.DesignLibraryErrorBoundary; } });
@@ -40,6 +40,7 @@ const SitecoreProvider_1 = require("./SitecoreProvider");
40
40
  /**
41
41
  * Simple error component applying basic error styling.
42
42
  * @param {object} props - Either with `message` (string) or with `children` (ReactNode), but not both.
43
+ * @internal
43
44
  */
44
45
  const ErrorComponent = (props) => {
45
46
  return (react_1.default.createElement("div", { className: "sc-content-sdk-placeholder-error" }, props.message ? props.message : props.children));
@@ -37,8 +37,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.Form = exports.mockFormModule = void 0;
38
38
  const react_1 = __importStar(require("react"));
39
39
  const content_1 = require("@sitecore-content-sdk/content");
40
+ const core_1 = require("@sitecore-content-sdk/core");
40
41
  const SitecoreProvider_1 = require("./SitecoreProvider");
41
42
  const ErrorBoundary_1 = require("./ErrorBoundary");
43
+ const { ERROR_MESSAGES } = core_1.constants;
42
44
  let { executeScriptElements, loadForm, subscribeToFormSubmitEvent } = content_1.form;
43
45
  /**
44
46
  * Mock function to replace the form module functions for `testing` purposes.
@@ -70,14 +72,14 @@ const Form = ({ params, rendering }) => {
70
72
  const edgeId = (_b = (_a = context.api) === null || _a === void 0 ? void 0 : _a.edge) === null || _b === void 0 ? void 0 : _b.clientContextId;
71
73
  if (!edgeId) {
72
74
  /* eslint-disable no-console */
73
- console.warn('Warning: clientContextId is missing – form cannot be loaded properly on the client');
75
+ console.warn(`${ERROR_MESSAGES.MV_006}. Form cannot be loaded properly on the client`);
74
76
  return;
75
77
  }
76
78
  loadForm(edgeId, params.FormId, (_d = (_c = context.api) === null || _c === void 0 ? void 0 : _c.edge) === null || _d === void 0 ? void 0 : _d.edgeUrl)
77
79
  .then(setContent)
78
80
  .catch(() => {
79
81
  if (isEditing) {
80
- console.error(`Failed to load form with id ${params.FormId}. Check debug logs for content-sdk:form for more details.`);
82
+ console.error(`Failed to load form with id ${params.FormId}. Check debug logs for content-sdk:form for more details. ${ERROR_MESSAGES.CONTACT_SUPPORT}`);
81
83
  }
82
84
  setError(true);
83
85
  });
@@ -17,6 +17,7 @@ const editing_1 = require("@sitecore-content-sdk/content/editing");
17
17
  * @param {'server' | 'client'} [props.componentRuntime] Component runtime type. Used to add data-csdk-component-runtime attribute to rendering chromes.
18
18
  * @param {JSX.Element} props.children The child components or elements to be wrapped by the metadata code blocks.
19
19
  * @returns {JSX.Element} A React fragment containing open and close code blocks surrounding the children elements.
20
+ * @internal
20
21
  */
21
22
  const PlaceholderMetadata = ({ rendering, placeholderName, children, componentRuntime, }) => {
22
23
  const getCodeBlockAttributes = ({ kind, id, placeholderName, }) => {
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withAppPlaceholder = exports.withEmptyFieldEditingComponent = exports.withFieldMetadata = exports.withDatasourceCheck = exports.withSitecore = exports.withEditorChromes = exports.useSitecore = exports.SitecoreProviderReactContext = exports.SitecoreProvider = exports.File = exports.Link = exports.DesignLibraryApp = 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.renderEmptyPlaceholder = exports.AppPlaceholder = 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 = exports.DefaultEmptyFieldEditingComponentText = exports.EditingScripts = exports.withPlaceholder = void 0;
3
+ exports.withFieldMetadata = exports.withDatasourceCheck = exports.withSitecore = exports.withEditorChromes = exports.ErrorComponent = exports.useSitecore = exports.SitecoreProviderReactContext = exports.SitecoreProvider = exports.File = exports.Link = exports.DesignLibraryErrorBoundary = 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.renderEmptyPlaceholder = exports.PlaceholderMetadata = exports.AppPlaceholder = 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 = exports.DefaultEmptyFieldEditingComponentText = exports.EditingScripts = exports.withPlaceholder = exports.withAppPlaceholder = exports.withEmptyFieldEditingComponent = void 0;
5
5
  var core_1 = require("@sitecore-content-sdk/core");
6
6
  Object.defineProperty(exports, "constants", { enumerable: true, get: function () { return core_1.constants; } });
7
7
  Object.defineProperty(exports, "enableDebug", { enumerable: true, get: function () { return core_1.enableDebug; } });
@@ -32,6 +32,7 @@ Object.defineProperty(exports, "Form", { enumerable: true, get: function () { re
32
32
  var Placeholder_1 = require("./components/Placeholder");
33
33
  Object.defineProperty(exports, "Placeholder", { enumerable: true, get: function () { return Placeholder_1.Placeholder; } });
34
34
  Object.defineProperty(exports, "AppPlaceholder", { enumerable: true, get: function () { return Placeholder_1.AppPlaceholder; } });
35
+ Object.defineProperty(exports, "PlaceholderMetadata", { enumerable: true, get: function () { return Placeholder_1.PlaceholderMetadata; } });
35
36
  Object.defineProperty(exports, "renderEmptyPlaceholder", { enumerable: true, get: function () { return Placeholder_1.renderEmptyPlaceholder; } });
36
37
  var Image_1 = require("./components/Image");
37
38
  Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return Image_1.Image; } });
@@ -55,7 +56,7 @@ Object.defineProperty(exports, "FEaaSServerWrapper", { enumerable: true, get: fu
55
56
  Object.defineProperty(exports, "BYOCServerWrapper", { enumerable: true, get: function () { return FEaaS_1.BYOCServerWrapper; } });
56
57
  var DesignLibrary_1 = require("./components/DesignLibrary");
57
58
  Object.defineProperty(exports, "DesignLibrary", { enumerable: true, get: function () { return DesignLibrary_1.DesignLibrary; } });
58
- Object.defineProperty(exports, "DesignLibraryApp", { enumerable: true, get: function () { return DesignLibrary_1.DesignLibraryApp; } });
59
+ Object.defineProperty(exports, "DesignLibraryErrorBoundary", { enumerable: true, get: function () { return DesignLibrary_1.DesignLibraryErrorBoundary; } });
59
60
  var Link_1 = require("./components/Link");
60
61
  Object.defineProperty(exports, "Link", { enumerable: true, get: function () { return Link_1.Link; } });
61
62
  var File_1 = require("./components/File");
@@ -64,6 +65,8 @@ var SitecoreProvider_1 = require("./components/SitecoreProvider");
64
65
  Object.defineProperty(exports, "SitecoreProvider", { enumerable: true, get: function () { return SitecoreProvider_1.SitecoreProvider; } });
65
66
  Object.defineProperty(exports, "SitecoreProviderReactContext", { enumerable: true, get: function () { return SitecoreProvider_1.SitecoreProviderReactContext; } });
66
67
  Object.defineProperty(exports, "useSitecore", { enumerable: true, get: function () { return SitecoreProvider_1.useSitecore; } });
68
+ var ErrorBoundary_1 = require("./components/ErrorBoundary");
69
+ Object.defineProperty(exports, "ErrorComponent", { enumerable: true, get: function () { return ErrorBoundary_1.ErrorComponent; } });
67
70
  var withEditorChromes_1 = require("./enhancers/withEditorChromes");
68
71
  Object.defineProperty(exports, "withEditorChromes", { enumerable: true, get: function () { return withEditorChromes_1.withEditorChromes; } });
69
72
  var withSitecore_1 = require("./enhancers/withSitecore");
@@ -82,7 +82,7 @@ export const DesignLibrary = () => {
82
82
  let unsubscribe;
83
83
  (async () => {
84
84
  if (!loadImportMap) {
85
- sendErrorEvent(uid, 'No loadImportMap provided', codegen.DesignLibraryPreviewError.RenderInit);
85
+ sendErrorEvent(uid, 'No loadImportMap provided', codegen.DesignLibraryPreviewError.ImportMapMissing);
86
86
  return;
87
87
  }
88
88
  let importMap;
@@ -91,7 +91,7 @@ export const DesignLibrary = () => {
91
91
  importMap = mod.default;
92
92
  }
93
93
  catch (e) {
94
- sendErrorEvent(uid, `Error loading import map: ${e}`, codegen.DesignLibraryPreviewError.RenderInit);
94
+ sendErrorEvent(uid, `Error loading import map: ${e}`, codegen.DesignLibraryPreviewError.ImportMapLoad);
95
95
  return;
96
96
  }
97
97
  // account for component being unmounted while resolving async import map
@@ -1,6 +1,12 @@
1
1
  'use client';
2
2
  import React, { Suspense } from 'react';
3
3
  import { DesignLibraryPreviewError, sendErrorEvent } from '@sitecore-content-sdk/content/codegen';
4
+ /**
5
+ * Error boundary for the Design Library component.
6
+ * Catches errors during rendering and sends them to the Design Library
7
+ * @param {DesignLibraryErrorBoundaryProps} props - The props for the error boundary, including the component UID and children to render.
8
+ * @internal
9
+ */
4
10
  export class DesignLibraryErrorBoundary extends React.Component {
5
11
  constructor() {
6
12
  super(...arguments);
@@ -1,2 +1,2 @@
1
1
  export { DesignLibrary } from './DesignLibrary';
2
- export { DesignLibraryApp } from './DesignLibraryApp';
2
+ export { DesignLibraryErrorBoundary } from './DesignLibraryErrorBoundary';
@@ -4,6 +4,7 @@ import { useSitecore } from './SitecoreProvider';
4
4
  /**
5
5
  * Simple error component applying basic error styling.
6
6
  * @param {object} props - Either with `message` (string) or with `children` (ReactNode), but not both.
7
+ * @internal
7
8
  */
8
9
  export const ErrorComponent = (props) => {
9
10
  return (React.createElement("div", { className: "sc-content-sdk-placeholder-error" }, props.message ? props.message : props.children));
@@ -1,8 +1,10 @@
1
1
  'use client';
2
2
  import React, { useEffect, useRef, useState } from 'react';
3
3
  import { form } from '@sitecore-content-sdk/content';
4
+ import { constants } from '@sitecore-content-sdk/core';
4
5
  import { useSitecore } from './SitecoreProvider';
5
6
  import { ErrorComponent } from './ErrorBoundary';
7
+ const { ERROR_MESSAGES } = constants;
6
8
  let { executeScriptElements, loadForm, subscribeToFormSubmitEvent } = form;
7
9
  /**
8
10
  * Mock function to replace the form module functions for `testing` purposes.
@@ -33,14 +35,14 @@ export const Form = ({ params, rendering }) => {
33
35
  const edgeId = (_b = (_a = context.api) === null || _a === void 0 ? void 0 : _a.edge) === null || _b === void 0 ? void 0 : _b.clientContextId;
34
36
  if (!edgeId) {
35
37
  /* eslint-disable no-console */
36
- console.warn('Warning: clientContextId is missing – form cannot be loaded properly on the client');
38
+ console.warn(`${ERROR_MESSAGES.MV_006}. Form cannot be loaded properly on the client`);
37
39
  return;
38
40
  }
39
41
  loadForm(edgeId, params.FormId, (_d = (_c = context.api) === null || _c === void 0 ? void 0 : _c.edge) === null || _d === void 0 ? void 0 : _d.edgeUrl)
40
42
  .then(setContent)
41
43
  .catch(() => {
42
44
  if (isEditing) {
43
- console.error(`Failed to load form with id ${params.FormId}. Check debug logs for content-sdk:form for more details.`);
45
+ console.error(`Failed to load form with id ${params.FormId}. Check debug logs for content-sdk:form for more details. ${ERROR_MESSAGES.CONTACT_SUPPORT}`);
44
46
  }
45
47
  setError(true);
46
48
  });
@@ -11,6 +11,7 @@ import { MetadataKind, DEFAULT_PLACEHOLDER_UID } from '@sitecore-content-sdk/con
11
11
  * @param {'server' | 'client'} [props.componentRuntime] Component runtime type. Used to add data-csdk-component-runtime attribute to rendering chromes.
12
12
  * @param {JSX.Element} props.children The child components or elements to be wrapped by the metadata code blocks.
13
13
  * @returns {JSX.Element} A React fragment containing open and close code blocks surrounding the children elements.
14
+ * @internal
14
15
  */
15
16
  export const PlaceholderMetadata = ({ rendering, placeholderName, children, componentRuntime, }) => {
16
17
  const getCodeBlockAttributes = ({ kind, id, placeholderName, }) => {
package/dist/esm/index.js CHANGED
@@ -5,7 +5,7 @@ export { DictionaryService } from '@sitecore-content-sdk/content/i18n';
5
5
  export { DefaultRetryStrategy, GraphQLRequestClient, ErrorPage, } from '@sitecore-content-sdk/content/client';
6
6
  export { mediaApi } from '@sitecore-content-sdk/content/media';
7
7
  export { Form } from './components/Form';
8
- export { Placeholder, AppPlaceholder, renderEmptyPlaceholder, } from './components/Placeholder';
8
+ export { Placeholder, AppPlaceholder, PlaceholderMetadata, renderEmptyPlaceholder, } from './components/Placeholder';
9
9
  export { Image, } from './components/Image';
10
10
  export { RichText } from './components/RichText';
11
11
  export { Text } from './components/Text';
@@ -13,10 +13,11 @@ export { DateField } from './components/Date';
13
13
  export { FEaaSComponent, fetchFEaaSComponentServerProps, BYOCComponent, fetchBYOCComponentServerProps,
14
14
  // leaving original names for backward compatibility
15
15
  BYOCWrapper, BYOCWrapper as BYOCClientWrapper, FEaaSWrapper, FEaaSWrapper as FEaaSClientWrapper, FEaaSServerWrapper, BYOCServerWrapper, } from './components/FEaaS';
16
- export { DesignLibrary, DesignLibraryApp } from './components/DesignLibrary';
16
+ export { DesignLibrary, DesignLibraryErrorBoundary, } from './components/DesignLibrary';
17
17
  export { Link } from './components/Link';
18
18
  export { File } from './components/File';
19
19
  export { SitecoreProvider, SitecoreProviderReactContext, useSitecore, } from './components/SitecoreProvider';
20
+ export { ErrorComponent } from './components/ErrorBoundary';
20
21
  export { withEditorChromes } from './enhancers/withEditorChromes';
21
22
  export { withSitecore } from './enhancers/withSitecore';
22
23
  export { withDatasourceCheck } from './enhancers/withDatasourceCheck';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitecore-content-sdk/react",
3
- "version": "2.0.0-canary.9",
3
+ "version": "2.0.2-canary.0",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "sideEffects": false,
@@ -70,20 +70,21 @@
70
70
  "typescript": "~5.8.3"
71
71
  },
72
72
  "peerDependencies": {
73
- "@sitecore-cloudsdk/events": "^0.5.1",
73
+ "@sitecore-content-sdk/analytics-core": "^2.0.0",
74
+ "@sitecore-content-sdk/events": "^2.0.0",
74
75
  "@sitecore-feaas/clientside": "^0.6.0",
75
76
  "react": "^19.2.1",
76
77
  "react-dom": "^19.2.1"
77
78
  },
78
79
  "dependencies": {
79
- "@sitecore-content-sdk/content": "2.0.0-canary.9",
80
- "@sitecore-content-sdk/core": "2.0.0-canary.9",
81
- "@sitecore-content-sdk/search": "0.2.0-canary.19",
80
+ "@sitecore-content-sdk/content": "2.0.2-canary.0",
81
+ "@sitecore-content-sdk/core": "2.0.2-canary.0",
82
+ "@sitecore-content-sdk/search": "0.2.2-canary.0",
82
83
  "fast-deep-equal": "^3.1.3"
83
84
  },
84
85
  "description": "",
85
86
  "types": "types/index.d.ts",
86
- "gitHead": "152ff7ce9979733dfe56ec6872fd8b466370d594",
87
+ "gitHead": "2c38dbe915264c92dfc8482535afa0f0466e0b35",
87
88
  "files": [
88
89
  "dist",
89
90
  "types",
@@ -1,9 +1,22 @@
1
1
  import React from 'react';
2
+ /**
3
+ * Props for the DesignLibraryErrorBoundary component.
4
+ * @property {string} uid - The unique identifier of the component being rendered.
5
+ * @property {React.ReactNode} children - The child components to render within the error boundary.
6
+ * @property {number} [renderKey] - An optional key to trigger re-rendering of the error boundary when changed.
7
+ * @internal
8
+ */
2
9
  type DesignLibraryErrorBoundaryProps = {
3
10
  uid: string;
4
11
  children: React.ReactNode;
5
12
  renderKey?: number;
6
13
  };
14
+ /**
15
+ * Error boundary for the Design Library component.
16
+ * Catches errors during rendering and sends them to the Design Library
17
+ * @param {DesignLibraryErrorBoundaryProps} props - The props for the error boundary, including the component UID and children to render.
18
+ * @internal
19
+ */
7
20
  export declare class DesignLibraryErrorBoundary extends React.Component<DesignLibraryErrorBoundaryProps> {
8
21
  state: {
9
22
  hasError: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"DesignLibraryErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/DesignLibraryErrorBoundary.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,KAAK,+BAA+B,GAAG;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,qBAAa,0BAA2B,SAAQ,KAAK,CAAC,SAAS,CAAC,+BAA+B,CAAC;IAC9F,KAAK;;MAEH;IAEF,MAAM,CAAC,wBAAwB;;;IAI/B,kBAAkB,CAAC,SAAS,EAAE,+BAA+B;IAM7D,iBAAiB,CAAC,KAAK,EAAE,KAAK;IAI9B,MAAM;CAOP"}
1
+ {"version":3,"file":"DesignLibraryErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/DesignLibraryErrorBoundary.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC;;;;;;GAMG;AACH,KAAK,+BAA+B,GAAG;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,0BAA2B,SAAQ,KAAK,CAAC,SAAS,CAAC,+BAA+B,CAAC;IAC9F,KAAK;;MAEH;IAEF,MAAM,CAAC,wBAAwB;;;IAI/B,kBAAkB,CAAC,SAAS,EAAE,+BAA+B;IAM7D,iBAAiB,CAAC,KAAK,EAAE,KAAK;IAI9B,MAAM;CAOP"}
@@ -1,3 +1,4 @@
1
1
  export { DesignLibrary } from './DesignLibrary';
2
- export { DesignLibraryApp } from './DesignLibraryApp';
2
+ export { DesignLibraryErrorBoundary } from './DesignLibraryErrorBoundary';
3
+ export { DynamicComponent, ImportMapImport } from './models';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC"}
@@ -1,62 +1,20 @@
1
- import { GeneratedComponentData, ImportEntry, ImportEntryInfo } from '@sitecore-content-sdk/content/codegen';
2
- import { ComponentFields, ComponentParams, ComponentRendering, RouteData } from '@sitecore-content-sdk/content/layout';
3
- import { DesignLibraryStatus } from '@sitecore-content-sdk/content/editing';
4
- import { Page } from '@sitecore-content-sdk/content/client';
5
- import { ComponentMap } from '../sharedTypes';
6
- export type ImportMapImport = {
7
- default: ImportEntry[];
8
- };
1
+ import { ComponentFields, ComponentParams } from '@sitecore-content-sdk/content/layout';
2
+ import { ImportEntry } from '@sitecore-content-sdk/content/codegen';
3
+ /**
4
+ * Model representing a dynamically generated component in the Design Library.
5
+ * This model includes the component's fields and parameters, which are used for rendering and interaction within the Design Library.
6
+ * @internal
7
+ */
9
8
  export type DynamicComponent = React.ComponentType<{
10
9
  [key: string]: unknown;
11
10
  fields?: ComponentFields;
12
11
  params?: ComponentParams;
13
12
  }>;
14
- export type DesignLibraryServerProps = {
15
- /**
16
- * Component Map will be used to map Sitecore component names to app implementation
17
- */
18
- componentMap: ComponentMap;
19
- /**
20
- * Rendering data to be used when rendering the placeholder.
21
- */
22
- rendering: ComponentRendering | RouteData;
23
- /**
24
- * Page data.
25
- */
26
- page: Page;
27
- /**
28
- * The dynamic import for sever import map to be used in variant generation mode.
29
- */
30
- loadServerImportMap: () => Promise<ImportMapImport>;
31
- };
32
- export type DesingLibraryAppProps = DesignLibraryServerProps;
33
- export type DesignLibraryServerPreviewProps = Omit<DesignLibraryServerProps, 'loadServerImportMap'>;
34
- export type DesignLibraryServerVariantGenerationProps = DesignLibraryServerProps;
35
- export type DesignLibraryPreviewEventsProps = {
36
- /**
37
- * The design library status to be posted as a message to the Design Studio.
38
- */
39
- designLibraryStatus: DesignLibraryStatus;
40
- /**
41
- * The component rendering data that is being edited in the Design Studio.
42
- */
43
- component: ComponentRendering;
44
- };
45
- export type DesignLibraryVariantGenerationEventsProps = DesignLibraryPreviewEventsProps & {
46
- /**
47
- * The import map info to be posted as a message to the Design Studio.
48
- */
49
- importMap?: ImportEntryInfo[];
50
- /**
51
- * Any error that occurred during initialization of the component:
52
- * - importMap error
53
- * - error fetching the generated component data from secured endpoint
54
- * - error during generation of the component on the server side
55
- */
56
- componentInitError?: string;
57
- /**
58
- * The generated component data received from design library.
59
- */
60
- generatedComponentData?: GeneratedComponentData;
13
+ /**
14
+ * Model representing the import map in the Design Library.
15
+ * @internal
16
+ */
17
+ export type ImportMapImport = {
18
+ default: ImportEntry[];
61
19
  };
62
20
  //# sourceMappingURL=models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/models.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,eAAe,EAChB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,SAAS,EACV,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAC;IACjD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B,CAAC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC;IAC3B;;OAEG;IACH,SAAS,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAC1C;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;OAEG;IACH,mBAAmB,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAE7D,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAAC,wBAAwB,EAAE,qBAAqB,CAAC,CAAC;AAEpG,MAAM,MAAM,yCAAyC,GAAG,wBAAwB,CAAC;AAEjF,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;OAEG;IACH,mBAAmB,EAAE,mBAAmB,CAAC;IACzC;;OAEG;IACH,SAAS,EAAE,kBAAkB,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,yCAAyC,GAAG,+BAA+B,GAAG;IACxF;;OAEG;IACH,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAC9B;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CACjD,CAAC"}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEpE;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAC;IACjD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC"}
@@ -16,6 +16,7 @@ export type ErrorBoundaryProps = {
16
16
  /**
17
17
  * Simple error component applying basic error styling.
18
18
  * @param {object} props - Either with `message` (string) or with `children` (ReactNode), but not both.
19
+ * @internal
19
20
  */
20
21
  export declare const ErrorComponent: (props: {
21
22
  message: React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/components/ErrorBoundary.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,KAAK,mBAAmB,GAAG;IACzB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,mBAAmB,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAAC,CAAC;IAC3F,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GACzB,OACI;IAAE,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,GAC9C;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,sBAOnD,CAAC;AAwEF,QAAA,MAAM,aAAa,GAAI,OAAO,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,sBAI7D,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/components/ErrorBoundary.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,KAAK,mBAAmB,GAAG;IACzB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,mBAAmB,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAAC,CAAC;IAC3F,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GACzB,OACI;IAAE,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,GAC9C;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,sBAOnD,CAAC;AAwEF,QAAA,MAAM,aAAa,GAAI,OAAO,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,sBAI7D,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../src/components/Form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAO1E;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,YAAY,GAAG,SAI7C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,MAAM,EAAE;QACN;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;QACf;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;WAEG;QACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,IAAI,GAAI,uBAAuB,SAAS,sBA+DpD,CAAC"}
1
+ {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../src/components/Form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAU1E;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,YAAY,GAAG,SAI7C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,MAAM,EAAE;QACN;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;QACf;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;WAEG;QACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,IAAI,GAAI,uBAAuB,SAAS,sBA6DpD,CAAC"}
@@ -30,6 +30,7 @@ export type CodeBlockAttributes = {
30
30
  * @param {'server' | 'client'} [props.componentRuntime] Component runtime type. Used to add data-csdk-component-runtime attribute to rendering chromes.
31
31
  * @param {JSX.Element} props.children The child components or elements to be wrapped by the metadata code blocks.
32
32
  * @returns {JSX.Element} A React fragment containing open and close code blocks surrounding the children elements.
33
+ * @internal
33
34
  */
34
35
  export declare const PlaceholderMetadata: ({ rendering, placeholderName, children, componentRuntime, }: PlaceholderMetadataProps) => JSX.Element;
35
36
  //# sourceMappingURL=PlaceholderMetadata.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlaceholderMetadata.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/PlaceholderMetadata.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAGnB,MAAM,sCAAsC,CAAC;AAG9C;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,kBAAkB,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,gBAAgB,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACxC;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6BAA6B,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACrD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,GAAI,6DAKjC,wBAAwB,KAAG,GAAG,CAAC,OAkEjC,CAAC"}
1
+ {"version":3,"file":"PlaceholderMetadata.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/PlaceholderMetadata.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAGnB,MAAM,sCAAsC,CAAC;AAG9C;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,kBAAkB,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,gBAAgB,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACxC;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6BAA6B,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACrD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAAI,6DAKjC,wBAAwB,KAAG,GAAG,CAAC,OAkEjC,CAAC"}
package/types/index.d.ts CHANGED
@@ -7,17 +7,18 @@ export { GraphQLClientError, RetryStrategy, DefaultRetryStrategy, GraphQLRequest
7
7
  export { mediaApi } from '@sitecore-content-sdk/content/media';
8
8
  export { Form } from './components/Form';
9
9
  export { ReactContentSdkComponent, ComponentMap, ReactModule } from './components/sharedTypes';
10
- export { Placeholder, PlaceholderProps, PlaceholderProps as PlaceholderComponentProps, AppPlaceholder, AppPlaceholderProps, renderEmptyPlaceholder, } from './components/Placeholder';
10
+ export { Placeholder, PlaceholderProps, PlaceholderProps as PlaceholderComponentProps, AppPlaceholder, PlaceholderMetadata, AppPlaceholderProps, renderEmptyPlaceholder, } from './components/Placeholder';
11
11
  export { Image, ImageProps, ImageField, ImageFieldValue, ImageSizeParameters, } from './components/Image';
12
12
  export { RichText, RichTextProps, RichTextField } from './components/RichText';
13
13
  export { Text, TextField } from './components/Text';
14
14
  export { DateField, DateFieldProps } from './components/Date';
15
15
  export { FEaaSComponent, FEaaSComponentProps, FEaaSComponentParams, fetchFEaaSComponentServerProps, BYOCComponent, BYOCComponentParams, BYOCComponentProps, fetchBYOCComponentServerProps, BYOCWrapper, BYOCWrapper as BYOCClientWrapper, FEaaSWrapper, FEaaSWrapper as FEaaSClientWrapper, FEaaSServerWrapper, BYOCServerWrapper, } from './components/FEaaS';
16
- export { DesignLibrary, DesignLibraryApp } from './components/DesignLibrary';
16
+ export { DesignLibrary, DesignLibraryErrorBoundary, DynamicComponent, ImportMapImport, } from './components/DesignLibrary';
17
17
  export {} from './components/FEaaS/BYOCComponent';
18
18
  export { Link, LinkField, LinkFieldValue, LinkProps } from './components/Link';
19
19
  export { File, FileField } from './components/File';
20
20
  export { SitecoreProvider, SitecoreProviderState, SitecoreProviderReactContext, useSitecore, } from './components/SitecoreProvider';
21
+ export { ErrorComponent } from './components/ErrorBoundary';
21
22
  export { withEditorChromes } from './enhancers/withEditorChromes';
22
23
  export { withSitecore } from './enhancers/withSitecore';
23
24
  export { withDatasourceCheck } from './enhancers/withDatasourceCheck';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3F,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,aAAa,EACb,SAAS,EACT,KAAK,EACL,IAAI,EACJ,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,QAAQ,GACT,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,iCAAiC,EACjC,oBAAoB,EACpB,QAAQ,EACR,SAAS,EACT,IA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,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,4BAA4B,EAC5B,WAAW,GACZ,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EACL,qCAAqC,EACrC,sCAAsC,GACvC,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC"}
@@ -1,31 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DesignLibraryApp = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const layout_1 = require("@sitecore-content-sdk/content/layout");
9
- const DesignLibraryServer_1 = require("./DesignLibraryServer");
10
- const DesignLibrary_1 = require("./DesignLibrary");
11
- /**
12
- * Design Library component intended to be used by the NextJs app router application
13
- * This component serves as a router between client and server component rendering modes for the Design Library.
14
- * It inspects the component type from the component map and
15
- * delegates to the appropriate rendering implementation:
16
- * - Client components are rendered using the `DesignLibrary` component
17
- * - Server components are rendered using the `DesignLibraryServer` component
18
- * @param {DesingLibraryAppProps} props - The properties for the Design Library App.
19
- * @public
20
- */
21
- const DesignLibraryApp = ({ page, componentMap, loadServerImportMap, }) => {
22
- var _a;
23
- const { route } = page.layout.sitecore;
24
- if (!route)
25
- return null;
26
- const rendering = (_a = route === null || route === void 0 ? void 0 : route.placeholders[layout_1.EDITING_COMPONENT_PLACEHOLDER]) === null || _a === void 0 ? void 0 : _a[0];
27
- const component = componentMap.get((rendering === null || rendering === void 0 ? void 0 : rendering.componentName) || '');
28
- const isClient = component && component.componentType === 'client';
29
- return (react_1.default.createElement(react_1.default.Fragment, null, isClient ? (react_1.default.createElement(DesignLibrary_1.DesignLibrary, null)) : (react_1.default.createElement(DesignLibraryServer_1.DesignLibraryServer, { page: page, componentMap: componentMap, loadServerImportMap: loadServerImportMap, rendering: route }))));
30
- };
31
- exports.DesignLibraryApp = DesignLibraryApp;