@sitecore-content-sdk/react 2.0.0-canary.9 → 2.0.1
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/LICENSE.txt +202 -202
- package/dist/cjs/components/DesignLibrary/DesignLibrary.js +2 -2
- package/dist/cjs/components/DesignLibrary/DesignLibraryErrorBoundary.js +6 -0
- package/dist/cjs/components/DesignLibrary/index.js +3 -3
- package/dist/cjs/components/ErrorBoundary.js +1 -0
- package/dist/cjs/components/Form.js +4 -2
- package/dist/cjs/components/Placeholder/PlaceholderMetadata.js +1 -0
- package/dist/cjs/index.js +6 -3
- package/dist/esm/components/DesignLibrary/DesignLibrary.js +2 -2
- package/dist/esm/components/DesignLibrary/DesignLibraryErrorBoundary.js +6 -0
- package/dist/esm/components/DesignLibrary/index.js +1 -1
- package/dist/esm/components/ErrorBoundary.js +1 -0
- package/dist/esm/components/Form.js +4 -2
- package/dist/esm/components/Placeholder/PlaceholderMetadata.js +1 -0
- package/dist/esm/index.js +3 -2
- package/package.json +7 -6
- package/types/components/DesignLibrary/DesignLibraryErrorBoundary.d.ts +13 -0
- package/types/components/DesignLibrary/DesignLibraryErrorBoundary.d.ts.map +1 -1
- package/types/components/DesignLibrary/index.d.ts +2 -1
- package/types/components/DesignLibrary/index.d.ts.map +1 -1
- package/types/components/DesignLibrary/models.d.ts +13 -55
- package/types/components/DesignLibrary/models.d.ts.map +1 -1
- package/types/components/ErrorBoundary.d.ts +1 -0
- package/types/components/ErrorBoundary.d.ts.map +1 -1
- package/types/components/Form.d.ts.map +1 -1
- package/types/components/Placeholder/PlaceholderMetadata.d.ts +1 -0
- package/types/components/Placeholder/PlaceholderMetadata.d.ts.map +1 -1
- package/types/index.d.ts +3 -2
- package/types/index.d.ts.map +1 -1
- package/dist/cjs/components/DesignLibrary/DesignLibraryApp.js +0 -31
- package/dist/cjs/components/DesignLibrary/DesignLibraryClientEvents.js +0 -139
- package/dist/cjs/components/DesignLibrary/DesignLibraryServer.js +0 -212
- package/dist/cjs/server-actions/update-server-component-action.js +0 -51
- package/dist/esm/components/DesignLibrary/DesignLibraryApp.js +0 -24
- package/dist/esm/components/DesignLibrary/DesignLibraryClientEvents.js +0 -100
- package/dist/esm/components/DesignLibrary/DesignLibraryServer.js +0 -169
- package/dist/esm/server-actions/update-server-component-action.js +0 -47
- package/types/components/DesignLibrary/DesignLibraryApp.d.ts +0 -14
- package/types/components/DesignLibrary/DesignLibraryApp.d.ts.map +0 -1
- package/types/components/DesignLibrary/DesignLibraryClientEvents.d.ts +0 -21
- package/types/components/DesignLibrary/DesignLibraryClientEvents.d.ts.map +0 -1
- package/types/components/DesignLibrary/DesignLibraryServer.d.ts +0 -38
- package/types/components/DesignLibrary/DesignLibraryServer.d.ts.map +0 -1
- package/types/server-actions/update-server-component-action.d.ts +0 -58
- package/types/server-actions/update-server-component-action.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DesignLibraryClientEvents.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/DesignLibraryClientEvents.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAOzC,OAAO,EACL,+BAA+B,EAC/B,yCAAyC,EAC1C,MAAM,UAAU,CAAC;AAclB,eAAO,MAAM,kBAAkB,GAAI,OAAO,GAAG,SAU5C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GAAI,qCAGxC,+BAA+B,sBAgBjC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,oCAAoC,GAAI,4FAMlD,yCAAyC,sBAiE3C,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DesignLibraryServerProps, DesignLibraryServerPreviewProps, DesignLibraryServerVariantGenerationProps } from './models';
|
|
3
|
-
export declare const __mockDependencies: (mocks: any) => Promise<void>;
|
|
4
|
-
/**
|
|
5
|
-
* Design Library component for rendering server components in app router application.
|
|
6
|
-
*
|
|
7
|
-
* Renders the **real** Sitecore component for `library` / `library-metadata` modes and,
|
|
8
|
-
* when generation is enabled (`page.mode.designLibrary.isVariantGeneration === true`),
|
|
9
|
-
* wires the **variant generation** handshake so the parent (Design Library) can send
|
|
10
|
-
* generated code to preview and iterate on.
|
|
11
|
-
* Also renders the DesignLibraryClientEvents component which serves as a communication bridge between DesignLibraryServer and the Design Studio on the client side.
|
|
12
|
-
* @param {DesignLibraryServerProps} props The props. {@link DesignLibraryServerProps}
|
|
13
|
-
* @returns {JSX.Element} The preview surface, or `null` when not in Design Library mode.
|
|
14
|
-
*/
|
|
15
|
-
export declare const DesignLibraryServer: ({ page, componentMap, rendering, loadServerImportMap, }: DesignLibraryServerProps) => Promise<React.JSX.Element | null>;
|
|
16
|
-
/**
|
|
17
|
-
* Design Library component for rendering server components in app router application in variant generation mode.
|
|
18
|
-
*
|
|
19
|
-
* Renders the **real** Sitecore component for `library` / `library-metadata` modes on first render and,
|
|
20
|
-
* wires the **variant generation** handshake so the parent (Design Library) can send
|
|
21
|
-
* generated code to preview and iterate on.
|
|
22
|
-
* Also renders the DesignLibraryVariantGenerationEvents component which serves as a communication bridge between DesignLibraryServer and the Design Studio on the client side.
|
|
23
|
-
* @param {DesignLibraryServerVariantGenerationProps} props The props. {@link DesignLibraryServerVariantGenerationProps}
|
|
24
|
-
* @returns {JSX.Element} The preview surface, or `null` when not in Design Library mode.
|
|
25
|
-
*/
|
|
26
|
-
export declare const DesignLibraryServerVariantGeneration: ({ page, rendering, loadServerImportMap, componentMap, }: DesignLibraryServerVariantGenerationProps) => Promise<React.JSX.Element>;
|
|
27
|
-
/**
|
|
28
|
-
* Design Library component for rendering server components in app router application when variant generation is not enabled.
|
|
29
|
-
*
|
|
30
|
-
* Renders the **real** Sitecore component for `library` / `library-metadata` modes and,
|
|
31
|
-
* wires the **component update** handshake so the parent (Design Library) can send
|
|
32
|
-
* updated component props.
|
|
33
|
-
* Also renders the DesignLibraryPreviewEvents component which serves as a communication bridge between DesignLibraryServer and the Design Studio on the client side.
|
|
34
|
-
* @param {DesignLibraryServerPreviewProps} props The props. {@link DesignLibraryServerPreviewProps}
|
|
35
|
-
* @returns {JSX.Element} The preview surface, or `null` when not in Design Library mode.
|
|
36
|
-
*/
|
|
37
|
-
export declare const DesignLibraryServerPreview: ({ page, rendering, componentMap, }: DesignLibraryServerPreviewProps) => Promise<React.JSX.Element>;
|
|
38
|
-
//# sourceMappingURL=DesignLibraryServer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DesignLibraryServer.d.ts","sourceRoot":"","sources":["../../../src/components/DesignLibrary/DesignLibraryServer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B,OAAO,EAEL,wBAAwB,EACxB,+BAA+B,EAC/B,yCAAyC,EAC1C,MAAM,UAAU,CAAC;AAOlB,eAAO,MAAM,kBAAkB,GAAU,OAAO,GAAG,kBAUlD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,GAAU,yDAKvC,wBAAwB,sCAoB1B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,oCAAoC,GAAU,yDAKxD,yCAAyC,+BA6G3C,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,GAAU,oCAI9C,+BAA+B,+BAsCjC,CAAC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { ComponentRendering } from '@sitecore-content-sdk/content/layout';
|
|
2
|
-
import { ServerComponentPreviewEventArgs, GeneratedComponentData } from '@sitecore-content-sdk/content/codegen';
|
|
3
|
-
export type ComponentUpdateModel = {
|
|
4
|
-
/**
|
|
5
|
-
* Unique identifier of the component being updated.
|
|
6
|
-
*/
|
|
7
|
-
uid: string;
|
|
8
|
-
/**
|
|
9
|
-
* The updated component rendering data.
|
|
10
|
-
*/
|
|
11
|
-
rendering?: ComponentRendering;
|
|
12
|
-
/**
|
|
13
|
-
* The data needed for generated component to be rendered on the server. Required if update event is coming for a generated component in variant generation mode.
|
|
14
|
-
*/
|
|
15
|
-
generatedComponentData?: GeneratedComponentData;
|
|
16
|
-
};
|
|
17
|
-
export type ComponentPreviewModel = {
|
|
18
|
-
/**
|
|
19
|
-
* Unique identifier of the component being updated.
|
|
20
|
-
*/
|
|
21
|
-
uid: string;
|
|
22
|
-
/**
|
|
23
|
-
* The data needed for generated component to be rendered on the server
|
|
24
|
-
*/
|
|
25
|
-
generatedComponentData?: GeneratedComponentData;
|
|
26
|
-
/**
|
|
27
|
-
* Error message in case fetching generated component data from secured cache endpoint fails.
|
|
28
|
-
*/
|
|
29
|
-
error?: string;
|
|
30
|
-
};
|
|
31
|
-
export type PreviewEventModel = {
|
|
32
|
-
/**
|
|
33
|
-
* Unique identifier of the component being updated.
|
|
34
|
-
*/
|
|
35
|
-
uid: string;
|
|
36
|
-
/**
|
|
37
|
-
* The preview component event arguments in variant generation mode.
|
|
38
|
-
*/
|
|
39
|
-
args: ServerComponentPreviewEventArgs;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Server action to update global cache with the provided component updates received from Design Library.
|
|
43
|
-
* Stores the given {@link ComponentUpdateModel} in the global cache using a key based on the component UID.
|
|
44
|
-
* This enables rendering dynamic updates of server components inside Design Library
|
|
45
|
-
* @param {ComponentUpdateModel} updatedComponent - The component update model containing the UID and optional updated or preview component data.
|
|
46
|
-
* @returns A Promise that resolves when the cache has been updated.
|
|
47
|
-
*/
|
|
48
|
-
export declare function updateComponentAction(updatedComponent: ComponentUpdateModel): Promise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* Server action to update global cache with the generated component data in variant generation mode
|
|
51
|
-
* The generated component data is retrieved from a secured cache endpoint via the provided event arguments.
|
|
52
|
-
* This enables rendering dynamic updates of server components inside Design Library
|
|
53
|
-
* @param {PreviewEventModel} previewEvent - The preview event model containing the UID and the preview event arguments with cache information to fetch the generated component data.
|
|
54
|
-
* @param {string} [edgeUrl] - Optional Edge URL to fetch the generated component data.
|
|
55
|
-
* @returns A Promise that resolves when the cache has been updated.
|
|
56
|
-
*/
|
|
57
|
-
export declare function previewComponentAction(previewEvent: PreviewEventModel, edgeUrl?: string): Promise<void>;
|
|
58
|
-
//# sourceMappingURL=update-server-component-action.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-server-component-action.d.ts","sourceRoot":"","sources":["../../src/server-actions/update-server-component-action.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EACL,+BAA+B,EAC/B,sBAAsB,EAEvB,MAAM,uCAAuC,CAAC;AAO/C,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B;;OAEG;IACH,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAChD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,EAAE,+BAA+B,CAAC;CACvC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CAAC,gBAAgB,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGjG;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,YAAY,EAAE,iBAAiB,EAC/B,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
|