refactor(editor): rename block-std to std (#11250)

Closes: BS-2946
This commit is contained in:
Saul-Mirone
2025-03-28 07:20:34 +00:00
parent 4498676a96
commit 205cd7a86d
1029 changed files with 1580 additions and 1698 deletions

View File

@@ -1,5 +1,5 @@
import { focusTextModel } from '@blocksuite/affine-rich-text';
import { type Command, TextSelection } from '@blocksuite/block-std';
import { type Command, TextSelection } from '@blocksuite/std';
/**
* Add a paragraph next to the current block.

View File

@@ -1,6 +1,6 @@
import { focusTextModel } from '@blocksuite/affine-rich-text';
import { getLastNoteBlock } from '@blocksuite/affine-shared/utils';
import type { Command } from '@blocksuite/block-std';
import type { Command } from '@blocksuite/std';
import { Text } from '@blocksuite/store';
/**

View File

@@ -4,7 +4,7 @@ import {
calculateCollapsedSiblings,
matchModels,
} from '@blocksuite/affine-shared/utils';
import { type Command, TextSelection } from '@blocksuite/block-std';
import { type Command, TextSelection } from '@blocksuite/std';
export const canDedentParagraphCommand: Command<
Partial<Omit<IndentContext, 'flavour' | 'type'>>,

View File

@@ -5,7 +5,7 @@ import {
getNearestHeadingBefore,
matchModels,
} from '@blocksuite/affine-shared/utils';
import { type Command, TextSelection } from '@blocksuite/block-std';
import { type Command, TextSelection } from '@blocksuite/std';
export const canIndentParagraphCommand: Command<
Partial<Omit<IndentContext, 'flavour' | 'type'>>,

View File

@@ -4,7 +4,7 @@ import {
getInlineEditorByModel,
} from '@blocksuite/affine-rich-text';
import { matchModels } from '@blocksuite/affine-shared/utils';
import { type Command, TextSelection } from '@blocksuite/block-std';
import { type Command, TextSelection } from '@blocksuite/std';
export const splitParagraphCommand: Command<
{

View File

@@ -7,8 +7,8 @@ import {
Heading6Icon,
} from '@blocksuite/affine-components/icons';
import type { ParagraphBlockModel } from '@blocksuite/affine-model';
import { ShadowlessElement } from '@blocksuite/block-std';
import { SignalWatcher, WithDisposable } from '@blocksuite/global/lit';
import { ShadowlessElement } from '@blocksuite/std';
import { cssVarV2 } from '@toeverything/theme/v2';
import { css, html, nothing, unsafeCSS } from 'lit';
import { property } from 'lit/decorators.js';

View File

@@ -1,5 +1,5 @@
import type { ParagraphBlockModel } from '@blocksuite/affine-model';
import { ConfigExtensionFactory } from '@blocksuite/block-std';
import { ConfigExtensionFactory } from '@blocksuite/std';
export interface ParagraphBlockConfig {
getPlaceholder: (model: ParagraphBlockModel) => string;

View File

@@ -13,12 +13,12 @@ import {
getNearestHeadingBefore,
getViewportElement,
} from '@blocksuite/affine-shared/utils';
import type { BlockComponent } from '@blocksuite/block-std';
import { TextSelection } from '@blocksuite/block-std';
import type { BlockComponent } from '@blocksuite/std';
import { TextSelection } from '@blocksuite/std';
import {
getInlineRangeProvider,
type InlineRangeProvider,
} from '@blocksuite/block-std/inline';
} from '@blocksuite/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

@@ -13,8 +13,8 @@ import {
calculateCollapsedSiblings,
matchModels,
} from '@blocksuite/affine-shared/utils';
import { KeymapExtension, TextSelection } from '@blocksuite/block-std';
import { IS_MAC } from '@blocksuite/global/env';
import { KeymapExtension, TextSelection } from '@blocksuite/std';
import { addParagraphCommand } from './commands/add-paragraph.js';
import {

View File

@@ -1,4 +1,4 @@
import { BlockViewExtension, FlavourExtension } from '@blocksuite/block-std';
import { BlockViewExtension, FlavourExtension } from '@blocksuite/std';
import type { ExtensionType } from '@blocksuite/store';
import { literal } from 'lit/static-html.js';

View File

@@ -5,9 +5,9 @@ import {
getSentenceRects,
segmentSentences,
} from '@blocksuite/affine-gfx-turbo-renderer';
import type { GfxBlockComponent } from '@blocksuite/block-std';
import { clientToModelCoord } from '@blocksuite/block-std/gfx';
import type { Container } from '@blocksuite/global/di';
import type { GfxBlockComponent } from '@blocksuite/std';
import { clientToModelCoord } from '@blocksuite/std/gfx';
import type { ParagraphLayout } from './paragraph-painter.worker';

View File

@@ -18,7 +18,7 @@ import {
BlockSelection,
type BlockStdScope,
TextSelection,
} from '@blocksuite/block-std';
} from '@blocksuite/std';
export function forwardDelete(std: BlockStdScope) {
const { store, host } = std;

View File

@@ -23,7 +23,7 @@ import {
getPrevContentBlock,
matchModels,
} from '@blocksuite/affine-shared/utils';
import { BlockSelection, type EditorHost } from '@blocksuite/block-std';
import { BlockSelection, type EditorHost } from '@blocksuite/std';
import type { BlockModel, Text } from '@blocksuite/store';
/**