Commit Graph

144 Commits

Author SHA1 Message Date
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