Commit Graph

48 Commits

Author SHA1 Message Date
Brooooooklyn fed0156f22 style: add @typescript-eslint/return-await rule (#9612) 2025-01-09 09:28:59 +00:00
forehalo 0554df6bc2 fix(electron): filename escape (#9583) 2025-01-08 07:31:09 +00:00
pengx17 a4841bbfa3 feat(core): drop doc onto split view (#9487)
fix AF-2068, AF-2069, AF-1175, AF-2061, AF-2079, AF-2034, AF-2080, AF-1960, AF-2081

1. replace `dnd-kit` with `@atlaskit/pragmatic-drag-and-drop`
2. allow creating split views by drag & drop the following
   a. WorkbenchLinks (route links), like journals, trash, all docs
   b. doc refs
   c. tags/collection
3. style adjustments to split view
4. remove split view's feature flag and make it GA for electron

https://github.com/user-attachments/assets/6a3e4a25-faa2-4215-8eb0-983f44db6e8c
2025-01-08 05:05:33 +00:00
forehalo c0ed74dfed chore: standardize tsconfig (#9568) 2025-01-08 04:07:56 +00:00
fundon 69e73af2a8 refactor(editor): add native clipboard extension (#9502)
Closes: [BS-2239](https://linear.app/affine-design/issue/BS-2239/不应该通过window注入affine的api)
2025-01-06 15:36:43 +00:00
EYHN 46c8c4a408 feat(nbstore): improve nbstore (#9512) 2025-01-06 09:38:04 +00:00
pengx17 887732179e feat(electron): expose electron apis to web worker (#9441)
fix AF-2044
2024-12-31 03:17:03 +00:00
pengx17 7d0160c8fb feat(electron): enable vscode debugger for electron (#9333) 2024-12-26 15:37:56 +00:00
forehalo 126d576c3e fix(electron): remove blocksuite dep 2024-12-26 21:00:51 +08:00
CatsJuice 690a79b905 chore(electron): disable onboarding (#9332)
close AF-2020
2024-12-26 11:21:15 +00:00
pengx17 70d9cc6b01 fix(electron): electron crash on leave fullscreen (#9314) 2024-12-26 01:55:07 +00:00
EYHN cbaf35df0b feat(nbstore): add nbstore worker (#9185) 2024-12-20 08:01:23 +00:00
EYHN 64b017dc1b feat(nbstore): remove async on connection api (#9187)
We should not use async on `connect` and `disconnect`, for `WebSocketConnection` will never connect when offline.

We should handle the connection status of each storage in sync, using the `connection.waitForConnect`

This PR also puts the connection reference count on the `connect` and disconnect`
2024-12-18 03:59:49 +00:00
Brooooooklyn ea746e3d77 chore: disable rules in oxlint (#9154) 2024-12-13 10:49:35 +00:00
forehalo 8c24f2b906 feat(nbstore): add sqlite implementation (#8811) 2024-12-13 06:13:05 +00:00
pengx17 dc7d128252 feat(core): allow bs snapshot dragging targets (#9093)
fix AF-1924, AF-1848, AF-1928, AF-1931

dnd between affine & editor

<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/T2klNLEk0wxLh4NRDzhk/dff3ceb1-dc82-4222-9b55-13be80b28b2f.mp4">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/T2klNLEk0wxLh4NRDzhk/dff3ceb1-dc82-4222-9b55-13be80b28b2f.mp4">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/dff3ceb1-dc82-4222-9b55-13be80b28b2f.mp4">20241210-1217-49.8960381.mp4</video>
2024-12-11 08:12:01 +00:00
EYHN 8963826463 feat(core): desktop multiple server support (#8979) 2024-12-03 05:51:09 +00:00
akumatus c95e6ec518 feat(core): support copy as image in electron app (#8939)
Close issue [AF-1785](https://linear.app/affine-design/issue/AF-1785).

### What changed?
- Support copy as image in electron app:
  -  Select the whole mindmap if any of the mindmap nodes is selected.
  -  Hide unselected overlap elements before taking a snapshot.
  -  Fit the selected elements to the screen.
  -  Add CSS style to hide irrelevant dom nodes, like widgets, whiteboard background and so on.
     - Due to the usage of Shadow Dom in our code, not all node styles can be controlled. Thus this PR use `-2px` padding for `affine:frame` snapshots.
  - Using electron `capturePage` API to take a snapshot of selected elements.

<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/sJGviKxfE3Ap685cl5bj/c1b7b772-ddf8-4a85-b670-e96af7bd5cc0.mov">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/sJGviKxfE3Ap685cl5bj/c1b7b772-ddf8-4a85-b670-e96af7bd5cc0.mov">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/c1b7b772-ddf8-4a85-b670-e96af7bd5cc0.mov">录屏2024-11-27 16.11.03.mov</video>
2024-11-28 03:58:04 +00:00
pengx17 f2398574ed fix(electron): should not show context menu if there is no typos (#8895)
fix AF-1794
2024-11-27 07:00:45 +00:00
pengx17 47243247b9 fix(electron): respect locale for spellchecker (#8844)
may fix #8837.
fix AF-1712

MacOS automatically do spellcheck based on given text. This only works for Win/Linux.
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/25058395-d70a-42a4-b869-c69fa71bc418.png)
2024-11-20 06:44:36 +00:00
Peng Xiao 8689465e00 fix(electron): potential crash on quit (#8855) 2024-11-20 14:44:06 +08:00
pengx17 df99e2ca97 fix(electron): potential crash on quit (#8829)
fix AF-1696

Related log:
```
Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0   Electron Framework            	       0x10c3bb09c electron::MessagePort::Close()
1   Electron Framework            	       0x10c3bcb78 gin::internal::Dispatcher<void (electron::MessagePort*)>::DispatchToCallbackImpl(gin::Arguments*)
2   Electron Framework            	       0x10c3bc984 gin::internal::Dispatcher<void (electron::MessagePort*)>::DispatchToCallback(v8::FunctionCallbackInfo<v8::Value> const&)
3   ???                           	       0x147e0f58c ???
4   ???                           	       0x147e0d45c ???
5   ???                           	       0x147e0d45c ???
6   ???                           	       0x147e0d45c ???
7   ???                           	       0x1401743b8 ???
8   ???                           	       0x147e0b088 ???
9   ???                           	       0x147e0acd4 ???
10  Electron Framework            	       0x10d657578 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*)
11  Electron Framework            	       0x10d53e478 v8::Function::Call(v8::Isolate*, v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*)
12  Electron Framework            	       0x11337ad34 node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context)
13  Electron Framework            	       0x11337b0b0 node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context)
14  Electron Framework            	       0x10c46d9dc gin_helper::internal::CallMethodWithArgs(v8::Isolate*, v8::Local<v8::Object>, char const*, base::span<v8::Local<v8::Value>, 18446744073709551615ul, v8::Local<v8::Value>*>)
15  Electron Framework            	       0x10c3833b0 bool gin_helper::EventEmitterMixin<electron::api::WebContents>::Emit<>(std::__Cr::basic_string_view<char, std::__Cr::char_traits<char>>)
16  Electron Framework            	       0x10c38324c electron::api::WebContents::WebContentsDestroyed()
17  Electron Framework            	       0x10ebc2ee8 void content::WebContentsImpl::WebContentsObserverList::NotifyObservers<void (content::WebContentsObserver::*)()>(void (content::WebContentsObserver::*)())
18  Electron Framework            	       0x10ebc229c content::WebContentsImpl::~WebContentsImpl()
19  Electron Framework            	       0x10ebc32b0 content::WebContentsImpl::~WebContentsImpl()
20  Electron Framework            	       0x10c4212dc electron::InspectableWebContents::~InspectableWebContents()
21  Electron Framework            	       0x10c4213ac electron::InspectableWebContents::~InspectableWebContents()
22  Electron Framework            	       0x10c382ffc electron::api::WebContents::~WebContents()
23  Electron Framework            	       0x10c383498 non-virtual thunk to electron::api::WebContents::~WebContents()
24  Electron Framework            	       0x10c46cb80 gin_helper::CleanedUpAtExit::DoCleanup()
25  Electron Framework            	       0x10c3ec994 electron::JavascriptEnvironment::DestroyMicrotasksRunner()
26  Electron Framework            	       0x10c3d2828 electron::ElectronBrowserMainParts::PostMainMessageLoopRun()
27  Electron Framework            	       0x10e663458 content::BrowserMainLoop::ShutdownThreadsAndCleanUp()
28  Electron Framework            	       0x10e664a80 content::BrowserMainRunnerImpl::Shutdown()
29  Electron Framework            	       0x10e661098 content::BrowserMain(content::MainFunctionParams)
30  Electron Framework            	       0x10c6339a4 content::RunBrowserProcessMain(content::MainFunctionParams, content::ContentMainDelegate*)
31  Electron Framework            	       0x10c634968 content::ContentMainRunnerImpl::RunBrowser(content::MainFunctionParams, bool)
32  Electron Framework            	       0x10c6347e8 content::ContentMainRunnerImpl::Run()
33  Electron Framework            	       0x10c633208 content::RunContentProcess(content::ContentMainParams, content::ContentMainRunner*)
34  Electron Framework            	       0x10c6332f0 content::ContentMain(content::ContentMainParams)
35  Electron Framework            	       0x10c2e98c0 ElectronMain
36  dyld                          	       0x18b5a8274 start
```
2024-11-15 02:58:19 +00:00
CatsJuice c32b29a293 fix(core): onboading performance improvement (#8790)
- compress images
- remove noise assets (700kb)
- remove lottie animations
- remove `perspective` after paper animation to reduce layers
2024-11-13 08:25:05 +00:00
forehalo b3b1ea2f33 fix(electron): make sure updater receive correct installer files (#8798)
fix AF-1680
2024-11-13 07:48:37 +00:00
Fangdun Tsai f4abe39689 feat(core): pdf preview (#8569)
Co-authored-by: forehalo <forehalo@gmail.com>
2024-11-12 19:12:31 +08:00
pengx17 35f3fc7b5d feat(electron): spellcheck setting (#8730)
fix AF-1647
2024-11-11 13:03:33 +00:00
pengx17 fcd4f8c4ff fix(electron): deep link handling in macos (#8713)
fix AF-1617
The issue is that handling deep link on opening new instance will access the screen module from electron too soon. Move the open call behind whenReady to mitigate the issue.
2024-11-06 02:02:56 +00:00
pengx17 029654f45e fix(electron): share page in electron issues (#8703)
fix AF-1592
fix AF-1612
2024-11-05 11:46:03 +00:00
EYHN 902635e60f refactor(core): desktop project struct (#8334) 2024-11-05 11:00:33 +08:00
Peng Xiao 378c9eb73a fix(electron): active view sometimes does not get focused (#8683) 2024-11-04 08:34:11 +00:00
pengx17 070f5fae49 fix(electron): deep link handling without running instance (#8661)
fix AF-1586
2024-11-01 07:23:38 +00:00
pengx17 c915a3bcb5 revert(electron): revert http protocl in electron (#8655)
fix AF-1583
2024-11-01 06:33:27 +00:00
pengx17 0f8b273134 feat(core): open app in electron app entry (#8637)
fix PD-208
fix PD-210
fix PD-209
fix AF-1495
2024-10-31 06:16:32 +00:00
pengx17 a791481ac8 refactor(electron): move electron-api to framework (#8601)
fix AF-1394
2024-10-30 09:16:20 +00:00
pengx17 835fdc33c0 feat(core): add open link in app to doc menu (#8597)
add "open in desktop app" menu item for editor

fix AF-1547
2024-10-29 13:55:13 +08:00
pengx17 72e1489c62 fix(electron): tab max width (#8507)
fix PD-1727
2024-10-16 08:32:27 +00:00
pengx17 3d3864fa5b build(electron): use live origin http protocol instead of file:// (#8464)
fix AF-1428
2024-10-15 05:42:52 +00:00
EYHN 67f7a4de9c fix(electron): fix windows userspace loss (#8450) 2024-10-08 07:05:37 +00:00
pengx17 f5c49a6ac9 fix(electron): screen resize sometimes does not work well after maximize (#8413)
fix AF-1460
2024-10-07 11:21:57 +00:00
pengx17 6b263d1441 feat(electron): ctrl+= to zoomin on linux (#8412) 2024-10-07 10:56:49 +00:00
pengx17 e839947dd5 fix(electron): enable WAL mode for sqlite (#8336)
fix AF-1015
2024-09-25 04:06:03 +00:00
pengx17 503e020412 fix(electron): cookie redirecting issue (#8347)
fix AF-1416
2024-09-23 04:05:04 +00:00
Saul-Mirone 35e232c61c feat: migrate to blocksuite/affine (#8332)
Use `@blocksuite/affine` package for all blocksuite features in affine.

```ts
@blocksuite/store -> @blocksuite/affine/store
@blocksuite/global -> @blocksuite/affine/global
@blocksuite/block-std -> @blocksuite/affine/block-std
@blocksuite/blocks -> @blocksuite/affine/blocks
@blocksuite/presets -> @blocksuite/affine/presets
```
2024-09-20 10:55:47 +00:00
pengx17 7a26c76e53 fix(electron): do not always enable devtools detach mode (#8273) 2024-09-18 04:16:51 +00:00
EYHN ed63602f01 refactor: remove unused deps (#8259)
auto removed by https://knip.dev/features/auto-fix
2024-09-14 14:52:50 +00:00
forehalo a387e4ac07 refactor: migrate environment to BUILD_CONFIG (#8206) 2024-09-13 07:58:20 +00:00
pengx17 df87300a3f chore(electron): upgrade electron to v32 (#8235)
workaround provided by https://github.com/electron/electron/issues/43556
2024-09-13 04:23:10 +00:00
EYHN cc5a6e6d40 refactor: new project struct (#8199)
packages/frontend/web -> packages/frontend/apps/web
packages/frontend/mobile -> packages/frontend/apps/mobile
packages/frontend/electron -> packages/frontend/apps/electron
2024-09-12 07:42:57 +00:00