@notionhq/custom-blocks 0.6.0 → 0.7.0
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 +32 -18
- package/dist/bridge/SandboxBridge.d.ts +7 -8
- package/dist/bridge/SandboxBridge.d.ts.map +1 -1
- package/dist/bridge/SandboxBridge.js +39 -114
- package/dist/bridge/applyHostStateMessage.d.ts.map +1 -1
- package/dist/bridge/createBrowserSandboxBridge.d.ts +3 -0
- package/dist/bridge/createBrowserSandboxBridge.d.ts.map +1 -0
- package/dist/bridge/createBrowserSandboxBridge.js +54 -0
- package/dist/bridge/getBridge.d.ts +1 -1
- package/dist/bridge/getBridge.d.ts.map +1 -1
- package/dist/bridge/getBridge.js +2 -2
- package/dist/bridge/getInitializedHostState.d.ts.map +1 -1
- package/dist/bridge/hostState.d.ts +2 -2
- package/dist/bridge/hostState.d.ts.map +1 -1
- package/dist/bridge/initialization/SandboxInitialization.d.ts +6 -0
- package/dist/bridge/initialization/SandboxInitialization.d.ts.map +1 -1
- package/dist/bridge/initialization/SandboxInitialization.js +13 -10
- package/dist/bridge/messageInterceptor.d.ts.map +1 -1
- package/dist/bridge/requests.d.ts.map +1 -1
- package/dist/bridge/sandboxEnvironment.d.ts +30 -0
- package/dist/bridge/sandboxEnvironment.d.ts.map +1 -0
- package/dist/bridge/sandboxEnvironment.js +1 -0
- package/dist/bridge/subscribeToHostStateField.d.ts.map +1 -1
- package/dist/bridge.d.ts.map +1 -1
- package/dist/data-sources.d.ts.map +1 -1
- package/dist/dataSources/NotionDataSource.d.ts.map +1 -1
- package/dist/dataSources/bridge/DataSourceCache.d.ts +18 -0
- package/dist/dataSources/bridge/DataSourceCache.d.ts.map +1 -0
- package/dist/dataSources/bridge/DataSourceCache.js +75 -0
- package/dist/dataSources/bridge/applyDataSourceBindings.d.ts.map +1 -1
- package/dist/dataSources/bridge/makeDataSourceReadResponseSchema.d.ts.map +1 -1
- package/dist/dataSources/bridge/resolveDataSourceQuery.d.ts.map +1 -1
- package/dist/dataSources/bridge/resolveDataSources.d.ts.map +1 -1
- package/dist/dataSources/bridge/resolveSorts.d.ts.map +1 -1
- package/dist/dataSources/bridge/reuseDataSourcesForUnchangedBindings.d.ts +0 -3
- package/dist/dataSources/bridge/reuseDataSourcesForUnchangedBindings.d.ts.map +1 -1
- package/dist/dataSources/bridge/reuseDataSourcesForUnchangedBindings.js +2 -5
- package/dist/dataSources/dataSourceInaccessibleError.d.ts.map +1 -1
- package/dist/dataSources/dataSourceState.d.ts.map +1 -1
- package/dist/dataSources/ensureDataSource.d.ts.map +1 -1
- package/dist/dataSources/filters/resolveFilter.d.ts.map +1 -1
- package/dist/dataSources/filters/types.d.ts.map +1 -1
- package/dist/dataSources/getDataSourcePage.d.ts.map +1 -1
- package/dist/dataSources/observeDataSource.d.ts.map +1 -1
- package/dist/dataSources/properties/resolvePropertyAddress.d.ts.map +1 -1
- package/dist/dataSources/properties/resolvePropertyWriteMapForDataSource.d.ts.map +1 -1
- package/dist/dataSources/properties/resolvePropertyWriteMapForDataSource.js +2 -2
- package/dist/dataSources/resolvePageDataSource.d.ts.map +1 -1
- package/dist/dataSources/subscribeToDataSource.d.ts.map +1 -1
- package/dist/dataSources/types.d.ts.map +1 -1
- package/dist/files/files.d.ts +1 -1
- package/dist/files/files.d.ts.map +1 -1
- package/dist/files/icons.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/initialization/NotInIframeError.d.ts.map +1 -1
- package/dist/initialization/initCustomBlock.d.ts.map +1 -1
- package/dist/initialization/notifyReady.d.ts.map +1 -1
- package/dist/initialization/react/useCustomBlockInit.d.ts.map +1 -1
- package/dist/initialization/resolveInitialState.d.ts.map +1 -1
- package/dist/initialization/types.d.ts.map +1 -1
- package/dist/layout/autoResize.d.ts.map +1 -1
- package/dist/layout/getInitialContentHeight.d.ts.map +1 -1
- package/dist/location/getContainingPage.d.ts.map +1 -1
- package/dist/location/getInstance.d.ts.map +1 -1
- package/dist/location/getParent.d.ts.map +1 -1
- package/dist/location/mapContainingPage.d.ts +2 -2
- package/dist/location/mapContainingPage.d.ts.map +1 -1
- package/dist/location/mapParent.d.ts.map +1 -1
- package/dist/location/subscribeToContainingPage.d.ts.map +1 -1
- package/dist/location/subscribeToParent.d.ts.map +1 -1
- package/dist/location/types.d.ts.map +1 -1
- package/dist/manifest/getManifest.d.ts.map +1 -1
- package/dist/manifest/readLocalManifest.d.ts.map +1 -1
- package/dist/manifest/types.d.ts.map +1 -1
- package/dist/navigation/openExternalUrl.d.ts.map +1 -1
- package/dist/navigation/types.d.ts.map +1 -1
- package/dist/navigation.d.ts.map +1 -1
- package/dist/pages/NotionPage.d.ts.map +1 -1
- package/dist/pages/bridge/buildCreatePageRequest.d.ts.map +1 -1
- package/dist/pages/bridge/getPageForDataSource.d.ts.map +1 -1
- package/dist/pages/bridge/resolveCreatePageDestination.d.ts.map +1 -1
- package/dist/pages/bridge/sendCreatePageRequest.d.ts.map +1 -1
- package/dist/pages/bridge/toNotionPageFromBridgePage.d.ts.map +1 -1
- package/dist/pages/bridge/toNotionPagePropertyFromBridgeProperty.d.ts +2 -2
- package/dist/pages/bridge/toNotionPagePropertyFromBridgeProperty.d.ts.map +1 -1
- package/dist/pages/bridge/updatePage.d.ts.map +1 -1
- package/dist/pages/createPage.d.ts.map +1 -1
- package/dist/pages/getPage.d.ts.map +1 -1
- package/dist/pages/identityBlockKey.d.ts.map +1 -1
- package/dist/pages/identityPageKey.d.ts.map +1 -1
- package/dist/pages/openPage.d.ts.map +1 -1
- package/dist/pages/parent.d.ts.map +1 -1
- package/dist/pages/types.d.ts +5 -3
- package/dist/pages/types.d.ts.map +1 -1
- package/dist/pages.d.ts.map +1 -1
- package/dist/preferences/backgroundColors.d.ts.map +1 -1
- package/dist/preferences/getContrastMode.d.ts.map +1 -1
- package/dist/preferences/getTheme.d.ts.map +1 -1
- package/dist/preferences/react/useContrastMode.d.ts.map +1 -1
- package/dist/preferences/react/useTheme.d.ts.map +1 -1
- package/dist/preferences/subscribeToContrastMode.d.ts.map +1 -1
- package/dist/preferences/subscribeToTheme.d.ts.map +1 -1
- package/dist/preferences/syncDocumentAppearance.d.ts +1 -1
- package/dist/preferences/syncDocumentAppearance.d.ts.map +1 -1
- package/dist/preferences/syncDocumentAppearance.js +2 -1
- package/dist/preferences.d.ts.map +1 -1
- package/dist/protocol/compatibility/protocol12/hostToSandbox.d.ts +3356 -0
- package/dist/protocol/compatibility/protocol12/hostToSandbox.js +38 -0
- package/dist/protocol/compatibility/protocol12/page.d.ts +296 -0
- package/dist/protocol/compatibility/protocol12/page.js +7 -0
- package/dist/protocol/context/containingPage.d.ts +4 -2
- package/dist/protocol/context/containingPage.js +1 -1
- package/dist/protocol/context/messages/pageChanged.js +2 -2
- package/dist/protocol/dataSources/areDataSourceBindingsEqual.d.ts +3 -0
- package/dist/protocol/dataSources/areDataSourceBindingsEqual.js +26 -0
- package/dist/protocol/dataSources/messages/queryDataSource.d.ts +24 -19
- package/dist/protocol/dataSources/messages/queryDataSource.js +2 -0
- package/dist/protocol/files.d.ts +18 -0
- package/dist/protocol/files.js +9 -0
- package/dist/protocol/messages/hostToSandbox.d.ts +2200 -68
- package/dist/protocol/messages/hostToSandbox.js +6 -2
- package/dist/protocol/messages/sandboxToHost.d.ts +51 -51
- package/dist/protocol/pages/bridgePage.d.ts +20 -17
- package/dist/protocol/pages/messages/createPage.d.ts +88 -85
- package/dist/protocol/pages/messages/getPage.d.ts +24 -19
- package/dist/protocol/pages/messages/getPage.js +2 -0
- package/dist/protocol/pages/messages/updatePage.d.ts +37 -34
- package/dist/protocol/pages/properties/bridgePagePropertyMaps.d.ts +37 -34
- package/dist/protocol/pages/properties/bridgePagePropertyMaps.js +3 -3
- package/dist/protocol/pages/properties/bridgePagePropertyValue.d.ts +236 -2
- package/dist/protocol/pages/properties/bridgePagePropertyValue.js +20 -7
- package/dist/protocol/utils/errors.d.ts +6 -0
- package/dist/protocol/utils/errors.js +8 -0
- package/dist/protocol/utils/protocolVersion.d.ts +4 -2
- package/dist/protocol/utils/protocolVersion.js +4 -2
- package/dist/react/InitializationErrorDetails.d.ts.map +1 -1
- package/dist/react/MissingHostCommand.d.ts.map +1 -1
- package/dist/react/MissingHostScreen.d.ts.map +1 -1
- package/dist/react/NotionCustomBlock.d.ts.map +1 -1
- package/dist/react/index.d.ts +0 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +0 -1
- package/dist/react/useAsyncRead.d.ts.map +1 -1
- package/dist/react/useContainingPage.d.ts.map +1 -1
- package/dist/react/useLiveLocationRead.d.ts.map +1 -1
- package/dist/react/usePage.d.ts.map +1 -1
- package/dist/react/useParent.d.ts.map +1 -1
- package/dist/react/useQuerySubscription.d.ts.map +1 -1
- package/dist/react/useUserFields.d.ts.map +1 -1
- package/dist/react/useViewer.d.ts.map +1 -1
- package/dist/styles/scrollbars.css +18 -0
- package/dist/users/NotionUser.d.ts.map +1 -1
- package/dist/users/bridge/toNotionUserDataFromBridgeUser.d.ts.map +1 -1
- package/dist/users/getUser.d.ts.map +1 -1
- package/dist/users/getViewer.d.ts.map +1 -1
- package/dist/users/listUsers.d.ts.map +1 -1
- package/dist/users/types.d.ts.map +1 -1
- package/dist/users.d.ts.map +1 -1
- package/dist/utils/makeUuid.d.ts.map +1 -1
- package/dist/utils/notifyListener.d.ts.map +1 -1
- package/dist/utils/typeUtils.d.ts.map +1 -1
- package/dist/utils/unreachable.d.ts.map +1 -1
- package/dist/utils/version.d.ts.map +1 -1
- package/dist/utils/version.js +1 -1
- package/docs/block-location.md +22 -9
- package/docs/deployment.md +5 -11
- package/docs/errors.md +4 -0
- package/docs/grants.md +7 -2
- package/docs/local-development.md +39 -0
- package/docs/pages.md +97 -62
- package/package.json +2 -1
- package/src/bridge/SandboxBridge.ts +49 -144
- package/src/bridge/createBrowserSandboxBridge.ts +64 -0
- package/src/bridge/getBridge.ts +3 -2
- package/src/bridge/hostState.ts +2 -2
- package/src/bridge/initialization/SandboxInitialization.ts +24 -10
- package/src/bridge/sandboxEnvironment.ts +38 -0
- package/src/dataSources/bridge/DataSourceCache.ts +94 -0
- package/src/dataSources/bridge/reuseDataSourcesForUnchangedBindings.ts +5 -5
- package/src/dataSources/properties/resolvePropertyWriteMapForDataSource.ts +2 -2
- package/src/files/files.ts +1 -1
- package/src/location/mapContainingPage.ts +2 -2
- package/src/pages/bridge/toNotionPagePropertyFromBridgeProperty.ts +2 -2
- package/src/pages/types.ts +9 -3
- package/src/preferences/syncDocumentAppearance.ts +2 -1
- package/src/react/index.ts +0 -2
- package/src/styles/scrollbars.css +18 -0
- package/dist/react/NotionTokenScope.d.ts +0 -10
- package/dist/react/NotionTokenScope.d.ts.map +0 -1
- package/dist/react/NotionTokenScope.js +0 -12
- package/src/react/NotionTokenScope.tsx +0 -26
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
} from "@notionhq/custom-blocks-protocol/dataSources/errors.js"
|
|
5
5
|
import type { NotionDataSource } from "@notionhq/custom-blocks-protocol/dataSources/notionDataSource.js"
|
|
6
6
|
import type { CreatePageMessage } from "@notionhq/custom-blocks-protocol/pages/messages/createPage.js"
|
|
7
|
-
import {
|
|
7
|
+
import { bridgePagePropertyWriteValueSchema } from "@notionhq/custom-blocks-protocol/pages/properties/bridgePagePropertyValue.js"
|
|
8
8
|
import * as v from "valibot"
|
|
9
9
|
import type { NotionPagePropertyInputMap } from "../../pages/types.js"
|
|
10
10
|
|
|
@@ -79,7 +79,7 @@ export function resolvePropertyWriteMapForDataSource(args: {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
const parsedValue = v.safeParse(
|
|
82
|
+
const parsedValue = v.safeParse(bridgePagePropertyWriteValueSchema, {
|
|
83
83
|
...value,
|
|
84
84
|
id: propertyId,
|
|
85
85
|
})
|
package/src/files/files.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ContainingPage } from "@notionhq/custom-blocks-protocol/context/containingPage.js"
|
|
2
2
|
import { NotionPage } from "../pages/NotionPage.js"
|
|
3
3
|
import type { NotionContainingPage } from "./types.js"
|
|
4
4
|
|
|
5
|
-
export function mapContainingPage(page:
|
|
5
|
+
export function mapContainingPage(page: ContainingPage): NotionContainingPage {
|
|
6
6
|
return page.type === "unavailable"
|
|
7
7
|
? { type: "unavailable" }
|
|
8
8
|
: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BridgePagePropertyReadValue } from "@notionhq/custom-blocks-protocol/pages/properties/bridgePagePropertyValue.js"
|
|
2
2
|
import { unreachable } from "../../utils/unreachable.js"
|
|
3
3
|
import type { NotionPagePropertyValue } from "../types.js"
|
|
4
4
|
|
|
5
5
|
export function toNotionPagePropertyFromBridgeProperty(
|
|
6
|
-
value:
|
|
6
|
+
value: BridgePagePropertyReadValue,
|
|
7
7
|
): NotionPagePropertyValue {
|
|
8
8
|
switch (value.type) {
|
|
9
9
|
case "title":
|
package/src/pages/types.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
PageParent,
|
|
4
4
|
} from "@notionhq/custom-blocks-protocol/context/parent.js"
|
|
5
5
|
import type { NotionDataSource } from "@notionhq/custom-blocks-protocol/dataSources/notionDataSource.js"
|
|
6
|
+
import type { BridgeFilePropertyItem } from "@notionhq/custom-blocks-protocol/files.js"
|
|
6
7
|
import type {
|
|
7
8
|
CustomBlockCreatePageErrorInfo,
|
|
8
9
|
NotionCreatePagePosition,
|
|
@@ -33,7 +34,7 @@ export type NotionPageIcon = BridgePageIcon
|
|
|
33
34
|
|
|
34
35
|
export type NotionPageCover = BridgePageCover
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
type PagePropertyValue<FileItem> = { id: string } & (
|
|
37
38
|
| { type: "title"; title: NotionRichTextItem[] }
|
|
38
39
|
| { type: "rich_text"; rich_text: NotionRichTextItem[] }
|
|
39
40
|
| { type: "number"; number: number | null }
|
|
@@ -47,7 +48,7 @@ export type NotionPagePropertyValue = { id: string } & (
|
|
|
47
48
|
| { type: "date"; date: NotionDateInput | null }
|
|
48
49
|
| { type: "people"; people: NotionUserInput[] }
|
|
49
50
|
| { type: "relation"; relation: NotionRelationInput[]; has_more?: boolean }
|
|
50
|
-
| { type: "files"; files:
|
|
51
|
+
| { type: "files"; files: FileItem[] }
|
|
51
52
|
| { type: "place"; place: NotionPlaceInput | null }
|
|
52
53
|
| { type: "created_time"; created_time: string | null }
|
|
53
54
|
| { type: "last_edited_time"; last_edited_time: string | null }
|
|
@@ -60,12 +61,17 @@ export type NotionPagePropertyValue = { id: string } & (
|
|
|
60
61
|
| { type: "verification"; verification: string }
|
|
61
62
|
)
|
|
62
63
|
|
|
64
|
+
export type NotionPagePropertyValue = PagePropertyValue<NotionFilePropertyItem>
|
|
65
|
+
|
|
63
66
|
export type NotionPagePropertyReadMap = Record<
|
|
64
67
|
string,
|
|
65
68
|
NotionPagePropertyValue | null
|
|
66
69
|
>
|
|
67
70
|
|
|
68
|
-
export type NotionPagePropertyWriteMap = Record<
|
|
71
|
+
export type NotionPagePropertyWriteMap = Record<
|
|
72
|
+
string,
|
|
73
|
+
PagePropertyValue<BridgeFilePropertyItem>
|
|
74
|
+
>
|
|
69
75
|
|
|
70
76
|
/**
|
|
71
77
|
* Public SDK page property write input. Keys may be raw property IDs or data source
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Applies the host's theme and contrast to the document before the application renders.
|
|
10
|
-
* Styling the canvas before
|
|
10
|
+
* Styling the canvas before the application mounts prevents a flash of the default white background.
|
|
11
11
|
*/
|
|
12
12
|
export function syncDocumentAppearance(args: {
|
|
13
13
|
theme: NotionTheme
|
|
@@ -18,6 +18,7 @@ export function syncDocumentAppearance(args: {
|
|
|
18
18
|
}
|
|
19
19
|
const { theme, contrastMode } = args
|
|
20
20
|
const root = document.documentElement
|
|
21
|
+
root.classList.add("nds")
|
|
21
22
|
root.dataset.displayMode = theme
|
|
22
23
|
root.dataset.contrastMode = contrastMode
|
|
23
24
|
root.style.colorScheme = theme
|
package/src/react/index.ts
CHANGED
|
@@ -10,8 +10,6 @@ export { useContrastMode } from "../preferences/react/useContrastMode.js"
|
|
|
10
10
|
export { useTheme } from "../preferences/react/useTheme.js"
|
|
11
11
|
export type { NotionCustomBlockProps } from "./NotionCustomBlock.js"
|
|
12
12
|
export { NotionCustomBlock } from "./NotionCustomBlock.js"
|
|
13
|
-
export type { NotionTokenScopeProps } from "./NotionTokenScope.js"
|
|
14
|
-
export { NotionTokenScope } from "./NotionTokenScope.js"
|
|
15
13
|
export { useContainingPage } from "./useContainingPage.js"
|
|
16
14
|
export { usePage } from "./usePage.js"
|
|
17
15
|
export { useParent } from "./useParent.js"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* Use the scroll area's text tokens so locally themed surfaces get matching colors. */
|
|
2
|
+
:where(:root, *) {
|
|
3
|
+
scrollbar-color: var(
|
|
4
|
+
--notion-scrollbar-thumb,
|
|
5
|
+
color-mix(in srgb, var(--content-interactive-tertiary) 50%, transparent)
|
|
6
|
+
)
|
|
7
|
+
transparent;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:where([data-contrast-mode="high"], [data-contrast-mode="high"] *) {
|
|
11
|
+
scrollbar-color: auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@media (forced-colors: active) {
|
|
15
|
+
:where(:root, *) {
|
|
16
|
+
scrollbar-color: auto;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
export type NotionTokenScopeProps = {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Makes Notion design tokens available to descendants and keeps their
|
|
7
|
-
* host-controlled appearance in sync.
|
|
8
|
-
*/
|
|
9
|
-
export declare function NotionTokenScope({ children }: NotionTokenScopeProps): import("react").JSX.Element;
|
|
10
|
-
//# sourceMappingURL=NotionTokenScope.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotionTokenScope.d.ts","sourceRoot":"","sources":["../../src/react/NotionTokenScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,MAAM,qBAAqB,GAAG;IACnC,QAAQ,EAAE,SAAS,CAAA;CACnB,CAAA;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,qBAAqB,+BAanE"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useContrastMode } from "../preferences/react/useContrastMode.js";
|
|
3
|
-
import { useTheme } from "../preferences/react/useTheme.js";
|
|
4
|
-
/**
|
|
5
|
-
* Makes Notion design tokens available to descendants and keeps their
|
|
6
|
-
* host-controlled appearance in sync.
|
|
7
|
-
*/
|
|
8
|
-
export function NotionTokenScope({ children }) {
|
|
9
|
-
const theme = useTheme();
|
|
10
|
-
const contrastMode = useContrastMode();
|
|
11
|
-
return (_jsx("div", { className: "nds", "data-display-mode": theme, "data-contrast-mode": contrastMode, children: children }));
|
|
12
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react"
|
|
2
|
-
import { useContrastMode } from "../preferences/react/useContrastMode.js"
|
|
3
|
-
import { useTheme } from "../preferences/react/useTheme.js"
|
|
4
|
-
|
|
5
|
-
export type NotionTokenScopeProps = {
|
|
6
|
-
children: ReactNode
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Makes Notion design tokens available to descendants and keeps their
|
|
11
|
-
* host-controlled appearance in sync.
|
|
12
|
-
*/
|
|
13
|
-
export function NotionTokenScope({ children }: NotionTokenScopeProps) {
|
|
14
|
-
const theme = useTheme()
|
|
15
|
-
const contrastMode = useContrastMode()
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<div
|
|
19
|
-
className="nds"
|
|
20
|
-
data-display-mode={theme}
|
|
21
|
-
data-contrast-mode={contrastMode}
|
|
22
|
-
>
|
|
23
|
-
{children}
|
|
24
|
-
</div>
|
|
25
|
-
)
|
|
26
|
-
}
|