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

@@ -23,7 +23,7 @@ import {
BlockSelection,
type Command,
TextSelection,
} from '@blocksuite/block-std';
} from '@blocksuite/std';
import type { BlockModel } from '@blocksuite/store';
type UpdateBlockConfig = {

View File

@@ -1,6 +1,6 @@
import { NoteBlockModel, NoteDisplayMode } from '@blocksuite/affine-model';
import { matchModels } from '@blocksuite/affine-shared/utils';
import type { Command } from '@blocksuite/block-std';
import type { Command } from '@blocksuite/std';
export const changeNoteDisplayMode: Command<{
noteId: string;

View File

@@ -1,6 +1,6 @@
import { NoteBlockModel } from '@blocksuite/affine-model';
import { matchModels } from '@blocksuite/affine-shared/utils';
import type { Command } from '@blocksuite/block-std';
import type { Command } from '@blocksuite/std';
import { dedentBlock } from './dedent-block';

View File

@@ -3,7 +3,7 @@ import {
calculateCollapsedSiblings,
matchModels,
} from '@blocksuite/affine-shared/utils';
import type { Command } from '@blocksuite/block-std';
import type { Command } from '@blocksuite/std';
/**
* @example

View File

@@ -1,6 +1,6 @@
import { NoteBlockModel } from '@blocksuite/affine-model';
import { matchModels } from '@blocksuite/affine-shared/utils';
import { type Command, TextSelection } from '@blocksuite/block-std';
import { type Command, TextSelection } from '@blocksuite/std';
import { dedentBlockToRoot } from './dedent-block-to-root';

View File

@@ -3,7 +3,7 @@ import {
calculateCollapsedSiblings,
matchModels,
} from '@blocksuite/affine-shared/utils';
import { type Command, TextSelection } from '@blocksuite/block-std';
import { type Command, TextSelection } from '@blocksuite/std';
import { dedentBlock } from './dedent-block';

View File

@@ -3,7 +3,7 @@ import {
calculateCollapsedSiblings,
matchModels,
} from '@blocksuite/affine-shared/utils';
import type { Command } from '@blocksuite/block-std';
import type { Command } from '@blocksuite/std';
/**
* @example

View File

@@ -4,7 +4,7 @@ import {
getNearestHeadingBefore,
matchModels,
} from '@blocksuite/affine-shared/utils';
import { type Command, TextSelection } from '@blocksuite/block-std';
import { type Command, TextSelection } from '@blocksuite/std';
import { indentBlock } from './indent-block';

View File

@@ -2,7 +2,7 @@ import {
type BlockComponent,
BlockSelection,
type Command,
} from '@blocksuite/block-std';
} from '@blocksuite/std';
export const selectBlock: Command<{
focusBlock?: BlockComponent;

View File

@@ -2,7 +2,7 @@ import {
type BlockComponent,
BlockSelection,
type Command,
} from '@blocksuite/block-std';
} from '@blocksuite/std';
export const selectBlocksBetween: Command<{
focusBlock?: BlockComponent;

View File

@@ -12,6 +12,8 @@ import {
matchModels,
stopPropagation,
} from '@blocksuite/affine-shared/utils';
import { clamp, Point } from '@blocksuite/global/gfx';
import { SignalWatcher, WithDisposable } from '@blocksuite/global/lit';
import {
type BlockComponent,
type BlockStdScope,
@@ -20,10 +22,8 @@ import {
ShadowlessElement,
stdContext,
TextSelection,
} from '@blocksuite/block-std';
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
import { clamp, Point } from '@blocksuite/global/gfx';
import { SignalWatcher, WithDisposable } from '@blocksuite/global/lit';
} from '@blocksuite/std';
import { GfxControllerIdentifier } from '@blocksuite/std/gfx';
import type { BlockModel } from '@blocksuite/store';
import { consume } from '@lit/context';
import { computed } from '@preact/signals-core';

View File

@@ -1,7 +1,7 @@
import { EditorChevronDown } from '@blocksuite/affine-components/toolbar';
import { LineWidth, type StrokeStyle } from '@blocksuite/affine-model';
import { ShadowlessElement } from '@blocksuite/block-std';
import { LineStyleIcon } from '@blocksuite/icons/lit';
import { ShadowlessElement } from '@blocksuite/std';
import { html } from 'lit';
import { property } from 'lit/decorators.js';

View File

@@ -1,6 +1,6 @@
import { EditorChevronDown } from '@blocksuite/affine-components/toolbar';
import { NoteDisplayMode } from '@blocksuite/affine-model';
import { ShadowlessElement } from '@blocksuite/block-std';
import { ShadowlessElement } from '@blocksuite/std';
import { html } from 'lit';
import { property } from 'lit/decorators.js';

View File

@@ -1,7 +1,7 @@
import type { NoteBlockModel } from '@blocksuite/affine-model';
import { type EditorHost, ShadowlessElement } from '@blocksuite/block-std';
import { almostEqual, Bound } from '@blocksuite/global/gfx';
import { SignalWatcher, WithDisposable } from '@blocksuite/global/lit';
import { type EditorHost, ShadowlessElement } from '@blocksuite/std';
import { html } from 'lit';
import { property } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';

View File

@@ -1,12 +1,12 @@
import { NoteBlockModel } from '@blocksuite/affine-model';
import { SignalWatcher, WithDisposable } from '@blocksuite/global/lit';
import {
type BlockStdScope,
PropTypes,
requiredProperties,
ShadowlessElement,
stdContext,
} from '@blocksuite/block-std';
import { SignalWatcher, WithDisposable } from '@blocksuite/global/lit';
} from '@blocksuite/std';
import { consume } from '@lit/context';
import { html } from 'lit';
import { property } from 'lit/decorators.js';

View File

@@ -1,8 +1,5 @@
import type { NoteBlockModel } from '@blocksuite/affine-model';
import {
type BlockStdScope,
ConfigExtensionFactory,
} from '@blocksuite/block-std';
import { type BlockStdScope, ConfigExtensionFactory } from '@blocksuite/std';
import type { TemplateResult } from 'lit';
type NoteBlockContext = {

View File

@@ -14,8 +14,8 @@ import {
SlashMenuConfigExtension,
type SlashMenuItem,
} from '@blocksuite/affine-widget-slash-menu';
import { BlockSelection } from '@blocksuite/block-std';
import { HeadingsIcon } from '@blocksuite/icons/lit';
import { BlockSelection } from '@blocksuite/std';
import { updateBlockType } from '../commands';
import { tooltips } from './tooltips';

View File

@@ -23,10 +23,6 @@ import {
ToolbarModuleExtension,
} from '@blocksuite/affine-shared/services';
import { getMostCommonResolvedValue } from '@blocksuite/affine-shared/utils';
import {
BlockFlavourIdentifier,
EditorLifeCycleExtension,
} from '@blocksuite/block-std';
import { Bound } from '@blocksuite/global/gfx';
import {
AutoHeightIcon,
@@ -35,6 +31,10 @@ import {
LinkedPageIcon,
ScissorsIcon,
} from '@blocksuite/icons/lit';
import {
BlockFlavourIdentifier,
EditorLifeCycleExtension,
} from '@blocksuite/std';
import type { ExtensionType } from '@blocksuite/store';
import { computed } from '@preact/signals-core';
import { html } from 'lit';

View File

@@ -2,7 +2,7 @@ import {
BlockSelection,
type BlockStdScope,
TextSelection,
} from '@blocksuite/block-std';
} from '@blocksuite/std';
const getSelection = (std: BlockStdScope) => std.selection;

View File

@@ -1,5 +1,5 @@
import type { NoteBlockModel } from '@blocksuite/affine-model';
import { BlockComponent } from '@blocksuite/block-std';
import { BlockComponent } from '@blocksuite/std';
import { css, html } from 'lit';
export class NoteBlockComponent extends BlockComponent<NoteBlockModel> {

View File

@@ -8,9 +8,9 @@ import {
handleNativeRangeAtPoint,
stopPropagation,
} from '@blocksuite/affine-shared/utils';
import { toGfxBlockComponent } from '@blocksuite/block-std';
import type { SelectedContext } from '@blocksuite/block-std/gfx';
import { Bound } from '@blocksuite/global/gfx';
import { toGfxBlockComponent } from '@blocksuite/std';
import type { SelectedContext } from '@blocksuite/std/gfx';
import { html, nothing, type PropertyValues } from 'lit';
import { query, state } from 'lit/decorators.js';
import { classMap } from 'lit/directives/class-map.js';

View File

@@ -27,7 +27,7 @@ import {
TextSelection,
type UIEventHandler,
type UIEventStateContext,
} from '@blocksuite/block-std';
} from '@blocksuite/std';
import type { BaseSelection } from '@blocksuite/store';
import {

View File

@@ -1,5 +1,5 @@
import { NoteBlockSchema } from '@blocksuite/affine-model';
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

@@ -8,7 +8,7 @@ import {
draftSelectedModelsCommand,
getSelectedModelsCommand,
} from '@blocksuite/affine-shared/commands';
import type { BlockStdScope } from '@blocksuite/block-std';
import type { BlockStdScope } from '@blocksuite/std';
import { toDraftModel } from '@blocksuite/store';
export interface QuickActionConfig {