mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-02 10:10:42 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5526696357 | |||
| 5be0292536 |
+1
-1
@@ -5,7 +5,7 @@ rustflags = ["-C", "target-feature=+crt-static"]
|
|||||||
[target.'cfg(target_os = "linux")']
|
[target.'cfg(target_os = "linux")']
|
||||||
rustflags = ["-C", "link-args=-Wl,--warn-unresolved-symbols"]
|
rustflags = ["-C", "link-args=-Wl,--warn-unresolved-symbols"]
|
||||||
[target.'cfg(target_os = "macos")']
|
[target.'cfg(target_os = "macos")']
|
||||||
rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup,-no_fixup_chains", "-C", "link-args=-all_load", "-C", "link-args=-weak_framework ScreenCaptureKit"]
|
rustflags = ["-C", "link-args=-all_load", "-C", "link-args=-weak_framework ScreenCaptureKit"]
|
||||||
# https://sourceware.org/bugzilla/show_bug.cgi?id=21032
|
# https://sourceware.org/bugzilla/show_bug.cgi?id=21032
|
||||||
# https://sourceware.org/bugzilla/show_bug.cgi?id=21031
|
# https://sourceware.org/bugzilla/show_bug.cgi?id=21031
|
||||||
# https://github.com/rust-lang/rust/issues/134820
|
# https://github.com/rust-lang/rust/issues/134820
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ services:
|
|||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis
|
||||||
container_name: affine_redis
|
container_name: redis
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
|
test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
|
||||||
interval: 10s
|
interval: 10s
|
||||||
@@ -54,7 +54,7 @@ services:
|
|||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16
|
image: postgres:16
|
||||||
container_name: affine_postgres
|
container_name: postgres
|
||||||
volumes:
|
volumes:
|
||||||
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
|
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -200,6 +200,11 @@
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "Configuration for mailer module",
|
"description": "Configuration for mailer module",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"enabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether enabled mail service.\n@default false",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
"SMTP.host": {
|
"SMTP.host": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Host of the email server (e.g. smtp.gmail.com)\n@default \"\"\n@environment `MAILER_HOST`",
|
"description": "Host of the email server (e.g. smtp.gmail.com)\n@default \"\"\n@environment `MAILER_HOST`",
|
||||||
@@ -507,7 +512,8 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A recognizable name for the server. Will be shown when connected with AFFiNE Desktop.\n@default undefined"
|
"description": "A recognizable name for the server. Will be shown when connected with AFFiNE Desktop.\n@default \"AFFiNE Cloud\"",
|
||||||
|
"default": "AFFiNE Cloud"
|
||||||
},
|
},
|
||||||
"externalUrl": {
|
"externalUrl": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -531,7 +537,7 @@
|
|||||||
},
|
},
|
||||||
"path": {
|
"path": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Subpath where the server get deployed if there is one.(e.g. /affine)\n@default \"\"\n@environment `AFFINE_SERVER_SUB_PATH`",
|
"description": "Subpath where the server get deployed if there is.\n@default \"\"\n@environment `AFFINE_SERVER_SUB_PATH`",
|
||||||
"default": ""
|
"default": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,8 @@ runs:
|
|||||||
- name: Import config
|
- name: Import config
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
printf '{"copilot":{"enabled":true,"providers.fal":{"apiKey":"%s"},"providers.gemini":{"apiKey":"%s"},"providers.openai":{"apiKey":"%s"},"providers.perplexity":{"apiKey":"%s"},"providers.anthropic":{"apiKey":"%s"},"exa":{"key":"%s"}}}' \
|
printf '{"copilot":{"enabled":true,"providers.fal":{"apiKey":"%s"},"providers.gemini":{"apiKey":"%s"},"providers.openai":{"apiKey":"%s"},"providers.perplexity":{"apiKey":"%s"}}}' \
|
||||||
"$COPILOT_FAL_API_KEY" \
|
"$COPILOT_FAL_API_KEY" \
|
||||||
"$COPILOT_GOOGLE_API_KEY" \
|
"$COPILOT_GOOGLE_API_KEY" \
|
||||||
"$COPILOT_OPENAI_API_KEY" \
|
"$COPILOT_OPENAI_API_KEY" \
|
||||||
"$COPILOT_PERPLEXITY_API_KEY" \
|
"$COPILOT_PERPLEXITY_API_KEY" > ./packages/backend/server/config.json
|
||||||
"$COPILOT_ANTHROPIC_API_KEY" \
|
|
||||||
"$COPILOT_EXA_API_KEY" > ./packages/backend/server/config.json
|
|
||||||
|
|||||||
@@ -10,4 +10,4 @@ RUN apt-get update && \
|
|||||||
apt-get install -y --no-install-recommends openssl && \
|
apt-get install -y --no-install-recommends openssl && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
CMD ["node", "./dist/main.js"]
|
CMD ["node", "--import", "./scripts/register.js", "./dist/index.js"]
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
services:
|
||||||
|
affine:
|
||||||
|
image: ghcr.io/toeverything/affine-graphql:stable
|
||||||
|
container_name: affine_selfhosted
|
||||||
|
command:
|
||||||
|
['sh', '-c', 'node ./scripts/self-host-predeploy && node ./dist/index.js']
|
||||||
|
ports:
|
||||||
|
- '3010:3010'
|
||||||
|
- '5555:5555'
|
||||||
|
depends_on:
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
volumes:
|
||||||
|
# custom configurations
|
||||||
|
- ~/.affine/self-host/config:/root/.affine/config
|
||||||
|
# blob storage
|
||||||
|
- ~/.affine/self-host/storage:/root/.affine/storage
|
||||||
|
logging:
|
||||||
|
driver: 'json-file'
|
||||||
|
options:
|
||||||
|
max-size: '1000m'
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
- NODE_OPTIONS="--import=./scripts/register.js"
|
||||||
|
- AFFINE_CONFIG_PATH=/root/.affine/config
|
||||||
|
- REDIS_SERVER_HOST=redis
|
||||||
|
- DATABASE_URL=postgres://affine:affine@postgres:5432/affine
|
||||||
|
- NODE_ENV=production
|
||||||
|
# Telemetry allows us to collect data on how you use the affine. This data will helps us improve the app and provide better features.
|
||||||
|
# Uncomment next line if you wish to quit telemetry.
|
||||||
|
# - TELEMETRY_ENABLE=false
|
||||||
|
redis:
|
||||||
|
image: redis
|
||||||
|
container_name: affine_redis
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ~/.affine/self-host/redis:/data
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
postgres:
|
||||||
|
image: postgres:16
|
||||||
|
container_name: affine_postgres
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ~/.affine/self-host/postgres:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD-SHELL', 'pg_isready -U affine']
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: affine
|
||||||
|
POSTGRES_PASSWORD: affine
|
||||||
|
POSTGRES_DB: affine
|
||||||
|
PGDATA: /var/lib/postgresql/data/pgdata
|
||||||
+5
-23
@@ -21,34 +21,16 @@
|
|||||||
"groupName": "oxlint"
|
"groupName": "oxlint"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"groupName": "all non-major rust dependencies",
|
"groupName": "blocksuite",
|
||||||
"groupSlug": "all-minor-patch",
|
"rangeStrategy": "replace",
|
||||||
"matchUpdateTypes": ["minor", "patch"],
|
"changelogUrl": "https://github.com/toeverything/blocksuite/blob/master/packages/blocks/CHANGELOG.md",
|
||||||
"matchManagers": ["cargo"]
|
"matchPackageNames": ["/^@blocksuite/", "!@blocksuite/icons"]
|
||||||
},
|
|
||||||
{
|
|
||||||
"groupName": "all non-major npm dependencies",
|
|
||||||
"groupSlug": "all-minor-patch",
|
|
||||||
"matchUpdateTypes": ["minor", "patch"],
|
|
||||||
"matchManagers": ["npm"],
|
|
||||||
"matchPackageNames": ["*", "!/^@blocksuite//", "!/oxlint/"]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"groupName": "all non-major dependencies",
|
"groupName": "all non-major dependencies",
|
||||||
"groupSlug": "all-minor-patch",
|
"groupSlug": "all-minor-patch",
|
||||||
"matchUpdateTypes": ["minor", "patch"],
|
"matchUpdateTypes": ["minor", "patch"],
|
||||||
"matchManagers": [
|
"matchPackageNames": ["*", "!/^@blocksuite//", "!/oxlint/"]
|
||||||
"dockerfile",
|
|
||||||
"github-actions",
|
|
||||||
"helmv3",
|
|
||||||
"helm-values",
|
|
||||||
"gradle-wrapper",
|
|
||||||
"gradle",
|
|
||||||
"docker-compose",
|
|
||||||
"devcontainer",
|
|
||||||
"cocoapods",
|
|
||||||
"bundler"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"groupName": "rust toolchain",
|
"groupName": "rust toolchain",
|
||||||
|
|||||||
@@ -13,6 +13,31 @@ permissions:
|
|||||||
packages: 'write'
|
packages: 'write'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build-server:
|
||||||
|
name: Build Server
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup Version
|
||||||
|
id: version
|
||||||
|
uses: ./.github/actions/setup-version
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: ./.github/actions/setup-node
|
||||||
|
with:
|
||||||
|
electron-install: false
|
||||||
|
extra-flags: workspaces focus @affine/server @types/affine__env
|
||||||
|
- name: Build Server
|
||||||
|
run: |
|
||||||
|
find packages/backend/server/src -type d -name "__tests__" -exec rm -rf {} +
|
||||||
|
rm -rf packages/backend/server/src/seed
|
||||||
|
yarn workspace @affine/server build
|
||||||
|
- name: Upload server dist
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: server-dist
|
||||||
|
path: ./packages/backend/server/dist
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
build-web:
|
build-web:
|
||||||
name: Build @affine/web
|
name: Build @affine/web
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -118,7 +143,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
targets:
|
targets:
|
||||||
- name: x86_64-unknown-linux-gnu
|
- name: x86_64-unknown-linux-gnu
|
||||||
file: server-native.x64.node
|
file: server-native.node
|
||||||
- name: aarch64-unknown-linux-gnu
|
- name: aarch64-unknown-linux-gnu
|
||||||
file: server-native.arm64.node
|
file: server-native.arm64.node
|
||||||
- name: armv7-unknown-linux-gnueabihf
|
- name: armv7-unknown-linux-gnueabihf
|
||||||
@@ -139,46 +164,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
target: ${{ matrix.targets.name }}
|
target: ${{ matrix.targets.name }}
|
||||||
package: '@affine/server-native'
|
package: '@affine/server-native'
|
||||||
- name: Rename ${{ matrix.targets.file }}
|
|
||||||
run: |
|
|
||||||
mv ./packages/backend/native/server-native.node ./packages/backend/native/${{ matrix.targets.file }}
|
|
||||||
- name: Upload ${{ matrix.targets.file }}
|
- name: Upload ${{ matrix.targets.file }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: server-native-${{ matrix.targets.file }}
|
name: ${{ matrix.targets.file }}
|
||||||
path: ./packages/backend/native/${{ matrix.targets.file }}
|
path: ./packages/backend/native/server-native.node
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
build-server:
|
|
||||||
name: Build Server
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs:
|
|
||||||
- build-server-native
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Version
|
|
||||||
id: version
|
|
||||||
uses: ./.github/actions/setup-version
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: ./.github/actions/setup-node
|
|
||||||
with:
|
|
||||||
electron-install: false
|
|
||||||
extra-flags: workspaces focus @affine/server @types/affine__env
|
|
||||||
- name: Download server-native
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
pattern: server-native-*
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./packages/backend/native
|
|
||||||
- name: List server-native files
|
|
||||||
run: ls -alh ./packages/backend/native
|
|
||||||
- name: Build Server
|
|
||||||
run: yarn workspace @affine/server build
|
|
||||||
- name: Upload server dist
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: server-dist
|
|
||||||
path: ./packages/backend/server/dist
|
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
build-images:
|
build-images:
|
||||||
@@ -189,6 +179,7 @@ jobs:
|
|||||||
- build-web
|
- build-web
|
||||||
- build-mobile
|
- build-mobile
|
||||||
- build-admin
|
- build-admin
|
||||||
|
- build-server-native
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Download server dist
|
- name: Download server dist
|
||||||
@@ -196,6 +187,25 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: server-dist
|
name: server-dist
|
||||||
path: ./packages/backend/server/dist
|
path: ./packages/backend/server/dist
|
||||||
|
- name: Download server-native.node
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: server-native.node
|
||||||
|
path: ./packages/backend/server
|
||||||
|
- name: Download server-native.node arm64
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: server-native.arm64.node
|
||||||
|
path: ./packages/backend/native
|
||||||
|
- name: Download server-native.node arm64
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: server-native.armv7.node
|
||||||
|
path: .
|
||||||
|
- name: move server-native files
|
||||||
|
run: |
|
||||||
|
mv ./packages/backend/native/server-native.node ./packages/backend/server/server-native.arm64.node
|
||||||
|
mv server-native.node ./packages/backend/server/server-native.armv7.node
|
||||||
- name: Setup env
|
- name: Setup env
|
||||||
run: |
|
run: |
|
||||||
echo "GIT_SHORT_HASH=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
|
echo "GIT_SHORT_HASH=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
|
||||||
|
|||||||
@@ -218,43 +218,7 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: test-results-e2e-bs-${{ matrix.shard }}
|
name: test-results-e2e-legacy-bs-${{ matrix.shard }}
|
||||||
path: ./test-results
|
|
||||||
if-no-files-found: ignore
|
|
||||||
|
|
||||||
e2e-blocksuite-cross-browser-test:
|
|
||||||
name: E2E BlockSuite Cross Browser Test
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: optimize_ci
|
|
||||||
if: needs.optimize_ci.outputs.skip == 'false'
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
shard: [1, 2]
|
|
||||||
browser: ['chromium', 'firefox', 'webkit']
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: ./.github/actions/setup-node
|
|
||||||
with:
|
|
||||||
playwright-install: true
|
|
||||||
playwright-platform: ${{ matrix.browser }}
|
|
||||||
electron-install: false
|
|
||||||
full-cache: true
|
|
||||||
|
|
||||||
- name: Run playground build
|
|
||||||
run: yarn workspace @blocksuite/playground build
|
|
||||||
|
|
||||||
- name: Run playwright tests
|
|
||||||
env:
|
|
||||||
BROWSER: ${{ matrix.browser }}
|
|
||||||
run: yarn workspace @affine-test/blocksuite test "cross-platform/" --forbid-only --shard=${{ matrix.shard }}/${{ strategy.job-total }}
|
|
||||||
|
|
||||||
- name: Upload test results
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: test-results-e2e-bs-cross-browser-${{ matrix.browser }}-${{ matrix.shard }}
|
|
||||||
path: ./test-results
|
path: ./test-results
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
|
|
||||||
@@ -582,7 +546,7 @@ jobs:
|
|||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: server-native.node
|
name: server-native.node
|
||||||
path: ./packages/backend/native
|
path: ./packages/backend/server
|
||||||
|
|
||||||
- name: Prepare Server Test Environment
|
- name: Prepare Server Test Environment
|
||||||
uses: ./.github/actions/server-test-env
|
uses: ./.github/actions/server-test-env
|
||||||
@@ -644,7 +608,7 @@ jobs:
|
|||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: server-native.node
|
name: server-native.node
|
||||||
path: ./packages/backend/native
|
path: ./packages/backend/server
|
||||||
|
|
||||||
- name: Prepare Server Test Environment
|
- name: Prepare Server Test Environment
|
||||||
uses: ./.github/actions/server-test-env
|
uses: ./.github/actions/server-test-env
|
||||||
@@ -661,142 +625,6 @@ jobs:
|
|||||||
name: affine
|
name: affine
|
||||||
fail_ci_if_error: false
|
fail_ci_if_error: false
|
||||||
|
|
||||||
miri:
|
|
||||||
name: miri code check
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs:
|
|
||||||
- optimize_ci
|
|
||||||
if: needs.optimize_ci.outputs.skip == 'false'
|
|
||||||
env:
|
|
||||||
RUST_BACKTRACE: full
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
MIRIFLAGS: -Zmiri-backtrace=full -Zmiri-tree-borrows
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Rust
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
|
||||||
toolchain: nightly
|
|
||||||
components: miri
|
|
||||||
- name: Install latest nextest release
|
|
||||||
uses: taiki-e/install-action@nextest
|
|
||||||
|
|
||||||
- name: Miri Code Check
|
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
|
||||||
cargo +nightly miri nextest run -p y-octo -j4
|
|
||||||
|
|
||||||
loom:
|
|
||||||
name: loom thread test
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs:
|
|
||||||
- optimize_ci
|
|
||||||
if: needs.optimize_ci.outputs.skip == 'false'
|
|
||||||
env:
|
|
||||||
RUSTFLAGS: --cfg loom
|
|
||||||
RUST_BACKTRACE: full
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Rust
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
- name: Install latest nextest release
|
|
||||||
uses: taiki-e/install-action@nextest
|
|
||||||
|
|
||||||
- name: Loom Thread Test
|
|
||||||
run: |
|
|
||||||
cargo nextest run -p y-octo --lib
|
|
||||||
|
|
||||||
fuzzing:
|
|
||||||
name: fuzzing
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs:
|
|
||||||
- optimize_ci
|
|
||||||
if: needs.optimize_ci.outputs.skip == 'false'
|
|
||||||
env:
|
|
||||||
RUSTFLAGS: -D warnings
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Rust
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
|
||||||
toolchain: nightly
|
|
||||||
|
|
||||||
- name: fuzzing
|
|
||||||
working-directory: ./packages/common/y-octo/utils
|
|
||||||
run: |
|
|
||||||
cargo install cargo-fuzz
|
|
||||||
cargo +nightly fuzz run apply_update -- -max_total_time=30
|
|
||||||
cargo +nightly fuzz run codec_doc_any_struct -- -max_total_time=30
|
|
||||||
cargo +nightly fuzz run codec_doc_any -- -max_total_time=30
|
|
||||||
cargo +nightly fuzz run decode_bytes -- -max_total_time=30
|
|
||||||
cargo +nightly fuzz run i32_decode -- -max_total_time=30
|
|
||||||
cargo +nightly fuzz run i32_encode -- -max_total_time=30
|
|
||||||
cargo +nightly fuzz run ins_del_text -- -max_total_time=30
|
|
||||||
cargo +nightly fuzz run sync_message -- -max_total_time=30
|
|
||||||
cargo +nightly fuzz run u64_decode -- -max_total_time=30
|
|
||||||
cargo +nightly fuzz run u64_encode -- -max_total_time=30
|
|
||||||
cargo +nightly fuzz run apply_update -- -max_total_time=30
|
|
||||||
|
|
||||||
- name: upload fuzz artifacts
|
|
||||||
if: ${{ failure() }}
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: fuzz-artifact
|
|
||||||
path: packages/common/y-octo/utils/fuzz/artifacts/**/*
|
|
||||||
|
|
||||||
y-octo-binding-test:
|
|
||||||
name: y-octo binding test on ${{ matrix.settings.target }}
|
|
||||||
runs-on: ${{ matrix.settings.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
settings:
|
|
||||||
- { target: 'x86_64-unknown-linux-gnu', os: 'ubuntu-latest' }
|
|
||||||
- { target: 'aarch64-unknown-linux-gnu', os: 'ubuntu-24.04-arm' }
|
|
||||||
- { target: 'x86_64-apple-darwin', os: 'macos-13' }
|
|
||||||
- { target: 'aarch64-apple-darwin', os: 'macos-latest' }
|
|
||||||
- { target: 'x86_64-pc-windows-msvc', os: 'windows-latest' }
|
|
||||||
- { target: 'aarch64-pc-windows-msvc', os: 'windows-11-arm' }
|
|
||||||
needs:
|
|
||||||
- optimize_ci
|
|
||||||
if: needs.optimize_ci.outputs.skip == 'false'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: ./.github/actions/setup-node
|
|
||||||
with:
|
|
||||||
extra-flags: workspaces focus @affine-tools/cli @affine/monorepo @y-octo/node
|
|
||||||
electron-install: false
|
|
||||||
- name: Install rustup (Windows 11 ARM)
|
|
||||||
if: matrix.settings.os == 'windows-11-arm'
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
Invoke-WebRequest -Uri "https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe" -OutFile rustup-init.exe
|
|
||||||
.\rustup-init.exe --default-toolchain none -y
|
|
||||||
"$env:USERPROFILE\.cargo\bin" | Out-File -Append -Encoding ascii $env:GITHUB_PATH
|
|
||||||
"CARGO_HOME=$env:USERPROFILE\.cargo" | Out-File -Append -Encoding ascii $env:GITHUB_ENV
|
|
||||||
- name: Install Rust (Windows 11 ARM)
|
|
||||||
if: matrix.settings.os == 'windows-11-arm'
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
rustup install stable
|
|
||||||
rustup target add ${{ matrix.settings.target }}
|
|
||||||
cargo --version
|
|
||||||
- name: Build Rust
|
|
||||||
uses: ./.github/actions/build-rust
|
|
||||||
with:
|
|
||||||
target: ${{ matrix.settings.target }}
|
|
||||||
package: '@y-octo/node'
|
|
||||||
- name: Run tests
|
|
||||||
run: yarn affine @y-octo/node test
|
|
||||||
|
|
||||||
rust-test:
|
rust-test:
|
||||||
name: Run native tests
|
name: Run native tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -885,7 +713,7 @@ jobs:
|
|||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: server-native.node
|
name: server-native.node
|
||||||
path: ./packages/backend/native
|
path: ./packages/backend/server
|
||||||
|
|
||||||
- name: Prepare Server Test Environment
|
- name: Prepare Server Test Environment
|
||||||
if: ${{ steps.check-blocksuite-update.outputs.skip != 'true' || steps.apifilter.outputs.changed == 'true' }}
|
if: ${{ steps.check-blocksuite-update.outputs.skip != 'true' || steps.apifilter.outputs.changed == 'true' }}
|
||||||
@@ -894,8 +722,6 @@ jobs:
|
|||||||
COPILOT_GOOGLE_API_KEY: ${{ secrets.COPILOT_GOOGLE_API_KEY }}
|
COPILOT_GOOGLE_API_KEY: ${{ secrets.COPILOT_GOOGLE_API_KEY }}
|
||||||
COPILOT_FAL_API_KEY: ${{ secrets.COPILOT_FAL_API_KEY }}
|
COPILOT_FAL_API_KEY: ${{ secrets.COPILOT_FAL_API_KEY }}
|
||||||
COPILOT_PERPLEXITY_API_KEY: ${{ secrets.COPILOT_PERPLEXITY_API_KEY }}
|
COPILOT_PERPLEXITY_API_KEY: ${{ secrets.COPILOT_PERPLEXITY_API_KEY }}
|
||||||
COPILOT_ANTHROPIC_API_KEY: ${{ secrets.COPILOT_ANTHROPIC_API_KEY }}
|
|
||||||
COPILOT_EXA_API_KEY: ${{ secrets.COPILOT_EXA_API_KEY }}
|
|
||||||
uses: ./.github/actions/server-test-env
|
uses: ./.github/actions/server-test-env
|
||||||
|
|
||||||
- name: Run server tests
|
- name: Run server tests
|
||||||
@@ -984,7 +810,7 @@ jobs:
|
|||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: server-native.node
|
name: server-native.node
|
||||||
path: ./packages/backend/native
|
path: ./packages/backend/server
|
||||||
|
|
||||||
- name: Prepare Server Test Environment
|
- name: Prepare Server Test Environment
|
||||||
if: ${{ steps.check-blocksuite-update.outputs.skip != 'true' || steps.e2efilter.outputs.changed == 'true' }}
|
if: ${{ steps.check-blocksuite-update.outputs.skip != 'true' || steps.e2efilter.outputs.changed == 'true' }}
|
||||||
@@ -993,8 +819,6 @@ jobs:
|
|||||||
COPILOT_GOOGLE_API_KEY: ${{ secrets.COPILOT_GOOGLE_API_KEY }}
|
COPILOT_GOOGLE_API_KEY: ${{ secrets.COPILOT_GOOGLE_API_KEY }}
|
||||||
COPILOT_FAL_API_KEY: ${{ secrets.COPILOT_FAL_API_KEY }}
|
COPILOT_FAL_API_KEY: ${{ secrets.COPILOT_FAL_API_KEY }}
|
||||||
COPILOT_PERPLEXITY_API_KEY: ${{ secrets.COPILOT_PERPLEXITY_API_KEY }}
|
COPILOT_PERPLEXITY_API_KEY: ${{ secrets.COPILOT_PERPLEXITY_API_KEY }}
|
||||||
COPILOT_ANTHROPIC_API_KEY: ${{ secrets.COPILOT_ANTHROPIC_API_KEY }}
|
|
||||||
COPILOT_EXA_API_KEY: ${{ secrets.COPILOT_EXA_API_KEY }}
|
|
||||||
uses: ./.github/actions/server-test-env
|
uses: ./.github/actions/server-test-env
|
||||||
|
|
||||||
- name: Run Copilot E2E Test ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
|
- name: Run Copilot E2E Test ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
|
||||||
@@ -1081,7 +905,7 @@ jobs:
|
|||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: server-native.node
|
name: server-native.node
|
||||||
path: ./packages/backend/native
|
path: ./packages/backend/server
|
||||||
|
|
||||||
- name: Download affine.linux-x64-gnu.node
|
- name: Download affine.linux-x64-gnu.node
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@@ -1317,7 +1141,6 @@ jobs:
|
|||||||
- check-yarn-binary
|
- check-yarn-binary
|
||||||
- e2e-test
|
- e2e-test
|
||||||
- e2e-blocksuite-test
|
- e2e-blocksuite-test
|
||||||
- e2e-blocksuite-cross-browser-test
|
|
||||||
- e2e-mobile-test
|
- e2e-mobile-test
|
||||||
- unit-test
|
- unit-test
|
||||||
- build-native
|
- build-native
|
||||||
@@ -1325,10 +1148,6 @@ jobs:
|
|||||||
- build-server-native
|
- build-server-native
|
||||||
- build-electron-renderer
|
- build-electron-renderer
|
||||||
- native-unit-test
|
- native-unit-test
|
||||||
- miri
|
|
||||||
- loom
|
|
||||||
- fuzzing
|
|
||||||
- y-octo-binding-test
|
|
||||||
- server-test
|
- server-test
|
||||||
- server-e2e-test
|
- server-e2e-test
|
||||||
- rust-test
|
- rust-test
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ jobs:
|
|||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: server-native.node
|
name: server-native.node
|
||||||
path: ./packages/backend/native
|
path: ./packages/backend/server
|
||||||
|
|
||||||
- name: Prepare Server Test Environment
|
- name: Prepare Server Test Environment
|
||||||
env:
|
env:
|
||||||
@@ -81,8 +81,6 @@ jobs:
|
|||||||
COPILOT_FAL_API_KEY: ${{ secrets.COPILOT_FAL_API_KEY }}
|
COPILOT_FAL_API_KEY: ${{ secrets.COPILOT_FAL_API_KEY }}
|
||||||
COPILOT_GOOGLE_API_KEY: ${{ secrets.COPILOT_GOOGLE_API_KEY }}
|
COPILOT_GOOGLE_API_KEY: ${{ secrets.COPILOT_GOOGLE_API_KEY }}
|
||||||
COPILOT_PERPLEXITY_API_KEY: ${{ secrets.COPILOT_PERPLEXITY_API_KEY }}
|
COPILOT_PERPLEXITY_API_KEY: ${{ secrets.COPILOT_PERPLEXITY_API_KEY }}
|
||||||
COPILOT_ANTHROPIC_API_KEY: ${{ secrets.COPILOT_ANTHROPIC_API_KEY }}
|
|
||||||
COPILOT_EXA_API_KEY: ${{ secrets.COPILOT_EXA_API_KEY }}
|
|
||||||
uses: ./.github/actions/server-test-env
|
uses: ./.github/actions/server-test-env
|
||||||
|
|
||||||
- name: Run server tests
|
- name: Run server tests
|
||||||
@@ -144,7 +142,7 @@ jobs:
|
|||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: server-native.node
|
name: server-native.node
|
||||||
path: ./packages/backend/native
|
path: ./packages/backend/server
|
||||||
|
|
||||||
- name: Prepare Server Test Environment
|
- name: Prepare Server Test Environment
|
||||||
env:
|
env:
|
||||||
@@ -152,8 +150,6 @@ jobs:
|
|||||||
COPILOT_FAL_API_KEY: ${{ secrets.COPILOT_FAL_API_KEY }}
|
COPILOT_FAL_API_KEY: ${{ secrets.COPILOT_FAL_API_KEY }}
|
||||||
COPILOT_GOOGLE_API_KEY: ${{ secrets.COPILOT_GOOGLE_API_KEY }}
|
COPILOT_GOOGLE_API_KEY: ${{ secrets.COPILOT_GOOGLE_API_KEY }}
|
||||||
COPILOT_PERPLEXITY_API_KEY: ${{ secrets.COPILOT_PERPLEXITY_API_KEY }}
|
COPILOT_PERPLEXITY_API_KEY: ${{ secrets.COPILOT_PERPLEXITY_API_KEY }}
|
||||||
COPILOT_ANTHROPIC_API_KEY: ${{ secrets.COPILOT_ANTHROPIC_API_KEY }}
|
|
||||||
COPILOT_EXA_API_KEY: ${{ secrets.COPILOT_EXA_API_KEY }}
|
|
||||||
uses: ./.github/actions/server-test-env
|
uses: ./.github/actions/server-test-env
|
||||||
|
|
||||||
- name: Run Copilot E2E Test ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
|
- name: Run Copilot E2E Test ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
|
||||||
|
|||||||
@@ -200,18 +200,11 @@ jobs:
|
|||||||
- build-android-web
|
- build-android-web
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Version
|
|
||||||
id: version
|
|
||||||
uses: ./.github/actions/setup-version
|
|
||||||
- name: Download mobile artifact
|
- name: Download mobile artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: android
|
name: android
|
||||||
path: packages/frontend/apps/android/dist
|
path: packages/frontend/apps/android/dist
|
||||||
- name: Load Google Service file
|
|
||||||
env:
|
|
||||||
DATA: ${{ secrets.FIREBASE_ANDROID_GOOGLE_SERVICE_JSON }}
|
|
||||||
run: echo $DATA | base64 -di > packages/frontend/apps/android/App/app/google-services.json
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: ./.github/actions/setup-node
|
uses: ./.github/actions/setup-node
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
@@ -261,14 +254,13 @@ jobs:
|
|||||||
AFFINE_ANDROID_KEYSTORE_PASSWORD: ${{ secrets.AFFINE_ANDROID_KEYSTORE_PASSWORD }}
|
AFFINE_ANDROID_KEYSTORE_PASSWORD: ${{ secrets.AFFINE_ANDROID_KEYSTORE_PASSWORD }}
|
||||||
AFFINE_ANDROID_KEYSTORE_ALIAS_PASSWORD: ${{ secrets.AFFINE_ANDROID_KEYSTORE_ALIAS_PASSWORD }}
|
AFFINE_ANDROID_KEYSTORE_ALIAS_PASSWORD: ${{ secrets.AFFINE_ANDROID_KEYSTORE_ALIAS_PASSWORD }}
|
||||||
AFFINE_ANDROID_SIGN_KEYSTORE: ${{ secrets.AFFINE_ANDROID_SIGN_KEYSTORE }}
|
AFFINE_ANDROID_SIGN_KEYSTORE: ${{ secrets.AFFINE_ANDROID_SIGN_KEYSTORE }}
|
||||||
VERSION_NAME: ${{ steps.version.outputs.APP_VERSION }}
|
|
||||||
- name: Upload to Google Play
|
- name: Upload to Google Play
|
||||||
uses: r0adkll/upload-google-play@v1
|
uses: r0adkll/upload-google-play@v1
|
||||||
if: ${{ env.BUILD_TARGET == 'distribution' }}
|
if: ${{ env.BUILD_TARGET == 'distribution' }}
|
||||||
with:
|
with:
|
||||||
serviceAccountJson: ${{ steps.auth.outputs.credentials_file_path }}
|
serviceAccountJson: ${{ steps.auth.outputs.credentials_file_path }}
|
||||||
packageName: app.affine.pro
|
packageName: app.affine.pro
|
||||||
releaseName: ${{ steps.version.outputs.APP_VERSION }}
|
|
||||||
releaseFiles: packages/frontend/apps/android/App/app/build/outputs/bundle/${{ env.BUILD_TYPE }}Release/app-${{ env.BUILD_TYPE }}-release-signed.aab
|
releaseFiles: packages/frontend/apps/android/App/app/build/outputs/bundle/${{ env.BUILD_TYPE }}Release/app-${{ env.BUILD_TYPE }}-release-signed.aab
|
||||||
track: internal
|
track: internal
|
||||||
status: draft
|
status: draft
|
||||||
|
|||||||
@@ -85,6 +85,3 @@ packages/frontend/core/public/static/templates
|
|||||||
af
|
af
|
||||||
af.cmd
|
af.cmd
|
||||||
*.resolved
|
*.resolved
|
||||||
|
|
||||||
# playwright
|
|
||||||
storageState.json
|
|
||||||
|
|||||||
Vendored
+4
-1
@@ -29,7 +29,10 @@
|
|||||||
"type": "chrome",
|
"type": "chrome",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "Debug AFFiNE Web",
|
"name": "Debug AFFiNE Web",
|
||||||
"url": "http://localhost:8080"
|
"url": "http://localhost:8080",
|
||||||
|
"sourceMapPathOverrides": {
|
||||||
|
"webpack://affine/blocksuite/*": "${workspaceFolder}/blocksuite/*"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
+169
-169
File diff suppressed because one or more lines are too long
+2
-2
@@ -10,6 +10,6 @@ npmAuthToken: "${NPM_TOKEN:-NONE}"
|
|||||||
|
|
||||||
npmPublishAccess: public
|
npmPublishAccess: public
|
||||||
|
|
||||||
npmRegistryServer: "https://registry.npmjs.org"
|
npmPublishRegistry: "https://registry.npmjs.org"
|
||||||
|
|
||||||
yarnPath: .yarn/releases/yarn-4.9.1.cjs
|
yarnPath: .yarn/releases/yarn-4.9.0.cjs
|
||||||
|
|||||||
Generated
+79
-498
File diff suppressed because it is too large
Load Diff
+3
-30
@@ -2,9 +2,6 @@
|
|||||||
members = [
|
members = [
|
||||||
"./packages/backend/native",
|
"./packages/backend/native",
|
||||||
"./packages/common/native",
|
"./packages/common/native",
|
||||||
"./packages/common/y-octo/core",
|
|
||||||
"./packages/common/y-octo/node",
|
|
||||||
"./packages/common/y-octo/utils",
|
|
||||||
"./packages/frontend/mobile-native",
|
"./packages/frontend/mobile-native",
|
||||||
"./packages/frontend/native",
|
"./packages/frontend/native",
|
||||||
"./packages/frontend/native/nbstore",
|
"./packages/frontend/native/nbstore",
|
||||||
@@ -19,61 +16,39 @@ edition = "2024"
|
|||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
affine_common = { path = "./packages/common/native" }
|
affine_common = { path = "./packages/common/native" }
|
||||||
affine_nbstore = { path = "./packages/frontend/native/nbstore" }
|
affine_nbstore = { path = "./packages/frontend/native/nbstore" }
|
||||||
ahash = "0.8"
|
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
arbitrary = { version = "1.3", features = ["derive"] }
|
|
||||||
assert-json-diff = "2.0"
|
|
||||||
async-lock = { version = "3.4.0", features = ["loom"] }
|
|
||||||
base64-simd = "0.8"
|
base64-simd = "0.8"
|
||||||
bitvec = "1.0"
|
|
||||||
block2 = "0.6"
|
block2 = "0.6"
|
||||||
byteorder = "1.5"
|
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
clap = { version = "4.4", features = ["derive"] }
|
|
||||||
core-foundation = "0.10"
|
core-foundation = "0.10"
|
||||||
coreaudio-rs = "0.12"
|
coreaudio-rs = "0.12"
|
||||||
criterion = { version = "0.5", features = ["html_reports"] }
|
|
||||||
criterion2 = { version = "3", default-features = false }
|
criterion2 = { version = "3", default-features = false }
|
||||||
dispatch2 = "0.3"
|
dispatch2 = "0.2"
|
||||||
docx-parser = { git = "https://github.com/toeverything/docx-parser" }
|
docx-parser = { git = "https://github.com/toeverything/docx-parser" }
|
||||||
dotenvy = "0.15"
|
dotenvy = "0.15"
|
||||||
file-format = { version = "0.26", features = ["reader"] }
|
file-format = { version = "0.26", features = ["reader"] }
|
||||||
homedir = "0.3"
|
homedir = "0.3"
|
||||||
infer = { version = "0.19.0" }
|
infer = { version = "0.19.0" }
|
||||||
lasso = { version = "0.7", features = ["multi-threaded"] }
|
|
||||||
lib0 = { version = "0.16", features = ["lib0-serde"] }
|
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
log = "0.4"
|
|
||||||
loom = { version = "0.7", features = ["checkpoint"] }
|
|
||||||
mimalloc = "0.1"
|
mimalloc = "0.1"
|
||||||
nanoid = "0.4"
|
|
||||||
napi = { version = "3.0.0-alpha.31", features = ["async", "chrono_date", "error_anyhow", "napi9", "serde"] }
|
napi = { version = "3.0.0-alpha.31", features = ["async", "chrono_date", "error_anyhow", "napi9", "serde"] }
|
||||||
napi-build = { version = "2" }
|
napi-build = { version = "2" }
|
||||||
napi-derive = { version = "3.0.0-alpha.28" }
|
napi-derive = { version = "3.0.0-alpha.28" }
|
||||||
nom = "8"
|
|
||||||
notify = { version = "8", features = ["serde"] }
|
notify = { version = "8", features = ["serde"] }
|
||||||
objc2 = "0.6"
|
objc2 = "0.6"
|
||||||
objc2-foundation = "0.3"
|
objc2-foundation = "0.3"
|
||||||
once_cell = "1"
|
once_cell = "1"
|
||||||
ordered-float = "5"
|
|
||||||
parking_lot = "0.12"
|
parking_lot = "0.12"
|
||||||
path-ext = "0.1.1"
|
path-ext = "0.1.1"
|
||||||
pdf-extract = { git = "https://github.com/toeverything/pdf-extract", branch = "darksky/improve-font-decoding" }
|
pdf-extract = { git = "https://github.com/toeverything/pdf-extract" }
|
||||||
phf = { version = "0.11", features = ["macros"] }
|
|
||||||
proptest = "1.3"
|
|
||||||
proptest-derive = "0.5"
|
|
||||||
rand = "0.9"
|
rand = "0.9"
|
||||||
rand_chacha = "0.9"
|
|
||||||
rand_distr = "0.5"
|
|
||||||
rayon = "1.10"
|
rayon = "1.10"
|
||||||
readability = { version = "0.3.0", default-features = false }
|
readability = { version = "0.3.0", default-features = false }
|
||||||
regex = "1.10"
|
|
||||||
rubato = "0.16"
|
rubato = "0.16"
|
||||||
screencapturekit = "0.3"
|
screencapturekit = "0.3"
|
||||||
serde = "1"
|
serde = "1"
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
sha3 = "0.10"
|
sha3 = "0.10"
|
||||||
smol_str = "0.3"
|
|
||||||
sqlx = { version = "0.8", default-features = false, features = ["chrono", "macros", "migrate", "runtime-tokio", "sqlite", "tls-rustls"] }
|
sqlx = { version = "0.8", default-features = false, features = ["chrono", "macros", "migrate", "runtime-tokio", "sqlite", "tls-rustls"] }
|
||||||
strum_macros = "0.27.0"
|
strum_macros = "0.27.0"
|
||||||
symphonia = { version = "0.5", features = ["all", "opt-simd"] }
|
symphonia = { version = "0.5", features = ["all", "opt-simd"] }
|
||||||
@@ -97,9 +72,7 @@ uniffi = "0.29"
|
|||||||
url = { version = "2.5" }
|
url = { version = "2.5" }
|
||||||
uuid = "1.8"
|
uuid = "1.8"
|
||||||
v_htmlescape = "0.15"
|
v_htmlescape = "0.15"
|
||||||
y-octo = { path = "./packages/common/y-octo/core" }
|
y-octo = { git = "https://github.com/y-crdt/y-octo.git", branch = "main" }
|
||||||
y-sync = { version = "0.4" }
|
|
||||||
yrs = "0.23.0"
|
|
||||||
|
|
||||||
[profile.dev.package.sqlx-macros]
|
[profile.dev.package.sqlx-macros]
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
|||||||
@@ -30,18 +30,14 @@
|
|||||||
"@blocksuite/affine-block-surface-ref": "workspace:*",
|
"@blocksuite/affine-block-surface-ref": "workspace:*",
|
||||||
"@blocksuite/affine-block-table": "workspace:*",
|
"@blocksuite/affine-block-table": "workspace:*",
|
||||||
"@blocksuite/affine-components": "workspace:*",
|
"@blocksuite/affine-components": "workspace:*",
|
||||||
"@blocksuite/affine-ext-loader": "workspace:*",
|
|
||||||
"@blocksuite/affine-foundation": "workspace:*",
|
|
||||||
"@blocksuite/affine-fragment-doc-title": "workspace:*",
|
"@blocksuite/affine-fragment-doc-title": "workspace:*",
|
||||||
"@blocksuite/affine-fragment-frame-panel": "workspace:*",
|
"@blocksuite/affine-fragment-frame-panel": "workspace:*",
|
||||||
"@blocksuite/affine-fragment-outline": "workspace:*",
|
"@blocksuite/affine-fragment-outline": "workspace:*",
|
||||||
"@blocksuite/affine-gfx-brush": "workspace:*",
|
"@blocksuite/affine-gfx-brush": "workspace:*",
|
||||||
"@blocksuite/affine-gfx-connector": "workspace:*",
|
"@blocksuite/affine-gfx-connector": "workspace:*",
|
||||||
"@blocksuite/affine-gfx-group": "workspace:*",
|
"@blocksuite/affine-gfx-group": "workspace:*",
|
||||||
"@blocksuite/affine-gfx-link": "workspace:*",
|
|
||||||
"@blocksuite/affine-gfx-mindmap": "workspace:*",
|
"@blocksuite/affine-gfx-mindmap": "workspace:*",
|
||||||
"@blocksuite/affine-gfx-note": "workspace:*",
|
"@blocksuite/affine-gfx-note": "workspace:*",
|
||||||
"@blocksuite/affine-gfx-pointer": "workspace:*",
|
|
||||||
"@blocksuite/affine-gfx-shape": "workspace:*",
|
"@blocksuite/affine-gfx-shape": "workspace:*",
|
||||||
"@blocksuite/affine-gfx-template": "workspace:*",
|
"@blocksuite/affine-gfx-template": "workspace:*",
|
||||||
"@blocksuite/affine-gfx-text": "workspace:*",
|
"@blocksuite/affine-gfx-text": "workspace:*",
|
||||||
@@ -58,16 +54,11 @@
|
|||||||
"@blocksuite/affine-widget-drag-handle": "workspace:*",
|
"@blocksuite/affine-widget-drag-handle": "workspace:*",
|
||||||
"@blocksuite/affine-widget-edgeless-auto-connect": "workspace:*",
|
"@blocksuite/affine-widget-edgeless-auto-connect": "workspace:*",
|
||||||
"@blocksuite/affine-widget-edgeless-toolbar": "workspace:*",
|
"@blocksuite/affine-widget-edgeless-toolbar": "workspace:*",
|
||||||
"@blocksuite/affine-widget-edgeless-zoom-toolbar": "workspace:*",
|
|
||||||
"@blocksuite/affine-widget-frame-title": "workspace:*",
|
"@blocksuite/affine-widget-frame-title": "workspace:*",
|
||||||
"@blocksuite/affine-widget-keyboard-toolbar": "workspace:*",
|
|
||||||
"@blocksuite/affine-widget-linked-doc": "workspace:*",
|
|
||||||
"@blocksuite/affine-widget-page-dragging-area": "workspace:*",
|
|
||||||
"@blocksuite/affine-widget-remote-selection": "workspace:*",
|
"@blocksuite/affine-widget-remote-selection": "workspace:*",
|
||||||
"@blocksuite/affine-widget-scroll-anchoring": "workspace:*",
|
"@blocksuite/affine-widget-scroll-anchoring": "workspace:*",
|
||||||
"@blocksuite/affine-widget-slash-menu": "workspace:*",
|
"@blocksuite/affine-widget-slash-menu": "workspace:*",
|
||||||
"@blocksuite/affine-widget-toolbar": "workspace:*",
|
"@blocksuite/affine-widget-toolbar": "workspace:*",
|
||||||
"@blocksuite/affine-widget-viewport-overlay": "workspace:*",
|
|
||||||
"@blocksuite/data-view": "workspace:*",
|
"@blocksuite/data-view": "workspace:*",
|
||||||
"@blocksuite/global": "workspace:*",
|
"@blocksuite/global": "workspace:*",
|
||||||
"@blocksuite/std": "workspace:*",
|
"@blocksuite/std": "workspace:*",
|
||||||
@@ -78,7 +69,6 @@
|
|||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts",
|
".": "./src/index.ts",
|
||||||
"./effects": "./src/effects.ts",
|
"./effects": "./src/effects.ts",
|
||||||
"./ext-loader": "./src/ext-loader/index.ts",
|
|
||||||
"./std": "./src/std/index.ts",
|
"./std": "./src/std/index.ts",
|
||||||
"./std/gfx": "./src/std/gfx.ts",
|
"./std/gfx": "./src/std/gfx.ts",
|
||||||
"./std/inline": "./src/std/inline.ts",
|
"./std/inline": "./src/std/inline.ts",
|
||||||
@@ -94,139 +84,57 @@
|
|||||||
"./global/lit": "./src/global/lit.ts",
|
"./global/lit": "./src/global/lit.ts",
|
||||||
"./store": "./src/store/index.ts",
|
"./store": "./src/store/index.ts",
|
||||||
"./store/test": "./src/store/test.ts",
|
"./store/test": "./src/store/test.ts",
|
||||||
"./blocks/attachment": "./src/blocks/attachment/index.ts",
|
"./blocks/attachment": "./src/blocks/attachment.ts",
|
||||||
"./blocks/attachment/store": "./src/blocks/attachment/store.ts",
|
"./blocks/bookmark": "./src/blocks/bookmark.ts",
|
||||||
"./blocks/attachment/view": "./src/blocks/attachment/view.ts",
|
"./blocks/callout": "./src/blocks/callout.ts",
|
||||||
"./blocks/bookmark": "./src/blocks/bookmark/index.ts",
|
"./blocks/code": "./src/blocks/code.ts",
|
||||||
"./blocks/bookmark/store": "./src/blocks/bookmark/store.ts",
|
"./blocks/data-view": "./src/blocks/data-view.ts",
|
||||||
"./blocks/bookmark/view": "./src/blocks/bookmark/view.ts",
|
"./blocks/database": "./src/blocks/database.ts",
|
||||||
"./blocks/callout": "./src/blocks/callout/index.ts",
|
"./blocks/divider": "./src/blocks/divider.ts",
|
||||||
"./blocks/callout/store": "./src/blocks/callout/store.ts",
|
"./blocks/edgeless-text": "./src/blocks/edgeless-text.ts",
|
||||||
"./blocks/callout/view": "./src/blocks/callout/view.ts",
|
"./blocks/embed": "./src/blocks/embed.ts",
|
||||||
"./blocks/code": "./src/blocks/code/index.ts",
|
"./blocks/frame": "./src/blocks/frame.ts",
|
||||||
"./blocks/code/store": "./src/blocks/code/store.ts",
|
"./blocks/image": "./src/blocks/image.ts",
|
||||||
"./blocks/code/view": "./src/blocks/code/view.ts",
|
"./blocks/latex": "./src/blocks/latex.ts",
|
||||||
"./blocks/data-view": "./src/blocks/data-view/index.ts",
|
"./blocks/list": "./src/blocks/list.ts",
|
||||||
"./blocks/data-view/store": "./src/blocks/data-view/store.ts",
|
"./blocks/note": "./src/blocks/note.ts",
|
||||||
"./blocks/data-view/view": "./src/blocks/data-view/view.ts",
|
"./blocks/paragraph": "./src/blocks/paragraph.ts",
|
||||||
"./blocks/database": "./src/blocks/database/index.ts",
|
|
||||||
"./blocks/database/store": "./src/blocks/database/store.ts",
|
|
||||||
"./blocks/database/view": "./src/blocks/database/view.ts",
|
|
||||||
"./blocks/divider": "./src/blocks/divider/index.ts",
|
|
||||||
"./blocks/divider/store": "./src/blocks/divider/store.ts",
|
|
||||||
"./blocks/divider/view": "./src/blocks/divider/view.ts",
|
|
||||||
"./blocks/edgeless-text": "./src/blocks/edgeless-text/index.ts",
|
|
||||||
"./blocks/edgeless-text/store": "./src/blocks/edgeless-text/store.ts",
|
|
||||||
"./blocks/edgeless-text/view": "./src/blocks/edgeless-text/view.ts",
|
|
||||||
"./blocks/embed": "./src/blocks/embed/index.ts",
|
|
||||||
"./blocks/embed/store": "./src/blocks/embed/store.ts",
|
|
||||||
"./blocks/embed/view": "./src/blocks/embed/view.ts",
|
|
||||||
"./blocks/frame": "./src/blocks/frame/index.ts",
|
|
||||||
"./blocks/frame/store": "./src/blocks/frame/store.ts",
|
|
||||||
"./blocks/frame/view": "./src/blocks/frame/view.ts",
|
|
||||||
"./blocks/image": "./src/blocks/image/index.ts",
|
|
||||||
"./blocks/image/store": "./src/blocks/image/store.ts",
|
|
||||||
"./blocks/image/view": "./src/blocks/image/view.ts",
|
|
||||||
"./blocks/latex": "./src/blocks/latex/index.ts",
|
|
||||||
"./blocks/latex/store": "./src/blocks/latex/store.ts",
|
|
||||||
"./blocks/latex/view": "./src/blocks/latex/view.ts",
|
|
||||||
"./blocks/list": "./src/blocks/list/index.ts",
|
|
||||||
"./blocks/list/store": "./src/blocks/list/store.ts",
|
|
||||||
"./blocks/list/view": "./src/blocks/list/view.ts",
|
|
||||||
"./blocks/note": "./src/blocks/note/index.ts",
|
|
||||||
"./blocks/note/store": "./src/blocks/note/store.ts",
|
|
||||||
"./blocks/note/view": "./src/blocks/note/view.ts",
|
|
||||||
"./blocks/paragraph": "./src/blocks/paragraph/index.ts",
|
|
||||||
"./blocks/paragraph/store": "./src/blocks/paragraph/store.ts",
|
|
||||||
"./blocks/paragraph/view": "./src/blocks/paragraph/view.ts",
|
|
||||||
"./blocks/root": "./src/blocks/root.ts",
|
"./blocks/root": "./src/blocks/root.ts",
|
||||||
"./blocks/surface": "./src/blocks/surface/index.ts",
|
"./blocks/surface": "./src/blocks/surface.ts",
|
||||||
"./blocks/surface/store": "./src/blocks/surface/store.ts",
|
"./blocks/surface-ref": "./src/blocks/surface-ref.ts",
|
||||||
"./blocks/surface/view": "./src/blocks/surface/view.ts",
|
"./blocks/table": "./src/blocks/table.ts",
|
||||||
"./blocks/surface-ref": "./src/blocks/surface-ref/index.ts",
|
|
||||||
"./blocks/surface-ref/store": "./src/blocks/surface-ref/store.ts",
|
|
||||||
"./blocks/surface-ref/view": "./src/blocks/surface-ref/view.ts",
|
|
||||||
"./blocks/table": "./src/blocks/table/index.ts",
|
|
||||||
"./blocks/table/store": "./src/blocks/table/store.ts",
|
|
||||||
"./blocks/table/view": "./src/blocks/table/view.ts",
|
|
||||||
"./data-view": "./src/data-view/index.ts",
|
"./data-view": "./src/data-view/index.ts",
|
||||||
"./data-view/effects": "./src/data-view/effects.ts",
|
"./data-view/effects": "./src/data-view/effects.ts",
|
||||||
"./inlines/link": "./src/inlines/link/index.ts",
|
"./inlines/link": "./src/inlines/link.ts",
|
||||||
"./inlines/link/store": "./src/inlines/link/store.ts",
|
"./inlines/reference": "./src/inlines/reference.ts",
|
||||||
"./inlines/link/view": "./src/inlines/link/view.ts",
|
"./inlines/preset": "./src/inlines/preset.ts",
|
||||||
"./inlines/reference": "./src/inlines/reference/index.ts",
|
"./inlines/footnote": "./src/inlines/footnote.ts",
|
||||||
"./inlines/reference/store": "./src/inlines/reference/store.ts",
|
"./inlines/latex": "./src/inlines/latex.ts",
|
||||||
"./inlines/reference/view": "./src/inlines/reference/view.ts",
|
"./inlines/mention": "./src/inlines/mention.ts",
|
||||||
"./inlines/preset": "./src/inlines/preset/index.ts",
|
"./widgets/drag-handle": "./src/widgets/drag-handle.ts",
|
||||||
"./inlines/preset/store": "./src/inlines/preset/store.ts",
|
"./widgets/edgeless-auto-connect": "./src/widgets/edgeless-auto-connect.ts",
|
||||||
"./inlines/preset/view": "./src/inlines/preset/view.ts",
|
"./widgets/edgeless-toolbar": "./src/widgets/edgeless-toolbar.ts",
|
||||||
"./inlines/footnote": "./src/inlines/footnote/index.ts",
|
"./widgets/frame-title": "./src/widgets/frame-title.ts",
|
||||||
"./inlines/footnote/view": "./src/inlines/footnote/view.ts",
|
"./widgets/remote-selection": "./src/widgets/remote-selection.ts",
|
||||||
"./inlines/footnote/store": "./src/inlines/footnote/store.ts",
|
"./widgets/scroll-anchoring": "./src/widgets/scroll-anchoring.ts",
|
||||||
"./inlines/latex": "./src/inlines/latex/index.ts",
|
"./widgets/slash-menu": "./src/widgets/slash-menu.ts",
|
||||||
"./inlines/latex/store": "./src/inlines/latex/store.ts",
|
"./widgets/toolbar": "./src/widgets/toolbar.ts",
|
||||||
"./inlines/latex/view": "./src/inlines/latex/view.ts",
|
|
||||||
"./inlines/mention": "./src/inlines/mention/index.ts",
|
|
||||||
"./inlines/mention/view": "./src/inlines/mention/view.ts",
|
|
||||||
"./widgets/drag-handle": "./src/widgets/drag-handle/index.ts",
|
|
||||||
"./widgets/drag-handle/view": "./src/widgets/drag-handle/view.ts",
|
|
||||||
"./widgets/edgeless-auto-connect": "./src/widgets/edgeless-auto-connect/index.ts",
|
|
||||||
"./widgets/edgeless-auto-connect/view": "./src/widgets/edgeless-auto-connect/view.ts",
|
|
||||||
"./widgets/edgeless-toolbar": "./src/widgets/edgeless-toolbar/index.ts",
|
|
||||||
"./widgets/edgeless-toolbar/view": "./src/widgets/edgeless-toolbar/view.ts",
|
|
||||||
"./widgets/frame-title": "./src/widgets/frame-title/index.ts",
|
|
||||||
"./widgets/frame-title/view": "./src/widgets/frame-title/view.ts",
|
|
||||||
"./widgets/linked-doc": "./src/widgets/linked-doc/index.ts",
|
|
||||||
"./widgets/linked-doc/view": "./src/widgets/linked-doc/view.ts",
|
|
||||||
"./widgets/remote-selection": "./src/widgets/remote-selection/index.ts",
|
|
||||||
"./widgets/remote-selection/view": "./src/widgets/remote-selection/view.ts",
|
|
||||||
"./widgets/scroll-anchoring": "./src/widgets/scroll-anchoring/index.ts",
|
|
||||||
"./widgets/scroll-anchoring/view": "./src/widgets/scroll-anchoring/view.ts",
|
|
||||||
"./widgets/slash-menu": "./src/widgets/slash-menu/index.ts",
|
|
||||||
"./widgets/slash-menu/view": "./src/widgets/slash-menu/view.ts",
|
|
||||||
"./widgets/toolbar": "./src/widgets/toolbar/index.ts",
|
|
||||||
"./widgets/toolbar/view": "./src/widgets/toolbar/view.ts",
|
|
||||||
"./widgets/keyboard-toolbar": "./src/widgets/keyboard-toolbar/index.ts",
|
|
||||||
"./widgets/keyboard-toolbar/view": "./src/widgets/keyboard-toolbar/view.ts",
|
|
||||||
"./widgets/viewport-overlay": "./src/widgets/viewport-overlay/index.ts",
|
|
||||||
"./widgets/viewport-overlay/view": "./src/widgets/viewport-overlay/view.ts",
|
|
||||||
"./widgets/page-dragging-area": "./src/widgets/page-dragging-area/index.ts",
|
|
||||||
"./widgets/page-dragging-area/view": "./src/widgets/page-dragging-area/view.ts",
|
|
||||||
"./fragments/doc-title": "./src/fragments/doc-title.ts",
|
"./fragments/doc-title": "./src/fragments/doc-title.ts",
|
||||||
"./fragments/frame-panel": "./src/fragments/frame-panel.ts",
|
"./fragments/frame-panel": "./src/fragments/frame-panel.ts",
|
||||||
"./fragments/outline": "./src/fragments/outline.ts",
|
"./fragments/outline": "./src/fragments/outline.ts",
|
||||||
"./gfx/text": "./src/gfx/text/index.ts",
|
"./gfx/text": "./src/gfx/text.ts",
|
||||||
"./gfx/text/store": "./src/gfx/text/store.ts",
|
"./gfx/brush": "./src/gfx/brush.ts",
|
||||||
"./gfx/text/view": "./src/gfx/text/view.ts",
|
"./gfx/shape": "./src/gfx/shape.ts",
|
||||||
"./gfx/brush": "./src/gfx/brush/index.ts",
|
"./gfx/note": "./src/gfx/note.ts",
|
||||||
"./gfx/brush/store": "./src/gfx/brush/store.ts",
|
"./gfx/mindmap": "./src/gfx/mindmap.ts",
|
||||||
"./gfx/brush/view": "./src/gfx/brush/view.ts",
|
"./gfx/connector": "./src/gfx/connector.ts",
|
||||||
"./gfx/pointer": "./src/gfx/pointer/index.ts",
|
"./gfx/group": "./src/gfx/group.ts",
|
||||||
"./gfx/pointer/view": "./src/gfx/pointer/view.ts",
|
"./gfx/template": "./src/gfx/template.ts",
|
||||||
"./gfx/shape": "./src/gfx/shape/index.ts",
|
|
||||||
"./gfx/shape/store": "./src/gfx/shape/store.ts",
|
|
||||||
"./gfx/shape/view": "./src/gfx/shape/view.ts",
|
|
||||||
"./gfx/link": "./src/gfx/link/index.ts",
|
|
||||||
"./gfx/link/view": "./src/gfx/link/view.ts",
|
|
||||||
"./gfx/note": "./src/gfx/note/index.ts",
|
|
||||||
"./gfx/note/view": "./src/gfx/note/view.ts",
|
|
||||||
"./gfx/mindmap": "./src/gfx/mindmap/index.ts",
|
|
||||||
"./gfx/mindmap/store": "./src/gfx/mindmap/store.ts",
|
|
||||||
"./gfx/mindmap/view": "./src/gfx/mindmap/view.ts",
|
|
||||||
"./gfx/connector": "./src/gfx/connector/index.ts",
|
|
||||||
"./gfx/connector/store": "./src/gfx/connector/store.ts",
|
|
||||||
"./gfx/connector/view": "./src/gfx/connector/view.ts",
|
|
||||||
"./gfx/group": "./src/gfx/group/index.ts",
|
|
||||||
"./gfx/group/store": "./src/gfx/group/store.ts",
|
|
||||||
"./gfx/group/view": "./src/gfx/group/view.ts",
|
|
||||||
"./gfx/template": "./src/gfx/template/index.ts",
|
|
||||||
"./gfx/template/view": "./src/gfx/template/view.ts",
|
|
||||||
"./gfx/turbo-renderer": "./src/gfx/turbo-renderer.ts",
|
"./gfx/turbo-renderer": "./src/gfx/turbo-renderer.ts",
|
||||||
"./components/block-selection": "./src/components/block-selection.ts",
|
"./components/block-selection": "./src/components/block-selection.ts",
|
||||||
"./components/block-zero-width": "./src/components/block-zero-width.ts",
|
"./components/block-zero-width": "./src/components/block-zero-width.ts",
|
||||||
"./components/caption": "./src/components/caption.ts",
|
"./components/caption": "./src/components/caption.ts",
|
||||||
"./components/card-style-dropdown-menu": "./src/components/card-style-dropdown-menu.ts",
|
"./components/card-style-dropdown-menu": "./src/components/card-style-dropdown-menu.ts",
|
||||||
"./components/citation": "./src/components/citation.ts",
|
|
||||||
"./components/color-picker": "./src/components/color-picker.ts",
|
"./components/color-picker": "./src/components/color-picker.ts",
|
||||||
"./components/context-menu": "./src/components/context-menu.ts",
|
"./components/context-menu": "./src/components/context-menu.ts",
|
||||||
"./components/date-picker": "./src/components/date-picker.ts",
|
"./components/date-picker": "./src/components/date-picker.ts",
|
||||||
@@ -263,8 +171,8 @@
|
|||||||
"./schemas": "./src/schemas.ts",
|
"./schemas": "./src/schemas.ts",
|
||||||
"./model": "./src/model/index.ts",
|
"./model": "./src/model/index.ts",
|
||||||
"./sync": "./src/sync/index.ts",
|
"./sync": "./src/sync/index.ts",
|
||||||
"./extensions/store": "./src/extensions/store.ts",
|
"./adapters": "./src/adapters/index.ts",
|
||||||
"./extensions/view": "./src/extensions/view.ts"
|
"./extensions": "./src/extensions/index.ts"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"src",
|
"src",
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ describe('snapshot to html', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const html = template(
|
const html = template(
|
||||||
`<pre><code class="code-python">import this</code></pre>`
|
`<pre class="shiki light-plus" style="background-color:#FFFFFF;color:#000000" tabindex="0"><code><span class="line"><span style="color:#AF00DB">import</span><span style="color:#000000"> this</span></span></code></pre>`
|
||||||
);
|
);
|
||||||
|
|
||||||
const htmlAdapter = new HtmlAdapter(createJob(), provider);
|
const htmlAdapter = new HtmlAdapter(createJob(), provider);
|
||||||
@@ -191,7 +191,7 @@ describe('snapshot to html', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const html = template(
|
const html = template(
|
||||||
`<pre><code class="code-PYTHON">import this</code></pre>`
|
`<pre class="shiki light-plus" style="background-color:#FFFFFF;color:#000000" tabindex="0"><code><span class="line"><span>import this</span></span></code></pre>`
|
||||||
);
|
);
|
||||||
|
|
||||||
const htmlAdapter = new HtmlAdapter(createJob(), provider);
|
const htmlAdapter = new HtmlAdapter(createJob(), provider);
|
||||||
@@ -257,7 +257,7 @@ describe('snapshot to html', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const html = template(
|
const html = template(
|
||||||
`<pre><code class="code-unknown">import this</code></pre>`
|
`<pre class="shiki light-plus" style="background-color:#FFFFFF;color:#000000" tabindex="0"><code><span class="line"><span>import this</span></span></code></pre>`
|
||||||
);
|
);
|
||||||
|
|
||||||
const htmlAdapter = new HtmlAdapter(createJob(), provider);
|
const htmlAdapter = new HtmlAdapter(createJob(), provider);
|
||||||
|
|||||||
@@ -2396,9 +2396,6 @@ World!
|
|||||||
reference: {
|
reference: {
|
||||||
type: 'url',
|
type: 'url',
|
||||||
url: 'https://www.example.com',
|
url: 'https://www.example.com',
|
||||||
favicon: 'https://www.example.com/favicon.ico',
|
|
||||||
title: 'Example Domain',
|
|
||||||
description: 'Example Domain',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -2440,7 +2437,7 @@ World!
|
|||||||
};
|
};
|
||||||
|
|
||||||
const markdown =
|
const markdown =
|
||||||
'aaa[^1][^2][^3]\n\n[^1]: {"type":"url","url":"https%3A%2F%2Fwww.example.com","favicon":"https%3A%2F%2Fwww.example.com%2Ffavicon.ico","title":"Example Domain","description":"Example Domain"}\n\n[^2]: {"type":"doc","docId":"deadbeef"}\n\n[^3]: {"type":"attachment","blobId":"abcdefg","fileName":"test.txt","fileType":"text/plain"}\n';
|
'aaa[^1][^2][^3]\n\n[^1]: {"type":"url","url":"https%3A%2F%2Fwww.example.com"}\n\n[^2]: {"type":"doc","docId":"deadbeef"}\n\n[^3]: {"type":"attachment","blobId":"abcdefg","fileName":"test.txt","fileType":"text/plain"}\n';
|
||||||
|
|
||||||
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
||||||
const target = await mdAdapter.fromBlockSnapshot({
|
const target = await mdAdapter.fromBlockSnapshot({
|
||||||
@@ -2451,262 +2448,203 @@ World!
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('markdown to snapshot', () => {
|
describe('markdown to snapshot', () => {
|
||||||
describe('code', () => {
|
test('code', async () => {
|
||||||
test('markdown code block', async () => {
|
const markdown = '```python\nimport this\n```\n';
|
||||||
const markdown = '```python\nimport this\n```\n';
|
|
||||||
|
|
||||||
const blockSnapshot: BlockSnapshot = {
|
const blockSnapshot: BlockSnapshot = {
|
||||||
type: 'block',
|
type: 'block',
|
||||||
id: 'matchesReplaceMap[0]',
|
id: 'matchesReplaceMap[0]',
|
||||||
flavour: 'affine:note',
|
flavour: 'affine:note',
|
||||||
props: {
|
props: {
|
||||||
xywh: '[0,0,800,95]',
|
xywh: '[0,0,800,95]',
|
||||||
background: DefaultTheme.noteBackgrounColor,
|
background: DefaultTheme.noteBackgrounColor,
|
||||||
index: 'a0',
|
index: 'a0',
|
||||||
hidden: false,
|
hidden: false,
|
||||||
displayMode: NoteDisplayMode.DocAndEdgeless,
|
displayMode: NoteDisplayMode.DocAndEdgeless,
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
type: 'block',
|
||||||
|
id: 'matchesReplaceMap[1]',
|
||||||
|
flavour: 'affine:code',
|
||||||
|
props: {
|
||||||
|
language: 'python',
|
||||||
|
wrap: false,
|
||||||
|
text: {
|
||||||
|
'$blocksuite:internal:text$': true,
|
||||||
|
delta: [
|
||||||
|
{
|
||||||
|
insert: 'import this',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
children: [],
|
||||||
},
|
},
|
||||||
children: [
|
],
|
||||||
{
|
};
|
||||||
type: 'block',
|
|
||||||
id: 'matchesReplaceMap[1]',
|
|
||||||
flavour: 'affine:code',
|
|
||||||
props: {
|
|
||||||
language: 'python',
|
|
||||||
wrap: false,
|
|
||||||
text: {
|
|
||||||
'$blocksuite:internal:text$': true,
|
|
||||||
delta: [
|
|
||||||
{
|
|
||||||
insert: 'import this',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
||||||
const rawBlockSnapshot = await mdAdapter.toBlockSnapshot({
|
const rawBlockSnapshot = await mdAdapter.toBlockSnapshot({
|
||||||
file: markdown,
|
file: markdown,
|
||||||
});
|
|
||||||
expect(nanoidReplacement(rawBlockSnapshot)).toEqual(blockSnapshot);
|
|
||||||
});
|
});
|
||||||
|
expect(nanoidReplacement(rawBlockSnapshot)).toEqual(blockSnapshot);
|
||||||
|
});
|
||||||
|
|
||||||
test('code with indentation 1 - slice', async () => {
|
test('code with indentation 1 - slice', async () => {
|
||||||
const markdown = '```python\n import this\n```';
|
const markdown = '```python\n import this\n```';
|
||||||
|
|
||||||
const sliceSnapshot: SliceSnapshot = {
|
const sliceSnapshot: SliceSnapshot = {
|
||||||
type: 'slice',
|
type: 'slice',
|
||||||
content: [
|
content: [
|
||||||
{
|
{
|
||||||
type: 'block',
|
type: 'block',
|
||||||
id: 'matchesReplaceMap[0]',
|
id: 'matchesReplaceMap[0]',
|
||||||
flavour: 'affine:note',
|
flavour: 'affine:note',
|
||||||
props: {
|
props: {
|
||||||
xywh: '[0,0,800,95]',
|
xywh: '[0,0,800,95]',
|
||||||
background: DefaultTheme.noteBackgrounColor,
|
background: DefaultTheme.noteBackgrounColor,
|
||||||
index: 'a0',
|
index: 'a0',
|
||||||
hidden: false,
|
hidden: false,
|
||||||
displayMode: 'both',
|
displayMode: 'both',
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
type: 'block',
|
type: 'block',
|
||||||
id: 'matchesReplaceMap[1]',
|
id: 'matchesReplaceMap[1]',
|
||||||
flavour: 'affine:code',
|
flavour: 'affine:code',
|
||||||
props: {
|
props: {
|
||||||
language: 'python',
|
language: 'python',
|
||||||
wrap: false,
|
wrap: false,
|
||||||
text: {
|
text: {
|
||||||
'$blocksuite:internal:text$': true,
|
'$blocksuite:internal:text$': true,
|
||||||
delta: [
|
delta: [
|
||||||
{
|
{
|
||||||
insert: ' import this',
|
insert: ' import this',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
|
||||||
},
|
},
|
||||||
children: [],
|
|
||||||
},
|
},
|
||||||
],
|
children: [],
|
||||||
},
|
|
||||||
],
|
|
||||||
workspaceId: '',
|
|
||||||
pageId: '',
|
|
||||||
};
|
|
||||||
|
|
||||||
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
|
||||||
const rawSliceSnapshot = await mdAdapter.toSliceSnapshot({
|
|
||||||
file: markdown,
|
|
||||||
workspaceId: '',
|
|
||||||
pageId: '',
|
|
||||||
});
|
|
||||||
expect(nanoidReplacement(rawSliceSnapshot!)).toEqual(sliceSnapshot);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('code with indentation 2 - slice', async () => {
|
|
||||||
const markdown = '````python\n```python\n import this\n```\n````';
|
|
||||||
|
|
||||||
const sliceSnapshot: SliceSnapshot = {
|
|
||||||
type: 'slice',
|
|
||||||
content: [
|
|
||||||
{
|
|
||||||
type: 'block',
|
|
||||||
id: 'matchesReplaceMap[0]',
|
|
||||||
flavour: 'affine:note',
|
|
||||||
props: {
|
|
||||||
xywh: '[0,0,800,95]',
|
|
||||||
background: DefaultTheme.noteBackgrounColor,
|
|
||||||
index: 'a0',
|
|
||||||
hidden: false,
|
|
||||||
displayMode: 'both',
|
|
||||||
},
|
},
|
||||||
children: [
|
],
|
||||||
{
|
|
||||||
type: 'block',
|
|
||||||
id: 'matchesReplaceMap[1]',
|
|
||||||
flavour: 'affine:code',
|
|
||||||
props: {
|
|
||||||
language: 'python',
|
|
||||||
wrap: false,
|
|
||||||
text: {
|
|
||||||
'$blocksuite:internal:text$': true,
|
|
||||||
delta: [
|
|
||||||
{
|
|
||||||
insert: '```python\n import this\n```',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
workspaceId: '',
|
|
||||||
pageId: '',
|
|
||||||
};
|
|
||||||
|
|
||||||
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
|
||||||
const rawSliceSnapshot = await mdAdapter.toSliceSnapshot({
|
|
||||||
file: markdown,
|
|
||||||
workspaceId: '',
|
|
||||||
pageId: '',
|
|
||||||
});
|
|
||||||
expect(nanoidReplacement(rawSliceSnapshot!)).toEqual(sliceSnapshot);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('code with indentation 3 - slice', async () => {
|
|
||||||
const markdown = '~~~~python\n````python\n import this\n````\n~~~~';
|
|
||||||
|
|
||||||
const sliceSnapshot: SliceSnapshot = {
|
|
||||||
type: 'slice',
|
|
||||||
content: [
|
|
||||||
{
|
|
||||||
type: 'block',
|
|
||||||
id: 'matchesReplaceMap[0]',
|
|
||||||
flavour: 'affine:note',
|
|
||||||
props: {
|
|
||||||
xywh: '[0,0,800,95]',
|
|
||||||
background: DefaultTheme.noteBackgrounColor,
|
|
||||||
index: 'a0',
|
|
||||||
hidden: false,
|
|
||||||
displayMode: 'both',
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
type: 'block',
|
|
||||||
id: 'matchesReplaceMap[1]',
|
|
||||||
flavour: 'affine:code',
|
|
||||||
props: {
|
|
||||||
language: 'python',
|
|
||||||
wrap: false,
|
|
||||||
text: {
|
|
||||||
'$blocksuite:internal:text$': true,
|
|
||||||
delta: [
|
|
||||||
{
|
|
||||||
insert: '````python\n import this\n````',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
workspaceId: '',
|
|
||||||
pageId: '',
|
|
||||||
};
|
|
||||||
|
|
||||||
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
|
||||||
const rawSliceSnapshot = await mdAdapter.toSliceSnapshot({
|
|
||||||
file: markdown,
|
|
||||||
workspaceId: '',
|
|
||||||
pageId: '',
|
|
||||||
});
|
|
||||||
expect(nanoidReplacement(rawSliceSnapshot!)).toEqual(sliceSnapshot);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('html block import as code block', async () => {
|
|
||||||
const markdown = `<div class="container">
|
|
||||||
<header>
|
|
||||||
<h1>Welcome to My Page</h1>
|
|
||||||
<nav>
|
|
||||||
<ul>
|
|
||||||
<li><a href="#home">Home</a></li>
|
|
||||||
<li><a href="#about">About</a></li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</header>
|
|
||||||
<main>
|
|
||||||
<p>This is a sample HTML content</p>
|
|
||||||
</main>
|
|
||||||
</div>`;
|
|
||||||
|
|
||||||
const blockSnapshot: BlockSnapshot = {
|
|
||||||
type: 'block',
|
|
||||||
id: 'matchesReplaceMap[0]',
|
|
||||||
flavour: 'affine:note',
|
|
||||||
props: {
|
|
||||||
xywh: '[0,0,800,95]',
|
|
||||||
background: DefaultTheme.noteBackgrounColor,
|
|
||||||
index: 'a0',
|
|
||||||
hidden: false,
|
|
||||||
displayMode: NoteDisplayMode.DocAndEdgeless,
|
|
||||||
},
|
},
|
||||||
children: [
|
],
|
||||||
{
|
workspaceId: '',
|
||||||
type: 'block',
|
pageId: '',
|
||||||
id: 'matchesReplaceMap[1]',
|
};
|
||||||
flavour: 'affine:code',
|
|
||||||
props: {
|
|
||||||
language: 'html',
|
|
||||||
wrap: false,
|
|
||||||
text: {
|
|
||||||
'$blocksuite:internal:text$': true,
|
|
||||||
delta: [
|
|
||||||
{
|
|
||||||
insert:
|
|
||||||
'<div class="container">\n <header>\n <h1>Welcome to My Page</h1>\n <nav>\n <ul>\n <li><a href="#home">Home</a></li>\n <li><a href="#about">About</a></li>\n </ul>\n </nav>\n </header>\n <main>\n <p>This is a sample HTML content</p>\n </main>\n</div>',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
||||||
const rawBlockSnapshot = await mdAdapter.toBlockSnapshot({
|
const rawSliceSnapshot = await mdAdapter.toSliceSnapshot({
|
||||||
file: markdown,
|
file: markdown,
|
||||||
});
|
workspaceId: '',
|
||||||
expect(nanoidReplacement(rawBlockSnapshot)).toEqual(blockSnapshot);
|
pageId: '',
|
||||||
});
|
});
|
||||||
|
expect(nanoidReplacement(rawSliceSnapshot!)).toEqual(sliceSnapshot);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('code with indentation 2 - slice', async () => {
|
||||||
|
const markdown = '````python\n```python\n import this\n```\n````';
|
||||||
|
|
||||||
|
const sliceSnapshot: SliceSnapshot = {
|
||||||
|
type: 'slice',
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
type: 'block',
|
||||||
|
id: 'matchesReplaceMap[0]',
|
||||||
|
flavour: 'affine:note',
|
||||||
|
props: {
|
||||||
|
xywh: '[0,0,800,95]',
|
||||||
|
background: DefaultTheme.noteBackgrounColor,
|
||||||
|
index: 'a0',
|
||||||
|
hidden: false,
|
||||||
|
displayMode: 'both',
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
type: 'block',
|
||||||
|
id: 'matchesReplaceMap[1]',
|
||||||
|
flavour: 'affine:code',
|
||||||
|
props: {
|
||||||
|
language: 'python',
|
||||||
|
wrap: false,
|
||||||
|
text: {
|
||||||
|
'$blocksuite:internal:text$': true,
|
||||||
|
delta: [
|
||||||
|
{
|
||||||
|
insert: '```python\n import this\n```',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
workspaceId: '',
|
||||||
|
pageId: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
||||||
|
const rawSliceSnapshot = await mdAdapter.toSliceSnapshot({
|
||||||
|
file: markdown,
|
||||||
|
workspaceId: '',
|
||||||
|
pageId: '',
|
||||||
|
});
|
||||||
|
expect(nanoidReplacement(rawSliceSnapshot!)).toEqual(sliceSnapshot);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('code with indentation 3 - slice', async () => {
|
||||||
|
const markdown = '~~~~python\n````python\n import this\n````\n~~~~';
|
||||||
|
|
||||||
|
const sliceSnapshot: SliceSnapshot = {
|
||||||
|
type: 'slice',
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
type: 'block',
|
||||||
|
id: 'matchesReplaceMap[0]',
|
||||||
|
flavour: 'affine:note',
|
||||||
|
props: {
|
||||||
|
xywh: '[0,0,800,95]',
|
||||||
|
background: DefaultTheme.noteBackgrounColor,
|
||||||
|
index: 'a0',
|
||||||
|
hidden: false,
|
||||||
|
displayMode: 'both',
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
type: 'block',
|
||||||
|
id: 'matchesReplaceMap[1]',
|
||||||
|
flavour: 'affine:code',
|
||||||
|
props: {
|
||||||
|
language: 'python',
|
||||||
|
wrap: false,
|
||||||
|
text: {
|
||||||
|
'$blocksuite:internal:text$': true,
|
||||||
|
delta: [
|
||||||
|
{
|
||||||
|
insert: '````python\n import this\n````',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
workspaceId: '',
|
||||||
|
pageId: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
||||||
|
const rawSliceSnapshot = await mdAdapter.toSliceSnapshot({
|
||||||
|
file: markdown,
|
||||||
|
workspaceId: '',
|
||||||
|
pageId: '',
|
||||||
|
});
|
||||||
|
expect(nanoidReplacement(rawSliceSnapshot!)).toEqual(sliceSnapshot);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('paragraph', async () => {
|
test('paragraph', async () => {
|
||||||
@@ -3700,6 +3638,48 @@ bbb
|
|||||||
expect(nanoidReplacement(rawBlockSnapshot)).toEqual(blockSnapshot);
|
expect(nanoidReplacement(rawBlockSnapshot)).toEqual(blockSnapshot);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('html tag', async () => {
|
||||||
|
const markdown = `<aaa>\n`;
|
||||||
|
|
||||||
|
const blockSnapshot: BlockSnapshot = {
|
||||||
|
type: 'block',
|
||||||
|
id: 'matchesReplaceMap[0]',
|
||||||
|
flavour: 'affine:note',
|
||||||
|
props: {
|
||||||
|
xywh: '[0,0,800,95]',
|
||||||
|
background: DefaultTheme.noteBackgrounColor,
|
||||||
|
index: 'a0',
|
||||||
|
hidden: false,
|
||||||
|
displayMode: NoteDisplayMode.DocAndEdgeless,
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
type: 'block',
|
||||||
|
id: 'matchesReplaceMap[1]',
|
||||||
|
flavour: 'affine:paragraph',
|
||||||
|
props: {
|
||||||
|
text: {
|
||||||
|
'$blocksuite:internal:text$': true,
|
||||||
|
delta: [
|
||||||
|
{
|
||||||
|
insert: '<aaa>',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
type: 'text',
|
||||||
|
},
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
||||||
|
const rawBlockSnapshot = await mdAdapter.toBlockSnapshot({
|
||||||
|
file: markdown,
|
||||||
|
});
|
||||||
|
expect(nanoidReplacement(rawBlockSnapshot)).toEqual(blockSnapshot);
|
||||||
|
});
|
||||||
|
|
||||||
describe('inline latex', () => {
|
describe('inline latex', () => {
|
||||||
test.each([
|
test.each([
|
||||||
['dollar sign syntax', 'inline $E=mc^2$ latex\n'],
|
['dollar sign syntax', 'inline $E=mc^2$ latex\n'],
|
||||||
@@ -4031,12 +4011,11 @@ hhh
|
|||||||
expect(nanoidReplacement(rawBlockSnapshot)).toEqual(blockSnapshot);
|
expect(nanoidReplacement(rawBlockSnapshot)).toEqual(blockSnapshot);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('footnote', () => {
|
test('without footnote middleware', async () => {
|
||||||
const url = 'https://www.example.com';
|
const markdown =
|
||||||
const favicon = 'https://www.example.com/favicon.ico';
|
'aaa[^1][^2][^3]\n\n[^1]: {"type":"url","url":"https%3A%2F%2Fwww.example.com"}\n\n[^2]: {"type":"doc","docId":"deadbeef"}\n\n[^3]: {"type":"attachment","blobId":"abcdefg","fileName":"test.txt","fileType":"text/plain"}\n';
|
||||||
const title = 'Example Domain';
|
|
||||||
const description = 'Example Domain';
|
const blockSnapshot: BlockSnapshot = {
|
||||||
const blockSnapshot = {
|
|
||||||
type: 'block',
|
type: 'block',
|
||||||
id: 'matchesReplaceMap[0]',
|
id: 'matchesReplaceMap[0]',
|
||||||
flavour: 'affine:note',
|
flavour: 'affine:note',
|
||||||
@@ -4067,10 +4046,7 @@ hhh
|
|||||||
label: '1',
|
label: '1',
|
||||||
reference: {
|
reference: {
|
||||||
type: 'url',
|
type: 'url',
|
||||||
url,
|
url: 'https://www.example.com',
|
||||||
favicon,
|
|
||||||
title,
|
|
||||||
description,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -4109,77 +4085,10 @@ hhh
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
test('with encoded url and favicon', async () => {
|
|
||||||
const encodedUrl = encodeURIComponent(url);
|
|
||||||
const encodedFavicon = encodeURIComponent(favicon);
|
|
||||||
const markdown = `aaa[^1][^2][^3]\n\n[^1]: {"type":"url","url":"${encodedUrl}","favicon":"${encodedFavicon}","title":"${title}","description":"${description}"}\n\n[^2]: {"type":"doc","docId":"deadbeef"}\n\n[^3]: {"type":"attachment","blobId":"abcdefg","fileName":"test.txt","fileType":"text/plain"}\n`;
|
|
||||||
|
|
||||||
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
|
||||||
const rawBlockSnapshot = await mdAdapter.toBlockSnapshot({
|
|
||||||
file: markdown,
|
|
||||||
});
|
|
||||||
expect(nanoidReplacement(rawBlockSnapshot)).toEqual(blockSnapshot);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('with unencoded url and favicon', async () => {
|
|
||||||
const markdown = `aaa[^1][^2][^3]\n\n[^1]: {"type":"url","url":"${url}","favicon":"${favicon}","title":"${title}","description":"${description}"}\n\n[^2]: {"type":"doc","docId":"deadbeef"}\n\n[^3]: {"type":"attachment","blobId":"abcdefg","fileName":"test.txt","fileType":"text/plain"}\n`;
|
|
||||||
|
|
||||||
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
|
||||||
const rawBlockSnapshot = await mdAdapter.toBlockSnapshot({
|
|
||||||
file: markdown,
|
|
||||||
});
|
|
||||||
expect(nanoidReplacement(rawBlockSnapshot)).toEqual(blockSnapshot);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('should not wrap url with angle brackets if it is not a url', async () => {
|
|
||||||
const markdown = 'prompt: How many people will live in the world in 2040?';
|
|
||||||
const sliceSnapshot: SliceSnapshot = {
|
|
||||||
type: 'slice',
|
|
||||||
content: [
|
|
||||||
{
|
|
||||||
type: 'block',
|
|
||||||
id: 'matchesReplaceMap[0]',
|
|
||||||
flavour: 'affine:note',
|
|
||||||
props: {
|
|
||||||
xywh: '[0,0,800,95]',
|
|
||||||
background: DefaultTheme.noteBackgrounColor,
|
|
||||||
index: 'a0',
|
|
||||||
hidden: false,
|
|
||||||
displayMode: NoteDisplayMode.DocAndEdgeless,
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
type: 'block',
|
|
||||||
id: 'matchesReplaceMap[1]',
|
|
||||||
flavour: 'affine:paragraph',
|
|
||||||
props: {
|
|
||||||
type: 'text',
|
|
||||||
text: {
|
|
||||||
'$blocksuite:internal:text$': true,
|
|
||||||
delta: [
|
|
||||||
{
|
|
||||||
insert:
|
|
||||||
'prompt: How many people will live in the world in 2040?',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
workspaceId: '',
|
|
||||||
pageId: '',
|
|
||||||
};
|
|
||||||
|
|
||||||
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
||||||
const rawSliceSnapshot = await mdAdapter.toSliceSnapshot({
|
const rawBlockSnapshot = await mdAdapter.toBlockSnapshot({
|
||||||
file: markdown,
|
file: markdown,
|
||||||
workspaceId: '',
|
|
||||||
pageId: '',
|
|
||||||
});
|
});
|
||||||
expect(nanoidReplacement(rawSliceSnapshot!)).toEqual(sliceSnapshot);
|
expect(nanoidReplacement(rawBlockSnapshot)).toEqual(blockSnapshot);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { defaultImageProxyMiddleware } from '@blocksuite/affine-shared/adapters';
|
import { defaultImageProxyMiddleware } from '@blocksuite/affine-block-image';
|
||||||
|
import { SpecProvider } from '@blocksuite/affine-shared/utils';
|
||||||
import {
|
import {
|
||||||
Schema,
|
Schema,
|
||||||
Transformer,
|
Transformer,
|
||||||
@@ -7,7 +8,6 @@ import {
|
|||||||
import { TestWorkspace } from '@blocksuite/store/test';
|
import { TestWorkspace } from '@blocksuite/store/test';
|
||||||
|
|
||||||
import { AffineSchemas } from '../../schemas.js';
|
import { AffineSchemas } from '../../schemas.js';
|
||||||
import { testStoreExtensions } from './store.js';
|
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
@@ -27,7 +27,7 @@ export function createJob(middlewares?: TransformerMiddleware[]) {
|
|||||||
testMiddlewares.push(defaultImageProxyMiddleware);
|
testMiddlewares.push(defaultImageProxyMiddleware);
|
||||||
const schema = new Schema().register(AffineSchemas);
|
const schema = new Schema().register(AffineSchemas);
|
||||||
const docCollection = new TestWorkspace();
|
const docCollection = new TestWorkspace();
|
||||||
docCollection.storeExtensions = testStoreExtensions;
|
docCollection.storeExtensions = SpecProvider._.getSpec('store').value;
|
||||||
docCollection.meta.initialize();
|
docCollection.meta.initialize();
|
||||||
return new Transformer({
|
return new Transformer({
|
||||||
schema,
|
schema,
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
|
import { SpecProvider } from '@blocksuite/affine-shared/utils';
|
||||||
import { Container } from '@blocksuite/global/di';
|
import { Container } from '@blocksuite/global/di';
|
||||||
|
|
||||||
import { testStoreExtensions } from './store';
|
import {
|
||||||
|
registerBlockSpecs,
|
||||||
|
registerStoreSpecs,
|
||||||
|
} from '../../extensions/register';
|
||||||
|
|
||||||
|
registerStoreSpecs();
|
||||||
|
registerBlockSpecs();
|
||||||
|
|
||||||
export function getProvider() {
|
export function getProvider() {
|
||||||
const container = new Container();
|
const container = new Container();
|
||||||
const exts = testStoreExtensions;
|
const exts = SpecProvider._.getSpec('store').value;
|
||||||
exts.forEach(ext => {
|
exts.forEach(ext => {
|
||||||
ext.setup(container);
|
ext.setup(container);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
import { StoreExtensionManager } from '@blocksuite/affine-ext-loader';
|
|
||||||
|
|
||||||
import { getInternalStoreExtensions } from '../../extensions/store';
|
|
||||||
|
|
||||||
const manager = new StoreExtensionManager(getInternalStoreExtensions());
|
|
||||||
|
|
||||||
export const testStoreExtensions = manager.get('store');
|
|
||||||
@@ -2,6 +2,7 @@ import {
|
|||||||
HtmlInlineToDeltaAdapterExtensions,
|
HtmlInlineToDeltaAdapterExtensions,
|
||||||
InlineDeltaToHtmlAdapterExtensions,
|
InlineDeltaToHtmlAdapterExtensions,
|
||||||
InlineDeltaToMarkdownAdapterExtensions,
|
InlineDeltaToMarkdownAdapterExtensions,
|
||||||
|
InlineDeltaToPlainTextAdapterExtensions,
|
||||||
MarkdownInlineToDeltaAdapterExtensions,
|
MarkdownInlineToDeltaAdapterExtensions,
|
||||||
NotionHtmlInlineToDeltaAdapterExtensions,
|
NotionHtmlInlineToDeltaAdapterExtensions,
|
||||||
} from '@blocksuite/affine-inline-preset';
|
} from '@blocksuite/affine-inline-preset';
|
||||||
@@ -61,5 +62,8 @@ export function getNotionHtmlAdapterExtensions(): ExtensionType[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getPlainTextAdapterExtensions(): ExtensionType[] {
|
export function getPlainTextAdapterExtensions(): ExtensionType[] {
|
||||||
return [...defaultBlockPlainTextAdapterMatchers];
|
return [
|
||||||
|
...defaultBlockPlainTextAdapterMatchers,
|
||||||
|
...InlineDeltaToPlainTextAdapterExtensions,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { AttachmentBlockMarkdownAdapterExtension } from '@blocksuite/affine-block-attachment';
|
|
||||||
import { BookmarkBlockMarkdownAdapterExtension } from '@blocksuite/affine-block-bookmark';
|
import { BookmarkBlockMarkdownAdapterExtension } from '@blocksuite/affine-block-bookmark';
|
||||||
import { CodeBlockMarkdownAdapterExtension } from '@blocksuite/affine-block-code';
|
import { CodeBlockMarkdownAdapterExtension } from '@blocksuite/affine-block-code';
|
||||||
import { DatabaseBlockMarkdownAdapterExtension } from '@blocksuite/affine-block-database';
|
import { DatabaseBlockMarkdownAdapterExtension } from '@blocksuite/affine-block-database';
|
||||||
@@ -39,5 +38,4 @@ export const defaultBlockMarkdownAdapterMatchers = [
|
|||||||
DividerBlockMarkdownAdapterExtension,
|
DividerBlockMarkdownAdapterExtension,
|
||||||
ImageBlockMarkdownAdapterExtension,
|
ImageBlockMarkdownAdapterExtension,
|
||||||
LatexBlockMarkdownAdapterExtension,
|
LatexBlockMarkdownAdapterExtension,
|
||||||
AttachmentBlockMarkdownAdapterExtension,
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import { BookmarkBlockMarkdownPreprocessorExtension } from '@blocksuite/affine-block-bookmark';
|
|
||||||
import { CodeMarkdownPreprocessorExtension } from '@blocksuite/affine-block-code';
|
import { CodeMarkdownPreprocessorExtension } from '@blocksuite/affine-block-code';
|
||||||
import { LatexMarkdownPreprocessorExtension } from '@blocksuite/affine-block-latex';
|
import { LatexMarkdownPreprocessorExtension } from '@blocksuite/affine-block-latex';
|
||||||
|
|
||||||
export const defaultMarkdownPreprocessors = [
|
export const defaultMarkdownPreprocessors = [
|
||||||
LatexMarkdownPreprocessorExtension,
|
LatexMarkdownPreprocessorExtension,
|
||||||
CodeMarkdownPreprocessorExtension,
|
CodeMarkdownPreprocessorExtension,
|
||||||
BookmarkBlockMarkdownPreprocessorExtension,
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-attachment/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-attachment/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-bookmark/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-bookmark/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-callout/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-callout/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-code/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-code/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-data-view/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-data-view/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-database/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-database/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-divider/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-divider/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-edgeless-text/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-edgeless-text/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-embed/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-embed/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-frame/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-frame/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-image/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-image/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-latex/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-latex/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-list/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-list/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-note/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-note/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-paragraph/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-paragraph/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-surface-ref/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-surface-ref/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-surface/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-surface/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-table/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-block-table/view';
|
|
||||||
@@ -21,7 +21,6 @@ import { BlockSelection } from '@blocksuite/affine-components/block-selection';
|
|||||||
import { BlockZeroWidth } from '@blocksuite/affine-components/block-zero-width';
|
import { BlockZeroWidth } from '@blocksuite/affine-components/block-zero-width';
|
||||||
import { effects as componentCaptionEffects } from '@blocksuite/affine-components/caption';
|
import { effects as componentCaptionEffects } from '@blocksuite/affine-components/caption';
|
||||||
import { effects as componentCardStyleDropdownMenuEffects } from '@blocksuite/affine-components/card-style-dropdown-menu';
|
import { effects as componentCardStyleDropdownMenuEffects } from '@blocksuite/affine-components/card-style-dropdown-menu';
|
||||||
import { effects as componentCitationEffects } from '@blocksuite/affine-components/citation';
|
|
||||||
import { effects as componentColorPickerEffects } from '@blocksuite/affine-components/color-picker';
|
import { effects as componentColorPickerEffects } from '@blocksuite/affine-components/color-picker';
|
||||||
import { effects as componentContextMenuEffects } from '@blocksuite/affine-components/context-menu';
|
import { effects as componentContextMenuEffects } from '@blocksuite/affine-components/context-menu';
|
||||||
import { effects as componentDatePickerEffects } from '@blocksuite/affine-components/date-picker';
|
import { effects as componentDatePickerEffects } from '@blocksuite/affine-components/date-picker';
|
||||||
@@ -64,6 +63,8 @@ import { effects as widgetToolbarEffects } from '@blocksuite/affine-widget-toolb
|
|||||||
import { effects as dataViewEffects } from '@blocksuite/data-view/effects';
|
import { effects as dataViewEffects } from '@blocksuite/data-view/effects';
|
||||||
import { effects as stdEffects } from '@blocksuite/std/effects';
|
import { effects as stdEffects } from '@blocksuite/std/effects';
|
||||||
|
|
||||||
|
import { registerBlockSpecs } from './extensions';
|
||||||
|
|
||||||
export declare const _GLOBAL_:
|
export declare const _GLOBAL_:
|
||||||
| typeof stdEffects
|
| typeof stdEffects
|
||||||
| typeof dataViewEffects
|
| typeof dataViewEffects
|
||||||
@@ -112,6 +113,7 @@ export declare const _GLOBAL_:
|
|||||||
| typeof fragmentOutlineEffects;
|
| typeof fragmentOutlineEffects;
|
||||||
|
|
||||||
export function effects() {
|
export function effects() {
|
||||||
|
registerBlockSpecs();
|
||||||
stdEffects();
|
stdEffects();
|
||||||
|
|
||||||
dataViewEffects();
|
dataViewEffects();
|
||||||
@@ -155,7 +157,6 @@ export function effects() {
|
|||||||
componentEmbedCardModalEffects();
|
componentEmbedCardModalEffects();
|
||||||
componentLinkPreviewEffects();
|
componentLinkPreviewEffects();
|
||||||
componentLinkedDocTitleEffects();
|
componentLinkedDocTitleEffects();
|
||||||
componentCitationEffects();
|
|
||||||
componentCardStyleDropdownMenuEffects();
|
componentCardStyleDropdownMenuEffects();
|
||||||
componentHighlightDropdownMenuEffects();
|
componentHighlightDropdownMenuEffects();
|
||||||
componentViewDropdownMenuEffects();
|
componentViewDropdownMenuEffects();
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-ext-loader';
|
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
import { AttachmentBlockSpec } from '@blocksuite/affine-block-attachment';
|
||||||
|
import { BookmarkBlockSpec } from '@blocksuite/affine-block-bookmark';
|
||||||
|
import { CalloutBlockSpec } from '@blocksuite/affine-block-callout';
|
||||||
|
import { CodeBlockSpec } from '@blocksuite/affine-block-code';
|
||||||
|
import { DataViewBlockSpec } from '@blocksuite/affine-block-data-view';
|
||||||
|
import { DatabaseBlockSpec } from '@blocksuite/affine-block-database';
|
||||||
|
import { DividerBlockSpec } from '@blocksuite/affine-block-divider';
|
||||||
|
import { EdgelessTextBlockSpec } from '@blocksuite/affine-block-edgeless-text';
|
||||||
|
import { EmbedExtensions } from '@blocksuite/affine-block-embed';
|
||||||
|
import { FrameBlockSpec } from '@blocksuite/affine-block-frame';
|
||||||
|
import { ImageBlockSpec } from '@blocksuite/affine-block-image';
|
||||||
|
import { LatexBlockSpec } from '@blocksuite/affine-block-latex';
|
||||||
|
import { ListBlockSpec } from '@blocksuite/affine-block-list';
|
||||||
|
import {
|
||||||
|
EdgelessNoteBlockSpec,
|
||||||
|
NoteBlockSpec,
|
||||||
|
} from '@blocksuite/affine-block-note';
|
||||||
|
import { ParagraphBlockSpec } from '@blocksuite/affine-block-paragraph';
|
||||||
|
import {
|
||||||
|
EdgelessSurfaceBlockAdapterExtensions,
|
||||||
|
EdgelessSurfaceBlockSpec,
|
||||||
|
PageSurfaceBlockSpec,
|
||||||
|
SurfaceBlockAdapterExtensions,
|
||||||
|
} from '@blocksuite/affine-block-surface';
|
||||||
|
import {
|
||||||
|
EdgelessSurfaceRefBlockSpec,
|
||||||
|
PageSurfaceRefBlockSpec,
|
||||||
|
} from '@blocksuite/affine-block-surface-ref';
|
||||||
|
import { TableBlockSpec } from '@blocksuite/affine-block-table';
|
||||||
|
import {
|
||||||
|
brushToMarkdownAdapterMatcher,
|
||||||
|
brushToPlainTextAdapterMatcher,
|
||||||
|
} from '@blocksuite/affine-gfx-brush';
|
||||||
|
import {
|
||||||
|
connectorToMarkdownAdapterMatcher,
|
||||||
|
connectorToPlainTextAdapterMatcher,
|
||||||
|
} from '@blocksuite/affine-gfx-connector';
|
||||||
|
import {
|
||||||
|
groupToMarkdownAdapterMatcher,
|
||||||
|
groupToPlainTextAdapterMatcher,
|
||||||
|
} from '@blocksuite/affine-gfx-group';
|
||||||
|
import {
|
||||||
|
mindmapToMarkdownAdapterMatcher,
|
||||||
|
mindmapToPlainTextAdapterMatcher,
|
||||||
|
} from '@blocksuite/affine-gfx-mindmap';
|
||||||
|
import {
|
||||||
|
shapeToMarkdownAdapterMatcher,
|
||||||
|
shapeToPlainTextAdapterMatcher,
|
||||||
|
} from '@blocksuite/affine-gfx-shape';
|
||||||
|
import {
|
||||||
|
textToMarkdownAdapterMatcher,
|
||||||
|
textToPlainTextAdapterMatcher,
|
||||||
|
} from '@blocksuite/affine-gfx-text';
|
||||||
|
import { inlinePresetExtensions } from '@blocksuite/affine-inline-preset';
|
||||||
|
import {
|
||||||
|
DefaultOpenDocExtension,
|
||||||
|
DocDisplayMetaService,
|
||||||
|
EditPropsStore,
|
||||||
|
FontLoaderService,
|
||||||
|
} from '@blocksuite/affine-shared/services';
|
||||||
|
import type { ExtensionType } from '@blocksuite/store';
|
||||||
|
|
||||||
|
const elementToPlainTextAdapterMatchers = [
|
||||||
|
groupToPlainTextAdapterMatcher,
|
||||||
|
shapeToPlainTextAdapterMatcher,
|
||||||
|
connectorToPlainTextAdapterMatcher,
|
||||||
|
brushToPlainTextAdapterMatcher,
|
||||||
|
textToPlainTextAdapterMatcher,
|
||||||
|
mindmapToPlainTextAdapterMatcher,
|
||||||
|
];
|
||||||
|
|
||||||
|
const elementToMarkdownAdapterMatchers = [
|
||||||
|
groupToMarkdownAdapterMatcher,
|
||||||
|
shapeToMarkdownAdapterMatcher,
|
||||||
|
connectorToMarkdownAdapterMatcher,
|
||||||
|
brushToMarkdownAdapterMatcher,
|
||||||
|
textToMarkdownAdapterMatcher,
|
||||||
|
mindmapToMarkdownAdapterMatcher,
|
||||||
|
];
|
||||||
|
|
||||||
|
export const CommonBlockSpecs: ExtensionType[] = [
|
||||||
|
inlinePresetExtensions,
|
||||||
|
DocDisplayMetaService,
|
||||||
|
EditPropsStore,
|
||||||
|
LatexBlockSpec,
|
||||||
|
ListBlockSpec,
|
||||||
|
DatabaseBlockSpec,
|
||||||
|
TableBlockSpec,
|
||||||
|
DataViewBlockSpec,
|
||||||
|
DividerBlockSpec,
|
||||||
|
BookmarkBlockSpec,
|
||||||
|
EmbedExtensions,
|
||||||
|
AttachmentBlockSpec,
|
||||||
|
CodeBlockSpec,
|
||||||
|
ImageBlockSpec,
|
||||||
|
ParagraphBlockSpec,
|
||||||
|
DefaultOpenDocExtension,
|
||||||
|
FontLoaderService,
|
||||||
|
CalloutBlockSpec,
|
||||||
|
FrameBlockSpec,
|
||||||
|
|
||||||
|
elementToPlainTextAdapterMatchers,
|
||||||
|
elementToMarkdownAdapterMatchers,
|
||||||
|
].flat();
|
||||||
|
|
||||||
|
export const PageFirstPartyBlockSpecs: ExtensionType[] = [
|
||||||
|
CommonBlockSpecs,
|
||||||
|
NoteBlockSpec,
|
||||||
|
PageSurfaceBlockSpec,
|
||||||
|
PageSurfaceRefBlockSpec,
|
||||||
|
|
||||||
|
...SurfaceBlockAdapterExtensions,
|
||||||
|
].flat();
|
||||||
|
|
||||||
|
export const EdgelessFirstPartyBlockSpecs: ExtensionType[] = [
|
||||||
|
CommonBlockSpecs,
|
||||||
|
|
||||||
|
EdgelessNoteBlockSpec,
|
||||||
|
EdgelessSurfaceBlockSpec,
|
||||||
|
EdgelessSurfaceRefBlockSpec,
|
||||||
|
EdgelessTextBlockSpec,
|
||||||
|
|
||||||
|
...EdgelessSurfaceBlockAdapterExtensions,
|
||||||
|
].flat();
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import {
|
||||||
|
EdgelessBuiltInSpecs,
|
||||||
|
PageRootBlockSpec,
|
||||||
|
} from '@blocksuite/affine-block-root';
|
||||||
|
import type { ExtensionType } from '@blocksuite/store';
|
||||||
|
|
||||||
|
import {
|
||||||
|
EdgelessFirstPartyBlockSpecs,
|
||||||
|
PageFirstPartyBlockSpecs,
|
||||||
|
} from './common';
|
||||||
|
|
||||||
|
export const EdgelessEditorBlockSpecs: ExtensionType[] = [
|
||||||
|
EdgelessBuiltInSpecs,
|
||||||
|
EdgelessFirstPartyBlockSpecs,
|
||||||
|
].flat();
|
||||||
|
|
||||||
|
export const PageEditorBlockSpecs: ExtensionType[] = [
|
||||||
|
PageRootBlockSpec,
|
||||||
|
PageFirstPartyBlockSpecs,
|
||||||
|
].flat();
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { effects as blockRootEffects } from '@blocksuite/affine-block-root/effects';
|
|
||||||
import { effects as fragmentDocTitleEffects } from '@blocksuite/affine-fragment-doc-title/effects';
|
|
||||||
import { effects as fragmentFramePanelEffects } from '@blocksuite/affine-fragment-frame-panel/effects';
|
|
||||||
import { effects as fragmentOutlineEffects } from '@blocksuite/affine-fragment-outline/effects';
|
|
||||||
|
|
||||||
export function effects() {
|
|
||||||
blockRootEffects();
|
|
||||||
|
|
||||||
fragmentDocTitleEffects();
|
|
||||||
fragmentFramePanelEffects();
|
|
||||||
fragmentOutlineEffects();
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
export * from './common';
|
||||||
|
export * from './editor-specs';
|
||||||
|
export * from './preview-specs';
|
||||||
|
export * from './register';
|
||||||
|
export * from './store';
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
import {
|
|
||||||
RootBlockHtmlAdapterExtension,
|
|
||||||
RootBlockMarkdownAdapterExtension,
|
|
||||||
RootBlockNotionHtmlAdapterExtension,
|
|
||||||
} from '@blocksuite/affine-block-root';
|
|
||||||
import {
|
|
||||||
type StoreExtensionContext,
|
|
||||||
StoreExtensionProvider,
|
|
||||||
} from '@blocksuite/affine-ext-loader';
|
|
||||||
import { RootBlockSchemaExtension } from '@blocksuite/affine-model';
|
|
||||||
import type { ExtensionType } from '@blocksuite/store';
|
|
||||||
|
|
||||||
const defaultBlockHtmlAdapterMatchers = [RootBlockHtmlAdapterExtension];
|
|
||||||
|
|
||||||
const defaultBlockMarkdownAdapterMatchers = [RootBlockMarkdownAdapterExtension];
|
|
||||||
|
|
||||||
const defaultBlockNotionHtmlAdapterMatchers: ExtensionType[] = [
|
|
||||||
RootBlockNotionHtmlAdapterExtension,
|
|
||||||
];
|
|
||||||
|
|
||||||
function getHtmlAdapterExtensions(): ExtensionType[] {
|
|
||||||
return [...defaultBlockHtmlAdapterMatchers];
|
|
||||||
}
|
|
||||||
|
|
||||||
function getMarkdownAdapterExtensions(): ExtensionType[] {
|
|
||||||
return [...defaultBlockMarkdownAdapterMatchers];
|
|
||||||
}
|
|
||||||
|
|
||||||
function getNotionHtmlAdapterExtensions(): ExtensionType[] {
|
|
||||||
return [...defaultBlockNotionHtmlAdapterMatchers];
|
|
||||||
}
|
|
||||||
|
|
||||||
const MigratingStoreExtensions: ExtensionType[] = [
|
|
||||||
RootBlockSchemaExtension,
|
|
||||||
|
|
||||||
getHtmlAdapterExtensions(),
|
|
||||||
getMarkdownAdapterExtensions(),
|
|
||||||
getNotionHtmlAdapterExtensions(),
|
|
||||||
].flat();
|
|
||||||
|
|
||||||
export class MigratingStoreExtension extends StoreExtensionProvider {
|
|
||||||
override name = 'migrating';
|
|
||||||
|
|
||||||
override setup(context: StoreExtensionContext) {
|
|
||||||
super.setup(context);
|
|
||||||
context.register(MigratingStoreExtensions);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
import {
|
|
||||||
type ViewExtensionContext,
|
|
||||||
ViewExtensionProvider,
|
|
||||||
} from '@blocksuite/affine-ext-loader';
|
|
||||||
|
|
||||||
import { effects } from './effects';
|
|
||||||
import {
|
|
||||||
MigratingEdgelessEditorBlockSpecs,
|
|
||||||
MigratingPageEditorBlockSpecs,
|
|
||||||
MigratingPreviewEdgelessEditorBlockSpecs,
|
|
||||||
MigratingPreviewPageEditorBlockSpecs,
|
|
||||||
} from './migrating';
|
|
||||||
|
|
||||||
export class MigratingViewExtension extends ViewExtensionProvider {
|
|
||||||
override name = 'migrating';
|
|
||||||
|
|
||||||
override effect() {
|
|
||||||
super.effect();
|
|
||||||
effects();
|
|
||||||
}
|
|
||||||
|
|
||||||
override setup(context: ViewExtensionContext) {
|
|
||||||
super.setup(context);
|
|
||||||
const scope = context.scope;
|
|
||||||
if (scope === 'preview-page') {
|
|
||||||
context.register(MigratingPreviewPageEditorBlockSpecs);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (scope === 'preview-edgeless') {
|
|
||||||
context.register(MigratingPreviewEdgelessEditorBlockSpecs);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (scope === 'page' || scope === 'mobile-page') {
|
|
||||||
context.register(MigratingPageEditorBlockSpecs);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (scope === 'edgeless' || scope === 'mobile-edgeless') {
|
|
||||||
context.register(MigratingEdgelessEditorBlockSpecs);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
import {
|
|
||||||
EdgelessBuiltInSpecs,
|
|
||||||
PageRootBlockSpec,
|
|
||||||
PreviewEdgelessRootBlockSpec,
|
|
||||||
PreviewPageRootBlockSpec,
|
|
||||||
ReadOnlyClipboard,
|
|
||||||
} from '@blocksuite/affine-block-root';
|
|
||||||
import type { ExtensionType } from '@blocksuite/store';
|
|
||||||
|
|
||||||
export const MigratingEdgelessEditorBlockSpecs: ExtensionType[] = [
|
|
||||||
EdgelessBuiltInSpecs,
|
|
||||||
].flat();
|
|
||||||
|
|
||||||
export const MigratingPageEditorBlockSpecs: ExtensionType[] = [
|
|
||||||
PageRootBlockSpec,
|
|
||||||
].flat();
|
|
||||||
|
|
||||||
export const MigratingPreviewEdgelessEditorBlockSpecs: ExtensionType[] = [
|
|
||||||
PreviewEdgelessRootBlockSpec,
|
|
||||||
ReadOnlyClipboard,
|
|
||||||
].flat();
|
|
||||||
|
|
||||||
export const MigratingPreviewPageEditorBlockSpecs: ExtensionType[] = [
|
|
||||||
PreviewPageRootBlockSpec,
|
|
||||||
ReadOnlyClipboard,
|
|
||||||
].flat();
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import {
|
||||||
|
PreviewEdgelessRootBlockSpec,
|
||||||
|
PreviewPageRootBlockSpec,
|
||||||
|
ReadOnlyClipboard,
|
||||||
|
} from '@blocksuite/affine-block-root';
|
||||||
|
import type { ExtensionType } from '@blocksuite/store';
|
||||||
|
|
||||||
|
import {
|
||||||
|
EdgelessFirstPartyBlockSpecs,
|
||||||
|
PageFirstPartyBlockSpecs,
|
||||||
|
} from './common.js';
|
||||||
|
|
||||||
|
export const PreviewEdgelessEditorBlockSpecs: ExtensionType[] = [
|
||||||
|
PreviewEdgelessRootBlockSpec,
|
||||||
|
EdgelessFirstPartyBlockSpecs,
|
||||||
|
ReadOnlyClipboard,
|
||||||
|
].flat();
|
||||||
|
|
||||||
|
export const PreviewPageEditorBlockSpecs: ExtensionType[] = [
|
||||||
|
PreviewPageRootBlockSpec,
|
||||||
|
PageFirstPartyBlockSpecs,
|
||||||
|
ReadOnlyClipboard,
|
||||||
|
].flat();
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import { SpecProvider } from '@blocksuite/affine-shared/utils';
|
||||||
|
|
||||||
|
import {
|
||||||
|
EdgelessEditorBlockSpecs,
|
||||||
|
PageEditorBlockSpecs,
|
||||||
|
} from './editor-specs.js';
|
||||||
|
import {
|
||||||
|
PreviewEdgelessEditorBlockSpecs,
|
||||||
|
PreviewPageEditorBlockSpecs,
|
||||||
|
} from './preview-specs.js';
|
||||||
|
import { StoreExtensions } from './store.js';
|
||||||
|
|
||||||
|
export function registerStoreSpecs() {
|
||||||
|
SpecProvider._.addSpec('store', StoreExtensions);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function registerBlockSpecs() {
|
||||||
|
SpecProvider._.addSpec('page', PageEditorBlockSpecs);
|
||||||
|
SpecProvider._.addSpec('edgeless', EdgelessEditorBlockSpecs);
|
||||||
|
SpecProvider._.addSpec('preview:page', PreviewPageEditorBlockSpecs);
|
||||||
|
SpecProvider._.addSpec('preview:edgeless', PreviewEdgelessEditorBlockSpecs);
|
||||||
|
}
|
||||||
@@ -1,72 +1,112 @@
|
|||||||
import { AttachmentStoreExtension } from '@blocksuite/affine-block-attachment/store';
|
import { DataViewBlockSchemaExtension } from '@blocksuite/affine-block-data-view';
|
||||||
import { BookmarkStoreExtension } from '@blocksuite/affine-block-bookmark/store';
|
import { DatabaseSelectionExtension } from '@blocksuite/affine-block-database';
|
||||||
import { CalloutStoreExtension } from '@blocksuite/affine-block-callout/store';
|
import { EmbedIframeConfigExtensions } from '@blocksuite/affine-block-embed';
|
||||||
import { CodeStoreExtension } from '@blocksuite/affine-block-code/store';
|
import { ImageStoreSpec } from '@blocksuite/affine-block-image';
|
||||||
import { DataViewStoreExtension } from '@blocksuite/affine-block-data-view/store';
|
import { SurfaceBlockSchemaExtension } from '@blocksuite/affine-block-surface';
|
||||||
import { DatabaseStoreExtension } from '@blocksuite/affine-block-database/store';
|
import { TableSelectionExtension } from '@blocksuite/affine-block-table';
|
||||||
import { DividerStoreExtension } from '@blocksuite/affine-block-divider/store';
|
import {
|
||||||
import { EdgelessTextStoreExtension } from '@blocksuite/affine-block-edgeless-text/store';
|
AttachmentBlockSchemaExtension,
|
||||||
import { EmbedStoreExtension } from '@blocksuite/affine-block-embed/store';
|
BookmarkBlockSchemaExtension,
|
||||||
import { FrameStoreExtension } from '@blocksuite/affine-block-frame/store';
|
CalloutBlockSchemaExtension,
|
||||||
import { ImageStoreExtension } from '@blocksuite/affine-block-image/store';
|
CodeBlockSchemaExtension,
|
||||||
import { LatexStoreExtension } from '@blocksuite/affine-block-latex/store';
|
DatabaseBlockSchemaExtension,
|
||||||
import { ListStoreExtension } from '@blocksuite/affine-block-list/store';
|
DividerBlockSchemaExtension,
|
||||||
import { NoteStoreExtension } from '@blocksuite/affine-block-note/store';
|
EdgelessTextBlockSchemaExtension,
|
||||||
import { ParagraphStoreExtension } from '@blocksuite/affine-block-paragraph/store';
|
EmbedFigmaBlockSchemaExtension,
|
||||||
import { SurfaceStoreExtension } from '@blocksuite/affine-block-surface/store';
|
EmbedGithubBlockSchemaExtension,
|
||||||
import { SurfaceRefStoreExtension } from '@blocksuite/affine-block-surface-ref/store';
|
EmbedHtmlBlockSchemaExtension,
|
||||||
import { TableStoreExtension } from '@blocksuite/affine-block-table/store';
|
EmbedIframeBlockSchemaExtension,
|
||||||
import { FoundationStoreExtension } from '@blocksuite/affine-foundation/store';
|
EmbedLinkedDocBlockSchemaExtension,
|
||||||
import { BrushStoreExtension } from '@blocksuite/affine-gfx-brush/store';
|
EmbedLoomBlockSchemaExtension,
|
||||||
import { ConnectorStoreExtension } from '@blocksuite/affine-gfx-connector/store';
|
EmbedSyncedDocBlockSchemaExtension,
|
||||||
import { GroupStoreExtension } from '@blocksuite/affine-gfx-group/store';
|
EmbedYoutubeBlockSchemaExtension,
|
||||||
import { MindmapStoreExtension } from '@blocksuite/affine-gfx-mindmap/store';
|
FrameBlockSchemaExtension,
|
||||||
import { ShapeStoreExtension } from '@blocksuite/affine-gfx-shape/store';
|
ImageBlockSchemaExtension,
|
||||||
import { TextStoreExtension } from '@blocksuite/affine-gfx-text/store';
|
LatexBlockSchemaExtension,
|
||||||
import { FootnoteStoreExtension } from '@blocksuite/affine-inline-footnote/store';
|
ListBlockSchemaExtension,
|
||||||
import { LatexStoreExtension as InlineLatexStoreExtension } from '@blocksuite/affine-inline-latex/store';
|
NoteBlockSchemaExtension,
|
||||||
import { LinkStoreExtension } from '@blocksuite/affine-inline-link/store';
|
ParagraphBlockSchemaExtension,
|
||||||
import { InlinePresetStoreExtension } from '@blocksuite/affine-inline-preset/store';
|
RootBlockSchemaExtension,
|
||||||
import { ReferenceStoreExtension } from '@blocksuite/affine-inline-reference/store';
|
SurfaceRefBlockSchemaExtension,
|
||||||
|
TableBlockSchemaExtension,
|
||||||
|
TranscriptionBlockSchemaExtension,
|
||||||
|
} from '@blocksuite/affine-model';
|
||||||
|
import {
|
||||||
|
HighlightSelectionExtension,
|
||||||
|
ImageSelectionExtension,
|
||||||
|
} from '@blocksuite/affine-shared/selection';
|
||||||
|
import {
|
||||||
|
BlockMetaService,
|
||||||
|
EmbedIframeService,
|
||||||
|
FeatureFlagService,
|
||||||
|
FileSizeLimitService,
|
||||||
|
LinkPreviewerService,
|
||||||
|
} from '@blocksuite/affine-shared/services';
|
||||||
|
import {
|
||||||
|
BlockSelectionExtension,
|
||||||
|
CursorSelectionExtension,
|
||||||
|
SurfaceSelectionExtension,
|
||||||
|
TextSelectionExtension,
|
||||||
|
} from '@blocksuite/std';
|
||||||
|
import type { ExtensionType } from '@blocksuite/store';
|
||||||
|
|
||||||
import { MigratingStoreExtension } from './migrating-store';
|
import {
|
||||||
|
getAdapterFactoryExtensions,
|
||||||
|
getHtmlAdapterExtensions,
|
||||||
|
getMarkdownAdapterExtensions,
|
||||||
|
getNotionHtmlAdapterExtensions,
|
||||||
|
getPlainTextAdapterExtensions,
|
||||||
|
} from '../adapters/extension.js';
|
||||||
|
|
||||||
export function getInternalStoreExtensions() {
|
export const StoreExtensions: ExtensionType[] = [
|
||||||
return [
|
CodeBlockSchemaExtension,
|
||||||
FoundationStoreExtension,
|
ParagraphBlockSchemaExtension,
|
||||||
|
RootBlockSchemaExtension,
|
||||||
|
ListBlockSchemaExtension,
|
||||||
|
NoteBlockSchemaExtension,
|
||||||
|
DividerBlockSchemaExtension,
|
||||||
|
ImageBlockSchemaExtension,
|
||||||
|
SurfaceBlockSchemaExtension,
|
||||||
|
BookmarkBlockSchemaExtension,
|
||||||
|
FrameBlockSchemaExtension,
|
||||||
|
DatabaseBlockSchemaExtension,
|
||||||
|
SurfaceRefBlockSchemaExtension,
|
||||||
|
DataViewBlockSchemaExtension,
|
||||||
|
AttachmentBlockSchemaExtension,
|
||||||
|
EmbedSyncedDocBlockSchemaExtension,
|
||||||
|
EmbedLinkedDocBlockSchemaExtension,
|
||||||
|
EmbedHtmlBlockSchemaExtension,
|
||||||
|
EmbedIframeBlockSchemaExtension,
|
||||||
|
EmbedGithubBlockSchemaExtension,
|
||||||
|
EmbedFigmaBlockSchemaExtension,
|
||||||
|
EmbedLoomBlockSchemaExtension,
|
||||||
|
EmbedYoutubeBlockSchemaExtension,
|
||||||
|
EdgelessTextBlockSchemaExtension,
|
||||||
|
LatexBlockSchemaExtension,
|
||||||
|
TableBlockSchemaExtension,
|
||||||
|
CalloutBlockSchemaExtension,
|
||||||
|
TranscriptionBlockSchemaExtension,
|
||||||
|
|
||||||
AttachmentStoreExtension,
|
BlockSelectionExtension,
|
||||||
BookmarkStoreExtension,
|
TextSelectionExtension,
|
||||||
CalloutStoreExtension,
|
SurfaceSelectionExtension,
|
||||||
CodeStoreExtension,
|
CursorSelectionExtension,
|
||||||
DataViewStoreExtension,
|
HighlightSelectionExtension,
|
||||||
DatabaseStoreExtension,
|
ImageSelectionExtension,
|
||||||
DividerStoreExtension,
|
DatabaseSelectionExtension,
|
||||||
EdgelessTextStoreExtension,
|
TableSelectionExtension,
|
||||||
EmbedStoreExtension,
|
|
||||||
FrameStoreExtension,
|
|
||||||
ImageStoreExtension,
|
|
||||||
LatexStoreExtension,
|
|
||||||
ListStoreExtension,
|
|
||||||
NoteStoreExtension,
|
|
||||||
ParagraphStoreExtension,
|
|
||||||
SurfaceRefStoreExtension,
|
|
||||||
TableStoreExtension,
|
|
||||||
SurfaceStoreExtension,
|
|
||||||
|
|
||||||
FootnoteStoreExtension,
|
getHtmlAdapterExtensions(),
|
||||||
LinkStoreExtension,
|
getMarkdownAdapterExtensions(),
|
||||||
ReferenceStoreExtension,
|
getNotionHtmlAdapterExtensions(),
|
||||||
InlineLatexStoreExtension,
|
getPlainTextAdapterExtensions(),
|
||||||
InlinePresetStoreExtension,
|
getAdapterFactoryExtensions(),
|
||||||
|
|
||||||
BrushStoreExtension,
|
FeatureFlagService,
|
||||||
ShapeStoreExtension,
|
LinkPreviewerService,
|
||||||
MindmapStoreExtension,
|
FileSizeLimitService,
|
||||||
ConnectorStoreExtension,
|
ImageStoreSpec,
|
||||||
GroupStoreExtension,
|
BlockMetaService,
|
||||||
TextStoreExtension,
|
EmbedIframeConfigExtensions,
|
||||||
|
EmbedIframeService,
|
||||||
MigratingStoreExtension,
|
].flat();
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,112 +0,0 @@
|
|||||||
import { AttachmentViewExtension } from '@blocksuite/affine-block-attachment/view';
|
|
||||||
import { BookmarkViewExtension } from '@blocksuite/affine-block-bookmark/view';
|
|
||||||
import { CalloutViewExtension } from '@blocksuite/affine-block-callout/view';
|
|
||||||
import { CodeBlockViewExtension } from '@blocksuite/affine-block-code/view';
|
|
||||||
import { DataViewViewExtension } from '@blocksuite/affine-block-data-view/view';
|
|
||||||
import { DatabaseViewExtension } from '@blocksuite/affine-block-database/view';
|
|
||||||
import { DividerViewExtension } from '@blocksuite/affine-block-divider/view';
|
|
||||||
import { EdgelessTextViewExtension } from '@blocksuite/affine-block-edgeless-text/view';
|
|
||||||
import { EmbedViewExtension } from '@blocksuite/affine-block-embed/view';
|
|
||||||
import { FrameViewExtension } from '@blocksuite/affine-block-frame/view';
|
|
||||||
import { ImageViewExtension } from '@blocksuite/affine-block-image/view';
|
|
||||||
import { LatexViewExtension } from '@blocksuite/affine-block-latex/view';
|
|
||||||
import { ListViewExtension } from '@blocksuite/affine-block-list/view';
|
|
||||||
import { NoteViewExtension } from '@blocksuite/affine-block-note/view';
|
|
||||||
import { ParagraphViewExtension } from '@blocksuite/affine-block-paragraph/view';
|
|
||||||
import { SurfaceViewExtension } from '@blocksuite/affine-block-surface/view';
|
|
||||||
import { SurfaceRefViewExtension } from '@blocksuite/affine-block-surface-ref/view';
|
|
||||||
import { TableViewExtension } from '@blocksuite/affine-block-table/view';
|
|
||||||
import { FoundationViewExtension } from '@blocksuite/affine-foundation/view';
|
|
||||||
import { BrushViewExtension } from '@blocksuite/affine-gfx-brush/view';
|
|
||||||
import { ConnectorViewExtension } from '@blocksuite/affine-gfx-connector/view';
|
|
||||||
import { GroupViewExtension } from '@blocksuite/affine-gfx-group/view';
|
|
||||||
import { LinkViewExtension as GfxLinkViewExtension } from '@blocksuite/affine-gfx-link/view';
|
|
||||||
import { MindmapViewExtension } from '@blocksuite/affine-gfx-mindmap/view';
|
|
||||||
import { NoteViewExtension as GfxNoteViewExtension } from '@blocksuite/affine-gfx-note/view';
|
|
||||||
import { PointerViewExtension } from '@blocksuite/affine-gfx-pointer/view';
|
|
||||||
import { ShapeViewExtension } from '@blocksuite/affine-gfx-shape/view';
|
|
||||||
import { TemplateViewExtension } from '@blocksuite/affine-gfx-template/view';
|
|
||||||
import { TextViewExtension } from '@blocksuite/affine-gfx-text/view';
|
|
||||||
import { FootnoteViewExtension } from '@blocksuite/affine-inline-footnote/view';
|
|
||||||
import { LatexViewExtension as InlineLatexViewExtension } from '@blocksuite/affine-inline-latex/view';
|
|
||||||
import { LinkViewExtension } from '@blocksuite/affine-inline-link/view';
|
|
||||||
import { MentionViewExtension } from '@blocksuite/affine-inline-mention/view';
|
|
||||||
import { InlinePresetViewExtension } from '@blocksuite/affine-inline-preset/view';
|
|
||||||
import { ReferenceViewExtension } from '@blocksuite/affine-inline-reference/view';
|
|
||||||
import { DragHandleViewExtension } from '@blocksuite/affine-widget-drag-handle/view';
|
|
||||||
import { EdgelessAutoConnectViewExtension } from '@blocksuite/affine-widget-edgeless-auto-connect/view';
|
|
||||||
import { EdgelessToolbarViewExtension } from '@blocksuite/affine-widget-edgeless-toolbar/view';
|
|
||||||
import { EdgelessZoomToolbarViewExtension } from '@blocksuite/affine-widget-edgeless-zoom-toolbar/view';
|
|
||||||
import { FrameTitleViewExtension } from '@blocksuite/affine-widget-frame-title/view';
|
|
||||||
import { KeyboardToolbarViewExtension } from '@blocksuite/affine-widget-keyboard-toolbar/view';
|
|
||||||
import { LinkedDocViewExtension } from '@blocksuite/affine-widget-linked-doc/view';
|
|
||||||
import { PageDraggingAreaViewExtension } from '@blocksuite/affine-widget-page-dragging-area/view';
|
|
||||||
import { RemoteSelectionViewExtension } from '@blocksuite/affine-widget-remote-selection/view';
|
|
||||||
import { ScrollAnchoringViewExtension } from '@blocksuite/affine-widget-scroll-anchoring/view';
|
|
||||||
import { SlashMenuViewExtension } from '@blocksuite/affine-widget-slash-menu/view';
|
|
||||||
import { ToolbarViewExtension } from '@blocksuite/affine-widget-toolbar/view';
|
|
||||||
import { ViewportOverlayViewExtension } from '@blocksuite/affine-widget-viewport-overlay/view';
|
|
||||||
|
|
||||||
import { MigratingViewExtension } from './migrating-view';
|
|
||||||
|
|
||||||
export function getInternalViewExtensions() {
|
|
||||||
return [
|
|
||||||
FoundationViewExtension,
|
|
||||||
|
|
||||||
// Gfx
|
|
||||||
PointerViewExtension,
|
|
||||||
GfxNoteViewExtension,
|
|
||||||
BrushViewExtension,
|
|
||||||
ShapeViewExtension,
|
|
||||||
MindmapViewExtension,
|
|
||||||
ConnectorViewExtension,
|
|
||||||
GroupViewExtension,
|
|
||||||
TextViewExtension,
|
|
||||||
TemplateViewExtension,
|
|
||||||
GfxLinkViewExtension,
|
|
||||||
|
|
||||||
// Block
|
|
||||||
AttachmentViewExtension,
|
|
||||||
BookmarkViewExtension,
|
|
||||||
CalloutViewExtension,
|
|
||||||
CodeBlockViewExtension,
|
|
||||||
DataViewViewExtension,
|
|
||||||
DatabaseViewExtension,
|
|
||||||
DividerViewExtension,
|
|
||||||
EdgelessTextViewExtension,
|
|
||||||
EmbedViewExtension,
|
|
||||||
FrameViewExtension,
|
|
||||||
ImageViewExtension,
|
|
||||||
LatexViewExtension,
|
|
||||||
ListViewExtension,
|
|
||||||
NoteViewExtension,
|
|
||||||
ParagraphViewExtension,
|
|
||||||
SurfaceRefViewExtension,
|
|
||||||
TableViewExtension,
|
|
||||||
SurfaceViewExtension,
|
|
||||||
|
|
||||||
// Inline
|
|
||||||
FootnoteViewExtension,
|
|
||||||
LinkViewExtension,
|
|
||||||
ReferenceViewExtension,
|
|
||||||
InlineLatexViewExtension,
|
|
||||||
MentionViewExtension,
|
|
||||||
InlinePresetViewExtension,
|
|
||||||
|
|
||||||
// Widget
|
|
||||||
DragHandleViewExtension,
|
|
||||||
EdgelessAutoConnectViewExtension,
|
|
||||||
EdgelessToolbarViewExtension,
|
|
||||||
MigratingViewExtension,
|
|
||||||
FrameTitleViewExtension,
|
|
||||||
KeyboardToolbarViewExtension,
|
|
||||||
LinkedDocViewExtension,
|
|
||||||
RemoteSelectionViewExtension,
|
|
||||||
ScrollAnchoringViewExtension,
|
|
||||||
SlashMenuViewExtension,
|
|
||||||
ToolbarViewExtension,
|
|
||||||
ViewportOverlayViewExtension,
|
|
||||||
EdgelessZoomToolbarViewExtension,
|
|
||||||
PageDraggingAreaViewExtension,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-gfx-brush/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-gfx-brush/view';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-gfx-connector/store';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from '@blocksuite/affine-gfx-connector/view';
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user