mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-02 10:10:42 +08:00
Compare commits
88 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5526696357 | |||
| 5be0292536 | |||
| 823bf40a57 | |||
| 588659ef67 | |||
| d5aebc1421 | |||
| 25418b402a | |||
| f0fb1447a4 | |||
| 0f39ab4ea4 | |||
| ffad5d0a2e | |||
| a166760041 | |||
| e79e4c9e9b | |||
| a6ddfdd85e | |||
| dba8e00fb6 | |||
| 69d4620753 | |||
| dbf09ea055 | |||
| 2822146a4d | |||
| c36dc9318c | |||
| f85b35227b | |||
| b8e93ed714 | |||
| cc257f4fbe | |||
| 44d2f301de | |||
| d1bd809608 | |||
| a759a1988e | |||
| 3629a725d2 | |||
| eb664f3016 | |||
| bde9abf664 | |||
| 8e1cbc4c5b | |||
| dbb8451adb | |||
| e376aa57c5 | |||
| 0ce5a9544b | |||
| 0302bd43cb | |||
| 5199a74426 | |||
| 0cf8e078e2 | |||
| 62b9422834 | |||
| bf293d8dca | |||
| d70588f5b7 | |||
| bb79781dd8 | |||
| e7d4684531 | |||
| cdbcb8a42a | |||
| 1bd31b67cd | |||
| e58f230354 | |||
| 4e56a8447b | |||
| 5808b3c8df | |||
| a1b518c6f4 | |||
| 34b6e7ef88 | |||
| ba875a120f | |||
| c09bd8c422 | |||
| 15abb78a6b | |||
| 06497773a7 | |||
| 9cf5e034bb | |||
| 3bf3068650 | |||
| 82ade96b3f | |||
| c9790ed854 | |||
| 1e9561b46c | |||
| be3024c0c1 | |||
| f0aafda509 | |||
| c57f41805f | |||
| 984a6763ae | |||
| dd1cf14069 | |||
| d7268ce04c | |||
| e4e3d8ef59 | |||
| 1081d6281f | |||
| 3820186512 | |||
| 7d4bb5150e | |||
| a2125787c2 | |||
| 93d8e22b07 | |||
| 780c35eabe | |||
| 280227fa5f | |||
| 0887c1864c | |||
| 1b858e1e6c | |||
| 8c87d2a39e | |||
| 238ec59dd2 | |||
| ca75162fc9 | |||
| bda5562f90 | |||
| b8e7ca3214 | |||
| ebdeaf3783 | |||
| d1b82f0c58 | |||
| a28b8b1b11 | |||
| 558e84138c | |||
| 49c6ad7c04 | |||
| 646182ea2a | |||
| e927d02c96 | |||
| 1f45cc5dec | |||
| e1bd2047c4 | |||
| 43809838ef | |||
| 3792464fa0 | |||
| af48df230d | |||
| f93acc6635 |
@@ -1,10 +0,0 @@
|
||||
FROM mcr.microsoft.com/devcontainers/base:bookworm
|
||||
|
||||
USER vscode
|
||||
# Install Homebrew For Linux
|
||||
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && \
|
||||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" && \
|
||||
echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> /home/vscode/.zshrc && \
|
||||
echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> /home/vscode/.bashrc && \
|
||||
# Install Graphite
|
||||
brew install withgraphite/tap/graphite && gt --version
|
||||
@@ -1,10 +1,6 @@
|
||||
#!/bin/bash
|
||||
# This is a script used by the devcontainer to build the project
|
||||
|
||||
#Enable yarn
|
||||
corepack enable
|
||||
corepack prepare yarn@stable --activate
|
||||
|
||||
# install dependencies
|
||||
yarn install
|
||||
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
// For format details, see https://aka.ms/devcontainer.json.
|
||||
{
|
||||
"name": "Debian",
|
||||
"name": "AFFiNE Dev Container",
|
||||
"dockerComposeFile": "docker-compose.yml",
|
||||
"service": "app",
|
||||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
|
||||
"containerEnv": {
|
||||
"COREPACK_ENABLE_DOWNLOAD_PROMPT": "0"
|
||||
},
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/node:1": {
|
||||
"version": "22"
|
||||
"version": "lts",
|
||||
"installYarnUsingApt": false
|
||||
},
|
||||
"ghcr.io/devcontainers/features/rust:1": {}
|
||||
},
|
||||
@@ -16,7 +20,7 @@
|
||||
"extensions": [
|
||||
"ms-playwright.playwright",
|
||||
"esbenp.prettier-vscode",
|
||||
"streetsidesoftware.code-spell-checker"
|
||||
"dbaeumer.vscode-eslint"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2,9 +2,7 @@ version: '3.8'
|
||||
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: mcr.microsoft.com/devcontainers/base:bookworm
|
||||
volumes:
|
||||
- ../..:/workspaces:cached
|
||||
command: sleep infinity
|
||||
@@ -24,8 +22,6 @@ services:
|
||||
POSTGRES_DB: affine
|
||||
redis:
|
||||
image: redis
|
||||
ports:
|
||||
- 6379:6379
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
set -e
|
||||
|
||||
npm install -g @withgraphite/graphite-cli@stable
|
||||
|
||||
if [ -v GRAPHITE_TOKEN ];then
|
||||
gt auth --token $GRAPHITE_TOKEN
|
||||
fi
|
||||
|
||||
git fetch origin canary:canary --depth=1
|
||||
git branch canary -t origin/canary
|
||||
gt init --trunk canary
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"schema": "https://github.com/toeverything/affine/releases/latest/download/config.schema.json",
|
||||
"$schema": "https://github.com/toeverything/affine/releases/latest/download/config.schema.json",
|
||||
"server": {
|
||||
"name": "AFFiNE Self Hosted Server"
|
||||
}
|
||||
|
||||
@@ -752,8 +752,8 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
shardIndex: [1, 2, 3]
|
||||
shardTotal: [3]
|
||||
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
|
||||
shardTotal: [8]
|
||||
needs:
|
||||
- build-server-native
|
||||
services:
|
||||
@@ -791,6 +791,8 @@ jobs:
|
||||
with:
|
||||
filters: |
|
||||
changed:
|
||||
- 'packages/backend/server/src/plugins/copilot/**'
|
||||
- 'packages/backend/server/tests/copilot.*'
|
||||
- 'packages/frontend/core/src/blocksuite/ai/**'
|
||||
- 'tests/affine-cloud-copilot/**'
|
||||
|
||||
|
||||
@@ -108,8 +108,8 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
shardIndex: [1, 2, 3]
|
||||
shardTotal: [3]
|
||||
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
|
||||
shardTotal: [8]
|
||||
needs:
|
||||
- build-server-native
|
||||
services:
|
||||
|
||||
Vendored
-935
File diff suppressed because one or more lines are too long
+948
File diff suppressed because one or more lines are too long
+1
-1
@@ -12,4 +12,4 @@ npmPublishAccess: public
|
||||
|
||||
npmPublishRegistry: "https://registry.npmjs.org"
|
||||
|
||||
yarnPath: .yarn/releases/yarn-4.8.1.cjs
|
||||
yarnPath: .yarn/releases/yarn-4.9.0.cjs
|
||||
|
||||
Generated
+9
-40
@@ -81,7 +81,6 @@ dependencies = [
|
||||
"coreaudio-rs",
|
||||
"dispatch2",
|
||||
"libc",
|
||||
"mp3lame-encoder",
|
||||
"napi",
|
||||
"napi-build",
|
||||
"napi-derive",
|
||||
@@ -358,15 +357,6 @@ version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
|
||||
|
||||
[[package]]
|
||||
name = "autotools"
|
||||
version = "0.2.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ef941527c41b0fc0dd48511a8154cd5fc7e29200a0ff8b7203c5d777dbc795cf"
|
||||
dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "backtrace"
|
||||
version = "0.3.74"
|
||||
@@ -611,9 +601,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.2.17"
|
||||
version = "1.2.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a"
|
||||
checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c"
|
||||
dependencies = [
|
||||
"shlex",
|
||||
]
|
||||
@@ -1996,7 +1986,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"windows-targets 0.52.6",
|
||||
"windows-targets 0.48.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2007,9 +1997,9 @@ checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa"
|
||||
|
||||
[[package]]
|
||||
name = "libmimalloc-sys"
|
||||
version = "0.1.41"
|
||||
version = "0.1.42"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6b20daca3a4ac14dbdc753c5e90fc7b490a48a9131daed3c9a9ced7b2defd37b"
|
||||
checksum = "ec9d6fac27761dabcd4ee73571cdb06b7022dc99089acbe5435691edffaac0f4"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
@@ -2163,9 +2153,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
|
||||
|
||||
[[package]]
|
||||
name = "mimalloc"
|
||||
version = "0.1.45"
|
||||
version = "0.1.46"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "03cb1f88093fe50061ca1195d336ffec131347c7b833db31f9ab62a2d1b7925f"
|
||||
checksum = "995942f432bbb4822a7e9c3faa87a695185b0d09273ba85f097b54f4e458f2af"
|
||||
dependencies = [
|
||||
"libmimalloc-sys",
|
||||
]
|
||||
@@ -2212,27 +2202,6 @@ dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mp3lame-encoder"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fc8c8b5cdbe788ccd1098c3d3635298a011cffdebdd3460c9ca5060a7551557b"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"mp3lame-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mp3lame-sys"
|
||||
version = "0.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a21460ca4d833756cb700430888c67969e40b4560f50c226a0d258de551931ec"
|
||||
dependencies = [
|
||||
"autotools",
|
||||
"cc",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nanoid"
|
||||
version = "0.4.0"
|
||||
@@ -4090,9 +4059,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
||||
|
||||
[[package]]
|
||||
name = "tokio"
|
||||
version = "1.44.1"
|
||||
version = "1.44.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a"
|
||||
checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"bytes",
|
||||
|
||||
+4
-1
@@ -31,7 +31,6 @@ homedir = "0.3"
|
||||
infer = { version = "0.19.0" }
|
||||
libc = "0.2"
|
||||
mimalloc = "0.1"
|
||||
mp3lame-encoder = "0.2"
|
||||
napi = { version = "3.0.0-alpha.31", features = ["async", "chrono_date", "error_anyhow", "napi9", "serde"] }
|
||||
napi-build = { version = "2" }
|
||||
napi-derive = { version = "3.0.0-alpha.28" }
|
||||
@@ -83,3 +82,7 @@ codegen-units = 1
|
||||
lto = true
|
||||
opt-level = 3
|
||||
strip = "symbols"
|
||||
|
||||
# android uniffi bindgen requires symbols
|
||||
[profile.release.package.affine_mobile_native]
|
||||
strip = "none"
|
||||
@@ -177,7 +177,6 @@ We would also like to give thanks to open-source projects that make AFFiNE possi
|
||||
- [Jotai](https://github.com/pmndrs/jotai) - Primitive and flexible state management for React.
|
||||
- [async-call-rpc](https://github.com/Jack-Works/async-call-rpc) - A lightweight JSON RPC client & server.
|
||||
- [Vite](https://github.com/vitejs/vite) - Next generation frontend tooling.
|
||||
- [lame](https://lame.sourceforge.io/) - High quality MPEG Audio Layer III (MP3) encoder.
|
||||
- Other upstream [dependencies](https://github.com/toeverything/AFFiNE/network/dependencies).
|
||||
|
||||
Thanks a lot to the community for providing such powerful and simple libraries, so that we can focus more on the implementation of the product logic, and we hope that in the future our projects will also provide a more easy-to-use knowledge base for everyone.
|
||||
|
||||
@@ -3769,6 +3769,48 @@ bbb
|
||||
});
|
||||
expect(nanoidReplacement(rawBlockSnapshot)).toEqual(blockSnapshot);
|
||||
});
|
||||
|
||||
test('escapes dollar signs followed by a digit or space and digit', async () => {
|
||||
const markdown =
|
||||
'The price of the T-shirt is $9.15 and the price of the hat is $ 8\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: {
|
||||
type: 'text',
|
||||
text: {
|
||||
'$blocksuite:internal:text$': true,
|
||||
delta: [
|
||||
{
|
||||
insert:
|
||||
'The price of the T-shirt is $9.15 and the price of the hat is $ 8',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
};
|
||||
const mdAdapter = new MarkdownAdapter(createJob(), provider);
|
||||
const rawBlockSnapshot = await mdAdapter.toBlockSnapshot({
|
||||
file: markdown,
|
||||
});
|
||||
expect(nanoidReplacement(rawBlockSnapshot)).toEqual(blockSnapshot);
|
||||
});
|
||||
});
|
||||
|
||||
test('reference', async () => {
|
||||
|
||||
@@ -24,36 +24,46 @@ import { defaultMarkdownPreprocessors } from './markdown/preprocessor';
|
||||
import { defaultBlockNotionHtmlAdapterMatchers } from './notion-html/block-matcher';
|
||||
import { defaultBlockPlainTextAdapterMatchers } from './plain-text/block-matcher';
|
||||
|
||||
export const AdapterFactoryExtensions: ExtensionType[] = [
|
||||
AttachmentAdapterFactoryExtension,
|
||||
ImageAdapterFactoryExtension,
|
||||
MarkdownAdapterFactoryExtension,
|
||||
PlainTextAdapterFactoryExtension,
|
||||
HtmlAdapterFactoryExtension,
|
||||
NotionTextAdapterFactoryExtension,
|
||||
NotionHtmlAdapterFactoryExtension,
|
||||
MixTextAdapterFactoryExtension,
|
||||
];
|
||||
export function getAdapterFactoryExtensions(): ExtensionType[] {
|
||||
return [
|
||||
AttachmentAdapterFactoryExtension,
|
||||
ImageAdapterFactoryExtension,
|
||||
MarkdownAdapterFactoryExtension,
|
||||
PlainTextAdapterFactoryExtension,
|
||||
HtmlAdapterFactoryExtension,
|
||||
NotionTextAdapterFactoryExtension,
|
||||
NotionHtmlAdapterFactoryExtension,
|
||||
MixTextAdapterFactoryExtension,
|
||||
];
|
||||
}
|
||||
|
||||
export const HtmlAdapterExtension: ExtensionType[] = [
|
||||
...HtmlInlineToDeltaAdapterExtensions,
|
||||
...defaultBlockHtmlAdapterMatchers,
|
||||
...InlineDeltaToHtmlAdapterExtensions,
|
||||
];
|
||||
export function getHtmlAdapterExtensions(): ExtensionType[] {
|
||||
return [
|
||||
...HtmlInlineToDeltaAdapterExtensions,
|
||||
...defaultBlockHtmlAdapterMatchers,
|
||||
...InlineDeltaToHtmlAdapterExtensions,
|
||||
];
|
||||
}
|
||||
|
||||
export const MarkdownAdapterExtension: ExtensionType[] = [
|
||||
...MarkdownInlineToDeltaAdapterExtensions,
|
||||
...defaultBlockMarkdownAdapterMatchers,
|
||||
...InlineDeltaToMarkdownAdapterExtensions,
|
||||
...defaultMarkdownPreprocessors,
|
||||
];
|
||||
export function getMarkdownAdapterExtensions(): ExtensionType[] {
|
||||
return [
|
||||
...MarkdownInlineToDeltaAdapterExtensions,
|
||||
...defaultBlockMarkdownAdapterMatchers,
|
||||
...InlineDeltaToMarkdownAdapterExtensions,
|
||||
...defaultMarkdownPreprocessors,
|
||||
];
|
||||
}
|
||||
|
||||
export const NotionHtmlAdapterExtension: ExtensionType[] = [
|
||||
...NotionHtmlInlineToDeltaAdapterExtensions,
|
||||
...defaultBlockNotionHtmlAdapterMatchers,
|
||||
];
|
||||
export function getNotionHtmlAdapterExtensions(): ExtensionType[] {
|
||||
return [
|
||||
...NotionHtmlInlineToDeltaAdapterExtensions,
|
||||
...defaultBlockNotionHtmlAdapterMatchers,
|
||||
];
|
||||
}
|
||||
|
||||
export const PlainTextAdapterExtension: ExtensionType[] = [
|
||||
...defaultBlockPlainTextAdapterMatchers,
|
||||
...InlineDeltaToPlainTextAdapterExtensions,
|
||||
];
|
||||
export function getPlainTextAdapterExtensions(): ExtensionType[] {
|
||||
return [
|
||||
...defaultBlockPlainTextAdapterMatchers,
|
||||
...InlineDeltaToPlainTextAdapterExtensions,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -51,11 +51,11 @@ import {
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import {
|
||||
AdapterFactoryExtensions,
|
||||
HtmlAdapterExtension,
|
||||
MarkdownAdapterExtension,
|
||||
NotionHtmlAdapterExtension,
|
||||
PlainTextAdapterExtension,
|
||||
getAdapterFactoryExtensions,
|
||||
getHtmlAdapterExtensions,
|
||||
getMarkdownAdapterExtensions,
|
||||
getNotionHtmlAdapterExtensions,
|
||||
getPlainTextAdapterExtensions,
|
||||
} from '../adapters/extension.js';
|
||||
|
||||
export const StoreExtensions: ExtensionType[] = [
|
||||
@@ -96,11 +96,11 @@ export const StoreExtensions: ExtensionType[] = [
|
||||
DatabaseSelectionExtension,
|
||||
TableSelectionExtension,
|
||||
|
||||
HtmlAdapterExtension,
|
||||
MarkdownAdapterExtension,
|
||||
NotionHtmlAdapterExtension,
|
||||
PlainTextAdapterExtension,
|
||||
AdapterFactoryExtensions,
|
||||
getHtmlAdapterExtensions(),
|
||||
getMarkdownAdapterExtensions(),
|
||||
getNotionHtmlAdapterExtensions(),
|
||||
getPlainTextAdapterExtensions(),
|
||||
getAdapterFactoryExtensions(),
|
||||
|
||||
FeatureFlagService,
|
||||
LinkPreviewerService,
|
||||
|
||||
@@ -7,29 +7,29 @@
|
||||
},
|
||||
"include": ["./src"],
|
||||
"references": [
|
||||
{ "path": "../blocks/block-attachment" },
|
||||
{ "path": "../blocks/block-bookmark" },
|
||||
{ "path": "../blocks/block-callout" },
|
||||
{ "path": "../blocks/block-code" },
|
||||
{ "path": "../blocks/block-data-view" },
|
||||
{ "path": "../blocks/block-database" },
|
||||
{ "path": "../blocks/block-divider" },
|
||||
{ "path": "../blocks/block-edgeless-text" },
|
||||
{ "path": "../blocks/block-embed" },
|
||||
{ "path": "../blocks/block-frame" },
|
||||
{ "path": "../blocks/block-image" },
|
||||
{ "path": "../blocks/block-latex" },
|
||||
{ "path": "../blocks/block-list" },
|
||||
{ "path": "../blocks/block-note" },
|
||||
{ "path": "../blocks/block-paragraph" },
|
||||
{ "path": "../blocks/block-root" },
|
||||
{ "path": "../blocks/block-surface" },
|
||||
{ "path": "../blocks/block-surface-ref" },
|
||||
{ "path": "../blocks/block-table" },
|
||||
{ "path": "../blocks/attachment" },
|
||||
{ "path": "../blocks/bookmark" },
|
||||
{ "path": "../blocks/callout" },
|
||||
{ "path": "../blocks/code" },
|
||||
{ "path": "../blocks/data-view" },
|
||||
{ "path": "../blocks/database" },
|
||||
{ "path": "../blocks/divider" },
|
||||
{ "path": "../blocks/edgeless-text" },
|
||||
{ "path": "../blocks/embed" },
|
||||
{ "path": "../blocks/frame" },
|
||||
{ "path": "../blocks/image" },
|
||||
{ "path": "../blocks/latex" },
|
||||
{ "path": "../blocks/list" },
|
||||
{ "path": "../blocks/note" },
|
||||
{ "path": "../blocks/paragraph" },
|
||||
{ "path": "../blocks/root" },
|
||||
{ "path": "../blocks/surface" },
|
||||
{ "path": "../blocks/surface-ref" },
|
||||
{ "path": "../blocks/table" },
|
||||
{ "path": "../components" },
|
||||
{ "path": "../fragments/fragment-doc-title" },
|
||||
{ "path": "../fragments/fragment-frame-panel" },
|
||||
{ "path": "../fragments/fragment-outline" },
|
||||
{ "path": "../fragments/doc-title" },
|
||||
{ "path": "../fragments/frame-panel" },
|
||||
{ "path": "../fragments/outline" },
|
||||
{ "path": "../gfx/brush" },
|
||||
{ "path": "../gfx/connector" },
|
||||
{ "path": "../gfx/group" },
|
||||
@@ -48,14 +48,14 @@
|
||||
{ "path": "../model" },
|
||||
{ "path": "../rich-text" },
|
||||
{ "path": "../shared" },
|
||||
{ "path": "../widgets/widget-drag-handle" },
|
||||
{ "path": "../widgets/widget-edgeless-auto-connect" },
|
||||
{ "path": "../widgets/widget-edgeless-toolbar" },
|
||||
{ "path": "../widgets/widget-frame-title" },
|
||||
{ "path": "../widgets/widget-remote-selection" },
|
||||
{ "path": "../widgets/widget-scroll-anchoring" },
|
||||
{ "path": "../widgets/widget-slash-menu" },
|
||||
{ "path": "../widgets/widget-toolbar" },
|
||||
{ "path": "../widgets/drag-handle" },
|
||||
{ "path": "../widgets/edgeless-auto-connect" },
|
||||
{ "path": "../widgets/edgeless-toolbar" },
|
||||
{ "path": "../widgets/frame-title" },
|
||||
{ "path": "../widgets/remote-selection" },
|
||||
{ "path": "../widgets/scroll-anchoring" },
|
||||
{ "path": "../widgets/slash-menu" },
|
||||
{ "path": "../widgets/toolbar" },
|
||||
{ "path": "../data-view" },
|
||||
{ "path": "../../framework/global" },
|
||||
{ "path": "../../framework/std" },
|
||||
|
||||
+3
-3
@@ -7,12 +7,12 @@
|
||||
},
|
||||
"include": ["./src"],
|
||||
"references": [
|
||||
{ "path": "../block-note" },
|
||||
{ "path": "../block-surface" },
|
||||
{ "path": "../embed" },
|
||||
{ "path": "../surface" },
|
||||
{ "path": "../../components" },
|
||||
{ "path": "../../model" },
|
||||
{ "path": "../../shared" },
|
||||
{ "path": "../../widgets/widget-slash-menu" },
|
||||
{ "path": "../../widgets/slash-menu" },
|
||||
{ "path": "../../../framework/global" },
|
||||
{ "path": "../../../framework/std" },
|
||||
{ "path": "../../../framework/store" }
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"outDir": "./dist",
|
||||
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
|
||||
},
|
||||
"include": ["./src"],
|
||||
"references": [
|
||||
{ "path": "../block-surface" },
|
||||
{ "path": "../../components" },
|
||||
{ "path": "../../model" },
|
||||
{ "path": "../../shared" },
|
||||
{ "path": "../../widgets/widget-edgeless-toolbar" },
|
||||
{ "path": "../../widgets/widget-frame-title" },
|
||||
{ "path": "../../../framework/global" },
|
||||
{ "path": "../../../framework/std" },
|
||||
{ "path": "../../../framework/store" }
|
||||
]
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import {
|
||||
type MarkdownAdapterPreprocessor,
|
||||
MarkdownPreprocessorExtension,
|
||||
} from '@blocksuite/affine-shared/adapters';
|
||||
|
||||
const latexPreprocessor: MarkdownAdapterPreprocessor = {
|
||||
name: 'latex',
|
||||
levels: ['block', 'slice', 'doc'],
|
||||
preprocess: content => {
|
||||
// Replace block-level LaTeX delimiters \[ \] with $$ $$
|
||||
const blockProcessedContent = content.replace(
|
||||
/\\\[(.*?)\\\]/gs,
|
||||
(_, equation) => `$$${equation}$$`
|
||||
);
|
||||
// Replace inline LaTeX delimiters \( \) with $ $
|
||||
const inlineProcessedContent = blockProcessedContent.replace(
|
||||
/\\\((.*?)\\\)/gs,
|
||||
(_, equation) => `$${equation}$`
|
||||
);
|
||||
return inlineProcessedContent;
|
||||
},
|
||||
};
|
||||
|
||||
export const LatexMarkdownPreprocessorExtension =
|
||||
MarkdownPreprocessorExtension(latexPreprocessor);
|
||||
@@ -1,11 +0,0 @@
|
||||
import { BaseTool } from '@blocksuite/std/gfx';
|
||||
|
||||
export class TemplateTool extends BaseTool {
|
||||
static override toolName: string = 'template';
|
||||
}
|
||||
|
||||
declare module '@blocksuite/std/gfx' {
|
||||
interface GfxToolsMap {
|
||||
template: TemplateTool;
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
import { WidgetComponent } from '@blocksuite/std';
|
||||
import {
|
||||
autoUpdate,
|
||||
computePosition,
|
||||
type FloatingElement,
|
||||
type ReferenceElement,
|
||||
size,
|
||||
} from '@floating-ui/dom';
|
||||
import { nothing } from 'lit';
|
||||
|
||||
export const AFFINE_INNER_MODAL_WIDGET = 'affine-inner-modal-widget';
|
||||
|
||||
export class AffineInnerModalWidget extends WidgetComponent {
|
||||
private _getTarget?: () => ReferenceElement;
|
||||
|
||||
get target(): ReferenceElement {
|
||||
if (this._getTarget) {
|
||||
return this._getTarget();
|
||||
}
|
||||
return document.body;
|
||||
}
|
||||
|
||||
open(
|
||||
modal: FloatingElement,
|
||||
ops: { onClose?: () => void }
|
||||
): { close(): void } {
|
||||
const cancel = autoUpdate(this.target, modal, () => {
|
||||
computePosition(this.target, modal, {
|
||||
middleware: [
|
||||
size({
|
||||
apply: ({ rects }) => {
|
||||
Object.assign(modal.style, {
|
||||
left: `${rects.reference.x}px`,
|
||||
top: `${rects.reference.y}px`,
|
||||
width: `${rects.reference.width}px`,
|
||||
height: `${rects.reference.height}px`,
|
||||
});
|
||||
},
|
||||
}),
|
||||
],
|
||||
}).catch(console.error);
|
||||
});
|
||||
const close = () => {
|
||||
modal.remove();
|
||||
ops.onClose?.();
|
||||
cancel();
|
||||
};
|
||||
return { close };
|
||||
}
|
||||
|
||||
override render() {
|
||||
return nothing;
|
||||
}
|
||||
|
||||
setTarget(fn: () => ReferenceElement) {
|
||||
this._getTarget = fn;
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"outDir": "./dist",
|
||||
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
|
||||
},
|
||||
"include": ["./src"],
|
||||
"references": [
|
||||
{ "path": "../block-attachment" },
|
||||
{ "path": "../block-bookmark" },
|
||||
{ "path": "../block-data-view" },
|
||||
{ "path": "../block-database" },
|
||||
{ "path": "../block-edgeless-text" },
|
||||
{ "path": "../block-embed" },
|
||||
{ "path": "../block-frame" },
|
||||
{ "path": "../block-image" },
|
||||
{ "path": "../block-latex" },
|
||||
{ "path": "../block-list" },
|
||||
{ "path": "../block-note" },
|
||||
{ "path": "../block-paragraph" },
|
||||
{ "path": "../block-surface" },
|
||||
{ "path": "../block-surface-ref" },
|
||||
{ "path": "../block-table" },
|
||||
{ "path": "../../components" },
|
||||
{ "path": "../../fragments/fragment-doc-title" },
|
||||
{ "path": "../../gfx/brush" },
|
||||
{ "path": "../../gfx/connector" },
|
||||
{ "path": "../../gfx/group" },
|
||||
{ "path": "../../gfx/mindmap" },
|
||||
{ "path": "../../gfx/note" },
|
||||
{ "path": "../../gfx/shape" },
|
||||
{ "path": "../../gfx/template" },
|
||||
{ "path": "../../gfx/text" },
|
||||
{ "path": "../../inlines/latex" },
|
||||
{ "path": "../../inlines/link" },
|
||||
{ "path": "../../inlines/preset" },
|
||||
{ "path": "../../inlines/reference" },
|
||||
{ "path": "../../model" },
|
||||
{ "path": "../../rich-text" },
|
||||
{ "path": "../../shared" },
|
||||
{ "path": "../../widgets/widget-drag-handle" },
|
||||
{ "path": "../../widgets/widget-edgeless-auto-connect" },
|
||||
{ "path": "../../widgets/widget-edgeless-toolbar" },
|
||||
{ "path": "../../widgets/widget-frame-title" },
|
||||
{ "path": "../../widgets/widget-remote-selection" },
|
||||
{ "path": "../../widgets/widget-scroll-anchoring" },
|
||||
{ "path": "../../widgets/widget-slash-menu" },
|
||||
{ "path": "../../widgets/widget-toolbar" },
|
||||
{ "path": "../../data-view" },
|
||||
{ "path": "../../../framework/global" },
|
||||
{ "path": "../../../framework/std" },
|
||||
{ "path": "../../../framework/store" }
|
||||
]
|
||||
}
|
||||
+9
-7
@@ -2,7 +2,7 @@ import { getEmbedCardIcons } from '@blocksuite/affine-block-embed';
|
||||
import { WebIcon16 } from '@blocksuite/affine-components/icons';
|
||||
import { ThemeProvider } from '@blocksuite/affine-shared/services';
|
||||
import { getHostName } from '@blocksuite/affine-shared/utils';
|
||||
import { WithDisposable } from '@blocksuite/global/lit';
|
||||
import { SignalWatcher, WithDisposable } from '@blocksuite/global/lit';
|
||||
import { OpenInNewIcon } from '@blocksuite/icons/lit';
|
||||
import { BlockSelection, ShadowlessElement } from '@blocksuite/std';
|
||||
import { html } from 'lit';
|
||||
@@ -12,7 +12,9 @@ import { classMap } from 'lit/directives/class-map.js';
|
||||
import type { BookmarkBlockComponent } from '../bookmark-block.js';
|
||||
import { styles } from '../styles.js';
|
||||
|
||||
export class BookmarkCard extends WithDisposable(ShadowlessElement) {
|
||||
export class BookmarkCard extends SignalWatcher(
|
||||
WithDisposable(ShadowlessElement)
|
||||
) {
|
||||
static override styles = styles;
|
||||
|
||||
private _handleClick(event: MouseEvent) {
|
||||
@@ -125,11 +127,11 @@ export class BookmarkCard extends WithDisposable(ShadowlessElement) {
|
||||
<div class="affine-bookmark-content-description">
|
||||
${descriptionText}
|
||||
</div>
|
||||
<div
|
||||
class="affine-bookmark-content-url-wrapper"
|
||||
@click=${this.bookmark.open}
|
||||
>
|
||||
<div class="affine-bookmark-content-url">
|
||||
<div class="affine-bookmark-content-url-wrapper">
|
||||
<div
|
||||
class="affine-bookmark-content-url"
|
||||
@click=${this.bookmark.open}
|
||||
>
|
||||
<span>${getHostName(url)}</span>
|
||||
<div class="affine-bookmark-content-url-icon">
|
||||
${OpenInNewIcon({ width: '12', height: '12' })}
|
||||
-1
@@ -26,7 +26,6 @@ export const styles = css`
|
||||
|
||||
.affine-bookmark-content {
|
||||
width: calc(100% - 204px);
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-self: stretch;
|
||||
+3
-3
@@ -7,12 +7,12 @@
|
||||
},
|
||||
"include": ["./src"],
|
||||
"references": [
|
||||
{ "path": "../block-embed" },
|
||||
{ "path": "../block-surface" },
|
||||
{ "path": "../embed" },
|
||||
{ "path": "../surface" },
|
||||
{ "path": "../../components" },
|
||||
{ "path": "../../model" },
|
||||
{ "path": "../../shared" },
|
||||
{ "path": "../../widgets/widget-slash-menu" },
|
||||
{ "path": "../../widgets/slash-menu" },
|
||||
{ "path": "../../../framework/global" },
|
||||
{ "path": "../../../framework/std" },
|
||||
{ "path": "../../../framework/store" }
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
{ "path": "../../model" },
|
||||
{ "path": "../../rich-text" },
|
||||
{ "path": "../../shared" },
|
||||
{ "path": "../../widgets/widget-slash-menu" },
|
||||
{ "path": "../../widgets/slash-menu" },
|
||||
{ "path": "../../../framework/global" },
|
||||
{ "path": "../../../framework/std" },
|
||||
{ "path": "../../../framework/store" }
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user