refactor(editor): extract bookmark block (#9304)
This commit is contained in:
43
blocksuite/affine/block-bookmark/package.json
Normal file
43
blocksuite/affine/block-bookmark/package.json
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"name": "@blocksuite/affine-block-bookmark",
|
||||||
|
"description": "Bookmark block for BlockSuite.",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"build": "tsc",
|
||||||
|
"test:unit": "nx vite:test --run --passWithNoTests",
|
||||||
|
"test:unit:coverage": "nx vite:test --run --coverage",
|
||||||
|
"test:e2e": "playwright test"
|
||||||
|
},
|
||||||
|
"sideEffects": false,
|
||||||
|
"keywords": [],
|
||||||
|
"author": "toeverything",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@blocksuite/affine-block-embed": "workspace:*",
|
||||||
|
"@blocksuite/affine-components": "workspace:*",
|
||||||
|
"@blocksuite/affine-model": "workspace:*",
|
||||||
|
"@blocksuite/affine-shared": "workspace:*",
|
||||||
|
"@blocksuite/block-std": "workspace:*",
|
||||||
|
"@blocksuite/global": "workspace:*",
|
||||||
|
"@blocksuite/icons": "^2.1.75",
|
||||||
|
"@blocksuite/inline": "workspace:*",
|
||||||
|
"@blocksuite/store": "workspace:*",
|
||||||
|
"@floating-ui/dom": "^1.6.10",
|
||||||
|
"@lit/context": "^1.1.2",
|
||||||
|
"@preact/signals-core": "^1.8.0",
|
||||||
|
"@toeverything/theme": "^1.1.1",
|
||||||
|
"lit": "^3.2.0",
|
||||||
|
"minimatch": "^10.0.1",
|
||||||
|
"zod": "^3.23.8"
|
||||||
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./src/index.ts",
|
||||||
|
"./effects": "./src/effects.ts"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src",
|
||||||
|
"dist",
|
||||||
|
"!src/__tests__",
|
||||||
|
"!dist/__tests__"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -9,10 +9,11 @@ import { property, query } from 'lit/decorators.js';
|
|||||||
import { classMap } from 'lit/directives/class-map.js';
|
import { classMap } from 'lit/directives/class-map.js';
|
||||||
import { type StyleInfo, styleMap } from 'lit/directives/style-map.js';
|
import { type StyleInfo, styleMap } from 'lit/directives/style-map.js';
|
||||||
|
|
||||||
import { BOOKMARK_MIN_WIDTH } from '../root-block/edgeless/utils/consts.js';
|
|
||||||
import type { BookmarkBlockService } from './bookmark-service.js';
|
import type { BookmarkBlockService } from './bookmark-service.js';
|
||||||
import { refreshBookmarkUrlData } from './utils.js';
|
import { refreshBookmarkUrlData } from './utils.js';
|
||||||
|
|
||||||
|
export const BOOKMARK_MIN_WIDTH = 450;
|
||||||
|
|
||||||
export class BookmarkBlockComponent extends CaptionedBlockComponent<
|
export class BookmarkBlockComponent extends CaptionedBlockComponent<
|
||||||
BookmarkBlockModel,
|
BookmarkBlockModel,
|
||||||
BookmarkBlockService
|
BookmarkBlockService
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import '@blocksuite/affine-block-embed/effects';
|
||||||
|
|
||||||
import { insertEmbedCard } from '@blocksuite/affine-block-embed';
|
import { insertEmbedCard } from '@blocksuite/affine-block-embed';
|
||||||
import type { EmbedCardStyle } from '@blocksuite/affine-model';
|
import type { EmbedCardStyle } from '@blocksuite/affine-model';
|
||||||
import { EmbedOptionProvider } from '@blocksuite/affine-shared/services';
|
import { EmbedOptionProvider } from '@blocksuite/affine-shared/services';
|
||||||
25
blocksuite/affine/block-bookmark/src/effects.ts
Normal file
25
blocksuite/affine/block-bookmark/src/effects.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import { BookmarkBlockComponent } from './bookmark-block';
|
||||||
|
import { BookmarkEdgelessBlockComponent } from './bookmark-edgeless-block';
|
||||||
|
import type { BookmarkBlockService } from './bookmark-service';
|
||||||
|
import type { insertBookmarkCommand } from './commands/insert-bookmark';
|
||||||
|
import { BookmarkCard } from './components/bookmark-card';
|
||||||
|
|
||||||
|
export function effects() {
|
||||||
|
customElements.define(
|
||||||
|
'affine-edgeless-bookmark',
|
||||||
|
BookmarkEdgelessBlockComponent
|
||||||
|
);
|
||||||
|
customElements.define('affine-bookmark', BookmarkBlockComponent);
|
||||||
|
customElements.define('bookmark-card', BookmarkCard);
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
namespace BlockSuite {
|
||||||
|
interface Commands {
|
||||||
|
insertBookmark: typeof insertBookmarkCommand;
|
||||||
|
}
|
||||||
|
interface BlockServices {
|
||||||
|
'affine:bookmark': BookmarkBlockService;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
4
blocksuite/affine/block-bookmark/src/index.ts
Normal file
4
blocksuite/affine/block-bookmark/src/index.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export * from './adapters';
|
||||||
|
export * from './bookmark-block';
|
||||||
|
export * from './bookmark-service';
|
||||||
|
export * from './bookmark-spec';
|
||||||
35
blocksuite/affine/block-bookmark/tsconfig.json
Normal file
35
blocksuite/affine/block-bookmark/tsconfig.json
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "./src/",
|
||||||
|
"outDir": "./dist/",
|
||||||
|
"noEmit": false
|
||||||
|
},
|
||||||
|
"include": ["./src"],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "../../framework/global"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../../framework/store"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../../framework/block-std"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../../framework/inline"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../model"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../components"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../shared"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../block-embed"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": ["../../../typedoc.base.json"],
|
|
||||||
"entryPoints": ["src/index.ts"]
|
|
||||||
}
|
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
"author": "toeverything",
|
"author": "toeverything",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@blocksuite/affine-block-bookmark": "workspace:*",
|
||||||
"@blocksuite/affine-block-embed": "workspace:*",
|
"@blocksuite/affine-block-embed": "workspace:*",
|
||||||
"@blocksuite/affine-block-list": "workspace:*",
|
"@blocksuite/affine-block-list": "workspace:*",
|
||||||
"@blocksuite/affine-block-paragraph": "workspace:*",
|
"@blocksuite/affine-block-paragraph": "workspace:*",
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { BookmarkBlockHtmlAdapterExtension } from '@blocksuite/affine-block-bookmark';
|
||||||
import {
|
import {
|
||||||
EmbedFigmaBlockHtmlAdapterExtension,
|
EmbedFigmaBlockHtmlAdapterExtension,
|
||||||
EmbedGithubBlockHtmlAdapterExtension,
|
EmbedGithubBlockHtmlAdapterExtension,
|
||||||
@@ -9,7 +10,6 @@ import {
|
|||||||
import { ListBlockHtmlAdapterExtension } from '@blocksuite/affine-block-list';
|
import { ListBlockHtmlAdapterExtension } from '@blocksuite/affine-block-list';
|
||||||
import { ParagraphBlockHtmlAdapterExtension } from '@blocksuite/affine-block-paragraph';
|
import { ParagraphBlockHtmlAdapterExtension } from '@blocksuite/affine-block-paragraph';
|
||||||
|
|
||||||
import { BookmarkBlockHtmlAdapterExtension } from '../../../bookmark-block/adapters/html.js';
|
|
||||||
import { CodeBlockHtmlAdapterExtension } from '../../../code-block/adapters/html.js';
|
import { CodeBlockHtmlAdapterExtension } from '../../../code-block/adapters/html.js';
|
||||||
import { DatabaseBlockHtmlAdapterExtension } from '../../../database-block/adapters/html.js';
|
import { DatabaseBlockHtmlAdapterExtension } from '../../../database-block/adapters/html.js';
|
||||||
import { DividerBlockHtmlAdapterExtension } from '../../../divider-block/adapters/html.js';
|
import { DividerBlockHtmlAdapterExtension } from '../../../divider-block/adapters/html.js';
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { bookmarkBlockMarkdownAdapterMatcher } from '@blocksuite/affine-block-bookmark';
|
||||||
import {
|
import {
|
||||||
embedFigmaBlockMarkdownAdapterMatcher,
|
embedFigmaBlockMarkdownAdapterMatcher,
|
||||||
embedGithubBlockMarkdownAdapterMatcher,
|
embedGithubBlockMarkdownAdapterMatcher,
|
||||||
@@ -9,7 +10,6 @@ import {
|
|||||||
import { listBlockMarkdownAdapterMatcher } from '@blocksuite/affine-block-list';
|
import { listBlockMarkdownAdapterMatcher } from '@blocksuite/affine-block-list';
|
||||||
import { paragraphBlockMarkdownAdapterMatcher } from '@blocksuite/affine-block-paragraph';
|
import { paragraphBlockMarkdownAdapterMatcher } from '@blocksuite/affine-block-paragraph';
|
||||||
|
|
||||||
import { bookmarkBlockMarkdownAdapterMatcher } from '../../../bookmark-block/adapters/markdown.js';
|
|
||||||
import { codeBlockMarkdownAdapterMatcher } from '../../../code-block/adapters/markdown.js';
|
import { codeBlockMarkdownAdapterMatcher } from '../../../code-block/adapters/markdown.js';
|
||||||
import { databaseBlockMarkdownAdapterMatcher } from '../../../database-block/adapters/markdown.js';
|
import { databaseBlockMarkdownAdapterMatcher } from '../../../database-block/adapters/markdown.js';
|
||||||
import { dividerBlockMarkdownAdapterMatcher } from '../../../divider-block/adapters/markdown.js';
|
import { dividerBlockMarkdownAdapterMatcher } from '../../../divider-block/adapters/markdown.js';
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { bookmarkBlockNotionHtmlAdapterMatcher } from '@blocksuite/affine-block-bookmark';
|
||||||
import {
|
import {
|
||||||
embedFigmaBlockNotionHtmlAdapterMatcher,
|
embedFigmaBlockNotionHtmlAdapterMatcher,
|
||||||
embedGithubBlockNotionHtmlAdapterMatcher,
|
embedGithubBlockNotionHtmlAdapterMatcher,
|
||||||
@@ -9,7 +10,6 @@ import { paragraphBlockNotionHtmlAdapterMatcher } from '@blocksuite/affine-block
|
|||||||
import type { BlockNotionHtmlAdapterMatcher } from '@blocksuite/affine-shared/adapters';
|
import type { BlockNotionHtmlAdapterMatcher } from '@blocksuite/affine-shared/adapters';
|
||||||
|
|
||||||
import { attachmentBlockNotionHtmlAdapterMatcher } from '../../../attachment-block/adapters/notion-html.js';
|
import { attachmentBlockNotionHtmlAdapterMatcher } from '../../../attachment-block/adapters/notion-html.js';
|
||||||
import { bookmarkBlockNotionHtmlAdapterMatcher } from '../../../bookmark-block/adapters/notion-html.js';
|
|
||||||
import { codeBlockNotionHtmlAdapterMatcher } from '../../../code-block/adapters/notion-html.js';
|
import { codeBlockNotionHtmlAdapterMatcher } from '../../../code-block/adapters/notion-html.js';
|
||||||
import { databaseBlockNotionHtmlAdapterMatcher } from '../../../database-block/adapters/notion-html.js';
|
import { databaseBlockNotionHtmlAdapterMatcher } from '../../../database-block/adapters/notion-html.js';
|
||||||
import { dividerBlockNotionHtmlAdapterMatcher } from '../../../divider-block/adapters/notion-html.js';
|
import { dividerBlockNotionHtmlAdapterMatcher } from '../../../divider-block/adapters/notion-html.js';
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { bookmarkBlockPlainTextAdapterMatcher } from '@blocksuite/affine-block-bookmark';
|
||||||
import {
|
import {
|
||||||
embedFigmaBlockPlainTextAdapterMatcher,
|
embedFigmaBlockPlainTextAdapterMatcher,
|
||||||
embedGithubBlockPlainTextAdapterMatcher,
|
embedGithubBlockPlainTextAdapterMatcher,
|
||||||
@@ -10,7 +11,6 @@ import { listBlockPlainTextAdapterMatcher } from '@blocksuite/affine-block-list'
|
|||||||
import { paragraphBlockPlainTextAdapterMatcher } from '@blocksuite/affine-block-paragraph';
|
import { paragraphBlockPlainTextAdapterMatcher } from '@blocksuite/affine-block-paragraph';
|
||||||
import type { BlockPlainTextAdapterMatcher } from '@blocksuite/affine-shared/adapters';
|
import type { BlockPlainTextAdapterMatcher } from '@blocksuite/affine-shared/adapters';
|
||||||
|
|
||||||
import { bookmarkBlockPlainTextAdapterMatcher } from '../../../bookmark-block/adapters/plain-text.js';
|
|
||||||
import { codeBlockPlainTextAdapterMatcher } from '../../../code-block/adapters/plain-text.js';
|
import { codeBlockPlainTextAdapterMatcher } from '../../../code-block/adapters/plain-text.js';
|
||||||
import { databaseBlockPlainTextAdapterMatcher } from '../../../database-block/adapters/plain-text.js';
|
import { databaseBlockPlainTextAdapterMatcher } from '../../../database-block/adapters/plain-text.js';
|
||||||
import { dividerBlockPlainTextAdapterMatcher } from '../../../divider-block/adapters/plain-text.js';
|
import { dividerBlockPlainTextAdapterMatcher } from '../../../divider-block/adapters/plain-text.js';
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { BookmarkBlockComponent } from '@blocksuite/affine-block-bookmark';
|
||||||
import {
|
import {
|
||||||
EmbedFigmaBlockComponent,
|
EmbedFigmaBlockComponent,
|
||||||
EmbedGithubBlockComponent,
|
EmbedGithubBlockComponent,
|
||||||
@@ -21,8 +22,6 @@ import {
|
|||||||
} from '@blocksuite/affine-model';
|
} from '@blocksuite/affine-model';
|
||||||
import type { BlockComponent } from '@blocksuite/block-std';
|
import type { BlockComponent } from '@blocksuite/block-std';
|
||||||
|
|
||||||
import { BookmarkBlockComponent } from '../../../bookmark-block/bookmark-block.js';
|
|
||||||
|
|
||||||
export type ExternalEmbedBlockComponent =
|
export type ExternalEmbedBlockComponent =
|
||||||
| BookmarkBlockComponent
|
| BookmarkBlockComponent
|
||||||
| EmbedFigmaBlockComponent
|
| EmbedFigmaBlockComponent
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { BookmarkBlockSpec } from '@blocksuite/affine-block-bookmark';
|
||||||
import { EmbedExtensions } from '@blocksuite/affine-block-embed';
|
import { EmbedExtensions } from '@blocksuite/affine-block-embed';
|
||||||
import { ListBlockSpec } from '@blocksuite/affine-block-list';
|
import { ListBlockSpec } from '@blocksuite/affine-block-list';
|
||||||
import { ParagraphBlockSpec } from '@blocksuite/affine-block-paragraph';
|
import { ParagraphBlockSpec } from '@blocksuite/affine-block-paragraph';
|
||||||
@@ -7,7 +8,6 @@ import type { ExtensionType } from '@blocksuite/block-std';
|
|||||||
|
|
||||||
import { AdapterFactoryExtensions } from '../_common/adapters/extension.js';
|
import { AdapterFactoryExtensions } from '../_common/adapters/extension.js';
|
||||||
import { AttachmentBlockSpec } from '../attachment-block/attachment-spec.js';
|
import { AttachmentBlockSpec } from '../attachment-block/attachment-spec.js';
|
||||||
import { BookmarkBlockSpec } from '../bookmark-block/bookmark-spec.js';
|
|
||||||
import { CodeBlockSpec } from '../code-block/code-block-spec.js';
|
import { CodeBlockSpec } from '../code-block/code-block-spec.js';
|
||||||
import { DataViewBlockSpec } from '../data-view-block/data-view-spec.js';
|
import { DataViewBlockSpec } from '../data-view-block/data-view-spec.js';
|
||||||
import { DatabaseBlockSpec } from '../database-block/database-spec.js';
|
import { DatabaseBlockSpec } from '../database-block/database-spec.js';
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { BookmarkBlockSpec } from '@blocksuite/affine-block-bookmark';
|
||||||
import {
|
import {
|
||||||
EmbedFigmaBlockSpec,
|
EmbedFigmaBlockSpec,
|
||||||
EmbedGithubBlockSpec,
|
EmbedGithubBlockSpec,
|
||||||
@@ -11,7 +12,6 @@ import { ListBlockSpec } from '@blocksuite/affine-block-list';
|
|||||||
import { ParagraphBlockSpec } from '@blocksuite/affine-block-paragraph';
|
import { ParagraphBlockSpec } from '@blocksuite/affine-block-paragraph';
|
||||||
|
|
||||||
import { AttachmentBlockSpec } from '../../attachment-block/attachment-spec.js';
|
import { AttachmentBlockSpec } from '../../attachment-block/attachment-spec.js';
|
||||||
import { BookmarkBlockSpec } from '../../bookmark-block/bookmark-spec.js';
|
|
||||||
import { CodeBlockSpec } from '../../code-block/code-block-spec.js';
|
import { CodeBlockSpec } from '../../code-block/code-block-spec.js';
|
||||||
import { DataViewBlockSpec } from '../../data-view-block/data-view-spec.js';
|
import { DataViewBlockSpec } from '../../data-view-block/data-view-spec.js';
|
||||||
import { DatabaseBlockSpec } from '../../database-block/database-spec.js';
|
import { DatabaseBlockSpec } from '../../database-block/database-spec.js';
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
export * from './adapters/index.js';
|
|
||||||
export * from './bookmark-block.js';
|
|
||||||
export * from './bookmark-service.js';
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { effects as blockBookmarkEffects } from '@blocksuite/affine-block-bookmark/effects';
|
||||||
import { effects as blockEmbedEffects } from '@blocksuite/affine-block-embed/effects';
|
import { effects as blockEmbedEffects } from '@blocksuite/affine-block-embed/effects';
|
||||||
import { effects as blockListEffects } from '@blocksuite/affine-block-list/effects';
|
import { effects as blockListEffects } from '@blocksuite/affine-block-list/effects';
|
||||||
import { effects as blockParagraphEffects } from '@blocksuite/affine-block-paragraph/effects';
|
import { effects as blockParagraphEffects } from '@blocksuite/affine-block-paragraph/effects';
|
||||||
@@ -33,13 +34,6 @@ import {
|
|||||||
AttachmentBlockComponent,
|
AttachmentBlockComponent,
|
||||||
type AttachmentBlockService,
|
type AttachmentBlockService,
|
||||||
} from './attachment-block/index.js';
|
} from './attachment-block/index.js';
|
||||||
import { BookmarkEdgelessBlockComponent } from './bookmark-block/bookmark-edgeless-block.js';
|
|
||||||
import type { insertBookmarkCommand } from './bookmark-block/commands/insert-bookmark.js';
|
|
||||||
import { BookmarkCard } from './bookmark-block/components/bookmark-card.js';
|
|
||||||
import {
|
|
||||||
BookmarkBlockComponent,
|
|
||||||
type BookmarkBlockService,
|
|
||||||
} from './bookmark-block/index.js';
|
|
||||||
import { AffineCodeUnit } from './code-block/highlight/affine-code-unit.js';
|
import { AffineCodeUnit } from './code-block/highlight/affine-code-unit.js';
|
||||||
import {
|
import {
|
||||||
CodeBlockComponent,
|
CodeBlockComponent,
|
||||||
@@ -281,6 +275,7 @@ export function effects() {
|
|||||||
stdEffects();
|
stdEffects();
|
||||||
inlineEffects();
|
inlineEffects();
|
||||||
|
|
||||||
|
blockBookmarkEffects();
|
||||||
blockListEffects();
|
blockListEffects();
|
||||||
blockParagraphEffects();
|
blockParagraphEffects();
|
||||||
blockEmbedEffects();
|
blockEmbedEffects();
|
||||||
@@ -309,15 +304,10 @@ export function effects() {
|
|||||||
widgetCodeToolbarEffects();
|
widgetCodeToolbarEffects();
|
||||||
|
|
||||||
customElements.define('affine-database-title', DatabaseTitle);
|
customElements.define('affine-database-title', DatabaseTitle);
|
||||||
customElements.define(
|
|
||||||
'affine-edgeless-bookmark',
|
|
||||||
BookmarkEdgelessBlockComponent
|
|
||||||
);
|
|
||||||
customElements.define('affine-image', ImageBlockComponent);
|
customElements.define('affine-image', ImageBlockComponent);
|
||||||
customElements.define('data-view-header-area-icon', IconCell);
|
customElements.define('data-view-header-area-icon', IconCell);
|
||||||
customElements.define('affine-database-link-cell', LinkCell);
|
customElements.define('affine-database-link-cell', LinkCell);
|
||||||
customElements.define('affine-database-link-cell-editing', LinkCellEditing);
|
customElements.define('affine-database-link-cell-editing', LinkCellEditing);
|
||||||
customElements.define('affine-bookmark', BookmarkBlockComponent);
|
|
||||||
customElements.define('affine-edgeless-image', ImageEdgelessBlockComponent);
|
customElements.define('affine-edgeless-image', ImageEdgelessBlockComponent);
|
||||||
customElements.define('data-view-header-area-text', HeaderAreaTextCell);
|
customElements.define('data-view-header-area-text', HeaderAreaTextCell);
|
||||||
customElements.define(
|
customElements.define(
|
||||||
@@ -497,7 +487,6 @@ export function effects() {
|
|||||||
customElements.define('note-display-mode-panel', NoteDisplayModePanel);
|
customElements.define('note-display-mode-panel', NoteDisplayModePanel);
|
||||||
customElements.define('edgeless-toolbar-button', EdgelessToolbarButton);
|
customElements.define('edgeless-toolbar-button', EdgelessToolbarButton);
|
||||||
customElements.define('frame-preview', FramePreview);
|
customElements.define('frame-preview', FramePreview);
|
||||||
customElements.define('bookmark-card', BookmarkCard);
|
|
||||||
customElements.define('presentation-toolbar', PresentationToolbar);
|
customElements.define('presentation-toolbar', PresentationToolbar);
|
||||||
customElements.define('edgeless-shape-menu', EdgelessShapeMenu);
|
customElements.define('edgeless-shape-menu', EdgelessShapeMenu);
|
||||||
customElements.define('stroke-style-panel', StrokeStylePanel);
|
customElements.define('stroke-style-panel', StrokeStylePanel);
|
||||||
@@ -588,7 +577,6 @@ declare global {
|
|||||||
dedentBlocksToRoot: typeof dedentBlocksToRoot;
|
dedentBlocksToRoot: typeof dedentBlocksToRoot;
|
||||||
dedentBlocks: typeof dedentBlocks;
|
dedentBlocks: typeof dedentBlocks;
|
||||||
indentBlock: typeof indentBlock;
|
indentBlock: typeof indentBlock;
|
||||||
insertBookmark: typeof insertBookmarkCommand;
|
|
||||||
updateBlockType: typeof updateBlockType;
|
updateBlockType: typeof updateBlockType;
|
||||||
insertEdgelessText: typeof insertEdgelessTextCommand;
|
insertEdgelessText: typeof insertEdgelessTextCommand;
|
||||||
dedentBlockToRoot: typeof dedentBlockToRoot;
|
dedentBlockToRoot: typeof dedentBlockToRoot;
|
||||||
@@ -607,7 +595,6 @@ declare global {
|
|||||||
'affine:note': NoteBlockService;
|
'affine:note': NoteBlockService;
|
||||||
'affine:page': RootService;
|
'affine:page': RootService;
|
||||||
'affine:attachment': AttachmentBlockService;
|
'affine:attachment': AttachmentBlockService;
|
||||||
'affine:bookmark': BookmarkBlockService;
|
|
||||||
'affine:database': DatabaseBlockService;
|
'affine:database': DatabaseBlockService;
|
||||||
'affine:image': ImageBlockService;
|
'affine:image': ImageBlockService;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ export * from './_common/transformers/index.js';
|
|||||||
export { type AbstractEditor } from './_common/types.js';
|
export { type AbstractEditor } from './_common/types.js';
|
||||||
export * from './_specs/index.js';
|
export * from './_specs/index.js';
|
||||||
export * from './attachment-block/index.js';
|
export * from './attachment-block/index.js';
|
||||||
export * from './bookmark-block/index.js';
|
|
||||||
export * from './code-block/index.js';
|
export * from './code-block/index.js';
|
||||||
export * from './data-view-block/index.js';
|
export * from './data-view-block/index.js';
|
||||||
export * from './database-block/index.js';
|
export * from './database-block/index.js';
|
||||||
@@ -50,6 +49,7 @@ export {
|
|||||||
MiniMindmapPreview,
|
MiniMindmapPreview,
|
||||||
} from './surface-block/mini-mindmap/index.js';
|
} from './surface-block/mini-mindmap/index.js';
|
||||||
export * from './surface-ref-block/index.js';
|
export * from './surface-ref-block/index.js';
|
||||||
|
export * from '@blocksuite/affine-block-bookmark';
|
||||||
export * from '@blocksuite/affine-block-embed';
|
export * from '@blocksuite/affine-block-embed';
|
||||||
export * from '@blocksuite/affine-block-list';
|
export * from '@blocksuite/affine-block-list';
|
||||||
export * from '@blocksuite/affine-block-paragraph';
|
export * from '@blocksuite/affine-block-paragraph';
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import {
|
|||||||
StrokeStyle,
|
StrokeStyle,
|
||||||
} from '@blocksuite/affine-model';
|
} from '@blocksuite/affine-model';
|
||||||
|
|
||||||
export const BOOKMARK_MIN_WIDTH = 450;
|
|
||||||
|
|
||||||
export const DEFAULT_NOTE_OFFSET_X = 30;
|
export const DEFAULT_NOTE_OFFSET_X = 30;
|
||||||
export const DEFAULT_NOTE_OFFSET_Y = 40;
|
export const DEFAULT_NOTE_OFFSET_Y = 40;
|
||||||
export const NOTE_OVERLAY_OFFSET_X = 6;
|
export const NOTE_OVERLAY_OFFSET_X = 6;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import type { BookmarkBlockComponent } from '@blocksuite/affine-block-bookmark';
|
||||||
import type {
|
import type {
|
||||||
EmbedFigmaBlockComponent,
|
EmbedFigmaBlockComponent,
|
||||||
EmbedGithubBlockComponent,
|
EmbedGithubBlockComponent,
|
||||||
@@ -31,7 +32,6 @@ import {
|
|||||||
promptDocTitle,
|
promptDocTitle,
|
||||||
} from '../../../../_common/utils/render-linked-doc.js';
|
} from '../../../../_common/utils/render-linked-doc.js';
|
||||||
import type { AttachmentBlockComponent } from '../../../../attachment-block/attachment-block.js';
|
import type { AttachmentBlockComponent } from '../../../../attachment-block/attachment-block.js';
|
||||||
import type { BookmarkBlockComponent } from '../../../../bookmark-block/bookmark-block.js';
|
|
||||||
import type { ImageBlockComponent } from '../../../../image-block/image-block.js';
|
import type { ImageBlockComponent } from '../../../../image-block/image-block.js';
|
||||||
import { duplicate } from '../../../edgeless/utils/clipboard-utils.js';
|
import { duplicate } from '../../../edgeless/utils/clipboard-utils.js';
|
||||||
import { getSortedCloneElements } from '../../../edgeless/utils/clone-utils.js';
|
import { getSortedCloneElements } from '../../../edgeless/utils/clone-utils.js';
|
||||||
|
|||||||
@@ -37,6 +37,9 @@
|
|||||||
{
|
{
|
||||||
"path": "../affine/block-embed"
|
"path": "../affine/block-embed"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "../affine/block-bookmark"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "../affine/data-view"
|
"path": "../affine/data-view"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,6 +13,20 @@ export const PackageList = [
|
|||||||
'blocksuite/framework/store',
|
'blocksuite/framework/store',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
location: 'blocksuite/affine/block-bookmark',
|
||||||
|
name: '@blocksuite/affine-block-bookmark',
|
||||||
|
workspaceDependencies: [
|
||||||
|
'blocksuite/affine/block-embed',
|
||||||
|
'blocksuite/affine/components',
|
||||||
|
'blocksuite/affine/model',
|
||||||
|
'blocksuite/affine/shared',
|
||||||
|
'blocksuite/framework/block-std',
|
||||||
|
'blocksuite/framework/global',
|
||||||
|
'blocksuite/framework/inline',
|
||||||
|
'blocksuite/framework/store',
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
location: 'blocksuite/affine/block-embed',
|
location: 'blocksuite/affine/block-embed',
|
||||||
name: '@blocksuite/affine-block-embed',
|
name: '@blocksuite/affine-block-embed',
|
||||||
@@ -124,6 +138,7 @@ export const PackageList = [
|
|||||||
location: 'blocksuite/blocks',
|
location: 'blocksuite/blocks',
|
||||||
name: '@blocksuite/blocks',
|
name: '@blocksuite/blocks',
|
||||||
workspaceDependencies: [
|
workspaceDependencies: [
|
||||||
|
'blocksuite/affine/block-bookmark',
|
||||||
'blocksuite/affine/block-embed',
|
'blocksuite/affine/block-embed',
|
||||||
'blocksuite/affine/block-list',
|
'blocksuite/affine/block-list',
|
||||||
'blocksuite/affine/block-paragraph',
|
'blocksuite/affine/block-paragraph',
|
||||||
@@ -300,6 +315,7 @@ export const PackageList = [
|
|||||||
'packages/frontend/core',
|
'packages/frontend/core',
|
||||||
'packages/frontend/i18n',
|
'packages/frontend/i18n',
|
||||||
'blocksuite/affine/all',
|
'blocksuite/affine/all',
|
||||||
|
'packages/common/infra',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -456,6 +472,7 @@ export const PackageList = [
|
|||||||
|
|
||||||
export type PackageName =
|
export type PackageName =
|
||||||
| '@blocksuite/affine'
|
| '@blocksuite/affine'
|
||||||
|
| '@blocksuite/affine-block-bookmark'
|
||||||
| '@blocksuite/affine-block-embed'
|
| '@blocksuite/affine-block-embed'
|
||||||
| '@blocksuite/affine-block-list'
|
| '@blocksuite/affine-block-list'
|
||||||
| '@blocksuite/affine-block-paragraph'
|
| '@blocksuite/affine-block-paragraph'
|
||||||
|
|||||||
24
yarn.lock
24
yarn.lock
@@ -3224,6 +3224,29 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"@blocksuite/affine-block-bookmark@workspace:*, @blocksuite/affine-block-bookmark@workspace:blocksuite/affine/block-bookmark":
|
||||||
|
version: 0.0.0-use.local
|
||||||
|
resolution: "@blocksuite/affine-block-bookmark@workspace:blocksuite/affine/block-bookmark"
|
||||||
|
dependencies:
|
||||||
|
"@blocksuite/affine-block-embed": "workspace:*"
|
||||||
|
"@blocksuite/affine-components": "workspace:*"
|
||||||
|
"@blocksuite/affine-model": "workspace:*"
|
||||||
|
"@blocksuite/affine-shared": "workspace:*"
|
||||||
|
"@blocksuite/block-std": "workspace:*"
|
||||||
|
"@blocksuite/global": "workspace:*"
|
||||||
|
"@blocksuite/icons": "npm:^2.1.75"
|
||||||
|
"@blocksuite/inline": "workspace:*"
|
||||||
|
"@blocksuite/store": "workspace:*"
|
||||||
|
"@floating-ui/dom": "npm:^1.6.10"
|
||||||
|
"@lit/context": "npm:^1.1.2"
|
||||||
|
"@preact/signals-core": "npm:^1.8.0"
|
||||||
|
"@toeverything/theme": "npm:^1.1.1"
|
||||||
|
lit: "npm:^3.2.0"
|
||||||
|
minimatch: "npm:^10.0.1"
|
||||||
|
zod: "npm:^3.23.8"
|
||||||
|
languageName: unknown
|
||||||
|
linkType: soft
|
||||||
|
|
||||||
"@blocksuite/affine-block-embed@workspace:*, @blocksuite/affine-block-embed@workspace:blocksuite/affine/block-embed":
|
"@blocksuite/affine-block-embed@workspace:*, @blocksuite/affine-block-embed@workspace:blocksuite/affine/block-embed":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@blocksuite/affine-block-embed@workspace:blocksuite/affine/block-embed"
|
resolution: "@blocksuite/affine-block-embed@workspace:blocksuite/affine/block-embed"
|
||||||
@@ -3435,6 +3458,7 @@ __metadata:
|
|||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@blocksuite/blocks@workspace:blocksuite/blocks"
|
resolution: "@blocksuite/blocks@workspace:blocksuite/blocks"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
"@blocksuite/affine-block-bookmark": "workspace:*"
|
||||||
"@blocksuite/affine-block-embed": "workspace:*"
|
"@blocksuite/affine-block-embed": "workspace:*"
|
||||||
"@blocksuite/affine-block-list": "workspace:*"
|
"@blocksuite/affine-block-list": "workspace:*"
|
||||||
"@blocksuite/affine-block-paragraph": "workspace:*"
|
"@blocksuite/affine-block-paragraph": "workspace:*"
|
||||||
|
|||||||
Reference in New Issue
Block a user