@@ -10,7 +10,7 @@ import {
1010 fields ,
1111} from '@keystone-6/fields-document/component-blocks'
1212import { type document } from '@keystone-6/fields-document'
13- import { Global , jsx } from '@emotion/react'
13+ import { Global } from '@emotion/react'
1414
1515import { getInitialPropsValue } from '../../../packages/fields-document/src/DocumentEditor/component-blocks/initial-values'
1616import { DocumentEditor , } from '../../../packages/fields-document/src/DocumentEditor'
@@ -22,9 +22,11 @@ import {
2222} from '../../../packages/fields-document/src/DocumentEditor/demo'
2323import { FormValueContentFromPreviewProps } from '../../../packages/fields-document/src/DocumentEditor/component-blocks/form-from-preview'
2424import { createGetPreviewProps } from '../../../packages/fields-document/src/DocumentEditor/component-blocks/preview-props'
25- import { componentBlocks as componentBlocksInSandboxProject } from '../../../tests/sandbox /component-blocks'
25+ import { componentBlocks as componentBlocksInExample } from '../../../examples/document-field-customisation/keystone-server/src /component-blocks'
2626import { initialContent } from '../../lib/initialDocumentDemoContent'
2727import { Code } from '../primitives/Code'
28+ import { KeystarProvider } from '@keystar/ui/core'
29+ import { useThemeContext } from '../../app/(site)/layout-client'
2830
2931const headingLevels = [ '1' , '2' , '3' , '4' , '5' , '6' ] as const
3032
@@ -86,11 +88,10 @@ type DocumentFeaturesFormValue = Parameters<
8688const emptyObj = { }
8789
8890const componentBlocks = {
89- notice : componentBlocksInSandboxProject . notice ,
90- hero : componentBlocksInSandboxProject . hero ,
91- quote : componentBlocksInSandboxProject . quote ,
92- checkboxList : componentBlocksInSandboxProject . checkboxList ,
93- carousel : componentBlocksInSandboxProject . carousel ,
91+ callout : componentBlocksInExample . callout ,
92+ hero : componentBlocksInExample . hero ,
93+ quote : componentBlocksInExample . quote ,
94+ carousel : componentBlocksInExample . carousel ,
9495}
9596
9697type DocumentFieldConfig = Parameters < typeof document > [ 0 ]
@@ -297,6 +298,7 @@ export function DocumentEditorDemo () {
297298 setKey ( x => x + 1 )
298299 } , [ documentFeatures ] )
299300
301+ const { theme } = useThemeContext ( )
300302 return (
301303 < div
302304 css = { {
@@ -336,15 +338,17 @@ export function DocumentEditorDemo () {
336338 marginBottom : 'var(--space-xlarge)' ,
337339 } }
338340 >
339- < DocumentEditor
340- key = { key }
341- value = { value }
342- onChange = { setValue }
343- componentBlocks = { componentBlocks }
344- documentFeatures = { documentFeatures }
345- relationships = { emptyObj }
346- initialExpanded
347- />
341+ < KeystarProvider colorScheme = { theme } >
342+ < DocumentEditor
343+ key = { key }
344+ value = { value }
345+ onChange = { setValue }
346+ componentBlocks = { componentBlocks }
347+ documentFeatures = { documentFeatures }
348+ relationships = { emptyObj }
349+ initialExpanded
350+ />
351+ </ KeystarProvider >
348352 </ div >
349353 < details css = { { marginBottom : 'var(--space-xlarge)' } } >
350354 < summary > View the Field Config</ summary >
0 commit comments