@sitecore-content-sdk/react 1.3.0-canary.9 → 1.4.0-canary.2
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/README.md +11 -11
- package/dist/cjs/components/ClientEditingChromesUpdate.js +53 -52
- package/dist/cjs/components/Date.js +49 -45
- package/dist/cjs/components/DefaultEmptyFieldEditingComponents.js +32 -22
- package/dist/cjs/components/{DesignLibrary.js → DesignLibrary/DesignLibrary.js} +161 -202
- package/dist/cjs/components/DesignLibrary/DesignLibraryApp.js +31 -0
- package/dist/cjs/components/DesignLibrary/DesignLibraryClientEvents.js +123 -0
- package/dist/cjs/components/DesignLibrary/DesignLibraryErrorBoundary.js +65 -0
- package/dist/cjs/components/DesignLibrary/DesignLibraryServer.js +193 -0
- package/dist/cjs/components/DesignLibrary/index.js +7 -0
- package/dist/cjs/components/DesignLibrary/models.js +2 -0
- package/dist/cjs/components/EditingScripts.js +44 -43
- package/dist/cjs/components/ErrorBoundary.js +101 -92
- package/dist/cjs/components/FEaaS/BYOCServerWrapper.js +25 -28
- package/dist/cjs/components/FEaaS/BYOCWrapper.js +133 -122
- package/dist/cjs/components/FEaaS/FEaaSSeverWrapper.js +26 -34
- package/dist/cjs/components/FEaaS/FEaaSWrapper.js +84 -78
- package/dist/cjs/components/FEaaS/feaas-utils.js +130 -144
- package/dist/cjs/components/FEaaS/index.js +21 -21
- package/dist/cjs/components/FEaaS/models.js +7 -7
- package/dist/cjs/components/FieldMetadata.js +29 -29
- package/dist/cjs/components/File.js +43 -38
- package/dist/cjs/components/Form.js +100 -92
- package/dist/cjs/components/HiddenRendering.js +23 -23
- package/dist/cjs/components/Image.js +71 -66
- package/dist/cjs/components/Link.js +91 -86
- package/dist/cjs/components/MissingComponent.js +28 -28
- package/dist/cjs/components/Placeholder/AppPlaceholder.js +79 -76
- package/dist/cjs/components/Placeholder/ClientComponentWrapper.js +21 -21
- package/dist/cjs/components/Placeholder/Placeholder.js +144 -110
- package/dist/cjs/components/Placeholder/PlaceholderMetadata.js +68 -63
- package/dist/cjs/components/Placeholder/index.js +25 -25
- package/dist/cjs/components/Placeholder/models.js +18 -18
- package/dist/cjs/components/Placeholder/placeholder-utils.js +226 -226
- package/dist/cjs/components/RichText.js +75 -70
- package/dist/cjs/components/SitecoreProvider.js +62 -52
- package/dist/cjs/components/Text.js +69 -65
- package/dist/cjs/components/sharedTypes/components.js +7 -7
- package/dist/cjs/components/sharedTypes/index.js +18 -18
- package/dist/cjs/components/sharedTypes/props.js +2 -2
- package/dist/cjs/enhancers/withAppPlaceholder.js +21 -21
- package/dist/cjs/enhancers/withComponentMap.js +24 -24
- package/dist/cjs/enhancers/withDatasourceCheck.js +31 -30
- package/dist/cjs/enhancers/withEditorChromes.js +29 -24
- package/dist/cjs/enhancers/withEmptyFieldEditingComponent.js +71 -70
- package/dist/cjs/enhancers/withFieldMetadata.js +68 -67
- package/dist/cjs/enhancers/withLoadImportMap.js +53 -0
- package/dist/cjs/enhancers/withPlaceholder.js +64 -65
- package/dist/cjs/enhancers/withSitecore.js +47 -45
- package/dist/cjs/index.js +86 -85
- package/dist/cjs/rsc-utils/no-rsc.js +5 -5
- package/dist/cjs/rsc-utils/rsc.js +5 -5
- package/dist/cjs/search/index.js +7 -0
- package/dist/cjs/search/useInfiniteSearch.js +136 -0
- package/dist/cjs/search/useSearch.js +107 -0
- package/dist/cjs/search/utils.js +35 -0
- package/dist/cjs/server-actions/update-server-component-action.js +18 -0
- package/dist/cjs/utils.js +38 -38
- package/dist/esm/components/ClientEditingChromesUpdate.js +16 -15
- package/dist/esm/components/Date.js +43 -39
- package/dist/esm/components/DefaultEmptyFieldEditingComponents.js +24 -14
- package/dist/esm/components/{DesignLibrary.js → DesignLibrary/DesignLibrary.js} +124 -164
- package/dist/esm/components/DesignLibrary/DesignLibraryApp.js +24 -0
- package/dist/esm/components/DesignLibrary/DesignLibraryClientEvents.js +84 -0
- package/dist/esm/components/DesignLibrary/DesignLibraryErrorBoundary.js +28 -0
- package/dist/esm/components/DesignLibrary/DesignLibraryServer.js +150 -0
- package/dist/esm/components/DesignLibrary/index.js +2 -0
- package/dist/esm/components/DesignLibrary/models.js +1 -0
- package/dist/esm/components/EditingScripts.js +37 -36
- package/dist/esm/components/ErrorBoundary.js +64 -57
- package/dist/esm/components/FEaaS/BYOCServerWrapper.js +18 -21
- package/dist/esm/components/FEaaS/BYOCWrapper.js +91 -81
- package/dist/esm/components/FEaaS/FEaaSSeverWrapper.js +19 -27
- package/dist/esm/components/FEaaS/FEaaSWrapper.js +43 -37
- package/dist/esm/components/FEaaS/feaas-utils.js +91 -105
- package/dist/esm/components/FEaaS/index.js +6 -6
- package/dist/esm/components/FEaaS/models.js +4 -4
- package/dist/esm/components/FieldMetadata.js +22 -22
- package/dist/esm/components/File.js +36 -31
- package/dist/esm/components/Form.js +62 -54
- package/dist/esm/components/HiddenRendering.js +16 -16
- package/dist/esm/components/Image.js +65 -60
- package/dist/esm/components/Link.js +55 -50
- package/dist/esm/components/MissingComponent.js +21 -21
- package/dist/esm/components/Placeholder/AppPlaceholder.js +72 -69
- package/dist/esm/components/Placeholder/ClientComponentWrapper.js +14 -14
- package/dist/esm/components/Placeholder/Placeholder.js +104 -103
- package/dist/esm/components/Placeholder/PlaceholderMetadata.js +61 -56
- package/dist/esm/components/Placeholder/index.js +4 -4
- package/dist/esm/components/Placeholder/models.js +15 -15
- package/dist/esm/components/Placeholder/placeholder-utils.js +214 -214
- package/dist/esm/components/RichText.js +39 -34
- package/dist/esm/components/SitecoreProvider.js +55 -45
- package/dist/esm/components/Text.js +63 -59
- package/dist/esm/components/sharedTypes/components.js +4 -4
- package/dist/esm/components/sharedTypes/index.js +2 -2
- package/dist/esm/components/sharedTypes/props.js +1 -1
- package/dist/esm/enhancers/withAppPlaceholder.js +14 -14
- package/dist/esm/enhancers/withComponentMap.js +18 -18
- package/dist/esm/enhancers/withDatasourceCheck.js +23 -22
- package/dist/esm/enhancers/withEditorChromes.js +22 -17
- package/dist/esm/enhancers/withEmptyFieldEditingComponent.js +35 -34
- package/dist/esm/enhancers/withFieldMetadata.js +32 -31
- package/dist/esm/enhancers/withLoadImportMap.js +17 -0
- package/dist/esm/enhancers/withPlaceholder.js +58 -59
- package/dist/esm/enhancers/withSitecore.js +40 -38
- package/dist/esm/index.js +29 -29
- package/dist/esm/rsc-utils/no-rsc.js +2 -2
- package/dist/esm/rsc-utils/rsc.js +2 -2
- package/dist/esm/search/index.js +2 -0
- package/dist/esm/search/useInfiniteSearch.js +132 -0
- package/dist/esm/search/useSearch.js +103 -0
- package/dist/esm/search/utils.js +30 -0
- package/dist/esm/server-actions/update-server-component-action.js +15 -0
- package/dist/esm/utils.js +33 -33
- package/global.d.ts +17 -0
- package/package.json +27 -11
- package/search.d.ts +1 -0
- package/types/components/ClientEditingChromesUpdate.d.ts +8 -6
- package/types/components/ClientEditingChromesUpdate.d.ts.map +1 -0
- package/types/components/Date.d.ts +25 -16
- package/types/components/Date.d.ts.map +1 -0
- package/types/components/DefaultEmptyFieldEditingComponents.d.ts +20 -9
- package/types/components/DefaultEmptyFieldEditingComponents.d.ts.map +1 -0
- package/types/components/DesignLibrary/DesignLibrary.d.ts +20 -0
- package/types/components/DesignLibrary/DesignLibrary.d.ts.map +1 -0
- package/types/components/DesignLibrary/DesignLibraryApp.d.ts +14 -0
- package/types/components/DesignLibrary/DesignLibraryApp.d.ts.map +1 -0
- package/types/components/DesignLibrary/DesignLibraryClientEvents.d.ts +21 -0
- package/types/components/DesignLibrary/DesignLibraryClientEvents.d.ts.map +1 -0
- package/types/components/DesignLibrary/DesignLibraryErrorBoundary.d.ts +19 -0
- package/types/components/DesignLibrary/DesignLibraryErrorBoundary.d.ts.map +1 -0
- package/types/components/DesignLibrary/DesignLibraryServer.d.ts +38 -0
- package/types/components/DesignLibrary/DesignLibraryServer.d.ts.map +1 -0
- package/types/components/DesignLibrary/index.d.ts +3 -0
- package/types/components/DesignLibrary/index.d.ts.map +1 -0
- package/types/components/DesignLibrary/models.d.ts +67 -0
- package/types/components/DesignLibrary/models.d.ts.map +1 -0
- package/types/components/EditingScripts.d.ts +9 -7
- package/types/components/EditingScripts.d.ts.map +1 -0
- package/types/components/ErrorBoundary.d.ts +29 -17
- package/types/components/ErrorBoundary.d.ts.map +1 -0
- package/types/components/FEaaS/BYOCServerWrapper.d.ts +10 -3
- package/types/components/FEaaS/BYOCServerWrapper.d.ts.map +1 -0
- package/types/components/FEaaS/BYOCWrapper.d.ts +29 -25
- package/types/components/FEaaS/BYOCWrapper.d.ts.map +1 -0
- package/types/components/FEaaS/FEaaSSeverWrapper.d.ts +10 -8
- package/types/components/FEaaS/FEaaSSeverWrapper.d.ts.map +1 -0
- package/types/components/FEaaS/FEaaSWrapper.d.ts +14 -7
- package/types/components/FEaaS/FEaaSWrapper.d.ts.map +1 -0
- package/types/components/FEaaS/feaas-utils.d.ts +24 -21
- package/types/components/FEaaS/feaas-utils.d.ts.map +1 -0
- package/types/components/FEaaS/index.d.ts +7 -6
- package/types/components/FEaaS/index.d.ts.map +1 -0
- package/types/components/FEaaS/models.d.ts +136 -125
- package/types/components/FEaaS/models.d.ts.map +1 -0
- package/types/components/FieldMetadata.d.ts +18 -17
- package/types/components/FieldMetadata.d.ts.map +1 -0
- package/types/components/File.d.ts +28 -18
- package/types/components/File.d.ts.map +1 -0
- package/types/components/Form.d.ts +35 -29
- package/types/components/Form.d.ts.map +1 -0
- package/types/components/HiddenRendering.d.ts +3 -2
- package/types/components/HiddenRendering.d.ts.map +1 -0
- package/types/components/Image.d.ts +70 -48
- package/types/components/Image.d.ts.map +1 -0
- package/types/components/Link.d.ts +45 -27
- package/types/components/Link.d.ts.map +1 -0
- package/types/components/MissingComponent.d.ts +9 -8
- package/types/components/MissingComponent.d.ts.map +1 -0
- package/types/components/Placeholder/AppPlaceholder.d.ts +12 -10
- package/types/components/Placeholder/AppPlaceholder.d.ts.map +1 -0
- package/types/components/Placeholder/ClientComponentWrapper.d.ts +10 -9
- package/types/components/Placeholder/ClientComponentWrapper.d.ts.map +1 -0
- package/types/components/Placeholder/Placeholder.d.ts +33 -28
- package/types/components/Placeholder/Placeholder.d.ts.map +1 -0
- package/types/components/Placeholder/PlaceholderMetadata.d.ts +35 -28
- package/types/components/Placeholder/PlaceholderMetadata.d.ts.map +1 -0
- package/types/components/Placeholder/index.d.ts +6 -5
- package/types/components/Placeholder/index.d.ts.map +1 -0
- package/types/components/Placeholder/models.d.ts +149 -140
- package/types/components/Placeholder/models.d.ts.map +1 -0
- package/types/components/Placeholder/placeholder-utils.d.ts +52 -53
- package/types/components/Placeholder/placeholder-utils.d.ts.map +1 -0
- package/types/components/RichText.d.ts +31 -17
- package/types/components/RichText.d.ts.map +1 -0
- package/types/components/SitecoreProvider.d.ts +68 -48
- package/types/components/SitecoreProvider.d.ts.map +1 -0
- package/types/components/Text.d.ts +29 -20
- package/types/components/Text.d.ts.map +1 -0
- package/types/components/sharedTypes/components.d.ts +50 -38
- package/types/components/sharedTypes/components.d.ts.map +1 -0
- package/types/components/sharedTypes/index.d.ts +3 -2
- package/types/components/sharedTypes/index.d.ts.map +1 -0
- package/types/components/sharedTypes/props.d.ts +15 -14
- package/types/components/sharedTypes/props.d.ts.map +1 -0
- package/types/enhancers/withAppPlaceholder.d.ts +16 -15
- package/types/enhancers/withAppPlaceholder.d.ts.map +1 -0
- package/types/enhancers/withComponentMap.d.ts +13 -12
- package/types/enhancers/withComponentMap.d.ts.map +1 -0
- package/types/enhancers/withDatasourceCheck.d.ts +23 -21
- package/types/enhancers/withDatasourceCheck.d.ts.map +1 -0
- package/types/enhancers/withEditorChromes.d.ts +8 -2
- package/types/enhancers/withEditorChromes.d.ts.map +1 -0
- package/types/enhancers/withEmptyFieldEditingComponent.d.ts +29 -27
- package/types/enhancers/withEmptyFieldEditingComponent.d.ts.map +1 -0
- package/types/enhancers/withFieldMetadata.d.ts +18 -16
- package/types/enhancers/withFieldMetadata.d.ts.map +1 -0
- package/types/enhancers/withLoadImportMap.d.ts +22 -0
- package/types/enhancers/withLoadImportMap.d.ts.map +1 -0
- package/types/enhancers/withPlaceholder.d.ts +37 -35
- package/types/enhancers/withPlaceholder.d.ts.map +1 -0
- package/types/enhancers/withSitecore.d.ts +63 -48
- package/types/enhancers/withSitecore.d.ts.map +1 -0
- package/types/index.d.ts +31 -30
- package/types/index.d.ts.map +1 -0
- package/types/rsc-utils/no-rsc.d.ts +2 -1
- package/types/rsc-utils/no-rsc.d.ts.map +1 -0
- package/types/rsc-utils/rsc.d.ts +2 -1
- package/types/rsc-utils/rsc.d.ts.map +1 -0
- package/types/search/index.d.ts +4 -0
- package/types/search/index.d.ts.map +1 -0
- package/types/search/useInfiniteSearch.d.ts +116 -0
- package/types/search/useInfiniteSearch.d.ts.map +1 -0
- package/types/search/useSearch.d.ts +107 -0
- package/types/search/useSearch.d.ts.map +1 -0
- package/types/search/utils.d.ts +19 -0
- package/types/search/utils.d.ts.map +1 -0
- package/types/server-actions/update-server-component-action.d.ts +25 -0
- package/types/server-actions/update-server-component-action.d.ts.map +1 -0
- package/types/utils.d.ts +18 -17
- package/types/utils.d.ts.map +1 -0
- package/types/components/DesignLibrary.d.ts +0 -26
|
@@ -1,53 +1,52 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentMap } from '../sharedTypes';
|
|
3
|
-
import { ComponentRendering, RouteData } from '@sitecore-content-sdk/core/layout';
|
|
4
|
-
import { AppComponentProps, BasePlaceholderProps, ComponentForRendering, PlaceholderProps, RenderedProps } from './models';
|
|
5
|
-
/**
|
|
6
|
-
* Get the renderings for the specified placeholder from the rendering data.
|
|
7
|
-
* @param {ComponentRendering | RouteData } rendering rendering data
|
|
8
|
-
* @param {string} name placeholder name
|
|
9
|
-
* @param {boolean} isEditing whether components should be rendered in editing mode
|
|
10
|
-
* @returns {ComponentRendering[]} array of component renderings
|
|
11
|
-
*/
|
|
12
|
-
export declare const getPlaceholderRenderings: (rendering: ComponentRendering | RouteData, name: string, isEditing: boolean) => ComponentRendering<import("@sitecore-content-sdk/core/layout").ComponentFields>[];
|
|
13
|
-
/**
|
|
14
|
-
* Get SXA specific params from Sitecore rendering params
|
|
15
|
-
* @param {ComponentRendering} rendering rendering object
|
|
16
|
-
* @returns {object} converted SXA params
|
|
17
|
-
*/
|
|
18
|
-
export declare const getSXAParams: (rendering: ComponentRendering) => {
|
|
19
|
-
styles
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
*
|
|
31
|
-
* @param {
|
|
32
|
-
* @
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*
|
|
39
|
-
* @
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
*
|
|
46
|
-
* @param {
|
|
47
|
-
* @param {
|
|
48
|
-
* @param {
|
|
49
|
-
* @
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
export declare const getComponentForRendering: (renderingDefinition: ComponentRendering, placeholderName: string, componentMap?: ComponentMap, hiddenRenderingComponent?: React.ComponentClass | React.FC, missingComponentComponent?: React.ComponentClass | React.FC) => ComponentForRendering;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentMap } from '../sharedTypes';
|
|
3
|
+
import { ComponentRendering, RouteData } from '@sitecore-content-sdk/core/layout';
|
|
4
|
+
import { AppComponentProps, BasePlaceholderProps, ComponentForRendering, PlaceholderProps, RenderedProps } from './models';
|
|
5
|
+
/**
|
|
6
|
+
* Get the renderings for the specified placeholder from the rendering data.
|
|
7
|
+
* @param {ComponentRendering | RouteData } rendering rendering data
|
|
8
|
+
* @param {string} name placeholder name
|
|
9
|
+
* @param {boolean} isEditing whether components should be rendered in editing mode
|
|
10
|
+
* @returns {ComponentRendering[]} array of component renderings
|
|
11
|
+
*/
|
|
12
|
+
export declare const getPlaceholderRenderings: (rendering: ComponentRendering | RouteData, name: string, isEditing: boolean) => ComponentRendering<import("@sitecore-content-sdk/core/layout").ComponentFields>[];
|
|
13
|
+
/**
|
|
14
|
+
* Get SXA specific params from Sitecore rendering params
|
|
15
|
+
* @param {ComponentRendering} rendering rendering object
|
|
16
|
+
* @returns {object} converted SXA params
|
|
17
|
+
*/
|
|
18
|
+
export declare const getSXAParams: (rendering: ComponentRendering) => "" | {
|
|
19
|
+
styles: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Renders the placeholder when it is empty. The required CSS styles are applied to the placeholder in edit mode.
|
|
23
|
+
* @param {React.ReactNode | React.ReactElement[]} node react node
|
|
24
|
+
* @returns react node
|
|
25
|
+
*/
|
|
26
|
+
export declare const renderEmptyPlaceholder: (node: React.ReactNode | React.ReactElement[]) => React.JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* Get component props to be passed to the rendered component.
|
|
29
|
+
* @param {PlaceholderProps} placeholderProps current placeholder props
|
|
30
|
+
* @param {ComponentRendering} componentRendering rendering to be rendered
|
|
31
|
+
* @param {string} renderingKey unique key to pass over to rendering props
|
|
32
|
+
* @returns {RenderedProps} props to be passed to the rendered component
|
|
33
|
+
*/
|
|
34
|
+
export declare const getRenderedComponentProps: (placeholderProps: PlaceholderProps, componentRendering: ComponentRendering, renderingKey: string) => RenderedProps;
|
|
35
|
+
/**
|
|
36
|
+
* Merge placeholder and component field and params content props.
|
|
37
|
+
* @param {BasePlaceholderProps} placeholderProps placeholder props
|
|
38
|
+
* @param {ComponentRendering} componentRendering component rendering
|
|
39
|
+
* @returns {ComponentProps} merged props
|
|
40
|
+
*/
|
|
41
|
+
export declare function getAppComponentProps<T extends BasePlaceholderProps>(placeholderProps: T, componentRendering: ComponentRendering): AppComponentProps;
|
|
42
|
+
/**
|
|
43
|
+
* Get component implemenation from the component map based on the rendering definition.
|
|
44
|
+
* @param {ComponentRendering} renderingDefinition rendering data
|
|
45
|
+
* @param {string} placeholderName name of current placeholder
|
|
46
|
+
* @param {ComponentMap} componentMap component map for the current app
|
|
47
|
+
* @param {React.ComponentClass} [hiddenRenderingComponent] fallback implementation in to be rendered if the rendering is hidden
|
|
48
|
+
* @param {React.ComponentClass} [missingComponentComponent] fallback implementation in case no component is found in the component map
|
|
49
|
+
* @returns {ContentSDKComponet | null} component implementation or null if no component map is provided
|
|
50
|
+
*/
|
|
51
|
+
export declare const getComponentForRendering: (renderingDefinition: ComponentRendering, placeholderName: string, componentMap?: ComponentMap, hiddenRenderingComponent?: React.ComponentClass | React.FC, missingComponentComponent?: React.ComponentClass | React.FC) => ComponentForRendering;
|
|
52
|
+
//# sourceMappingURL=placeholder-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder-utils.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/placeholder-utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAuD,MAAM,gBAAgB,CAAC;AACnG,OAAO,EACL,kBAAkB,EAClB,SAAS,EAGV,MAAM,mCAAmC,CAAC;AAa3C,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACd,MAAM,UAAU,CAAC;AAElB;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACnC,WAAW,kBAAkB,GAAG,SAAS,EACzC,MAAM,MAAM,EACZ,WAAW,OAAO,sFA2CnB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,WAAW,kBAAkB;;CAUzD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,MAAM,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,YAAY,EAAE,sBAElF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GACpC,kBAAkB,gBAAgB,EAClC,oBAAoB,kBAAkB,EACtC,cAAc,MAAM,KACnB,aAeF,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,oBAAoB,EACjE,gBAAgB,EAAE,CAAC,EACnB,kBAAkB,EAAE,kBAAkB,GACrC,iBAAiB,CAYnB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GACnC,qBAAqB,kBAAkB,EACvC,iBAAiB,MAAM,EACvB,eAAe,YAAY,EAC3B,2BAA2B,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,EAAE,EAC1D,4BAA4B,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,EAAE,KAC1D,qBA0GF,CAAC"}
|
|
@@ -1,17 +1,31 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { EditableFieldProps } from './sharedTypes';
|
|
3
|
-
import { FieldMetadata } from '@sitecore-content-sdk/core/layout';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditableFieldProps } from './sharedTypes';
|
|
3
|
+
import { FieldMetadata } from '@sitecore-content-sdk/core/layout';
|
|
4
|
+
/**
|
|
5
|
+
* The interface for the RichText field.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface RichTextField extends FieldMetadata {
|
|
9
|
+
value?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The interface for the RichText component props.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export interface RichTextProps extends EditableFieldProps<RichTextProps> {
|
|
16
|
+
[htmlAttributes: string]: unknown;
|
|
17
|
+
/** The rich text field data. */
|
|
18
|
+
field?: RichTextField;
|
|
19
|
+
/**
|
|
20
|
+
* The HTML element that will wrap the contents of the field.
|
|
21
|
+
* @default <div />
|
|
22
|
+
*/
|
|
23
|
+
tag?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The RichText component.
|
|
27
|
+
* @param {RichTextProps} props component props
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export declare const RichText: React.FC<RichTextProps>;
|
|
31
|
+
//# sourceMappingURL=RichText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichText.d.ts","sourceRoot":"","sources":["../../src/components/RichText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAIxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,aAAa,EAAqB,MAAM,mCAAmC,CAAC;AAErF;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,kBAAkB,CAAC,aAAa,CAAC;IACtE,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,gCAAgC;IAChC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA0B5C,CAAC"}
|
|
@@ -1,48 +1,68 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Page } from '@sitecore-content-sdk/core/client';
|
|
3
|
-
import { SitecoreConfig } from '@sitecore-content-sdk/core/config';
|
|
4
|
-
import { ComponentMap } from './sharedTypes';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Page } from '@sitecore-content-sdk/core/client';
|
|
3
|
+
import { SitecoreConfig } from '@sitecore-content-sdk/core/config';
|
|
4
|
+
import { ComponentMap } from './sharedTypes';
|
|
5
|
+
import { ImportMapImport } from './DesignLibrary/models';
|
|
6
|
+
export interface SitecoreProviderProps {
|
|
7
|
+
/**
|
|
8
|
+
* The API configuration defined in the `SitecoreConfig`.
|
|
9
|
+
*/
|
|
10
|
+
api: SitecoreConfig['api'];
|
|
11
|
+
/**
|
|
12
|
+
* The component map to use for rendering components.
|
|
13
|
+
*/
|
|
14
|
+
componentMap: ComponentMap;
|
|
15
|
+
/**
|
|
16
|
+
* The page data.
|
|
17
|
+
*/
|
|
18
|
+
page: Page;
|
|
19
|
+
/**
|
|
20
|
+
* The dynamic import for import map to be used in variant generation mode.
|
|
21
|
+
* Currently it's optional but it will be required in the next major version.
|
|
22
|
+
*/
|
|
23
|
+
loadImportMap?: () => Promise<ImportMapImport>;
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The state for the SitecoreProvider component.
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export interface SitecoreProviderState {
|
|
31
|
+
/**
|
|
32
|
+
* Method to set the page.
|
|
33
|
+
* @param {Page} value New page value.
|
|
34
|
+
* @returns {void}
|
|
35
|
+
*/
|
|
36
|
+
setPage: (value: Page) => void;
|
|
37
|
+
/**
|
|
38
|
+
* The current page.
|
|
39
|
+
*/
|
|
40
|
+
page: Page;
|
|
41
|
+
/**
|
|
42
|
+
* The API configuration defined in the `SitecoreConfig`.
|
|
43
|
+
*/
|
|
44
|
+
api?: SitecoreProviderProps['api'];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The context for the SitecoreProvider component.
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
export declare const SitecoreProviderReactContext: React.Context<SitecoreProviderState>;
|
|
51
|
+
export declare const ComponentMapReactContext: React.Context<ComponentMap>;
|
|
52
|
+
export declare const ImportMapReactContext: React.Context<(() => Promise<ImportMapImport>) | undefined>;
|
|
53
|
+
/**
|
|
54
|
+
* The SitecoreProvider component.
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
export declare class SitecoreProvider extends React.Component<SitecoreProviderProps, SitecoreProviderState> {
|
|
58
|
+
static displayName: string;
|
|
59
|
+
constructor(props: SitecoreProviderProps);
|
|
60
|
+
componentDidUpdate(prevProps: SitecoreProviderProps): void;
|
|
61
|
+
/**
|
|
62
|
+
* Update page state.
|
|
63
|
+
* @param {Page} value New page value
|
|
64
|
+
*/
|
|
65
|
+
setPage: (value: Page) => void;
|
|
66
|
+
render(): React.JSX.Element;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=SitecoreProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SitecoreProvider.d.ts","sourceRoot":"","sources":["../../src/components/SitecoreProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,GAAG,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;IAC3B;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC;IAC3B;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;IAE/C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;IAC/B;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;OAEG;IACH,GAAG,CAAC,EAAE,qBAAqB,CAAC,KAAK,CAAC,CAAC;CACpC;AAED;;;GAGG;AACH,eAAO,MAAM,4BAA4B,sCAExC,CAAC;AAEF,eAAO,MAAM,wBAAwB,6BAA+C,CAAC;AAErF,eAAO,MAAM,qBAAqB,uBACzB,OAAO,CAAC,eAAe,CAAC,cACrB,CAAC;AAEb;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,KAAK,CAAC,SAAS,CACnD,qBAAqB,EACrB,qBAAqB,CACtB;IACC,MAAM,CAAC,WAAW,SAAsB;gBAE5B,KAAK,EAAE,qBAAqB;IAyBxC,kBAAkB,CAAC,SAAS,EAAE,qBAAqB;IAUnD;;;OAGG;IACH,OAAO,GAAI,OAAO,IAAI,UAIpB;IAEF,MAAM;CAWP"}
|
|
@@ -1,20 +1,29 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { EditableFieldProps } from './sharedTypes';
|
|
3
|
-
import { FieldMetadata } from '@sitecore-content-sdk/core/layout';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditableFieldProps } from './sharedTypes';
|
|
3
|
+
import { FieldMetadata } from '@sitecore-content-sdk/core/layout';
|
|
4
|
+
/**
|
|
5
|
+
* The interface for the Text field.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface TextField extends FieldMetadata {
|
|
9
|
+
value?: string | number;
|
|
10
|
+
}
|
|
11
|
+
export interface TextProps extends EditableFieldProps<TextProps> {
|
|
12
|
+
[htmlAttributes: string]: unknown;
|
|
13
|
+
/** The text field data. */
|
|
14
|
+
field?: TextField;
|
|
15
|
+
/**
|
|
16
|
+
* The HTML element that will wrap the contents of the field.
|
|
17
|
+
*/
|
|
18
|
+
tag?: string;
|
|
19
|
+
/**
|
|
20
|
+
* If false, HTML-encoding of the field value is disabled and the value is rendered as-is.
|
|
21
|
+
*/
|
|
22
|
+
encode?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The Text component.
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export declare const Text: React.FC<TextProps>;
|
|
29
|
+
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/components/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAI5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,aAAa,EAAqB,MAAM,mCAAmC,CAAC;AAErF;;;GAGG;AACH,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,SAAU,SAAQ,kBAAkB,CAAC,SAAS,CAAC;IAC9D,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,2BAA2B;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA2DpC,CAAC"}
|
|
@@ -1,38 +1,50 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* React component import with account for custom exports
|
|
4
|
-
*/
|
|
5
|
-
export type ReactJssComponent = (ComponentType | ReactModule) & {
|
|
6
|
-
isClient?: boolean;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* SXA uses custom default export name
|
|
10
|
-
*/
|
|
11
|
-
export declare const DEFAULT_EXPORT_NAME = "Default";
|
|
12
|
-
/**
|
|
13
|
-
* React component import with account for custom exports
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export type
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* React component import with account for custom exports
|
|
4
|
+
*/
|
|
5
|
+
export type ReactJssComponent = (ComponentType | ReactModule) & {
|
|
6
|
+
isClient?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* SXA uses custom default export name
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_EXPORT_NAME = "Default";
|
|
12
|
+
/**
|
|
13
|
+
* React component import with account for custom exports
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export type ReactContentSdkComponent = (ComponentType | ReactModule) & {
|
|
17
|
+
componentType?: 'server' | 'client' | 'universal';
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The type of the React module.
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export type ReactModule = {
|
|
24
|
+
/**
|
|
25
|
+
* Custom exports
|
|
26
|
+
*/
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
/**
|
|
29
|
+
* Default module export
|
|
30
|
+
*/
|
|
31
|
+
Default?: ComponentType;
|
|
32
|
+
/**
|
|
33
|
+
* Default non-standard export
|
|
34
|
+
*/
|
|
35
|
+
default?: ComponentType;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Component type returned from component builder / factory
|
|
39
|
+
*/
|
|
40
|
+
export type LazyComponentType = ComponentType & {
|
|
41
|
+
render?: {
|
|
42
|
+
[key: string]: unknown;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The type of the component map.
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
export type ComponentMap<TComponent extends ReactContentSdkComponent = ReactContentSdkComponent> = Map<string, TComponent>;
|
|
50
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/components/sharedTypes/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,aAAa,GAAG,WAAW,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEvF;;GAEG;AACH,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,aAAa,GAAG,WAAW,CAAC,GAAG;IACrE,aAAa,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;CACnD,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAG9C,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACrC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,YAAY,CAAC,UAAU,SAAS,wBAAwB,GAAG,wBAAwB,IAC7F,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * from './components';
|
|
2
|
-
export * from './props';
|
|
1
|
+
export * from './components';
|
|
2
|
+
export * from './props';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/sharedTypes/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared editing field props
|
|
3
|
-
*/
|
|
4
|
-
export interface EditableFieldProps<EmptyFieldEditingComponentProps = unknown> {
|
|
5
|
-
/**
|
|
6
|
-
* Can be used to explicitly disable inline editing.
|
|
7
|
-
* @default true
|
|
8
|
-
*/
|
|
9
|
-
editable?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Custom element to render in Pages in edit mode if field value is empty
|
|
12
|
-
*/
|
|
13
|
-
emptyFieldEditingComponent?: React.ComponentClass<EmptyFieldEditingComponentProps> | React.FC<EmptyFieldEditingComponentProps>;
|
|
14
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Shared editing field props
|
|
3
|
+
*/
|
|
4
|
+
export interface EditableFieldProps<EmptyFieldEditingComponentProps = unknown> {
|
|
5
|
+
/**
|
|
6
|
+
* Can be used to explicitly disable inline editing.
|
|
7
|
+
* @default true
|
|
8
|
+
*/
|
|
9
|
+
editable?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Custom element to render in Pages in edit mode if field value is empty
|
|
12
|
+
*/
|
|
13
|
+
emptyFieldEditingComponent?: React.ComponentClass<EmptyFieldEditingComponentProps> | React.FC<EmptyFieldEditingComponentProps>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/components/sharedTypes/props.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,+BAA+B,GAAG,OAAO;IAC3E;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,0BAA0B,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,+BAA+B,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,+BAA+B,CAAC,CAAC;CAChI"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentType } from 'react';
|
|
3
|
-
import { ComponentRendering } from '@sitecore-content-sdk/core/layout';
|
|
4
|
-
import { Page } from '@sitecore-content-sdk/core/client';
|
|
5
|
-
import { ComponentMap } from '../components/sharedTypes';
|
|
6
|
-
export type ComponentProps = {
|
|
7
|
-
rendering: ComponentRendering;
|
|
8
|
-
placeholders: Record<string, React.ReactNode>;
|
|
9
|
-
};
|
|
10
|
-
export type WrapperProps = {
|
|
11
|
-
rendering: ComponentRendering;
|
|
12
|
-
page: Page;
|
|
13
|
-
componentMap: ComponentMap;
|
|
14
|
-
};
|
|
15
|
-
export declare const withAppPlaceholder: <T extends ComponentProps, W extends T & WrapperProps>(Component: ComponentType<T>) => (props: W) => React.JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
import { ComponentRendering } from '@sitecore-content-sdk/core/layout';
|
|
4
|
+
import { Page } from '@sitecore-content-sdk/core/client';
|
|
5
|
+
import { ComponentMap } from '../components/sharedTypes';
|
|
6
|
+
export type ComponentProps = {
|
|
7
|
+
rendering: ComponentRendering;
|
|
8
|
+
placeholders: Record<string, React.ReactNode>;
|
|
9
|
+
};
|
|
10
|
+
export type WrapperProps = {
|
|
11
|
+
rendering: ComponentRendering;
|
|
12
|
+
page: Page;
|
|
13
|
+
componentMap: ComponentMap;
|
|
14
|
+
};
|
|
15
|
+
export declare const withAppPlaceholder: <T extends ComponentProps, W extends T & WrapperProps>(Component: ComponentType<T>) => (props: W) => React.JSX.Element;
|
|
16
|
+
//# sourceMappingURL=withAppPlaceholder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withAppPlaceholder.d.ts","sourceRoot":"","sources":["../../src/enhancers/withAppPlaceholder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,EAAE,kBAAkB,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,CAAC,GAAG,YAAY,EACrF,WAAW,aAAa,CAAC,CAAC,CAAC,MAEnB,OAAO,CAAC,sBAoBjB,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import React, { JSX } from 'react';
|
|
2
|
-
import { ComponentMap } from '../components/sharedTypes';
|
|
3
|
-
export interface WithComponentMapProps {
|
|
4
|
-
componentMap?: ComponentMap;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* @param {React.ComponentClass<T> | React.FC<T>} Component
|
|
8
|
-
*/
|
|
9
|
-
export declare function withComponentMap<T extends WithComponentMapProps>(Component: React.ComponentClass<T> | React.FC<T>): {
|
|
10
|
-
(props: T): JSX.Element;
|
|
11
|
-
displayName: string;
|
|
12
|
-
};
|
|
1
|
+
import React, { JSX } from 'react';
|
|
2
|
+
import { ComponentMap } from '../components/sharedTypes';
|
|
3
|
+
export interface WithComponentMapProps {
|
|
4
|
+
componentMap?: ComponentMap;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @param {React.ComponentClass<T> | React.FC<T>} Component
|
|
8
|
+
*/
|
|
9
|
+
export declare function withComponentMap<T extends WithComponentMapProps>(Component: React.ComponentClass<T> | React.FC<T>): {
|
|
10
|
+
(props: T): JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=withComponentMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withComponentMap.d.ts","sourceRoot":"","sources":["../../src/enhancers/withComponentMap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,MAAM,WAAW,qBAAqB;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,qBAAqB,EAC9D,SAAS,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;YAMf,CAAC,GAAG,GAAG,CAAC,OAAO;;EAWjD"}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import React, { JSX } from 'react';
|
|
2
|
-
import { ComponentRendering } from '@sitecore-content-sdk/core/layout';
|
|
3
|
-
export declare const DefaultEditingError: () => JSX.Element;
|
|
4
|
-
export interface WithDatasourceCheckProps {
|
|
5
|
-
rendering: ComponentRendering;
|
|
6
|
-
}
|
|
7
|
-
export interface WithDatasourceCheckOptions {
|
|
8
|
-
/**
|
|
9
|
-
* A component that is rendered when a datasource is missing during editing.
|
|
10
|
-
* If unspecified, a default component with message is displayed.
|
|
11
|
-
*/
|
|
12
|
-
editingErrorComponent?: React.ComponentClass<unknown> | React.FC<unknown>;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Checks whether a Sitecore datasource is present and renders appropriately depending on page mode (normal vs editing).
|
|
16
|
-
* @param {WithDatasourceCheckOptions} [options]
|
|
17
|
-
* @returns
|
|
18
|
-
* The wrapped component, if a datasource is present.
|
|
19
|
-
* A null component (in normal mode) or an error component (in editing mode), if a datasource is not present.
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import React, { JSX } from 'react';
|
|
2
|
+
import { ComponentRendering } from '@sitecore-content-sdk/core/layout';
|
|
3
|
+
export declare const DefaultEditingError: () => JSX.Element;
|
|
4
|
+
export interface WithDatasourceCheckProps {
|
|
5
|
+
rendering: ComponentRendering;
|
|
6
|
+
}
|
|
7
|
+
export interface WithDatasourceCheckOptions {
|
|
8
|
+
/**
|
|
9
|
+
* A component that is rendered when a datasource is missing during editing.
|
|
10
|
+
* If unspecified, a default component with message is displayed.
|
|
11
|
+
*/
|
|
12
|
+
editingErrorComponent?: React.ComponentClass<unknown> | React.FC<unknown>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Checks whether a Sitecore datasource is present and renders appropriately depending on page mode (normal vs editing).
|
|
16
|
+
* @param {WithDatasourceCheckOptions} [options]
|
|
17
|
+
* @returns
|
|
18
|
+
* The wrapped component, if a datasource is present.
|
|
19
|
+
* A null component (in normal mode) or an error component (in editing mode), if a datasource is not present.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare function withDatasourceCheck(options?: WithDatasourceCheckOptions): <ComponentProps extends WithDatasourceCheckProps>(Component: React.ComponentType<ComponentProps>) => (props: ComponentProps) => JSX.Element | null;
|
|
23
|
+
//# sourceMappingURL=withDatasourceCheck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withDatasourceCheck.d.ts","sourceRoot":"","sources":["../../src/enhancers/withDatasourceCheck.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAGvE,eAAO,MAAM,mBAAmB,QAAO,GAAG,CAAC,OAI1C,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,kBAAkB,CAAC;CAC/B;AAED,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;CAC3E;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,0BAA0B,IAC/B,cAAc,SAAS,wBAAwB,EACpF,WAAW,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,MAEV,OAAO,cAAc,wBAc5D"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* HOC to inject editor chromes reset on component update.
|
|
4
|
+
* @param {React.ComponentClass<unknown> | React.FC<unknown>} WrappedComponent - The component to wrap.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare const withEditorChromes: (WrappedComponent: React.ComponentClass<unknown> | React.FC<unknown>) => React.ComponentClass;
|
|
8
|
+
//# sourceMappingURL=withEditorChromes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withEditorChromes.d.ts","sourceRoot":"","sources":["../../src/enhancers/withEditorChromes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAG7C;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC5B,kBAAkB,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAehD,KAAK,CAAC,cAC1B,CAAC"}
|