@sitecore-content-sdk/react 2.0.0-canary.2 → 2.0.0-canary.4
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/Date.js +13 -11
- package/dist/cjs/components/DefaultEmptyFieldEditingComponents.js +2 -1
- package/dist/cjs/components/DesignLibrary/DesignLibrary.js +3 -7
- package/dist/cjs/components/DesignLibrary/DesignLibraryClientEvents.js +13 -5
- package/dist/cjs/components/EditingScripts.js +2 -2
- package/dist/cjs/components/ErrorBoundary.js +8 -3
- package/dist/cjs/components/File.js +3 -1
- package/dist/cjs/components/Form.js +12 -5
- package/dist/cjs/components/Image.js +12 -9
- package/dist/cjs/components/Link.js +19 -46
- package/dist/cjs/components/Placeholder/AppPlaceholder.js +57 -58
- package/dist/cjs/components/Placeholder/ClientComponentWrapper.js +5 -9
- package/dist/cjs/components/Placeholder/Placeholder.js +21 -93
- package/dist/cjs/components/Placeholder/index.js +1 -2
- package/dist/cjs/components/Placeholder/placeholder-utils.js +7 -35
- package/dist/cjs/components/RichText.js +18 -49
- package/dist/cjs/components/SitecoreProvider.js +81 -33
- package/dist/cjs/components/Text.js +12 -8
- package/dist/cjs/enhancers/withAppPlaceholder.js +6 -0
- package/dist/cjs/enhancers/withDatasourceCheck.js +4 -3
- package/dist/cjs/enhancers/withEditorChromes.js +50 -15
- package/dist/cjs/enhancers/withEmptyFieldEditingComponent.js +8 -38
- package/dist/cjs/enhancers/withFieldMetadata.js +9 -39
- package/dist/cjs/enhancers/withPlaceholder.js +16 -52
- package/dist/cjs/enhancers/withSitecore.js +5 -29
- package/dist/cjs/index.js +9 -7
- package/dist/cjs/search/utils.js +2 -2
- package/dist/esm/components/Date.js +13 -11
- package/dist/esm/components/DefaultEmptyFieldEditingComponents.js +2 -1
- package/dist/esm/components/DesignLibrary/DesignLibrary.js +3 -7
- package/dist/esm/components/DesignLibrary/DesignLibraryClientEvents.js +12 -4
- package/dist/esm/components/EditingScripts.js +2 -2
- package/dist/esm/components/ErrorBoundary.js +8 -3
- package/dist/esm/components/File.js +3 -1
- package/dist/esm/components/Form.js +11 -4
- package/dist/esm/components/Image.js +12 -9
- package/dist/esm/components/Link.js +16 -13
- package/dist/esm/components/Placeholder/AppPlaceholder.js +58 -59
- package/dist/esm/components/Placeholder/ClientComponentWrapper.js +4 -8
- package/dist/esm/components/Placeholder/Placeholder.js +20 -89
- package/dist/esm/components/Placeholder/index.js +1 -1
- package/dist/esm/components/Placeholder/placeholder-utils.js +5 -32
- package/dist/esm/components/RichText.js +15 -16
- package/dist/esm/components/SitecoreProvider.js +46 -32
- package/dist/esm/components/Text.js +12 -8
- package/dist/esm/enhancers/withAppPlaceholder.js +6 -0
- package/dist/esm/enhancers/withDatasourceCheck.js +3 -2
- package/dist/esm/enhancers/withEditorChromes.js +17 -12
- package/dist/esm/enhancers/withEmptyFieldEditingComponent.js +5 -5
- package/dist/esm/enhancers/withFieldMetadata.js +6 -6
- package/dist/esm/enhancers/withPlaceholder.js +15 -52
- package/dist/esm/enhancers/withSitecore.js +6 -29
- package/dist/esm/index.js +4 -3
- package/dist/esm/search/utils.js +1 -1
- package/package.json +5 -5
- package/types/components/Date.d.ts.map +1 -1
- package/types/components/DefaultEmptyFieldEditingComponents.d.ts.map +1 -1
- package/types/components/DesignLibrary/DesignLibrary.d.ts +0 -2
- package/types/components/DesignLibrary/DesignLibrary.d.ts.map +1 -1
- package/types/components/DesignLibrary/DesignLibraryClientEvents.d.ts.map +1 -1
- package/types/components/EditingScripts.d.ts +2 -2
- package/types/components/EditingScripts.d.ts.map +1 -1
- package/types/components/ErrorBoundary.d.ts +2 -2
- package/types/components/ErrorBoundary.d.ts.map +1 -1
- package/types/components/File.d.ts.map +1 -1
- package/types/components/Form.d.ts.map +1 -1
- package/types/components/Image.d.ts.map +1 -1
- package/types/components/Link.d.ts.map +1 -1
- package/types/components/Placeholder/AppPlaceholder.d.ts +1 -1
- package/types/components/Placeholder/AppPlaceholder.d.ts.map +1 -1
- package/types/components/Placeholder/ClientComponentWrapper.d.ts +2 -2
- package/types/components/Placeholder/ClientComponentWrapper.d.ts.map +1 -1
- package/types/components/Placeholder/Placeholder.d.ts +4 -19
- package/types/components/Placeholder/Placeholder.d.ts.map +1 -1
- package/types/components/Placeholder/index.d.ts +1 -1
- package/types/components/Placeholder/index.d.ts.map +1 -1
- package/types/components/Placeholder/models.d.ts +30 -56
- package/types/components/Placeholder/models.d.ts.map +1 -1
- package/types/components/Placeholder/placeholder-utils.d.ts +5 -13
- package/types/components/Placeholder/placeholder-utils.d.ts.map +1 -1
- package/types/components/RichText.d.ts +2 -0
- package/types/components/RichText.d.ts.map +1 -1
- package/types/components/SitecoreProvider.d.ts +43 -13
- package/types/components/SitecoreProvider.d.ts.map +1 -1
- package/types/components/Text.d.ts.map +1 -1
- package/types/enhancers/withAppPlaceholder.d.ts +6 -0
- package/types/enhancers/withAppPlaceholder.d.ts.map +1 -1
- package/types/enhancers/withDatasourceCheck.d.ts.map +1 -1
- package/types/enhancers/withEditorChromes.d.ts +4 -1
- package/types/enhancers/withEditorChromes.d.ts.map +1 -1
- package/types/enhancers/withEmptyFieldEditingComponent.d.ts +5 -3
- package/types/enhancers/withEmptyFieldEditingComponent.d.ts.map +1 -1
- package/types/enhancers/withFieldMetadata.d.ts +4 -2
- package/types/enhancers/withFieldMetadata.d.ts.map +1 -1
- package/types/enhancers/withPlaceholder.d.ts +14 -32
- package/types/enhancers/withPlaceholder.d.ts.map +1 -1
- package/types/enhancers/withSitecore.d.ts +8 -50
- package/types/enhancers/withSitecore.d.ts.map +1 -1
- package/types/index.d.ts +4 -3
- package/types/index.d.ts.map +1 -1
- package/dist/cjs/enhancers/withComponentMap.js +0 -24
- package/dist/cjs/enhancers/withLoadImportMap.js +0 -62
- package/dist/esm/enhancers/withComponentMap.js +0 -18
- package/dist/esm/enhancers/withLoadImportMap.js +0 -25
- package/types/enhancers/withComponentMap.d.ts +0 -13
- package/types/enhancers/withComponentMap.d.ts.map +0 -1
- package/types/enhancers/withLoadImportMap.d.ts +0 -28
- package/types/enhancers/withLoadImportMap.d.ts.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import 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 {
|
|
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
|
|
26
|
+
return (props) => {
|
|
27
27
|
const emptyFieldEditingComponent = getEmptyFieldEditingComponent(props);
|
|
28
|
-
return (emptyFieldEditingComponent ||
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 {
|
|
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
|
-
*
|
|
8
|
-
* @param {
|
|
9
|
-
* @
|
|
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
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
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 {
|
|
3
|
+
import { useSitecore, } from '../components/SitecoreProvider';
|
|
4
4
|
/**
|
|
5
|
-
* @
|
|
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
|
-
|
|
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 {
|
|
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';
|
package/dist/esm/search/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SearchService } from '@sitecore-content-sdk/search';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import { useSitecore } from '../
|
|
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.
|
|
3
|
+
"version": "2.0.0-canary.4",
|
|
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.
|
|
80
|
-
"@sitecore-content-sdk/core": "2.0.0-canary.
|
|
81
|
-
"@sitecore-content-sdk/search": "0.2.0-canary.
|
|
79
|
+
"@sitecore-content-sdk/content": "2.0.0-canary.4",
|
|
80
|
+
"@sitecore-content-sdk/core": "2.0.0-canary.4",
|
|
81
|
+
"@sitecore-content-sdk/search": "0.2.0-canary.14",
|
|
82
82
|
"fast-deep-equal": "^3.1.3"
|
|
83
83
|
},
|
|
84
84
|
"description": "",
|
|
85
85
|
"types": "types/index.d.ts",
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "5c49b45ca02bc2f418f6018a2221ca69199e21be",
|
|
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;
|
|
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,
|
|
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;
|
|
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,
|
|
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,sBAiE3C,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
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,
|
|
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
|
|
28
|
-
export 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;AAC5D,O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CAAC,EAAE,CAAC,SAAS,
|
|
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,
|
|
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":"
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/components/Image.tsx"],"names":[],"mappings":"AACA,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,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,6BAA6B;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8BAA8B;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,0BAA0B;IAC1B,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACZ,oBAAoB;IACpB,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACX,mCAAmC;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,kBAAkB,CAAC,UAAU,CAAC;IAChE,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,2DAA2D;IAC3D,KAAK,CAAC,EAAE,CAAC,UAAU,GAAG,eAAe,CAAC,GAAG,aAAa,CAAC;IAEvD;;OAEG;IACH,WAAW,CAAC,EAAE;QACZ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;KACtC,CAAC;IAEF,MAAM,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE/B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CAGzB;AAsED;;;;GAIG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAItC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/components/Link.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/components/Link.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAqB,MAAM,sCAAsC,CAAC;AAIxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;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) =>
|
|
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;
|
|
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;AA6I1B;;;;;;;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 {
|
|
3
|
+
import { ChildComponentProps } from './models';
|
|
4
4
|
export interface ClientComponentWrapperProps {
|
|
5
5
|
rendering: ComponentRendering;
|
|
6
|
-
componentProps:
|
|
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;
|
|
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:
|
|
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,
|
|
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
|
|
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,
|
|
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"}
|
|
@@ -6,21 +6,11 @@ export type { ComponentType };
|
|
|
6
6
|
type ErrorComponentProps = {
|
|
7
7
|
[prop: string]: unknown;
|
|
8
8
|
};
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export interface AppComponentProps {
|
|
15
|
-
fields: {
|
|
16
|
-
[name: string]: Field | Item | Item[];
|
|
17
|
-
};
|
|
18
|
-
params: {
|
|
19
|
-
[name: string]: string;
|
|
20
|
-
};
|
|
21
|
-
rendering: ComponentRendering;
|
|
22
|
-
}
|
|
23
|
-
export interface BasePlaceholderProps {
|
|
9
|
+
/**
|
|
10
|
+
* Base Placeholder props
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export interface PlaceholderProps {
|
|
24
14
|
/** Name of the placeholder to render. */
|
|
25
15
|
name: string;
|
|
26
16
|
/** Rendering data to be used when rendering the placeholder. */
|
|
@@ -57,7 +47,7 @@ export interface BasePlaceholderProps {
|
|
|
57
47
|
* Page data.
|
|
58
48
|
* This data is passed by the SitecoreProvider.
|
|
59
49
|
*/
|
|
60
|
-
page
|
|
50
|
+
page?: Page;
|
|
61
51
|
/**
|
|
62
52
|
* The message that gets displayed while component is loading
|
|
63
53
|
*/
|
|
@@ -76,66 +66,50 @@ export interface BasePlaceholderProps {
|
|
|
76
66
|
* Mutually exclusive with `render`.
|
|
77
67
|
*/
|
|
78
68
|
renderEach?: (component: React.ReactNode, index: number) => React.ReactNode;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* The interface for the Placeholder component props.
|
|
82
|
-
* @public
|
|
83
|
-
*/
|
|
84
|
-
export interface PlaceholderProps extends BasePlaceholderProps {
|
|
85
|
-
[key: string]: unknown;
|
|
86
69
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* When rendered as a server placeholder, this prop must be provided. This prop is not used in AppPlaceholder.
|
|
70
|
+
* Render props function that enables control over the rendering of the components in the placeholder.
|
|
71
|
+
* Useful for techniques like wrapping each child in a wrapper component.
|
|
90
72
|
*/
|
|
91
|
-
|
|
73
|
+
render?: (components: React.ReactNode[], data: ComponentRendering[], props: PlaceholderProps) => React.ReactNode;
|
|
92
74
|
/**
|
|
93
75
|
* Modify final props of component (before render) provided by rendering data.
|
|
94
76
|
* Can be used in case when you need to insert additional data into the component.
|
|
95
|
-
* @param {
|
|
96
|
-
* @returns {
|
|
77
|
+
* @param {ChildComponentProps} componentProps component props to be modified
|
|
78
|
+
* @returns {ChildComponentProps} modified or initial props
|
|
97
79
|
*/
|
|
98
|
-
modifyComponentProps?: (componentProps:
|
|
80
|
+
modifyComponentProps?: (componentProps: ChildComponentProps) => ChildComponentProps;
|
|
99
81
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
82
|
+
* An alternative to `modifyComponentProps` that allows passing additional props to the component without modifying the CSDK Placeholder props from Sitecore.
|
|
83
|
+
* These props will be merged into the result of modifyComponentProps if you use both
|
|
84
|
+
* Make sure to not include non-serializable props here in RSC server context https://react.dev/reference/rsc/use-server#serializable-parameters-and-return-values
|
|
102
85
|
*/
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
* The interface for the AppPlaceholder component props.
|
|
107
|
-
* @public
|
|
108
|
-
*/
|
|
109
|
-
export interface AppPlaceholderProps extends BasePlaceholderProps {
|
|
86
|
+
passThroughComponentProps?: {
|
|
87
|
+
[key: string]: unknown;
|
|
88
|
+
};
|
|
110
89
|
/**
|
|
111
90
|
* Component Map will be used to map Sitecore component names to app implementation
|
|
112
91
|
* When rendered within a <SitecoreProvider> component, defaults to the context componentMap.
|
|
113
92
|
* When rendered as a server placeholder, this prop must be provided. This prop is not used in AppPlaceholder.
|
|
114
93
|
*/
|
|
115
|
-
componentMap
|
|
116
|
-
/**
|
|
117
|
-
* Modify final props of component (before render) provided by rendering data.
|
|
118
|
-
* Can be used in case when you need to insert additional data into the component.
|
|
119
|
-
* @param {AppComponentProps} componentProps component props to be modified
|
|
120
|
-
* @returns {AppComponentProps} modified or initial props
|
|
121
|
-
*/
|
|
122
|
-
modifyComponentProps?: (componentProps: AppComponentProps) => AppComponentProps;
|
|
123
|
-
/**
|
|
124
|
-
* Render props function that enables control over the rendering of the components in the placeholder.
|
|
125
|
-
* Useful for techniques like wrapping each child in a wrapper component.
|
|
126
|
-
*/
|
|
127
|
-
render?: (components: React.ReactNode[], data: ComponentRendering[], props: AppPlaceholderProps) => React.ReactNode;
|
|
94
|
+
componentMap?: ComponentMap;
|
|
128
95
|
}
|
|
129
|
-
|
|
96
|
+
/**
|
|
97
|
+
* The interface for the AppPlaceholder server-side component props.
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
100
|
+
export type AppPlaceholderProps = Omit<PlaceholderProps, 'componentMap' | 'page'> & Required<Pick<PlaceholderProps, 'componentMap' | 'page'>>;
|
|
101
|
+
export type RenderedProps = ChildComponentProps & {
|
|
130
102
|
key: string;
|
|
103
|
+
};
|
|
104
|
+
export interface ChildComponentProps {
|
|
131
105
|
fields: {
|
|
132
|
-
[
|
|
106
|
+
[name: string]: Field | Item | Item[];
|
|
133
107
|
};
|
|
134
108
|
params: {
|
|
135
|
-
[
|
|
109
|
+
[name: string]: string;
|
|
136
110
|
};
|
|
137
111
|
rendering: ComponentRendering;
|
|
138
|
-
}
|
|
112
|
+
}
|
|
139
113
|
export interface ComponentForRendering {
|
|
140
114
|
component: React.ComponentType<any>;
|
|
141
115
|
isEmpty: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,sCAA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AG;IAChD,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE;QACN,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC;KACvC,CAAC;IACF,MAAM,EAAE;QACN,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;KACxB,CAAC;IACF,SAAS,EAAE,kBAAkB,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED;;GAEG;AACH,eAAO,MAAM,6BAA6B,+LAWK,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ComponentMap } from '../sharedTypes';
|
|
3
3
|
import { ComponentRendering, RouteData } from '@sitecore-content-sdk/content/layout';
|
|
4
|
-
import {
|
|
4
|
+
import { ChildComponentProps, PlaceholderProps, ComponentForRendering } from './models';
|
|
5
5
|
/**
|
|
6
|
-
* Get the renderings for the specified placeholder from the rendering data.
|
|
6
|
+
* Get the renderings for the specified placeholder from the rendering layout data.
|
|
7
7
|
* @param {ComponentRendering | RouteData } rendering rendering data
|
|
8
8
|
* @param {string} name placeholder name
|
|
9
9
|
* @param {boolean} isEditing whether components should be rendered in editing mode
|
|
@@ -26,20 +26,12 @@ export declare const getSXAParams: (rendering: ComponentRendering) => "" | {
|
|
|
26
26
|
*/
|
|
27
27
|
export declare const renderEmptyPlaceholder: (node: React.ReactNode | React.ReactElement[]) => React.JSX.Element;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
* @param {PlaceholderProps} placeholderProps
|
|
31
|
-
* @param {ComponentRendering} componentRendering rendering to be rendered
|
|
32
|
-
* @param {string} renderingKey unique key to pass over to rendering props
|
|
33
|
-
* @returns {RenderedProps} props to be passed to the rendered component
|
|
34
|
-
*/
|
|
35
|
-
export declare const getRenderedComponentProps: (placeholderProps: PlaceholderProps, componentRendering: ComponentRendering, renderingKey: string) => RenderedProps;
|
|
36
|
-
/**
|
|
37
|
-
* Merge placeholder and component field and params content props.
|
|
38
|
-
* @param {BasePlaceholderProps} placeholderProps placeholder props
|
|
29
|
+
* Merge specific placeholder props with component field and params content props.
|
|
30
|
+
* @param {PlaceholderProps} placeholderProps placeholder props
|
|
39
31
|
* @param {ComponentRendering} componentRendering component rendering
|
|
40
32
|
* @returns {ComponentProps} merged props
|
|
41
33
|
*/
|
|
42
|
-
export declare function
|
|
34
|
+
export declare function getChildComponentProps<T extends PlaceholderProps>(placeholderProps: T, componentRendering: ComponentRendering): ChildComponentProps;
|
|
43
35
|
/**
|
|
44
36
|
* Get component implemenation from the component map based on the rendering definition.
|
|
45
37
|
* @param {ComponentRendering} renderingDefinition rendering data
|