@sitecore-content-sdk/react 2.0.0-canary.1 → 2.0.0-canary.10

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 (113) hide show
  1. package/dist/cjs/components/Date.js +13 -11
  2. package/dist/cjs/components/DefaultEmptyFieldEditingComponents.js +2 -1
  3. package/dist/cjs/components/DesignLibrary/DesignLibrary.js +5 -9
  4. package/dist/cjs/components/DesignLibrary/DesignLibraryClientEvents.js +14 -6
  5. package/dist/cjs/components/DesignLibrary/DesignLibraryServer.js +11 -5
  6. package/dist/cjs/components/EditingScripts.js +2 -2
  7. package/dist/cjs/components/ErrorBoundary.js +10 -6
  8. package/dist/cjs/components/File.js +3 -1
  9. package/dist/cjs/components/Form.js +12 -5
  10. package/dist/cjs/components/Image.js +12 -9
  11. package/dist/cjs/components/Link.js +19 -46
  12. package/dist/cjs/components/Placeholder/AppPlaceholder.js +56 -58
  13. package/dist/cjs/components/Placeholder/ClientComponentWrapper.js +5 -9
  14. package/dist/cjs/components/Placeholder/Placeholder.js +21 -93
  15. package/dist/cjs/components/Placeholder/index.js +1 -2
  16. package/dist/cjs/components/Placeholder/placeholder-utils.js +7 -35
  17. package/dist/cjs/components/RichText.js +18 -49
  18. package/dist/cjs/components/SitecoreProvider.js +81 -33
  19. package/dist/cjs/components/Text.js +12 -8
  20. package/dist/cjs/enhancers/withAppPlaceholder.js +6 -0
  21. package/dist/cjs/enhancers/withDatasourceCheck.js +4 -3
  22. package/dist/cjs/enhancers/withEditorChromes.js +50 -15
  23. package/dist/cjs/enhancers/withEmptyFieldEditingComponent.js +8 -38
  24. package/dist/cjs/enhancers/withFieldMetadata.js +9 -39
  25. package/dist/cjs/enhancers/withPlaceholder.js +16 -52
  26. package/dist/cjs/enhancers/withSitecore.js +5 -29
  27. package/dist/cjs/index.js +9 -7
  28. package/dist/cjs/search/utils.js +2 -2
  29. package/dist/esm/components/Date.js +13 -11
  30. package/dist/esm/components/DefaultEmptyFieldEditingComponents.js +2 -1
  31. package/dist/esm/components/DesignLibrary/DesignLibrary.js +5 -9
  32. package/dist/esm/components/DesignLibrary/DesignLibraryClientEvents.js +13 -5
  33. package/dist/esm/components/DesignLibrary/DesignLibraryServer.js +11 -5
  34. package/dist/esm/components/EditingScripts.js +2 -2
  35. package/dist/esm/components/ErrorBoundary.js +10 -6
  36. package/dist/esm/components/File.js +3 -1
  37. package/dist/esm/components/Form.js +11 -4
  38. package/dist/esm/components/Image.js +12 -9
  39. package/dist/esm/components/Link.js +16 -13
  40. package/dist/esm/components/Placeholder/AppPlaceholder.js +57 -59
  41. package/dist/esm/components/Placeholder/ClientComponentWrapper.js +4 -8
  42. package/dist/esm/components/Placeholder/Placeholder.js +20 -89
  43. package/dist/esm/components/Placeholder/index.js +1 -1
  44. package/dist/esm/components/Placeholder/placeholder-utils.js +5 -32
  45. package/dist/esm/components/RichText.js +15 -16
  46. package/dist/esm/components/SitecoreProvider.js +46 -32
  47. package/dist/esm/components/Text.js +12 -8
  48. package/dist/esm/enhancers/withAppPlaceholder.js +6 -0
  49. package/dist/esm/enhancers/withDatasourceCheck.js +3 -2
  50. package/dist/esm/enhancers/withEditorChromes.js +17 -12
  51. package/dist/esm/enhancers/withEmptyFieldEditingComponent.js +5 -5
  52. package/dist/esm/enhancers/withFieldMetadata.js +6 -6
  53. package/dist/esm/enhancers/withPlaceholder.js +15 -52
  54. package/dist/esm/enhancers/withSitecore.js +6 -29
  55. package/dist/esm/index.js +4 -3
  56. package/dist/esm/search/utils.js +1 -1
  57. package/package.json +5 -5
  58. package/types/components/Date.d.ts.map +1 -1
  59. package/types/components/DefaultEmptyFieldEditingComponents.d.ts.map +1 -1
  60. package/types/components/DesignLibrary/DesignLibrary.d.ts +0 -2
  61. package/types/components/DesignLibrary/DesignLibrary.d.ts.map +1 -1
  62. package/types/components/DesignLibrary/DesignLibraryClientEvents.d.ts.map +1 -1
  63. package/types/components/DesignLibrary/DesignLibraryServer.d.ts.map +1 -1
  64. package/types/components/DesignLibrary/models.d.ts +9 -3
  65. package/types/components/DesignLibrary/models.d.ts.map +1 -1
  66. package/types/components/EditingScripts.d.ts +2 -2
  67. package/types/components/EditingScripts.d.ts.map +1 -1
  68. package/types/components/ErrorBoundary.d.ts +2 -2
  69. package/types/components/ErrorBoundary.d.ts.map +1 -1
  70. package/types/components/File.d.ts.map +1 -1
  71. package/types/components/Form.d.ts.map +1 -1
  72. package/types/components/Image.d.ts.map +1 -1
  73. package/types/components/Link.d.ts.map +1 -1
  74. package/types/components/Placeholder/AppPlaceholder.d.ts +1 -1
  75. package/types/components/Placeholder/AppPlaceholder.d.ts.map +1 -1
  76. package/types/components/Placeholder/ClientComponentWrapper.d.ts +2 -2
  77. package/types/components/Placeholder/ClientComponentWrapper.d.ts.map +1 -1
  78. package/types/components/Placeholder/Placeholder.d.ts +4 -19
  79. package/types/components/Placeholder/Placeholder.d.ts.map +1 -1
  80. package/types/components/Placeholder/index.d.ts +1 -1
  81. package/types/components/Placeholder/index.d.ts.map +1 -1
  82. package/types/components/Placeholder/models.d.ts +35 -58
  83. package/types/components/Placeholder/models.d.ts.map +1 -1
  84. package/types/components/Placeholder/placeholder-utils.d.ts +5 -13
  85. package/types/components/Placeholder/placeholder-utils.d.ts.map +1 -1
  86. package/types/components/RichText.d.ts +2 -0
  87. package/types/components/RichText.d.ts.map +1 -1
  88. package/types/components/SitecoreProvider.d.ts +43 -13
  89. package/types/components/SitecoreProvider.d.ts.map +1 -1
  90. package/types/components/Text.d.ts.map +1 -1
  91. package/types/enhancers/withAppPlaceholder.d.ts +6 -0
  92. package/types/enhancers/withAppPlaceholder.d.ts.map +1 -1
  93. package/types/enhancers/withDatasourceCheck.d.ts.map +1 -1
  94. package/types/enhancers/withEditorChromes.d.ts +4 -1
  95. package/types/enhancers/withEditorChromes.d.ts.map +1 -1
  96. package/types/enhancers/withEmptyFieldEditingComponent.d.ts +5 -3
  97. package/types/enhancers/withEmptyFieldEditingComponent.d.ts.map +1 -1
  98. package/types/enhancers/withFieldMetadata.d.ts +4 -2
  99. package/types/enhancers/withFieldMetadata.d.ts.map +1 -1
  100. package/types/enhancers/withPlaceholder.d.ts +14 -32
  101. package/types/enhancers/withPlaceholder.d.ts.map +1 -1
  102. package/types/enhancers/withSitecore.d.ts +8 -50
  103. package/types/enhancers/withSitecore.d.ts.map +1 -1
  104. package/types/index.d.ts +4 -3
  105. package/types/index.d.ts.map +1 -1
  106. package/dist/cjs/enhancers/withComponentMap.js +0 -24
  107. package/dist/cjs/enhancers/withLoadImportMap.js +0 -62
  108. package/dist/esm/enhancers/withComponentMap.js +0 -18
  109. package/dist/esm/enhancers/withLoadImportMap.js +0 -25
  110. package/types/enhancers/withComponentMap.d.ts +0 -13
  111. package/types/enhancers/withComponentMap.d.ts.map +0 -1
  112. package/types/enhancers/withLoadImportMap.d.ts +0 -28
  113. package/types/enhancers/withLoadImportMap.d.ts.map +0 -1
@@ -1,5 +1,11 @@
1
1
  import React from 'react';
2
2
  import { AppPlaceholder } from '../components/Placeholder/AppPlaceholder';
3
+ /**
4
+ * Provides a slot-like functionality by wrapping a component and rendering placeholders defined in the layout data.
5
+ * @param {ComponentType<T>} Component - The component to be wrapped around placeholders.
6
+ * @returns {React.ReactNode} A new component that renders the original component with placeholders.
7
+ * @public
8
+ */
3
9
  export const withAppPlaceholder = (Component) => {
4
10
  return (props) => {
5
11
  const placeholders = props.rendering.placeholders || {};
@@ -1,5 +1,6 @@
1
+ 'use client';
1
2
  import React from 'react';
2
- import { useSitecore } from './withSitecore';
3
+ import { useSitecore } from './../components/SitecoreProvider';
3
4
  export const DefaultEditingError = () => (React.createElement("div", { className: "sc-jss-editing-error", role: "alert" }, "Datasource is required. Please choose a content item for this component."));
4
5
  /**
5
6
  * Checks whether a Sitecore datasource is present and renders appropriately depending on page mode (normal vs editing).
@@ -11,7 +12,7 @@ export const DefaultEditingError = () => (React.createElement("div", { className
11
12
  */
12
13
  export function withDatasourceCheck(options) {
13
14
  return function withDatasourceCheckHoc(Component) {
14
- return function WithDatasourceCheck(props) {
15
+ return (props) => {
15
16
  var _a, _b;
16
17
  const { page } = useSitecore();
17
18
  const EditingError = (_a = options === null || options === void 0 ? void 0 : options.editingErrorComponent) !== null && _a !== void 0 ? _a : DefaultEditingError;
@@ -1,4 +1,5 @@
1
- import React from 'react';
1
+ 'use client';
2
+ import React, { useEffect, useRef } from 'react';
2
3
  import { resetEditorChromes } from '..';
3
4
  /**
4
5
  * HOC to inject editor chromes reset on component update.
@@ -6,17 +7,21 @@ import { resetEditorChromes } from '..';
6
7
  * @public
7
8
  */
8
9
  export const withEditorChromes = (WrappedComponent) => {
9
- class Enhancer extends React.Component {
10
- constructor() {
11
- super(...arguments);
12
- this.displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
13
- }
14
- componentDidUpdate() {
10
+ const Enhancer = (props) => {
11
+ const isFirstRender = useRef(true);
12
+ useEffect(() => {
13
+ if (isFirstRender.current) {
14
+ isFirstRender.current = false;
15
+ return;
16
+ }
17
+ // only reset chromes on subsequent re-renders
15
18
  resetEditorChromes();
16
- }
17
- render() {
18
- return React.createElement(WrappedComponent, Object.assign({}, this.props));
19
- }
20
- }
19
+ });
20
+ return React.createElement(WrappedComponent, Object.assign({}, props));
21
+ };
22
+ Enhancer.displayName =
23
+ WrappedComponent.displayName ||
24
+ WrappedComponent.name ||
25
+ 'Component';
21
26
  return Enhancer;
22
27
  };
@@ -1,9 +1,9 @@
1
- import React, { forwardRef } from 'react';
1
+ import React from 'react';
2
2
  import { isFieldValueEmpty, } from '@sitecore-content-sdk/content/layout';
3
3
  /**
4
4
  * Returns the passed field component or default component in case field value is empty and edit mode is 'metadata'
5
5
  * @param {ComponentType<FieldComponentProps>} FieldComponent the field component
6
- * @param {WithEmptyFieldEditingComponentProps} options the options of the HOC;
6
+ * @param {WithEmptyFieldEditingComponentOptions} options the options of the HOC;
7
7
  * @public
8
8
  */
9
9
  export function withEmptyFieldEditingComponent(FieldComponent, options) {
@@ -23,10 +23,10 @@ export function withEmptyFieldEditingComponent(FieldComponent, options) {
23
23
  return null;
24
24
  };
25
25
  if (options.isForwardRef) {
26
- return forwardRef((props, ref) => {
26
+ return (props) => {
27
27
  const emptyFieldEditingComponent = getEmptyFieldEditingComponent(props);
28
- return (emptyFieldEditingComponent || (React.createElement(FieldComponent, Object.assign({}, props, { ref: ref }))));
29
- });
28
+ return (emptyFieldEditingComponent || React.createElement(FieldComponent, Object.assign({}, props)));
29
+ };
30
30
  }
31
31
  return (props) => {
32
32
  const emptyFieldEditingComponent = getEmptyFieldEditingComponent(props);
@@ -1,23 +1,23 @@
1
- import React, { forwardRef } from 'react';
1
+ import React from 'react';
2
2
  import { FieldMetadata } from '../components/FieldMetadata';
3
3
  /**
4
4
  * Wraps the field component with metadata markup intended to be used for chromes hydration in Pages
5
5
  * @param {ComponentType<FieldComponentProps>} FieldComponent the field component
6
- * @param {boolean} isForwardRef set to 'true' if forward reference is needed
6
+ * @param {boolean} isForwardRef set to 'true' if the ref prop should be explicitly accepted and forwarded
7
7
  * @public
8
8
  */
9
9
  export function withFieldMetadata(FieldComponent, isForwardRef = false) {
10
10
  if (isForwardRef) {
11
- return forwardRef((props, ref) => {
11
+ return (props) => {
12
12
  var _a;
13
13
  const { editable = true } = props;
14
14
  const metadata = (_a = props.field) === null || _a === void 0 ? void 0 : _a.metadata;
15
15
  if (!metadata || !editable) {
16
- return React.createElement(FieldComponent, Object.assign({}, props, { ref: ref }));
16
+ return React.createElement(FieldComponent, Object.assign({}, props));
17
17
  }
18
18
  return (React.createElement(FieldMetadata, { metadata: metadata },
19
- React.createElement(FieldComponent, Object.assign({}, props, { ref: ref }))));
20
- });
19
+ React.createElement(FieldComponent, Object.assign({}, props))));
20
+ };
21
21
  }
22
22
  return (props) => {
23
23
  var _a;
@@ -1,58 +1,21 @@
1
+ 'use client';
1
2
  import React from 'react';
2
- import { withComponentMap } from './withComponentMap';
3
- import { withSitecore } from './withSitecore';
4
- import { PlaceholderComponent, getPlaceholderRenderings, } from '../components/Placeholder';
5
- import { ErrorComponent } from '../components/ErrorBoundary';
3
+ import { Placeholder } from '../components/Placeholder';
6
4
  /**
7
- * HOC to provide client-side placeholder functionality to a component.
8
- * @param {WithPlaceholderSpec} placeholders
9
- * @param {WithPlaceholderOptions} [options]
5
+ * Provides a slot-like functionality by wrapping a component in client/SSR context and rendering placeholders defined in the layout data.
6
+ * @param {ComponentType<T>} Component - The component to be wrapped around placeholders.
7
+ * @returns {React.ReactNode} A new component that renders the original component with placeholders.
10
8
  * @public
11
9
  */
12
- export function withPlaceholder(placeholders, options) {
13
- return (WrappedComponent) => {
14
- class WithPlaceholder extends PlaceholderComponent {
15
- constructor(props) {
16
- super(props);
17
- }
18
- render() {
19
- let childProps = Object.assign({}, this.props);
20
- delete childProps.componentMap;
21
- if (options && options.propsTransformer) {
22
- childProps = options.propsTransformer(childProps);
23
- }
24
- if (this.state.error) {
25
- if (childProps.errorComponent) {
26
- return React.createElement(childProps.errorComponent, { error: this.state.error });
27
- }
28
- return (React.createElement(ErrorComponent, { message: `A rendering error occurred: ${this.state.error.message}.` }));
29
- }
30
- const renderingData = options && options.resolvePlaceholderDataFromProps
31
- ? options.resolvePlaceholderDataFromProps(childProps)
32
- : childProps.rendering;
33
- const definitelyArrayPlacholders = !Array.isArray(placeholders)
34
- ? [placeholders]
35
- : placeholders;
36
- definitelyArrayPlacholders.forEach((placeholder) => {
37
- let placeholderData;
38
- if (typeof placeholder !== 'string' && placeholder.placeholder && placeholder.prop) {
39
- placeholderData = getPlaceholderRenderings(renderingData, placeholder.placeholder, childProps.page.mode.isEditing);
40
- if (placeholderData) {
41
- childProps[placeholder.prop] =
42
- PlaceholderComponent.getRenderedComponents(this.props, placeholderData);
43
- }
44
- }
45
- else {
46
- placeholderData = getPlaceholderRenderings(renderingData, placeholder, childProps.page.mode.isEditing);
47
- if (placeholderData) {
48
- childProps[placeholder] =
49
- PlaceholderComponent.getRenderedComponents(this.props, placeholderData);
50
- }
51
- }
52
- });
53
- return React.createElement(WrappedComponent, Object.assign({}, childProps));
54
- }
10
+ export const withPlaceholder = (Component) => {
11
+ return (props) => {
12
+ const placeholders = props.rendering.placeholders || {};
13
+ const phProps = {};
14
+ for (const placeholder of Object.keys(placeholders)) {
15
+ phProps[placeholder] = (React.createElement(Placeholder, { name: placeholder, rendering: props.rendering, page: props.page, componentMap: props.componentMap }));
55
16
  }
56
- return withSitecore()(withComponentMap(WithPlaceholder));
17
+ const displayName = Component.displayName || Component.name || 'Component';
18
+ const propsCopy = Object.assign(Object.assign({}, props), { displayName });
19
+ return React.createElement(Component, Object.assign({}, propsCopy, { placeholders: phProps }));
57
20
  };
58
- }
21
+ };
@@ -1,40 +1,17 @@
1
1
  'use client';
2
2
  import React from 'react';
3
- import { SitecoreProviderReactContext, } from '../components/SitecoreProvider';
3
+ import { useSitecore, } from '../components/SitecoreProvider';
4
4
  /**
5
- * @param {WithSitecoreProviderOptions} [options]
5
+ * @deprecated `useSitecore` hook is a better practice for consuming Sitecore context in components
6
+ * @param {UseSitecoreOptions} [options] - Options for whether return page context update method alongside the rest of context
7
+ * @returns A higher-order component that injects Sitecore context into the wrapped component.
6
8
  * @public
7
9
  */
8
10
  export function withSitecore(options) {
9
11
  return function withSitecoreProviderHoc(Component) {
10
12
  return function WithSitecoreProvider(props) {
11
- return (React.createElement(SitecoreProviderReactContext.Consumer, null, (value) => (React.createElement(Component, Object.assign({}, props, { page: value.page, api: value.api, updatePage: options && options.updatable && value.setPage })))));
13
+ const scContext = useSitecore(options);
14
+ return (React.createElement(Component, Object.assign({}, props, { page: scContext.page, api: scContext.api, setPage: scContext.setPage, componentMap: scContext.componentMap, loadImportMap: scContext.loadImportMap })));
12
15
  };
13
16
  };
14
17
  }
15
- /**
16
- * This hook grants acсess to the current Sitecore page and api.
17
- * @param {WithSitecoreOptions} [options] hook options
18
- * @example
19
- * const EditMode = () => {
20
- * const { page } = useSitecore();
21
- * return <span>Edit Mode is {page.mode.isEditing ? 'active' : 'inactive'}</span>
22
- * }
23
- * @example
24
- * const EditMode = () => {
25
- * const { page, updatePage } = useSitecore({ updatable: true });
26
- * const onClick = () => updatePage({ itemId: '123' });
27
- * return <span onClick={onClick}>Item id is {page.itemId}</span>
28
- * }
29
- * @returns {object} { api, page, updatePage }
30
- * @public
31
- */
32
- export function useSitecore(options) {
33
- const reactContext = React.useContext(SitecoreProviderReactContext);
34
- const updatable = options === null || options === void 0 ? void 0 : options.updatable;
35
- return {
36
- api: reactContext.api,
37
- page: reactContext.page,
38
- updatePage: updatable ? reactContext.setPage : undefined,
39
- };
40
- }
package/dist/esm/index.js CHANGED
@@ -16,13 +16,14 @@ BYOCWrapper, BYOCWrapper as BYOCClientWrapper, FEaaSWrapper, FEaaSWrapper as FEa
16
16
  export { DesignLibrary, DesignLibraryApp } from './components/DesignLibrary';
17
17
  export { Link } from './components/Link';
18
18
  export { File } from './components/File';
19
- export { SitecoreProvider, SitecoreProviderReactContext, } from './components/SitecoreProvider';
20
- export { withSitecore, useSitecore, } from './enhancers/withSitecore';
19
+ export { SitecoreProvider, SitecoreProviderReactContext, useSitecore, } from './components/SitecoreProvider';
21
20
  export { withEditorChromes } from './enhancers/withEditorChromes';
22
- export { withPlaceholder } from './enhancers/withPlaceholder';
21
+ export { withSitecore } from './enhancers/withSitecore';
23
22
  export { withDatasourceCheck } from './enhancers/withDatasourceCheck';
24
23
  export { withFieldMetadata } from './enhancers/withFieldMetadata';
25
24
  export { withEmptyFieldEditingComponent } from './enhancers/withEmptyFieldEditingComponent';
25
+ export { withAppPlaceholder } from './enhancers/withAppPlaceholder';
26
+ export { withPlaceholder } from './enhancers/withPlaceholder';
26
27
  export { EditingScripts } from './components/EditingScripts';
27
28
  export { DefaultEmptyFieldEditingComponentText, DefaultEmptyFieldEditingComponentImage, } from './components/DefaultEmptyFieldEditingComponents';
28
29
  export { ClientEditingChromesUpdate } from './components/ClientEditingChromesUpdate';
@@ -1,6 +1,6 @@
1
1
  import { SearchService } from '@sitecore-content-sdk/search';
2
2
  import { useMemo } from 'react';
3
- import { useSitecore } from '../enhancers/withSitecore';
3
+ import { useSitecore } from '../components/SitecoreProvider';
4
4
  export const DEFAULT_PAGE_SIZE = 10;
5
5
  /**
6
6
  * Hook to initialize and manage SearchService.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitecore-content-sdk/react",
3
- "version": "2.0.0-canary.1",
3
+ "version": "2.0.0-canary.10",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "sideEffects": false,
@@ -76,14 +76,14 @@
76
76
  "react-dom": "^19.2.1"
77
77
  },
78
78
  "dependencies": {
79
- "@sitecore-content-sdk/content": "2.0.0-canary.1",
80
- "@sitecore-content-sdk/core": "2.0.0-canary.1",
81
- "@sitecore-content-sdk/search": "0.2.0-canary.11",
79
+ "@sitecore-content-sdk/content": "2.0.0-canary.10",
80
+ "@sitecore-content-sdk/core": "2.0.0-canary.10",
81
+ "@sitecore-content-sdk/search": "0.2.0-canary.20",
82
82
  "fast-deep-equal": "^3.1.3"
83
83
  },
84
84
  "description": "",
85
85
  "types": "types/index.d.ts",
86
- "gitHead": "b457ff6e0b17787c66803a15b50da0d3ad6e4200",
86
+ "gitHead": "6246e4787e22778e64c90bcd9292a9988b3552a8",
87
87
  "files": [
88
88
  "dist",
89
89
  "types",
@@ -1 +1 @@
1
- {"version":3,"file":"Date.d.ts","sourceRoot":"","sources":["../../src/components/Date.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,aAAa,EAAqB,MAAM,sCAAsC,CAAC;AAExF;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,kBAAkB,CAAC,cAAc,CAAC;IACxE,2BAA2B;IAC3B,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,KAAK,EAAE,aAAa,GAAG;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,KAAK,CAAC,SAAS,CAAC;CACjD;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA+B9C,CAAC"}
1
+ {"version":3,"file":"Date.d.ts","sourceRoot":"","sources":["../../src/components/Date.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,aAAa,EAAqB,MAAM,sCAAsC,CAAC;AAExF;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,kBAAkB,CAAC,cAAc,CAAC;IACxE,2BAA2B;IAC3B,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,KAAK,EAAE,aAAa,GAAG;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,KAAK,CAAC,SAAS,CAAC;CACjD;AAwBD;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAI9C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultEmptyFieldEditingComponents.d.ts","sourceRoot":"","sources":["../../src/components/DefaultEmptyFieldEditingComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,EAAE,KAAK,CAAC,EAAE,CAAC;IAC3D,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAMA,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5D,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAmBA,CAAC"}
1
+ {"version":3,"file":"DefaultEmptyFieldEditingComponents.d.ts","sourceRoot":"","sources":["../../src/components/DefaultEmptyFieldEditingComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,EAAE,KAAK,CAAC,EAAE,CAAC;IAC3D,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAOA,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5D,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAmBA,CAAC"}
@@ -7,8 +7,6 @@ export declare const __mockDependencies: (mocks: any) => void;
7
7
  * when generation is enabled (`page.mode.designLibrary.isVariantGeneration === true`),
8
8
  * wires the **variant generation** handshake so the parent (DL Studio) can send
9
9
  * generated code to preview and iterate on.
10
- * @param {DesignLibraryProps} props
11
- * @param {() => Promise} [props.loadImportMap] Optional async loader that resolves to the import-map used to resolve the generated component’s imports. Required when `isVariantGeneration` is true.
12
10
  * @returns {JSX.Element} The preview surface, or `null` when not in Design Library mode.
13
11
  * @public
14
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"DesignLibrary.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/DesignLibrary.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA8B,MAAM,OAAO,CAAC;AA2BnD,eAAO,MAAM,kBAAkB,GAAI,OAAO,GAAG,SAQ5C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,gCA6HzB,CAAC"}
1
+ {"version":3,"file":"DesignLibrary.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/DesignLibrary.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA8B,MAAM,OAAO,CAAC;AA0BnD,eAAO,MAAM,kBAAkB,GAAI,OAAO,GAAG,SAQ5C,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,gCA4HzB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DesignLibraryClientEvents.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/DesignLibraryClientEvents.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAOzC,OAAO,EACL,+BAA+B,EAC/B,yCAAyC,EAC1C,MAAM,UAAU,CAAC;AAclB,eAAO,MAAM,kBAAkB,GAAI,OAAO,GAAG,SAU5C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GAAI,qCAGxC,+BAA+B,sBAgBjC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,oCAAoC,GAAI,4FAMlD,yCAAyC,sBAyD3C,CAAC"}
1
+ {"version":3,"file":"DesignLibraryClientEvents.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/DesignLibraryClientEvents.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAOzC,OAAO,EACL,+BAA+B,EAC/B,yCAAyC,EAC1C,MAAM,UAAU,CAAC;AAclB,eAAO,MAAM,kBAAkB,GAAI,OAAO,GAAG,SAU5C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GAAI,qCAGxC,+BAA+B,sBAgBjC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,oCAAoC,GAAI,4FAMlD,yCAAyC,sBA6D3C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DesignLibraryServer.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/DesignLibraryServer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B,OAAO,EAEL,wBAAwB,EACxB,+BAA+B,EAC/B,yCAAyC,EAC1C,MAAM,UAAU,CAAC;AAOlB,eAAO,MAAM,kBAAkB,GAAU,OAAO,GAAG,kBAUlD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,GAAU,yDAKvC,wBAAwB,sCAoB1B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,oCAAoC,GAAU,yDAKxD,yCAAyC,+BA6G3C,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,GAAU,oCAI9C,+BAA+B,+BAsCjC,CAAC"}
1
+ {"version":3,"file":"DesignLibraryServer.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/DesignLibraryServer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B,OAAO,EAEL,wBAAwB,EACxB,+BAA+B,EAC/B,yCAAyC,EAE1C,MAAM,UAAU,CAAC;AAOlB,eAAO,MAAM,kBAAkB,GAAU,OAAO,GAAG,kBAUlD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,GAAU,yDAKvC,wBAAwB,sCAoB1B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,oCAAoC,GAAU,yDAKxD,yCAAyC,+BAsI3C,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,GAAU,oCAI9C,+BAA+B,+BAsCjC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { GeneratedComponentData, ImportEntry, ImportEntryInfo } from '@sitecore-content-sdk/content/codegen';
1
+ import { DesignLibraryPreviewError, GeneratedComponentData, ImportEntry, ImportEntryInfo } from '@sitecore-content-sdk/content/codegen';
2
2
  import { ComponentFields, ComponentParams, ComponentRendering, RouteData } from '@sitecore-content-sdk/content/layout';
3
3
  import { DesignLibraryStatus } from '@sitecore-content-sdk/content/editing';
4
4
  import { Page } from '@sitecore-content-sdk/content/client';
@@ -51,12 +51,18 @@ export type DesignLibraryVariantGenerationEventsProps = DesignLibraryPreviewEven
51
51
  * Any error that occurred during initialization of the component:
52
52
  * - importMap error
53
53
  * - error fetching the generated component data from secured endpoint
54
- * - error during generation of the component on the server side
54
+ * - error during generation or rendering of the component on the server side
55
55
  */
56
- componentInitError?: string;
56
+ componentInitError?: ServerComponentInitError;
57
57
  /**
58
58
  * The generated component data received from design library.
59
59
  */
60
60
  generatedComponentData?: GeneratedComponentData;
61
61
  };
62
+ export type ServerComponentInitError = {
63
+ /** The type of error, as defined in DesignLibraryPreviewError. */
64
+ type: DesignLibraryPreviewError;
65
+ /** The error message. */
66
+ message: string;
67
+ };
62
68
  //# 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,CA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,9 +1,9 @@
1
- import { JSX } from 'react';
1
+ import React from 'react';
2
2
  /**
3
3
  * Renders client scripts and data for editing/preview mode for Pages.
4
4
  * Renders script required for the Design Library (when mode.isDesignLibrary is true).
5
5
  * @returns A JSX element containing the editing scripts or an empty fragment if not in editing/preview mode.
6
6
  * @public
7
7
  */
8
- export declare const EditingScripts: () => JSX.Element;
8
+ export declare const EditingScripts: () => React.JSX.Element;
9
9
  //# sourceMappingURL=EditingScripts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditingScripts.d.ts","sourceRoot":"","sources":["../../src/components/EditingScripts.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAInC;;;;;GAKG;AACH,eAAO,MAAM,cAAc,QAAO,GAAG,CAAC,OA+CrC,CAAC"}
1
+ {"version":3,"file":"EditingScripts.d.ts","sourceRoot":"","sources":["../../src/components/EditingScripts.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B;;;;;GAKG;AACH,eAAO,MAAM,cAAc,yBA+C1B,CAAC"}
@@ -24,6 +24,6 @@ export declare const ErrorComponent: (props: {
24
24
  children: React.ReactNode;
25
25
  message?: never;
26
26
  }) => React.JSX.Element;
27
- declare const _default: (props: import("@sitecore-content-sdk/core/tools").EnhancedOmit<ErrorBoundaryProps, keyof import("../enhancers/withSitecore").WithSitecoreProps>) => React.JSX.Element;
28
- export default _default;
27
+ declare const ErrorBoundary: (props: Omit<ErrorBoundaryProps, "page">) => React.JSX.Element;
28
+ export default ErrorBoundary;
29
29
  //# sourceMappingURL=ErrorBoundary.d.ts.map
@@ -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;A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AK,CAAC,EAAE,CAAC,SAAS,CAoBpC,CAAC"}
1
+ {"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../src/components/File.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,cAAc;IAC7B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,cAAc,CAAC;CACvB;AAED,MAAM,WAAW,SAAS;IACxB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,2BAA2B;IAC3B,KAAK,EAAE,cAAc,GAAG,SAAS,CAAC;IAClC,uEAAuE;IACvE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;GAIG;AACH,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA0BpC,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,sBAwDpD,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;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 +1 @@
1
- {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/components/Image.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAGrE;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;CAEd;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC5C,+BAA+B;IAC/B,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,CA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AAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,cAAc,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,kBAAkB,CAAC,SAAS,CAAC,GACnD,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,GAC7C,aAAa,CAAC,iBAAiB,CAAC,GAAG;IACjC,2BAA2B;IAC3B,KAAK,EAAE,CAAC,SAAS,GAAG,cAAc,CAAC,GAAG,aAAa,CAAC;IAEpD;;OAEG;IACH,+BAA+B,CAAC,EAAE,OAAO,CAAC;CAC3C,CAAC;AAkDJ;;;;GAIG;AACH,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAIpC,CAAC"}
@@ -8,5 +8,5 @@ import React from 'react';
8
8
  * @returns {React.ReactNode | React.ReactElement[]} rendered component(s)
9
9
  * @public
10
10
  */
11
- export declare const AppPlaceholder: (props: AppPlaceholderProps) => string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | (string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined)[] | null | undefined;
11
+ export declare const AppPlaceholder: (props: AppPlaceholderProps) => React.JSX.Element;
12
12
  //# sourceMappingURL=AppPlaceholder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppPlaceholder.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/AppPlaceholder.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAO/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,0kBAyHxD,CAAC"}
1
+ {"version":3,"file":"AppPlaceholder.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/AppPlaceholder.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAO/C,OAAO,KAAK,MAAM,OAAO,CAAC;AA4I1B;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,sBAKxD,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { ComponentRendering } from '@sitecore-content-sdk/content/layout';
2
2
  import React from 'react';
3
- import { AppComponentProps } from './models';
3
+ import { ChildComponentProps } from './models';
4
4
  export interface ClientComponentWrapperProps {
5
5
  rendering: ComponentRendering;
6
- componentProps: AppComponentProps;
6
+ componentProps: ChildComponentProps;
7
7
  placeholderName: string;
8
8
  }
9
9
  export declare const ClientComponentWrapper: (props: ClientComponentWrapperProps) => React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"ClientComponentWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/ClientComponentWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,kBAAkB,CAAC;IAC9B,cAAc,EAAE,iBAAiB,CAAC;IAClC,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,sBAAsB,GAAI,OAAO,2BAA2B,sBAexE,CAAC"}
1
+ {"version":3,"file":"ClientComponentWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/ClientComponentWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,kBAAkB,CAAC;IAC9B,cAAc,EAAE,mBAAmB,CAAC;IACpC,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,sBAAsB,GAAI,OAAO,2BAA2B,sBAcxE,CAAC"}
@@ -1,26 +1,11 @@
1
1
  import React from 'react';
2
2
  import { PlaceholderProps } from './models';
3
- import { ComponentRendering } from '@sitecore-content-sdk/content/layout';
4
- export declare class PlaceholderComponent extends React.Component<PlaceholderProps> {
5
- isEmpty: boolean;
6
- state: Readonly<{
7
- error?: Error;
8
- }>;
9
- constructor(props: PlaceholderProps);
10
- /**
11
- * Renders the components for the placeholder based on the provided rendering data.
12
- * @param {PlaceholderProps} props placeholder component props
13
- * @param {ComponentRendering[]} placeholderRenderings renderings within placeholder
14
- * @returns {React.ReactNode | React.ReactElement[]} rendered components
15
- */
16
- static getRenderedComponents: (props: PlaceholderProps, placeholderRenderings: ComponentRendering[]) => React.JSX.Element[];
17
- componentDidMount(): void;
18
- componentDidCatch(error: Error): void;
19
- render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | (string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined)[] | null | undefined;
20
- }
21
3
  /**
22
4
  * The Placeholder component.
5
+ * Renders the components assigned to a placeholder in Sitecore. It also supports custom rendering and empty state.
6
+ * @param {PlaceholderProps} props - The props for the Placeholder component.
7
+ * @returns The rendered Placeholder component.
23
8
  * @public
24
9
  */
25
- export declare const Placeholder: (props: import("@sitecore-content-sdk/core/tools").EnhancedOmit<PlaceholderProps, keyof import("../../enhancers/withSitecore").WithSitecoreProps>) => React.JSX.Element;
10
+ export declare const Placeholder: (props: PlaceholderProps) => React.JSX.Element;
26
11
  //# sourceMappingURL=Placeholder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Placeholder.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/Placeholder.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAU5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAI1E,qBAAa,oBAAqB,SAAQ,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC;IACzE,OAAO,UAAS;IAChB,KAAK,EAAE,QAAQ,CAAC;QAAE,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC;gBAEvB,KAAK,EAAE,gBAAgB;IAKnC;;;;;OAKG;IACH,MAAM,CAAC,qBAAqB,GAC1B,OAAO,gBAAgB,EACvB,uBAAuB,kBAAkB,EAAE,yBAoE3C;IAEF,iBAAiB;IAMjB,iBAAiB,CAAC,KAAK,EAAE,KAAK;IAI9B,MAAM;CAkDP;AAID;;;GAGG;AACH,eAAO,MAAM,WAAW,yKAA8C,CAAC"}
1
+ {"version":3,"file":"Placeholder.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/Placeholder.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAM5C;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,sBAkBlD,CAAC"}
@@ -1,4 +1,4 @@
1
- export { Placeholder, PlaceholderComponent } from './Placeholder';
1
+ export { Placeholder } from './Placeholder';
2
2
  export { PlaceholderMetadata } from './PlaceholderMetadata';
3
3
  export { PlaceholderProps, AppPlaceholderProps } from './models';
4
4
  export { AppPlaceholder } from './AppPlaceholder';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,cAAc,qBAAqB,CAAC"}