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