File tree Expand file tree Collapse file tree 4 files changed +21
-19
lines changed
packages/frontend/core/src/components
affine/setting-modal/general-setting/editor/edgeless
blocksuite/block-suite-editor Expand file tree Collapse file tree 4 files changed +21
-19
lines changed Original file line number Diff line number Diff line change 11import { Skeleton } from '@affine/component' ;
2+ import { getFontConfigExtension } from '@affine/core/components/blocksuite/block-suite-editor' ;
23import type { EditorSettingSchema } from '@affine/core/modules/editor-settting' ;
34import { EditorSettingService } from '@affine/core/modules/editor-settting' ;
45import type { EditorHost } from '@blocksuite/block-std' ;
@@ -71,7 +72,10 @@ export const EdgelessSnapshot = (props: Props) => {
7172
7273 const editorHost = new BlockStdScope ( {
7374 doc,
74- extensions : SpecProvider . getInstance ( ) . getSpec ( 'edgeless:preview' ) . value ,
75+ extensions : [
76+ ...SpecProvider . getInstance ( ) . getSpec ( 'edgeless:preview' ) . value ,
77+ getFontConfigExtension ( ) ,
78+ ] ,
7579 } ) . render ( ) ;
7680 docRef . current = doc ;
7781 editorHostRef . current = editorHost ;
Original file line number Diff line number Diff line change 11export * from './blocksuite-editor' ;
2+ export { getFontConfigExtension } from './specs/font-extension' ;
23
34import './ai/setup-provider' ;
45import './specs/preview' ;
Original file line number Diff line number Diff line change @@ -6,35 +6,19 @@ import { mixpanel } from '@affine/core/mixpanel';
66import { EditorSettingService } from '@affine/core/modules/editor-settting' ;
77import { ConfigExtension , type ExtensionType } from '@blocksuite/block-std' ;
88import {
9- AffineCanvasTextFonts ,
109 EdgelessRootBlockSpec ,
1110 EditorSettingExtension ,
1211 FontLoaderService ,
1312 PageRootBlockSpec ,
1413} from '@blocksuite/blocks' ;
15- import {
16- FontConfigExtension ,
17- type TelemetryEventMap ,
18- TelemetryProvider ,
19- } from '@blocksuite/blocks' ;
14+ import { type TelemetryEventMap , TelemetryProvider } from '@blocksuite/blocks' ;
2015import { type FrameworkProvider } from '@toeverything/infra' ;
2116
17+ import { getFontConfigExtension } from '../font-extension' ;
2218import { createDatabaseOptionsConfig } from './database-block' ;
2319import { createLinkedWidgetConfig } from './widgets/linked' ;
2420import { createToolbarMoreMenuConfig } from './widgets/toolbar' ;
2521
26- function getFontConfigExtension ( ) {
27- return FontConfigExtension (
28- runtimeConfig . isSelfHosted
29- ? AffineCanvasTextFonts . map ( font => ( {
30- ...font ,
31- // self-hosted fonts are served from /assets
32- url : '/assets/' + new URL ( font . url ) . pathname . split ( '/' ) . pop ( ) ,
33- } ) )
34- : AffineCanvasTextFonts
35- ) ;
36- }
37-
3822function getTelemetryExtension ( ) : ExtensionType {
3923 return {
4024 setup : di => {
Original file line number Diff line number Diff line change 1+ import { AffineCanvasTextFonts , FontConfigExtension } from '@blocksuite/blocks' ;
2+
3+ export function getFontConfigExtension ( ) {
4+ return FontConfigExtension (
5+ runtimeConfig . isSelfHosted
6+ ? AffineCanvasTextFonts . map ( font => ( {
7+ ...font ,
8+ // self-hosted fonts are served from /assets
9+ url : '/assets/' + new URL ( font . url ) . pathname . split ( '/' ) . pop ( ) ,
10+ } ) )
11+ : AffineCanvasTextFonts
12+ ) ;
13+ }
You can’t perform that action at this time.
0 commit comments