Compare commits

...

98 Commits

Author SHA1 Message Date
DarkSky
9e94e7195b fix: use absolute path in gql client (#5454) (#5462) 2023-12-29 16:02:29 +08:00
Peng Xiao
de951c8779 fix(core): enable page history for beta/stable (#5415) 2023-12-27 14:39:59 +08:00
EYHN
fd37026ca5 fix(component): fix font display on safari (#5393)
before

![CleanShot 2023-12-25 at 13.09.26.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/g3jz87HxbjOJpXV3FPT7/4fe08951-67bb-4050-ba14-94391db1cac1.png)

after

![CleanShot 2023-12-25 at 13.09.13.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/g3jz87HxbjOJpXV3FPT7/fbfb17ec-b871-4746-9d3c-d24f850ecca1.png)
2023-12-27 14:39:50 +08:00
JimmFly
4fd5812a89 fix(core): avatars are not aligned (#5404) 2023-12-26 20:43:08 +08:00
Peng Xiao
d01e987ecc fix(core): trash page footer display issue (#5402)
Before

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/eb5e5b18-c4a2-469b-8763-be34c39ba736.png)

After

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/7b3ef339-0cb5-44fe-9e75-cec0e97d28b7.png)
2023-12-26 20:42:54 +08:00
Joooye_34
d87c218c0b fix(electron): set stable base url to app.affine.pro (#5401)
close TOV-282
2023-12-26 20:42:41 +08:00
Peng Xiao
a5bf5cc244 fix(core): about setting blink issue (#5399) 2023-12-26 20:42:33 +08:00
Peng Xiao
16bcd6e76b fix(core): workpace list blink issue on open (#5400) 2023-12-26 20:42:19 +08:00
JimmFly
2e2ace8472 chore(core): add background color to questionnaire (#5396) 2023-12-26 20:42:06 +08:00
Cats Juice
37cff8fe8d fix(core): correct title of onboarding article-2 (#5387) 2023-12-26 20:41:58 +08:00
DarkSky
70ab3b4916 fix: use prefix in electron to prevent formdata bug (#5395) 2023-12-26 20:41:47 +08:00
EYHN
f42ba54578 fix(core): fix flickering workspace list (#5391) 2023-12-26 20:41:36 +08:00
EYHN
a67c8181fc fix(workspace): fix svg file with xml header (#5388) 2023-12-26 20:41:28 +08:00
regischen
613efbded9 feat: bump blocksuite (#5386) 2023-12-26 20:41:18 +08:00
李华桥
549419d102 Merge branch 'canary' into stable 2023-12-22 16:29:51 +08:00
EYHN
8b28761a8a fix(component): fix workspace input (#5381) 2023-12-22 08:26:14 +00:00
EYHN
77d239ff81 fix(workspace): leave workspace correctly (#5379) 2023-12-22 16:17:59 +08:00
Cats Juice
1ce4dd0497 fix(core): hide onboarding paper segments gap (#5384) 2023-12-22 15:49:43 +08:00
EYHN
aa74b0617c fix(workspace): dont upgrade subdoc on cloud (#5382) 2023-12-22 15:48:54 +08:00
Joooye_34
46f824c4e9 fix: input style priority (#5383) 2023-12-22 15:48:28 +08:00
EYHN
f11ea7570a fix(core): maxWait for sync progress debounce (#5377) 2023-12-22 03:28:24 +00:00
Flrande
a08edfd6d9 feat: bump blocksuite (#5374) 2023-12-22 03:17:57 +00:00
李华桥
21c42f8771 Merge branch 'canary' into stable 2023-12-22 01:29:30 +08:00
DarkSky
06912c6885 fix: websocket prefix (#5372) 2023-12-21 15:52:05 +00:00
Joooye_34
ec7f73f168 chore: catch and ignore page upgrade error (#5373) 2023-12-21 14:27:07 +00:00
Joooye_34
cfb77e8243 chore: fix about version in client (#5371) 2023-12-21 14:15:22 +00:00
DarkSky
aa4d42b36c feat: use baseurl from server config (#5369) 2023-12-21 12:52:38 +00:00
李华桥
9012adda7a Merge branch 'canary' into stable 2023-12-21 18:42:56 +08:00
Joooye_34
9fbd9b39d6 ci: set version correctly and remove nightly build workflow (#5367) 2023-12-21 10:00:12 +00:00
李华桥
fb442e9055 Merge branch 'canary' into stable 2023-12-21 16:22:57 +08:00
Cats Juice
aeec68b0d7 fix(core): onboading tooltip next button always shows (#5363) 2023-12-21 08:09:37 +00:00
Joooye_34
fb1ed90ecc ci: use setup version action to init version (#5365)
1. Create  setup version action to unify version initialization
2. Split tag event from release desktop
3. Add schedule to daily deploy and desktop release
2023-12-21 07:58:16 +00:00
LongYinan
cc73124259 chore: bump up @react-hookz/web version to v24 (#5359)
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@react-hookz/web](https://togithub.com/react-hookz/web) | [`^23.1.0` -> `^24.0.0`](https://renovatebot.com/diffs/npm/@react-hookz%2fweb/23.1.0/24.0.1) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@react-hookz%2fweb/24.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@react-hookz%2fweb/24.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@react-hookz%2fweb/23.1.0/24.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@react-hookz%2fweb/23.1.0/24.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>react-hookz/web (@&#8203;react-hookz/web)</summary>

### [`v24.0.1`](https://togithub.com/react-hookz/web/blob/HEAD/CHANGELOG.md#2401-2023-12-20)

[Compare Source](https://togithub.com/react-hookz/web/compare/v24.0.0...v24.0.1)

##### Bug Fixes

-   change build so development and distributed imports match ([6383cdd](6383cdd558))

### [`v24.0.0`](https://togithub.com/react-hookz/web/blob/HEAD/CHANGELOG.md#2400-2023-12-20)

[Compare Source](https://togithub.com/react-hookz/web/compare/v23.1.0...v24.0.0)

##### Features

-   switch package to module type ([#&#8203;1472](https://togithub.com/react-hookz/web/issues/1472)) ([50921ef](50921efda5))

##### BREAKING CHANGES

-   Hooks are now distrubutes as JS built form TS with target ESNext and ESM module resolution. There is no more sense to distribute CJS version as package is ESM-only.

Consequent of above - no more esm and cjs subfolders - hooks are importable from index.js or its own directory which don't have a prefix anymore, thanks to exports directive. All of below examples will lead to same result, choose any on your taste:

import { useFirstMountState } from '[@&#8203;react-hookz/web](https://togithub.com/react-hookz/web)';
import { useFirstMountState } from '@&#8203;react-hookz/web/';
import { useFirstMountState } from '@&#8203;react-hookz/web/useFirstMountState/';
import { useFirstMountState } from '@&#8203;react-hookz/web/useFirstMountState/index.js';
Thought is seems not to have subfolder, it is only due to exports directive, in real it is
@&#8203;react-hookz/web/dist/useFirstMountState/index.js.

Pakage uses imports directive to define path alias #root - it stays so even in distributed code, thus, some may be affected in case their bundler configured to somehow handle such alias. Those developer shoud configure import rewriter not to handle node_modules or [@&#8203;react-hookz/web](https://togithub.com/react-hookz/web) package exclusively.

Side-effect for current PR - documentation is broken, as storybook 6 is not working within ESM packages and I'm planning to switch to another domenting engine anyway.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/toeverything/AFFiNE).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMDMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjEwMy4xIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5In0=-->
2023-12-21 07:45:32 +00:00
Cats Juice
c2db8b356c feat(electron): handle onboarding-window moved between screens (#5345) 2023-12-21 15:44:21 +08:00
LongYinan
eaa62df2dd chore: bump up eslint-plugin-unicorn version to v50 (#5362)
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [eslint-plugin-unicorn](https://togithub.com/sindresorhus/eslint-plugin-unicorn) | [`^49.0.0` -> `^50.0.0`](https://renovatebot.com/diffs/npm/eslint-plugin-unicorn/49.0.0/50.0.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/eslint-plugin-unicorn/50.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/eslint-plugin-unicorn/50.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/eslint-plugin-unicorn/49.0.0/50.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/eslint-plugin-unicorn/49.0.0/50.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>sindresorhus/eslint-plugin-unicorn (eslint-plugin-unicorn)</summary>

### [`v50.0.0`](https://togithub.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v50.0.0)

[Compare Source](https://togithub.com/sindresorhus/eslint-plugin-unicorn/compare/v49.0.0...v50.0.0)

##### New rules

-   [`no-unnecessary-polyfills`](https://togithub.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-polyfills.md) ([#&#8203;1717](https://togithub.com/sindresorhus/eslint-plugin-unicorn/issues/1717))  [`6788d86`](https://togithub.com/sindresorhus/eslint-plugin-unicorn/commit/6788d86)

##### Improvements

-   Support ESLint's new config system ([#&#8203;1886](https://togithub.com/sindresorhus/eslint-plugin-unicorn/issues/1886))  [`65711f9`](https://togithub.com/sindresorhus/eslint-plugin-unicorn/commit/65711f9)
-   `no-useless-undefined`: Add `checkArrowFunctionBody` option ([#&#8203;2232](https://togithub.com/sindresorhus/eslint-plugin-unicorn/issues/2232))  [`9d7048c`](https://togithub.com/sindresorhus/eslint-plugin-unicorn/commit/9d7048c)
-   `prefer-negative-index`: Check `TypedArray#subarray()` ([#&#8203;2237](https://togithub.com/sindresorhus/eslint-plugin-unicorn/issues/2237))  [`6708a30`](https://togithub.com/sindresorhus/eslint-plugin-unicorn/commit/6708a30)
-   `no-useless-undefined`: Ignore React state setters ([#&#8203;2223](https://togithub.com/sindresorhus/eslint-plugin-unicorn/issues/2223))  [`42881ba`](https://togithub.com/sindresorhus/eslint-plugin-unicorn/commit/42881ba)
-   `prefer-module`: Allow `module` as TSTypeParameter name ([#&#8203;2213](https://togithub.com/sindresorhus/eslint-plugin-unicorn/issues/2213))  [`8f61f7c`](https://togithub.com/sindresorhus/eslint-plugin-unicorn/commit/8f61f7c)

##### Fixes

-   `string-content`: Fix JSX autofix for newlines, etc. ([#&#8203;2222](https://togithub.com/sindresorhus/eslint-plugin-unicorn/issues/2222))  [`b95e75e`](https://togithub.com/sindresorhus/eslint-plugin-unicorn/commit/b95e75e)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/toeverything/AFFiNE).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMDMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjEwMy4xIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5In0=-->
2023-12-21 07:23:11 +00:00
JimmFly
332a5c6685 chore(core): temporarily hide export png and pdf in edgeless (#5364) 2023-12-21 07:13:05 +00:00
李华桥
a231474dd2 Merge branch 'canary' into stable 2023-12-21 14:26:01 +08:00
Cats Juice
34c1d2a674 feat(core): responsive for onboarding (#5361)
fix(core): use light-theme for onboarding back button

feat(core): responsive for onboarding
2023-12-21 04:27:49 +00:00
Chen
4dc41fcd09 feat: bump blocksuite (#5357) 2023-12-21 12:22:39 +08:00
Peng Xiao
bfbdde212f fix(storybook): disable onboarding for storybook (#5351) 2023-12-21 03:11:44 +00:00
李华桥
833b42000b Merge branch 'canary' into stable 2023-12-20 16:36:44 +08:00
李华桥
7690c48710 Merge branch 'canary' into stable 2023-12-20 16:32:36 +08:00
DarkSky
579828a700 fix: use secure websocket (#5297) 2023-12-13 22:28:04 +08:00
DarkSky
746db2ccfc feat: only follow serverUrlPrefix at redirect to client (#5295) 2023-12-13 20:37:20 +08:00
李华桥
eff344a9c1 Merge branch 'canary' into stable 2023-12-12 16:45:47 +08:00
李华桥
c89ebab596 Merge branch 'canary' into stable 2023-12-12 11:04:33 +08:00
liuyi
62f4421b7c fix(server): avoid updates persist forever (#5258) 2023-12-11 17:42:25 +08:00
李华桥
42383dbd29 Merge branch 'canary' into stable 2023-12-10 21:04:15 +08:00
李华桥
120e7397ba Merge branch 'canary' into stable 2023-12-01 16:12:17 +08:00
李华桥
24123ad01c Revert "Revert "Merge remote-tracking branch 'origin/canary' into stable""
This reverts commit 89197bacef.
2023-12-01 13:29:43 +08:00
李华桥
ad50320391 v0.10.3 2023-12-01 12:52:15 +08:00
李华桥
eb21a60dda v0.10.3-beta.7 2023-12-01 12:12:20 +08:00
Joooye_34
c0e3be2d40 fix(core): rerender error boundary when route change and improve sentry report (#5147) 2023-12-01 04:04:44 +00:00
李华桥
09d3b72358 v0.10.3-beta.6 2023-11-30 23:02:26 +08:00
Joooye_34
246e16c6c0 fix(infra): compatibility logic follow blocksuite (#5143) 2023-11-30 23:01:38 +08:00
李华桥
dc279d062b v0.10.3-beta.5 2023-11-30 16:49:55 +08:00
Joooye_34
47d5f9e1c2 fix(infra): use blocksuite api to check compatibility (#5137) 2023-11-30 08:48:13 +00:00
Joooye_34
a226eb8d5f fix(core): expose catched editor load error (#5133) 2023-11-29 20:31:35 +08:00
Joooye_34
908c4e1a6f ci: add sentry env when frontend assets build (#5131) 2023-11-29 10:03:49 +00:00
李华桥
1d0bcc80a0 v0.10.3-beta.4 2023-11-29 16:14:06 +08:00
Joooye_34
50010bd824 fix(core): implement editor timeout and report error from boundary (#5105) 2023-11-29 08:10:38 +00:00
liuyi
c0ede1326d fix(server): wrong OTEL config (#5084) 2023-11-29 11:19:13 +08:00
李华桥
89197bacef Revert "Merge remote-tracking branch 'origin/canary' into stable"
This reverts commit 992ed89a89, reversing
changes made to d272d7922d.
2023-11-29 11:18:45 +08:00
李华桥
f97d323ab5 Revert "Revert "refactor(server): standarderlize metrics and trace with OTEL (#5054)""
This reverts commit c1cd1713b9.
2023-11-29 11:07:28 +08:00
EYHN
2acb219dcc fix(workspace): filter awareness from other workspace (#5093) 2023-11-28 16:47:45 +08:00
LongYinan
992ed89a89 Merge remote-tracking branch 'origin/canary' into stable 2023-11-28 15:12:52 +08:00
李华桥
d272d7922d v0.10.3-beta.2 2023-11-25 23:50:40 +08:00
李华桥
c1cd1713b9 Revert "refactor(server): standarderlize metrics and trace with OTEL (#5054)"
This reverts commit 91efca107a.
2023-11-25 23:50:39 +08:00
李华桥
b20e91bee0 v0.10.3-beta.1 2023-11-25 14:14:40 +08:00
李华桥
9a4e5ec8c3 Merge branch 'canary' into stable 2023-11-25 14:14:14 +08:00
李华桥
2019838ae7 v0.10.3-beta.0 2023-11-24 11:39:23 +08:00
李华桥
30ff25f400 Merge branch 'canary' into stable 2023-11-23 23:40:32 +08:00
李华桥
e766208c18 chore: reset merge wrong codes 2023-11-23 22:53:06 +08:00
李华桥
8742f28148 Merge branch 'canary' into stable 2023-11-23 21:31:42 +08:00
LongYinan
cd291bb60e build: remove useless source-map-loader to speedup webpack (#4910) 2023-11-20 10:52:28 +08:00
LongYinan
62c0efcfd1 fix(core): handle the getSession network error properly (#4909)
If network offline or API error happens, the `session` returned by the `useSession` hook will be null, so we can't assume it is not null.

There should be following changes:
1. create a page in ErrorBoundary to let the user refetch the session.
2. The `SessionProvider` stop to pull the new session once the session is null, we need to figure out a way to pull the new session when the network is back or the user click the refetch button.
2023-11-17 16:50:48 +08:00
liuyi
87248b3337 fix(server): all viewers can share public link (#4968) 2023-11-17 12:34:15 +08:00
Joooye_34
00c940f7df chore: bump affine version to 0.10.2 (#4959) 2023-11-16 15:48:37 +08:00
Flrande
931b459fbd chore: bump blocksuite (#4958) 2023-11-16 14:27:39 +08:00
LongYinan
51e71f4a0a ci: prevent error if rust build is cached by nx (#4951)
If Rust build was cached by nx, only the output file will be presented. The chmod command will be failed in this case like: https://github.com/toeverything/AFFiNE/actions/runs/6874496337/job/18697360212
2023-11-16 10:31:51 +08:00
Peng Xiao
9b631f2328 fix(infra): page id compat fix for page ids in workspace.meta (#4950)
since we strip `page:` in keys of workspacedoc.spaces, we should also strip the prefix in meta.pages as well.
2023-11-15 17:36:08 +08:00
LongYinan
01f481a9b6 ci: only disable postinstall on macOS in nightly desktop build (#4938) 2023-11-14 23:00:30 +08:00
Joooye_34
0177ab5c87 fix(infra): workspace migration without blockVersions (#4936) 2023-11-14 14:38:11 +01:00
Peng Xiao
4db35d341c perf(component): use png instead of svg for rendering noise svg (#4935) 2023-11-14 11:52:51 +00:00
DarkSky
3c4a803c97 fix: change password token check (#4934) (#4932) 2023-11-14 11:15:54 +00:00
LongYinan
05154dc7ca ci: disable postinstall in nightly desktop build (#4930)
Should be part of https://github.com/toeverything/AFFiNE/pull/4885
2023-11-14 14:13:55 +08:00
Peng Xiao
c90b477f60 fix(core): change server url of stable to insider (#4902) (#4926) 2023-11-14 12:05:52 +08:00
李华桥
6f18ddbe85 v0.10.1 2023-11-13 19:49:26 +08:00
LongYinan
dde779a71d test(e2e): add subdoc migration test (#4921)
test(e2e): add subdoc migration test

fix: remove .only
2023-11-13 18:00:40 +08:00
Peng Xiao
bd9f66fbc7 fix(infra): compatibility fix for space prefix (#4912)
It seems there are some cases that [this upstream PR](https://github.com/toeverything/blocksuite/pull/4747) will cause data loss.

Because of some historical reasons, the page id could be different with its doc id.
It might be caused by subdoc migration in the following (not 100% sure if all white screen issue is caused by it) 0714c12703/packages/common/infra/src/blocksuite/index.ts (L538-L540)

In version 0.10, page id in spaces no longer has prefix "space:"
The data flow for fetching a doc's updates is:
- page id in `meta.pages` -> find `${page-id}` in `doc.spaces` -> `doc` -> `doc.guid`
if `doc` is not found in `doc.spaces`, a new doc will be created and its `doc.guid` is the same with its pageId
- because of guid logic change, the doc that previously prefixed with `space:` will not be found in `doc.spaces`
- when fetching the rows of this doc using the doc id === page id,
  it will return EMPTY since there is no updates associated with the page id

The provided fix in the PR will patch the `spaces` field of the root doc so that after 0.10 the page doc can still be found in the `spaces` map. It shall apply to both of the idb & sqlite datasources.

Special thanks to @lawvs 's db file for investigation!
2023-11-13 17:57:56 +08:00
liuyi
92f1f40bfa fix(server): wrap updates applying in a transaction (#4922) 2023-11-13 08:49:30 +00:00
LongYinan
48dc1049b3 Merge pull request #4913 from toeverything/darksky/cleanup-depolyment
chore: cleanup deployment
2023-11-12 11:20:02 +08:00
DarkSky
9add530370 chore: cleanup deployment 2023-11-12 11:03:25 +08:00
LongYinan
b77460d871 Merge pull request #4908 from toeverything/61/hotfix-websocket-payload
fix(server): increase server acceptable websocket payload size
2023-11-10 22:01:48 +08:00
forehalo
42db41776b fix(server): increase server acceptable websocket payload size 2023-11-10 21:31:45 +08:00
李华桥
075439c74f fix(core): change server url of stable to insider 2023-11-10 18:32:53 +08:00
Yifeng Wang
fc6c553ece chore: bump theme (#4904)
Co-authored-by: 李华桥 <joooye1991@gmail.com>
2023-11-10 15:40:38 +08:00
Joooye_34
59cb3d5df1 fix(core): change server url of stable to insider (#4902) 2023-11-10 14:50:57 +08:00
82 changed files with 776 additions and 713 deletions

View File

@@ -0,0 +1,24 @@
name: Setup Version
description: 'Setup Version'
outputs:
APP_VERSION:
description: 'App Version'
value: ${{ steps.version.outputs.APP_VERSION }}
runs:
using: 'composite'
steps:
- name: 'Write Version'
id: version
shell: bash
run: |
if [ "${{ github.ref_type }}" == "tag" ]; then
APP_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
else
PACKAGE_VERSION=$(node -p "require('./package.json').version")
TIME_VERSION=$(date +%Y%m%d%H%M)
GIT_SHORT_HASH=$(git rev-parse --short HEAD)
APP_VERSION=$PACKAGE_VERSION-nightly-$TIME_VERSION-$GIT_SHORT_HASH
fi
echo $APP_VERSION
echo "APP_VERSION=$APP_VERSION" >> "$GITHUB_OUTPUT"
./scripts/set-version.sh $APP_VERSION

View File

@@ -0,0 +1,27 @@
name: Deploy Automatically
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-canary.[0-9]+'
schedule:
- cron: '0 9 * * *'
jobs:
dispatch-deploy:
runs-on: ubuntu-latest
name: Setup Deploy
steps:
- name: dispatch deploy by tag
if: ${{ github.event_name == 'push' }}
uses: benc-uk/workflow-dispatch@v1
with:
workflow: deploy.yml
inputs: '{ "flavor": "canary" }'
- name: dispatch deploy by schedule
if: ${{ github.event_name == 'schedule' }}
uses: benc-uk/workflow-dispatch@v1
with:
workflow: deploy.yml
inputs: '{ "flavor": "canary" }'
ref: canary

View File

@@ -4,10 +4,14 @@ on:
workflow_dispatch:
inputs:
flavor:
description: 'Build type (canary, beta, or stable or internal)'
type: string
description: 'Select what enverionment to deploy to'
type: choice
default: canary
options:
- canary
- beta
- stable
- internal
env:
APP_NAME: affine
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
@@ -18,6 +22,9 @@ jobs:
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:
@@ -36,6 +43,9 @@ jobs:
environment: ${{ github.event.inputs.flavor }}
steps:
- uses: actions/checkout@v4
- name: Setup Version
id: version
uses: ./.github/actions/setup-version
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Build Plugins
@@ -67,6 +77,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Version
id: version
uses: ./.github/actions/setup-version
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Build Rust
@@ -88,6 +101,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Version
id: version
uses: ./.github/actions/setup-version
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Build Rust
@@ -207,12 +223,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup deploy version
- name: Setup Version
id: version
run: |
export APP_VERSION=`node -e "console.log(require('./package.json').version)"`
echo $APP_VERSION
echo "APP_VERSION=$APP_VERSION" >> "$GITHUB_OUTPUT"
uses: ./.github/actions/setup-version
- name: Deploy to ${{ github.event.inputs.flavor }}
uses: ./.github/actions/deploy
with:

View File

@@ -1,30 +0,0 @@
name: Dispatch Deploy by tag
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-canary.[0-9]+'
jobs:
dispatch-deploy-by-tag:
runs-on: ubuntu-latest
name: Setup deploy environment
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
extra-flags: 'workspaces focus @affine/monorepo'
hard-link-nm: false
electron-install: false
build-infra: false
build-plugins: false
- name: Setup output value
id: flavor
run: |
node -e "const env = require('semver').parse('${{ github.ref_name }}').prerelease[0] ?? 'stable'; console.log(`flavor=${env}`)" >> "$GITHUB_OUTPUT"
- name: dispatch deploy
uses: benc-uk/workflow-dispatch@v1
with:
workflow: deploy.yml
inputs: '{ "flavor": "${{ steps.flavor.outputs.flavor }}" }'

View File

@@ -1,258 +0,0 @@
name: Build Canary Desktop App on Staging Branch
on:
workflow_dispatch:
inputs:
channel_override:
description: 'channel type (canary, beta, or stable)'
type: choice
default: beta
options:
- canary
- beta
- stable
push:
branches:
# 0.6.x-staging
- v[0-9]+.[0-9]+.x-staging
# 0.6.1-staging
- v[0-9]+.[0-9]+.[0-9]+-staging
paths-ignore:
- README.md
- .github/**
- '!.github/workflows/nightly-build.yml'
- '!.github/actions/build-rust/action.yml'
- '!.github/actions/setup-node/action.yml'
permissions:
actions: write
contents: write
security-events: write
concurrency:
# The concurrency group contains the workflow name and the branch name for
# pull requests or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
env:
# BUILD_TYPE => app icon, app name, etc
BUILD_TYPE: internal
# BUILD_TYPE_OVERRIDE => channel type (canary, beta, or stable) - get the channel type (the api configs)
BUILD_TYPE_OVERRIDE: ${{ github.event.inputs.channel_override || 'beta' }}
jobs:
set-build-version:
runs-on: ubuntu-latest
outputs:
version: 0.0.0-internal.${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: toeverything/set-build-version@latest
- id: version
run: echo ::set-output name=version::${{ env.BUILD_VERSION }}
before-make:
runs-on: ubuntu-latest
needs:
- set-build-version
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Setup @sentry/cli
uses: ./.github/actions/setup-sentry
- name: Replace Version
run: ./scripts/set-version.sh ${{ needs.set-build-version.outputs.version }}
- name: generate-assets
run: yarn workspace @affine/electron generate-assets
env:
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
RELEASE_VERSION: ${{ needs.set-build-version.outputs.version }}
SKIP_PLUGIN_BUILD: 'true'
SKIP_NX_CACHE: 'true'
- name: Upload core artifact
uses: actions/upload-artifact@v3
with:
name: core
path: packages/frontend/electron/resources/web-static
make-distribution:
strategy:
# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64
# For windows, we need a separate approach
matrix:
spec:
- runner: macos-latest
platform: darwin
arch: x64
target: x86_64-apple-darwin
- runner: macos-latest
platform: darwin
arch: arm64
target: aarch64-apple-darwin
- runner: ubuntu-latest
platform: linux
arch: x64
target: x86_64-unknown-linux-gnu
- runner: windows-latest
platform: win32
arch: x64
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.spec.runner }}
needs:
- before-make
- set-build-version
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
SKIP_GENERATE_ASSETS: 1
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
timeout-minutes: 10
if: ${{ matrix.spec.platform == 'darwin' }}
uses: ./.github/actions/setup-node
with:
extra-flags: workspaces focus @affine/electron @affine/monorepo
hard-link-nm: false
build-plugins: false
nmHoistingLimits: workspaces
enableScripts: false
- name: Setup Node.js
timeout-minutes: 10
if: ${{ matrix.spec.platform != 'darwin' }}
uses: ./.github/actions/setup-node
with:
extra-flags: workspaces focus @affine/electron @affine/monorepo
hard-link-nm: false
build-plugins: false
nmHoistingLimits: workspaces
- name: Build AFFiNE native
uses: ./.github/actions/build-rust
with:
target: ${{ matrix.spec.target }}
package: '@affine/native'
nx_token: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Replace Version
run: ./scripts/set-version.sh ${{ needs.set-build-version.outputs.version }}
- uses: actions/download-artifact@v3
with:
name: core
path: packages/frontend/electron/resources/web-static
- name: Build Plugins
run: yarn run build:plugins
- name: Build Desktop Layers
run: yarn workspace @affine/electron build
- name: Signing By Apple Developer ID
if: ${{ matrix.spec.platform == 'darwin' }}
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: make
run: yarn workspace @affine/electron make --platform=${{ matrix.spec.platform }} --arch=${{ matrix.spec.arch }}
env:
SKIP_PLUGIN_BUILD: 1
SKIP_WEB_BUILD: 1
HOIST_NODE_MODULES: 1
- name: Save artifacts (mac)
if: ${{ matrix.spec.platform == 'darwin' }}
run: |
mkdir -p builds
mv packages/frontend/electron/out/*/make/*.dmg ./builds/affine-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.dmg
mv packages/frontend/electron/out/*/make/zip/darwin/${{ matrix.spec.arch }}/*.zip ./builds/affine-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.zip
- name: Save artifacts (windows)
if: ${{ matrix.spec.platform == 'win32' }}
run: |
mkdir -p builds
mv packages/frontend/electron/out/*/make/zip/win32/x64/AFFiNE*-win32-x64-*.zip ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.zip
mv packages/frontend/electron/out/*/make/squirrel.windows/x64/*.exe ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.exe
mv packages/frontend/electron/out/*/make/squirrel.windows/x64/*.msi ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.msi
mv packages/frontend/electron/out/*/make/squirrel.windows/x64/*.nupkg ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.nupkg
- name: Save artifacts (linux)
if: ${{ matrix.spec.platform == 'linux' }}
run: |
mkdir -p builds
mv packages/frontend/electron/out/*/make/zip/linux/x64/*.zip ./builds/affine-${{ env.BUILD_TYPE }}-linux-x64.zip
mv packages/frontend/electron/out/*/make/AppImage/x64/*.AppImage ./builds/affine-${{ env.BUILD_TYPE }}-linux-x64.AppImage
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: affine-${{ matrix.spec.platform }}-${{ matrix.spec.arch }}-builds
path: builds
release:
needs:
- make-distribution
- set-build-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Artifacts (macos-x64)
uses: actions/download-artifact@v3
with:
name: affine-darwin-x64-builds
path: ./
- name: Download Artifacts (macos-arm64)
uses: actions/download-artifact@v3
with:
name: affine-darwin-arm64-builds
path: ./
- name: Download Artifacts (windows-x64)
uses: actions/download-artifact@v3
with:
name: affine-win32-x64-builds
path: ./
- name: Download Artifacts (linux-x64)
uses: actions/download-artifact@v3
with:
name: affine-linux-x64-builds
path: ./
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Generate Release yml
run: |
node ./packages/frontend/electron/scripts/generate-yml.js
env:
RELEASE_VERSION: ${{ needs.set-build-version.outputs.version }}
- name: Generate SHA512 checksums
run: |
sha512sum *-linux-* > SHA512SUMS.txt
sha512sum *-macos-* >> SHA512SUMS.txt
sha512sum *-windows-* >> SHA512SUMS.txt
- name: Create Release Draft
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
repository: 'toeverything/AFFiNE-Releases'
name: ${{ needs.set-build-version.outputs.version }}
tag_name: ${{ needs.set-build-version.outputs.version }}
prerelease: true
files: |
./SHA512SUMS.txt
./VERSION
./*.zip
./*.dmg
./*.exe
./*.nupkg
./RELEASES
./*.AppImage
./*.apk
./*.yml

View File

@@ -0,0 +1,27 @@
name: Release Desktop Automatically
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-canary.[0-9]+'
schedule:
- cron: '0 9 * * *'
jobs:
dispatch-release-desktop:
runs-on: ubuntu-latest
name: Setup Release Desktop
steps:
- name: dispatch desktop release by tag
if: ${{ github.event_name == 'push' }}
uses: benc-uk/workflow-dispatch@v1
with:
workflow: release-desktop.yml
inputs: '{ "build-type": "canary", "is-draft": false, "is-pre-release": true }'
- name: dispatch desktop release by schedule
if: ${{ github.event_name == 'schedule' }}
uses: benc-uk/workflow-dispatch@v1
with:
workflow: release-desktop.yml
inputs: '{ "build-type": "canary", "is-draft": false, "is-pre-release": true }'
ref: canary

View File

@@ -1,15 +1,17 @@
name: Release Desktop App
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-canary.[0-9]+'
workflow_dispatch:
inputs:
version:
description: App Version
build-type:
description: 'Build Type'
type: choice
required: true
default: 0.0.0
default: canary
options:
- canary
- beta
- stable
is-draft:
description: 'Draft Release?'
type: boolean
@@ -20,11 +22,6 @@ on:
type: boolean
required: true
default: true
build-type:
description: 'Build Type (canary, beta or stable)'
type: string
required: true
default: canary
permissions:
actions: write
@@ -32,7 +29,7 @@ permissions:
security-events: write
env:
BUILD_TYPE: ${{ github.event.inputs.build-type || (github.ref_type == 'tag' && contains(github.ref, 'canary') && 'canary') }}
BUILD_TYPE: ${{ github.event.inputs.build-type }}
DEBUG: napi:*
APP_NAME: affine
MACOSX_DEPLOYMENT_TARGET: '10.13'
@@ -40,26 +37,18 @@ env:
jobs:
before-make:
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.build-type || (github.ref_type == 'tag' && contains(github.ref, 'canary') && 'canary') }}
environment: ${{ github.event.inputs.build-type }}
outputs:
RELEASE_VERSION: ${{ steps.get-canary-version.outputs.RELEASE_VERSION }}
RELEASE_VERSION: ${{ steps.version.outputs.APP_VERSION }}
steps:
- uses: actions/checkout@v4
- name: Setup Version
id: version
uses: ./.github/actions/setup-version
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Setup @sentry/cli
uses: ./.github/actions/setup-sentry
- name: Get canary version
id: get-canary-version
if: ${{ github.ref_type == 'tag' }}
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/v}
PACKAGE_VERSION=$(node -p "require('./packages/frontend/electron/package.json').version")
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)"
exit 1
fi
echo "RELEASE_VERSION=$(node -p "require('./packages/frontend/electron/package.json').version")" >> $GITHUB_OUTPUT
- name: generate-assets
run: yarn workspace @affine/electron generate-assets
env:
@@ -67,7 +56,7 @@ jobs:
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
RELEASE_VERSION: ${{ github.event.inputs.version || steps.get-canary-version.outputs.RELEASE_VERSION }}
RELEASE_VERSION: ${{ steps.version.outputs.APP_VERSION }}
SKIP_PLUGIN_BUILD: 'true'
SKIP_NX_CACHE: 'true'
@@ -104,6 +93,9 @@ jobs:
SKIP_GENERATE_ASSETS: 1
steps:
- uses: actions/checkout@v4
- name: Setup Version
id: version
uses: ./.github/actions/setup-version
- name: Setup Node.js
timeout-minutes: 10
uses: ./.github/actions/setup-node
@@ -178,6 +170,9 @@ jobs:
SKIP_GENERATE_ASSETS: 1
steps:
- uses: actions/checkout@v4
- name: Setup Version
id: version
uses: ./.github/actions/setup-version
- name: Setup Node.js
timeout-minutes: 10
uses: ./.github/actions/setup-node
@@ -361,14 +356,14 @@ jobs:
run: |
node ./packages/frontend/electron/scripts/generate-yml.js
env:
RELEASE_VERSION: ${{ github.event.inputs.version || needs.before-make.outputs.RELEASE_VERSION }}
RELEASE_VERSION: ${{ needs.before-make.outputs.RELEASE_VERSION }}
- name: Create Release Draft
uses: softprops/action-gh-release@v1
with:
name: ${{ github.event.inputs.version || needs.before-make.outputs.RELEASE_VERSION }}
name: ${{ needs.before-make.outputs.RELEASE_VERSION }}
body: ''
draft: ${{ github.event.inputs.is-draft || true }}
prerelease: ${{ github.event.inputs.is-pre-release || needs.before-make.outputs.version }}
draft: ${{ github.event.inputs.is-draft }}
prerelease: ${{ github.event.inputs.is-pre-release }}
files: |
./VERSION
./*.zip

View File

@@ -88,7 +88,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-sonarjs": "^0.23.0",
"eslint-plugin-unicorn": "^49.0.0",
"eslint-plugin-unicorn": "^50.0.0",
"eslint-plugin-unused-imports": "^3.0.0",
"eslint-plugin-vue": "^9.18.1",
"fake-indexeddb": "5.0.1",

View File

@@ -10,6 +10,9 @@ export class ServerConfigType {
@Field({ description: 'server flavor' })
flavor!: string;
@Field({ description: 'server base url' })
baseUrl!: string;
}
export class ServerConfigResolver {
@@ -20,6 +23,7 @@ export class ServerConfigResolver {
return {
version: AFFiNE.version,
flavor: SERVER_FLAVOR,
baseUrl: AFFiNE.baseUrl,
};
}
}

View File

@@ -8,6 +8,9 @@ type ServerConfigType {
"""server flavor"""
flavor: String!
"""server base url"""
baseUrl: String!
}
type UserQuotaHumanReadable {

View File

@@ -3,8 +3,8 @@
"private": true,
"type": "module",
"devDependencies": {
"@blocksuite/global": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/store": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/global": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/store": "0.11.0-nightly-202312220916-e3abcbb",
"react": "18.2.0",
"react-dom": "18.2.0",
"vitest": "1.0.4",

View File

@@ -62,9 +62,9 @@
"@affine/debug": "workspace:*",
"@affine/env": "workspace:*",
"@affine/sdk": "workspace:*",
"@blocksuite/blocks": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/global": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/store": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/blocks": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/global": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/store": "0.11.0-nightly-202312220916-e3abcbb",
"jotai": "^2.5.1",
"jotai-effect": "^0.2.3",
"tinykeys": "^2.1.0",
@@ -73,8 +73,8 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine/templates": "workspace:*",
"@blocksuite/lit": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/presets": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/lit": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/presets": "0.11.0-nightly-202312220916-e3abcbb",
"@testing-library/react": "^14.0.0",
"async-call-rpc": "^6.3.1",
"electron": "link:../../frontend/electron/node_modules/electron",

View File

@@ -28,7 +28,12 @@ export async function migratePages(
const oldVersions = versions?.toJSON() ?? {};
spaces.forEach((space: YDoc) => {
schema.upgradePage(0, oldVersions, space);
try {
// Catch page upgrade error to avoid blocking the whole workspace migration.
schema.upgradePage(0, oldVersions, space);
} catch (e) {
console.error(e);
}
});
schema.upgradeWorkspace(rootDoc);

View File

@@ -11,7 +11,8 @@ export enum MigrationPoint {
}
export function checkWorkspaceCompatibility(
workspace: Workspace
workspace: Workspace,
isCloud: boolean
): MigrationPoint | null {
// check if there is any key starts with 'space:' on root doc
const spaceMetaObj = workspace.doc.share.get('space:meta') as
@@ -20,7 +21,9 @@ export function checkWorkspaceCompatibility(
const docKeys = Array.from(workspace.doc.share.keys());
const haveSpaceMeta = !!spaceMetaObj && spaceMetaObj.size > 0;
const haveLegacySpace = docKeys.some(key => key.startsWith('space:'));
if (haveSpaceMeta || haveLegacySpace) {
// DON'T UPGRADE SUBDOC ON CLOUD
if (!isCloud && (haveSpaceMeta || haveLegacySpace)) {
return MigrationPoint.SubDoc;
}

View File

@@ -22,11 +22,11 @@
"dist"
],
"dependencies": {
"@blocksuite/block-std": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/blocks": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/global": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/presets": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/store": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/block-std": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/blocks": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/global": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/presets": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/store": "0.11.0-nightly-202312220916-e3abcbb",
"jotai": "^2.5.1",
"zod": "^3.22.4"
},

View File

@@ -37,8 +37,8 @@
"y-provider": "workspace:*"
},
"devDependencies": {
"@blocksuite/blocks": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/store": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/blocks": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/store": "0.11.0-nightly-202312220916-e3abcbb",
"fake-indexeddb": "^5.0.0",
"vite": "^5.0.6",
"vite-plugin-dts": "3.6.0",

View File

@@ -24,7 +24,7 @@
"build": "vite build"
},
"devDependencies": {
"@blocksuite/store": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/store": "0.11.0-nightly-202312220916-e3abcbb",
"vite": "^5.0.6",
"vite-plugin-dts": "3.6.0",
"vitest": "1.0.4",

View File

@@ -72,12 +72,12 @@
"uuid": "^9.0.1"
},
"devDependencies": {
"@blocksuite/blocks": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/global": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/blocks": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/global": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/icons": "2.1.36",
"@blocksuite/lit": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/presets": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/store": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/lit": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/presets": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/store": "0.11.0-nightly-202312220916-e3abcbb",
"@storybook/addon-actions": "^7.5.3",
"@storybook/addon-essentials": "^7.5.3",
"@storybook/addon-interactions": "^7.5.3",

View File

@@ -7,6 +7,7 @@ export const scrollableContainer = style({
alignItems: 'center',
height: '100vh',
padding: '0 200px',
backgroundColor: 'var(--affine-background-primary-color)',
'@media': {
'screen and (max-width: 1024px)': {
padding: '80px 36px',

View File

@@ -21,6 +21,7 @@ interface ExportMenuItemProps<T> {
interface ExportProps {
exportHandler: (type: 'pdf' | 'html' | 'png' | 'markdown') => Promise<void>;
pageMode?: 'page' | 'edgeless';
className?: string;
}
@@ -47,6 +48,7 @@ export function ExportMenuItem<T>({
export const ExportMenuItems = ({
exportHandler,
className = transitionStyle,
pageMode = 'page',
}: ExportProps) => {
const t = useAFFiNEI18N();
const itemMap = useMemo(
@@ -94,16 +96,23 @@ export const ExportMenuItems = ({
],
[className, exportHandler, t]
);
const items = itemMap.map(({ component: Component, props }) => (
<Component key={props.label} {...props} />
));
const items = itemMap.map(({ component: Component, props }) =>
pageMode === 'edgeless' &&
(props.type === 'pdf' || props.type === 'png') ? null : (
<Component key={props.label} {...props} />
)
);
return items;
};
export const Export = ({ exportHandler, className }: ExportProps) => {
export const Export = ({ exportHandler, className, pageMode }: ExportProps) => {
const t = useAFFiNEI18N();
const items = (
<ExportMenuItems exportHandler={exportHandler} className={className} />
<ExportMenuItems
exportHandler={exportHandler}
className={className}
pageMode={pageMode}
/>
);
return (
<MenuSub

View File

@@ -1,6 +0,0 @@
import { style } from '@vanilla-extract/css';
export const input = style({
height: '34px',
width: '220px',
});

View File

@@ -2,7 +2,6 @@ import { useCallback, useState } from 'react';
import Input from '../../ui/input';
import { Menu } from '../../ui/menu';
import * as styles from './index.css';
export const RenameModal = ({
onRename,
@@ -33,12 +32,12 @@ export const RenameModal = ({
}}
items={
<Input
className={styles.input}
autoFocus
defaultValue={value}
onChange={setValue}
onEnter={handleRename}
data-testid="rename-modal-input"
style={{ width: 220, height: 34 }}
/>
}
>

View File

@@ -5,6 +5,7 @@
font-family: 'Inter';
font-display: swap;
src: url(../fonts/inter/Inter-VariableFont_slnt,wght.ttf);
font-weight: 1 999;
}
/*

View File

@@ -391,7 +391,6 @@ export const createConfiguration: (
proxy: {
'/api/worker/': {
target: 'https://affine-worker.toeverything.workers.dev',
pathRewrite: { '^/api/worker/': '/api/' },
changeOrigin: true,
secure: false,
},

View File

@@ -31,9 +31,9 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
enableCaptcha: true,
enableEnhanceShareMode: false,
enablePayment: true,
enablePageHistory: false,
enablePageHistory: true,
enableCopilot: false,
serverUrlPrefix: 'https://insider.affine.pro', // Let insider be stable environment temporarily.
serverUrlPrefix: 'https://app.affine.pro',
editorFlags,
appVersion: packageJson.version,
editorVersion: packageJson.dependencies['@blocksuite/presets'],
@@ -42,7 +42,7 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
get beta() {
return {
...this.stable,
enablePageHistory: false,
enablePageHistory: true,
enableCopilot: false,
serverUrlPrefix: 'https://insider.affine.pro',
appBuildType: 'beta' as const,

View File

@@ -25,14 +25,14 @@
"@affine/i18n": "workspace:*",
"@affine/templates": "workspace:*",
"@affine/workspace": "workspace:*",
"@blocksuite/block-std": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/blocks": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/global": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/block-std": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/blocks": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/global": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/icons": "2.1.36",
"@blocksuite/inline": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/lit": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/presets": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/store": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/inline": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/lit": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/presets": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/store": "0.11.0-nightly-202312220916-e3abcbb",
"@dnd-kit/core": "^6.0.8",
"@dnd-kit/sortable": "^8.0.0",
"@emotion/cache": "^11.11.0",
@@ -44,7 +44,7 @@
"@radix-ui/react-dialog": "^1.0.4",
"@radix-ui/react-scroll-area": "^1.0.5",
"@radix-ui/react-select": "^2.0.0",
"@react-hookz/web": "^23.1.0",
"@react-hookz/web": "^24.0.0",
"@sentry/integrations": "^7.83.0",
"@sentry/react": "^7.83.0",
"@toeverything/theme": "^0.7.20",

View File

@@ -8,7 +8,7 @@ import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { useWorkspace } from '@toeverything/hooks/use-workspace';
import { useWorkspaceInfo } from '@toeverything/hooks/use-workspace-info';
import { useSelfHosted } from '../../../hooks/affine/use-server-flavor';
import { useSelfHosted } from '../../../hooks/affine/use-server-config';
import { DeleteLeaveWorkspace } from './delete-leave-workspace';
import { EnableCloudPanel } from './enable-cloud';
import { ExportPanel } from './export';

View File

@@ -14,7 +14,6 @@ import { useSetAtom } from 'jotai';
import {
type KeyboardEvent,
type MouseEvent,
startTransition,
useCallback,
useEffect,
useState,
@@ -119,9 +118,7 @@ export const ProfilePanel = ({ isOwner, workspace }: ProfilePanelProps) => {
);
const handleSetInput = useCallback((value: string) => {
startTransition(() => {
setInput(value);
});
setInput(value);
}, []);
const handleKeyUp = useCallback(
@@ -203,7 +200,7 @@ export const ProfilePanel = ({ isOwner, workspace }: ProfilePanelProps) => {
<Input
disabled={workspaceIsLoading || !isOwner}
value={input}
className={styles.workspaceNameInput}
style={{ width: 280, height: 32 }}
data-testid="workspace-name-input"
placeholder={t['Workspace Name']()}
maxLength={64}

View File

@@ -201,8 +201,3 @@ export const arrowRight = style({
color: 'var(--affine-text-emphasis-color)',
cursor: 'pointer',
});
export const workspaceNameInput = style({
height: '32px',
width: '280px',
});

View File

@@ -2,7 +2,15 @@ import { Button } from '@affine/component';
import * as styles from './animate-in-tooltip.css';
export const AnimateInTooltip = ({ onNext }: { onNext: () => void }) => {
interface AnimateInTooltipProps {
onNext: () => void;
visible?: boolean;
}
export const AnimateInTooltip = ({
onNext,
visible,
}: AnimateInTooltipProps) => {
return (
<>
<div className={styles.tooltip}>
@@ -10,9 +18,11 @@ export const AnimateInTooltip = ({ onNext }: { onNext: () => void }) => {
whiteboards and databases
</div>
<div className={styles.next}>
<Button type="primary" size="extraLarge" onClick={onNext}>
Next
</Button>
{visible ? (
<Button type="primary" size="extraLarge" onClick={onNext}>
Next
</Button>
) : null}
</div>
</>
);

View File

@@ -8,12 +8,7 @@ import { BlogLink } from './blog-link';
export const article2: Array<OnboardingBlockOption> = [
{
children: (
<h1>
Learning with earning with
<br /> retrieval practice
</h1>
),
children: <h1>Learning with retrieval practice</h1>,
offset: { x: -824, y: 0 },
},
{
@@ -150,14 +145,14 @@ export const article2: Array<OnboardingBlockOption> = [
{
children: <img draggable={false} width={380} src={embed1png} />,
edgelessOnly: true,
position: { x: -300, y: 0 },
position: { x: -200, y: -50 },
fromPosition: { x: 300, y: -300 },
},
{
children: <img draggable={false} width={309} src={note1png} />,
edgelessOnly: true,
position: { x: -360, y: -20 },
position: { x: -260, y: -70 },
fromPosition: { x: -360, y: -100 },
enterDelay: 300,
customStyle: {
@@ -170,7 +165,7 @@ export const article2: Array<OnboardingBlockOption> = [
{
children: <img draggable={false} width={1800} src={note2png} />,
edgelessOnly: true,
position: { x: 0, y: 0 },
position: { x: 50, y: 0 },
fromPosition: { x: 2000, y: -2000 },
},
];

View File

@@ -158,7 +158,7 @@ const paperBriefs = {
'2': (
<div className={articleWrapper}>
<article className={article}>
<h1 className={title}>Learning with earning with retrieval practice</h1>
<h1 className={title}>Learning with retrieval practice</h1>
<p className={text}>
Are there any specific techniques to make the process of learning more
effective?

View File

@@ -23,7 +23,27 @@ export const segment = style({
position: 'absolute',
top: `calc(var(--segments-up) / var(--segments) * 100%)`,
// add a thin line behind to hide the gap between segments
'::before': {
content: '""',
position: 'absolute',
transform: `translateZ(-1px)`,
width: '100%',
height: '2px',
background: onboardingVars.paper.bg,
},
selectors: {
['&[data-root="true"]::before']: {
content: 'none',
},
['&[data-direction="up"]::before']: {
bottom: -1,
},
['&[data-direction="down"]::before']: {
top: -1,
},
['&[data-root="true"]']: {
height: `calc(1 / var(--segments) * 100%)`,
},

View File

@@ -34,6 +34,11 @@ export const Onboarding = ({ onOpenApp }: OnboardingProps) => {
});
}, []);
const onTooltipNext = useCallback(() => {
if (status.activeId) return;
setStatus({ activeId: null, unfoldingId: '4' });
}, [status.activeId]);
return (
<div
className={styles.onboarding}
@@ -80,9 +85,7 @@ export const Onboarding = ({ onOpenApp }: OnboardingProps) => {
)}
<div className={styles.tipsWrapper} data-visible={!status.activeId}>
<AnimateInTooltip
onNext={() => setStatus({ activeId: null, unfoldingId: '4' })}
/>
<AnimateInTooltip onNext={onTooltipNext} visible={!status.activeId} />
</div>
</div>
</div>

View File

@@ -14,6 +14,9 @@ export const edgelessSwitchWindow = style({
fontFamily: 'var(--affine-font-family)',
color: onboardingVars.paper.textColor,
maxWidth: 'calc(100vw - 48px)',
maxHeight: 'calc(100vh - 48px)',
selectors: {
'&[data-mode="edgeless"]': {
width: onboardingVars.edgeless.w,

View File

@@ -224,7 +224,15 @@ export const EdgelessSwitch = ({
<div data-no-drag className={styles.noDragWrapper}>
<header className={styles.header}>
<Button size="extraLarge" onClick={onBack}>
<Button
style={{
background: 'white',
borderColor: '#E3E2E4',
color: '#424149',
}}
size="extraLarge"
onClick={onBack}
>
Back
</Button>
<EdgelessSwitchButtons

View File

@@ -100,8 +100,7 @@ export const onboarding = style([
animation: `${fadeIn} 0.8s linear`,
// content: 'unset',
background:
// 'linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 99.58%)',
'linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 80%)',
'linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 99.58%)',
},
'&[data-is-window="true"][data-is-desktop="true"]::after': {
opacity: 0,
@@ -133,16 +132,25 @@ export const paperLocation = style({
export const tipsWrapper = style({
position: 'absolute',
width: `calc(${onboardingVars.article.w} - 48px)`,
top: `calc(-${onboardingVars.article.h} / 2 + 24px)`,
maxWidth: 'calc(100vw - 96px)',
bottom: 0,
height: `calc(${onboardingVars.article.h} / 2 - 24px)`,
maxHeight: 'calc(50vh - 48px)',
pointerEvents: 'none',
display: 'flex',
justifyContent: 'center',
opacity: 0,
transition: '0.3s ease 1s',
transition: '0.3s ease',
selectors: {
'&[data-visible="true"]': {
pointerEvents: 'auto',
opacity: 1,
},
},
});
globalStyle(`${tipsWrapper} > *`, {
display: 'inline-block',
height: 'fit-content',
});
globalStyle(`${tipsWrapper}[data-visible="true"] > *`, {
pointerEvents: 'auto',
});

View File

@@ -34,7 +34,7 @@ import {
openSignOutModalAtom,
} from '../../../../atoms';
import { useCurrentUser } from '../../../../hooks/affine/use-current-user';
import { useSelfHosted } from '../../../../hooks/affine/use-server-flavor';
import { useSelfHosted } from '../../../../hooks/affine/use-server-config';
import { useUserSubscription } from '../../../../hooks/use-subscription';
import { validateAndReduceImage } from '../../../../utils/reduce-image';
import { Upload } from '../../../pure/file-upload';
@@ -137,12 +137,12 @@ export const AvatarAndName = () => {
<label>{t['com.affine.settings.profile.name']()}</label>
<FlexWrapper alignItems="center">
<Input
className={styles.userNameInput}
defaultValue={input}
data-testid="user-name-input"
placeholder={t['com.affine.settings.profile.placeholder']()}
maxLength={64}
minLength={0}
style={{ width: 280, height: 32 }}
onChange={setInput}
onEnter={handleUpdateUserName}
/>

View File

@@ -43,8 +43,3 @@ globalStyle(`${avatarWrapper} .camera-icon-wrapper`, {
export const button = style({
padding: '4px 12px',
});
export const userNameInput = style({
height: '32px',
width: '280px',
});

View File

@@ -8,7 +8,7 @@ import {
import type { ReactElement, SVGProps } from 'react';
import { useCurrentLoginStatus } from '../../../../hooks/affine/use-current-login-status';
import { useSelfHosted } from '../../../../hooks/affine/use-server-flavor';
import { useSelfHosted } from '../../../../hooks/affine/use-server-config';
import { AboutAffine } from './about';
import { AppearanceSettings } from './appearance';
import { BillingSettings } from './billing';

View File

@@ -126,20 +126,20 @@ export const SettingModal = ({
>
<div ref={modalContentRef} className={style.centerContainer}>
<div className={style.content}>
{activeTab === 'workspace' && workspaceMetadata ? (
<Suspense fallback={<WorkspaceDetailSkeleton />}>
<Suspense fallback={<WorkspaceDetailSkeleton />}>
{activeTab === 'workspace' && workspaceMetadata ? (
<WorkspaceSetting
key={workspaceMetadata.id}
workspaceMetadata={workspaceMetadata}
/>
</Suspense>
) : null}
{generalSettingList.some(v => v.key === activeTab) ? (
<GeneralSetting generalKey={activeTab as GeneralSettingKeys} />
) : null}
{activeTab === 'account' && loginStatus === 'authenticated' ? (
<AccountSetting />
) : null}
) : null}
{generalSettingList.some(v => v.key === activeTab) ? (
<GeneralSetting generalKey={activeTab as GeneralSettingKeys} />
) : null}
{activeTab === 'account' && loginStatus === 'authenticated' ? (
<AccountSetting />
) : null}
</Suspense>
</div>
<div className={style.footer}>
<a

View File

@@ -4,7 +4,9 @@ import { Divider } from '@affine/component/ui/divider';
import { WorkspaceFlavour } from '@affine/env/workspace';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { LinkIcon } from '@blocksuite/icons';
import { useAtomValue } from 'jotai';
import { currentModeAtom } from '../../../../atoms/mode';
import { useExportPage } from '../../../../hooks/affine/use-export-page';
import * as styles from './index.css';
import type { ShareMenuProps } from './share-menu';
@@ -17,12 +19,13 @@ export const ShareExport = ({
const t = useAFFiNEI18N();
const workspaceId = workspace.id;
const pageId = currentPage.id;
const { onClickCopyLink } = useSharingUrl({
const { sharingUrl, onClickCopyLink } = useSharingUrl({
workspaceId,
pageId,
urlType: 'workspace',
});
const exportHandler = useExportPage(currentPage);
const currentMode = useAtomValue(currentModeAtom);
return (
<>
@@ -36,6 +39,7 @@ export const ShareExport = ({
<ExportMenuItems
exportHandler={exportHandler}
className={styles.menuItemStyle}
pageMode={currentMode}
/>
</div>
{workspace.flavour !== WorkspaceFlavour.LOCAL ? (
@@ -53,6 +57,7 @@ export const ShareExport = ({
onClick={onClickCopyLink}
icon={<LinkIcon />}
type="plain"
disabled={!sharingUrl}
>
{t['com.affine.share-menu.copy-private-link']()}
</Button>

View File

@@ -18,6 +18,7 @@ import { useCallback } from 'react';
import type { PageMode } from '../../../../atoms';
import { currentModeAtom } from '../../../../atoms/mode';
import { useIsSharedPage } from '../../../../hooks/affine/use-is-shared-page';
import { useServerBaseUrl } from '../../../../hooks/affine/use-server-config';
import * as styles from './index.css';
import type { ShareMenuProps } from './share-menu';
import { useSharingUrl } from './use-share-url';
@@ -98,6 +99,7 @@ export const AffineSharePage = (props: ShareMenuProps) => {
pageId,
urlType: 'share',
});
const baseUrl = useServerBaseUrl();
const t = useAFFiNEI18N();
const onClickCreateLink = useCallback(() => {
@@ -140,9 +142,13 @@ export const AffineSharePage = (props: ShareMenuProps) => {
lineHeight: '20px',
}}
value={
isSharedPage
? sharingUrl
: `${location.protocol}//${location.hostname}/...`
(isSharedPage && sharingUrl) ||
`${
baseUrl ||
`${location.protocol}${
location.port ? `:${location.port}` : ''
}//${location.hostname}`
}/...`
}
readOnly
/>
@@ -151,6 +157,7 @@ export const AffineSharePage = (props: ShareMenuProps) => {
onClick={onClickCopyLink}
data-testid="share-menu-copy-link-button"
style={{ padding: '4px 12px', whiteSpace: 'nowrap' }}
disabled={!sharingUrl}
>
{t.Copy()}
</Button>

View File

@@ -1,4 +1,5 @@
import { toast } from '@affine/component';
import { useServerBaseUrl } from '@affine/core/hooks/affine/use-server-config';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { useCallback, useMemo } from 'react';
@@ -10,22 +11,27 @@ type UseSharingUrl = {
urlType: UrlType;
};
export const generateUrl = ({
workspaceId,
pageId,
urlType,
}: UseSharingUrl) => {
// to generate a private url like https://affine.app/workspace/123/456
// to generate a public url like https://affine.app/share/123/456
// or https://affine.app/share/123/456?mode=edgeless
const useGenerateUrl = ({ workspaceId, pageId, urlType }: UseSharingUrl) => {
// to generate a private url like https://app.affine.app/workspace/123/456
// to generate a public url like https://app.affine.app/share/123/456
// or https://app.affine.app/share/123/456?mode=edgeless
const { protocol, hostname, port } = window.location;
const url = new URL(
`${protocol}//${hostname}${
port ? `:${port}` : ''
}/${urlType}/${workspaceId}/${pageId}`
);
return url.toString();
const baseUrl = useServerBaseUrl();
const url = useMemo(() => {
// baseUrl is null when running in electron and without network
if (!baseUrl) return null;
try {
return new URL(
`${baseUrl}/${urlType}/${workspaceId}/${pageId}`
).toString();
} catch (e) {
return null;
}
}, [baseUrl, pageId, urlType, workspaceId]);
return url;
};
export const useSharingUrl = ({
@@ -34,20 +40,21 @@ export const useSharingUrl = ({
urlType,
}: UseSharingUrl) => {
const t = useAFFiNEI18N();
const sharingUrl = useMemo(
() => generateUrl({ workspaceId, pageId, urlType }),
[workspaceId, pageId, urlType]
);
const sharingUrl = useGenerateUrl({ workspaceId, pageId, urlType });
const onClickCopyLink = useCallback(() => {
navigator.clipboard
.writeText(sharingUrl)
.then(() => {
toast(t['Copied link to clipboard']());
})
.catch(err => {
console.error(err);
});
if (sharingUrl) {
navigator.clipboard
.writeText(sharingUrl)
.then(() => {
toast(t['Copied link to clipboard']());
})
.catch(err => {
console.error(err);
});
} else {
toast('Network not available');
}
}, [sharingUrl, t]);
return {

View File

@@ -182,7 +182,7 @@ export const PageHeaderMenuButton = ({ rename, pageId }: PageMenuProps) => {
>
{t['Import']()}
</MenuItem>
<Export exportHandler={exportHandler} />
<Export exportHandler={exportHandler} pageMode={currentMode} />
{workspace.flavour === WorkspaceFlavour.AFFINE_CLOUD &&
runtimeConfig.enablePageHistory ? (

View File

@@ -1,4 +1,3 @@
import { styled } from '@affine/component';
import { Button } from '@affine/component/ui/button';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import type { ChangeEvent, PropsWithChildren } from 'react';
@@ -42,7 +41,7 @@ export const Upload = ({
}
return (
<UploadStyle onClick={_chooseFile}>
<div style={{ display: 'flex' }} onClick={_chooseFile}>
{children ?? <Button>{t['Upload']()}</Button>}
<input
ref={input_ref}
@@ -52,12 +51,6 @@ export const Upload = ({
accept={accept}
{...props}
/>
</UploadStyle>
</div>
);
};
const UploadStyle = styled('div')(() => {
return {
display: 'inline-block',
};
});

View File

@@ -17,13 +17,6 @@ export const deleteHintContainer = style({
gap: '16px',
backgroundColor: 'var(--affine-background-primary-color)',
borderTop: '1px solid var(--affine-border-color)',
selectors: {
'&[data-has-background="false"]': {
backgroundColor: 'transparent',
borderTop: 'none',
padding: '14px 0',
},
},
});
export const deleteHintText = style({
fontSize: '15px',

View File

@@ -97,9 +97,16 @@ const useSyncEngineSyncProgress = () => {
useEffect(() => {
setSyncEngineStatus(currentWorkspace.engine.sync.status);
const disposable = currentWorkspace.engine.sync.onStatusChange.on(
debounce(status => {
setSyncEngineStatus(status);
}, 500)
debounce(
status => {
setSyncEngineStatus(status);
},
300,
{
maxWait: 500,
trailing: true,
}
)
);
return () => {
disposable?.dispose();

View File

@@ -30,7 +30,7 @@ import { useAsyncCallback } from '@toeverything/hooks/affine-async-hooks';
import { useAtom, useAtomValue } from 'jotai';
import { nanoid } from 'nanoid';
import type { HTMLAttributes, ReactElement } from 'react';
import { forwardRef, useCallback, useEffect, useMemo } from 'react';
import { forwardRef, Suspense, useCallback, useEffect, useMemo } from 'react';
import { openWorkspaceListModalAtom } from '../../atoms';
import { useHistoryAtom } from '../../atoms/history';
@@ -218,7 +218,11 @@ export const RootAppSidebar = ({
rootOptions={{
open: openUserWorkspaceList,
}}
items={<UserWithWorkspaceList onEventEnd={closeUserWorkspaceList} />}
items={
<Suspense>
<UserWithWorkspaceList onEventEnd={closeUserWorkspaceList} />
</Suspense>
}
contentOptions={{
// hide trigger
sideOffset: -58,

View File

@@ -141,7 +141,7 @@ export function useRegisterBlocksuiteEditorCommands(
unsubs.push(
registerAffineCommand({
id: `editor:${mode}-export-to-pdf`,
preconditionStrategy,
preconditionStrategy: () => mode === 'page' && !trash,
category: `editor:${mode}`,
icon: mode === 'page' ? <PageIcon /> : <EdgelessIcon />,
label: t['Export to PDF'](),
@@ -167,7 +167,7 @@ export function useRegisterBlocksuiteEditorCommands(
unsubs.push(
registerAffineCommand({
id: `editor:${mode}-export-to-png`,
preconditionStrategy,
preconditionStrategy: () => mode === 'page' && !trash,
category: `editor:${mode}`,
icon: mode === 'page' ? <PageIcon /> : <EdgelessIcon />,
label: t['Export to PNG'](),

View File

@@ -9,7 +9,7 @@ const errorHandler: Middleware = useSWRNext => (key, fetcher, config) => {
return useSWRNext(key, wrappedFetcher.bind(null, fetcher), config);
};
export const useServerFlavor = () => {
const useServerConfig = () => {
const { data: config, error } = useQueryImmutable(
{ query: serverConfigQuery },
{
@@ -18,10 +18,20 @@ export const useServerFlavor = () => {
);
if (error || !config) {
return null;
}
return config.serverConfig;
};
export const useServerFlavor = () => {
const config = useServerConfig();
if (!config) {
return 'local';
}
return config.serverConfig.flavor;
return config.flavor;
};
export const useSelfHosted = () => {
@@ -29,3 +39,18 @@ export const useSelfHosted = () => {
return ['local', 'selfhosted'].includes(serverFlavor);
};
export const useServerBaseUrl = () => {
const config = useServerConfig();
if (!config) {
if (environment.isDesktop) {
// don't use window.location in electron
return null;
}
const { protocol, hostname, port } = window.location;
return `${protocol}//${hostname}${port ? `:${port}` : ''}`;
}
return config.baseUrl;
};

View File

@@ -1,15 +0,0 @@
'use client';
import { useMemo } from 'react';
export function useShareLink(workspaceId: string): string {
return useMemo(() => {
if (environment.isServer) {
throw new Error('useShareLink is not available on server side');
}
if (environment.isDesktop) {
return '???';
} else {
return origin + '/share/' + workspaceId;
}
}, [workspaceId]);
}

View File

@@ -2,7 +2,7 @@ import { type SubscriptionQuery, subscriptionQuery } from '@affine/graphql';
import { useQuery } from '@affine/workspace/affine/gql';
import { useAsyncCallback } from '@toeverything/hooks/affine-async-hooks';
import { useSelfHosted } from './affine/use-server-flavor';
import { useSelfHosted } from './affine/use-server-config';
export type Subscription = NonNullable<
NonNullable<SubscriptionQuery['currentUser']>['subscription']

View File

@@ -1,7 +1,8 @@
import { Menu } from '@affine/component/ui/menu';
import { WorkspaceFallback } from '@affine/component/workspace';
import { workspaceListAtom } from '@affine/workspace/atom';
import { useAtomValue } from 'jotai';
import { lazy, useEffect } from 'react';
import { lazy, useEffect, useLayoutEffect, useState } from 'react';
import { type LoaderFunction, redirect } from 'react-router-dom';
import { createFirstAppData } from '../bootstrap/first-app-data';
@@ -24,10 +25,14 @@ export const loader: LoaderFunction = async () => {
};
export const Component = () => {
// navigating and creating may be slow, to avoid flickering, we show workspace fallback
const [navigating, setNavigating] = useState(false);
const [creating, setCreating] = useState(false);
const list = useAtomValue(workspaceListAtom);
const { openPage } = useNavigateHelper();
useEffect(() => {
useLayoutEffect(() => {
if (list.length === 0) {
return;
}
@@ -36,14 +41,24 @@ export const Component = () => {
const lastId = localStorage.getItem('last_workspace_id');
const openWorkspace = list.find(w => w.id === lastId) ?? list[0];
openPage(openWorkspace.id, WorkspaceSubPath.ALL);
setNavigating(true);
}, [list, openPage]);
useEffect(() => {
createFirstAppData().catch(err => {
console.error('Failed to create first app data', err);
});
setCreating(true);
createFirstAppData()
.catch(err => {
console.error('Failed to create first app data', err);
})
.finally(() => {
setCreating(false);
});
}, []);
if (navigating || creating) {
return <WorkspaceFallback></WorkspaceFallback>;
}
// TODO: We need a no workspace page
return (
<>

View File

@@ -32,10 +32,10 @@
"@affine/sdk": "workspace:*",
"@affine/templates": "workspace:*",
"@affine/vue-hello-world-plugin": "workspace:*",
"@blocksuite/blocks": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/lit": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/presets": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/store": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/blocks": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/lit": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/presets": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/store": "0.11.0-nightly-202312220916-e3abcbb",
"@electron-forge/cli": "^7.2.0",
"@electron-forge/core": "^7.2.0",
"@electron-forge/core-utils": "^7.2.0",

View File

@@ -17,13 +17,14 @@ const affineCoreOutDir = path.join(affineCoreDir, 'dist');
const publicAffineOutDir = path.join(publicDistDir, `web-static`);
const releaseVersionEnv = process.env.RELEASE_VERSION || '';
console.log('build with following dir', {
console.log('build with following variables', {
repoRootDir,
electronRootDir,
publicDistDir,
affineSrcDir: affineCoreDir,
affineSrcOutDir: affineCoreOutDir,
publicAffineOutDir,
releaseVersionEnv,
});
// step 0: check version match

View File

@@ -24,7 +24,7 @@ export const mode = process.env.NODE_ENV;
export const isDev = mode === 'development';
const API_URL_MAPPING = {
stable: `https://insider.affine.pro`, // Let insider be stable environment temporarily.
stable: `https://app.affine.pro`,
beta: `https://insider.affine.pro`,
canary: `https://affine.fail`,
internal: `https://insider.affine.pro`,

View File

@@ -1,10 +1,16 @@
import { BrowserWindow, screen } from 'electron';
import { BrowserWindow, type Display, screen } from 'electron';
import { join } from 'path';
import { isMacOS } from '../shared/utils';
import { mainWindowOrigin } from './constants';
// import { getExposedMeta } from './exposed';
import { logger } from './logger';
const getScreenSize = (display: Display) => {
const { width, height } = isMacOS() ? display.bounds : display.workArea;
return { width, height };
};
// todo: not all window need all of the exposed meta
const getWindowAdditionalArguments = async () => {
const { getExposedMeta } = await import('./exposed');
@@ -15,11 +21,24 @@ const getWindowAdditionalArguments = async () => {
];
};
function fullscreenAndCenter(browserWindow: BrowserWindow) {
const position = browserWindow.getPosition();
const size = browserWindow.getSize();
const currentDisplay = screen.getDisplayNearestPoint({
x: position[0] + size[0] / 2,
y: position[1] + size[1] / 2,
});
if (!currentDisplay) return;
const { width, height } = getScreenSize(currentDisplay);
browserWindow.setSize(width, height);
browserWindow.center();
}
async function createOnboardingWindow(additionalArguments: string[]) {
logger.info('creating onboarding window');
// get user's screen size
const { width, height } = screen.getPrimaryDisplay().workAreaSize;
const { width, height } = getScreenSize(screen.getPrimaryDisplay());
const browserWindow = new BrowserWindow({
width,
@@ -36,6 +55,7 @@ async function createOnboardingWindow(additionalArguments: string[]) {
// skipTaskbar: true,
transparent: true,
hasShadow: false,
roundedCorners: false,
webPreferences: {
webgl: true,
preload: join(__dirname, './preload.js'),
@@ -56,12 +76,18 @@ async function createOnboardingWindow(additionalArguments: string[]) {
browserWindow.on('ready-to-show', () => {
// forcing zoom factor to 1 to avoid onboarding display issues
browserWindow.webContents.setZoomFactor(1);
fullscreenAndCenter(browserWindow);
// TODO: add a timeout to avoid flickering, window is ready, but dom is not ready
setTimeout(() => {
browserWindow.show();
}, 300);
});
// When moved to another screen, resize to fit the screen
browserWindow.on('moved', () => {
fullscreenAndCenter(browserWindow);
});
await browserWindow.loadURL(
`${mainWindowOrigin}${mainWindowOrigin.endsWith('/') ? '' : '/'}onboarding`
);

View File

@@ -655,6 +655,7 @@ query serverConfig {
serverConfig {
version
flavor
baseUrl
}
}`,
};

View File

@@ -2,5 +2,6 @@ query serverConfig {
serverConfig {
version
flavor
baseUrl
}
}

View File

@@ -2,4 +2,15 @@ export * from './fetcher';
export * from './graphql';
export * from './schema';
export * from './utils';
import '@affine/env/global';
import { setupGlobal } from '@affine/env/global';
setupGlobal();
export function getBaseUrl(): string {
if (environment.isDesktop) {
return runtimeConfig.serverUrlPrefix;
}
const { protocol, hostname, port } = window.location;
return `${protocol}//${hostname}${port ? `:${port}` : ''}`;
}

View File

@@ -632,6 +632,7 @@ export type ServerConfigQuery = {
__typename?: 'ServerConfigType';
version: string;
flavor: string;
baseUrl: string;
};
};

View File

@@ -20,12 +20,12 @@
"@affine/debug": "workspace:*",
"@affine/env": "workspace:*",
"@affine/workspace": "workspace:*",
"@blocksuite/block-std": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/blocks": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/global": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/lit": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/presets": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/store": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/block-std": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/blocks": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/global": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/lit": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/presets": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/store": "0.11.0-nightly-202312220916-e3abcbb",
"@testing-library/react": "^14.0.0",
"@toeverything/infra": "workspace:*",
"@types/image-blob-reduce": "^4.1.3",

View File

@@ -7,7 +7,7 @@ import type {
QueryVariables,
RecursiveMaybeFields,
} from '@affine/graphql';
import { gqlFetcherFactory } from '@affine/graphql';
import { getBaseUrl, gqlFetcherFactory } from '@affine/graphql';
import type { GraphQLError } from 'graphql';
import { useCallback, useMemo } from 'react';
import type { Key, SWRConfiguration, SWRResponse } from 'swr';
@@ -22,7 +22,7 @@ import useSWRMutation from 'swr/mutation';
setupGlobal();
export const fetcher = gqlFetcherFactory('/graphql');
export const fetcher = gqlFetcherFactory(getBaseUrl() + '/graphql');
/**
* A `useSWR` wrapper for sending graphql queries

View File

@@ -92,7 +92,7 @@ export class SyncEngine {
}
canGracefulStop() {
return !!this.status.local && this.status.local.pendingPushUpdates > 0;
return !!this.status.local && this.status.local.pendingPushUpdates === 0;
}
async waitForGracefulStop(abort?: AbortSignal) {

View File

@@ -76,6 +76,11 @@ export function createCloudAwarenessProvider(
removeAwarenessStates(awareness, [awareness.clientID], 'window unload');
};
function handleConnect() {
socket.emit('client-handshake-awareness', workspaceId);
socket.emit('awareness-init', workspaceId);
}
return {
connect: () => {
socket.on('server-awareness-broadcast', awarenessBroadcast);
@@ -86,16 +91,19 @@ export function createCloudAwarenessProvider(
socket.connect();
socket.on('connect', handleConnect);
socket.emit('client-handshake-awareness', workspaceId);
socket.emit('awareness-init', workspaceId);
},
disconnect: () => {
removeAwarenessStates(awareness, [awareness.clientID], 'disconnect');
awareness.off('update', awarenessUpdate);
socket.emit('client-leave-awareness', workspaceId);
socket.off('server-awareness-broadcast', awarenessBroadcast);
socket.off('new-client-awareness-init', newClientAwarenessInitHandler);
socket.off('connect', handleConnect);
window.removeEventListener('unload', windowBeforeUnloadHandler);
socket.disconnect();
},
};
}

View File

@@ -2,6 +2,7 @@ import {
checkBlobSizesQuery,
deleteBlobMutation,
fetchWithTraceReport,
getBaseUrl,
listBlobsQuery,
setBlobMutation,
} from '@affine/graphql';
@@ -21,7 +22,7 @@ export const createAffineCloudBlobStorage = (
? key
: `/api/workspaces/${workspaceId}/blobs/${key}`;
return fetchWithTraceReport(suffix).then(async res => {
return fetchWithTraceReport(getBaseUrl() + suffix).then(async res => {
if (!res.ok) {
// status not in the range 200-299
return null;

View File

@@ -51,8 +51,7 @@ export function createAffineStorage(
});
});
// TODO: handle error
socket.on('connect', () => {
function handleConnect() {
socket.emit(
'client-handshake-sync',
workspaceId,
@@ -62,10 +61,22 @@ export function createAffineStorage(
}
}
);
});
}
socket.on('connect', handleConnect);
socket.connect();
socket.emit(
'client-handshake-sync',
workspaceId,
(response: { error?: any }) => {
if (!response.error) {
syncSender.start();
}
}
);
return {
name: 'affine-cloud',
async pull(docId, state) {
@@ -124,14 +135,6 @@ export function createAffineStorage(
await syncSender.send(docId, update);
},
async subscribe(cb, disconnect) {
const response: { error?: any } = await socket
.timeout(10000)
.emitWithAck('client-handshake-sync', workspaceId);
if (response.error) {
throw new Error('client-handshake error, ' + response.error);
}
const handleUpdate = async (message: {
workspaceId: string;
guid: string;
@@ -157,7 +160,7 @@ export function createAffineStorage(
disconnect() {
syncSender.stop();
socket.emit('client-leave-sync', workspaceId);
socket.disconnect();
socket.off('connect', handleConnect);
},
};
}

View File

@@ -49,7 +49,8 @@ export class WorkspaceUpgradeController {
checkIfNeedUpgrade() {
const needUpgrade = !!checkWorkspaceCompatibility(
this.workspace.blockSuiteWorkspace
this.workspace.blockSuiteWorkspace,
this.workspace.flavour === WorkspaceFlavour.AFFINE_CLOUD
);
this.status = {
...this.status,
@@ -69,7 +70,8 @@ export class WorkspaceUpgradeController {
await this.workspace.engine.sync.waitForSynced();
const step = checkWorkspaceCompatibility(
this.workspace.blockSuiteWorkspace
this.workspace.blockSuiteWorkspace,
this.workspace.flavour === WorkspaceFlavour.AFFINE_CLOUD
);
if (!step) {

View File

@@ -9,5 +9,10 @@ describe('isSvgBuffer', () => {
expect(isSvgBuffer(Buffer.from('<svg></svg>'))).toBe(true);
expect(isSvgBuffer(Buffer.from(' \n\r\t<svg></svg>'))).toBe(true);
expect(isSvgBuffer(Buffer.from('<123>'))).toBe(false);
expect(
isSvgBuffer(
Buffer.from('<?xml version="1.0" encoding="UTF-8"?><svg></svg>')
)
).toBe(true);
});
});

View File

@@ -2,21 +2,25 @@ import { Manager } from 'socket.io-client';
let ioManager: Manager | null = null;
function getBaseUrl(): string {
if (environment.isDesktop) {
return runtimeConfig.serverUrlPrefix;
}
const { protocol, hostname, port } = window.location;
return `${protocol === 'https:' ? 'wss' : 'ws'}://${hostname}${
port ? `:${port}` : ''
}`;
}
// use lazy initialization socket.io io manager
export function getIoManager(): Manager {
if (ioManager) {
return ioManager;
}
const { protocol, hostname, port } = window.location;
ioManager = new Manager(
`${protocol === 'https:' ? 'wss' : 'ws'}://${hostname}${
port ? `:${port}` : ''
}/`,
{
autoConnect: false,
transports: ['websocket'],
secure: location.protocol === 'https:',
}
);
ioManager = new Manager(`${getBaseUrl()}/`, {
autoConnect: false,
transports: ['websocket'],
secure: location.protocol === 'https:',
});
return ioManager;
}

View File

@@ -1,7 +1,7 @@
import isSvg from 'is-svg';
function fastCheckIsNotSvg(buffer: Uint8Array) {
// check first non-whitespace character is not '<svg'
// check first non-whitespace character is not '<svg' or '<?xml'
for (let i = 0; i < buffer.length; i++) {
const ch = buffer[i];
@@ -18,11 +18,20 @@ function fastCheckIsNotSvg(buffer: Uint8Array) {
continue;
}
return !(
buffer[i] === /* '<' */ 0x3c &&
buffer[i + 1] === /* 's' */ 0x73 &&
buffer[i + 2] === /* 'v' */ 0x76 &&
buffer[i + 3] === /* 'g' */ 0x67
return (
!(
buffer[i] === /* '<' */ 0x3c &&
buffer[i + 1] === /* 's' */ 0x73 &&
buffer[i + 2] === /* 'v' */ 0x76 &&
buffer[i + 3] === /* 'g' */ 0x67
) &&
!(
buffer[i] === /* '<' */ 0x3c &&
buffer[i + 1] === /* '?' */ 0x3f &&
buffer[i + 2] === /* 'x' */ 0x78 &&
buffer[i + 3] === /* 'm' */ 0x6d &&
buffer[i + 4] === /* 'l' */ 0x6c
)
);
}

View File

@@ -5,7 +5,6 @@ import { type ReactElement, useCallback } from 'react';
import { openAIApiKeyAtom } from '../core/hooks';
import { conversationHistoryDBName } from '../core/langchain/message-history';
import * as styles from './index.css';
export const DebugContent = (): ReactElement => {
const [key, setKey] = useAtom(openAIApiKeyAtom);
@@ -13,7 +12,7 @@ export const DebugContent = (): ReactElement => {
<div>
<FlexWrapper justifyContent="space-between">
<Input
className={styles.debugContentInput}
style={{ width: 280 }}
defaultValue={key ?? undefined}
onChange={useCallback(
(newValue: string) => {

View File

@@ -41,7 +41,3 @@ export const sendButtonStyle = style({
backgroundColor: 'transparent',
},
});
export const debugContentInput = style({
width: '280px',
});

View File

@@ -9,10 +9,10 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine-test/kit": "workspace:*",
"@blocksuite/block-std": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/blocks": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/global": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/store": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/block-std": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/blocks": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/global": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/store": "0.11.0-nightly-202312220916-e3abcbb",
"@playwright/test": "^1.39.0",
"express": "^4.18.2",
"http-proxy-middleware": "^3.0.0-beta.1",

View File

@@ -9,10 +9,10 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine-test/kit": "workspace:*",
"@blocksuite/block-std": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/blocks": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/global": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/store": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/block-std": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/blocks": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/global": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/store": "0.11.0-nightly-202312220916-e3abcbb",
"@playwright/test": "^1.39.0",
"express": "^4.18.2",
"http-proxy-middleware": "^3.0.0-beta.1",

View File

@@ -9,10 +9,10 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine-test/kit": "workspace:*",
"@blocksuite/block-std": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/blocks": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/global": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/store": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/block-std": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/blocks": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/global": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/store": "0.11.0-nightly-202312220916-e3abcbb",
"@playwright/test": "^1.39.0",
"express": "^4.18.2",
"http-proxy-middleware": "^3.0.0-beta.1",

View File

@@ -9,10 +9,10 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine-test/kit": "workspace:*",
"@blocksuite/block-std": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/blocks": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/global": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/store": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/block-std": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/blocks": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/global": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/store": "0.11.0-nightly-202312220916-e3abcbb",
"@playwright/test": "^1.39.0",
"express": "^4.18.2",
"http-proxy-middleware": "^3.0.0-beta.1",

View File

@@ -7,10 +7,10 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine-test/kit": "workspace:*",
"@blocksuite/block-std": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/blocks": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/global": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/store": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/block-std": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/blocks": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/global": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/store": "0.11.0-nightly-202312220916-e3abcbb",
"@playwright/test": "^1.39.0"
},
"version": "0.11.0"

View File

@@ -107,6 +107,13 @@ const ThemeChange = () => {
};
localStorage.clear();
// do not show onboarding for storybook
window.localStorage.setItem(
'app_config',
'{"onBoarding":false, "dismissWorkspaceGuideModal":true}'
);
const store = createStore();
_setCurrentStore(store);
setup();

View File

@@ -31,14 +31,14 @@
"wait-on": "^7.2.0"
},
"devDependencies": {
"@blocksuite/block-std": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/blocks": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/global": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/block-std": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/blocks": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/global": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/icons": "2.1.36",
"@blocksuite/inline": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/lit": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/presets": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/store": "0.11.0-nightly-202312200102-8254dc9",
"@blocksuite/inline": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/lit": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/presets": "0.11.0-nightly-202312220916-e3abcbb",
"@blocksuite/store": "0.11.0-nightly-202312220916-e3abcbb",
"@dnd-kit/sortable": "^8.0.0",
"@tomfreudenberg/next-auth-mock": "^0.5.6",
"chromatic": "^9.1.0",

345
yarn.lock
View File

@@ -25,10 +25,10 @@ __metadata:
dependencies:
"@affine-test/fixtures": "workspace:*"
"@affine-test/kit": "workspace:*"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@playwright/test": "npm:^1.39.0"
express: "npm:^4.18.2"
http-proxy-middleware: "npm:^3.0.0-beta.1"
@@ -42,10 +42,10 @@ __metadata:
dependencies:
"@affine-test/fixtures": "workspace:*"
"@affine-test/kit": "workspace:*"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@playwright/test": "npm:^1.39.0"
express: "npm:^4.18.2"
http-proxy-middleware: "npm:^3.0.0-beta.1"
@@ -59,10 +59,10 @@ __metadata:
dependencies:
"@affine-test/fixtures": "workspace:*"
"@affine-test/kit": "workspace:*"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@playwright/test": "npm:^1.39.0"
express: "npm:^4.18.2"
http-proxy-middleware: "npm:^3.0.0-beta.1"
@@ -76,10 +76,10 @@ __metadata:
dependencies:
"@affine-test/fixtures": "workspace:*"
"@affine-test/kit": "workspace:*"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@playwright/test": "npm:^1.39.0"
express: "npm:^4.18.2"
http-proxy-middleware: "npm:^3.0.0-beta.1"
@@ -138,10 +138,10 @@ __metadata:
dependencies:
"@affine-test/fixtures": "workspace:*"
"@affine-test/kit": "workspace:*"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@playwright/test": "npm:^1.39.0"
languageName: unknown
linkType: soft
@@ -222,12 +222,12 @@ __metadata:
"@affine/graphql": "workspace:*"
"@affine/i18n": "workspace:*"
"@affine/workspace": "workspace:*"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/icons": "npm:2.1.36"
"@blocksuite/lit": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/presets": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/lit": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/presets": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@dnd-kit/core": "npm:^6.0.8"
"@dnd-kit/modifiers": "npm:^7.0.0"
"@dnd-kit/sortable": "npm:^8.0.0"
@@ -351,14 +351,14 @@ __metadata:
"@affine/templates": "workspace:*"
"@affine/workspace": "workspace:*"
"@aws-sdk/client-s3": "npm:3.433.0"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/icons": "npm:2.1.36"
"@blocksuite/inline": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/lit": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/presets": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/inline": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/lit": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/presets": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@dnd-kit/core": "npm:^6.0.8"
"@dnd-kit/sortable": "npm:^8.0.0"
"@emotion/cache": "npm:^11.11.0"
@@ -372,7 +372,7 @@ __metadata:
"@radix-ui/react-dialog": "npm:^1.0.4"
"@radix-ui/react-scroll-area": "npm:^1.0.5"
"@radix-ui/react-select": "npm:^2.0.0"
"@react-hookz/web": "npm:^23.1.0"
"@react-hookz/web": "npm:^24.0.0"
"@sentry/integrations": "npm:^7.83.0"
"@sentry/react": "npm:^7.83.0"
"@sentry/webpack-plugin": "npm:^2.8.0"
@@ -468,10 +468,10 @@ __metadata:
"@affine/sdk": "workspace:*"
"@affine/templates": "workspace:*"
"@affine/vue-hello-world-plugin": "workspace:*"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/lit": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/presets": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/lit": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/presets": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@electron-forge/cli": "npm:^7.2.0"
"@electron-forge/core": "npm:^7.2.0"
"@electron-forge/core-utils": "npm:^7.2.0"
@@ -520,8 +520,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "@affine/env@workspace:packages/common/env"
dependencies:
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
lit: "npm:^3.0.2"
react: "npm:18.2.0"
react-dom: "npm:18.2.0"
@@ -628,7 +628,7 @@ __metadata:
eslint-plugin-react-hooks: "npm:^4.6.0"
eslint-plugin-simple-import-sort: "npm:^10.0.0"
eslint-plugin-sonarjs: "npm:^0.23.0"
eslint-plugin-unicorn: "npm:^49.0.0"
eslint-plugin-unicorn: "npm:^50.0.0"
eslint-plugin-unused-imports: "npm:^3.0.0"
eslint-plugin-vue: "npm:^9.18.1"
fake-indexeddb: "npm:5.0.1"
@@ -711,11 +711,11 @@ __metadata:
version: 0.0.0-use.local
resolution: "@affine/sdk@workspace:packages/common/sdk"
dependencies:
"@blocksuite/block-std": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/presets": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/presets": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
jotai: "npm:^2.5.1"
vite: "npm:^5.0.6"
vite-plugin-dts: "npm:3.6.0"
@@ -840,14 +840,14 @@ __metadata:
dependencies:
"@affine/component": "workspace:*"
"@affine/i18n": "workspace:*"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/icons": "npm:2.1.36"
"@blocksuite/inline": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/lit": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/presets": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/inline": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/lit": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/presets": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@dnd-kit/sortable": "npm:^8.0.0"
"@storybook/addon-actions": "npm:^7.5.3"
"@storybook/addon-essentials": "npm:^7.5.3"
@@ -4077,29 +4077,29 @@ __metadata:
languageName: node
linkType: hard
"@blocksuite/block-std@npm:0.11.0-nightly-202312200102-8254dc9":
version: 0.11.0-nightly-202312200102-8254dc9
resolution: "@blocksuite/block-std@npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/block-std@npm:0.11.0-nightly-202312220916-e3abcbb":
version: 0.11.0-nightly-202312220916-e3abcbb
resolution: "@blocksuite/block-std@npm:0.11.0-nightly-202312220916-e3abcbb"
dependencies:
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
lz-string: "npm:^1.5.0"
w3c-keyname: "npm:^2.2.8"
zod: "npm:^3.22.4"
peerDependencies:
"@blocksuite/store": 0.11.0-nightly-202312200102-8254dc9
checksum: 223f704ad15e5473be1c2c617964e665dd05c278a3100e79618d5e194c7670fff20daf9652372fa8d6f9145b7f535862674d13bd443cad87dbe8f30da414c850
"@blocksuite/store": 0.11.0-nightly-202312220916-e3abcbb
checksum: bb1e7aae8310b09976af186566194eeae50d49518ada0571993d093afed029e8e1487258cc9fdc1b87b4961e05664408fbf7def2ffd01664bd80702481793eca
languageName: node
linkType: hard
"@blocksuite/blocks@npm:0.11.0-nightly-202312200102-8254dc9":
version: 0.11.0-nightly-202312200102-8254dc9
resolution: "@blocksuite/blocks@npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/blocks@npm:0.11.0-nightly-202312220916-e3abcbb":
version: 0.11.0-nightly-202312220916-e3abcbb
resolution: "@blocksuite/blocks@npm:0.11.0-nightly-202312220916-e3abcbb"
dependencies:
"@blocksuite/block-std": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/inline": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/lit": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/inline": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/lit": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@floating-ui/dom": "npm:^1.5.3"
"@toeverything/theme": "npm:^0.7.27"
"@types/hast": "npm:^3.0.3"
@@ -4133,16 +4133,16 @@ __metadata:
unified: "npm:^11.0.4"
webfontloader: "npm:^1.6.28"
zod: "npm:^3.22.4"
checksum: dcefc3b3309fc743b78a248acd4dc3cbe60a666ea747c4fadc370a60597ed35156d42310e5232c6ec806c7c4cffad6e130917e4051c14fd14b7a7ca9866775a0
checksum: 4d489d9b07240e10f395889cff888a0827d755be546dcc8a59394ac9562efadb18bc7af395d0fb64d31a14fda1582a0834a3f7f543ca3cfbf6ede063c1db02c7
languageName: node
linkType: hard
"@blocksuite/global@npm:0.11.0-nightly-202312200102-8254dc9":
version: 0.11.0-nightly-202312200102-8254dc9
resolution: "@blocksuite/global@npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global@npm:0.11.0-nightly-202312220916-e3abcbb":
version: 0.11.0-nightly-202312220916-e3abcbb
resolution: "@blocksuite/global@npm:0.11.0-nightly-202312220916-e3abcbb"
dependencies:
zod: "npm:^3.22.4"
checksum: a871324674b5b7b50753e66a95baefa2c4054f79a5dddcbea4572a780551ba75be93b44d0efde6c83662463acf9fdd860f20f7340dd0c5f3dd3abc8ef36d6e45
checksum: 90cadce741fe6917175848637fceddd90f8d18270ce95d92fd7c3035805e5add96dc363a20c6c1d89402f0d932ae0afcbba2d99afe65a624118b57cfdebcb13c
languageName: node
linkType: hard
@@ -4156,55 +4156,57 @@ __metadata:
languageName: node
linkType: hard
"@blocksuite/inline@npm:0.11.0-nightly-202312200102-8254dc9":
version: 0.11.0-nightly-202312200102-8254dc9
resolution: "@blocksuite/inline@npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/inline@npm:0.11.0-nightly-202312220916-e3abcbb":
version: 0.11.0-nightly-202312220916-e3abcbb
resolution: "@blocksuite/inline@npm:0.11.0-nightly-202312220916-e3abcbb"
dependencies:
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
zod: "npm:^3.22.4"
peerDependencies:
lit: ^3.0.2
yjs: ^13
checksum: 9cc1e7b7b965928362294962b97f5517259a01a8bed29fa8a51c837d35a9b6330cc1d0fcb372815e68945b12950e9230d452941065eed5cb1e332a60651e2844
checksum: 33f68338338981d43304e7408757ede7269bd5eb8be2fe92ec5e5a35dbbc20095fbec9bf26878d7e88484302bd4c466806bdc48c871c97aeab0c2d456fd062ab
languageName: node
linkType: hard
"@blocksuite/lit@npm:0.11.0-nightly-202312200102-8254dc9":
version: 0.11.0-nightly-202312200102-8254dc9
resolution: "@blocksuite/lit@npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/lit@npm:0.11.0-nightly-202312220916-e3abcbb":
version: 0.11.0-nightly-202312220916-e3abcbb
resolution: "@blocksuite/lit@npm:0.11.0-nightly-202312220916-e3abcbb"
dependencies:
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/inline": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/inline": "npm:0.11.0-nightly-202312220916-e3abcbb"
lit: "npm:^3.1.0"
peerDependencies:
"@blocksuite/block-std": 0.11.0-nightly-202312200102-8254dc9
"@blocksuite/store": 0.11.0-nightly-202312200102-8254dc9
checksum: e9cfbdebd24c20f69b6b9c9295a3da32a3b56f1b7ed535f72246cb17d9644794f097c134a409c1b21c055aed1468331ec99f4f85ebd373d0ab4a947210a9cc9c
"@blocksuite/block-std": 0.11.0-nightly-202312220916-e3abcbb
"@blocksuite/store": 0.11.0-nightly-202312220916-e3abcbb
checksum: af7835d4facd1e4a1339ec69a3069c0e49042d76a5af40cd5ad4763f845806b0c95b8464e2a26a74fe92397fd01e928ee30168e7dbbf86d111711c1c8f3503f4
languageName: node
linkType: hard
"@blocksuite/presets@npm:0.11.0-nightly-202312200102-8254dc9":
version: 0.11.0-nightly-202312200102-8254dc9
resolution: "@blocksuite/presets@npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/presets@npm:0.11.0-nightly-202312220916-e3abcbb":
version: 0.11.0-nightly-202312220916-e3abcbb
resolution: "@blocksuite/presets@npm:0.11.0-nightly-202312220916-e3abcbb"
dependencies:
"@blocksuite/block-std": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/lit": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/inline": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/lit": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@fal-ai/serverless-client": "npm:^0.7.3"
"@toeverything/theme": "npm:^0.7.27"
lit: "npm:^3.1.0"
openai: "npm:^4.20.1"
checksum: 19f45cdaaa68551be4682d76cf696726d18faa9892b20e79d616a83c6f1a259732446c70e5b221a7dcf70cd1a1f71ab63a1b2f546f460c767174cd3d4776df4d
checksum: c065ed1ac04eef103170650bdb81af7aca6d8f1b9d72253251397345d908c09e6daf78eed2a408b273caf3d109900ad84f4a60fc54fd6f7b062f93b5e23c92f4
languageName: node
linkType: hard
"@blocksuite/store@npm:0.11.0-nightly-202312200102-8254dc9":
version: 0.11.0-nightly-202312200102-8254dc9
resolution: "@blocksuite/store@npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store@npm:0.11.0-nightly-202312220916-e3abcbb":
version: 0.11.0-nightly-202312220916-e3abcbb
resolution: "@blocksuite/store@npm:0.11.0-nightly-202312220916-e3abcbb"
dependencies:
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/inline": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/inline": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@types/flexsearch": "npm:^0.7.3"
flexsearch: "npm:0.7.21"
idb-keyval: "npm:^6.2.1"
@@ -4217,7 +4219,7 @@ __metadata:
peerDependencies:
async-call-rpc: ^6
yjs: ^13
checksum: 0d64da33b8dd916638c10661fc1ed80812cb6dd5ff57c4866f34599164e94f2aa53a1a26a4d8fc5b2ad69984d846bc3c63e1024d2d90990b24d5512516ce6db5
checksum: fe615c626b412c5f48406a6617e950f55388e3253540cd02978e3155f3a573adc68539c3b521c40d04da7932eb8a73af30b8262cb34f478fb0b88bc0b28f9153
languageName: node
linkType: hard
@@ -5863,6 +5865,23 @@ __metadata:
languageName: node
linkType: hard
"@eslint/eslintrc@npm:^2.1.4":
version: 2.1.4
resolution: "@eslint/eslintrc@npm:2.1.4"
dependencies:
ajv: "npm:^6.12.4"
debug: "npm:^4.3.2"
espree: "npm:^9.6.0"
globals: "npm:^13.19.0"
ignore: "npm:^5.2.0"
import-fresh: "npm:^3.2.1"
js-yaml: "npm:^4.1.0"
minimatch: "npm:^3.1.2"
strip-json-comments: "npm:^3.1.1"
checksum: 7a3b14f4b40fc1a22624c3f84d9f467a3d9ea1ca6e9a372116cb92507e485260359465b58e25bcb6c9981b155416b98c9973ad9b796053fd7b3f776a6946bce8
languageName: node
linkType: hard
"@eslint/js@npm:8.54.0":
version: 8.54.0
resolution: "@eslint/js@npm:8.54.0"
@@ -5884,6 +5903,17 @@ __metadata:
languageName: node
linkType: hard
"@fal-ai/serverless-client@npm:^0.7.3":
version: 0.7.4
resolution: "@fal-ai/serverless-client@npm:0.7.4"
dependencies:
"@msgpack/msgpack": "npm:^3.0.0-beta2"
robot3: "npm:^0.4.1"
uuid-random: "npm:^1.3.2"
checksum: 2df2a3de60b637b2cfe57e08429f79e0ac7f604777f7e761839b28795be049e714f3f1f338c4fb35a18e575d4c58b82c7244680877adf5d83094ba6625de4851
languageName: node
linkType: hard
"@fal-works/esbuild-plugin-global-externals@npm:^2.1.2":
version: 2.1.2
resolution: "@fal-works/esbuild-plugin-global-externals@npm:2.1.2"
@@ -7373,6 +7403,13 @@ __metadata:
languageName: node
linkType: hard
"@msgpack/msgpack@npm:^3.0.0-beta2":
version: 3.0.0-beta2
resolution: "@msgpack/msgpack@npm:3.0.0-beta2"
checksum: d02f9221aa152cbd2977d1f56dc591baa2a37420a694cbc7e54ff0724f56ac0523e94de010e56bb845d67a1f2226c1761064b5777e63e9fc26884f4144d391a7
languageName: node
linkType: hard
"@mswjs/cookies@npm:^1.1.0":
version: 1.1.0
resolution: "@mswjs/cookies@npm:1.1.0"
@@ -11221,9 +11258,9 @@ __metadata:
languageName: node
linkType: hard
"@react-hookz/web@npm:^23.1.0":
version: 23.1.0
resolution: "@react-hookz/web@npm:23.1.0"
"@react-hookz/web@npm:^24.0.0":
version: 24.0.0
resolution: "@react-hookz/web@npm:24.0.0"
dependencies:
"@react-hookz/deep-equal": "npm:^1.0.4"
peerDependencies:
@@ -11233,7 +11270,7 @@ __metadata:
peerDependenciesMeta:
js-cookie:
optional: true
checksum: 7f345fc286ee3bae74b76b909898213a589250856783805d0356d8ef9ca0e3d1638e7499d8b77ae1dff6350dec230fda468e0e4c8fc05a9997902569d3d81b49
checksum: 85ec7ebecf3a69f098fecb89c1515ffd8c119f29a74521277df34af637059320669cf8ff6273063cec6a4c86cee4849e24fa8772191d08f81b2b88de69749670
languageName: node
linkType: hard
@@ -13726,12 +13763,12 @@ __metadata:
"@affine/debug": "workspace:*"
"@affine/env": "workspace:*"
"@affine/workspace": "workspace:*"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/lit": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/presets": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/block-std": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/lit": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/presets": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@testing-library/react": "npm:^14.0.0"
"@toeverything/infra": "workspace:*"
"@types/image-blob-reduce": "npm:^4.1.3"
@@ -13782,11 +13819,11 @@ __metadata:
"@affine/env": "workspace:*"
"@affine/sdk": "workspace:*"
"@affine/templates": "workspace:*"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/global": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/lit": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/presets": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/global": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/lit": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/presets": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@testing-library/react": "npm:^14.0.0"
async-call-rpc: "npm:^6.3.1"
electron: "link:../../frontend/electron/node_modules/electron"
@@ -13835,8 +13872,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "@toeverything/y-indexeddb@workspace:packages/common/y-indexeddb"
dependencies:
"@blocksuite/blocks": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/blocks": "npm:0.11.0-nightly-202312220916-e3abcbb"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
fake-indexeddb: "npm:^5.0.0"
idb: "npm:^8.0.0"
nanoid: "npm:^5.0.3"
@@ -17329,6 +17366,20 @@ __metadata:
languageName: node
linkType: hard
"browserslist@npm:^4.22.2":
version: 4.22.2
resolution: "browserslist@npm:4.22.2"
dependencies:
caniuse-lite: "npm:^1.0.30001565"
electron-to-chromium: "npm:^1.4.601"
node-releases: "npm:^2.0.14"
update-browserslist-db: "npm:^1.0.13"
bin:
browserslist: cli.js
checksum: e3590793db7f66ad3a50817e7b7f195ce61e029bd7187200244db664bfbe0ac832f784e4f6b9c958aef8ea4abe001ae7880b7522682df521f4bc0a5b67660b5e
languageName: node
linkType: hard
"bser@npm:2.1.1":
version: 2.1.1
resolution: "bser@npm:2.1.1"
@@ -17646,6 +17697,13 @@ __metadata:
languageName: node
linkType: hard
"caniuse-lite@npm:^1.0.30001565":
version: 1.0.30001570
resolution: "caniuse-lite@npm:1.0.30001570"
checksum: a9b939e003dd70580cc18bce54627af84f298af7c774415c8d6c99871e7cee13bd8278b67955a979cd338369c73e8821a10b37e607d1fff2fbc8ff92fc489653
languageName: node
linkType: hard
"capital-case@npm:^1.0.4":
version: 1.0.4
resolution: "capital-case@npm:1.0.4"
@@ -17971,7 +18029,7 @@ __metadata:
languageName: node
linkType: hard
"ci-info@npm:^3.2.0, ci-info@npm:^3.8.0":
"ci-info@npm:^3.2.0":
version: 3.9.0
resolution: "ci-info@npm:3.9.0"
checksum: 75bc67902b4d1c7b435497adeb91598f6d52a3389398e44294f6601b20cfef32cf2176f7be0eb961d9e085bb333a8a5cae121cb22f81cf238ae7f58eb80e9397
@@ -18787,6 +18845,15 @@ __metadata:
languageName: node
linkType: hard
"core-js-compat@npm:^3.34.0":
version: 3.34.0
resolution: "core-js-compat@npm:3.34.0"
dependencies:
browserslist: "npm:^4.22.2"
checksum: e29571cc524b4966e331b5876567f13c2b82ed48ac9b02784f3156b29ee1cd82fe3e60052d78b017c429eb61969fd238c22684bb29180908d335266179a29155
languageName: node
linkType: hard
"core-js-pure@npm:^3.23.3":
version: 3.33.3
resolution: "core-js-pure@npm:3.33.3"
@@ -20095,6 +20162,13 @@ __metadata:
languageName: node
linkType: hard
"electron-to-chromium@npm:^1.4.601":
version: 1.4.615
resolution: "electron-to-chromium@npm:1.4.615"
checksum: dbf9deb234cbd381a91f41f6c6729cc8b4bed9b1580d6aea589d689d5f2a8aadf88837ef6887e761c143a1e1015f5eb3ae1bd2728a3068fa6a235c16c0fd76ae
languageName: node
linkType: hard
"electron-updater@npm:^6.1.5":
version: 6.1.7
resolution: "electron-updater@npm:6.1.7"
@@ -20916,14 +20990,16 @@ __metadata:
languageName: node
linkType: hard
"eslint-plugin-unicorn@npm:^49.0.0":
version: 49.0.0
resolution: "eslint-plugin-unicorn@npm:49.0.0"
"eslint-plugin-unicorn@npm:^50.0.0":
version: 50.0.0
resolution: "eslint-plugin-unicorn@npm:50.0.0"
dependencies:
"@babel/helper-validator-identifier": "npm:^7.22.20"
"@eslint-community/eslint-utils": "npm:^4.4.0"
ci-info: "npm:^3.8.0"
"@eslint/eslintrc": "npm:^2.1.4"
ci-info: "npm:^4.0.0"
clean-regexp: "npm:^1.0.0"
core-js-compat: "npm:^3.34.0"
esquery: "npm:^1.5.0"
indent-string: "npm:^4.0.0"
is-builtin-module: "npm:^3.2.1"
@@ -20935,8 +21011,8 @@ __metadata:
semver: "npm:^7.5.4"
strip-indent: "npm:^3.0.0"
peerDependencies:
eslint: ">=8.52.0"
checksum: 7f73f41356cdf720675998c558ab13872d76302dde3a49661df0b5219fd328627e3d7e418aaa3e94cf8764d1ef8b606f7ea01f019eccc0bf0522def8e6769caa
eslint: ">=8.56.0"
checksum: 09d069bac3d4c7d3d3d4ddf8a9992718cd1acc6bbba99cfcb0fb581d9dd0d64378c55d6cc5579aadf23d199c53b539a4351446e0855b363c95e8926be15c95e6
languageName: node
linkType: hard
@@ -29033,6 +29109,13 @@ __metadata:
languageName: node
linkType: hard
"node-releases@npm:^2.0.14":
version: 2.0.14
resolution: "node-releases@npm:2.0.14"
checksum: 0f7607ec7db5ef1dc616899a5f24ae90c869b6a54c2d4f36ff6d84a282ab9343c7ff3ca3670fe4669171bb1e8a9b3e286e1ef1c131f09a83d70554f855d54f24
languageName: node
linkType: hard
"nodemailer@npm:^6.9.7":
version: 6.9.7
resolution: "nodemailer@npm:6.9.7"
@@ -32604,6 +32687,13 @@ __metadata:
languageName: node
linkType: hard
"robot3@npm:^0.4.1":
version: 0.4.1
resolution: "robot3@npm:0.4.1"
checksum: bab48cf0be9c26caeca0bb11a0c7abac813db67dd76c406cfd9ac828562c1cf504ce3775f87b157eb33ac62cda4763421513ecc6f2780266d19cc0f9590eb3bf
languageName: node
linkType: hard
"rollup-plugin-inject@npm:^3.0.0":
version: 3.0.2
resolution: "rollup-plugin-inject@npm:3.0.2"
@@ -35709,6 +35799,13 @@ __metadata:
languageName: node
linkType: hard
"uuid-random@npm:^1.3.2":
version: 1.3.2
resolution: "uuid-random@npm:1.3.2"
checksum: 9070c876651e1893f9255dddab2edc177ba34196660065be074050e4143405382b7f0f5fb922b666ebfd0794a6ef7b9f6acb627865df7b2978edb0da6b448f1d
languageName: node
linkType: hard
"uuid@npm:9.0.1, uuid@npm:^9.0.0, uuid@npm:^9.0.1":
version: 9.0.1
resolution: "uuid@npm:9.0.1"
@@ -36954,7 +37051,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "y-provider@workspace:packages/common/y-provider"
dependencies:
"@blocksuite/store": "npm:0.11.0-nightly-202312200102-8254dc9"
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
vite: "npm:^5.0.6"
vite-plugin-dts: "npm:3.6.0"
vitest: "npm:1.0.4"