refactor(editor): store should not rely on inline (#11017)

This commit is contained in:
Saul-Mirone
2025-03-20 01:33:29 +00:00
parent ee337a16af
commit 258c70cf07
82 changed files with 140 additions and 141 deletions

View File

@@ -6,11 +6,13 @@ import {
} from '@blocksuite/global/di';
import {
type AttributeRenderer,
baseTextAttributes,
type DeltaInsert,
getDefaultAttributeRenderer,
} from '@blocksuite/inline';
import type { ExtensionType } from '@blocksuite/store';
import {
baseTextAttributes,
type DeltaInsert,
type ExtensionType,
} from '@blocksuite/store';
import { z, type ZodObject, type ZodTypeAny } from 'zod';
import { MarkdownMatcherIdentifier } from './markdown-matcher.js';

View File

@@ -1,10 +1,9 @@
import type {
AttributeRenderer,
BaseTextAttributes,
DeltaInsert,
InlineEditor,
InlineRange,
} from '@blocksuite/inline';
import type { BaseTextAttributes, DeltaInsert } from '@blocksuite/store';
import type * as Y from 'yjs';
import type { ZodTypeAny } from 'zod';

View File

@@ -1,6 +1,7 @@
import type { AffineTextAttributes } from '@blocksuite/affine-shared/types';
import { ShadowlessElement } from '@blocksuite/block-std';
import { type DeltaInsert, ZERO_WIDTH_SPACE } from '@blocksuite/inline';
import { ZERO_WIDTH_SPACE } from '@blocksuite/inline';
import type { DeltaInsert } from '@blocksuite/store';
import { html } from 'lit';
import { property } from 'lit/decorators.js';
import { type StyleInfo, styleMap } from 'lit/directives/style-map.js';

View File

@@ -10,12 +10,12 @@ import {
} from '@blocksuite/block-std';
import { WithDisposable } from '@blocksuite/global/lit';
import {
type DeltaInsert,
INLINE_ROOT_ATTR,
type InlineRootElement,
ZERO_WIDTH_NON_JOINER,
ZERO_WIDTH_SPACE,
} from '@blocksuite/inline';
import type { DeltaInsert } from '@blocksuite/store';
import { shift } from '@floating-ui/dom';
import { baseTheme } from '@toeverything/theme';
import { css, html, nothing, unsafeCSS } from 'lit';

View File

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

View File

@@ -8,11 +8,11 @@ import {
} from '@blocksuite/block-std';
import { SignalWatcher, WithDisposable } from '@blocksuite/global/lit';
import {
type DeltaInsert,
type InlineEditor,
ZERO_WIDTH_NON_JOINER,
ZERO_WIDTH_SPACE,
} from '@blocksuite/inline';
import type { DeltaInsert } from '@blocksuite/store';
import { signal } from '@preact/signals-core';
import katex from 'katex';
import { css, html, render } from 'lit';

View File

@@ -9,11 +9,11 @@ import type { BlockComponent, BlockStdScope } from '@blocksuite/block-std';
import { BLOCK_ID_ATTR, ShadowlessElement } from '@blocksuite/block-std';
import { WithDisposable } from '@blocksuite/global/lit';
import {
type DeltaInsert,
INLINE_ROOT_ATTR,
type InlineRootElement,
ZERO_WIDTH_SPACE,
} from '@blocksuite/inline';
import type { DeltaInsert } from '@blocksuite/store';
import { css, html } from 'lit';
import { property } from 'lit/decorators.js';
import { type StyleInfo, styleMap } from 'lit/directives/style-map.js';

View File

@@ -19,13 +19,12 @@ import { BLOCK_ID_ATTR, ShadowlessElement } from '@blocksuite/block-std';
import { WithDisposable } from '@blocksuite/global/lit';
import { LinkedPageIcon } from '@blocksuite/icons/lit';
import {
type DeltaInsert,
INLINE_ROOT_ATTR,
type InlineRootElement,
ZERO_WIDTH_NON_JOINER,
ZERO_WIDTH_SPACE,
} from '@blocksuite/inline';
import type { DocMeta, Store } from '@blocksuite/store';
import type { DeltaInsert, DocMeta, Store } from '@blocksuite/store';
import { css, html, nothing } from 'lit';
import { property, state } from 'lit/decorators.js';
import { choose } from 'lit/directives/choose.js';

View File

@@ -3,12 +3,12 @@ import { ShadowlessElement } from '@blocksuite/block-std';
import { WithDisposable } from '@blocksuite/global/lit';
import {
type AttributeRenderer,
type DeltaInsert,
InlineEditor,
type InlineRange,
type InlineRangeProvider,
type VLine,
} from '@blocksuite/inline';
import type { DeltaInsert } from '@blocksuite/store';
import { Text } from '@blocksuite/store';
import { effect, signal } from '@preact/signals-core';
import { css, html, type TemplateResult } from 'lit';