mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 08:53:27 +03:00
feat(core): bump blocksuite (#6965)
## Features - https://github.com/toeverything/BlockSuite/pull/7052 @donteatfriedrice ## Bugfix - https://github.com/toeverything/BlockSuite/pull/7072 @Flrande - https://github.com/toeverything/BlockSuite/pull/7073 @Flrande - https://github.com/toeverything/BlockSuite/pull/7062 @akumatus - https://github.com/toeverything/BlockSuite/pull/7066 @L-Sun - https://github.com/toeverything/BlockSuite/pull/7061 @Flrande - https://github.com/toeverything/BlockSuite/pull/7058 @L-Sun - https://github.com/toeverything/BlockSuite/pull/7060 @doouding - https://github.com/toeverything/BlockSuite/pull/7051 @L-Sun - https://github.com/toeverything/BlockSuite/pull/7054 @L-Sun - https://github.com/toeverything/BlockSuite/pull/7023 @golok727 - https://github.com/toeverything/BlockSuite/pull/7022 @golok727 - https://github.com/toeverything/BlockSuite/pull/7047 @fundon - https://github.com/toeverything/BlockSuite/pull/7043 @akumatus - https://github.com/toeverything/BlockSuite/pull/7041 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/7038 @fourdim - https://github.com/toeverything/BlockSuite/pull/7040 @regischen ## Refactor - https://github.com/toeverything/BlockSuite/pull/7068 @doouding - https://github.com/toeverything/BlockSuite/pull/7069 @zzj3720 - https://github.com/toeverything/BlockSuite/pull/7065 @Flrande - https://github.com/toeverything/BlockSuite/pull/7048 @fundon - https://github.com/toeverything/BlockSuite/pull/7045 @Flrande - https://github.com/toeverything/BlockSuite/pull/7046 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/7039 @Flrande - https://github.com/toeverything/BlockSuite/pull/7036 @Saul-Mirone - https://github.com/toeverything/BlockSuite/pull/7032 @Saul-Mirone ## Misc - https://github.com/toeverything/BlockSuite/pull/7063 @Saul-Mirone - https://github.com/toeverything/BlockSuite/pull/7050 @fourdim - https://github.com/toeverything/BlockSuite/pull/7044 @doouding - https://github.com/toeverything/BlockSuite/pull/7042 @Flrande - https://github.com/toeverything/BlockSuite/pull/6992 @doouding
This commit is contained in:
parent
bd5023d4ab
commit
35a6cf655b
4
packages/common/env/package.json
vendored
4
packages/common/env/package.json
vendored
@ -3,8 +3,8 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"@blocksuite/global": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/store": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/global": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/store": "0.15.0-canary-202405160907-89e5893",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1",
|
||||
"vitest": "1.6.0"
|
||||
|
@ -13,9 +13,9 @@
|
||||
"@affine/debug": "workspace:*",
|
||||
"@affine/env": "workspace:*",
|
||||
"@affine/templates": "workspace:*",
|
||||
"@blocksuite/blocks": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/global": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/store": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/blocks": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/global": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/store": "0.15.0-canary-202405160907-89e5893",
|
||||
"@datastructures-js/binary-search-tree": "^5.3.2",
|
||||
"foxact": "^0.2.33",
|
||||
"jotai": "^2.8.0",
|
||||
@ -30,8 +30,8 @@
|
||||
"devDependencies": {
|
||||
"@affine-test/fixtures": "workspace:*",
|
||||
"@affine/templates": "workspace:*",
|
||||
"@blocksuite/block-std": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/presets": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/block-std": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/presets": "0.15.0-canary-202405160907-89e5893",
|
||||
"@testing-library/react": "^15.0.0",
|
||||
"async-call-rpc": "^6.4.0",
|
||||
"react": "^18.2.0",
|
||||
|
@ -75,12 +75,12 @@
|
||||
"zod": "^3.22.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blocksuite/block-std": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/blocks": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/global": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/block-std": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/blocks": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/global": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/icons": "2.1.50",
|
||||
"@blocksuite/presets": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/store": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/presets": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/store": "0.15.0-canary-202405160907-89e5893",
|
||||
"@storybook/addon-actions": "^7.6.17",
|
||||
"@storybook/addon-essentials": "^7.6.17",
|
||||
"@storybook/addon-interactions": "^7.6.17",
|
||||
|
@ -18,13 +18,13 @@
|
||||
"@affine/graphql": "workspace:*",
|
||||
"@affine/i18n": "workspace:*",
|
||||
"@affine/templates": "workspace:*",
|
||||
"@blocksuite/block-std": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/blocks": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/global": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/block-std": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/blocks": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/global": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/icons": "2.1.50",
|
||||
"@blocksuite/inline": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/presets": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/store": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/inline": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/presets": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/store": "0.15.0-canary-202405160907-89e5893",
|
||||
"@dnd-kit/core": "^6.1.0",
|
||||
"@dnd-kit/modifiers": "^7.0.0",
|
||||
"@dnd-kit/sortable": "^8.0.0",
|
||||
|
@ -17,7 +17,7 @@ import {
|
||||
} from './request';
|
||||
import { setupTracker } from './tracker';
|
||||
|
||||
export function setupAIProvider() {
|
||||
function setupAIProvider() {
|
||||
// a single workspace should have only a single chat session
|
||||
// user-id:workspace-id:doc-id -> chat session id
|
||||
const chatSessions = new Map<string, Promise<string>>();
|
||||
@ -371,3 +371,5 @@ Could you make a new website based on these notes and send back just the html fi
|
||||
|
||||
setupTracker();
|
||||
}
|
||||
|
||||
setupAIProvider();
|
@ -1,8 +0,0 @@
|
||||
import { getAISpecs } from '@blocksuite/presets';
|
||||
|
||||
import { setupAIProvider } from './provider';
|
||||
|
||||
export function getParsedAISpecs() {
|
||||
setupAIProvider();
|
||||
return getAISpecs();
|
||||
}
|
@ -21,7 +21,7 @@ import {
|
||||
} from 'react';
|
||||
|
||||
import { BlocksuiteDocEditor, BlocksuiteEdgelessEditor } from './lit-adaper';
|
||||
import type { InlineRenderers } from './specs';
|
||||
import type { ReferenceReactRenderer } from './specs/custom/patch-reference-renderer';
|
||||
import * as styles from './styles.css';
|
||||
|
||||
// copy forwardSlot from blocksuite, but it seems we need to dispose the pipe
|
||||
@ -45,7 +45,7 @@ interface BlocksuiteEditorContainerProps {
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
defaultSelectedBlockId?: string;
|
||||
customRenderers?: InlineRenderers;
|
||||
referenceRenderer?: ReferenceReactRenderer;
|
||||
}
|
||||
|
||||
// mimic the interface of the webcomponent and expose slots & host
|
||||
@ -99,7 +99,7 @@ export const BlocksuiteEditorContainer = forwardRef<
|
||||
AffineEditorContainer,
|
||||
BlocksuiteEditorContainerProps
|
||||
>(function AffineEditorContainer(
|
||||
{ page, mode, className, style, defaultSelectedBlockId, customRenderers },
|
||||
{ page, mode, className, style, defaultSelectedBlockId, referenceRenderer },
|
||||
ref
|
||||
) {
|
||||
const [scrolled, setScrolled] = useState(false);
|
||||
@ -246,7 +246,7 @@ export const BlocksuiteEditorContainer = forwardRef<
|
||||
return;
|
||||
}
|
||||
const newSelection = selectManager.create('block', {
|
||||
path: blockElement.path,
|
||||
blockId: blockElement.blockId,
|
||||
});
|
||||
selectManager.set([newSelection]);
|
||||
setScrolled(true);
|
||||
@ -282,13 +282,13 @@ export const BlocksuiteEditorContainer = forwardRef<
|
||||
<BlocksuiteDocEditor
|
||||
page={page}
|
||||
ref={docRef}
|
||||
customRenderers={customRenderers}
|
||||
referenceRenderer={referenceRenderer}
|
||||
/>
|
||||
) : (
|
||||
<BlocksuiteEdgelessEditor
|
||||
page={page}
|
||||
ref={edgelessRef}
|
||||
customRenderers={customRenderers}
|
||||
referenceRenderer={referenceRenderer}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
@ -1,7 +1,4 @@
|
||||
import { EditorLoading } from '@affine/component/page-detail-skeleton';
|
||||
import { useDocMetaHelper } from '@affine/core/hooks/use-block-suite-page-meta';
|
||||
import { useJournalHelper } from '@affine/core/hooks/use-journal';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import type { AffineEditorContainer } from '@blocksuite/presets';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
@ -17,11 +14,10 @@ import {
|
||||
useRef,
|
||||
} from 'react';
|
||||
|
||||
import type { PageReferenceRendererOptions } from '../../affine/reference-link';
|
||||
import { AffinePageReference } from '../../affine/reference-link';
|
||||
import { BlocksuiteEditorContainer } from './blocksuite-editor-container';
|
||||
import { NoPageRootError } from './no-page-error';
|
||||
import type { InlineRenderers } from './specs';
|
||||
import type { ReferenceReactRenderer } from './specs/custom/patch-reference-renderer';
|
||||
|
||||
export type ErrorBoundaryProps = {
|
||||
onReset?: () => void;
|
||||
@ -59,20 +55,6 @@ function usePageRoot(page: Doc) {
|
||||
return page.root;
|
||||
}
|
||||
|
||||
const customRenderersFactory: (
|
||||
opts: Omit<PageReferenceRendererOptions, 'pageId'>
|
||||
) => InlineRenderers = opts => ({
|
||||
pageReference(reference) {
|
||||
const pageId = reference.delta.attributes?.reference?.pageId;
|
||||
if (!pageId) {
|
||||
return <span />;
|
||||
}
|
||||
return (
|
||||
<AffinePageReference docCollection={opts.docCollection} pageId={pageId} />
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
const BlockSuiteEditorImpl = forwardRef<AffineEditorContainer, EditorProps>(
|
||||
function BlockSuiteEditorImpl(
|
||||
{ mode, page, className, defaultSelectedBlockId, onLoadEditor, style },
|
||||
@ -106,18 +88,18 @@ const BlockSuiteEditorImpl = forwardRef<AffineEditorContainer, EditorProps>(
|
||||
};
|
||||
}, []);
|
||||
|
||||
const pageMetaHelper = useDocMetaHelper(page.collection);
|
||||
const journalHelper = useJournalHelper(page.collection);
|
||||
const t = useAFFiNEI18N();
|
||||
|
||||
const customRenderers = useMemo(() => {
|
||||
return customRenderersFactory({
|
||||
pageMetaHelper,
|
||||
journalHelper,
|
||||
t,
|
||||
docCollection: page.collection,
|
||||
});
|
||||
}, [journalHelper, page.collection, pageMetaHelper, t]);
|
||||
const referenceRenderer: ReferenceReactRenderer = useMemo(() => {
|
||||
return function customReference(reference) {
|
||||
const pageId = reference.delta.attributes?.reference?.pageId;
|
||||
if (!pageId) return <span />;
|
||||
return (
|
||||
<AffinePageReference
|
||||
docCollection={page.collection}
|
||||
pageId={pageId}
|
||||
/>
|
||||
);
|
||||
};
|
||||
}, [page.collection]);
|
||||
|
||||
return (
|
||||
<BlocksuiteEditorContainer
|
||||
@ -126,7 +108,7 @@ const BlockSuiteEditorImpl = forwardRef<AffineEditorContainer, EditorProps>(
|
||||
ref={onRefChange}
|
||||
className={className}
|
||||
style={style}
|
||||
customRenderers={customRenderers}
|
||||
referenceRenderer={referenceRenderer}
|
||||
defaultSelectedBlockId={defaultSelectedBlockId}
|
||||
/>
|
||||
);
|
||||
|
@ -1 +1,3 @@
|
||||
export * from './blocksuite-editor';
|
||||
|
||||
import './ai/setup-provider';
|
||||
|
@ -23,8 +23,12 @@ import React, {
|
||||
|
||||
import { PagePropertiesTable } from '../../affine/page-properties';
|
||||
import { BlocksuiteEditorJournalDocTitle } from './journal-doc-title';
|
||||
import type { InlineRenderers } from './specs';
|
||||
import { docModeSpecs, edgelessModeSpecs, patchSpecs } from './specs';
|
||||
import {
|
||||
patchReferenceRenderer,
|
||||
type ReferenceReactRenderer,
|
||||
} from './specs/custom/patch-reference-renderer';
|
||||
import { EdgelessModeSpecs } from './specs/edgeless';
|
||||
import { PageModeSpecs } from './specs/page';
|
||||
import * as styles from './styles.css';
|
||||
|
||||
const adapted = {
|
||||
@ -50,16 +54,16 @@ const adapted = {
|
||||
}),
|
||||
};
|
||||
|
||||
interface BlocksuiteDocEditorProps {
|
||||
interface BlocksuiteEditorProps {
|
||||
page: Doc;
|
||||
customRenderers?: InlineRenderers;
|
||||
referenceRenderer?: ReferenceReactRenderer;
|
||||
// todo: add option to replace docTitle with custom component (e.g., for journal page)
|
||||
}
|
||||
|
||||
export const BlocksuiteDocEditor = forwardRef<
|
||||
PageEditor,
|
||||
BlocksuiteDocEditorProps
|
||||
>(function BlocksuiteDocEditor({ page, customRenderers }, ref) {
|
||||
BlocksuiteEditorProps
|
||||
>(function BlocksuiteDocEditor({ page, referenceRenderer }, ref) {
|
||||
const titleRef = useRef<DocTitle>(null);
|
||||
const docRef = useRef<PageEditor | null>(null);
|
||||
const [docPage, setDocPage] =
|
||||
@ -80,11 +84,12 @@ export const BlocksuiteDocEditor = forwardRef<
|
||||
[ref]
|
||||
);
|
||||
|
||||
const [litToTemplate, portals] = useLitPortalFactory();
|
||||
const [reactToLit, portals] = useLitPortalFactory();
|
||||
|
||||
const specs = useMemo(() => {
|
||||
return patchSpecs(docModeSpecs, litToTemplate, customRenderers);
|
||||
}, [customRenderers, litToTemplate]);
|
||||
if (!referenceRenderer) return PageModeSpecs;
|
||||
return patchReferenceRenderer(PageModeSpecs, reactToLit, referenceRenderer);
|
||||
}, [reactToLit, referenceRenderer]);
|
||||
|
||||
useEffect(() => {
|
||||
// auto focus the title
|
||||
@ -139,12 +144,17 @@ export const BlocksuiteDocEditor = forwardRef<
|
||||
|
||||
export const BlocksuiteEdgelessEditor = forwardRef<
|
||||
EdgelessEditor,
|
||||
BlocksuiteDocEditorProps
|
||||
>(function BlocksuiteEdgelessEditor({ page, customRenderers }, ref) {
|
||||
const [litToTemplate, portals] = useLitPortalFactory();
|
||||
BlocksuiteEditorProps
|
||||
>(function BlocksuiteEdgelessEditor({ page, referenceRenderer }, ref) {
|
||||
const [reactToLit, portals] = useLitPortalFactory();
|
||||
const specs = useMemo(() => {
|
||||
return patchSpecs(edgelessModeSpecs, litToTemplate, customRenderers);
|
||||
}, [customRenderers, litToTemplate]);
|
||||
if (!referenceRenderer) return EdgelessModeSpecs;
|
||||
return patchReferenceRenderer(
|
||||
EdgelessModeSpecs,
|
||||
reactToLit,
|
||||
referenceRenderer
|
||||
);
|
||||
}, [reactToLit, referenceRenderer]);
|
||||
return (
|
||||
<>
|
||||
<adapted.EdgelessEditor ref={ref} doc={page} specs={specs} />
|
||||
|
@ -1,228 +0,0 @@
|
||||
import type { ElementOrFactory } from '@affine/component';
|
||||
import { mixpanel } from '@affine/core/utils';
|
||||
import type { BlockSpec } from '@blocksuite/block-std';
|
||||
import type { ParagraphService, RootService } from '@blocksuite/blocks';
|
||||
import {
|
||||
AffineLinkedDocWidget,
|
||||
AffineSlashMenuWidget,
|
||||
AttachmentService,
|
||||
CanvasTextFonts,
|
||||
EdgelessRootService,
|
||||
PageRootService,
|
||||
} from '@blocksuite/blocks';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
import bytes from 'bytes';
|
||||
import type { TemplateResult } from 'lit';
|
||||
|
||||
import { getParsedAISpecs } from './ai/spec';
|
||||
|
||||
const {
|
||||
pageModeSpecs: PageEditorBlockSpecs,
|
||||
edgelessModeSpecs: EdgelessEditorBlockSpecs,
|
||||
} = getParsedAISpecs();
|
||||
|
||||
class CustomAttachmentService extends AttachmentService {
|
||||
override mounted(): void {
|
||||
// blocksuite default max file size is 10MB, we override it to 2GB
|
||||
// but the real place to limit blob size is CloudQuotaModal / LocalQuotaModal
|
||||
this.maxFileSize = bytes.parse('2GB');
|
||||
super.mounted();
|
||||
}
|
||||
}
|
||||
|
||||
function customLoadFonts(service: RootService): void {
|
||||
if (runtimeConfig.isSelfHosted) {
|
||||
const fonts = CanvasTextFonts.map(font => ({
|
||||
...font,
|
||||
// self-hosted fonts are served from /assets
|
||||
url: '/assets/' + new URL(font.url).pathname.split('/').pop(),
|
||||
}));
|
||||
service.fontLoader.load(fonts);
|
||||
} else {
|
||||
service.fontLoader.load(CanvasTextFonts);
|
||||
}
|
||||
}
|
||||
|
||||
class CustomDocPageService extends PageRootService {
|
||||
override loadFonts(): void {
|
||||
customLoadFonts(this);
|
||||
}
|
||||
}
|
||||
class CustomEdgelessPageService extends EdgelessRootService {
|
||||
override loadFonts(): void {
|
||||
customLoadFonts(this);
|
||||
}
|
||||
|
||||
override addElement<T = Record<string, unknown>>(type: string, props: T) {
|
||||
const res = super.addElement(type, props);
|
||||
mixpanel.track('WhiteboardObjectCreated', {
|
||||
page: 'whiteboard editor',
|
||||
module: 'whiteboard',
|
||||
segment: 'canvas',
|
||||
// control:
|
||||
type: 'whiteboard object',
|
||||
category: type,
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
override addBlock(
|
||||
flavour: string,
|
||||
props: Record<string, unknown>,
|
||||
parent?: string | BlockModel,
|
||||
parentIndex?: number
|
||||
) {
|
||||
const res = super.addBlock(flavour, props, parent, parentIndex);
|
||||
mixpanel.track('WhiteboardObjectCreated', {
|
||||
page: 'whiteboard editor',
|
||||
module: 'whiteboard',
|
||||
segment: 'canvas',
|
||||
// control:
|
||||
type: 'whiteboard object',
|
||||
category: flavour.split(':')[1], // affine:paragraph -> paragraph
|
||||
});
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
type AffineReference = HTMLElementTagNameMap['affine-reference'];
|
||||
type PageReferenceRenderer = (reference: AffineReference) => React.ReactElement;
|
||||
|
||||
export interface InlineRenderers {
|
||||
pageReference?: PageReferenceRenderer;
|
||||
}
|
||||
|
||||
function patchSpecsWithReferenceRenderer(
|
||||
specs: BlockSpec<string>[],
|
||||
pageReferenceRenderer: PageReferenceRenderer,
|
||||
toLitTemplate: (element: ElementOrFactory) => TemplateResult
|
||||
) {
|
||||
const renderer = (reference: AffineReference) => {
|
||||
const node = pageReferenceRenderer(reference);
|
||||
return toLitTemplate(node);
|
||||
};
|
||||
return specs.map(spec => {
|
||||
if (
|
||||
['affine:paragraph', 'affine:list', 'affine:database'].includes(
|
||||
spec.schema.model.flavour
|
||||
)
|
||||
) {
|
||||
// todo: remove these type assertions
|
||||
spec.service = class extends (spec.service as typeof ParagraphService) {
|
||||
override mounted() {
|
||||
super.mounted();
|
||||
this.referenceNodeConfig.setCustomContent(renderer);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return spec;
|
||||
});
|
||||
}
|
||||
|
||||
function patchSlashMenuWidget() {
|
||||
const menuGroup = AffineSlashMenuWidget.DEFAULT_OPTIONS.menus.find(group => {
|
||||
return group.name === 'Docs';
|
||||
});
|
||||
|
||||
if (Array.isArray(menuGroup?.items)) {
|
||||
const newDocItem = menuGroup.items.find(item => {
|
||||
return item.name === 'New Doc';
|
||||
});
|
||||
|
||||
if (newDocItem) {
|
||||
const oldAction = newDocItem.action;
|
||||
newDocItem.action = async (...props) => {
|
||||
await oldAction(...props);
|
||||
mixpanel.track('DocCreated', {
|
||||
segment: 'doc',
|
||||
module: 'command menu',
|
||||
control: 'new doc command',
|
||||
type: 'doc',
|
||||
category: 'doc',
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function patchLinkedDocPopover() {
|
||||
const oldGetMenus = AffineLinkedDocWidget.DEFAULT_OPTIONS.getMenus;
|
||||
|
||||
AffineLinkedDocWidget.DEFAULT_OPTIONS.getMenus = ctx => {
|
||||
const menus = oldGetMenus(ctx);
|
||||
const newDocGroup = menus.find(group => group.name === 'New Doc');
|
||||
const newDocItem = newDocGroup?.items.find(item => item.key === 'create');
|
||||
// todo: patch import doc/workspace action
|
||||
// const importItem = newDocGroup?.items.find(item => item.key === 'import');
|
||||
|
||||
if (newDocItem) {
|
||||
const oldAction = newDocItem.action;
|
||||
newDocItem.action = async () => {
|
||||
await oldAction();
|
||||
mixpanel.track('DocCreated', {
|
||||
segment: 'doc',
|
||||
module: 'linked doc popover',
|
||||
control: 'new doc command',
|
||||
type: 'doc',
|
||||
category: 'doc',
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
return menus;
|
||||
};
|
||||
}
|
||||
|
||||
patchSlashMenuWidget();
|
||||
patchLinkedDocPopover();
|
||||
|
||||
/**
|
||||
* Patch the block specs with custom renderers.
|
||||
*/
|
||||
export function patchSpecs(
|
||||
specs: BlockSpec<string>[],
|
||||
toLitTemplate: (element: ElementOrFactory) => TemplateResult,
|
||||
inlineRenderers?: InlineRenderers
|
||||
) {
|
||||
let newSpecs = specs;
|
||||
if (inlineRenderers?.pageReference) {
|
||||
newSpecs = patchSpecsWithReferenceRenderer(
|
||||
newSpecs,
|
||||
inlineRenderers.pageReference,
|
||||
toLitTemplate
|
||||
);
|
||||
}
|
||||
return newSpecs;
|
||||
}
|
||||
|
||||
export const docModeSpecs = PageEditorBlockSpecs.map(spec => {
|
||||
if (spec.schema.model.flavour === 'affine:attachment') {
|
||||
return {
|
||||
...spec,
|
||||
service: CustomAttachmentService,
|
||||
};
|
||||
}
|
||||
if (spec.schema.model.flavour === 'affine:page') {
|
||||
return {
|
||||
...spec,
|
||||
service: CustomDocPageService,
|
||||
};
|
||||
}
|
||||
return spec;
|
||||
});
|
||||
export const edgelessModeSpecs = EdgelessEditorBlockSpecs.map(spec => {
|
||||
if (spec.schema.model.flavour === 'affine:attachment') {
|
||||
return {
|
||||
...spec,
|
||||
service: CustomAttachmentService,
|
||||
};
|
||||
}
|
||||
if (spec.schema.model.flavour === 'affine:page') {
|
||||
return {
|
||||
...spec,
|
||||
service: CustomEdgelessPageService,
|
||||
};
|
||||
}
|
||||
return spec;
|
||||
});
|
@ -0,0 +1,42 @@
|
||||
import type { BlockSpec } from '@blocksuite/block-std';
|
||||
import {
|
||||
BookmarkBlockSpec,
|
||||
CodeBlockSpec,
|
||||
DatabaseBlockSpec,
|
||||
DataViewBlockSpec,
|
||||
DividerBlockSpec,
|
||||
EmbedFigmaBlockSpec,
|
||||
EmbedGithubBlockSpec,
|
||||
EmbedHtmlBlockSpec,
|
||||
EmbedLinkedDocBlockSpec,
|
||||
EmbedLoomBlockSpec,
|
||||
EmbedSyncedDocBlockSpec,
|
||||
EmbedYoutubeBlockSpec,
|
||||
ImageBlockSpec,
|
||||
ListBlockSpec,
|
||||
NoteBlockSpec,
|
||||
} from '@blocksuite/blocks';
|
||||
import { AIParagraphBlockSpec } from '@blocksuite/presets';
|
||||
|
||||
import { CustomAttachmentBlockSpec } from './custom/attachment-block';
|
||||
|
||||
export const CommonBlockSpecs: BlockSpec[] = [
|
||||
ListBlockSpec,
|
||||
NoteBlockSpec,
|
||||
DatabaseBlockSpec,
|
||||
DataViewBlockSpec,
|
||||
DividerBlockSpec,
|
||||
CodeBlockSpec,
|
||||
ImageBlockSpec,
|
||||
BookmarkBlockSpec,
|
||||
EmbedFigmaBlockSpec,
|
||||
EmbedGithubBlockSpec,
|
||||
EmbedYoutubeBlockSpec,
|
||||
EmbedLoomBlockSpec,
|
||||
EmbedHtmlBlockSpec,
|
||||
EmbedSyncedDocBlockSpec,
|
||||
EmbedLinkedDocBlockSpec,
|
||||
// special
|
||||
CustomAttachmentBlockSpec,
|
||||
AIParagraphBlockSpec,
|
||||
];
|
@ -0,0 +1,20 @@
|
||||
import type { BlockSpec } from '@blocksuite/block-std';
|
||||
import {
|
||||
AttachmentBlockService,
|
||||
AttachmentBlockSpec,
|
||||
} from '@blocksuite/blocks';
|
||||
import bytes from 'bytes';
|
||||
|
||||
class CustomAttachmentBlockService extends AttachmentBlockService {
|
||||
override mounted(): void {
|
||||
// blocksuite default max file size is 10MB, we override it to 2GB
|
||||
// but the real place to limit blob size is CloudQuotaModal / LocalQuotaModal
|
||||
this.maxFileSize = bytes.parse('2GB');
|
||||
super.mounted();
|
||||
}
|
||||
}
|
||||
|
||||
export const CustomAttachmentBlockSpec: BlockSpec = {
|
||||
...AttachmentBlockSpec,
|
||||
service: CustomAttachmentBlockService,
|
||||
};
|
@ -0,0 +1,45 @@
|
||||
import type { ElementOrFactory } from '@affine/component';
|
||||
import type { BlockSpec } from '@blocksuite/block-std';
|
||||
import type {
|
||||
AffineReference,
|
||||
ParagraphBlockService,
|
||||
} from '@blocksuite/blocks';
|
||||
import type { TemplateResult } from 'lit';
|
||||
|
||||
export type ReferenceReactRenderer = (
|
||||
reference: AffineReference
|
||||
) => React.ReactElement;
|
||||
|
||||
/**
|
||||
* Patch the block specs with custom renderers.
|
||||
*/
|
||||
export function patchReferenceRenderer(
|
||||
specs: BlockSpec[],
|
||||
reactToLit: (element: ElementOrFactory) => TemplateResult,
|
||||
reactRenderer: ReferenceReactRenderer
|
||||
) {
|
||||
const litRenderer = (reference: AffineReference) => {
|
||||
const node = reactRenderer(reference);
|
||||
return reactToLit(node);
|
||||
};
|
||||
|
||||
return specs.map(spec => {
|
||||
if (
|
||||
['affine:paragraph', 'affine:list', 'affine:database'].includes(
|
||||
spec.schema.model.flavour
|
||||
)
|
||||
) {
|
||||
// todo: remove these type assertions
|
||||
spec.service = class extends (
|
||||
(spec.service as typeof ParagraphBlockService)
|
||||
) {
|
||||
override mounted() {
|
||||
super.mounted();
|
||||
this.referenceNodeConfig.setCustomContent(litRenderer);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return spec;
|
||||
});
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
import { mixpanel } from '@affine/core/utils';
|
||||
import type { BlockSpec } from '@blocksuite/block-std';
|
||||
import type { RootService } from '@blocksuite/blocks';
|
||||
import {
|
||||
AffineCanvasTextFonts,
|
||||
EdgelessRootService,
|
||||
PageRootService,
|
||||
} from '@blocksuite/blocks';
|
||||
import {
|
||||
AIEdgelessRootBlockSpec,
|
||||
AIPageRootBlockSpec,
|
||||
} from '@blocksuite/presets';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
|
||||
function customLoadFonts(service: RootService): void {
|
||||
if (runtimeConfig.isSelfHosted) {
|
||||
const fonts = AffineCanvasTextFonts.map(font => ({
|
||||
...font,
|
||||
// self-hosted fonts are served from /assets
|
||||
url: '/assets/' + new URL(font.url).pathname.split('/').pop(),
|
||||
}));
|
||||
service.fontLoader.load(fonts);
|
||||
} else {
|
||||
service.fontLoader.load(AffineCanvasTextFonts);
|
||||
}
|
||||
}
|
||||
|
||||
class CustomPageRootService extends PageRootService {
|
||||
override loadFonts(): void {
|
||||
customLoadFonts(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CustomEdgelessRootService extends EdgelessRootService {
|
||||
override loadFonts(): void {
|
||||
customLoadFonts(this);
|
||||
}
|
||||
|
||||
override addElement<T = Record<string, unknown>>(type: string, props: T) {
|
||||
const res = super.addElement(type, props);
|
||||
mixpanel.track('WhiteboardObjectCreated', {
|
||||
page: 'whiteboard editor',
|
||||
module: 'whiteboard',
|
||||
segment: 'canvas',
|
||||
// control:
|
||||
type: 'whiteboard object',
|
||||
category: type,
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
override addBlock(
|
||||
flavour: string,
|
||||
props: Record<string, unknown>,
|
||||
parent?: string | BlockModel,
|
||||
parentIndex?: number
|
||||
) {
|
||||
const res = super.addBlock(flavour, props, parent, parentIndex);
|
||||
mixpanel.track('WhiteboardObjectCreated', {
|
||||
page: 'whiteboard editor',
|
||||
module: 'whiteboard',
|
||||
segment: 'canvas',
|
||||
// control:
|
||||
type: 'whiteboard object',
|
||||
category: flavour.split(':')[1], // affine:paragraph -> paragraph
|
||||
});
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
export const CustomPageRootBlockSpec: BlockSpec = {
|
||||
...AIPageRootBlockSpec,
|
||||
service: CustomPageRootService,
|
||||
};
|
||||
|
||||
export const CustomEdgelessRootBlockSpec: BlockSpec = {
|
||||
...AIEdgelessRootBlockSpec,
|
||||
service: CustomEdgelessRootService,
|
||||
};
|
@ -0,0 +1,18 @@
|
||||
import type { BlockSpec } from '@blocksuite/block-std';
|
||||
import {
|
||||
EdgelessSurfaceBlockSpec,
|
||||
EdgelessSurfaceRefBlockSpec,
|
||||
FrameBlockSpec,
|
||||
} from '@blocksuite/blocks';
|
||||
|
||||
import { CommonBlockSpecs } from './common';
|
||||
import { CustomEdgelessRootBlockSpec } from './custom/root-block';
|
||||
|
||||
export const EdgelessModeSpecs: BlockSpec[] = [
|
||||
...CommonBlockSpecs,
|
||||
EdgelessSurfaceBlockSpec,
|
||||
EdgelessSurfaceRefBlockSpec,
|
||||
FrameBlockSpec,
|
||||
// special
|
||||
CustomEdgelessRootBlockSpec,
|
||||
];
|
@ -0,0 +1,16 @@
|
||||
import type { BlockSpec } from '@blocksuite/block-std';
|
||||
import {
|
||||
PageSurfaceBlockSpec,
|
||||
PageSurfaceRefBlockSpec,
|
||||
} from '@blocksuite/blocks';
|
||||
|
||||
import { CommonBlockSpecs } from './common';
|
||||
import { CustomPageRootBlockSpec } from './custom/root-block';
|
||||
|
||||
export const PageModeSpecs: BlockSpec[] = [
|
||||
...CommonBlockSpecs,
|
||||
PageSurfaceBlockSpec,
|
||||
PageSurfaceRefBlockSpec,
|
||||
// special
|
||||
CustomPageRootBlockSpec,
|
||||
];
|
@ -4,12 +4,12 @@ import { PageAIOnboarding } from '@affine/core/components/affine/ai-onboarding';
|
||||
import { useAppSettingHelper } from '@affine/core/hooks/affine/use-app-setting-helper';
|
||||
import type { PageRootService } from '@blocksuite/blocks';
|
||||
import {
|
||||
BookmarkService,
|
||||
BookmarkBlockService,
|
||||
customImageProxyMiddleware,
|
||||
EmbedGithubService,
|
||||
EmbedLoomService,
|
||||
EmbedYoutubeService,
|
||||
ImageService,
|
||||
EmbedGithubBlockService,
|
||||
EmbedLoomBlockService,
|
||||
EmbedYoutubeBlockService,
|
||||
ImageBlockService,
|
||||
} from '@blocksuite/blocks';
|
||||
import { DisposableGroup } from '@blocksuite/global/utils';
|
||||
import { type AffineEditorContainer, AIProvider } from '@blocksuite/presets';
|
||||
@ -169,13 +169,19 @@ const DetailPageImpl = memo(function DetailPageImpl() {
|
||||
editorHost.std.clipboard.use(
|
||||
customImageProxyMiddleware(runtimeConfig.imageProxyUrl)
|
||||
);
|
||||
ImageService.setImageProxyURL(runtimeConfig.imageProxyUrl);
|
||||
ImageBlockService.setImageProxyURL(runtimeConfig.imageProxyUrl);
|
||||
|
||||
// provide link preview endpoint to blocksuite
|
||||
BookmarkService.setLinkPreviewEndpoint(runtimeConfig.linkPreviewUrl);
|
||||
EmbedGithubService.setLinkPreviewEndpoint(runtimeConfig.linkPreviewUrl);
|
||||
EmbedYoutubeService.setLinkPreviewEndpoint(runtimeConfig.linkPreviewUrl);
|
||||
EmbedLoomService.setLinkPreviewEndpoint(runtimeConfig.linkPreviewUrl);
|
||||
BookmarkBlockService.setLinkPreviewEndpoint(runtimeConfig.linkPreviewUrl);
|
||||
EmbedGithubBlockService.setLinkPreviewEndpoint(
|
||||
runtimeConfig.linkPreviewUrl
|
||||
);
|
||||
EmbedYoutubeBlockService.setLinkPreviewEndpoint(
|
||||
runtimeConfig.linkPreviewUrl
|
||||
);
|
||||
EmbedLoomBlockService.setLinkPreviewEndpoint(
|
||||
runtimeConfig.linkPreviewUrl
|
||||
);
|
||||
|
||||
// provide page mode and updated date to blocksuite
|
||||
const pageService =
|
||||
|
@ -29,10 +29,10 @@
|
||||
"@affine/env": "workspace:*",
|
||||
"@affine/i18n": "workspace:*",
|
||||
"@affine/native": "workspace:*",
|
||||
"@blocksuite/block-std": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/blocks": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/presets": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/store": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/block-std": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/blocks": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/presets": "0.15.0-canary-202405160907-89e5893",
|
||||
"@blocksuite/store": "0.15.0-canary-202405160907-89e5893",
|
||||
"@electron-forge/cli": "^7.3.0",
|
||||
"@electron-forge/core": "^7.3.0",
|
||||
"@electron-forge/core-utils": "^7.3.0",
|
||||
|
@ -6,7 +6,7 @@
|
||||
"@affine/env": "workspace:*",
|
||||
"@affine/templates": "workspace:*",
|
||||
"@aws-sdk/client-s3": "3.577.0",
|
||||
"@blocksuite/presets": "0.15.0-canary-202405131108-aa6f0b7",
|
||||
"@blocksuite/presets": "0.15.0-canary-202405160907-89e5893",
|
||||
"@clack/core": "^0.3.4",
|
||||
"@clack/prompts": "^0.7.0",
|
||||
"@magic-works/i18n-codegen": "^0.6.0",
|
||||
|
206
yarn.lock
206
yarn.lock
@ -166,7 +166,7 @@ __metadata:
|
||||
"@affine/env": "workspace:*"
|
||||
"@affine/templates": "workspace:*"
|
||||
"@aws-sdk/client-s3": "npm:3.577.0"
|
||||
"@blocksuite/presets": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/presets": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@clack/core": "npm:^0.3.4"
|
||||
"@clack/prompts": "npm:^0.7.0"
|
||||
"@magic-works/i18n-codegen": "npm:^0.6.0"
|
||||
@ -219,12 +219,12 @@ __metadata:
|
||||
"@affine/electron-api": "workspace:*"
|
||||
"@affine/graphql": "workspace:*"
|
||||
"@affine/i18n": "workspace:*"
|
||||
"@blocksuite/block-std": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/blocks": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/block-std": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/blocks": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/icons": "npm:2.1.50"
|
||||
"@blocksuite/presets": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/store": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/presets": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/store": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@dnd-kit/core": "npm:^6.1.0"
|
||||
"@dnd-kit/modifiers": "npm:^7.0.0"
|
||||
"@dnd-kit/sortable": "npm:^8.0.0"
|
||||
@ -320,13 +320,13 @@ __metadata:
|
||||
"@affine/graphql": "workspace:*"
|
||||
"@affine/i18n": "workspace:*"
|
||||
"@affine/templates": "workspace:*"
|
||||
"@blocksuite/block-std": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/blocks": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/block-std": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/blocks": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/icons": "npm:2.1.50"
|
||||
"@blocksuite/inline": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/presets": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/store": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/inline": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/presets": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/store": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@dnd-kit/core": "npm:^6.1.0"
|
||||
"@dnd-kit/modifiers": "npm:^7.0.0"
|
||||
"@dnd-kit/sortable": "npm:^8.0.0"
|
||||
@ -448,10 +448,10 @@ __metadata:
|
||||
"@affine/env": "workspace:*"
|
||||
"@affine/i18n": "workspace:*"
|
||||
"@affine/native": "workspace:*"
|
||||
"@blocksuite/block-std": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/blocks": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/presets": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/store": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/block-std": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/blocks": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/presets": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/store": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@electron-forge/cli": "npm:^7.3.0"
|
||||
"@electron-forge/core": "npm:^7.3.0"
|
||||
"@electron-forge/core-utils": "npm:^7.3.0"
|
||||
@ -509,8 +509,8 @@ __metadata:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@affine/env@workspace:packages/common/env"
|
||||
dependencies:
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/store": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/store": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
lit: "npm:^3.1.2"
|
||||
react: "npm:18.3.1"
|
||||
react-dom: "npm:18.3.1"
|
||||
@ -3336,41 +3336,40 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@blocksuite/block-std@npm:0.15.0-canary-202405131108-aa6f0b7":
|
||||
version: 0.15.0-canary-202405131108-aa6f0b7
|
||||
resolution: "@blocksuite/block-std@npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/block-std@npm:0.15.0-canary-202405160907-89e5893":
|
||||
version: 0.15.0-canary-202405160907-89e5893
|
||||
resolution: "@blocksuite/block-std@npm:0.15.0-canary-202405160907-89e5893"
|
||||
dependencies:
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
lit: "npm:^3.1.3"
|
||||
lz-string: "npm:^1.5.0"
|
||||
w3c-keyname: "npm:^2.2.8"
|
||||
zod: "npm:^3.22.4"
|
||||
zod: "npm:^3.23.8"
|
||||
peerDependencies:
|
||||
"@blocksuite/inline": 0.15.0-canary-202405131108-aa6f0b7
|
||||
"@blocksuite/store": 0.15.0-canary-202405131108-aa6f0b7
|
||||
checksum: 10/1f8cf44de45c7d82c0a50dd38f9c723036c471f0033304050786101e26bd32eb8c86ac5382e57ff67a65c2fc4e6446f3d26429e12d9904e15121f7b70c00d84a
|
||||
"@blocksuite/inline": 0.15.0-canary-202405160907-89e5893
|
||||
"@blocksuite/store": 0.15.0-canary-202405160907-89e5893
|
||||
checksum: 10/33ffa71f97f3deaa50229ef44b64584771570d2e8569b9b195759a9c7cc37f90e1ed4fe6c577edacaa2afefe9fd787748496d3cced78119a8f908be285f7f451
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@blocksuite/blocks@npm:0.15.0-canary-202405131108-aa6f0b7":
|
||||
version: 0.15.0-canary-202405131108-aa6f0b7
|
||||
resolution: "@blocksuite/blocks@npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/blocks@npm:0.15.0-canary-202405160907-89e5893":
|
||||
version: 0.15.0-canary-202405160907-89e5893
|
||||
resolution: "@blocksuite/blocks@npm:0.15.0-canary-202405160907-89e5893"
|
||||
dependencies:
|
||||
"@blocksuite/block-std": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/inline": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/store": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/block-std": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/inline": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/store": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@dotlottie/player-component": "npm:^2.7.12"
|
||||
"@fal-ai/serverless-client": "npm:^0.9.3"
|
||||
"@floating-ui/dom": "npm:^1.6.3"
|
||||
"@fal-ai/serverless-client": "npm:^0.10.0"
|
||||
"@floating-ui/dom": "npm:^1.6.5"
|
||||
"@sgtpooki/file-type": "npm:1.0.1"
|
||||
"@toeverything/theme": "npm:^0.7.29"
|
||||
"@types/hast": "npm:^3.0.4"
|
||||
"@types/mdast": "npm:^4.0.3"
|
||||
"@types/mdast": "npm:^4.0.4"
|
||||
"@types/sortablejs": "npm:^1.15.8"
|
||||
"@types/webfontloader": "npm:^1.6.38"
|
||||
date-fns: "npm:^3.6.0"
|
||||
dompurify: "npm:^3.1.0"
|
||||
dompurify: "npm:^3.1.3"
|
||||
fractional-indexing: "npm:^3.2.0"
|
||||
html2canvas: "npm:^1.4.1"
|
||||
jszip: "npm:^3.10.1"
|
||||
@ -3387,27 +3386,26 @@ __metadata:
|
||||
micromark-util-combine-extensions: "npm:^2.0.0"
|
||||
minimatch: "npm:^9.0.4"
|
||||
nanoid: "npm:^5.0.7"
|
||||
openai: "npm:^4.37.1"
|
||||
openai: "npm:^4.47.1"
|
||||
pdf-lib: "npm:^1.17.1"
|
||||
rehype-parse: "npm:^9.0.0"
|
||||
rehype-stringify: "npm:^10.0.0"
|
||||
remark-parse: "npm:^11.0.0"
|
||||
remark-stringify: "npm:^11.0.0"
|
||||
shiki: "npm:^1.3.0"
|
||||
shiki: "npm:^1.5.2"
|
||||
sortablejs: "npm:^1.15.2"
|
||||
unified: "npm:^11.0.4"
|
||||
webfontloader: "npm:^1.6.28"
|
||||
zod: "npm:^3.22.4"
|
||||
checksum: 10/b07631c8447e68e9457f74261aef3ad1f69befcc8853534e9aa78ea6d2cd0c98c94d1b196deff5424cb5c724d3149aa21c669dea331b53742bcfd4dcc8aca0e4
|
||||
zod: "npm:^3.23.8"
|
||||
checksum: 10/68df0df5663447764f50981893442373b12f169653dd560a0e2c5f89d090041966f6f898d18cf67f751abee010b1a43d47eaca18c5d94733052e41b260c98c9b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@blocksuite/global@npm:0.15.0-canary-202405131108-aa6f0b7":
|
||||
version: 0.15.0-canary-202405131108-aa6f0b7
|
||||
resolution: "@blocksuite/global@npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/global@npm:0.15.0-canary-202405160907-89e5893":
|
||||
version: 0.15.0-canary-202405160907-89e5893
|
||||
resolution: "@blocksuite/global@npm:0.15.0-canary-202405160907-89e5893"
|
||||
dependencies:
|
||||
zod: "npm:^3.22.4"
|
||||
checksum: 10/4790b19f9cfcd1dc51f5f665c19c51bfe43371f06b31174b9289e29fcc043bcb8fea4ea3727c77eaea94d8c6e1334a2c6db4f0f5ba69a12438f483ba1fbc2f55
|
||||
zod: "npm:^3.23.8"
|
||||
checksum: 10/8885d6316884a505af028c24e032fb758037b41e7ef027cd2961c65839999397c5c2959f7617770b9f0351d1d38f5324b4cac014b7165c7e4dc0b6530cb692f1
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -3421,45 +3419,45 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@blocksuite/inline@npm:0.15.0-canary-202405131108-aa6f0b7":
|
||||
version: 0.15.0-canary-202405131108-aa6f0b7
|
||||
resolution: "@blocksuite/inline@npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/inline@npm:0.15.0-canary-202405160907-89e5893":
|
||||
version: 0.15.0-canary-202405160907-89e5893
|
||||
resolution: "@blocksuite/inline@npm:0.15.0-canary-202405160907-89e5893"
|
||||
dependencies:
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
zod: "npm:^3.22.4"
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
zod: "npm:^3.23.8"
|
||||
peerDependencies:
|
||||
lit: ^3.1.1
|
||||
yjs: ^13
|
||||
checksum: 10/26f66cc9ebc070f294238ec543b69ea788a8fc2c48feeb74c3cbdcab3bf9846b8360143670fe52dec71bb6e33ff1891de2397df54c4fe317f9b3f50752e6a784
|
||||
yjs: ^13.6.15
|
||||
checksum: 10/6d645d07f30a6ccd8ab09dacb92dd1494612ee7e0f68b51b60458c91e15bb9339470cca7456b96265a68d7b84aff813209567f882423043cc91ab0a5089ba000
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@blocksuite/presets@npm:0.15.0-canary-202405131108-aa6f0b7":
|
||||
version: 0.15.0-canary-202405131108-aa6f0b7
|
||||
resolution: "@blocksuite/presets@npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/presets@npm:0.15.0-canary-202405160907-89e5893":
|
||||
version: 0.15.0-canary-202405160907-89e5893
|
||||
resolution: "@blocksuite/presets@npm:0.15.0-canary-202405160907-89e5893"
|
||||
dependencies:
|
||||
"@blocksuite/block-std": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/blocks": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/inline": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/store": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/block-std": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/blocks": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/inline": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/store": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@dotlottie/player-component": "npm:^2.7.12"
|
||||
"@fal-ai/serverless-client": "npm:^0.9.3"
|
||||
"@floating-ui/dom": "npm:^1.6.3"
|
||||
"@fal-ai/serverless-client": "npm:^0.10.0"
|
||||
"@floating-ui/dom": "npm:^1.6.5"
|
||||
"@toeverything/theme": "npm:^0.7.29"
|
||||
lit: "npm:^3.1.3"
|
||||
openai: "npm:^4.37.1"
|
||||
checksum: 10/c7399b27f7d68aca1194ef5ae4156f6643493941b12f02d761ccc70846e923636ee955b570997cf77b7674c95994ee04daa39608f23ecbc10e0fa2c79c24de1e
|
||||
openai: "npm:^4.47.1"
|
||||
checksum: 10/d6717c1c8b3f6ed4b926c7bb2cec734d6a521def8b7748f42b6774758a2dac8a7d64cd847d28883558d177300f4986ffc81501049dabfca4da0658f1b8e50a71
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@blocksuite/store@npm:0.15.0-canary-202405131108-aa6f0b7":
|
||||
version: 0.15.0-canary-202405131108-aa6f0b7
|
||||
resolution: "@blocksuite/store@npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/store@npm:0.15.0-canary-202405160907-89e5893":
|
||||
version: 0.15.0-canary-202405160907-89e5893
|
||||
resolution: "@blocksuite/store@npm:0.15.0-canary-202405160907-89e5893"
|
||||
dependencies:
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/inline": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/sync": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/inline": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/sync": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@types/flexsearch": "npm:^0.7.6"
|
||||
flexsearch: "npm:0.7.43"
|
||||
idb-keyval: "npm:^6.2.1"
|
||||
@ -3468,23 +3466,23 @@ __metadata:
|
||||
minimatch: "npm:^9.0.4"
|
||||
nanoid: "npm:^5.0.7"
|
||||
y-protocols: "npm:^1.0.6"
|
||||
zod: "npm:^3.22.4"
|
||||
zod: "npm:^3.23.8"
|
||||
peerDependencies:
|
||||
yjs: ^13
|
||||
checksum: 10/d04915eed25b84b6a20f4b3d36cc3b46734832e22a7dc4d6857d7077f9030b5719cdc9b5843df6e6573f6c7e3fd5fb80a739254e166decfa19f4a18fdb9595ed
|
||||
yjs: ^13.6.15
|
||||
checksum: 10/0affad44d13b992f41afb524406df36dce4fc38c07322967494a649dd8999635eacb8850ddca264f9ec4aee7440a10f4247ecb262948015806b04ff2b3cb0187
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@blocksuite/sync@npm:0.15.0-canary-202405131108-aa6f0b7":
|
||||
version: 0.15.0-canary-202405131108-aa6f0b7
|
||||
resolution: "@blocksuite/sync@npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/sync@npm:0.15.0-canary-202405160907-89e5893":
|
||||
version: 0.15.0-canary-202405160907-89e5893
|
||||
resolution: "@blocksuite/sync@npm:0.15.0-canary-202405160907-89e5893"
|
||||
dependencies:
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
idb: "npm:^8.0.0"
|
||||
y-protocols: "npm:^1.0.6"
|
||||
peerDependencies:
|
||||
yjs: ^13
|
||||
checksum: 10/caac48991b235e6039141a2006097fffd0294fa587b5bdd1902f94d0f8a174c2a7552274f98110b5e6ad3db4733e1dee59bc4f5a83663ec7c4cb3fb6f5665c96
|
||||
yjs: ^13.6.15
|
||||
checksum: 10/35e8149dd174230567a4676cc035f7430149eb076ff4eb37b9bf47fd939b17367936293f4f9cff067fa191cc68cfeda0882d40c22735d5ede21ff3291977fa96
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -5419,15 +5417,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@fal-ai/serverless-client@npm:^0.9.3":
|
||||
version: 0.9.3
|
||||
resolution: "@fal-ai/serverless-client@npm:0.9.3"
|
||||
"@fal-ai/serverless-client@npm:^0.10.0":
|
||||
version: 0.10.0
|
||||
resolution: "@fal-ai/serverless-client@npm:0.10.0"
|
||||
dependencies:
|
||||
"@msgpack/msgpack": "npm:^3.0.0-beta2"
|
||||
eventsource-parser: "npm:^1.1.2"
|
||||
robot3: "npm:^0.4.1"
|
||||
uuid-random: "npm:^1.3.2"
|
||||
checksum: 10/3b0ff879e77126f3bf55d4164f943da9689c48d4f1acb46df89eb92c912d0c0290f63a964b41d0b319e2da3dfb69f825bf8cdadbae55449dc99f047fa941211d
|
||||
checksum: 10/46bf17fa08523ad6847c063535458b2f132e2baa0e40c70f09b881112d8aa3fa8d3be085e4f915cfe5106f8ad6abe31e7a8236e05acf7a884f17a78ae24a705b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -5465,7 +5463,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@floating-ui/dom@npm:^1.0.0, @floating-ui/dom@npm:^1.6.3":
|
||||
"@floating-ui/dom@npm:^1.0.0, @floating-ui/dom@npm:^1.6.5":
|
||||
version: 1.6.5
|
||||
resolution: "@floating-ui/dom@npm:1.6.5"
|
||||
dependencies:
|
||||
@ -14425,11 +14423,11 @@ __metadata:
|
||||
"@affine/debug": "workspace:*"
|
||||
"@affine/env": "workspace:*"
|
||||
"@affine/templates": "workspace:*"
|
||||
"@blocksuite/block-std": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/blocks": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/presets": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/store": "npm:0.15.0-canary-202405131108-aa6f0b7"
|
||||
"@blocksuite/block-std": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/blocks": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/global": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/presets": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@blocksuite/store": "npm:0.15.0-canary-202405160907-89e5893"
|
||||
"@datastructures-js/binary-search-tree": "npm:^5.3.2"
|
||||
"@testing-library/react": "npm:^15.0.0"
|
||||
async-call-rpc: "npm:^6.4.0"
|
||||
@ -15229,7 +15227,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/mdast@npm:^4.0.0, @types/mdast@npm:^4.0.3":
|
||||
"@types/mdast@npm:^4.0.0, @types/mdast@npm:^4.0.4":
|
||||
version: 4.0.4
|
||||
resolution: "@types/mdast@npm:4.0.4"
|
||||
dependencies:
|
||||
@ -15683,13 +15681,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/webfontloader@npm:^1.6.38":
|
||||
version: 1.6.38
|
||||
resolution: "@types/webfontloader@npm:1.6.38"
|
||||
checksum: 10/2be3d1e43837ddeea8ea0390d0952fc735abc6d713b2b87843ad0a6d4acd6628b2ce8f0280ec81d48144a23e358d1bd22c16e4717cc8d67f75c1cd1ddc2d0f27
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/webpack-env@npm:^1.18.4":
|
||||
version: 1.18.5
|
||||
resolution: "@types/webpack-env@npm:1.18.5"
|
||||
@ -20611,7 +20602,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"dompurify@npm:^3.1.0":
|
||||
"dompurify@npm:^3.1.3":
|
||||
version: 3.1.3
|
||||
resolution: "dompurify@npm:3.1.3"
|
||||
checksum: 10/bb1badf23e8b8c32e116339ae70842465f35706be0d3b2c38a392f3ee1f32e73dbabee6462e9e89406a527e837100b75002b86d8f386937663448cbdf714c466
|
||||
@ -30180,7 +30171,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"openai@npm:^4.33.0, openai@npm:^4.37.1":
|
||||
"openai@npm:^4.33.0, openai@npm:^4.47.1":
|
||||
version: 4.47.1
|
||||
resolution: "openai@npm:4.47.1"
|
||||
dependencies:
|
||||
@ -33859,7 +33850,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"shiki@npm:^1.3.0":
|
||||
"shiki@npm:^1.5.2":
|
||||
version: 1.5.2
|
||||
resolution: "shiki@npm:1.5.2"
|
||||
dependencies:
|
||||
@ -37140,13 +37131,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"webfontloader@npm:^1.6.28":
|
||||
version: 1.6.28
|
||||
resolution: "webfontloader@npm:1.6.28"
|
||||
checksum: 10/fba6a6a41222d893401aa43199ba3937679a6d71a7e1aeed1fc57d2f034c96fefa267b57cf9aff6af5877fed78c11a5327d7f3c8d3d6f2bfb7543fce8640e5f0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"webidl-conversions@npm:^3.0.0":
|
||||
version: 3.0.1
|
||||
resolution: "webidl-conversions@npm:3.0.1"
|
||||
@ -37993,7 +37977,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"zod@npm:^3.20.6, zod@npm:^3.22.4":
|
||||
"zod@npm:^3.20.6, zod@npm:^3.22.4, zod@npm:^3.23.8":
|
||||
version: 3.23.8
|
||||
resolution: "zod@npm:3.23.8"
|
||||
checksum: 10/846fd73e1af0def79c19d510ea9e4a795544a67d5b34b7e1c4d0425bf6bfd1c719446d94cdfa1721c1987d891321d61f779e8236fde517dc0e524aa851a6eff1
|
||||
|
Loading…
Reference in New Issue
Block a user