refactor(editor): merge inline to std (#11025)

This commit is contained in:
Saul-Mirone
2025-03-20 05:46:56 +00:00
parent 5aa36efab0
commit 92d76ba571
176 changed files with 142 additions and 534 deletions

View File

@@ -19,7 +19,6 @@
"@blocksuite/block-std": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/icons": "^2.2.6",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@floating-ui/dom": "^1.6.13",
"@lit/context": "^1.1.2",

View File

@@ -15,7 +15,6 @@
{ "path": "../../widgets/widget-slash-menu" },
{ "path": "../../../framework/block-std" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -19,7 +19,6 @@
"@blocksuite/block-std": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/icons": "^2.2.6",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@lit/context": "^1.1.2",
"@preact/signals-core": "^1.8.0",

View File

@@ -15,7 +15,6 @@
{ "path": "../../widgets/widget-slash-menu" },
{ "path": "../../../framework/block-std" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -18,7 +18,6 @@
"@blocksuite/block-std": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/icons": "^2.2.6",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@emoji-mart/data": "^1.2.1",
"@floating-ui/dom": "^1.6.10",

View File

@@ -14,7 +14,6 @@
{ "path": "../../widgets/widget-slash-menu" },
{ "path": "../../../framework/block-std" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -18,7 +18,6 @@
"@blocksuite/block-std": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/icons": "^2.2.6",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@floating-ui/dom": "^1.6.13",
"@lit/context": "^1.1.2",

View File

@@ -8,19 +8,16 @@ import {
} from '@blocksuite/affine-shared/services';
import { getViewportElement } from '@blocksuite/affine-shared/utils';
import type { BlockComponent } from '@blocksuite/block-std';
import { BlockSelection, TextSelection } from '@blocksuite/block-std';
import {
BlockSelection,
getInlineRangeProvider,
TextSelection,
} from '@blocksuite/block-std';
import { IS_MAC, IS_MOBILE } from '@blocksuite/global/env';
import { noop } from '@blocksuite/global/utils';
import {
INLINE_ROOT_ATTR,
type InlineRangeProvider,
type InlineRootElement,
type VLine,
} from '@blocksuite/inline';
} from '@blocksuite/block-std/inline';
import { IS_MAC, IS_MOBILE } from '@blocksuite/global/env';
import { noop } from '@blocksuite/global/utils';
import { Slice } from '@blocksuite/store';
import { computed, effect, type Signal, signal } from '@preact/signals-core';
import { html, nothing, type TemplateResult } from 'lit';

View File

@@ -1,7 +1,7 @@
import { affineTextStyles } from '@blocksuite/affine-rich-text';
import type { AffineTextAttributes } from '@blocksuite/affine-shared/types';
import { ShadowlessElement } from '@blocksuite/block-std';
import { ZERO_WIDTH_SPACE } from '@blocksuite/inline';
import { ZERO_WIDTH_SPACE } from '@blocksuite/block-std/inline';
import type { DeltaInsert } from '@blocksuite/store';
import { html } from 'lit';
import { property } from 'lit/decorators.js';

View File

@@ -14,7 +14,6 @@
{ "path": "../../widgets/widget-slash-menu" },
{ "path": "../../../framework/block-std" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -19,7 +19,6 @@
"@blocksuite/data-view": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/icons": "^2.2.6",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@floating-ui/dom": "^1.6.13",
"@lit/context": "^1.1.2",

View File

@@ -19,10 +19,8 @@ import {
type TelemetryEventMap,
TelemetryProvider,
} from '@blocksuite/affine-shared/services';
import {
type BlockComponent,
RANGE_SYNC_EXCLUDE_ATTR,
} from '@blocksuite/block-std';
import { type BlockComponent } from '@blocksuite/block-std';
import { RANGE_SYNC_EXCLUDE_ATTR } from '@blocksuite/block-std/inline';
import {
createRecordDetail,
createUniComponentFromWebComponent,

View File

@@ -15,7 +15,6 @@
{ "path": "../../../framework/block-std" },
{ "path": "../../data-view" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -20,7 +20,6 @@
"@blocksuite/data-view": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/icons": "^2.2.6",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@floating-ui/dom": "^1.6.13",
"@lit/context": "^1.1.2",

View File

@@ -16,10 +16,8 @@ import {
TelemetryProvider,
} from '@blocksuite/affine-shared/services';
import { getDropResult } from '@blocksuite/affine-widget-drag-handle';
import {
type BlockComponent,
RANGE_SYNC_EXCLUDE_ATTR,
} from '@blocksuite/block-std';
import { type BlockComponent } from '@blocksuite/block-std';
import { RANGE_SYNC_EXCLUDE_ATTR } from '@blocksuite/block-std/inline';
import {
createRecordDetail,
createUniComponentFromWebComponent,

View File

@@ -17,7 +17,6 @@
{ "path": "../../../framework/block-std" },
{ "path": "../../data-view" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -15,7 +15,6 @@
"@blocksuite/affine-shared": "workspace:*",
"@blocksuite/block-std": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@floating-ui/dom": "^1.6.13",
"@lit/context": "^1.1.2",

View File

@@ -12,7 +12,6 @@
{ "path": "../../shared" },
{ "path": "../../../framework/block-std" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -18,7 +18,6 @@
"@blocksuite/block-std": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/icons": "^2.2.6",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@floating-ui/dom": "^1.6.13",
"@lit/context": "^1.1.2",

View File

@@ -14,7 +14,6 @@
{ "path": "../../shared" },
{ "path": "../../../framework/block-std" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -19,7 +19,6 @@
"@blocksuite/block-std": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/icons": "^2.2.6",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@floating-ui/dom": "^1.6.13",
"@lit/context": "^1.1.2",

View File

@@ -15,7 +15,6 @@
{ "path": "../../widgets/widget-slash-menu" },
{ "path": "../../../framework/block-std" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -18,7 +18,6 @@
"@blocksuite/block-std": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/icons": "^2.2.6",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@floating-ui/dom": "^1.6.13",
"@lit/context": "^1.1.2",

View File

@@ -14,7 +14,6 @@
{ "path": "../../widgets/widget-frame-title" },
{ "path": "../../../framework/block-std" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -19,7 +19,6 @@
"@blocksuite/block-std": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/icons": "^2.2.6",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@floating-ui/dom": "^1.6.13",
"@lit/context": "^1.1.2",

View File

@@ -15,7 +15,6 @@
{ "path": "../../widgets/widget-slash-menu" },
{ "path": "../../../framework/block-std" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -19,7 +19,6 @@
"@blocksuite/block-std": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/icons": "^2.2.6",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@floating-ui/dom": "^1.6.13",
"@lit/context": "^1.1.2",

View File

@@ -15,7 +15,6 @@
{ "path": "../../widgets/widget-slash-menu" },
{ "path": "../../../framework/block-std" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -17,7 +17,6 @@
"@blocksuite/block-std": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/icons": "^2.2.6",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@floating-ui/dom": "^1.6.13",
"@lit/context": "^1.1.2",

View File

@@ -15,12 +15,11 @@ import {
import { DocModeProvider } from '@blocksuite/affine-shared/services';
import { getViewportElement } from '@blocksuite/affine-shared/utils';
import type { BlockComponent } from '@blocksuite/block-std';
import { BlockSelection, TextSelection } from '@blocksuite/block-std';
import {
BlockSelection,
getInlineRangeProvider,
TextSelection,
} from '@blocksuite/block-std';
import type { InlineRangeProvider } from '@blocksuite/inline';
type InlineRangeProvider,
} from '@blocksuite/block-std/inline';
import type { BaseSelection } from '@blocksuite/store';
import { effect } from '@preact/signals-core';
import { html, nothing, type TemplateResult } from 'lit';

View File

@@ -13,7 +13,6 @@
{ "path": "../../shared" },
{ "path": "../../../framework/block-std" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -21,7 +21,6 @@
"@blocksuite/block-std": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/icons": "^2.2.6",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@lit/context": "^1.1.2",
"@preact/signals-core": "^1.8.0",

View File

@@ -17,7 +17,6 @@
{ "path": "../../widgets/widget-slash-menu" },
{ "path": "../../../framework/block-std" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -17,7 +17,6 @@
"@blocksuite/affine-shared": "workspace:*",
"@blocksuite/block-std": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@floating-ui/dom": "^1.6.13",
"@lit/context": "^1.1.2",

View File

@@ -16,8 +16,11 @@ import {
getViewportElement,
} from '@blocksuite/affine-shared/utils';
import type { BlockComponent } from '@blocksuite/block-std';
import { getInlineRangeProvider, TextSelection } from '@blocksuite/block-std';
import type { InlineRangeProvider } from '@blocksuite/inline';
import { TextSelection } from '@blocksuite/block-std';
import {
getInlineRangeProvider,
type InlineRangeProvider,
} from '@blocksuite/block-std/inline';
import { computed, effect, signal } from '@preact/signals-core';
import { html, nothing, type TemplateResult } from 'lit';
import { query, state } from 'lit/decorators.js';

View File

@@ -14,7 +14,6 @@
{ "path": "../../shared" },
{ "path": "../../../framework/block-std" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -42,7 +42,6 @@
"@blocksuite/data-view": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/icons": "^2.2.6",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@floating-ui/dom": "^1.6.13",
"@lit/context": "^1.1.2",

View File

@@ -7,12 +7,9 @@ import type { ConnectorElementModel } from '@blocksuite/affine-model';
import type { RichText } from '@blocksuite/affine-rich-text';
import { ThemeProvider } from '@blocksuite/affine-shared/services';
import { almostEqual } from '@blocksuite/affine-shared/utils';
import {
type BlockComponent,
RANGE_SYNC_EXCLUDE_ATTR,
ShadowlessElement,
} from '@blocksuite/block-std';
import { type BlockComponent, ShadowlessElement } from '@blocksuite/block-std';
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
import { RANGE_SYNC_EXCLUDE_ATTR } from '@blocksuite/block-std/inline';
import { Bound, Vec } from '@blocksuite/global/gfx';
import { WithDisposable } from '@blocksuite/global/lit';
import { css, html, nothing } from 'lit';

View File

@@ -5,12 +5,9 @@ import {
} from '@blocksuite/affine-block-surface';
import type { GroupElementModel } from '@blocksuite/affine-model';
import type { RichText } from '@blocksuite/affine-rich-text';
import {
type BlockComponent,
RANGE_SYNC_EXCLUDE_ATTR,
ShadowlessElement,
} from '@blocksuite/block-std';
import { type BlockComponent, ShadowlessElement } from '@blocksuite/block-std';
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
import { RANGE_SYNC_EXCLUDE_ATTR } from '@blocksuite/block-std/inline';
import { Bound } from '@blocksuite/global/gfx';
import { WithDisposable } from '@blocksuite/global/lit';
import { html, nothing } from 'lit';

View File

@@ -7,12 +7,9 @@ import { MindmapElementModel, TextResizing } from '@blocksuite/affine-model';
import type { RichText } from '@blocksuite/affine-rich-text';
import { ThemeProvider } from '@blocksuite/affine-shared/services';
import { getSelectedRect } from '@blocksuite/affine-shared/utils';
import {
type BlockComponent,
RANGE_SYNC_EXCLUDE_ATTR,
ShadowlessElement,
} from '@blocksuite/block-std';
import { type BlockComponent, ShadowlessElement } from '@blocksuite/block-std';
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
import { RANGE_SYNC_EXCLUDE_ATTR } from '@blocksuite/block-std/inline';
import { Bound, toRadian, Vec } from '@blocksuite/global/gfx';
import { WithDisposable } from '@blocksuite/global/lit';
import { html, nothing } from 'lit';

View File

@@ -19,7 +19,7 @@ import {
type Signal,
} from '@blocksuite/affine-shared/utils';
import type { BlockStdScope, EditorHost } from '@blocksuite/block-std';
import type { InlineRange } from '@blocksuite/inline';
import type { InlineRange } from '@blocksuite/block-std/inline';
import type { TemplateResult } from 'lit';
import { showImportModal } from './import-doc/index.js';

View File

@@ -8,12 +8,12 @@ import { getViewportElement } from '@blocksuite/affine-shared/utils';
import type { BlockComponent } from '@blocksuite/block-std';
import { BLOCK_ID_ATTR, WidgetComponent } from '@blocksuite/block-std';
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
import { IS_MOBILE } from '@blocksuite/global/env';
import {
INLINE_ROOT_ATTR,
type InlineEditor,
type InlineRootElement,
} from '@blocksuite/inline';
} from '@blocksuite/block-std/inline';
import { IS_MOBILE } from '@blocksuite/global/env';
import { signal } from '@preact/signals-core';
import { html, nothing } from 'lit';
import { choose } from 'lit/directives/choose.js';

View File

@@ -38,7 +38,6 @@
{ "path": "../../../framework/block-std" },
{ "path": "../../data-view" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -19,7 +19,6 @@
"@blocksuite/block-std": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/icons": "^2.2.6",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@floating-ui/dom": "^1.6.13",
"@lit/context": "^1.1.2",

View File

@@ -14,9 +14,9 @@ import { SpecProvider } from '@blocksuite/affine-shared/utils';
import {
BlockStdScope,
type EditorHost,
RANGE_QUERY_EXCLUDE_ATTR,
ShadowlessElement,
} from '@blocksuite/block-std';
import { RANGE_QUERY_EXCLUDE_ATTR } from '@blocksuite/block-std/inline';
import { deserializeXYWH } from '@blocksuite/global/gfx';
import { WithDisposable } from '@blocksuite/global/lit';
import { type BlockModel, type Query } from '@blocksuite/store';

View File

@@ -15,7 +15,6 @@
{ "path": "../../widgets/widget-slash-menu" },
{ "path": "../../../framework/block-std" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -16,7 +16,6 @@
"@blocksuite/affine-shared": "workspace:*",
"@blocksuite/block-std": "workspace:*",
"@blocksuite/global": "workspace:*",
"@blocksuite/inline": "workspace:*",
"@blocksuite/store": "workspace:*",
"@lit/context": "^1.1.2",
"@preact/signals-core": "^1.8.0",

View File

@@ -5,11 +5,11 @@ import {
type LocalConnectorElementModel,
type PointStyle,
} from '@blocksuite/affine-model';
import { deltaInsertsToChunks } from '@blocksuite/block-std/inline';
import {
getBezierParameters,
type PointLocation,
} from '@blocksuite/global/gfx';
import { deltaInsertsToChunks } from '@blocksuite/inline';
import { isConnectorWithLabel } from '../../../managers/connector-manager.js';
import type { RoughCanvas } from '../../../utils/rough/canvas.js';

View File

@@ -4,9 +4,9 @@ import type {
ShapeType,
} from '@blocksuite/affine-model';
import { DefaultTheme, TextAlign } from '@blocksuite/affine-model';
import { deltaInsertsToChunks } from '@blocksuite/block-std/inline';
import type { IBound } from '@blocksuite/global/gfx';
import { Bound } from '@blocksuite/global/gfx';
import { deltaInsertsToChunks } from '@blocksuite/inline';
import type { RoughCanvas } from '../../../utils/rough/canvas.js';
import type { CanvasRenderer } from '../../canvas-renderer.js';

View File

@@ -5,8 +5,8 @@ import type {
TextVerticalAlign,
} from '@blocksuite/affine-model';
import { FeatureFlagService } from '@blocksuite/affine-shared/services';
import { deltaInsertsToChunks } from '@blocksuite/block-std/inline';
import type { Bound, SerializedXYWH } from '@blocksuite/global/gfx';
import { deltaInsertsToChunks } from '@blocksuite/inline';
import type { CanvasRenderer } from '../../canvas-renderer.js';
import {

View File

@@ -1,5 +1,5 @@
import { DefaultTheme, type TextElementModel } from '@blocksuite/affine-model';
import { deltaInsertsToChunks } from '@blocksuite/inline';
import { deltaInsertsToChunks } from '@blocksuite/block-std/inline';
import type { CanvasRenderer } from '../../canvas-renderer.js';
import {

View File

@@ -4,12 +4,12 @@ import type {
FontWeight,
TextElementModel,
} from '@blocksuite/affine-model';
import { deltaInsertsToChunks } from '@blocksuite/block-std/inline';
import type { Bound } from '@blocksuite/global/gfx';
import {
getPointsFromBoundWithRotation,
rotatePoints,
} from '@blocksuite/global/gfx';
import { deltaInsertsToChunks } from '@blocksuite/inline';
import type * as Y from 'yjs';
import {

View File

@@ -1,11 +1,12 @@
import type { Color } from '@blocksuite/affine-model';
import { ThemeProvider } from '@blocksuite/affine-shared/services';
import type { EditorHost, SurfaceSelection } from '@blocksuite/block-std';
import { BlockComponent, RANGE_SYNC_EXCLUDE_ATTR } from '@blocksuite/block-std';
import { BlockComponent } from '@blocksuite/block-std';
import {
GfxControllerIdentifier,
type Viewport,
} from '@blocksuite/block-std/gfx';
import { RANGE_SYNC_EXCLUDE_ATTR } from '@blocksuite/block-std/inline';
import { Bound } from '@blocksuite/global/gfx';
import { css, html } from 'lit';
import { query } from 'lit/decorators.js';

View File

@@ -13,7 +13,6 @@
{ "path": "../../shared" },
{ "path": "../../../framework/block-std" },
{ "path": "../../../framework/global" },
{ "path": "../../../framework/inline" },
{ "path": "../../../framework/store" }
]
}

View File

@@ -3,10 +3,8 @@ import type { TableBlockModel } from '@blocksuite/affine-model';
import { NOTE_SELECTOR } from '@blocksuite/affine-shared/consts';
import { DocModeProvider } from '@blocksuite/affine-shared/services';
import { VirtualPaddingController } from '@blocksuite/affine-shared/utils';
import {
type BlockComponent,
RANGE_SYNC_EXCLUDE_ATTR,
} from '@blocksuite/block-std';
import type { BlockComponent } from '@blocksuite/block-std';
import { RANGE_SYNC_EXCLUDE_ATTR } from '@blocksuite/block-std/inline';
import { IS_MOBILE } from '@blocksuite/global/env';
import { signal } from '@preact/signals-core';
import { html, nothing } from 'lit';