mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 01:56:27 +08:00
refactor(editor): add gfx entry in bs global package (#10612)
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
"./global/exceptions": "./src/global/exceptions.ts",
|
||||
"./global/di": "./src/global/di.ts",
|
||||
"./global/types": "./src/global/types.ts",
|
||||
"./global/gfx": "./src/global/gfx.ts",
|
||||
"./store": "./src/store/index.ts",
|
||||
"./store/test": "./src/store/test.ts",
|
||||
"./inline": "./src/inline/index.ts",
|
||||
@@ -69,6 +70,9 @@
|
||||
"global/types": [
|
||||
"dist/global/types.d.ts"
|
||||
],
|
||||
"global/gfx": [
|
||||
"dist/global/gfx.d.ts"
|
||||
],
|
||||
"store": [
|
||||
"dist/store/index.d.ts"
|
||||
],
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export * from '@blocksuite/global/gfx';
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
EMBED_CARD_HEIGHT,
|
||||
EMBED_CARD_WIDTH,
|
||||
} from '@blocksuite/affine-shared/consts';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { ArrowDownSmallIcon, MoreVerticalIcon } from '@blocksuite/icons/lit';
|
||||
import { flip, offset } from '@floating-ui/dom';
|
||||
import { html, nothing } from 'lit';
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
import { type BlockStdScope, StdIdentifier } from '@blocksuite/block-std';
|
||||
import type { Container } from '@blocksuite/global/di';
|
||||
import { createIdentifier } from '@blocksuite/global/di';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { Extension } from '@blocksuite/store';
|
||||
import type { TemplateResult } from 'lit';
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
import { humanFileSize } from '@blocksuite/affine-shared/utils';
|
||||
import type { BlockStdScope, EditorHost } from '@blocksuite/block-std';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import { Bound, type IVec, Point, Vec } from '@blocksuite/global/utils';
|
||||
import { Bound, type IVec, Point, Vec } from '@blocksuite/global/gfx';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
|
||||
import type { AttachmentBlockComponent } from './attachment-block.js';
|
||||
|
||||
@@ -36,7 +36,7 @@ import {
|
||||
uniMap,
|
||||
} from '@blocksuite/data-view';
|
||||
import { widgetPresets } from '@blocksuite/data-view/widget-presets';
|
||||
import { Rect } from '@blocksuite/global/utils';
|
||||
import { Rect } from '@blocksuite/global/gfx';
|
||||
import {
|
||||
CopyIcon,
|
||||
DeleteIcon,
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
} from '@blocksuite/data-view';
|
||||
import { presetPropertyConverts } from '@blocksuite/data-view/property-presets';
|
||||
import { propertyModelPresets } from '@blocksuite/data-view/property-pure-presets';
|
||||
import { clamp } from '@blocksuite/global/utils';
|
||||
import { clamp } from '@blocksuite/global/gfx';
|
||||
import { nanoid, Text } from '@blocksuite/store';
|
||||
|
||||
import { richTextPropertyModelConfig } from './rich-text/define.js';
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
import { focusTextModel } from '@blocksuite/affine-components/rich-text';
|
||||
import type { Command } from '@blocksuite/block-std';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
|
||||
import {
|
||||
EDGELESS_TEXT_BLOCK_MIN_HEIGHT,
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
GfxBlockComponent,
|
||||
TextSelection,
|
||||
} from '@blocksuite/block-std';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { css, html } from 'lit';
|
||||
import { query, state } from 'lit/decorators.js';
|
||||
import { type StyleInfo, styleMap } from 'lit/directives/style-map.js';
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
TextSelection,
|
||||
} from '@blocksuite/block-std';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import { Bound, Vec } from '@blocksuite/global/utils';
|
||||
import { Bound, Vec } from '@blocksuite/global/gfx';
|
||||
|
||||
interface EmbedCardProperties {
|
||||
flavour: string;
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
GfxBlockElementModel,
|
||||
GfxCompatibleProps,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import type { StyleInfo } from 'lit/directives/style-map.js';
|
||||
|
||||
import type { EmbedBlockComponent } from './embed-block-element.js';
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import {
|
||||
isNewTabTrigger,
|
||||
isNewViewTrigger,
|
||||
} from '@blocksuite/affine-shared/utils';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
|
||||
import { toEdgelessEmbedBlock } from '../common/to-edgeless-embed-block.js';
|
||||
import { EmbedLinkedDocBlockComponent } from './embed-linked-doc-block.js';
|
||||
|
||||
@@ -27,7 +27,8 @@ import {
|
||||
referenceToNode,
|
||||
} from '@blocksuite/affine-shared/utils';
|
||||
import { BlockSelection } from '@blocksuite/block-std';
|
||||
import { Bound, throttle } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { throttle } from '@blocksuite/global/utils';
|
||||
import { Text } from '@blocksuite/store';
|
||||
import { computed } from '@preact/signals-core';
|
||||
import { html, nothing } from 'lit';
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import {
|
||||
ThemeProvider,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import { BlockStdScope } from '@blocksuite/block-std';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { html, nothing } from 'lit';
|
||||
import { choose } from 'lit/directives/choose.js';
|
||||
import { classMap } from 'lit/directives/class-map.js';
|
||||
|
||||
@@ -34,7 +34,8 @@ import {
|
||||
GfxControllerIdentifier,
|
||||
GfxExtension,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import { assertExists, Bound, getCommonBound } from '@blocksuite/global/utils';
|
||||
import { Bound, getCommonBound } from '@blocksuite/global/gfx';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { type GetBlocksOptions, type Query, Text } from '@blocksuite/store';
|
||||
import { computed, signal } from '@preact/signals-core';
|
||||
import { html, nothing, type PropertyValues } from 'lit';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { DefaultTheme, type FrameBlockModel } from '@blocksuite/affine-model';
|
||||
import { ThemeProvider } from '@blocksuite/affine-shared/services';
|
||||
import { GfxBlockComponent } from '@blocksuite/block-std';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { cssVarV2 } from '@toeverything/theme/v2';
|
||||
import { html } from 'lit';
|
||||
import { state } from 'lit/decorators.js';
|
||||
|
||||
@@ -17,10 +17,10 @@ import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import {
|
||||
Bound,
|
||||
deserializeXYWH,
|
||||
DisposableGroup,
|
||||
type IVec,
|
||||
type SerializedXYWH,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import { DisposableGroup } from '@blocksuite/global/utils';
|
||||
import { type BlockModel, Text } from '@blocksuite/store';
|
||||
import * as Y from 'yjs';
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
} from '@blocksuite/affine-shared/utils';
|
||||
import type { BlockStdScope, EditorHost } from '@blocksuite/block-std';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import { Bound, type IVec, Point, Vec } from '@blocksuite/global/utils';
|
||||
import { Bound, type IVec, Point, Vec } from '@blocksuite/global/gfx';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
|
||||
import {
|
||||
|
||||
@@ -22,12 +22,8 @@ import {
|
||||
TextSelection,
|
||||
} from '@blocksuite/block-std';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import {
|
||||
clamp,
|
||||
Point,
|
||||
SignalWatcher,
|
||||
WithDisposable,
|
||||
} from '@blocksuite/global/utils';
|
||||
import { clamp, Point } from '@blocksuite/global/gfx';
|
||||
import { SignalWatcher, WithDisposable } from '@blocksuite/global/utils';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
import { consume } from '@lit/context';
|
||||
import { computed } from '@preact/signals-core';
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
import type { NoteBlockModel } from '@blocksuite/affine-model';
|
||||
import { type EditorHost, ShadowlessElement } from '@blocksuite/block-std';
|
||||
import {
|
||||
almostEqual,
|
||||
Bound,
|
||||
SignalWatcher,
|
||||
WithDisposable,
|
||||
} from '@blocksuite/global/utils';
|
||||
import { almostEqual, Bound } from '@blocksuite/global/gfx';
|
||||
import { SignalWatcher, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { html } from 'lit';
|
||||
import { property } from 'lit/decorators.js';
|
||||
import { styleMap } from 'lit/directives/style-map.js';
|
||||
|
||||
@@ -5,7 +5,7 @@ import { EDGELESS_BLOCK_CHILD_PADDING } from '@blocksuite/affine-shared/consts';
|
||||
import { TelemetryProvider } from '@blocksuite/affine-shared/services';
|
||||
import { stopPropagation } from '@blocksuite/affine-shared/utils';
|
||||
import { toGfxBlockComponent } from '@blocksuite/block-std';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { html, nothing, type PropertyValues } from 'lit';
|
||||
import { query, state } from 'lit/decorators.js';
|
||||
import { classMap } from 'lit/directives/class-map.js';
|
||||
|
||||
@@ -49,15 +49,19 @@ import {
|
||||
SortOrder,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import type { IBound, IVec, SerializedXYWH } from '@blocksuite/global/utils';
|
||||
import {
|
||||
Bound,
|
||||
getCommonBound,
|
||||
type IBound,
|
||||
type IVec,
|
||||
type SerializedXYWH,
|
||||
Vec,
|
||||
} from '@blocksuite/global/gfx';
|
||||
import {
|
||||
assertExists,
|
||||
assertType,
|
||||
Bound,
|
||||
DisposableGroup,
|
||||
getCommonBound,
|
||||
nToLast,
|
||||
Vec,
|
||||
} from '@blocksuite/global/utils';
|
||||
import {
|
||||
type BlockSnapshot,
|
||||
|
||||
+3
-4
@@ -29,17 +29,16 @@ import {
|
||||
import { captureEventTarget } from '@blocksuite/affine-shared/utils';
|
||||
import { type BlockStdScope, stdContext } from '@blocksuite/block-std';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import type { XYWH } from '@blocksuite/global/utils';
|
||||
import type { XYWH } from '@blocksuite/global/gfx';
|
||||
import {
|
||||
assertInstanceOf,
|
||||
Bound,
|
||||
clamp,
|
||||
normalizeDegAngle,
|
||||
serializeXYWH,
|
||||
toDegree,
|
||||
Vec,
|
||||
WithDisposable,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import { assertInstanceOf, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { FrameIcon, PageIcon } from '@blocksuite/icons/lit';
|
||||
import { consume } from '@lit/context';
|
||||
import { baseTheme } from '@toeverything/theme';
|
||||
|
||||
+2
-2
@@ -25,11 +25,11 @@ import {
|
||||
import { handleNativeRangeAtPoint } from '@blocksuite/affine-shared/utils';
|
||||
import { type BlockStdScope, stdContext } from '@blocksuite/block-std';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import type { Bound, IVec } from '@blocksuite/global/utils';
|
||||
import type { Bound, IVec } from '@blocksuite/global/gfx';
|
||||
import { Vec } from '@blocksuite/global/gfx';
|
||||
import {
|
||||
assertExists,
|
||||
DisposableGroup,
|
||||
Vec,
|
||||
WithDisposable,
|
||||
} from '@blocksuite/global/utils';
|
||||
import {
|
||||
|
||||
@@ -15,8 +15,8 @@ import {
|
||||
} from '@blocksuite/affine-model';
|
||||
import type { GfxController, GfxModel } from '@blocksuite/block-std/gfx';
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import type { XYWH } from '@blocksuite/global/utils';
|
||||
import { assertType, Bound, normalizeDegAngle } from '@blocksuite/global/utils';
|
||||
import { Bound, normalizeDegAngle, type XYWH } from '@blocksuite/global/gfx';
|
||||
import { assertType } from '@blocksuite/global/utils';
|
||||
import * as Y from 'yjs';
|
||||
|
||||
import type { EdgelessRootBlockComponent } from '../../edgeless-root-block.js';
|
||||
|
||||
@@ -9,7 +9,8 @@ import {
|
||||
stdContext,
|
||||
} from '@blocksuite/block-std';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import { DisposableGroup, Vec, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { Vec } from '@blocksuite/global/gfx';
|
||||
import { DisposableGroup, WithDisposable } from '@blocksuite/global/utils';
|
||||
import type { Store } from '@blocksuite/store';
|
||||
import { consume } from '@lit/context';
|
||||
import { css, html, LitElement } from 'lit';
|
||||
|
||||
@@ -7,10 +7,9 @@ import {
|
||||
ShadowlessElement,
|
||||
} from '@blocksuite/block-std';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import { Bound, deserializeXYWH } from '@blocksuite/global/gfx';
|
||||
import {
|
||||
Bound,
|
||||
debounce,
|
||||
deserializeXYWH,
|
||||
DisposableGroup,
|
||||
WithDisposable,
|
||||
} from '@blocksuite/global/utils';
|
||||
|
||||
@@ -10,12 +10,8 @@ import { TelemetryProvider } from '@blocksuite/affine-shared/services';
|
||||
import { getRectByBlockComponent } from '@blocksuite/affine-shared/utils';
|
||||
import { WidgetComponent } from '@blocksuite/block-std';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import {
|
||||
deserializeXYWH,
|
||||
DisposableGroup,
|
||||
Point,
|
||||
serializeXYWH,
|
||||
} from '@blocksuite/global/utils';
|
||||
import { deserializeXYWH, Point, serializeXYWH } from '@blocksuite/global/gfx';
|
||||
import { DisposableGroup } from '@blocksuite/global/utils';
|
||||
import { ScissorsIcon } from '@blocksuite/icons/lit';
|
||||
import { css, html, nothing, type PropertyValues } from 'lit';
|
||||
import { state } from 'lit/decorators.js';
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import type { FrameBlockModel, RootBlockModel } from '@blocksuite/affine-model';
|
||||
import { EditPropsStore } from '@blocksuite/affine-shared/services';
|
||||
import { WidgetComponent } from '@blocksuite/block-std';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { effect } from '@preact/signals-core';
|
||||
import { css, html, nothing } from 'lit';
|
||||
import { state } from 'lit/decorators.js';
|
||||
|
||||
+4
-10
@@ -49,20 +49,14 @@ import {
|
||||
type GfxModel,
|
||||
type GfxPrimitiveElementModel,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import type {
|
||||
Disposable,
|
||||
IPoint,
|
||||
IVec,
|
||||
PointLocation,
|
||||
} from '@blocksuite/global/utils';
|
||||
import type { IPoint, IVec, PointLocation } from '@blocksuite/global/gfx';
|
||||
import {
|
||||
assertType,
|
||||
Bound,
|
||||
deserializeXYWH,
|
||||
normalizeDegAngle,
|
||||
pickValues,
|
||||
Slot,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import type { Disposable } from '@blocksuite/global/utils';
|
||||
import { assertType, pickValues, Slot } from '@blocksuite/global/utils';
|
||||
import { css, html, nothing } from 'lit';
|
||||
import { state } from 'lit/decorators.js';
|
||||
import { ifDefined } from 'lit/directives/if-defined.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IVec } from '@blocksuite/global/utils';
|
||||
import type { IVec } from '@blocksuite/global/gfx';
|
||||
import { html, nothing } from 'lit';
|
||||
|
||||
export enum HandleDirection {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { NOTE_MIN_WIDTH } from '@blocksuite/affine-model';
|
||||
import {
|
||||
assertExists,
|
||||
Bound,
|
||||
getQuadBoundWithRotation,
|
||||
type IPoint,
|
||||
type IVec,
|
||||
type PointLocation,
|
||||
rotatePoints,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
|
||||
import type { SelectableProps } from '../../utils/query.js';
|
||||
import { HandleDirection, type ResizeMode } from './resize-handles.js';
|
||||
|
||||
+2
-6
@@ -10,12 +10,8 @@ import {
|
||||
RANGE_SYNC_EXCLUDE_ATTR,
|
||||
ShadowlessElement,
|
||||
} from '@blocksuite/block-std';
|
||||
import {
|
||||
assertExists,
|
||||
Bound,
|
||||
Vec,
|
||||
WithDisposable,
|
||||
} from '@blocksuite/global/utils';
|
||||
import { Bound, Vec } from '@blocksuite/global/gfx';
|
||||
import { assertExists, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { css, html, nothing } from 'lit';
|
||||
import { property, query } from 'lit/decorators.js';
|
||||
import { styleMap } from 'lit/directives/style-map.js';
|
||||
|
||||
+2
-1
@@ -9,7 +9,8 @@ import {
|
||||
RANGE_SYNC_EXCLUDE_ATTR,
|
||||
ShadowlessElement,
|
||||
} from '@blocksuite/block-std';
|
||||
import { assertExists, Bound, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { assertExists, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { cssVarV2 } from '@toeverything/theme/v2';
|
||||
import { css, html, nothing } from 'lit';
|
||||
import { property, query } from 'lit/decorators.js';
|
||||
|
||||
+2
-1
@@ -9,7 +9,8 @@ import {
|
||||
RANGE_SYNC_EXCLUDE_ATTR,
|
||||
ShadowlessElement,
|
||||
} from '@blocksuite/block-std';
|
||||
import { assertExists, Bound, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { assertExists, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { html, nothing } from 'lit';
|
||||
import { property, query } from 'lit/decorators.js';
|
||||
import { styleMap } from 'lit/directives/style-map.js';
|
||||
|
||||
+2
-7
@@ -11,13 +11,8 @@ import {
|
||||
RANGE_SYNC_EXCLUDE_ATTR,
|
||||
ShadowlessElement,
|
||||
} from '@blocksuite/block-std';
|
||||
import {
|
||||
assertExists,
|
||||
Bound,
|
||||
toRadian,
|
||||
Vec,
|
||||
WithDisposable,
|
||||
} from '@blocksuite/global/utils';
|
||||
import { Bound, toRadian, Vec } from '@blocksuite/global/gfx';
|
||||
import { assertExists, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { html, nothing } from 'lit';
|
||||
import { property, query } from 'lit/decorators.js';
|
||||
import { styleMap } from 'lit/directives/style-map.js';
|
||||
|
||||
@@ -10,13 +10,8 @@ import {
|
||||
RANGE_SYNC_EXCLUDE_ATTR,
|
||||
ShadowlessElement,
|
||||
} from '@blocksuite/block-std';
|
||||
import {
|
||||
assertExists,
|
||||
Bound,
|
||||
toRadian,
|
||||
Vec,
|
||||
WithDisposable,
|
||||
} from '@blocksuite/global/utils';
|
||||
import { Bound, toRadian, Vec } from '@blocksuite/global/gfx';
|
||||
import { assertExists, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { css, html, nothing } from 'lit';
|
||||
import { property, query } from 'lit/decorators.js';
|
||||
import { styleMap } from 'lit/directives/style-map.js';
|
||||
|
||||
+2
-1
@@ -2,7 +2,8 @@ import {
|
||||
EditPropsStore,
|
||||
ThemeProvider,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import { assertExists, Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import {
|
||||
type ReactiveController,
|
||||
type ReactiveControllerHost,
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
import type { Bound, DisposableClass } from '@blocksuite/global/utils';
|
||||
import type { Bound } from '@blocksuite/global/gfx';
|
||||
import type { DisposableClass } from '@blocksuite/global/utils';
|
||||
import type { TemplateResult } from 'lit';
|
||||
|
||||
import type { EdgelessRootBlockComponent } from '../../../../edgeless-root-block.js';
|
||||
|
||||
+2
-1
@@ -12,7 +12,8 @@ import {
|
||||
TelemetryProvider,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import { openFileOrFiles } from '@blocksuite/affine-shared/utils';
|
||||
import { assertInstanceOf, Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { assertInstanceOf } from '@blocksuite/global/utils';
|
||||
import type { TemplateResult } from 'lit';
|
||||
import * as Y from 'yjs';
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import {
|
||||
import type { BlockStdScope } from '@blocksuite/block-std';
|
||||
import { modelContext, stdContext } from '@blocksuite/block-std';
|
||||
import { ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import type { Bound } from '@blocksuite/global/utils';
|
||||
import type { Bound } from '@blocksuite/global/gfx';
|
||||
import { SignalWatcher } from '@blocksuite/global/utils';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
import { consume } from '@lit/context';
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import {
|
||||
ThemeProvider,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import type { GfxToolsFullOptionValue } from '@blocksuite/block-std/gfx';
|
||||
import type { Bound } from '@blocksuite/global/utils';
|
||||
import type { Bound } from '@blocksuite/global/gfx';
|
||||
import { SignalWatcher } from '@blocksuite/global/utils';
|
||||
import { computed } from '@preact/signals-core';
|
||||
import { css, html, LitElement, nothing } from 'lit';
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { openFileOrFiles } from '@blocksuite/affine-shared/utils';
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import type { Bound } from '@blocksuite/global/utils';
|
||||
import type { Bound } from '@blocksuite/global/gfx';
|
||||
import c from 'simple-xml-to-json';
|
||||
|
||||
type MindMapNode = {
|
||||
|
||||
+2
-1
@@ -6,7 +6,8 @@ import { toast } from '@blocksuite/affine-components/toast';
|
||||
import type { FrameBlockModel } from '@blocksuite/affine-model';
|
||||
import { EditPropsStore } from '@blocksuite/affine-shared/services';
|
||||
import type { GfxToolsFullOptionValue } from '@blocksuite/block-std/gfx';
|
||||
import { Bound, clamp, SignalWatcher } from '@blocksuite/global/utils';
|
||||
import { Bound, clamp } from '@blocksuite/global/gfx';
|
||||
import { SignalWatcher } from '@blocksuite/global/utils';
|
||||
import {
|
||||
EndPointArrowIcon,
|
||||
ExpandCloseIcon,
|
||||
|
||||
+2
-1
@@ -8,7 +8,8 @@ import {
|
||||
type ShapeName,
|
||||
type ShapeStyle,
|
||||
} from '@blocksuite/affine-model';
|
||||
import { Bound, sleep, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { sleep, WithDisposable } from '@blocksuite/global/utils';
|
||||
import {
|
||||
css,
|
||||
html,
|
||||
|
||||
+2
-1
@@ -10,7 +10,8 @@ import {
|
||||
requestConnectedFrame,
|
||||
stopPropagation,
|
||||
} from '@blocksuite/affine-shared/utils';
|
||||
import { type Bound, WithDisposable } from '@blocksuite/global/utils';
|
||||
import type { Bound } from '@blocksuite/global/gfx';
|
||||
import { WithDisposable } from '@blocksuite/global/utils';
|
||||
import { baseTheme } from '@toeverything/theme';
|
||||
import { css, html, LitElement, nothing, unsafeCSS } from 'lit';
|
||||
import { property, state } from 'lit/decorators.js';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { CursorType, StandardCursor } from '@blocksuite/block-std/gfx';
|
||||
import type { IVec } from '@blocksuite/global/utils';
|
||||
import { assertExists, normalizeDegAngle, Vec } from '@blocksuite/global/utils';
|
||||
import type { IVec } from '@blocksuite/global/gfx';
|
||||
import { normalizeDegAngle, Vec } from '@blocksuite/global/gfx';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { css, html } from 'lit';
|
||||
|
||||
// "<svg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'><g><path fill='white' d='M13.7,18.5h3.9l0-1.5c0-1.4-1.2-2.6-2.6-2.6h-1.5v3.9l-5.8-5.8l5.8-5.8v3.9h2.3c3.1,0,5.6,2.5,5.6,5.6v2.3h3.9l-5.8,5.8L13.7,18.5z'/><path d='M20.4,19.4v-3.2c0-2.6-2.1-4.7-4.7-4.7h-3.2l0,0V9L9,12.6l3.6,3.6v-2.6l0,0H15c1.9,0,3.5,1.6,3.5,3.5v2.4l0,0h-2.6l3.6,3.6l3.6-3.6L20.4,19.4L20.4,19.4z'/></g></svg>";
|
||||
export function generateCursorUrl(
|
||||
angle = 0,
|
||||
fallback: StandardCursor = 'default'
|
||||
|
||||
@@ -29,7 +29,7 @@ import {
|
||||
isGfxGroupCompatibleModel,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import { IS_MAC } from '@blocksuite/global/env';
|
||||
import { Bound, getCommonBound } from '@blocksuite/global/utils';
|
||||
import { Bound, getCommonBound } from '@blocksuite/global/gfx';
|
||||
|
||||
import { PageKeyboardManager } from '../keyboard/keyboard-manager.js';
|
||||
import type { EdgelessRootBlockComponent } from './edgeless-root-block.js';
|
||||
|
||||
@@ -39,7 +39,8 @@ import {
|
||||
type GfxViewportElement,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import { IS_WINDOWS } from '@blocksuite/global/env';
|
||||
import { assertExists, Bound, Point, Vec } from '@blocksuite/global/utils';
|
||||
import { Bound, Point, Vec } from '@blocksuite/global/gfx';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { effect } from '@preact/signals-core';
|
||||
import { css, html } from 'lit';
|
||||
import { query } from 'lit/decorators.js';
|
||||
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
ZOOM_STEP,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import { Bound, getCommonBound } from '@blocksuite/global/utils';
|
||||
import { Bound, getCommonBound } from '@blocksuite/global/gfx';
|
||||
import { effect } from '@preact/signals-core';
|
||||
import clamp from 'lodash-es/clamp';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { BrushElementModel } from '@blocksuite/affine-model';
|
||||
import { TelemetryProvider } from '@blocksuite/affine-shared/services';
|
||||
import type { PointerEventState } from '@blocksuite/block-std';
|
||||
import { BaseTool } from '@blocksuite/block-std/gfx';
|
||||
import type { IVec } from '@blocksuite/global/utils';
|
||||
import type { IVec } from '@blocksuite/global/gfx';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
|
||||
export class BrushTool extends BaseTool {
|
||||
|
||||
@@ -19,8 +19,8 @@ import {
|
||||
import { TelemetryProvider } from '@blocksuite/affine-shared/services';
|
||||
import type { PointerEventState } from '@blocksuite/block-std';
|
||||
import { BaseTool, type GfxModel } from '@blocksuite/block-std/gfx';
|
||||
import type { IBound, IVec } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import type { IBound, IVec } from '@blocksuite/global/gfx';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
|
||||
enum ConnectorToolMode {
|
||||
// Dragging connect
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { PointerEventState } from '@blocksuite/block-std';
|
||||
import type { GfxElementModelView } from '@blocksuite/block-std/gfx';
|
||||
import { Bound, last } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { last } from '@blocksuite/global/utils';
|
||||
|
||||
import { DefaultModeDragType, DefaultToolExt } from './ext.js';
|
||||
|
||||
|
||||
+2
-1
@@ -8,7 +8,8 @@ import {
|
||||
type MindmapNode,
|
||||
type MindmapRoot,
|
||||
} from '@blocksuite/affine-model';
|
||||
import { Bound, last } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { last } from '@blocksuite/global/utils';
|
||||
|
||||
const isOnEdge = (node: MindmapNode, direction: 'tail' | 'head') => {
|
||||
let current = node;
|
||||
|
||||
+2
-2
@@ -15,11 +15,11 @@ import {
|
||||
type Bound,
|
||||
isVecZero,
|
||||
type IVec,
|
||||
last,
|
||||
PointLocation,
|
||||
toRadian,
|
||||
Vec,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import { last } from '@blocksuite/global/utils';
|
||||
|
||||
export class MindMapIndicatorOverlay extends Overlay {
|
||||
static INDICATOR_SIZE = [48, 22];
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ import {
|
||||
type GfxPrimitiveElementModel,
|
||||
isGfxGroupCompatibleModel,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import type { Bound, IVec } from '@blocksuite/global/utils';
|
||||
import type { Bound, IVec } from '@blocksuite/global/gfx';
|
||||
|
||||
import { isSingleMindMapNode } from '../../../utils/mindmap.js';
|
||||
import { isMindmapNode } from '../../../utils/query.js';
|
||||
|
||||
@@ -41,15 +41,9 @@ import {
|
||||
isGfxGroupCompatibleModel,
|
||||
type PointTestOptions,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import type { IVec } from '@blocksuite/global/utils';
|
||||
import {
|
||||
Bound,
|
||||
DisposableGroup,
|
||||
getCommonBoundWithRotation,
|
||||
last,
|
||||
noop,
|
||||
Vec,
|
||||
} from '@blocksuite/global/utils';
|
||||
import type { IVec } from '@blocksuite/global/gfx';
|
||||
import { Bound, getCommonBoundWithRotation, Vec } from '@blocksuite/global/gfx';
|
||||
import { DisposableGroup, last, noop } from '@blocksuite/global/utils';
|
||||
import { effect } from '@preact/signals-core';
|
||||
import clamp from 'lodash-es/clamp';
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
getSvgPathFromStroke,
|
||||
type IVec,
|
||||
linePolygonIntersects,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
|
||||
class EraserOverlay extends Overlay {
|
||||
d = '';
|
||||
|
||||
@@ -14,8 +14,8 @@ import {
|
||||
getTopElements,
|
||||
GfxExtensionIdentifier,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import type { IPoint, IVec } from '@blocksuite/global/utils';
|
||||
import { Bound, Vec } from '@blocksuite/global/utils';
|
||||
import type { IPoint, IVec } from '@blocksuite/global/gfx';
|
||||
import { Bound, Vec } from '@blocksuite/global/gfx';
|
||||
import { Text } from '@blocksuite/store';
|
||||
import * as Y from 'yjs';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ThemeProvider } from '@blocksuite/affine-shared/services';
|
||||
import { LassoMode } from '@blocksuite/affine-shared/types';
|
||||
import type { PointerEventState } from '@blocksuite/block-std';
|
||||
import { BaseTool } from '@blocksuite/block-std/gfx';
|
||||
import type { IPoint, IVec } from '@blocksuite/global/utils';
|
||||
import type { IPoint, IVec } from '@blocksuite/global/gfx';
|
||||
import {
|
||||
Bound,
|
||||
getBoundFromPoints,
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
pointInPolygon,
|
||||
rotatePoints,
|
||||
Vec,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
|
||||
class LassoOverlay extends Overlay {
|
||||
d = '';
|
||||
|
||||
@@ -9,7 +9,7 @@ import type { NoteChildrenFlavour } from '@blocksuite/affine-shared/types';
|
||||
import { hasClassNameInList } from '@blocksuite/affine-shared/utils';
|
||||
import type { PointerEventState } from '@blocksuite/block-std';
|
||||
import { BaseTool } from '@blocksuite/block-std/gfx';
|
||||
import { Point } from '@blocksuite/global/utils';
|
||||
import { Point } from '@blocksuite/global/gfx';
|
||||
import { effect } from '@preact/signals-core';
|
||||
|
||||
import { EXCLUDING_MOUSE_OUT_CLASS_LIST } from '../utils/consts.js';
|
||||
|
||||
@@ -12,8 +12,8 @@ import {
|
||||
import { hasClassNameInList } from '@blocksuite/affine-shared/utils';
|
||||
import type { PointerEventState } from '@blocksuite/block-std';
|
||||
import { BaseTool } from '@blocksuite/block-std/gfx';
|
||||
import type { IBound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import type { IBound } from '@blocksuite/global/gfx';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { effect } from '@preact/signals-core';
|
||||
|
||||
import {
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import type { PointerEventState } from '@blocksuite/block-std';
|
||||
import { BaseTool, type GfxController } from '@blocksuite/block-std/gfx';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import * as Y from 'yjs';
|
||||
|
||||
import type { EdgelessRootBlockComponent } from '../edgeless-root-block.js';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { generateElementId, sortIndex } from '@blocksuite/affine-block-surface';
|
||||
import type { ConnectorElementModel } from '@blocksuite/affine-model';
|
||||
import { assertExists, assertType, Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { assertExists, assertType } from '@blocksuite/global/utils';
|
||||
import type { BlockSnapshot, SnapshotNode } from '@blocksuite/store';
|
||||
|
||||
import type { SlotBlockPayload, TemplateJob } from './template.js';
|
||||
|
||||
@@ -3,13 +3,8 @@ import type {
|
||||
SurfaceBlockTransformer,
|
||||
} from '@blocksuite/affine-block-surface';
|
||||
import type { ConnectorElementModel } from '@blocksuite/affine-model';
|
||||
import {
|
||||
assertExists,
|
||||
assertType,
|
||||
Bound,
|
||||
getCommonBound,
|
||||
Slot,
|
||||
} from '@blocksuite/global/utils';
|
||||
import { Bound, getCommonBound } from '@blocksuite/global/gfx';
|
||||
import { assertExists, assertType, Slot } from '@blocksuite/global/utils';
|
||||
import {
|
||||
type BlockModel,
|
||||
type BlockSnapshot,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { SerializedElement } from '@blocksuite/block-std/gfx';
|
||||
import { Bound, getBoundWithRotation } from '@blocksuite/global/utils';
|
||||
import { Bound, getBoundWithRotation } from '@blocksuite/global/gfx';
|
||||
import { type BlockSnapshot, BlockSnapshotSchema } from '@blocksuite/store';
|
||||
|
||||
export function getBoundFromSerializedElement(element: SerializedElement) {
|
||||
|
||||
@@ -18,7 +18,8 @@ import {
|
||||
type GfxModel,
|
||||
type SerializedElement,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import { getCommonBoundWithRotation, groupBy } from '@blocksuite/global/utils';
|
||||
import { getCommonBoundWithRotation } from '@blocksuite/global/gfx';
|
||||
import { groupBy } from '@blocksuite/global/utils';
|
||||
import { type BlockSnapshot, BlockSnapshotSchema } from '@blocksuite/store';
|
||||
|
||||
import type { EdgelessRootBlockComponent } from '../edgeless-root-block.js';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { PointerEventState } from '@blocksuite/block-std';
|
||||
import type { Viewport } from '@blocksuite/block-std/gfx';
|
||||
import type { IVec } from '@blocksuite/global/utils';
|
||||
import type { IVec } from '@blocksuite/global/gfx';
|
||||
|
||||
const PANNING_DISTANCE = 30;
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ import type {
|
||||
GfxToolsFullOptionValue,
|
||||
Viewport,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import type { PointLocation } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import type { PointLocation } from '@blocksuite/global/gfx';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
|
||||
export function isMindmapNode(element: GfxBlockElementModel | GfxModel | null) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Overlay } from '@blocksuite/affine-block-surface';
|
||||
import { ConnectorElementModel } from '@blocksuite/affine-model';
|
||||
import type { GfxModel } from '@blocksuite/block-std/gfx';
|
||||
import { almostEqual, Bound, Point } from '@blocksuite/global/utils';
|
||||
import { almostEqual, Bound, Point } from '@blocksuite/global/gfx';
|
||||
|
||||
interface Distance {
|
||||
horiz?: {
|
||||
|
||||
@@ -12,8 +12,9 @@ import type {
|
||||
import { ShapeElementModel, TextElementModel } from '@blocksuite/affine-model';
|
||||
import type { PointerEventState } from '@blocksuite/block-std';
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import type { IVec } from '@blocksuite/global/utils';
|
||||
import { assertInstanceOf, Bound } from '@blocksuite/global/utils';
|
||||
import type { IVec } from '@blocksuite/global/gfx';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { assertInstanceOf } from '@blocksuite/global/utils';
|
||||
import * as Y from 'yjs';
|
||||
|
||||
import { EdgelessConnectorLabelEditor } from '../components/text/edgeless-connector-label-editor.js';
|
||||
|
||||
@@ -12,10 +12,10 @@ import {
|
||||
} from '@blocksuite/affine-model';
|
||||
import { ThemeProvider } from '@blocksuite/affine-shared/services';
|
||||
import type { GfxController, GfxToolsMap } from '@blocksuite/block-std/gfx';
|
||||
import type { XYWH } from '@blocksuite/global/utils';
|
||||
import type { XYWH } from '@blocksuite/global/gfx';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import {
|
||||
assertType,
|
||||
Bound,
|
||||
DisposableGroup,
|
||||
noop,
|
||||
Slot,
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
BlockSelection,
|
||||
TextSelection,
|
||||
} from '@blocksuite/block-std';
|
||||
import { Point } from '@blocksuite/global/utils';
|
||||
import { Point } from '@blocksuite/global/gfx';
|
||||
import type { BlockModel, Text } from '@blocksuite/store';
|
||||
import { css, html } from 'lit';
|
||||
import { query } from 'lit/decorators.js';
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { MindmapElementModel } from '@blocksuite/affine-model';
|
||||
import { TelemetryProvider } from '@blocksuite/affine-shared/services';
|
||||
import type { GfxModel } from '@blocksuite/block-std/gfx';
|
||||
import { Bound, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { WithDisposable } from '@blocksuite/global/utils';
|
||||
import { FrameIcon } from '@blocksuite/icons/lit';
|
||||
import { css, html, LitElement, nothing } from 'lit';
|
||||
import { property } from 'lit/decorators.js';
|
||||
|
||||
@@ -6,7 +6,8 @@ import {
|
||||
} from '@blocksuite/affine-block-surface';
|
||||
import { MindmapElementModel } from '@blocksuite/affine-model';
|
||||
import type { GfxModel } from '@blocksuite/block-std/gfx';
|
||||
import { Bound, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { WithDisposable } from '@blocksuite/global/utils';
|
||||
import {
|
||||
AlignBottomIcon,
|
||||
AlignHorizontalCenterIcon,
|
||||
|
||||
+2
-1
@@ -18,7 +18,8 @@ import {
|
||||
EMBED_CARD_WIDTH,
|
||||
} from '@blocksuite/affine-shared/consts';
|
||||
import { ThemeProvider } from '@blocksuite/affine-shared/services';
|
||||
import { Bound, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { WithDisposable } from '@blocksuite/global/utils';
|
||||
import type { TemplateResult } from 'lit';
|
||||
import { html, LitElement, nothing } from 'lit';
|
||||
import { property } from 'lit/decorators.js';
|
||||
|
||||
+2
-1
@@ -54,7 +54,8 @@ import {
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import { getHostName, referenceToNode } from '@blocksuite/affine-shared/utils';
|
||||
import type { BlockStdScope } from '@blocksuite/block-std';
|
||||
import { Bound, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { WithDisposable } from '@blocksuite/global/utils';
|
||||
import { css, html, LitElement, nothing, type TemplateResult } from 'lit';
|
||||
import { property, state } from 'lit/decorators.js';
|
||||
import { ifDefined } from 'lit/directives/if-defined.js';
|
||||
|
||||
@@ -22,13 +22,8 @@ import { FeatureFlagService } from '@blocksuite/affine-shared/services';
|
||||
import type { ColorEvent } from '@blocksuite/affine-shared/utils';
|
||||
import { matchModels } from '@blocksuite/affine-shared/utils';
|
||||
import { GfxExtensionIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import {
|
||||
countBy,
|
||||
deserializeXYWH,
|
||||
maxBy,
|
||||
serializeXYWH,
|
||||
WithDisposable,
|
||||
} from '@blocksuite/global/utils';
|
||||
import { deserializeXYWH, serializeXYWH } from '@blocksuite/global/gfx';
|
||||
import { countBy, maxBy, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { EditIcon, PageIcon, UngroupIcon } from '@blocksuite/icons/lit';
|
||||
import { html, LitElement, nothing } from 'lit';
|
||||
import { property, query } from 'lit/decorators.js';
|
||||
|
||||
@@ -7,11 +7,8 @@ import {
|
||||
NoteDisplayMode,
|
||||
} from '@blocksuite/affine-model';
|
||||
import { matchModels } from '@blocksuite/affine-shared/utils';
|
||||
import {
|
||||
deserializeXYWH,
|
||||
serializeXYWH,
|
||||
WithDisposable,
|
||||
} from '@blocksuite/global/utils';
|
||||
import { deserializeXYWH, serializeXYWH } from '@blocksuite/global/gfx';
|
||||
import { WithDisposable } from '@blocksuite/global/utils';
|
||||
import { EditIcon, PageIcon, UngroupIcon } from '@blocksuite/icons/lit';
|
||||
import { html, LitElement, nothing } from 'lit';
|
||||
import { property } from 'lit/decorators.js';
|
||||
|
||||
@@ -30,12 +30,8 @@ import {
|
||||
TelemetryProvider,
|
||||
ThemeProvider,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import {
|
||||
Bound,
|
||||
countBy,
|
||||
maxBy,
|
||||
WithDisposable,
|
||||
} from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { countBy, maxBy, WithDisposable } from '@blocksuite/global/utils';
|
||||
import {
|
||||
AutoHeightIcon,
|
||||
CornerIcon,
|
||||
|
||||
@@ -31,12 +31,8 @@ import {
|
||||
} from '@blocksuite/affine-model';
|
||||
import { FeatureFlagService } from '@blocksuite/affine-shared/services';
|
||||
import type { ColorEvent } from '@blocksuite/affine-shared/utils';
|
||||
import {
|
||||
Bound,
|
||||
countBy,
|
||||
maxBy,
|
||||
WithDisposable,
|
||||
} from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { countBy, maxBy, WithDisposable } from '@blocksuite/global/utils';
|
||||
import {
|
||||
TextAlignCenterIcon,
|
||||
TextAlignLeftIcon,
|
||||
|
||||
@@ -30,13 +30,8 @@ import { ThemeProvider } from '@blocksuite/affine-shared/services';
|
||||
import { requestConnectedFrame } from '@blocksuite/affine-shared/utils';
|
||||
import { WidgetComponent } from '@blocksuite/block-std';
|
||||
import type { GfxModel } from '@blocksuite/block-std/gfx';
|
||||
import {
|
||||
atLeastNMatches,
|
||||
clamp,
|
||||
getCommonBoundWithRotation,
|
||||
groupBy,
|
||||
pickValues,
|
||||
} from '@blocksuite/global/utils';
|
||||
import { clamp, getCommonBoundWithRotation } from '@blocksuite/global/gfx';
|
||||
import { atLeastNMatches, groupBy, pickValues } from '@blocksuite/global/utils';
|
||||
import { ConnectorCIcon } from '@blocksuite/icons/lit';
|
||||
import { css, html, nothing, type TemplateResult, unsafeCSS } from 'lit';
|
||||
import { property, state } from 'lit/decorators.js';
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
OpenDocExtensionIdentifier,
|
||||
TelemetryProvider,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import { Bound, getCommonBoundWithRotation } from '@blocksuite/global/utils';
|
||||
import { Bound, getCommonBoundWithRotation } from '@blocksuite/global/gfx';
|
||||
import {
|
||||
ArrowDownBigBottomIcon,
|
||||
ArrowDownBigIcon,
|
||||
|
||||
@@ -7,7 +7,8 @@ import {
|
||||
GfxControllerIdentifier,
|
||||
type GfxModel,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import { assertExists, Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
|
||||
export const edgelessToBlob = async (
|
||||
host: EditorHost,
|
||||
|
||||
@@ -11,7 +11,8 @@ import type {
|
||||
ImageBlockModel,
|
||||
} from '@blocksuite/affine-model';
|
||||
import { ShadowlessElement } from '@blocksuite/block-std';
|
||||
import { Bound, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { WithDisposable } from '@blocksuite/global/utils';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
import { css, type TemplateResult } from 'lit';
|
||||
import { property } from 'lit/decorators.js';
|
||||
|
||||
@@ -17,7 +17,8 @@ import {
|
||||
RANGE_QUERY_EXCLUDE_ATTR,
|
||||
ShadowlessElement,
|
||||
} from '@blocksuite/block-std';
|
||||
import { deserializeXYWH, WithDisposable } from '@blocksuite/global/utils';
|
||||
import { deserializeXYWH } from '@blocksuite/global/gfx';
|
||||
import { WithDisposable } from '@blocksuite/global/utils';
|
||||
import { type BlockModel, type Query } from '@blocksuite/store';
|
||||
import { css, nothing } from 'lit';
|
||||
import { property } from 'lit/decorators.js';
|
||||
|
||||
@@ -37,12 +37,11 @@ import {
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import {
|
||||
assertExists,
|
||||
Bound,
|
||||
deserializeXYWH,
|
||||
DisposableGroup,
|
||||
type SerializedXYWH,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import { assertExists, DisposableGroup } from '@blocksuite/global/utils';
|
||||
import { DeleteIcon, EdgelessIcon, FrameIcon } from '@blocksuite/icons/lit';
|
||||
import type { BaseSelection, Store } from '@blocksuite/store';
|
||||
import { css, html, nothing, type TemplateResult } from 'lit';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { IVec, IVec3 } from '@blocksuite/global/utils';
|
||||
import { almostEqual } from '@blocksuite/global/utils';
|
||||
import type { IVec, IVec3 } from '@blocksuite/global/gfx';
|
||||
import { almostEqual } from '@blocksuite/global/gfx';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { AStarRunner } from '../utils/a-star.js';
|
||||
@@ -55,7 +55,7 @@ describe('a* algorithm', () => {
|
||||
let path: IVec[] | IVec3[] = aStar.path;
|
||||
path.pop();
|
||||
path.shift();
|
||||
path = mergePath(path);
|
||||
path = mergePath(path as IVec3[]);
|
||||
const expected = [
|
||||
[0, 0],
|
||||
[100, 0],
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
getCommonBound,
|
||||
inflateBound,
|
||||
transformPointsToNewBound,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
describe('bound utils', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { Graph } from '../utils/graph.js';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {
|
||||
almostEqual,
|
||||
assertExists,
|
||||
isPointOnLineSegment,
|
||||
type IVec,
|
||||
lineEllipseIntersects,
|
||||
@@ -12,7 +11,8 @@ import {
|
||||
rotatePoints,
|
||||
toDegree,
|
||||
toRadian,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
describe('Line', () => {
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
GfxControllerIdentifier,
|
||||
type GfxModel,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import chunk from 'lodash.chunk';
|
||||
|
||||
const ALIGN_HEIGHT = 200;
|
||||
|
||||
@@ -28,8 +28,8 @@ import {
|
||||
type GfxPrimitiveElementModel,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import type { IBound } from '@blocksuite/global/utils';
|
||||
import { Bound, deserializeXYWH } from '@blocksuite/global/utils';
|
||||
import type { IBound } from '@blocksuite/global/gfx';
|
||||
import { Bound, deserializeXYWH } from '@blocksuite/global/gfx';
|
||||
import type { ExtensionType, Store } from '@blocksuite/store';
|
||||
|
||||
import { SurfaceElementModel } from '../../element-model/base.js';
|
||||
|
||||
@@ -12,12 +12,9 @@ import type {
|
||||
GfxLocalElementModel,
|
||||
GfxModel,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import type { IBound, IVec, IVec3 } from '@blocksuite/global/utils';
|
||||
import type { IBound, IVec, IVec3 } from '@blocksuite/global/gfx';
|
||||
import {
|
||||
almostEqual,
|
||||
assertEquals,
|
||||
assertExists,
|
||||
assertType,
|
||||
Bound,
|
||||
clamp,
|
||||
getBezierCurveBoundingBox,
|
||||
@@ -27,13 +24,18 @@ import {
|
||||
getPointFromBoundsWithRotation,
|
||||
isOverlap,
|
||||
isVecZero,
|
||||
last,
|
||||
lineIntersects,
|
||||
PI2,
|
||||
PointLocation,
|
||||
sign,
|
||||
toRadian,
|
||||
Vec,
|
||||
} from '@blocksuite/global/gfx';
|
||||
import {
|
||||
assertEquals,
|
||||
assertExists,
|
||||
assertType,
|
||||
last,
|
||||
} from '@blocksuite/global/utils';
|
||||
import { effect } from '@preact/signals-core';
|
||||
|
||||
|
||||
@@ -6,14 +6,9 @@ import type {
|
||||
SurfaceBlockModel,
|
||||
Viewport,
|
||||
} from '@blocksuite/block-std/gfx';
|
||||
import type { IBound } from '@blocksuite/global/utils';
|
||||
import {
|
||||
DisposableGroup,
|
||||
getBoundWithRotation,
|
||||
intersects,
|
||||
last,
|
||||
Slot,
|
||||
} from '@blocksuite/global/utils';
|
||||
import type { IBound } from '@blocksuite/global/gfx';
|
||||
import { getBoundWithRotation, intersects } from '@blocksuite/global/gfx';
|
||||
import { DisposableGroup, last, Slot } from '@blocksuite/global/utils';
|
||||
|
||||
import type { SurfaceElementModel } from '../element-model/base.js';
|
||||
import { RoughCanvas } from '../utils/rough/canvas.js';
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
import {
|
||||
getBezierParameters,
|
||||
type PointLocation,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import { deltaInsertsToChunks } from '@blocksuite/inline';
|
||||
|
||||
import { isConnectorWithLabel } from '../../../managers/connector-manager.js';
|
||||
|
||||
@@ -7,12 +7,12 @@ import type {
|
||||
BezierCurveParameters,
|
||||
IVec,
|
||||
PointLocation,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
import {
|
||||
getBezierParameters,
|
||||
getBezierTangent,
|
||||
Vec,
|
||||
} from '@blocksuite/global/utils';
|
||||
} from '@blocksuite/global/gfx';
|
||||
|
||||
import type { RoughCanvas } from '../../../utils/rough/canvas.js';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GroupElementModel } from '@blocksuite/affine-model';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
|
||||
import type { CanvasRenderer } from '../../canvas-renderer.js';
|
||||
import { titleRenderParams } from './utils.js';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { GroupElementModel } from '@blocksuite/affine-model';
|
||||
import { FontWeight } from '@blocksuite/affine-model';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
|
||||
import {
|
||||
getFontString,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GfxPrimitiveElementModel } from '@blocksuite/block-std/gfx';
|
||||
import type { IBound } from '@blocksuite/global/utils';
|
||||
import type { IBound } from '@blocksuite/global/gfx';
|
||||
|
||||
import type { RoughCanvas } from '../../index.js';
|
||||
import type { CanvasRenderer } from '../canvas-renderer.js';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user