@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,38 +1,40 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { SitecoreProviderReactContext, } from '../components/SitecoreProvider';
|
|
4
|
-
/**
|
|
5
|
-
* @param {WithSitecoreProviderOptions} [options]
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
* @
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* }
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* const
|
|
26
|
-
*
|
|
27
|
-
* }
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { SitecoreProviderReactContext, } from '../components/SitecoreProvider';
|
|
4
|
+
/**
|
|
5
|
+
* @param {WithSitecoreProviderOptions} [options]
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export function withSitecore(options) {
|
|
9
|
+
return function withSitecoreProviderHoc(Component) {
|
|
10
|
+
return function WithSitecoreProvider(props) {
|
|
11
|
+
return (React.createElement(SitecoreProviderReactContext.Consumer, null, (value) => (React.createElement(Component, Object.assign({}, props, { page: value.page, api: value.api, updatePage: options && options.updatable && value.setPage })))));
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}
|
|
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
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
export { constants, enableDebug, ClientError, MemoryCacheClient, NativeDataFetcher, } from '@sitecore-content-sdk/core';
|
|
2
|
-
export { isEditorActive, resetEditorChromes } from '@sitecore-content-sdk/core/editing';
|
|
3
|
-
export { getContentStylesheetLink, getDesignLibraryStylesheetLinks, LayoutServicePageState, LayoutService, getChildPlaceholder, getFieldValue, EditMode, } from '@sitecore-content-sdk/core/layout';
|
|
4
|
-
export { DictionaryService } from '@sitecore-content-sdk/core/i18n';
|
|
5
|
-
export { DefaultRetryStrategy, GraphQLRequestClient, ErrorPage, } from '@sitecore-content-sdk/core/client';
|
|
6
|
-
export { mediaApi } from '@sitecore-content-sdk/core/media';
|
|
7
|
-
export { Form } from './components/Form';
|
|
8
|
-
export { Placeholder, AppPlaceholder, } from './components/Placeholder';
|
|
9
|
-
export { Image, } from './components/Image';
|
|
10
|
-
export { RichText } from './components/RichText';
|
|
11
|
-
export { Text } from './components/Text';
|
|
12
|
-
export { DateField } from './components/Date';
|
|
13
|
-
export { FEaaSComponent, fetchFEaaSComponentServerProps, BYOCComponent, fetchBYOCComponentServerProps,
|
|
14
|
-
// leaving original names for backward compatibility
|
|
15
|
-
BYOCWrapper, BYOCWrapper as BYOCClientWrapper, FEaaSWrapper, FEaaSWrapper as FEaaSClientWrapper, FEaaSServerWrapper, BYOCServerWrapper, } from './components/FEaaS';
|
|
16
|
-
export { DesignLibrary } from './components/DesignLibrary';
|
|
17
|
-
export { Link } from './components/Link';
|
|
18
|
-
export { File } from './components/File';
|
|
19
|
-
export { SitecoreProvider, SitecoreProviderReactContext, } from './components/SitecoreProvider';
|
|
20
|
-
export { withSitecore, useSitecore, } from './enhancers/withSitecore';
|
|
21
|
-
export { withEditorChromes } from './enhancers/withEditorChromes';
|
|
22
|
-
export { withPlaceholder } from './enhancers/withPlaceholder';
|
|
23
|
-
export { withDatasourceCheck } from './enhancers/withDatasourceCheck';
|
|
24
|
-
export { withFieldMetadata } from './enhancers/withFieldMetadata';
|
|
25
|
-
export { withEmptyFieldEditingComponent } from './enhancers/withEmptyFieldEditingComponent';
|
|
26
|
-
export { EditingScripts } from './components/EditingScripts';
|
|
27
|
-
export { DefaultEmptyFieldEditingComponentText, DefaultEmptyFieldEditingComponentImage, } from './components/DefaultEmptyFieldEditingComponents';
|
|
28
|
-
export { ClientEditingChromesUpdate } from './components/ClientEditingChromesUpdate';
|
|
29
|
-
export { SitePathService } from '@sitecore-content-sdk/core/site';
|
|
1
|
+
export { constants, enableDebug, ClientError, MemoryCacheClient, NativeDataFetcher, } from '@sitecore-content-sdk/core';
|
|
2
|
+
export { isEditorActive, resetEditorChromes } from '@sitecore-content-sdk/core/editing';
|
|
3
|
+
export { getContentStylesheetLink, getDesignLibraryStylesheetLinks, LayoutServicePageState, LayoutService, getChildPlaceholder, getFieldValue, EditMode, } from '@sitecore-content-sdk/core/layout';
|
|
4
|
+
export { DictionaryService } from '@sitecore-content-sdk/core/i18n';
|
|
5
|
+
export { DefaultRetryStrategy, GraphQLRequestClient, ErrorPage, } from '@sitecore-content-sdk/core/client';
|
|
6
|
+
export { mediaApi } from '@sitecore-content-sdk/core/media';
|
|
7
|
+
export { Form } from './components/Form';
|
|
8
|
+
export { Placeholder, AppPlaceholder, } from './components/Placeholder';
|
|
9
|
+
export { Image, } from './components/Image';
|
|
10
|
+
export { RichText } from './components/RichText';
|
|
11
|
+
export { Text } from './components/Text';
|
|
12
|
+
export { DateField } from './components/Date';
|
|
13
|
+
export { FEaaSComponent, fetchFEaaSComponentServerProps, BYOCComponent, fetchBYOCComponentServerProps,
|
|
14
|
+
// leaving original names for backward compatibility
|
|
15
|
+
BYOCWrapper, BYOCWrapper as BYOCClientWrapper, FEaaSWrapper, FEaaSWrapper as FEaaSClientWrapper, FEaaSServerWrapper, BYOCServerWrapper, } from './components/FEaaS';
|
|
16
|
+
export { DesignLibrary, DesignLibraryApp } from './components/DesignLibrary';
|
|
17
|
+
export { Link } from './components/Link';
|
|
18
|
+
export { File } from './components/File';
|
|
19
|
+
export { SitecoreProvider, SitecoreProviderReactContext, } from './components/SitecoreProvider';
|
|
20
|
+
export { withSitecore, useSitecore, } from './enhancers/withSitecore';
|
|
21
|
+
export { withEditorChromes } from './enhancers/withEditorChromes';
|
|
22
|
+
export { withPlaceholder } from './enhancers/withPlaceholder';
|
|
23
|
+
export { withDatasourceCheck } from './enhancers/withDatasourceCheck';
|
|
24
|
+
export { withFieldMetadata } from './enhancers/withFieldMetadata';
|
|
25
|
+
export { withEmptyFieldEditingComponent } from './enhancers/withEmptyFieldEditingComponent';
|
|
26
|
+
export { EditingScripts } from './components/EditingScripts';
|
|
27
|
+
export { DefaultEmptyFieldEditingComponentText, DefaultEmptyFieldEditingComponentImage, } from './components/DefaultEmptyFieldEditingComponents';
|
|
28
|
+
export { ClientEditingChromesUpdate } from './components/ClientEditingChromesUpdate';
|
|
29
|
+
export { SitePathService } from '@sitecore-content-sdk/core/site';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Always false constant to import in the non-RSC contexts using conditional imports
|
|
2
|
-
export const rsc = false;
|
|
1
|
+
// Always false constant to import in the non-RSC contexts using conditional imports
|
|
2
|
+
export const rsc = false;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Always true constant to import in the RSC environment using conditional imports
|
|
2
|
-
export const rsc = true;
|
|
1
|
+
// Always true constant to import in the RSC environment using conditional imports
|
|
2
|
+
export const rsc = true;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { DEFAULT_PAGE_SIZE, useSearchService } from './utils';
|
|
4
|
+
/**
|
|
5
|
+
* React hook for performing infinite search queries.
|
|
6
|
+
* @param {UseInfiniteSearchOptions} options - Configuration options for the infinite search hook.
|
|
7
|
+
* @returns {UseInfiniteSearchState} The infinite search state.
|
|
8
|
+
* @throws {Error} if the search index ID is not provided.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export const useInfiniteSearch = (options) => {
|
|
12
|
+
const { query, searchIndexId, pageSize = DEFAULT_PAGE_SIZE, sort, enabled = true } = options;
|
|
13
|
+
const [state, setState] = useState(() => {
|
|
14
|
+
const error = !searchIndexId
|
|
15
|
+
? new Error('useInfiniteSearch: searchIndexId is required when initializing the hook')
|
|
16
|
+
: null;
|
|
17
|
+
const status = !searchIndexId ? 'error' : 'idle';
|
|
18
|
+
return {
|
|
19
|
+
results: [],
|
|
20
|
+
total: 0,
|
|
21
|
+
totalPages: 0,
|
|
22
|
+
error,
|
|
23
|
+
offset: 0,
|
|
24
|
+
status,
|
|
25
|
+
loadMoreStatus: 'idle',
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
const hasNextPage = useMemo(() => state.results.length < state.total, [state.results.length, state.total]);
|
|
29
|
+
const searchService = useSearchService();
|
|
30
|
+
const abortControllerRef = useRef(null);
|
|
31
|
+
const search = useCallback(async (offset, isLoadingMore = false) => {
|
|
32
|
+
if (!searchService || !searchIndexId) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
abortControllerRef.current = new AbortController();
|
|
36
|
+
const signal = abortControllerRef.current.signal;
|
|
37
|
+
if (isLoadingMore) {
|
|
38
|
+
setState((prev) => (Object.assign(Object.assign({}, prev), { error: null, loadMoreStatus: 'loading' })));
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
setState({
|
|
42
|
+
results: [],
|
|
43
|
+
total: 0,
|
|
44
|
+
totalPages: 0,
|
|
45
|
+
error: null,
|
|
46
|
+
offset: 0,
|
|
47
|
+
status: 'loading',
|
|
48
|
+
loadMoreStatus: 'idle',
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
const searchParams = {
|
|
53
|
+
searchIndexId,
|
|
54
|
+
keyphrase: query,
|
|
55
|
+
limit: pageSize,
|
|
56
|
+
offset,
|
|
57
|
+
sort,
|
|
58
|
+
};
|
|
59
|
+
const { results: searchResults, total: totalResults } = await searchService.search(searchParams, { signal });
|
|
60
|
+
if (signal.aborted) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
setState((prev) => {
|
|
64
|
+
const results = isLoadingMore ? [...prev.results, ...searchResults] : searchResults;
|
|
65
|
+
const totalPages = Math.ceil(totalResults / pageSize);
|
|
66
|
+
return {
|
|
67
|
+
results,
|
|
68
|
+
error: null,
|
|
69
|
+
offset,
|
|
70
|
+
status: 'success',
|
|
71
|
+
loadMoreStatus: 'idle',
|
|
72
|
+
total: totalResults,
|
|
73
|
+
totalPages,
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
// Don't set error if request was aborted
|
|
79
|
+
if (signal.aborted) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const errorMessage = err instanceof Error ? err : new Error(JSON.stringify(err));
|
|
83
|
+
// Don't clean up existing results if appending results
|
|
84
|
+
if (isLoadingMore) {
|
|
85
|
+
setState((prev) => (Object.assign(Object.assign({}, prev), { error: errorMessage, loadMoreStatus: 'error' })));
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
setState({
|
|
89
|
+
results: [],
|
|
90
|
+
total: 0,
|
|
91
|
+
totalPages: 0,
|
|
92
|
+
error: errorMessage,
|
|
93
|
+
offset: 0,
|
|
94
|
+
status: 'error',
|
|
95
|
+
loadMoreStatus: 'idle',
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}, [searchService, pageSize, sort, query, searchIndexId]);
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
if (enabled) {
|
|
102
|
+
search(0, false);
|
|
103
|
+
}
|
|
104
|
+
return () => {
|
|
105
|
+
var _a;
|
|
106
|
+
(_a = abortControllerRef.current) === null || _a === void 0 ? void 0 : _a.abort();
|
|
107
|
+
};
|
|
108
|
+
}, [search, enabled]);
|
|
109
|
+
const loadMore = useCallback(() => {
|
|
110
|
+
// Don't load more if already loading or no more pages
|
|
111
|
+
if (state.loadMoreStatus === 'loading' || !hasNextPage) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const nextOffset = state.offset + pageSize;
|
|
115
|
+
search(nextOffset, true);
|
|
116
|
+
}, [search, pageSize, state.offset, hasNextPage, state.loadMoreStatus]);
|
|
117
|
+
return useMemo(() => ({
|
|
118
|
+
results: state.results,
|
|
119
|
+
status: state.status,
|
|
120
|
+
loadMoreStatus: state.loadMoreStatus,
|
|
121
|
+
total: state.total,
|
|
122
|
+
totalPages: state.totalPages,
|
|
123
|
+
error: state.error,
|
|
124
|
+
loadMore,
|
|
125
|
+
hasNextPage,
|
|
126
|
+
isLoading: state.status === 'loading',
|
|
127
|
+
isSuccess: state.status === 'success',
|
|
128
|
+
isError: state.status === 'error',
|
|
129
|
+
isLoadingMore: state.loadMoreStatus === 'loading',
|
|
130
|
+
isLoadingMoreError: state.loadMoreStatus === 'error',
|
|
131
|
+
}), [state, loadMore, hasNextPage]);
|
|
132
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { DEFAULT_PAGE_SIZE, getOffset, useSearchService } from './utils';
|
|
3
|
+
/**
|
|
4
|
+
* React hook for performing search queries with pagination.
|
|
5
|
+
* @param {UseSearchOptions} options - Configuration options for the search hook.
|
|
6
|
+
* @returns {UseSearchState} The search state.
|
|
7
|
+
* @throws {Error} if the search index ID is not provided.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export const useSearch = (options) => {
|
|
11
|
+
const { query, page = 1, searchIndexId, pageSize = DEFAULT_PAGE_SIZE, sort, enabled = true, keepPreviousData = false, } = options;
|
|
12
|
+
const [state, setState] = useState(() => {
|
|
13
|
+
const error = !searchIndexId
|
|
14
|
+
? new Error('useSearch: searchIndexId is required when initializing the hook')
|
|
15
|
+
: null;
|
|
16
|
+
const status = !searchIndexId ? 'error' : 'idle';
|
|
17
|
+
return {
|
|
18
|
+
results: [],
|
|
19
|
+
total: 0,
|
|
20
|
+
totalPages: 0,
|
|
21
|
+
error,
|
|
22
|
+
status,
|
|
23
|
+
previousStatus: 'idle',
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
const searchService = useSearchService();
|
|
27
|
+
const abortControllerRef = useRef(null);
|
|
28
|
+
const search = useCallback(async () => {
|
|
29
|
+
if (!searchService || !searchIndexId) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
abortControllerRef.current = new AbortController();
|
|
33
|
+
const signal = abortControllerRef.current.signal;
|
|
34
|
+
setState((prev) => ({
|
|
35
|
+
results: keepPreviousData ? prev.results : [],
|
|
36
|
+
status: 'loading',
|
|
37
|
+
total: keepPreviousData ? prev.total : 0,
|
|
38
|
+
totalPages: keepPreviousData ? prev.totalPages : 0,
|
|
39
|
+
error: null,
|
|
40
|
+
previousStatus: prev.status,
|
|
41
|
+
}));
|
|
42
|
+
try {
|
|
43
|
+
const offset = getOffset(page, pageSize);
|
|
44
|
+
const searchParams = {
|
|
45
|
+
searchIndexId,
|
|
46
|
+
keyphrase: query,
|
|
47
|
+
limit: pageSize,
|
|
48
|
+
offset,
|
|
49
|
+
sort,
|
|
50
|
+
};
|
|
51
|
+
const { results: searchResults, total } = await searchService.search(searchParams, {
|
|
52
|
+
signal,
|
|
53
|
+
});
|
|
54
|
+
if (signal.aborted) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const totalPages = Math.ceil(total / pageSize);
|
|
58
|
+
setState({
|
|
59
|
+
results: searchResults,
|
|
60
|
+
total,
|
|
61
|
+
totalPages,
|
|
62
|
+
status: 'success',
|
|
63
|
+
error: null,
|
|
64
|
+
previousStatus: 'success',
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
// Don't set error if request was aborted
|
|
69
|
+
if (signal.aborted) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const errorMessage = err instanceof Error ? err : new Error(JSON.stringify(err));
|
|
73
|
+
setState({
|
|
74
|
+
results: [],
|
|
75
|
+
total: 0,
|
|
76
|
+
totalPages: 0,
|
|
77
|
+
status: 'error',
|
|
78
|
+
error: errorMessage,
|
|
79
|
+
previousStatus: 'error',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}, [searchService, searchIndexId, page, pageSize, sort, query, keepPreviousData]);
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if (enabled) {
|
|
85
|
+
search();
|
|
86
|
+
}
|
|
87
|
+
return () => {
|
|
88
|
+
var _a;
|
|
89
|
+
(_a = abortControllerRef.current) === null || _a === void 0 ? void 0 : _a.abort();
|
|
90
|
+
};
|
|
91
|
+
}, [search, enabled]);
|
|
92
|
+
return useMemo(() => ({
|
|
93
|
+
error: state.error,
|
|
94
|
+
results: state.results,
|
|
95
|
+
total: state.total,
|
|
96
|
+
totalPages: state.totalPages,
|
|
97
|
+
status: state.status,
|
|
98
|
+
isLoading: state.status === 'loading',
|
|
99
|
+
isSuccess: state.status === 'success',
|
|
100
|
+
isError: state.status === 'error',
|
|
101
|
+
isPreviousData: keepPreviousData && state.previousStatus === 'success' && state.status === 'loading',
|
|
102
|
+
}), [state, keepPreviousData]);
|
|
103
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SearchService } from '@sitecore-content-sdk/search';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useSitecore } from '../enhancers/withSitecore';
|
|
4
|
+
export const DEFAULT_PAGE_SIZE = 10;
|
|
5
|
+
/**
|
|
6
|
+
* Hook to initialize and manage SearchService.
|
|
7
|
+
*/
|
|
8
|
+
export function useSearchService() {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
const { api } = useSitecore();
|
|
11
|
+
return useMemo(() => {
|
|
12
|
+
var _a;
|
|
13
|
+
if (!((_a = api === null || api === void 0 ? void 0 : api.edge) === null || _a === void 0 ? void 0 : _a.clientContextId)) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return new SearchService({
|
|
17
|
+
contextId: api.edge.clientContextId,
|
|
18
|
+
edgeUrl: api.edge.edgeUrl,
|
|
19
|
+
});
|
|
20
|
+
}, [(_a = api === null || api === void 0 ? void 0 : api.edge) === null || _a === void 0 ? void 0 : _a.clientContextId, (_b = api === null || api === void 0 ? void 0 : api.edge) === null || _b === void 0 ? void 0 : _b.edgeUrl]);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Calculates the number of items to skip before returning results.
|
|
24
|
+
* @param {number} page - The current page number (1-indexed).
|
|
25
|
+
* @param {number} pageSize - The number of results per page.
|
|
26
|
+
* @returns The number of items to skip before returning results.
|
|
27
|
+
*/
|
|
28
|
+
export const getOffset = (page, pageSize) => {
|
|
29
|
+
return page === 1 ? 0 : pageSize * (page - 1);
|
|
30
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
import { debug } from '@sitecore-content-sdk/core';
|
|
3
|
+
import { setCache } from '@sitecore-content-sdk/core/utils';
|
|
4
|
+
import { COMPONENT_UPDATE_CACHE_KEY_PREFIX } from '@sitecore-content-sdk/core/editing';
|
|
5
|
+
/**
|
|
6
|
+
* Server action to update global cache with the provided component updates received from Design Library.
|
|
7
|
+
* Stores the given {@link ComponentUpdateModel} in the global cache using a key based on the component UID.
|
|
8
|
+
* This enables dynamic rendering of server components inside Design Library
|
|
9
|
+
* @param {ComponentUpdateModel} componentUpdate - The component update model containing the UID and optional updated or preview component data.
|
|
10
|
+
* @returns A Promise that resolves when the cache has been updated.
|
|
11
|
+
*/
|
|
12
|
+
export async function updateServerComponentAction(componentUpdate) {
|
|
13
|
+
debug.editing(`Updating server component cache for Component: ${componentUpdate.uid}`);
|
|
14
|
+
setCache(`${COMPONENT_UPDATE_CACHE_KEY_PREFIX}${componentUpdate.uid}`, componentUpdate);
|
|
15
|
+
}
|
package/dist/esm/utils.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { getFieldValue } from '@sitecore-content-sdk/core/layout';
|
|
2
|
-
/**
|
|
3
|
-
* "class" property will be transformed into or appended to "className" instead.
|
|
4
|
-
* @param {string} otherAttrs all other props included on the image component
|
|
5
|
-
* @returns {void}
|
|
6
|
-
*/
|
|
7
|
-
export const addClassName = (otherAttrs) => {
|
|
8
|
-
if (otherAttrs.class) {
|
|
9
|
-
// if any classes are defined properly already
|
|
10
|
-
if (otherAttrs.className) {
|
|
11
|
-
let className = otherAttrs.className;
|
|
12
|
-
className += ` ${otherAttrs.class}`;
|
|
13
|
-
otherAttrs.className = className;
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
otherAttrs.className = otherAttrs.class;
|
|
17
|
-
}
|
|
18
|
-
delete otherAttrs.class;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Used in FEAAS and BYOC implementations to convert datasource item field values into component props
|
|
23
|
-
* @param {ComponentFields} fields field collection from Sitecore
|
|
24
|
-
* @returns JSON object that can be used as props
|
|
25
|
-
*/
|
|
26
|
-
export const getDataFromFields = (fields) => {
|
|
27
|
-
let data = {};
|
|
28
|
-
data = Object.entries(fields).reduce((acc, [key]) => {
|
|
29
|
-
acc[key] = getFieldValue(fields, key);
|
|
30
|
-
return acc;
|
|
31
|
-
}, data);
|
|
32
|
-
return data;
|
|
33
|
-
};
|
|
1
|
+
import { getFieldValue } from '@sitecore-content-sdk/core/layout';
|
|
2
|
+
/**
|
|
3
|
+
* "class" property will be transformed into or appended to "className" instead.
|
|
4
|
+
* @param {string} otherAttrs all other props included on the image component
|
|
5
|
+
* @returns {void}
|
|
6
|
+
*/
|
|
7
|
+
export const addClassName = (otherAttrs) => {
|
|
8
|
+
if (otherAttrs.class) {
|
|
9
|
+
// if any classes are defined properly already
|
|
10
|
+
if (otherAttrs.className) {
|
|
11
|
+
let className = otherAttrs.className;
|
|
12
|
+
className += ` ${otherAttrs.class}`;
|
|
13
|
+
otherAttrs.className = className;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
otherAttrs.className = otherAttrs.class;
|
|
17
|
+
}
|
|
18
|
+
delete otherAttrs.class;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Used in FEAAS and BYOC implementations to convert datasource item field values into component props
|
|
23
|
+
* @param {ComponentFields} fields field collection from Sitecore
|
|
24
|
+
* @returns JSON object that can be used as props
|
|
25
|
+
*/
|
|
26
|
+
export const getDataFromFields = (fields) => {
|
|
27
|
+
let data = {};
|
|
28
|
+
data = Object.entries(fields).reduce((acc, [key]) => {
|
|
29
|
+
acc[key] = getFieldValue(fields, key);
|
|
30
|
+
return acc;
|
|
31
|
+
}, data);
|
|
32
|
+
return data;
|
|
33
|
+
};
|
package/global.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare module 'style-attr' {
|
|
2
|
+
export const parse: (
|
|
3
|
+
style: string,
|
|
4
|
+
config: { preserveNumbers: boolean }
|
|
5
|
+
) => { [key: string]: unknown };
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare namespace NodeJS {
|
|
9
|
+
export interface Global {
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
requestAnimationFrame: (callback: () => void) => void;
|
|
12
|
+
window: Window;
|
|
13
|
+
document: Document;
|
|
14
|
+
navigator: Navigator;
|
|
15
|
+
HTMLElement: HTMLElement;
|
|
16
|
+
}
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-content-sdk/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0-canary.2",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
"test": "mocha --require ./test/setup.js \"./src/**/*.test.ts\" \"./src/**/*.test.tsx\" --exit",
|
|
16
16
|
"prepublishOnly": "npm run build",
|
|
17
17
|
"coverage": "nyc npm test",
|
|
18
|
-
"generate-docs": "npx typedoc --plugin typedoc-plugin-markdown --outputFileStrategy Members --parametersFormat table --readme none --out ../../ref-docs/react src/index.ts --githubPages false"
|
|
18
|
+
"generate-docs": "npx typedoc --plugin typedoc-plugin-markdown --outputFileStrategy Members --parametersFormat table --readme none --out ../../ref-docs/react src/index.ts --githubPages false",
|
|
19
|
+
"api-extractor": "npm run build && api-extractor run --local --verbose",
|
|
20
|
+
"api-extractor:verify": "api-extractor run"
|
|
19
21
|
},
|
|
20
22
|
"engines": {
|
|
21
23
|
"node": ">=22"
|
|
@@ -39,8 +41,8 @@
|
|
|
39
41
|
"@types/mocha": "^10.0.10",
|
|
40
42
|
"@types/node": "22.15.14",
|
|
41
43
|
"@types/proxyquire": "^1.3.31",
|
|
42
|
-
"@types/react": "^19.
|
|
43
|
-
"@types/react-dom": "^19.
|
|
44
|
+
"@types/react": "^19.2.7",
|
|
45
|
+
"@types/react-dom": "^19.2.3",
|
|
44
46
|
"@types/sinon": "^17.0.4",
|
|
45
47
|
"@types/sinon-chai": "^4.0.0",
|
|
46
48
|
"@typescript-eslint/eslint-plugin": "8.39.0",
|
|
@@ -60,8 +62,8 @@
|
|
|
60
62
|
"nyc": "^17.1.0",
|
|
61
63
|
"prettier": "^2.8.0",
|
|
62
64
|
"proxyquire": "^2.1.3",
|
|
63
|
-
"react": "^19.1
|
|
64
|
-
"react-dom": "^19.1
|
|
65
|
+
"react": "^19.2.1",
|
|
66
|
+
"react-dom": "^19.2.1",
|
|
65
67
|
"sinon": "^20.0.0",
|
|
66
68
|
"sinon-chai": "^3.7.0",
|
|
67
69
|
"ts-node": "^10.9.2",
|
|
@@ -70,20 +72,34 @@
|
|
|
70
72
|
"peerDependencies": {
|
|
71
73
|
"@sitecore-cloudsdk/events": "^0.5.1",
|
|
72
74
|
"@sitecore-feaas/clientside": "^0.6.0",
|
|
73
|
-
"react": "^19.1
|
|
74
|
-
"react-dom": "^19.1
|
|
75
|
+
"react": "^19.2.1",
|
|
76
|
+
"react-dom": "^19.2.1"
|
|
75
77
|
},
|
|
76
78
|
"dependencies": {
|
|
77
|
-
"@sitecore-content-sdk/core": "1.
|
|
79
|
+
"@sitecore-content-sdk/core": "1.4.0-canary.2",
|
|
80
|
+
"@sitecore-content-sdk/search": "1.4.0-canary.2",
|
|
78
81
|
"fast-deep-equal": "^3.1.3"
|
|
79
82
|
},
|
|
80
83
|
"description": "",
|
|
81
84
|
"types": "types/index.d.ts",
|
|
82
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "a566163f138188b5b3d22dbf2d87f373a1eb0715",
|
|
83
86
|
"files": [
|
|
84
87
|
"dist",
|
|
85
|
-
"types"
|
|
88
|
+
"types",
|
|
89
|
+
"/*.d.ts"
|
|
86
90
|
],
|
|
91
|
+
"exports": {
|
|
92
|
+
".": {
|
|
93
|
+
"import": "./dist/esm/index.js",
|
|
94
|
+
"require": "./dist/cjs/index.js",
|
|
95
|
+
"types": "./types/index.d.ts"
|
|
96
|
+
},
|
|
97
|
+
"./search": {
|
|
98
|
+
"import": "./dist/esm/search/index.js",
|
|
99
|
+
"require": "./dist/cjs/search/index.js",
|
|
100
|
+
"types": "./types/search/index.d.ts"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
87
103
|
"imports": {
|
|
88
104
|
"#rsc-env": {
|
|
89
105
|
"react-server": {
|
package/search.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types/search/index';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Updates editing chromes in app router / RSC context.
|
|
4
|
-
* This ensures all the relevant Pages editing markup is applied once all client components are loaded.
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Updates editing chromes in app router / RSC context.
|
|
4
|
+
* This ensures all the relevant Pages editing markup is applied once all client components are loaded.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare const ClientEditingChromesUpdate: () => JSX.Element;
|
|
8
|
+
//# sourceMappingURL=ClientEditingChromesUpdate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientEditingChromesUpdate.d.ts","sourceRoot":"","sources":["../../src/components/ClientEditingChromesUpdate.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAa,GAAG,EAAE,MAAM,OAAO,CAAC;AAC9C;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,QAAO,GAAG,CAAC,OAOjD,CAAC"}
|