@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,27 +1,29 @@
|
|
|
1
|
-
import React, { ComponentType } from 'react';
|
|
2
|
-
import { GenericFieldValue, Field, FieldMetadata } from '@sitecore-content-sdk/core/layout';
|
|
3
|
-
/**
|
|
4
|
-
* The HOC options
|
|
5
|
-
*/
|
|
6
|
-
export interface WithEmptyFieldEditingComponentOptions {
|
|
7
|
-
/**
|
|
8
|
-
* the default empty field component
|
|
9
|
-
*/
|
|
10
|
-
defaultEmptyFieldEditingComponent: React.FC;
|
|
11
|
-
/**
|
|
12
|
-
* 'true' if forward reference is needed
|
|
13
|
-
*/
|
|
14
|
-
isForwardRef?: boolean;
|
|
15
|
-
}
|
|
16
|
-
interface WithEmptyFieldEditingComponentProps<Props> {
|
|
17
|
-
field?: (Partial<Field> | GenericFieldValue) & FieldMetadata;
|
|
18
|
-
editable?: boolean;
|
|
19
|
-
emptyFieldEditingComponent?: React.ComponentClass<Props> | React.FC<Props>;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Returns the passed field component or default component in case field value is empty and edit mode is 'metadata'
|
|
23
|
-
* @param {ComponentType<FieldComponentProps>} FieldComponent the field component
|
|
24
|
-
* @param {WithEmptyFieldEditingComponentProps} options the options of the HOC;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export
|
|
1
|
+
import React, { ComponentType } from 'react';
|
|
2
|
+
import { GenericFieldValue, Field, FieldMetadata } from '@sitecore-content-sdk/core/layout';
|
|
3
|
+
/**
|
|
4
|
+
* The HOC options
|
|
5
|
+
*/
|
|
6
|
+
export interface WithEmptyFieldEditingComponentOptions {
|
|
7
|
+
/**
|
|
8
|
+
* the default empty field component
|
|
9
|
+
*/
|
|
10
|
+
defaultEmptyFieldEditingComponent: React.FC;
|
|
11
|
+
/**
|
|
12
|
+
* 'true' if forward reference is needed
|
|
13
|
+
*/
|
|
14
|
+
isForwardRef?: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface WithEmptyFieldEditingComponentProps<Props> {
|
|
17
|
+
field?: (Partial<Field> | GenericFieldValue) & FieldMetadata;
|
|
18
|
+
editable?: boolean;
|
|
19
|
+
emptyFieldEditingComponent?: React.ComponentClass<Props> | React.FC<Props>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Returns the passed field component or default component in case field value is empty and edit mode is 'metadata'
|
|
23
|
+
* @param {ComponentType<FieldComponentProps>} FieldComponent the field component
|
|
24
|
+
* @param {WithEmptyFieldEditingComponentProps} options the options of the HOC;
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export declare function withEmptyFieldEditingComponent<FieldComponentProps extends WithEmptyFieldEditingComponentProps<FieldComponentProps>, RefElementType = HTMLElement>(FieldComponent: ComponentType<FieldComponentProps>, options: WithEmptyFieldEditingComponentOptions): React.ForwardRefExoticComponent<React.PropsWithoutRef<FieldComponentProps> & React.RefAttributes<RefElementType>> | ((props: FieldComponentProps) => React.JSX.Element);
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=withEmptyFieldEditingComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withEmptyFieldEditingComponent.d.ts","sourceRoot":"","sources":["../../src/enhancers/withEmptyFieldEditingComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAc,MAAM,OAAO,CAAC;AACzD,OAAO,EACL,iBAAiB,EACjB,KAAK,EAEL,aAAa,EACd,MAAM,mCAAmC,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,qCAAqC;IACpD;;OAEG;IACH,iCAAiC,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5C;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAKD,UAAU,mCAAmC,CAAC,KAAK;IAEjD,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,iBAAiB,CAAC,GAAG,aAAa,CAAC;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0BAA0B,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;CAC5E;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,mBAAmB,SAAS,mCAAmC,CAAC,mBAAmB,CAAC,EACpF,cAAc,GAAG,WAAW,EAE5B,cAAc,EAAE,aAAa,CAAC,mBAAmB,CAAC,EAClD,OAAO,EAAE,qCAAqC,gIA0C/B,mBAAmB,wBAKnC"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import React, { ComponentType } from 'react';
|
|
2
|
-
interface WithMetadataProps {
|
|
3
|
-
field?: {
|
|
4
|
-
metadata?: {
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
editable?: boolean;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Wraps the field component with metadata markup intended to be used for chromes hydration in Pages
|
|
12
|
-
* @param {ComponentType<FieldComponentProps>} FieldComponent the field component
|
|
13
|
-
* @param {boolean} isForwardRef set to 'true' if forward reference is needed
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export
|
|
1
|
+
import React, { ComponentType } from 'react';
|
|
2
|
+
interface WithMetadataProps {
|
|
3
|
+
field?: {
|
|
4
|
+
metadata?: {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
editable?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Wraps the field component with metadata markup intended to be used for chromes hydration in Pages
|
|
12
|
+
* @param {ComponentType<FieldComponentProps>} FieldComponent the field component
|
|
13
|
+
* @param {boolean} isForwardRef set to 'true' if forward reference is needed
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export declare function withFieldMetadata<FieldComponentProps extends WithMetadataProps, RefElementType = HTMLElement>(FieldComponent: ComponentType<FieldComponentProps>, isForwardRef?: boolean): React.ForwardRefExoticComponent<React.PropsWithoutRef<FieldComponentProps> & React.RefAttributes<RefElementType>> | ((props: FieldComponentProps) => React.JSX.Element);
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=withFieldMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withFieldMetadata.d.ts","sourceRoot":"","sources":["../../src/enhancers/withFieldMetadata.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAc,MAAM,OAAO,CAAC;AAGzD,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE;QACN,QAAQ,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;KACvC,CAAC;IACF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,mBAAmB,SAAS,iBAAiB,EAC7C,cAAc,GAAG,WAAW,EAC5B,cAAc,EAAE,aAAa,CAAC,mBAAmB,CAAC,EAAE,YAAY,UAAQ,gIAkBzD,mBAAmB,wBAcnC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { JSX } from 'react';
|
|
2
|
+
import { ImportMapImport } from '../components/DesignLibrary/models';
|
|
3
|
+
/**
|
|
4
|
+
* Props that include the loadImportMap function from context.
|
|
5
|
+
*/
|
|
6
|
+
export interface WithLoadImportMapProps {
|
|
7
|
+
/**
|
|
8
|
+
* The dynamic import for import map to be used in variant generation mode.
|
|
9
|
+
*/
|
|
10
|
+
loadImportMap?: () => Promise<ImportMapImport>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Higher-order component that injects the loadImportMap function from context into component props.
|
|
14
|
+
* If the component already receives loadImportMap via props, the prop value takes precedence.
|
|
15
|
+
* @param {React.ComponentClass<T> | React.FC<T>} Component - The component to enhance.
|
|
16
|
+
* @returns {React.ComponentClass<T> | React.FC<T>} The enhanced component with loadImportMap injected.
|
|
17
|
+
*/
|
|
18
|
+
export declare function withLoadImportMap<T extends WithLoadImportMapProps>(Component: React.ComponentClass<T> | React.FC<T>): {
|
|
19
|
+
(props: T): JSX.Element;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=withLoadImportMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withLoadImportMap.d.ts","sourceRoot":"","sources":["../../src/enhancers/withLoadImportMap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,GAAG,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;CAChD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,sBAAsB,EAChE,SAAS,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;YAEd,CAAC,GAAG,GAAG,CAAC,OAAO;;EAWlD"}
|
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentRendering, RouteData } from '@sitecore-content-sdk/core/layout';
|
|
3
|
-
import { PlaceholderProps } from '../components/Placeholder';
|
|
4
|
-
export interface WithPlaceholderOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Function to map incoming placeholder props into rendering data to use for the placeholder data.
|
|
7
|
-
* Normally in a Content SDK component, props.rendering is passed the component data, and that is the default.
|
|
8
|
-
* However, if your component data is in a different prop, like say 'route' in a sample app,
|
|
9
|
-
* this lets you map that.
|
|
10
|
-
*/
|
|
11
|
-
resolvePlaceholderDataFromProps?: (props: unknown) => ComponentRendering | RouteData;
|
|
12
|
-
/**
|
|
13
|
-
* Function to alter the placeholder props from within the HOC. Enables the props to be
|
|
14
|
-
* transformed before being used by the placeholder/HOC, for example to customize the
|
|
15
|
-
* error or missing component display
|
|
16
|
-
*/
|
|
17
|
-
propsTransformer?: (props: PlaceholderProps) => PlaceholderProps;
|
|
18
|
-
}
|
|
19
|
-
export interface PlaceholderToPropMapping {
|
|
20
|
-
/**
|
|
21
|
-
* The name of the placeholder this component will expose
|
|
22
|
-
*/
|
|
23
|
-
placeholder: string;
|
|
24
|
-
/**
|
|
25
|
-
* The name of the prop on your wrapped component that you would like the placeholder data injected on
|
|
26
|
-
*/
|
|
27
|
-
prop: string;
|
|
28
|
-
}
|
|
29
|
-
export type WithPlaceholderSpec = (string | PlaceholderToPropMapping) | (string | PlaceholderToPropMapping)[];
|
|
30
|
-
/**
|
|
31
|
-
* HOC to provide client-side placeholder functionality to a component.
|
|
32
|
-
* @param {WithPlaceholderSpec} placeholders
|
|
33
|
-
* @param {WithPlaceholderOptions} [options]
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentRendering, RouteData } from '@sitecore-content-sdk/core/layout';
|
|
3
|
+
import { PlaceholderProps } from '../components/Placeholder';
|
|
4
|
+
export interface WithPlaceholderOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Function to map incoming placeholder props into rendering data to use for the placeholder data.
|
|
7
|
+
* Normally in a Content SDK component, props.rendering is passed the component data, and that is the default.
|
|
8
|
+
* However, if your component data is in a different prop, like say 'route' in a sample app,
|
|
9
|
+
* this lets you map that.
|
|
10
|
+
*/
|
|
11
|
+
resolvePlaceholderDataFromProps?: (props: unknown) => ComponentRendering | RouteData;
|
|
12
|
+
/**
|
|
13
|
+
* Function to alter the placeholder props from within the HOC. Enables the props to be
|
|
14
|
+
* transformed before being used by the placeholder/HOC, for example to customize the
|
|
15
|
+
* error or missing component display
|
|
16
|
+
*/
|
|
17
|
+
propsTransformer?: (props: PlaceholderProps) => PlaceholderProps;
|
|
18
|
+
}
|
|
19
|
+
export interface PlaceholderToPropMapping {
|
|
20
|
+
/**
|
|
21
|
+
* The name of the placeholder this component will expose
|
|
22
|
+
*/
|
|
23
|
+
placeholder: string;
|
|
24
|
+
/**
|
|
25
|
+
* The name of the prop on your wrapped component that you would like the placeholder data injected on
|
|
26
|
+
*/
|
|
27
|
+
prop: string;
|
|
28
|
+
}
|
|
29
|
+
export type WithPlaceholderSpec = (string | PlaceholderToPropMapping) | (string | PlaceholderToPropMapping)[];
|
|
30
|
+
/**
|
|
31
|
+
* HOC to provide client-side placeholder functionality to a component.
|
|
32
|
+
* @param {WithPlaceholderSpec} placeholders
|
|
33
|
+
* @param {WithPlaceholderOptions} [options]
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export declare function withPlaceholder(placeholders: WithPlaceholderSpec, options?: WithPlaceholderOptions): (WrappedComponent: React.ComponentClass<PlaceholderProps> | React.FunctionComponent<PlaceholderProps>) => (props: import("@sitecore-content-sdk/core/utils").EnhancedOmit<PlaceholderProps, keyof import("./withSitecore").WithSitecoreProps>) => React.JSX.Element;
|
|
37
|
+
//# sourceMappingURL=withPlaceholder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withPlaceholder.d.ts","sourceRoot":"","sources":["../../src/enhancers/withPlaceholder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAGlF,OAAO,EAEL,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AAGnC,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,+BAA+B,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,kBAAkB,GAAG,SAAS,CAAC;IACrF;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,gBAAgB,CAAC;CAClE;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,mBAAmB,GAC3B,CAAC,MAAM,GAAG,wBAAwB,CAAC,GACnC,CAAC,MAAM,GAAG,wBAAwB,CAAC,EAAE,CAAC;AAE1C;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,mBAAmB,EACjC,OAAO,CAAC,EAAE,sBAAsB,IAG9B,kBACI,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,GACtC,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,+JAmEhD"}
|
|
@@ -1,48 +1,63 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { EnhancedOmit } from '@sitecore-content-sdk/core/utils';
|
|
3
|
-
import { SitecoreProviderState } from '../components/SitecoreProvider';
|
|
4
|
-
import { Page } from '@sitecore-content-sdk/core/client';
|
|
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 { EnhancedOmit } from '@sitecore-content-sdk/core/utils';
|
|
3
|
+
import { SitecoreProviderState } from '../components/SitecoreProvider';
|
|
4
|
+
import { Page } from '@sitecore-content-sdk/core/client';
|
|
5
|
+
/**
|
|
6
|
+
* The options for the withSitecore HOC.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export interface WithSitecoreOptions {
|
|
10
|
+
/**
|
|
11
|
+
* If set to true, the `updateContext` method will be injected into the component props.
|
|
12
|
+
*/
|
|
13
|
+
updatable?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The props that HOC will inject.
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
export interface WithSitecoreProps {
|
|
20
|
+
/**
|
|
21
|
+
* The current page context.
|
|
22
|
+
*/
|
|
23
|
+
page: Page;
|
|
24
|
+
/**
|
|
25
|
+
* The API configuration defined in the `SitecoreConfig`.
|
|
26
|
+
*/
|
|
27
|
+
api?: SitecoreProviderState['api'];
|
|
28
|
+
/**
|
|
29
|
+
* Method to update the page. This is only available if `updatable` is set to true.
|
|
30
|
+
* @param {Page} value New page value.
|
|
31
|
+
* @returns {void}
|
|
32
|
+
*/
|
|
33
|
+
updatePage?: ((value: Page) => void) | false;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The type of the props that HOC will receive.
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export type WithSitecoreHocProps<ComponentProps> = EnhancedOmit<ComponentProps, keyof WithSitecoreProps>;
|
|
40
|
+
/**
|
|
41
|
+
* @param {WithSitecoreProviderOptions} [options]
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export declare function withSitecore(options?: WithSitecoreOptions): <ComponentProps extends WithSitecoreProps>(Component: React.ComponentType<ComponentProps>) => (props: WithSitecoreHocProps<ComponentProps>) => React.JSX.Element;
|
|
45
|
+
/**
|
|
46
|
+
* This hook grants acсess to the current Sitecore page and api.
|
|
47
|
+
* @param {WithSitecoreOptions} [options] hook options
|
|
48
|
+
* @example
|
|
49
|
+
* const EditMode = () => {
|
|
50
|
+
* const { page } = useSitecore();
|
|
51
|
+
* return <span>Edit Mode is {page.mode.isEditing ? 'active' : 'inactive'}</span>
|
|
52
|
+
* }
|
|
53
|
+
* @example
|
|
54
|
+
* const EditMode = () => {
|
|
55
|
+
* const { page, updatePage } = useSitecore({ updatable: true });
|
|
56
|
+
* const onClick = () => updatePage({ itemId: '123' });
|
|
57
|
+
* return <span onClick={onClick}>Item id is {page.itemId}</span>
|
|
58
|
+
* }
|
|
59
|
+
* @returns {object} { api, page, updatePage }
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
export declare function useSitecore(options?: WithSitecoreOptions): WithSitecoreProps;
|
|
63
|
+
//# sourceMappingURL=withSitecore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withSitecore.d.ts","sourceRoot":"","sources":["../../src/enhancers/withSitecore.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAEL,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;OAEG;IACH,GAAG,CAAC,EAAE,qBAAqB,CAAC,KAAK,CAAC,CAAC;IACnC;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC;CAC9C;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,CAAC,cAAc,IAAI,YAAY,CAC7D,cAAc,EACd,MAAM,iBAAiB,CACxB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,mBAAmB,IAChB,cAAc,SAAS,iBAAiB,EAC9E,WAAW,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,MAET,OAAO,oBAAoB,CAAC,cAAc,CAAC,uBAenF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,iBAAiB,CAS5E"}
|
package/types/index.d.ts
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
export { constants, enableDebug, ClientError, CacheClient, CacheOptions, MemoryCacheClient, NativeDataFetcher, NativeDataFetcherResponse, NativeDataFetcherConfig, } from '@sitecore-content-sdk/core';
|
|
2
|
-
export { EnhancedOmit } from '@sitecore-content-sdk/core/utils';
|
|
3
|
-
export { isEditorActive, resetEditorChromes } from '@sitecore-content-sdk/core/editing';
|
|
4
|
-
export { getContentStylesheetLink, getDesignLibraryStylesheetLinks, LayoutServiceData, LayoutServicePageState, LayoutServiceContext, LayoutServiceContextData, LayoutService, RouteData, Field, Item, getChildPlaceholder, getFieldValue, ComponentRendering, ComponentFields, ComponentParams, EditMode, } from '@sitecore-content-sdk/core/layout';
|
|
5
|
-
export { DictionaryPhrases, DictionaryService } from '@sitecore-content-sdk/core/i18n';
|
|
6
|
-
export { GraphQLClientError, RetryStrategy, DefaultRetryStrategy, GraphQLRequestClientFactoryConfig, GraphQLRequestClient, PageMode, ErrorPage, Page, } from '@sitecore-content-sdk/core/client';
|
|
7
|
-
export { mediaApi } from '@sitecore-content-sdk/core/media';
|
|
8
|
-
export { Form } from './components/Form';
|
|
9
|
-
export { ReactContentSdkComponent, ComponentMap, ReactModule } from './components/sharedTypes';
|
|
10
|
-
export { Placeholder, PlaceholderProps, PlaceholderProps as PlaceholderComponentProps, AppPlaceholder, AppPlaceholderProps, } from './components/Placeholder';
|
|
11
|
-
export { Image, ImageProps, ImageField, ImageFieldValue, ImageSizeParameters, } from './components/Image';
|
|
12
|
-
export { RichText, RichTextProps, RichTextField } from './components/RichText';
|
|
13
|
-
export { Text, TextField } from './components/Text';
|
|
14
|
-
export { DateField, DateFieldProps } from './components/Date';
|
|
15
|
-
export { FEaaSComponent, FEaaSComponentProps, FEaaSComponentParams, fetchFEaaSComponentServerProps, BYOCComponent, BYOCComponentParams, BYOCComponentProps, fetchBYOCComponentServerProps, BYOCWrapper, BYOCWrapper as BYOCClientWrapper, FEaaSWrapper, FEaaSWrapper as FEaaSClientWrapper, FEaaSServerWrapper, BYOCServerWrapper, } from './components/FEaaS';
|
|
16
|
-
export { DesignLibrary } from './components/DesignLibrary';
|
|
17
|
-
export {} from './components/FEaaS/BYOCComponent';
|
|
18
|
-
export { Link, LinkField, LinkFieldValue, LinkProps } from './components/Link';
|
|
19
|
-
export { File, FileField } from './components/File';
|
|
20
|
-
export { SitecoreProvider, SitecoreProviderState, SitecoreProviderReactContext, } from './components/SitecoreProvider';
|
|
21
|
-
export { withSitecore, useSitecore, WithSitecoreOptions, WithSitecoreProps, WithSitecoreHocProps, } from './enhancers/withSitecore';
|
|
22
|
-
export { withEditorChromes } from './enhancers/withEditorChromes';
|
|
23
|
-
export { withPlaceholder } from './enhancers/withPlaceholder';
|
|
24
|
-
export { withDatasourceCheck } from './enhancers/withDatasourceCheck';
|
|
25
|
-
export { withFieldMetadata } from './enhancers/withFieldMetadata';
|
|
26
|
-
export { withEmptyFieldEditingComponent } from './enhancers/withEmptyFieldEditingComponent';
|
|
27
|
-
export { EditingScripts } from './components/EditingScripts';
|
|
28
|
-
export { DefaultEmptyFieldEditingComponentText, DefaultEmptyFieldEditingComponentImage, } from './components/DefaultEmptyFieldEditingComponents';
|
|
29
|
-
export { ClientEditingChromesUpdate } from './components/ClientEditingChromesUpdate';
|
|
30
|
-
export { SitePathService, SitePathServiceConfig } from '@sitecore-content-sdk/core/site';
|
|
1
|
+
export { constants, enableDebug, ClientError, CacheClient, CacheOptions, MemoryCacheClient, NativeDataFetcher, NativeDataFetcherResponse, NativeDataFetcherConfig, } from '@sitecore-content-sdk/core';
|
|
2
|
+
export { EnhancedOmit } from '@sitecore-content-sdk/core/utils';
|
|
3
|
+
export { isEditorActive, resetEditorChromes } from '@sitecore-content-sdk/core/editing';
|
|
4
|
+
export { getContentStylesheetLink, getDesignLibraryStylesheetLinks, LayoutServiceData, LayoutServicePageState, LayoutServiceContext, LayoutServiceContextData, LayoutService, RouteData, Field, Item, getChildPlaceholder, getFieldValue, ComponentRendering, ComponentFields, ComponentParams, EditMode, } from '@sitecore-content-sdk/core/layout';
|
|
5
|
+
export { DictionaryPhrases, DictionaryService } from '@sitecore-content-sdk/core/i18n';
|
|
6
|
+
export { GraphQLClientError, RetryStrategy, DefaultRetryStrategy, GraphQLRequestClientFactoryConfig, GraphQLRequestClient, PageMode, ErrorPage, Page, } from '@sitecore-content-sdk/core/client';
|
|
7
|
+
export { mediaApi } from '@sitecore-content-sdk/core/media';
|
|
8
|
+
export { Form } from './components/Form';
|
|
9
|
+
export { ReactContentSdkComponent, ComponentMap, ReactModule } from './components/sharedTypes';
|
|
10
|
+
export { Placeholder, PlaceholderProps, PlaceholderProps as PlaceholderComponentProps, AppPlaceholder, AppPlaceholderProps, } from './components/Placeholder';
|
|
11
|
+
export { Image, ImageProps, ImageField, ImageFieldValue, ImageSizeParameters, } from './components/Image';
|
|
12
|
+
export { RichText, RichTextProps, RichTextField } from './components/RichText';
|
|
13
|
+
export { Text, TextField } from './components/Text';
|
|
14
|
+
export { DateField, DateFieldProps } from './components/Date';
|
|
15
|
+
export { FEaaSComponent, FEaaSComponentProps, FEaaSComponentParams, fetchFEaaSComponentServerProps, BYOCComponent, BYOCComponentParams, BYOCComponentProps, fetchBYOCComponentServerProps, BYOCWrapper, BYOCWrapper as BYOCClientWrapper, FEaaSWrapper, FEaaSWrapper as FEaaSClientWrapper, FEaaSServerWrapper, BYOCServerWrapper, } from './components/FEaaS';
|
|
16
|
+
export { DesignLibrary, DesignLibraryApp } from './components/DesignLibrary';
|
|
17
|
+
export {} from './components/FEaaS/BYOCComponent';
|
|
18
|
+
export { Link, LinkField, LinkFieldValue, LinkProps } from './components/Link';
|
|
19
|
+
export { File, FileField } from './components/File';
|
|
20
|
+
export { SitecoreProvider, SitecoreProviderState, SitecoreProviderReactContext, } from './components/SitecoreProvider';
|
|
21
|
+
export { withSitecore, useSitecore, WithSitecoreOptions, WithSitecoreProps, WithSitecoreHocProps, } from './enhancers/withSitecore';
|
|
22
|
+
export { withEditorChromes } from './enhancers/withEditorChromes';
|
|
23
|
+
export { withPlaceholder } from './enhancers/withPlaceholder';
|
|
24
|
+
export { withDatasourceCheck } from './enhancers/withDatasourceCheck';
|
|
25
|
+
export { withFieldMetadata } from './enhancers/withFieldMetadata';
|
|
26
|
+
export { withEmptyFieldEditingComponent } from './enhancers/withEmptyFieldEditingComponent';
|
|
27
|
+
export { EditingScripts } from './components/EditingScripts';
|
|
28
|
+
export { DefaultEmptyFieldEditingComponentText, DefaultEmptyFieldEditingComponentImage, } from './components/DefaultEmptyFieldEditingComponents';
|
|
29
|
+
export { ClientEditingChromesUpdate } from './components/ClientEditingChromesUpdate';
|
|
30
|
+
export { SitePathService, SitePathServiceConfig } from '@sitecore-content-sdk/core/site';
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const rsc = false;
|
|
1
|
+
export declare const rsc = false;
|
|
2
|
+
//# sourceMappingURL=no-rsc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-rsc.d.ts","sourceRoot":"","sources":["../../src/rsc-utils/no-rsc.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,GAAG,QAAQ,CAAC"}
|
package/types/rsc-utils/rsc.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const rsc = true;
|
|
1
|
+
export declare const rsc = true;
|
|
2
|
+
//# sourceMappingURL=rsc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsc.d.ts","sourceRoot":"","sources":["../../src/rsc-utils/rsc.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { SearchStatus } from './utils';
|
|
2
|
+
import { SearchDocument, SearchParameters } from '@sitecore-content-sdk/search';
|
|
3
|
+
/**
|
|
4
|
+
* Options for the useInfiniteSearch hook.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface UseInfiniteSearchOptions<T extends SearchDocument = SearchDocument> {
|
|
8
|
+
/**
|
|
9
|
+
* The query string to search for.
|
|
10
|
+
* By default empty string is used.
|
|
11
|
+
*/
|
|
12
|
+
query?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The ID of the search index to use.
|
|
15
|
+
*/
|
|
16
|
+
searchIndexId: string;
|
|
17
|
+
/**
|
|
18
|
+
* Number of results per page.
|
|
19
|
+
* @default 10
|
|
20
|
+
*/
|
|
21
|
+
pageSize?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Specifies the sorting of the search results.
|
|
24
|
+
*/
|
|
25
|
+
sort?: SearchParameters<T>['sort'];
|
|
26
|
+
/**
|
|
27
|
+
* Specifies whether the search should automatically run.
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The state of the useInfiniteSearch hook.
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export type UseInfiniteSearchState<T extends SearchDocument = SearchDocument> = Omit<InternalInfiniteSearchState<T>, 'offset'> & {
|
|
37
|
+
/**
|
|
38
|
+
* Load the next page of results.
|
|
39
|
+
*/
|
|
40
|
+
loadMore: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* Whether there are more results available.
|
|
43
|
+
*/
|
|
44
|
+
hasNextPage: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Whether a search request is currently in progress.
|
|
47
|
+
*/
|
|
48
|
+
isLoading: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the search request was successful.
|
|
51
|
+
*/
|
|
52
|
+
isSuccess: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Whether the search request failed.
|
|
55
|
+
*/
|
|
56
|
+
isError: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Whether a search request for more results is currently in progress.
|
|
59
|
+
*/
|
|
60
|
+
isLoadingMore: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Whether the search request for more results failed.
|
|
63
|
+
*/
|
|
64
|
+
isLoadingMoreError: boolean;
|
|
65
|
+
};
|
|
66
|
+
type InternalInfiniteSearchState<T extends SearchDocument = SearchDocument> = {
|
|
67
|
+
/**
|
|
68
|
+
* The search results.
|
|
69
|
+
*/
|
|
70
|
+
results: T[];
|
|
71
|
+
/**
|
|
72
|
+
* Total number of results across all pages.
|
|
73
|
+
*/
|
|
74
|
+
total: number;
|
|
75
|
+
/**
|
|
76
|
+
* Total number of pages available based on `total` and `pageSize`.
|
|
77
|
+
*/
|
|
78
|
+
totalPages: number;
|
|
79
|
+
/**
|
|
80
|
+
* The error object if the last search request failed, or null if no error occurred.
|
|
81
|
+
*/
|
|
82
|
+
error: Error | null;
|
|
83
|
+
/**
|
|
84
|
+
* The current offset of the search results.
|
|
85
|
+
*/
|
|
86
|
+
offset: number;
|
|
87
|
+
/**
|
|
88
|
+
* The status of the initial search request.
|
|
89
|
+
* It will be set to:
|
|
90
|
+
* - 'idle' if no search request has been made yet.
|
|
91
|
+
* - 'loading' if a search request is currently in progress.
|
|
92
|
+
* - 'success' if a search request was successful.
|
|
93
|
+
* - 'error' if a search request failed.
|
|
94
|
+
* @default 'idle'
|
|
95
|
+
*/
|
|
96
|
+
status: SearchStatus;
|
|
97
|
+
/**
|
|
98
|
+
* The status of the "load more" request.
|
|
99
|
+
* It will be set to:
|
|
100
|
+
* - 'idle' if no "load more" request has been made yet.
|
|
101
|
+
* - 'loading' if a "load more" request is currently in progress.
|
|
102
|
+
* - 'error' if a "load more" request failed.
|
|
103
|
+
* @default 'idle'
|
|
104
|
+
*/
|
|
105
|
+
loadMoreStatus: Omit<SearchStatus, 'success'>;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* React hook for performing infinite search queries.
|
|
109
|
+
* @param {UseInfiniteSearchOptions} options - Configuration options for the infinite search hook.
|
|
110
|
+
* @returns {UseInfiniteSearchState} The infinite search state.
|
|
111
|
+
* @throws {Error} if the search index ID is not provided.
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
export declare const useInfiniteSearch: <T extends SearchDocument = SearchDocument>(options: UseInfiniteSearchOptions<T>) => UseInfiniteSearchState<T>;
|
|
115
|
+
export {};
|
|
116
|
+
//# sourceMappingURL=useInfiniteSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInfiniteSearch.d.ts","sourceRoot":"","sources":["../../src/search/useInfiniteSearch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,YAAY,EAAoB,MAAM,SAAS,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhF;;;GAGG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc;IACjF;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACnC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,IAAI,IAAI,CAClF,2BAA2B,CAAC,CAAC,CAAC,EAC9B,QAAQ,CACT,GAAG;IACF;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,kBAAkB,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,KAAK,2BAA2B,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,IAAI;IAC5E;;OAEG;IACH,OAAO,EAAE,CAAC,EAAE,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;;;OAQG;IACH,MAAM,EAAE,YAAY,CAAC;IACrB;;;;;;;OAOG;IACH,cAAc,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;CAC/C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,cAAc,GAAG,cAAc,EACzE,SAAS,wBAAwB,CAAC,CAAC,CAAC,KACnC,sBAAsB,CAAC,CAAC,CA6J1B,CAAC"}
|