Commit Graph

130 Commits

Author SHA1 Message Date
Peng Xiao c8f418f9c5 fix: use sgtpooki/file-type for resolving image type (#7326) 2024-06-27 10:08:08 +00:00
Cats Juice fa2305b0e2 feat(core): replace all radio-button-group usage (#7352) 2024-06-27 17:54:30 +08:00
pengx17 81462fe000 refactor(core): view transition api for peek-view modal animation (#7350)
Remaining issue:
modal controls' position is not relatively moved to the parent container during transitioning.
2024-06-27 08:38:16 +00:00
Fangdun Tsai a5662e3de2 fix(core): optimize request chat cards fn (#7331) 2024-06-26 23:50:45 +08:00
pengx17 7baa260e97 refactor(core): image block use peek view workflow (#7329)
depends on https://github.com/toeverything/blocksuite/pull/7424
2024-06-26 07:49:25 +00:00
EYHN ad746b6376 fix(core): fix error overflow (#7335) 2024-06-26 07:25:29 +00:00
akumatus 4df334bfdb fix: cannot read properties of undefined editor.host (#7333)
Fix issue [BS-657](https://linear.app/affine-design/issue/BS-657).

Unable to obtain `editor.host` synchronously on `editor` reference callback. Maybe we should have a separate host reference callback. @pengx17

![截屏2024-06-26 11.58.54.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/7d442ce3-86c9-4f4d-85c5-000d923702b6.png)
2024-06-26 06:31:25 +00:00
EYHN 2d74e4c340 fix(core): fix the page loading style (#7336) 2024-06-26 06:20:20 +00:00
fundon a92515b5aa fix(core): ai chat opening and append card (#7322)
Closes: [BS-642](https://linear.app/affine-design/issue/BS-642/continue-with-ai-:-侧边栏关闭的情况下,先唤起-侧边栏,同时插入选中的内容)

https://github.com/toeverything/AFFiNE/assets/27926/3022d808-d560-4bc8-8a04-735b76056121
2024-06-25 15:56:44 +00:00
pengx17 f51da066a8 refactor: image preview component issues in center peek (#7313)
fix AF-948

- remove jotai
- every editor got its own image block modal
- image block uses center peek modal for animation and style
2024-06-25 07:34:18 +00:00
CatsJuice b38c46649f feat(core): adjust ai help island style and behavior, add animation (#7310)
- Move right-sidebar activeTab state into `RightSidebarService`
- Remove `styled` usage and adjust the UI
- Fix the issue that ai-button clicking not work when sidebar opened
- Add an animation if AI-Chat panel hasn't been opened.

![CleanShot 2024-06-24 at 18.10.27.gif](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/LakojjjzZNf6ogjOVwKE/14c86fbc-ad4c-44bf-93fe-ca3450db908b.gif)
2024-06-24 14:37:38 +00:00
pengx17 2482c3c266 fix(electron): center peek for links in electron (#7301) 2024-06-21 09:27:13 +00:00
forehalo 7b3673ae82 chore: assign todos (#7297) 2024-06-21 07:54:14 +00:00
pengx17 e085b927f6 feat(core): peek view api enhancements (#7288)
upstream https://github.com/toeverything/blocksuite/pull/7390
fix AF-917
2024-06-21 07:38:42 +00:00
fundon 92be6b2ff7 fix(core): open ai chat for first time (#7291)
There are two issues here:

1. open right sidebar with chat
2. notify chat-panel of selected content

The second issue will be fixed in a subsequent PR.
2024-06-21 10:32:34 +08:00
CatsJuice 1fdfa834a0 feat(core): responsive detail page header (#7263) 2024-06-20 05:47:43 +00:00
EYHN b4212d54ed chore(core): delete center peek feature flag (#7281) 2024-06-20 04:24:47 +00:00
regischen ddf72733e1 feat: add ai-is-land (#7259) 2024-06-20 02:52:14 +00:00
EYHN 7c0a686cd9 refactor(i18n): new hook api (#7273)
# NEW HOOK API

`useI18n`: same as `useAFFiNEI18N`, with additional APIs

```ts
import { useI18n } from '@affine/i18n'

const i18n = useI18n()
i18n['hello world']() -> 你好世界
```

# NEW GLOBAL i18n Instance

`I18n`: use i18n capabilities outside of React

```ts
import { I18n } from '@affine/i18n'

I18n['hello world']() -> 你好世界
```

# NEW TYPES

`I18nKeys` -> all i18n keys

`I18nString` -> An i18n message (key&options)
transfer and store i18n text outside of React
```ts
const msg: I18nString = {
  key: 'helloworld',
  options: {
    arg1: '123'
  }
}

I18n.t(msg) -> 你好世界123
```

before:

```ts
registerCommand('open-page', {
  name: t('command.open-page')
  // ^- translation happens here,
})
```

after:

```ts
registerCommand('open-page', {
  name: { key: 'command.open-page' }
  // ^- store I18nString here, translate when the command render to UI
})
```
2024-06-20 02:19:41 +00:00
CatsJuice 98e35384a6 feat(component): helper function observeResize to observe size change via global ResizeObserver (#7241)
```ts
import { observeResize } from "@affine/component";

useEffect(() => {
  const dispose = observeResize(element entry => {
    console.log(entry.contentRect);
  });

  return () => dispose();
}, []);
```
2024-06-19 09:04:56 +00:00
EYHN bcc66422fd refactor(i18n): i18n utils tools (#7251) 2024-06-19 07:38:20 +00:00
doouding 314fa064ab fix: peek view on synced doc (#7265) 2024-06-19 06:41:08 +00:00
L-Sun 09201d42a0 chore: bump up @blocksuite/icons version (#7233) 2024-06-18 17:07:11 +08:00
JimmFly ea718d30e9 refactor(core): replace the Modal of the FindInPage component with Dialog (#7149)
In order to customize the opening and closing styles, the Modal were replaced.

https://github.com/toeverything/AFFiNE/assets/102217452/ece774ea-634c-4723-bace-7926f003497c
2024-06-18 07:46:22 +00:00
L-Sun b3ec3a2b3e refactor(core): migrate ai preset to AFFiNE (#7219)
## TL;DR
Move `@blocksuite/presets/ai` to AFFiNE. After this PR is merged, you can use AI features from `@affine/core/blocksuite/presets/ai`.
2024-06-18 07:31:06 +00:00
L-Sun 9b89c9ed38 chore: bump up blocksuite version (#7243)
## Features
- https://github.com/toeverything/BlockSuite/pull/7330 @CatsJuice
- https://github.com/toeverything/BlockSuite/pull/7348 @zzj3720

## Bugfix
- https://github.com/toeverything/BlockSuite/pull/7338 @akumatus
- https://github.com/toeverything/BlockSuite/pull/7353 @Saul-Mirone
- https://github.com/toeverything/BlockSuite/pull/7351 @lawvs
- https://github.com/toeverything/BlockSuite/pull/7357 @L-Sun
- https://github.com/toeverything/BlockSuite/pull/7355 @akumatus

## Misc
- https://github.com/toeverything/BlockSuite/pull/7352 @L-Sun
- https://github.com/toeverything/BlockSuite/pull/7349 @pengx17
2024-06-18 04:29:55 +00:00
pengx17 006c260e5f feat: add isNewDoc flag to quick search api (#7232) 2024-06-18 04:07:55 +00:00
liuyi 54fc1197ad feat(server): introduce user friendly server errors (#7111) 2024-06-17 11:30:58 +08:00
akumatus 24cb0d3757 refactor: add docsService for blocksuite to change and observe doc mode (#7200)
This PR provide `DocModeService` to manage document mode, which is used by blocksuite.

### What Changed?
- Add document mode apis from `DocService` and `DocsService`
- Remove useless `pageService.getEditorMode` and `pageService.slots.editorModeSwitch` api

[Related PR in blocksuite](https://github.com/toeverything/blocksuite/pull/7288)

[Bump Blocksuite](https://github.com/toeverything/AFFiNE/pull/7209)
> ## Features
> * [feat(presets): support different tracker control for actions blocksuite#7285](https://github.com/toeverything/blocksuite/pull/7285) @donteatfriedrice
> * [feat(edgeless): add default color and editing border for edgeless text blocksuite#7278](https://github.com/toeverything/blocksuite/pull/7278) @Flrande
> * [feat(blocks): center peek entries blocksuite#7275](https://github.com/toeverything/blocksuite/pull/7275) @pengx17
>
> ## Bugfix
> * [fix(blocks): affine-embed-synced-doc-block peek on dblclick blocksuite#7284](https://github.com/toeverything/blocksuite/pull/7284) @pengx17
> * [fix(edgeless): edgeless text rect should automatically update when changing font blocksuite#7292](https://github.com/toeverything/blocksuite/pull/7292) @Flrande
> * [fix(edgeless): align panel not work blocksuite#7293](https://github.com/toeverything/blocksuite/pull/7293) @Flrande
> * [fix(blocks): filterable list unexpected hover style blocksuite#7291](https://github.com/toeverything/blocksuite/pull/7291) @golok727
> * [fix(blocks): slash menu unexpected hover style blocksuite#7290](https://github.com/toeverything/blocksuite/pull/7290) @golok727
> * [fix(blocks): bookmark block error on undo or delete while loading blocksuite#7276](https://github.com/toeverything/blocksuite/pull/7276) @golok727
> * [fix(presets): chat input max-height blocksuite#7283](https://github.com/toeverything/blocksuite/pull/7283) @fundon
> * [fix(presets): get image blob from selection blocksuite#7286](https://github.com/toeverything/blocksuite/pull/7286) @donteatfriedrice
> * [fix(blocks): connectors resize and rotate blocksuite#7256](https://github.com/toeverything/blocksuite/pull/7256) @fundon
>
> ## Refactor
> * [refactor: add DocModeService for doc mode get, set, toogle and observe change blocksuite#7288](https://github.com/toeverything/blocksuite/pull/7288) @akumatus
> * [refactor(edgeless): rewrite auto-connect component as a widget blocksuite#7287](https://github.com/toeverything/blocksuite/pull/7287) @doouding
>
> ## Misc
> * [test: fix flaky blocksuite#7295](https://github.com/toeverything/blocksuite/pull/7295) @L-Sun
> * [style(page): adjust heading font-weight and letter-spacing blocksuite#7277](https://github.com/toeverything/blocksuite/pull/7277) @CatsJuice
> * [chore: apply member ordering rule blocksuite#7279](https://github.com/toeverything/blocksuite/pull/7279) @Saul-Mirone

---
2024-06-13 16:53:42 +08:00
doouding a3ca41fd6a fix: surface-ref peek view (#7208)
### Change
Add ref to `SurfaceRefPeekView`. It provide `fitViewportToTarget` method to fit the `surface-ref` content.

Related to [AFF-1200](https://linear.app/affine-design/issue/AFF-1200/center-peek-frame-rendering-issue).
2024-06-13 07:05:14 +00:00
pengx17 a11cb6b0cd fix: peek view modal controls animation (#7180) 2024-06-11 03:18:53 +00:00
EYHN ef01b6255e fix(core): template image assets missing (#7171)
fix TOV-910
2024-06-08 17:28:24 +00:00
pengx17 3464e30229 fix: quick search placeholder for docs search (#7175)
fix AFF-1236
2024-06-07 07:42:16 +00:00
pengx17 17a5900575 fix: adjust peek view modal container styles (#7173)
fix AFF-1233, AFF-1234
2024-06-07 05:12:15 +00:00
pengx17 e6ec506226 fix: insert link action in quick search callback (#7165) 2024-06-07 04:39:20 +00:00
pengx17 79e1e8dd2f fix: close peek view when clicking on reference link (#7137) 2024-06-06 15:40:22 +00:00
EYHN d791ab73ba fix(core): fix active view undefined (#7161) 2024-06-06 07:53:37 +00:00
pengx17 b99b964a78 fix: temp fix for showing peek view modal for edgeless (#7155)
workaround for AFF-1200
2024-06-06 07:27:29 +00:00
pengx17 10297766b8 fix: adjust peek view modal container styles (#7153) 2024-06-06 07:27:25 +00:00
pengx17 1439d00b61 feat: add search doc modal (#7136) 2024-06-06 06:29:36 +00:00
pengx17 de81527e29 refactor: move command registry to frontend/core (#7135)
move command registeration related logic out of infra module.
2024-06-05 14:09:20 +00:00
EYHN f67108c6f7 fix(core): fetch share docs on non-cloud workspace (#7144) 2024-06-04 09:45:35 +00:00
pengx17 03be1d66f9 feat: add feature flag for peek view (#7122) 2024-05-31 12:01:27 +00:00
pengx17 002b9e80f8 feat: e2e tests for peek view (#7112)
fix AFF-1163
2024-05-31 10:28:42 +00:00
pengx17 ea0059fa1b feat: center peek view (#7073)
<div class='graphite__hidden'>
          <div>🎥 Video uploaded on Graphite:</div>
            <a href="https://app.graphite.dev/media/video/T2klNLEk0wxLh4NRDzhk/7380c06e-880e-424a-9204-8cfb5e924978.mp4">
              <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/T2klNLEk0wxLh4NRDzhk/7380c06e-880e-424a-9204-8cfb5e924978.mp4">
            </a>
          </div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/7380c06e-880e-424a-9204-8cfb5e924978.mp4">Kapture 2024-05-30 at 19.42.46.mp4</video>
2024-05-31 10:28:37 +00:00
JimmFly 9d296c4b62 chore: adjust find in page modal style (#7087)
![image](https://github.com/toeverything/AFFiNE/assets/102217452/757a4ea3-2101-4610-852c-21be02e9b167)
![image](https://github.com/toeverything/AFFiNE/assets/102217452/c7c2ad1b-f220-4799-926c-6f3777b0daf9)
2024-05-28 06:19:59 +00:00
pengx17 2ca77d9170 refactor: find in page (#7086)
- refactor rxjs data flow
- use canvas text to mitigate searchable search box input text issue
2024-05-28 06:19:53 +00:00
JimmFly bd9c929d05 feat(core): cmd+f search in doc function (#7040)
You can use the cmd+F shortcut key to trigger the FindInPage function.
2024-05-28 06:19:48 +00:00
EYHN b356ddbe6e fix(core): fix ui flashing (#7056) 2024-05-27 08:05:20 +00:00
EYHN a440e85ffe chore: bump blocksuite (#7075)
## Features
- toeverything/blocksuite#6937 @Flrande

## Bugfix
- toeverything/blocksuite#7137 @fundon
- toeverything/blocksuite#7126 @golok727
- toeverything/blocksuite#7128 @CatsJuice
- toeverything/blocksuite#7130 @fundon

## Refactor

## Misc
- toeverything/blocksuite#7131 @fundon

## Additional changes

Adjust the awareness provider so that it only obtains awareness instances when connect, and fixes the dependencies between workspace components.
2024-05-27 05:11:12 +00:00