mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
fix: remove global, store and std in affine packages (#9785)
This commit is contained in:
@@ -20,10 +20,7 @@
|
||||
"@blocksuite/affine": "workspace:*",
|
||||
"@blocksuite/affine-components": "workspace:*",
|
||||
"@blocksuite/affine-shared": "workspace:*",
|
||||
"@blocksuite/block-std": "workspace:*",
|
||||
"@blocksuite/global": "workspace:*",
|
||||
"@blocksuite/icons": "2.2.2",
|
||||
"@blocksuite/store": "workspace:*",
|
||||
"@capacitor/app": "^6.0.2",
|
||||
"@capacitor/browser": "^6.0.4",
|
||||
"@dotlottie/player-component": "^2.7.12",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { EditorHost } from '@blocksuite/affine/block-std';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/affine/block-std/gfx';
|
||||
import type {
|
||||
AffineAIPanelWidget,
|
||||
AIError,
|
||||
@@ -15,7 +16,6 @@ import {
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import { Slice } from '@blocksuite/affine/store';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import type { TemplateResult } from 'lit';
|
||||
|
||||
import { AIChatBlockModel } from '../../../blocks';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Store } from '@blocksuite/store';
|
||||
import type { Store } from '@blocksuite/affine/store';
|
||||
import type { Signal } from '@preact/signals-core';
|
||||
|
||||
export interface AINetworkSearchConfig {
|
||||
|
||||
@@ -4,8 +4,8 @@ import {
|
||||
MarkdownInlineToDeltaAdapterExtensions,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { Container } from '@blocksuite/affine/global/di';
|
||||
import { Schema } from '@blocksuite/store';
|
||||
import { TestWorkspace } from '@blocksuite/store/test';
|
||||
import { Schema } from '@blocksuite/affine/store';
|
||||
import { TestWorkspace } from '@blocksuite/affine/store/test';
|
||||
import { describe, expect, test } from 'vitest';
|
||||
|
||||
import { markdownToMindmap } from '../mindmap-preview.js';
|
||||
|
||||
@@ -10,9 +10,9 @@ import {
|
||||
NoteDisplayMode,
|
||||
titleMiddleware,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { ServiceProvider } from '@blocksuite/affine/global/di';
|
||||
import type { BlockModel, Store } from '@blocksuite/affine/store';
|
||||
import { Slice, toDraftModel, Transformer } from '@blocksuite/affine/store';
|
||||
import type { ServiceProvider } from '@blocksuite/global/di';
|
||||
|
||||
import type { ChatContextValue, DocContext } from '../chat-panel/chat-context';
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { type EditorHost, TextSelection } from '@blocksuite/affine/block-std';
|
||||
import type { GfxModel } from '@blocksuite/affine/block-std/gfx';
|
||||
import {
|
||||
BlocksUtils,
|
||||
type CopilotTool,
|
||||
@@ -14,7 +15,6 @@ import {
|
||||
Slice,
|
||||
toDraftModel,
|
||||
} from '@blocksuite/affine/store';
|
||||
import type { GfxModel } from '@blocksuite/block-std/gfx';
|
||||
|
||||
import { getContentFromSlice } from '../../_common';
|
||||
import { getEdgelessCopilotWidget, getService } from './edgeless';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { toGfxBlockComponent } from '@blocksuite/affine/block-std';
|
||||
import { Bound } from '@blocksuite/global/utils';
|
||||
import { Bound } from '@blocksuite/affine/global/utils';
|
||||
import { html } from 'lit';
|
||||
import { styleMap } from 'lit/directives/style-map.js';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { EditorHost } from '@blocksuite/block-std';
|
||||
import type { AffineAIPanelState } from '@blocksuite/blocks';
|
||||
import type { EditorHost } from '@blocksuite/affine/block-std';
|
||||
import type { AffineAIPanelState } from '@blocksuite/affine/blocks';
|
||||
import { css, html, LitElement } from 'lit';
|
||||
import { property } from 'lit/decorators.js';
|
||||
import { classMap } from 'lit/directives/class-map.js';
|
||||
|
||||
@@ -32,6 +32,7 @@ import {
|
||||
TelemetryProvider,
|
||||
ThemeExtensionIdentifier,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { Container } from '@blocksuite/affine/global/di';
|
||||
import type { ExtensionType } from '@blocksuite/affine/store';
|
||||
import {
|
||||
createSignalFromObservable,
|
||||
@@ -39,7 +40,6 @@ import {
|
||||
type Signal,
|
||||
SpecProvider,
|
||||
} from '@blocksuite/affine-shared/utils';
|
||||
import type { Container } from '@blocksuite/global/di';
|
||||
import { LinkedPageIcon, PageIcon } from '@blocksuite/icons/lit';
|
||||
import { type FrameworkProvider } from '@toeverything/infra';
|
||||
import type { TemplateResult } from 'lit';
|
||||
|
||||
@@ -7,9 +7,9 @@ import { useInsidePeekView } from '@affine/core/modules/peek-view/view/modal-con
|
||||
import { WorkspaceService } from '@affine/core/modules/workspace';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/affine/block-std/gfx';
|
||||
import { matchFlavours, type NoteBlockModel } from '@blocksuite/affine/blocks';
|
||||
import { Bound } from '@blocksuite/affine/global/utils';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import {
|
||||
ExpandFullIcon,
|
||||
InformationIcon,
|
||||
|
||||
@@ -5,9 +5,8 @@ import 'fake-indexeddb/auto';
|
||||
|
||||
import { AffineSchemas } from '@blocksuite/affine/blocks/schemas';
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import { type Store, Text } from '@blocksuite/affine/store';
|
||||
import { Schema } from '@blocksuite/store';
|
||||
import { TestWorkspace } from '@blocksuite/store/test';
|
||||
import { Schema, type Store, Text } from '@blocksuite/affine/store';
|
||||
import { TestWorkspace } from '@blocksuite/affine/store/test';
|
||||
import { renderHook } from '@testing-library/react';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
||||
|
||||
@@ -18,10 +18,10 @@ import {
|
||||
SpecProvider,
|
||||
ThemeExtensionIdentifier,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { Container } from '@blocksuite/affine/global/di';
|
||||
import { Bound } from '@blocksuite/affine/global/utils';
|
||||
import type { Block, Store } from '@blocksuite/affine/store';
|
||||
import { createSignalFromObservable } from '@blocksuite/affine-shared/utils';
|
||||
import type { Container } from '@blocksuite/global/di';
|
||||
import type { Signal } from '@preact/signals-core';
|
||||
import type { FrameworkProvider } from '@toeverything/infra';
|
||||
import { useFramework } from '@toeverything/infra';
|
||||
|
||||
@@ -25,8 +25,8 @@ import {
|
||||
DocModes,
|
||||
RefNodeSlotsProvider,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { DisposableGroup } from '@blocksuite/affine/global/utils';
|
||||
import type { AffineEditorContainer } from '@blocksuite/affine/presets';
|
||||
import { DisposableGroup } from '@blocksuite/global/utils';
|
||||
import { Logo1Icon } from '@blocksuite/icons/rc';
|
||||
import { FrameworkScope, useLiveData, useService } from '@toeverything/infra';
|
||||
import clsx from 'clsx';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { fuzzyMatch } from '@affine/core/utils/fuzzy-match';
|
||||
import { I18n, i18nTime } from '@affine/i18n';
|
||||
import track from '@affine/track';
|
||||
import type { EditorHost } from '@blocksuite/affine/block-std';
|
||||
import {
|
||||
type AffineInlineEditor,
|
||||
type DocMode,
|
||||
@@ -12,7 +13,6 @@ import {
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import { Text } from '@blocksuite/affine/store';
|
||||
import { createSignalFromObservable } from '@blocksuite/affine-shared/utils';
|
||||
import type { EditorHost } from '@blocksuite/block-std';
|
||||
import {
|
||||
DateTimeIcon,
|
||||
NewXxxEdgelessIcon,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { toURLSearchParams } from '@affine/core/modules/navigation';
|
||||
import type { ReferenceParams } from '@blocksuite/blocks';
|
||||
import type { ReferenceParams } from '@blocksuite/affine/blocks';
|
||||
import { fromPromise, OnEvent, Service } from '@toeverything/infra';
|
||||
import { isEmpty, omit } from 'lodash-es';
|
||||
import { map, type Observable, switchMap } from 'rxjs';
|
||||
|
||||
@@ -7,7 +7,7 @@ Manages template files for use in AFFiNE. For now we only support onboarding tem
|
||||
Before we offer a better solution, to update the onboarding templates:
|
||||
|
||||
1. run AFFiNE core locally (dev mode)
|
||||
2. expose `ZipTransformer` to window. e.g., `import {ZipTransformer} from '@blocksuite/blocks'; window.ZipTransformer = ZipTransformer;`
|
||||
2. expose `ZipTransformer` to window. e.g., `import {ZipTransformer} from '@blocksuite/affine/blocks'; window.ZipTransformer = ZipTransformer;`
|
||||
3. run the following script
|
||||
```js
|
||||
(async () => {
|
||||
|
||||
Reference in New Issue
Block a user