mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-04 08:38:34 +00:00
chore: standardize package references (#9346)
This commit is contained in:
4
.github/workflows/build-test.yml
vendored
4
.github/workflows/build-test.yml
vendored
@@ -315,11 +315,11 @@ jobs:
|
|||||||
electron-install: false
|
electron-install: false
|
||||||
full-cache: true
|
full-cache: true
|
||||||
- name: Build Electron renderer
|
- name: Build Electron renderer
|
||||||
run: yarn affine @affine/electron bundle
|
run: yarn affine @affine/electron-renderer build
|
||||||
env:
|
env:
|
||||||
DISTRIBUTION: desktop
|
DISTRIBUTION: desktop
|
||||||
- name: zip web
|
- name: zip web
|
||||||
run: tar -czf dist.tar.gz --directory=packages/frontend/apps/electron/renderer/dist .
|
run: tar -czf dist.tar.gz --directory=packages/frontend/apps/electron-renderer/dist .
|
||||||
- name: Upload web artifact
|
- name: Upload web artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ Building the desktop client app for the moment is a bit more complicated than bu
|
|||||||
|
|
||||||
1. `packages/frontend/core`: the web app
|
1. `packages/frontend/core`: the web app
|
||||||
2. `packages/frontend/native`: the native modules written in Rust (mostly the sqlite bindings)
|
2. `packages/frontend/native`: the native modules written in Rust (mostly the sqlite bindings)
|
||||||
3. `packages/frontend/electron`: the Electron app (containing main & helper process, and the electron entry point in `packages/frontend/electron/renderer`)
|
3. `packages/frontend/electron`: the Electron app (containing main & helper process, and the electron entry point in `packages/frontend/electron-renderer`)
|
||||||
|
|
||||||
#3 is dependent on #1 and #2, and relies on electron-forge to make the final app & installer. To get a deep understanding of how the desktop client app is built, you may want to read the workflow file in [release-desktop.yml](/.github/workflows/release-desktop.yml).
|
#3 is dependent on #1 and #2, and relies on electron-forge to make the final app & installer. To get a deep understanding of how the desktop client app is built, you may want to read the workflow file in [release-desktop.yml](/.github/workflows/release-desktop.yml).
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"exports": {
|
"exports": {
|
||||||
"./blocksuite": "./src/blocksuite/index.ts",
|
|
||||||
"./storage": "./src/storage/index.ts",
|
"./storage": "./src/storage/index.ts",
|
||||||
"./utils": "./src/utils/index.ts",
|
"./utils": "./src/utils/index.ts",
|
||||||
"./app-config-storage": "./src/app-config-storage.ts",
|
"./app-config-storage": "./src/app-config-storage.ts",
|
||||||
@@ -15,7 +14,6 @@
|
|||||||
"@affine/debug": "workspace:*",
|
"@affine/debug": "workspace:*",
|
||||||
"@affine/env": "workspace:*",
|
"@affine/env": "workspace:*",
|
||||||
"@affine/templates": "workspace:*",
|
"@affine/templates": "workspace:*",
|
||||||
"@blocksuite/affine": "workspace:*",
|
|
||||||
"@datastructures-js/binary-search-tree": "^5.3.2",
|
"@datastructures-js/binary-search-tree": "^5.3.2",
|
||||||
"eventemitter2": "^6.4.9",
|
"eventemitter2": "^6.4.9",
|
||||||
"foxact": "^0.2.43",
|
"foxact": "^0.2.43",
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
export * from './blocks';
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
export * from './app-config-storage';
|
export * from './app-config-storage';
|
||||||
export * from './atom';
|
export * from './atom';
|
||||||
export * from './blocksuite';
|
|
||||||
export * from './framework';
|
export * from './framework';
|
||||||
export * from './initialization';
|
export * from './initialization';
|
||||||
export * from './livedata';
|
export * from './livedata';
|
||||||
|
|||||||
30
packages/frontend/apps/electron-renderer/package.json
Normal file
30
packages/frontend/apps/electron-renderer/package.json
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"name": "@affine/electron-renderer",
|
||||||
|
"private": true,
|
||||||
|
"version": "0.18.0",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"build": "affine bundle",
|
||||||
|
"dev": "affine bundle --dev"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@affine/component": "workspace:*",
|
||||||
|
"@affine/core": "workspace:*",
|
||||||
|
"@affine/electron-api": "workspace:*",
|
||||||
|
"@affine/i18n": "workspace:*",
|
||||||
|
"@emotion/react": "^11.14.0",
|
||||||
|
"@sentry/react": "^8.44.0",
|
||||||
|
"@vanilla-extract/css": "^1.16.1",
|
||||||
|
"next-themes": "^0.4.4",
|
||||||
|
"react": "^19.0.0",
|
||||||
|
"react-dom": "^19.0.0",
|
||||||
|
"react-router-dom": "^6.28.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@affine-tools/utils": "workspace:*",
|
||||||
|
"@types/react": "^19.0.1",
|
||||||
|
"@types/react-dom": "^19.0.2",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
|
"typescript": "^5.7.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function mountApp() {
|
function mountApp() {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
// oxlint-disable-next-line typescript-eslint/no-non-null-assertion
|
||||||
const root = document.getElementById('app')!;
|
const root = document.getElementById('app')!;
|
||||||
createRoot(root).render(
|
createRoot(root).render(
|
||||||
<StrictMode>
|
<StrictMode>
|
||||||
17
packages/frontend/apps/electron-renderer/tsconfig.json
Normal file
17
packages/frontend/apps/electron-renderer/tsconfig.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"composite": true,
|
||||||
|
"outDir": "lib",
|
||||||
|
"moduleResolution": "Bundler",
|
||||||
|
"types": ["affine__env"],
|
||||||
|
"rootDir": "./src"
|
||||||
|
},
|
||||||
|
"include": ["./src"],
|
||||||
|
"references": [
|
||||||
|
{ "path": "../../core" },
|
||||||
|
{
|
||||||
|
"path": "../../electron-api"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
21
packages/frontend/apps/electron-renderer/tsconfig.test.json
Normal file
21
packages/frontend/apps/electron-renderer/tsconfig.test.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"composite": true,
|
||||||
|
"target": "ESNext",
|
||||||
|
"module": "ESNext",
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"moduleResolution": "Node",
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"noEmit": false,
|
||||||
|
"outDir": "./lib/tests",
|
||||||
|
"types": ["node", "affine__env"],
|
||||||
|
"allowJs": true
|
||||||
|
},
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.json"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"include": ["./test"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
export const config = {
|
||||||
|
entry: {
|
||||||
|
app: './src/index.tsx',
|
||||||
|
shell: './src/shell/index.tsx',
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
"dev:prod": "node ./scripts/dev.ts",
|
"dev:prod": "node ./scripts/dev.ts",
|
||||||
"build": "cross-env NODE_ENV=production node ./scripts/build-layers.ts",
|
"build": "cross-env NODE_ENV=production node ./scripts/build-layers.ts",
|
||||||
"build:dev": "node ./scripts/build-layers.ts",
|
"build:dev": "node ./scripts/build-layers.ts",
|
||||||
"bundle": "affine bundle",
|
|
||||||
"generate-assets": "node ./scripts/generate-assets.ts",
|
"generate-assets": "node ./scripts/generate-assets.ts",
|
||||||
"package": "electron-forge package",
|
"package": "electron-forge package",
|
||||||
"make": "electron-forge make",
|
"make": "electron-forge make",
|
||||||
@@ -26,13 +25,8 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@affine-test/kit": "workspace:*",
|
"@affine-test/kit": "workspace:*",
|
||||||
"@affine-tools/utils": "workspace:*",
|
"@affine-tools/utils": "workspace:*",
|
||||||
"@affine/component": "workspace:*",
|
|
||||||
"@affine/core": "workspace:*",
|
|
||||||
"@affine/electron-api": "workspace:*",
|
|
||||||
"@affine/i18n": "workspace:*",
|
|
||||||
"@affine/native": "workspace:*",
|
"@affine/native": "workspace:*",
|
||||||
"@affine/nbstore": "workspace:*",
|
"@affine/nbstore": "workspace:*",
|
||||||
"@blocksuite/affine": "workspace:*",
|
|
||||||
"@electron-forge/cli": "^7.6.0",
|
"@electron-forge/cli": "^7.6.0",
|
||||||
"@electron-forge/core": "^7.6.0",
|
"@electron-forge/core": "^7.6.0",
|
||||||
"@electron-forge/core-utils": "^7.6.0",
|
"@electron-forge/core-utils": "^7.6.0",
|
||||||
@@ -43,7 +37,6 @@
|
|||||||
"@electron-forge/maker-zip": "^7.6.0",
|
"@electron-forge/maker-zip": "^7.6.0",
|
||||||
"@electron-forge/plugin-auto-unpack-natives": "^7.6.0",
|
"@electron-forge/plugin-auto-unpack-natives": "^7.6.0",
|
||||||
"@electron-forge/shared-types": "^7.6.0",
|
"@electron-forge/shared-types": "^7.6.0",
|
||||||
"@emotion/react": "^11.14.0",
|
|
||||||
"@pengx17/electron-forge-maker-appimage": "^1.2.1",
|
"@pengx17/electron-forge-maker-appimage": "^1.2.1",
|
||||||
"@sentry/electron": "^5.8.0",
|
"@sentry/electron": "^5.8.0",
|
||||||
"@sentry/esbuild-plugin": "^2.22.7",
|
"@sentry/esbuild-plugin": "^2.22.7",
|
||||||
@@ -51,7 +44,6 @@
|
|||||||
"@toeverything/infra": "workspace:*",
|
"@toeverything/infra": "workspace:*",
|
||||||
"@types/set-cookie-parser": "^2.4.10",
|
"@types/set-cookie-parser": "^2.4.10",
|
||||||
"@types/uuid": "^10.0.0",
|
"@types/uuid": "^10.0.0",
|
||||||
"@vanilla-extract/css": "^1.16.1",
|
|
||||||
"@vitejs/plugin-react-swc": "^3.7.2",
|
"@vitejs/plugin-react-swc": "^3.7.2",
|
||||||
"app-builder-lib": "^25.1.8",
|
"app-builder-lib": "^25.1.8",
|
||||||
"builder-util-runtime": "^9.2.10",
|
"builder-util-runtime": "^9.2.10",
|
||||||
@@ -67,9 +59,6 @@
|
|||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"msw": "^2.6.8",
|
"msw": "^2.6.8",
|
||||||
"nanoid": "^5.0.9",
|
"nanoid": "^5.0.9",
|
||||||
"react": "^19.0.0",
|
|
||||||
"react-dom": "^19.0.0",
|
|
||||||
"react-router-dom": "^6.28.0",
|
|
||||||
"rxjs": "^7.8.1",
|
"rxjs": "^7.8.1",
|
||||||
"semver": "^7.6.3",
|
"semver": "^7.6.3",
|
||||||
"tree-kill": "^1.2.2",
|
"tree-kill": "^1.2.2",
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../../../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"composite": true,
|
|
||||||
"target": "ESNext",
|
|
||||||
"module": "ESNext",
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"moduleResolution": "Bundler",
|
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
"noEmit": false,
|
|
||||||
"outDir": "../lib",
|
|
||||||
"allowJs": true
|
|
||||||
},
|
|
||||||
"references": [
|
|
||||||
{
|
|
||||||
"path": "../../../../common/env"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "../../../core"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "../../../component"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "../../../../common/infra"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"include": ["."],
|
|
||||||
"exclude": ["dist"]
|
|
||||||
}
|
|
||||||
@@ -17,8 +17,7 @@ const webDir = path.join(
|
|||||||
'packages',
|
'packages',
|
||||||
'frontend',
|
'frontend',
|
||||||
'apps',
|
'apps',
|
||||||
'electron',
|
'electron-renderer'
|
||||||
'renderer'
|
|
||||||
);
|
);
|
||||||
const affineWebOutDir = path.join(webDir, 'dist');
|
const affineWebOutDir = path.join(webDir, 'dist');
|
||||||
const publicAffineOutDir = path.join(publicDistDir, `web-static`);
|
const publicAffineOutDir = path.join(publicDistDir, `web-static`);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export const AIChatBlockSchema = defineBlockSchema({
|
|||||||
export class AIChatBlockModel extends GfxCompatible<AIChatProps>(BlockModel) {}
|
export class AIChatBlockModel extends GfxCompatible<AIChatProps>(BlockModel) {}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
// oxlint-disable-next-line @typescript-eslint/no-namespace
|
||||||
namespace BlockSuite {
|
namespace BlockSuite {
|
||||||
interface EdgelessBlockModelMap {
|
interface EdgelessBlockModelMap {
|
||||||
'affine:embed-ai-chat': AIChatBlockModel;
|
'affine:embed-ai-chat': AIChatBlockModel;
|
||||||
@@ -25,9 +25,9 @@ import {
|
|||||||
type SerializedXYWH,
|
type SerializedXYWH,
|
||||||
} from '@blocksuite/affine/global/utils';
|
} from '@blocksuite/affine/global/utils';
|
||||||
import type { Doc } from '@blocksuite/affine/store';
|
import type { Doc } from '@blocksuite/affine/store';
|
||||||
import type { ChatMessage } from '@toeverything/infra/blocksuite';
|
|
||||||
import type { TemplateResult } from 'lit';
|
import type { TemplateResult } from 'lit';
|
||||||
|
|
||||||
|
import type { ChatMessage } from '../../../blocks';
|
||||||
import { insertFromMarkdown } from '../../_common';
|
import { insertFromMarkdown } from '../../_common';
|
||||||
import { AIProvider, type AIUserInfo } from '../provider';
|
import { AIProvider, type AIUserInfo } from '../provider';
|
||||||
import { reportResponse } from '../utils/action-reporter';
|
import { reportResponse } from '../utils/action-reporter';
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ import {
|
|||||||
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 { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||||
import { AIChatBlockModel } from '@toeverything/infra';
|
|
||||||
import type { TemplateResult } from 'lit';
|
import type { TemplateResult } from 'lit';
|
||||||
|
|
||||||
|
import { AIChatBlockModel } from '../../../blocks';
|
||||||
import { getContentFromSlice } from '../../_common';
|
import { getContentFromSlice } from '../../_common';
|
||||||
import { AIProvider } from '../provider';
|
import { AIProvider } from '../provider';
|
||||||
import { reportResponse } from '../utils/action-reporter';
|
import { reportResponse } from '../utils/action-reporter';
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import type { EditorHost } from '@blocksuite/affine/block-std';
|
import type { EditorHost } from '@blocksuite/affine/block-std';
|
||||||
import { type AIError, openFileOrFiles } from '@blocksuite/affine/blocks';
|
import { type AIError, openFileOrFiles } from '@blocksuite/affine/blocks';
|
||||||
import type { ChatMessage } from '@toeverything/infra';
|
|
||||||
import { css, html, LitElement, nothing } from 'lit';
|
import { css, html, LitElement, nothing } from 'lit';
|
||||||
import { property, query, state } from 'lit/decorators.js';
|
import { property, query, state } from 'lit/decorators.js';
|
||||||
import { classMap } from 'lit/directives/class-map.js';
|
import { classMap } from 'lit/directives/class-map.js';
|
||||||
import { repeat } from 'lit/directives/repeat.js';
|
import { repeat } from 'lit/directives/repeat.js';
|
||||||
|
|
||||||
|
import type { ChatMessage } from '../../../blocks';
|
||||||
import {
|
import {
|
||||||
ChatAbortIcon,
|
ChatAbortIcon,
|
||||||
ChatClearIcon,
|
ChatClearIcon,
|
||||||
|
|||||||
@@ -8,16 +8,16 @@ import {
|
|||||||
NotificationProvider,
|
NotificationProvider,
|
||||||
TelemetryProvider,
|
TelemetryProvider,
|
||||||
} from '@blocksuite/affine/blocks';
|
} from '@blocksuite/affine/blocks';
|
||||||
import {
|
|
||||||
type AIChatBlockModel,
|
|
||||||
type ChatMessage,
|
|
||||||
ChatMessagesSchema,
|
|
||||||
} from '@toeverything/infra/blocksuite';
|
|
||||||
import { html, LitElement, nothing } from 'lit';
|
import { html, LitElement, nothing } from 'lit';
|
||||||
import { property, query, state } from 'lit/decorators.js';
|
import { property, query, state } from 'lit/decorators.js';
|
||||||
import { classMap } from 'lit/directives/class-map.js';
|
import { classMap } from 'lit/directives/class-map.js';
|
||||||
import { repeat } from 'lit/directives/repeat.js';
|
import { repeat } from 'lit/directives/repeat.js';
|
||||||
|
|
||||||
|
import {
|
||||||
|
type AIChatBlockModel,
|
||||||
|
type ChatMessage,
|
||||||
|
ChatMessagesSchema,
|
||||||
|
} from '../../../blocks';
|
||||||
import {
|
import {
|
||||||
ChatBlockPeekViewActions,
|
ChatBlockPeekViewActions,
|
||||||
constructUserInfoWithMessages,
|
constructUserInfoWithMessages,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import type { AIError } from '@blocksuite/affine/blocks';
|
import type { AIError } from '@blocksuite/affine/blocks';
|
||||||
import type { ChatMessage } from '@toeverything/infra/blocksuite';
|
|
||||||
|
import type { ChatMessage } from '../../../blocks';
|
||||||
|
|
||||||
export type ChatStatus =
|
export type ChatStatus =
|
||||||
| 'success'
|
| 'success'
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import type { EdgelessRootService } from '@blocksuite/affine/blocks';
|
import type { EdgelessRootService } from '@blocksuite/affine/blocks';
|
||||||
import { Bound } from '@blocksuite/affine/global/utils';
|
import { Bound } from '@blocksuite/affine/global/utils';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
type AIChatBlockModel,
|
type AIChatBlockModel,
|
||||||
CHAT_BLOCK_HEIGHT,
|
CHAT_BLOCK_HEIGHT,
|
||||||
CHAT_BLOCK_WIDTH,
|
CHAT_BLOCK_WIDTH,
|
||||||
} from '@toeverything/infra';
|
} from '../../../blocks';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the bounding box for a child block
|
* Calculates the bounding box for a child block
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
import { BlockComponent } from '@blocksuite/affine/block-std';
|
import { BlockComponent } from '@blocksuite/affine/block-std';
|
||||||
import { Peekable } from '@blocksuite/affine/blocks';
|
import { Peekable } from '@blocksuite/affine/blocks';
|
||||||
import { computed } from '@preact/signals-core';
|
import { computed } from '@preact/signals-core';
|
||||||
import {
|
|
||||||
type AIChatBlockModel,
|
|
||||||
ChatMessagesSchema,
|
|
||||||
} from '@toeverything/infra/blocksuite';
|
|
||||||
import { html } from 'lit';
|
import { html } from 'lit';
|
||||||
|
|
||||||
|
import { type AIChatBlockModel, ChatMessagesSchema } from '../../../blocks';
|
||||||
import { ChatWithAIIcon } from '../_common/icon';
|
import { ChatWithAIIcon } from '../_common/icon';
|
||||||
import { AIChatBlockStyles } from './styles';
|
import { AIChatBlockStyles } from './styles';
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import type { EditorHost } from '@blocksuite/block-std';
|
import type { EditorHost } from '@blocksuite/block-std';
|
||||||
import type { AffineAIPanelState } from '@blocksuite/blocks';
|
import type { AffineAIPanelState } from '@blocksuite/blocks';
|
||||||
import type {
|
|
||||||
ChatMessage,
|
|
||||||
MessageRole,
|
|
||||||
MessageUserInfo,
|
|
||||||
} from '@toeverything/infra/blocksuite';
|
|
||||||
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';
|
||||||
import { repeat } from 'lit/directives/repeat.js';
|
import { repeat } from 'lit/directives/repeat.js';
|
||||||
|
|
||||||
|
import type {
|
||||||
|
ChatMessage,
|
||||||
|
MessageRole,
|
||||||
|
MessageUserInfo,
|
||||||
|
} from '../../../../blocks';
|
||||||
import type { TextRendererOptions } from '../../../_common/components/text-renderer';
|
import type { TextRendererOptions } from '../../../_common/components/text-renderer';
|
||||||
import { UserInfoTemplate } from './user-info';
|
import { UserInfoTemplate } from './user-info';
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import type { MessageRole, MessageUserInfo } from '@toeverything/infra';
|
|
||||||
import { baseTheme } from '@toeverything/theme';
|
import { baseTheme } from '@toeverything/theme';
|
||||||
import { css, html, LitElement, type TemplateResult, unsafeCSS } from 'lit';
|
import { css, html, LitElement, type TemplateResult, unsafeCSS } from 'lit';
|
||||||
import { property } from 'lit/decorators.js';
|
import { property } from 'lit/decorators.js';
|
||||||
|
|
||||||
|
import type { MessageRole, MessageUserInfo } from '../../../../blocks';
|
||||||
import { AffineAIIcon } from '../../_common/icon';
|
import { AffineAIIcon } from '../../_common/icon';
|
||||||
|
|
||||||
export class UserInfo extends LitElement {
|
export class UserInfo extends LitElement {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
toReactNode,
|
toReactNode,
|
||||||
type useConfirmModal,
|
type useConfirmModal,
|
||||||
} from '@affine/component';
|
} from '@affine/component';
|
||||||
|
import { AIChatBlockSchema } from '@affine/core/blocksuite/blocks';
|
||||||
import { AttachmentPreviewErrorBoundary } from '@affine/core/components/attachment-viewer/error';
|
import { AttachmentPreviewErrorBoundary } from '@affine/core/components/attachment-viewer/error';
|
||||||
import { PDFViewerEmbedded } from '@affine/core/components/attachment-viewer/pdf-viewer-embedded';
|
import { PDFViewerEmbedded } from '@affine/core/components/attachment-viewer/pdf-viewer-embedded';
|
||||||
import { buildAttachmentProps } from '@affine/core/components/attachment-viewer/utils';
|
import { buildAttachmentProps } from '@affine/core/components/attachment-viewer/utils';
|
||||||
@@ -66,11 +67,7 @@ import {
|
|||||||
import { Bound } from '@blocksuite/affine/global/utils';
|
import { Bound } from '@blocksuite/affine/global/utils';
|
||||||
import { type BlockSnapshot, Text } from '@blocksuite/affine/store';
|
import { type BlockSnapshot, Text } from '@blocksuite/affine/store';
|
||||||
import type { ReferenceParams } from '@blocksuite/affine-model';
|
import type { ReferenceParams } from '@blocksuite/affine-model';
|
||||||
import {
|
import { type DocProps, type FrameworkProvider } from '@toeverything/infra';
|
||||||
AIChatBlockSchema,
|
|
||||||
type DocProps,
|
|
||||||
type FrameworkProvider,
|
|
||||||
} from '@toeverything/infra';
|
|
||||||
import { type TemplateResult } from 'lit';
|
import { type TemplateResult } from 'lit';
|
||||||
import { customElement } from 'lit/decorators.js';
|
import { customElement } from 'lit/decorators.js';
|
||||||
import { literal } from 'lit/static-html.js';
|
import { literal } from 'lit/static-html.js';
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import type {
|
|||||||
} from '@blocksuite/affine/blocks';
|
} from '@blocksuite/affine/blocks';
|
||||||
import { AffineReference } from '@blocksuite/affine/blocks';
|
import { AffineReference } from '@blocksuite/affine/blocks';
|
||||||
import type { Block, BlockModel } from '@blocksuite/affine/store';
|
import type { Block, BlockModel } from '@blocksuite/affine/store';
|
||||||
import type { AIChatBlockModel } from '@toeverything/infra';
|
|
||||||
import { Entity, LiveData } from '@toeverything/infra';
|
import { Entity, LiveData } from '@toeverything/infra';
|
||||||
import type { TemplateResult } from 'lit';
|
import type { TemplateResult } from 'lit';
|
||||||
import { firstValueFrom, map, race } from 'rxjs';
|
import { firstValueFrom, map, race } from 'rxjs';
|
||||||
|
|
||||||
|
import type { AIChatBlockModel } from '../../../blocksuite/blocks';
|
||||||
import { resolveLinkToDoc } from '../../navigation';
|
import { resolveLinkToDoc } from '../../navigation';
|
||||||
import type { WorkbenchService } from '../../workbench';
|
import type { WorkbenchService } from '../../workbench';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { AffineSchemas } from '@blocksuite/affine/blocks/schemas';
|
import { AffineSchemas } from '@blocksuite/affine/blocks/schemas';
|
||||||
import { Schema } from '@blocksuite/affine/store';
|
import { Schema } from '@blocksuite/affine/store';
|
||||||
import { AIChatBlockSchema } from '@toeverything/infra';
|
|
||||||
|
import { AIChatBlockSchema } from '../../blocksuite/blocks';
|
||||||
|
|
||||||
let _schema: Schema | null = null;
|
let _schema: Schema | null = null;
|
||||||
export function getAFFiNEWorkspaceSchema() {
|
export function getAFFiNEWorkspaceSchema() {
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export class BundleCommand extends PackageCommand {
|
|||||||
let configOverride: Configuration | undefined;
|
let configOverride: Configuration | undefined;
|
||||||
const overrideConfigPath = this.workspace
|
const overrideConfigPath = this.workspace
|
||||||
.getPackage(this.package)
|
.getPackage(this.package)
|
||||||
.join('webpack.config.js');
|
.join('webpack.config.ts');
|
||||||
|
|
||||||
if (overrideConfigPath.isFile()) {
|
if (overrideConfigPath.isFile()) {
|
||||||
const override = await import(overrideConfigPath.value);
|
const override = await import(overrideConfigPath.value);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export const PackageToDistribution = new Map<
|
|||||||
>([
|
>([
|
||||||
['@affine/admin', 'admin'],
|
['@affine/admin', 'admin'],
|
||||||
['@affine/web', 'web'],
|
['@affine/web', 'web'],
|
||||||
['@affine/electron', 'desktop'],
|
['@affine/electron-renderer', 'desktop'],
|
||||||
['@affine/mobile', 'mobile'],
|
['@affine/mobile', 'mobile'],
|
||||||
['@affine/ios', 'ios'],
|
['@affine/ios', 'ios'],
|
||||||
['@affine/android', 'android'],
|
['@affine/android', 'android'],
|
||||||
@@ -17,8 +17,9 @@ export const PackageToDistribution = new Map<
|
|||||||
export const AliasToPackage = new Map<string, PackageName>([
|
export const AliasToPackage = new Map<string, PackageName>([
|
||||||
['admin', '@affine/admin'],
|
['admin', '@affine/admin'],
|
||||||
['web', '@affine/web'],
|
['web', '@affine/web'],
|
||||||
['desktop', '@affine/electron'],
|
|
||||||
['electron', '@affine/electron'],
|
['electron', '@affine/electron'],
|
||||||
|
['desktop', '@affine/electron-renderer'],
|
||||||
|
['renderer', '@affine/electron-renderer'],
|
||||||
['mobile', '@affine/mobile'],
|
['mobile', '@affine/mobile'],
|
||||||
['ios', '@affine/ios'],
|
['ios', '@affine/ios'],
|
||||||
['android', '@affine/android'],
|
['android', '@affine/android'],
|
||||||
|
|||||||
@@ -332,7 +332,6 @@ export const PackageList = [
|
|||||||
'packages/common/debug',
|
'packages/common/debug',
|
||||||
'packages/common/env',
|
'packages/common/env',
|
||||||
'packages/frontend/templates',
|
'packages/frontend/templates',
|
||||||
'blocksuite/affine/all',
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -370,14 +369,20 @@ export const PackageList = [
|
|||||||
workspaceDependencies: [
|
workspaceDependencies: [
|
||||||
'tests/kit',
|
'tests/kit',
|
||||||
'tools/utils',
|
'tools/utils',
|
||||||
|
'packages/frontend/native',
|
||||||
|
'packages/common/nbstore',
|
||||||
|
'packages/common/infra',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
location: 'packages/frontend/apps/electron-renderer',
|
||||||
|
name: '@affine/electron-renderer',
|
||||||
|
workspaceDependencies: [
|
||||||
'packages/frontend/component',
|
'packages/frontend/component',
|
||||||
'packages/frontend/core',
|
'packages/frontend/core',
|
||||||
'packages/frontend/electron-api',
|
'packages/frontend/electron-api',
|
||||||
'packages/frontend/i18n',
|
'packages/frontend/i18n',
|
||||||
'packages/frontend/native',
|
'tools/utils',
|
||||||
'packages/common/nbstore',
|
|
||||||
'blocksuite/affine/all',
|
|
||||||
'packages/common/infra',
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -579,6 +584,7 @@ export type PackageName =
|
|||||||
| '@affine/admin'
|
| '@affine/admin'
|
||||||
| '@affine/android'
|
| '@affine/android'
|
||||||
| '@affine/electron'
|
| '@affine/electron'
|
||||||
|
| '@affine/electron-renderer'
|
||||||
| '@affine/ios'
|
| '@affine/ios'
|
||||||
| '@affine/mobile'
|
| '@affine/mobile'
|
||||||
| '@affine/web'
|
| '@affine/web'
|
||||||
|
|||||||
@@ -99,6 +99,9 @@
|
|||||||
{
|
{
|
||||||
"path": "./packages/frontend/apps/web"
|
"path": "./packages/frontend/apps/web"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "./packages/frontend/apps/electron-renderer"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "./packages/frontend/apps/mobile"
|
"path": "./packages/frontend/apps/mobile"
|
||||||
},
|
},
|
||||||
@@ -111,9 +114,6 @@
|
|||||||
{
|
{
|
||||||
"path": "./packages/frontend/apps/electron/tsconfig.test.json"
|
"path": "./packages/frontend/apps/electron/tsconfig.test.json"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "./packages/frontend/apps/electron/renderer/tsconfig.json"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "./packages/frontend/graphql"
|
"path": "./packages/frontend/graphql"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
{ "path": "./packages/frontend/admin" },
|
{ "path": "./packages/frontend/admin" },
|
||||||
{ "path": "./packages/frontend/apps/android" },
|
{ "path": "./packages/frontend/apps/android" },
|
||||||
{ "path": "./packages/frontend/apps/electron" },
|
{ "path": "./packages/frontend/apps/electron" },
|
||||||
|
{ "path": "./packages/frontend/apps/electron-renderer" },
|
||||||
{ "path": "./packages/frontend/apps/ios" },
|
{ "path": "./packages/frontend/apps/ios" },
|
||||||
{ "path": "./packages/frontend/apps/mobile" },
|
{ "path": "./packages/frontend/apps/mobile" },
|
||||||
{ "path": "./packages/frontend/apps/web" },
|
{ "path": "./packages/frontend/apps/web" },
|
||||||
|
|||||||
34
yarn.lock
34
yarn.lock
@@ -456,19 +456,37 @@ __metadata:
|
|||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
|
"@affine/electron-renderer@workspace:packages/frontend/apps/electron-renderer":
|
||||||
|
version: 0.0.0-use.local
|
||||||
|
resolution: "@affine/electron-renderer@workspace:packages/frontend/apps/electron-renderer"
|
||||||
|
dependencies:
|
||||||
|
"@affine-tools/utils": "workspace:*"
|
||||||
|
"@affine/component": "workspace:*"
|
||||||
|
"@affine/core": "workspace:*"
|
||||||
|
"@affine/electron-api": "workspace:*"
|
||||||
|
"@affine/i18n": "workspace:*"
|
||||||
|
"@emotion/react": "npm:^11.14.0"
|
||||||
|
"@sentry/react": "npm:^8.44.0"
|
||||||
|
"@types/react": "npm:^19.0.1"
|
||||||
|
"@types/react-dom": "npm:^19.0.2"
|
||||||
|
"@vanilla-extract/css": "npm:^1.16.1"
|
||||||
|
cross-env: "npm:^7.0.3"
|
||||||
|
next-themes: "npm:^0.4.4"
|
||||||
|
react: "npm:^19.0.0"
|
||||||
|
react-dom: "npm:^19.0.0"
|
||||||
|
react-router-dom: "npm:^6.28.0"
|
||||||
|
typescript: "npm:^5.7.2"
|
||||||
|
languageName: unknown
|
||||||
|
linkType: soft
|
||||||
|
|
||||||
"@affine/electron@workspace:packages/frontend/apps/electron":
|
"@affine/electron@workspace:packages/frontend/apps/electron":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@affine/electron@workspace:packages/frontend/apps/electron"
|
resolution: "@affine/electron@workspace:packages/frontend/apps/electron"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@affine-test/kit": "workspace:*"
|
"@affine-test/kit": "workspace:*"
|
||||||
"@affine-tools/utils": "workspace:*"
|
"@affine-tools/utils": "workspace:*"
|
||||||
"@affine/component": "workspace:*"
|
|
||||||
"@affine/core": "workspace:*"
|
|
||||||
"@affine/electron-api": "workspace:*"
|
|
||||||
"@affine/i18n": "workspace:*"
|
|
||||||
"@affine/native": "workspace:*"
|
"@affine/native": "workspace:*"
|
||||||
"@affine/nbstore": "workspace:*"
|
"@affine/nbstore": "workspace:*"
|
||||||
"@blocksuite/affine": "workspace:*"
|
|
||||||
"@electron-forge/cli": "npm:^7.6.0"
|
"@electron-forge/cli": "npm:^7.6.0"
|
||||||
"@electron-forge/core": "npm:^7.6.0"
|
"@electron-forge/core": "npm:^7.6.0"
|
||||||
"@electron-forge/core-utils": "npm:^7.6.0"
|
"@electron-forge/core-utils": "npm:^7.6.0"
|
||||||
@@ -479,7 +497,6 @@ __metadata:
|
|||||||
"@electron-forge/maker-zip": "npm:^7.6.0"
|
"@electron-forge/maker-zip": "npm:^7.6.0"
|
||||||
"@electron-forge/plugin-auto-unpack-natives": "npm:^7.6.0"
|
"@electron-forge/plugin-auto-unpack-natives": "npm:^7.6.0"
|
||||||
"@electron-forge/shared-types": "npm:^7.6.0"
|
"@electron-forge/shared-types": "npm:^7.6.0"
|
||||||
"@emotion/react": "npm:^11.14.0"
|
|
||||||
"@pengx17/electron-forge-maker-appimage": "npm:^1.2.1"
|
"@pengx17/electron-forge-maker-appimage": "npm:^1.2.1"
|
||||||
"@sentry/electron": "npm:^5.8.0"
|
"@sentry/electron": "npm:^5.8.0"
|
||||||
"@sentry/esbuild-plugin": "npm:^2.22.7"
|
"@sentry/esbuild-plugin": "npm:^2.22.7"
|
||||||
@@ -487,7 +504,6 @@ __metadata:
|
|||||||
"@toeverything/infra": "workspace:*"
|
"@toeverything/infra": "workspace:*"
|
||||||
"@types/set-cookie-parser": "npm:^2.4.10"
|
"@types/set-cookie-parser": "npm:^2.4.10"
|
||||||
"@types/uuid": "npm:^10.0.0"
|
"@types/uuid": "npm:^10.0.0"
|
||||||
"@vanilla-extract/css": "npm:^1.16.1"
|
|
||||||
"@vitejs/plugin-react-swc": "npm:^3.7.2"
|
"@vitejs/plugin-react-swc": "npm:^3.7.2"
|
||||||
app-builder-lib: "npm:^25.1.8"
|
app-builder-lib: "npm:^25.1.8"
|
||||||
async-call-rpc: "npm:^6.4.2"
|
async-call-rpc: "npm:^6.4.2"
|
||||||
@@ -507,9 +523,6 @@ __metadata:
|
|||||||
msw: "npm:^2.6.8"
|
msw: "npm:^2.6.8"
|
||||||
nanoid: "npm:^5.0.9"
|
nanoid: "npm:^5.0.9"
|
||||||
next-themes: "npm:^0.4.4"
|
next-themes: "npm:^0.4.4"
|
||||||
react: "npm:^19.0.0"
|
|
||||||
react-dom: "npm:^19.0.0"
|
|
||||||
react-router-dom: "npm:^6.28.0"
|
|
||||||
rxjs: "npm:^7.8.1"
|
rxjs: "npm:^7.8.1"
|
||||||
semver: "npm:^7.6.3"
|
semver: "npm:^7.6.3"
|
||||||
set-cookie-parser: "npm:^2.7.1"
|
set-cookie-parser: "npm:^2.7.1"
|
||||||
@@ -13884,7 +13897,6 @@ __metadata:
|
|||||||
"@affine/debug": "workspace:*"
|
"@affine/debug": "workspace:*"
|
||||||
"@affine/env": "workspace:*"
|
"@affine/env": "workspace:*"
|
||||||
"@affine/templates": "workspace:*"
|
"@affine/templates": "workspace:*"
|
||||||
"@blocksuite/affine": "workspace:*"
|
|
||||||
"@datastructures-js/binary-search-tree": "npm:^5.3.2"
|
"@datastructures-js/binary-search-tree": "npm:^5.3.2"
|
||||||
"@emotion/react": "npm:^11.14.0"
|
"@emotion/react": "npm:^11.14.0"
|
||||||
"@swc/core": "npm:^1.10.1"
|
"@swc/core": "npm:^1.10.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user