Commit Graph

245 Commits

Author SHA1 Message Date
Brooooooklyn
d8a3cd5ce2
chore: bump oxlint and rules (#6314) 2024-03-26 05:58:22 +00:00
pengx17
095f8c2359
fix: button should have its font-family inherited (#6311) 2024-03-26 03:57:59 +00:00
CatsJuice
b2f34d17a2
feat(core): adjust app sidebar's style (#6162) 2024-03-25 10:25:48 +00:00
EYHN
f2adbdaba4
style: enable import-x/no-duplicates (#6279) 2024-03-25 03:55:33 +00:00
Peng Xiao
dc8f351051
refactor(component): render react element into lit (#6124)
See docs in https://insider.affine.pro/share/af3478a2-9c9c-4d16-864d-bffa1eb10eb6/oL1ifjA4rKv7HRn5nYzIF

This PR also enables opening split view by ctrl-click a page link in a doc.
2024-03-18 07:04:02 +00:00
Fangdun Tsai
8301d82548
fix(core): sync list titles in sidebar (#6157) 2024-03-18 14:39:28 +08:00
Fangdun Tsai
636fa503b8
feat: support esc shortcut on input-edit (#6143) 2024-03-16 13:13:37 +00:00
Peng Xiao
e116a82c24
fix(component): an input display issue in confirm dialog (#6102)
fix the following issue of `input`

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/8a439fd1-3f96-46c3-9e8d-0449779b5c36.png)
2024-03-13 11:40:34 +00:00
Peng Xiao
9f74cb32ea
fix(component): input focus implementation (#6086) 2024-03-12 15:07:48 +00:00
liuyi
fb3a0e7b8f
refactor(server): auth (#5895)
Remove `next-auth` and implement our own Authorization/Authentication system from scratch.

## Server

- [x] tokens
  - [x] function
  - [x] encryption

- [x] AuthController
  - [x] /api/auth/sign-in
  - [x] /api/auth/sign-out
  - [x] /api/auth/session
  - [x] /api/auth/session (WE SUPPORT MULTI-ACCOUNT!)

- [x] OAuthPlugin
  - [x] OAuthController
  - [x] /oauth/login
  - [x] /oauth/callback
  - [x] Providers
    - [x] Google
    - [x] GitHub

## Client

- [x] useSession
- [x] cloudSignIn
- [x] cloudSignOut

## NOTE:

Tests will be adding in the future
2024-03-12 10:00:09 +00:00
Jason
fc9bf9cd8a
chore(component): simplify code (#6056) 2024-03-11 14:04:16 +08:00
EYHN
e9d51f6c96
fix(component): journal header button no responce (#6021) 2024-03-05 09:40:19 +00:00
EYHN
7c76c25a9c
refactor(core): new back&forward button base on workbench (#6012)
# feature:

## In Browser:
- hidden back&forward button in sidebar.
- back and forward is equal with `window.history.back()` `window.history.forward()`

## In Desktop:
- Back and forward can be controlled through the sidebar, cmdk, and shortcut keys.
- back and forward act on the currently **active** view.
- buttons change disable&enable style based on current active view history

# Refactor:

Move app-sidebar and app-container from @affine/component to @affine/core
2024-03-05 07:01:24 +00:00
EYHN
a9be19ce6c
fix(core): fix style break when scroll to block (#6001) 2024-03-04 11:43:10 +00:00
tzyoo
ee54e00a03
fix(core): upgrade dialog close button layout level (#6004) 2024-03-04 11:30:25 +00:00
Cats Juice
2275eee5b2
feat(core): resize and reorder split-view (#5994) 2024-03-04 11:19:39 +00:00
EYHN
c599715963
feat(core): split right sidebar (#5971)
https://github.com/toeverything/AFFiNE/assets/13579374/c846c069-aa32-445d-b59b-b773a9b05ced

Now each view has a general container, the yellow area is the general container part, and the green part is the routing specific part.

![CleanShot 2024-03-01 at 11.47.35@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/g3jz87HxbjOJpXV3FPT7/9a9f6ad6-2207-42e5-ae66-f7426bc9f3fc.png)
2024-03-04 06:42:12 +00:00
EYHN
de939bb6f6
fix(core): fix page mode scroll bar (#5955) 2024-03-01 04:46:15 +00:00
Peng Xiao
148807879b
refactor(component): use react-transition-state to simplify exit animation (#5923)
## **User description**
use react-transition-state to simplify exit animation

___

## **Type**
enhancement

___

## **Description**
- Integrated `react-transition-state` for managing animations in `ResizePanel` and `CMDKModal` components, simplifying the code and improving maintainability.
- Introduced a shared animation timeout variable to standardize animation durations across components.
- Added `react-transition-state` to dependencies to enable the new animation handling.

___

## **Changes walkthrough**
<table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
      <summary><strong>resize-panel.tsx</strong><dd><code>Integrate `react-transition-state` for Resize Panel Animations</code></dd></summary>
<hr>

packages/frontend/component/src/components/resize-panel/resize-panel.tsx

<li>Introduced <code>useTransition</code> hook from <code>react-transition-state</code> for managing <br>animations.<br> <li> Added a constant for animation timeout and applied it to the <br>transition.<br> <li> Utilized the transition state to toggle the open state of the resize <br>panel.<br>

</details>

  </td>
  <td><a href="https:/toeverything/AFFiNE/pull/5923/files#diff-a4d6e633862f63f97c167ff41ba62aff8aebf3e3b2f6e7ce13d5a0e22e8ff287">+12/-0</a>&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
      <summary><strong>modal.css.ts</strong><dd><code>Use Variable for Animation Timeout in Modal CSS</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

packages/frontend/core/src/components/pure/cmdk/modal.css.ts

<li>Created a variable for animation timeout.<br> <li> Updated animation durations to use the new timeout variable.<br>

</details>

  </td>
  <td><a href="https:/toeverything/AFFiNE/pull/5923/files#diff-ba8935611b9c1695153d92d08ecb0f7dac73a6197f54ccda5a6e791902cd651d">+6/-3</a>&nbsp; &nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
      <summary><strong>modal.tsx</strong><dd><code>Simplify CMDK Modal Animation with `react-transition-state`</code></dd></summary>
<hr>

packages/frontend/core/src/components/pure/cmdk/modal.tsx

<li>Replaced custom animation state management with <code>useTransition</code> hook.<br> <li> Removed old animation state logic and simplified the component.<br> <li> Added animation timeout variable and applied it to the transition.<br>

</details>

  </td>
  <td><a href="https:/toeverything/AFFiNE/pull/5923/files#diff-ab3fe66c9b1d3a691fafd1aebc9988e840fedfcd09b5b89570838a5a2a9469c9">+13/-33</a>&nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Dependencies</strong></td><td><table>
<tr>
  <td>
    <details>
      <summary><strong>package.json</strong><dd><code>Add `react-transition-state` Dependency</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

packages/frontend/core/package.json

- Added `react-transition-state` as a dependency.

</details>

  </td>
  <td><a href="https:/toeverything/AFFiNE/pull/5923/files#diff-23e0e5dc0ceb004a0a5d3d13e7d00545de7487535ca0e5eab4c5047f1e24eff0">+1/-0</a>&nbsp; &nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

>  **PR-Agent usage**:
>Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions
2024-02-27 14:55:33 +00:00
EYHN
606397e319
feat(core): workbench system (#5837) 2024-02-27 04:14:07 +00:00
JimmFly
0be62d892d
refactor(core): use custom scrollbar for editor and adjust shared page style (#5752)
Close TOV-481
- Use a custom scrollbar component for editor
- Modified the header of the share page and added a new footer
2024-02-26 08:54:52 +00:00
Peng Xiao
cc2d97e3b8
fix: right sidepanel open on focus (#5901)
fix TOV-614
Should not show sidepanel on focusing inner elemenets
2024-02-26 03:43:37 +00:00
JimmFly
4ea4a2d25f
feat(core): support create cloud workspace (#5771)
close TOV-475

has not logged:

https://github.com/toeverything/AFFiNE/assets/102217452/b9aa2806-7dbd-4235-895d-5b27effb5831

 has logged :

https://github.com/toeverything/AFFiNE/assets/102217452/259a1c35-c6ab-4a52-9e03-4438ca64e620

client has not logged:

https://github.com/toeverything/AFFiNE/assets/102217452/af6ef528-6fb8-4a27-842f-00c9669afcb2
2024-02-23 06:18:25 +00:00
Peng Xiao
bb8e601f82
feat(core): tags inline editor (#5748)
tags inline editor and some refactor

<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/T2klNLEk0wxLh4NRDzhk/439da1e3-30a9-462a-b7b4-c8e7c3b5ef17.mp4">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/T2klNLEk0wxLh4NRDzhk/439da1e3-30a9-462a-b7b4-c8e7c3b5ef17.mp4">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/439da1e3-30a9-462a-b7b4-c8e7c3b5ef17.mp4">Kapture 2024-01-31 at 23.29.11.mp4</video>

fix AFF-467
fix AFF-468
fix AFF-472
fix AFF-466
2024-02-22 09:37:50 +00:00
Peng Xiao
546d96c5c9
feat(core): workspace properties setting (#5739)
the property settings in workspace settings
2024-02-22 09:37:46 +00:00
Peng Xiao
d97304e9eb
feat(core): page info ui (#5729)
this PR includes the main table view in the page detail page
2024-02-22 05:58:15 +00:00
Cats Juice
67dffc2a5a
feat(component): remove react-datepicker (#5681) 2024-02-21 13:09:44 +00:00
Cats Juice
ed0d67ee56
fix(component): nowrap inline-edit (#5844) 2024-02-21 10:03:05 +00:00
Cats Juice
3fe9d834de
feat(core): replace page filter, journal's date-picker with new one (#5675) 2024-02-20 13:53:41 +00:00
Cats Juice
e664494b2f
refactor(component): new calendar-view DatePicker (#5654) 2024-02-20 13:53:37 +00:00
JimmFly
4068e7aeff
feat(core): add starAFFiNE and issueFeedback modal (#5718)
close TOV-482

https://github.com/toeverything/AFFiNE/assets/102217452/da1f74bc-4b8d-4d7f-987d-f53da98d92fe
2024-02-20 12:50:51 +00:00
Peng Xiao
7d951a975f
fix(core): replace most --affine with cssVar (#5728)
using a [babel plugin](https://gist.github.com/pengx17/49e24ae8a5a609bdaff122ee8c679d1c) to transform all var(--affine-xxx) to cssVar

Some issues:
- tried ast-grep but it seems to be not easy to add imports conditionally
- current work does not work well with ts with types because babel will strip them out
2024-02-01 09:33:11 +00:00
EYHN
329fc19852
refactor(infra): migrate to new infra (#5565) 2024-01-30 07:16:39 +00:00
Cats Juice
6ca2043697
feat(component): optimize week-date-picker keyboard navigation (#5684) 2024-01-26 07:05:19 +00:00
JimmFly
25897dc404
feat(workspace): add blob and storage limit (#5535)
close TOV-343 AFF-508 TOV-461 TOV-460 TOV-419

Add `isOverCapacity ` status to detect if blob usage exceeds limits.
Add `onCapacityChange` and `onBlobSet` to monitor if the storage or blob exceeds the capacity limit.
Global modals `LocalQuotaModal` and `CloudQuotaModal` have been added, with the upload size of the blob being limited within the modal components.
The notification component has been adjusted, now you can pass in `action` click events and `actionLabel` .
2024-01-24 07:34:51 +00:00
Cats Juice
6c8621bdcd
chore(core): bump @toeverything/theme, add cssVar use case (#5667) 2024-01-23 04:39:07 +00:00
Cats Juice
35e7b41ca8
fix(component): adjust the style of Switch to match the design (#5636)
closes #5635
2024-01-22 10:14:32 +00:00
Peng Xiao
f41b7d7e71
feat(component): react wrapper for blocksuite editor (#5606)
A React wrapper for blocksuite editor from title/meta/doc/edgless fragments.
This PR only **clones** the `AffineEditorContainer`'s existing behavior and make it easier for extension in affine later.

fix TOV-315

### Some core issues:

A customized version of `createComponent` from `@lit/react`. The [existing and solutions in the community](https://github.com/lit/lit/issues/4435) does not work well in our case.
Alternatively in this PR the approach we have is to create web component instances in React lifecycle and then append them to DOM. However this make it hard to wrap the exported Lit component's using React and therefore we will have an additional wrapper tag for the wrapped web component.

To mitigate the migration issue on using React instead of Lit listed on last day, we now use [a proxy to mimic the wrapped React component](https://github.com/toeverything/AFFiNE/pull/5606/files#diff-5b7f0ae7b52a08739d50e78e9ec803c26ff3d3e5437581c692add0de12d3ede5R142-R183) into an `AffineEditorContainer` instance.
2024-01-22 08:25:29 +00:00
JimmFly
353b27d796
refactor(component): adapt the questionnaire component to the desktop client (#5514)
close TOV-240

Windows desktop:
<img width="1145" alt="image" src="https://github.com/toeverything/AFFiNE/assets/102217452/6b12a6bd-c020-4d02-a366-e97e1afd1e10">

MacOS desktop:
<img width="1187" alt="image" src="https://github.com/toeverything/AFFiNE/assets/102217452/9a3c909c-b283-4ddc-a187-3db12b26a7f5">

Web:
<img width="1438" alt="image" src="https://github.com/toeverything/AFFiNE/assets/102217452/e8e04258-9275-470d-a3f8-5d18f5b29eb3">
2024-01-19 10:07:18 +00:00
Cats Juice
70ea1e5ef8
feat(core): journal sidebar dater-picker navigation (#5558) 2024-01-18 12:34:23 +00:00
Peng Xiao
9a944048e8
feat(core): experimental features ui (#5338)
fix TOV-280

experimental features ui
- enabled in the workspace settings for a cloud workspace; only show for workspace owner + early access
- a disclaimer prompt will be shown before going to the next feature setting page
- for now only show the ai poc switch, which controls the display of the ai tab in editor's sidepanel
2024-01-18 07:53:15 +00:00
Cats Juice
943ede4ffd
feat(component): new inline-edit component (#5517)
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://github.com/toeverything/AFFiNE/assets/39363750/6dad59f0-5e63-4c25-a81c-dff397da1d34">
  <img height="100" alt="" src="https://github.com/toeverything/AFFiNE/assets/39363750/7c30d7b2-55c9-49eb-82e7-a0882f2e0493">
</picture>
2024-01-18 03:33:47 +00:00
Cats Juice
2b92b27f8f
feat(component): new week-date-picker component (#5477)
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://github.com/toeverything/AFFiNE/assets/39363750/49d7a1ee-2832-4b61-a427-e627dae92952">
  <img height="100" alt="" src="https://github.com/toeverything/AFFiNE/assets/39363750/819d6ee9-38e0-4537-ad0f-ec9faf96f505">
</picture>
2024-01-18 02:14:27 +00:00
liuyi
b9f20877d0
feat(core): make password sigin default if user has one (#5577) 2024-01-17 11:13:58 +00:00
Cats Juice
2db3c933fa
refactor(component): move date-picker to ui, add story, support responsive (#5468)
- move to `component/ui`
- add `AFFiNEDatePicker` & `BlocksuiteDatePicker` story
- inline mode support
- responsive support
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://github.com/toeverything/AFFiNE/assets/39363750/320bef49-380f-40a2-b3b2-4b74dd2d8da4">
    <img  alt="" src="https://github.com/toeverything/AFFiNE/assets/39363750/fc9e7808-02fe-49a1-aa78-aea254fb1f9d">
  </picture>
2024-01-17 09:16:46 +00:00
Peng Xiao
238d1ad44e
fix(component): add back lottie color hack for dark mode (#5576)
Not sure why but it seems the changes in https://github.com/toeverything/AFFiNE/pull/4953 are lost
2024-01-16 08:11:51 +00:00
JimmFly
baeb5cc732
feat(core): get cloud workspace usage limit from user quota (#5518) 2024-01-16 07:57:23 +00:00
Lewis Liu
94e24d1b82
style: import from './index' instead of '.' (#5590)
Co-authored-by: LongYinan <lynweklm@gmail.com>
2024-01-16 14:39:08 +08:00
EYHN
5aee480c50
refactor(core): move page list to core (#5556) 2024-01-10 11:09:39 +00:00
Cats Juice
611c6e85bb
fix(component): app sidebar will never float when menu not opened (#5529) 2024-01-09 06:46:09 +00:00
JimmFly
7d886e44a6
feat(core): add cloud workspace member limit (#5500)
<img width="521" alt="image" src="https://github.com/toeverything/AFFiNE/assets/102217452/2cac78ef-07ed-4e06-b739-1279f913d0e1">
<img width="514" alt="image" src="https://github.com/toeverything/AFFiNE/assets/102217452/eed0db08-8550-4686-8ea1-251f1c4c7fee">
2024-01-03 14:57:27 +00:00
Peng Xiao
6cb62ed25d
feat: bump blocksuite (#5453)
Change history: https://github.com/toeverything/blocksuite/compare/e3abcbb...master
2024-01-03 02:10:19 +00:00
EYHN
6844b282ac
refactor(component): adjust active editor atom (#5457)
before:

set global `blocksuiteEditorAtom` state in `<BlocksuiteEditorImpl />`

after:

Rename `blocksuiteEditorAtom` to `activeBlocksuiteEditorAtom`

And move the logic of setting this atom to `<PageDetailEditor />`.

benefit:

* make BlocksuiteEditor pure
* keep @toeverything/component clear
* Clarify the purpose of `activeBlocksuiteEditorAtom`
2024-01-02 07:30:09 +00:00
EYHN
9d51f9596f
refactor(component): make component pure (#5427) 2023-12-28 09:57:26 +00:00
JimmFly
e11e8277ca
feat: add useBlocksuiteEditor hooks (#5366) 2023-12-28 08:36:36 +00:00
Cats Juice
7e75e19d04
style(core): add font smoothing and optimize legibility globally (#5417)
![Frame 629667](https://github.com/toeverything/AFFiNE/assets/39363750/857a2c8d-6a75-43b2-a92f-eaf24c996d8b)
2023-12-28 07:34:20 +00:00
Peng Xiao
0c64535e41
fix(infra): remove unused svg loader (#5398) 2023-12-27 09:00:37 +00:00
EYHN
4e861d8118
refactor(electron): create electron api package (#5334) 2023-12-27 06:38:37 +00:00
EYHN
7a770f9672
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 04:37:30 +00:00
JimmFly
f25814b31c
chore(core): add background color to questionnaire (#5396) 2023-12-26 07:13:44 +00:00
Peng Xiao
972de52833
fix(core): remove plugins settings (#5337)
depend on https://github.com/toeverything/AFFiNE/pull/5324
2023-12-26 06:21:59 +00:00
Joooye_34
46f824c4e9
fix: input style priority (#5383) 2023-12-22 15:48:28 +08:00
JimmFly
332a5c6685
chore(core): temporarily hide export png and pdf in edgeless (#5364) 2023-12-21 07:13:05 +00:00
EYHN
fcc3e9e069
feat(core): add syncing progress (#5356)
![CleanShot 2023-12-20 at 16.54.30@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/g3jz87HxbjOJpXV3FPT7/318a2d3c-14ea-48db-907a-881886d605e7.png)
2023-12-20 09:25:06 +00:00
DarkSky
33a589a8ba
feat: onboarding electron redirect (#5327) 2023-12-19 13:54:43 +00:00
DarkSky
8ea910a2bb
feat: onboarding page (#5277) 2023-12-19 13:54:41 +00:00
JimmFly
38617abc17
fix(component): fix incorrect input component width and height styling (#5292)
after:

https://github.com/toeverything/AFFiNE/assets/102217452/5d8f51c5-c7a6-4ec8-b2b0-7f1391f045c7
2023-12-19 08:27:46 +00:00
JimmFly
cef9e0539d
fix(storybook): fix test (#5325)
<img width="440" alt="image" src="https://github.com/toeverything/AFFiNE/assets/102217452/329f9c12-cc0b-4aae-9352-3811ab0a27a6">
2023-12-18 13:36:56 +00:00
EYHN
fe2851d3e9
refactor: workspace manager (#5060) 2023-12-15 07:20:50 +00:00
Yifeng Wang
af15aa06d4
feat: bump blocksuite (#5286)
Co-authored-by: donteatfriedrice <huisheng.chen7788@outlook.com>
2023-12-15 12:57:52 +08:00
Peng Xiao
63de73a815
fix: width blink in side bar (#5291) 2023-12-14 09:20:18 +00:00
Peng Xiao
098787bd0c
fix(core): collection modal position after modal style changes (#5289)
fix https://github.com/toeverything/AFFiNE/issues/5270
fix TOV-161
2023-12-13 08:14:55 +00:00
Peng Xiao
ce64685176
refactor(core): side bar resizing (#5280)
Rewrite sidebar panel using a customized react-resizable-panels version that supports sidebar pixel sizing (not using flex percentages).

Now the left & right sidebar using the same `ResizePanel` impl.

fix https://github.com/toeverything/AFFiNE/issues/5271
fix TOV-163
fix TOV-146
fix TOV-168
fix TOV-109
fix TOV-165
2023-12-13 07:52:01 +00:00
Peng Xiao
883ab46557
fix(core): bg color issues in transparent mode (#5278)
fix the following style issue
![CleanShot 2023-12-13 at 00.06.13@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/46f5e766-e6c9-4965-bab7-6fd6dbb2c651.png)
2023-12-13 07:14:24 +00:00
JimmFly
f4a52c031f
feat(core): support sidebar page item dnd (#5132)
Added the ability to drag page items from the `all pages` view to the sidebar, including `favourites,` `collection` and `trash`. Page items in `favourites` and `collection` can also be dragged between each other. However, linked subpages cannot be dragged.

Additionally, an operation menu and ‘add’ button have been provided for the sidebar’s page items, enabling the addition of a subpage, renaming, deletion or removal from the sidebar.

On the code front, the `useSidebarDrag` hooks have been implemented for consolidating drag events. The functions `getDragItemId` and `getDropItemId` have been created, and they accept type and ID to obtain itemId.

https://github.com/toeverything/AFFiNE/assets/102217452/d06bac18-3c28-41c9-a7d4-72de955d7b11
2023-12-12 16:04:58 +00:00
Flrande
9aa33d0228
feat: bump blocksuite (#5267)
Change history: 2b5bb47...2b3d2ba
2023-12-12 06:18:30 +00:00
Peng Xiao
cfd200528f
fix(component): revert theme flickering (#5238) (#5256)
This reverts commit e8cfc807ea.
2023-12-11 06:05:16 +00:00
Peng Xiao
5979162a5c
fix(component): theme flickering (#5238)
Add color-scheme to html so that the web will use system scheme when scripts has not being loaded;
Use `(prefers-color-scheme: dark)` so that the css vars do not defer load based on `data-theme`, which is set by next-themes (which is deferred).
2023-12-08 10:12:20 +00:00
Peng Xiao
fcd43033fe
fix(electron): sync settings from localStorage -> atom -> electron (#5020)
- moved `appSettingAtom` to infra since we now have different packages that depends on it. There is no better place to fit in for now
- use atomEffect to sync setting changes to updater related configs to Electron side
- refactored how Electron reacts to updater config changes.
2023-12-08 03:20:02 +00:00
Umar Faiz
453d4db713
fix: close font calt to avoid render twinkle (#4969) 2023-12-08 03:08:59 +00:00
Rakhee Singh
780ffd94dc
feat(core): added new filter for last n days (#5167)
Co-authored-by: rakhee28 <rakhee@strings.ai>
Co-authored-by: EYHN <cneyhn@gmail.com>
2023-12-08 11:08:15 +08:00
Peng Xiao
5352736eba
feat(component): new right sidebar (#5169)
Refactor AFFiNE layout to support new right sidebar.

The new layout:
![image](https://github.com/toeverything/AFFiNE/assets/584378/678a05f5-bd48-4dbe-ad78-7a0bcc979918)

**Highlights:**
- new sidebar UI/UX
- favoring top-down UI components that are composed by basic building blocks in each route, instead of creating universal component like `WorkspaceHeader` that renders every possible cases (which I think is really hard to maintain)
- remove plugin based solution

**Pros/cons for current plugin-based solution:**

The current solution is somewhat a Dependency Injection (DI) approach, where the layout is defined at the top and UI items can be injected using Jotai atom slots.
This approach works well if we want a fully configurable system with everything being handled by plugins. It provides flexibility for custom extensions.
However, this solution is more suitable for single-page applications where the UI is completely controlled by configuration. It becomes challenging to achieve an optimized and visually appealing UI that remains under our control. An example of such a scenario would be a customizable dashboard like Grafana.
Another drawback of the existing solution is that we need to use Jotai and hooks to access context values, resulting in an unclear data flow within the component hierarchy.

**Alternatively, our approach in this PR** provides layout building blocks such as headers and sidebars, which can then be composed in individual route components. The good is that we have cleaner biz component instead of vague all-in-one layout component (like `<WorkspaceHeader />`).

**Issues of the implementation in this PR:**
Some UI layouts that that seems to be defined at the root layout are now defined in individual route component instead.
New 3-col layout component like the right sidebar still needs some abstraction and they are right now just for the detail editor only.
2023-12-08 01:03:48 +00:00
Peng Xiao
ed8e526f71
fix(core): remove duplicate loading component (#5168) 2023-12-07 15:34:10 +00:00
Peng Xiao
352bb548f0
fix(core): update noise image (#5219)
seems https://github.com/toeverything/AFFiNE/pull/4946 not in latest canary.
2023-12-07 15:11:00 +00:00
JimmFly
7ec8e49b3b
feat(core): add responsive styles to registration page (#5044)
The responsive style of the login and registration page has been adjusted, with special treatment given to the input.
work for #4843
2023-12-06 10:43:14 +00:00
Yifeng Wang
6cbf5b2a92
feat: bump blocksuite (#5194)
Co-authored-by: AyushAgrawal-A2 <ayushagl06@gmail.com>
2023-12-06 18:15:03 +08:00
JimmFly
b32a427ecd
chore: adjust banner content text (#5153)
![image](https://github.com/toeverything/AFFiNE/assets/102217452/86a77f1f-1be5-4d05-bdfa-9e1b321c0d9e)
2023-12-06 08:13:56 +00:00
Peng Xiao
1e01ed0b0f
fix(component): modal blurness (#5177)
moved https://github.com/toeverything/design/pull/108

Do not use transform to center the modal. It has know issue to cause modal to have blurred texts.

https://github.com/radix-ui/website/issues/383

fix https://github.com/toeverything/AFFiNE/issues/5176
2023-12-05 09:18:49 +00:00
Cats Juice
1cd8de9d60
fix(component): clear page list operation's link style (#5148)
- before
  ![CleanShot 2023-12-01 at 12 03 24@2x](https://github.com/toeverything/AFFiNE/assets/39363750/6951ee61-d3c3-43b3-8949-fe6ed9ceb99e)
- after
  ![CleanShot 2023-12-01 at 12 08 02@2x](https://github.com/toeverything/AFFiNE/assets/39363750/2a85e5f7-9156-4aef-81a2-76d66a673ebd)
2023-12-05 07:01:42 +00:00
Cats Juice
d911d21d1c
feat(component): add storybook (#5079) 2023-12-04 08:32:19 +00:00
Cats Juice
9c50dbc362
feat(core): remove all imports from design/component (#5078)
feat(core): remove all imports from design/component

feat(plugin): remove imports from design-components

feat(storybook): remove design-components imoprts

feat(core): remove

fix(component): remove design/component import in local-demo-tip
2023-12-04 08:32:16 +00:00
Cats Juice
0abadbe7bb
refactor(component): migrate design components (#5000)
```[tasklist]
### Tasks
- [x] Migrate components from [design](https://github.com/toeverything/design)
- [x] Replace all imports from `@toeverything/components`
- [x] Clean up `@toeverything/components` dependencies
- [x] Storybook
```

### Influence

Here are all the components that are influenced by `@toeverything/components`

- `@affine/component`
    - App update `Button` `Tooltip`
    - App sidebar header `IconButton`, `Tooltip`
    - Back `Button`
    - Auth
      - Change email page save `Button`
      - Change password page all `Button`s (Save, Later, Open)
      - Confirm change email `Button`
      - Set password page `Button`
      - Sign in success page `Button`
      - Sign up page `Button`
      - Auth `Modal`
    - Workspace card `Avatar`, `Divider`, `Tooltip`, `IconButton`
    - Share
      - Disable shared public link `Modal`
    - Import page `IconButton`, `Tooltip`
    - Accept invite page `Avatar`, `Button`
    - Invite member `Modal`
    - 404 Page `Avatar`, `Button`, `IconButton`, `Tooltip`
    - Notification center `IconButton`
    - Page list
      - operation cell `IconButton`, `Menu`, `ConfirmModal`, `Tooltip`
      - tags more `Menu`
      - favorite `IconButton`, `Tooltip`
      - new page dropdown `Menu`
      - filter `Menu`, `Button`, `IconButton`
    - Page operation `Menu`
      - export `MenuItem`
      - move to trash `MenuItem`, `ConfirmModal`
    - Workspace header filter `Menu`, `Button`
    - Collection bar `Button`, `Tooltip` (*⚠️ seems not used*)
    - Collection operation `Menu`, `MenuItem`
      - Create collection `Modal`, `Button`
      - Edit collection `Modal`, `Button`
      - Page mode filter `Menu`
      - Page mode `Button`, `Menu`
    - Setting modal
      - storage usage progress `Button`, `Tooltip`
    - On boarding tour `Modal`
- `@affine/core`
  - Bookmark `Menu`
  - Affine error boundary `Button`
  - After sign in send email `Button`
  - After sign up send email `Button`
  - Send email `Button`
  - Sign in `Button`
  - Subscription redirect `Loading`, `Button`
  - Setting `Modal`
    - User plan button `Tooltip`
    - Members `Avatar`, `Button`, `IconButton`, `Loading`, `Tooltip`, `Menu`
    - Profile `Button`, `Avatar`
    - Workspace
      - publish panel `Button`, `Tooltip`
      - export panel `Button`
      - storage panel `Button`, `Tooltip`
      - delete `ConfirmModal`
    - Language `Menu`
    - Account setting `Avatar`, `Button`
    - Date format setting `Menu`
    - Billing `Button`, `IconButton`, `Loading`
    - Payment plans `Button`, `ConfirmModal`, `Modal`, `Tooltip`
  - Create workspace `Modal`, `ConfirmModal`, `Button`
  - Payment disabled `ConfirmModal`
  - Share/Export `Menu`, `Button`, `Divider`
  - Sign out `ConfirmModal`
  - Temp disable affine cloud `Modal`
  - Page detail operation `Menu`
  - Blocksuite mode switch `Tooltip`
  - Login card `Avatar`
  - Help island `Tooltip`
- `plugin`
  - copilot
  - hello world
  - image preview
  - outline
2023-12-04 08:32:12 +00:00
Joooye_34
eb7d293aaa
fix(core): implement editor timeout and report error from boundary (#5105) (#5151)
fix(core): implement editor timeout and report error from boundary (#5105)

ci: add sentry env when frontend assets build (#5131)

fix(core): expose catched editor load error (#5133)

fix(infra): use blocksuite api to check compatibility (#5137)

fix(infra): compatibility logic follow blocksuite (#5143)

fix(core): rerender error boundary when route change and improve sentry report (#5147)
2023-12-01 07:25:08 +00:00
JimmFly
3e662f358d
fix(core): adjust ui styles (#5094) 2023-11-30 12:23:57 +08:00
JimmFly
23518cae16
feat(core): add manual check for updates (#4957)
work for #4523

add `appBuildType` to `runtimeConfig`
add `useAppUpdater` to manage client updates

<!--
copilot:summary
-->
### <samp>🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset) Generated by Copilot at cdd012c</samp>

This pull request refactors and enhances the update functionality for the frontend. It introduces a new custom hook `useAppUpdater` that simplifies the update logic and state management, and uses it in various components and commands. It also adds more options and feedback for the user to control and monitor the update process, such as manual download, auto-check, and auto-download toggles, and update status and progress indicators. It also updates the `AboutAffine` component to show the app icon, version, and build type. It also adds new translations, dependencies, types, and schemas related to the update functionality.

<img width="1073" alt="image" src="https://github.com/toeverything/AFFiNE/assets/102217452/16ae7a6a-0035-4e57-902b-6b8f63169501">
2023-11-29 13:31:25 +00:00
LongYinan
7a7cbc45d7
fix: add prefer-readonly rule (#5122) 2023-11-29 15:19:00 +08:00
LongYinan
e9ea67bd38
fix: add prefer-for-of rule (#5121) 2023-11-29 15:18:52 +08:00
LongYinan
cb2c659f52
fix: add no-new-array rule (#5117) 2023-11-29 04:44:06 +00:00
LongYinan
4dddbbdaee
fix: add prefer-dom-node-remove rule (#5112) 2023-11-29 04:43:51 +00:00
LongYinan
23cfc58fe2
fix: add prefer-dom-node-append rule (#5108) 2023-11-29 04:43:39 +00:00
LongYinan
923844f302
fix: add eqeqeq lint rule (#5106) 2023-11-29 04:43:31 +00:00
LongYinan
a843dcd851
fix: resolve cycle imports and prevent it by oxlint (#5103) 2023-11-29 04:43:27 +00:00
JimmFly
469a18f794
feat(component): default collapse and float sidebar on mobile (#5077)
work for #4843

https://github.com/toeverything/AFFiNE/assets/102217452/c658dbab-4db8-4065-a3a6-3e20274b6cb9
2023-11-29 02:12:13 +00:00
Peng Xiao
3891f23dfa
fix(component): rework tags list collapsing (#5072)
Before:

![CleanShot 2023-11-27 at 16.39.55@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/2ac2b8e3-6c30-41f7-a9b2-7a9c81b250fa.png)

After:
![CleanShot 2023-11-27 at 16.38.50@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/12eac806-e641-45be-9215-d166f8733db9.png)
2023-11-27 09:56:25 +00:00
DarkSky
f04ec50d12
feat: optional payment for frontend (#5056) 2023-11-25 15:15:44 +00:00
JimmFly
ad2d3b9167
feat(core): add download app button to web (#5023) 2023-11-23 14:33:25 +08:00
LongYinan
3499dbbb7f
feat: upgrade dependencies and lockfile (#5016)
- Close https://github.com/toeverything/AFFiNE/security/dependabot/47
2023-11-23 05:18:05 +00:00
Peng Xiao
ca07b143ef
fix(core): should not reset page preset on rerender (#5034)
Should not reset editor preset when re-render.

See ce7ac88fc7/packages/editor/src/components/editor-container.ts (L197). If these props changes, it will trigger some unexpected side effects.
2023-11-22 18:29:34 +00:00
LongYinan
7f09652cca
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-20 11:04:39 +08:00
Cats Juice
57d42bf491
refactor(core): remove all MUI related components and utilities (#4941) 2023-11-20 10:51:28 +08:00
JimmFly
9bab1b5dff
feat(core): keep the latest toast showing when multiple call (#4961) 2023-11-20 10:47:09 +08:00
Cats Juice
ce7a691eef
fix(component): stack notification cards expand animation (#4962) 2023-11-18 00:32:06 +08:00
JimmFly
ce2eeeffbe
feat(i18n): update translation (#4923) 2023-11-17 17:39:33 +08:00
JimmFly
ddd7cab414
feat(core): support share edgeless mode (#4856)
Close #3287

<!--
copilot:all
-->
### <samp>🤖 Generated by Copilot at d3fdf86</samp>

### Summary
📄🚀🔗

<!--
1.  📄 - This emoji represents the page and edgeless modes of sharing a page, as well as the GraphQL operations and types related to public pages.
2.  🚀 - This emoji represents the functionality of publishing and revoking public pages, as well as the confirmation modal and the notifications for the user.
3.  🔗 - This emoji represents the sharing URL and the query parameter for the share mode, as well as the hooks and functions that generate and use the URL.
-->
This pull request adds a feature to the frontend component of AFFiNE that allows the user to share a page in either `page` or `edgeless` mode, which affects the appearance and functionality of the page. It also adds the necessary GraphQL operations, types, and schema to support this feature in the backend, and updates the tests and the storybook stories accordingly.

*  Modify the `useIsSharedPage` hook to accept an optional `shareMode` argument and use the `getWorkspacePublicPagesQuery`, `publishPageMutation`, and `revokePublicPageMutation` from `@affine/graphql`
2023-11-15 16:02:58 +08:00
Peng Xiao
9ac8a32e00
perf(component): use png instead of svg for rendering noise svg (#4935) 2023-11-14 23:03:19 +08:00
Peng Xiao
76b585d1ef
fix(storybook): page tags display (#4924) 2023-11-14 09:45:12 +08:00
Joooye_34
30bac7dce2
ci(core): eslint errors for core (#4662) 2023-11-10 10:25:59 +00:00
fourdim
af7d331610
feat(core): add global loading state (#4840) 2023-11-10 03:25:05 +00:00
JimmFly
1fe5a0fffa
feat(core): auto select block when jump to block (#4858)
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
2023-11-10 03:02:56 +00:00
Peng Xiao
d0b014543c
fix(core): select all in page list group header does not need to enable selection (#4869) 2023-11-09 12:01:36 +00:00
Joooye_34
af72bf0f69
feat(core): support signup set password before goto stripe payment url (#4892) 2023-11-09 11:58:16 +00:00
Peng Xiao
ad82376890
chore: update delete icon (#4871) 2023-11-09 02:49:48 +00:00
EYHN
b7edaab387
chore: fix code style issues (#4857) 2023-11-08 05:51:08 +00:00
3720
08e7fa3486
fix(core): improve the UX for edit collection (#4827)
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
2023-11-07 10:18:56 +00:00
JimmFly
9664d142ad
feat(core): temporary expansion files are limited to 100M (#4833) 2023-11-06 06:38:46 +00:00
Cats Juice
3c4dbed16b
fix(core): payment UI fix (#4839) 2023-11-06 02:40:52 +00:00
Joooye_34
97db941749
fix(core): remove responsive editor width (#4821) 2023-11-03 04:47:51 +00:00
Cats Juice
de33967a73
fix(component): flex setting-modal header & footer (#4818) 2023-11-02 15:11:20 +00:00
Peng Xiao
65321e39cc
refactor(component): virtual rendering page list (#4775)
Co-authored-by: Joooye_34 <Joooye1991@gmail.com>
2023-11-02 14:21:01 +00:00
3720
7068d5f38a
feat(core): remove mode and pages field from Collection (#4817) 2023-11-02 10:47:43 +00:00
Hongtao Lye
15024c6c8a
chore: bump blocksuite (#4801) 2023-11-02 09:12:23 +00:00
3720
e5be570f54
fix(core): text color of search input, style for the multi-select tag, date-picker autofocus issue (#4799) 2023-11-01 09:28:00 +00:00
JimmFly
97d189f1c8
fix(component): adjust autofill style (#4773) 2023-10-31 15:30:35 +00:00
Peng Xiao
f08408ebe5
fix(core): possible crash issues (#4783) 2023-10-31 08:56:14 +00:00
Peng Xiao
9e3c79526c
fix(core): selectAtom crash on isEqual (#4780) 2023-10-31 03:29:18 +00:00
zzj3720
f23ec9063c
feat(collections): completion i18n 2023-10-30 17:06:59 +08:00
DarkSky
95c1a44a0d
Merge branch 'master' into payment-system 2023-10-30 01:55:51 -05:00
3720
ef8024c657
feat: new collections (#4530)
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
2023-10-27 09:06:59 +00:00
Joooye_34
385de7d33b Merge remote-tracking branch 'origin/master' into payment-system 2023-10-27 16:04:48 +08:00
JimmFly
e0f7ac426c
feat(core): add translation key for payment (#4723) 2023-10-26 16:15:12 +08:00
JimmFly
df69c908fe
feat(core): adapt storage progress to payment system (#4713) 2023-10-25 16:18:30 +08:00
JimmFly
5226d6c568
feat(core): add search result highlighting (#4667)
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
2023-10-24 05:54:37 +00:00
liuyi
858a1da35f
feat(core): impl billing settings (#4652) 2023-10-24 11:40:46 +08:00
Peng Xiao
817463c40e
feat(component): checkbox (#4665) 2023-10-20 03:46:44 +00:00
Joooye_34
bed9310519
refactor(infra): directory structure (#4615) 2023-10-18 15:30:08 +00:00