Commit Graph

26 Commits

Author SHA1 Message Date
L-Sun
2cd83be621 fix(editor): code block toolbar float offset (#10579)
Close [BS-2736](https://linear.app/affine-design/issue/BS-2736/代码块工具栏偏移太大), [BS-1974](https://linear.app/affine-design/issue/BS-1974/code-block-浮标歪)

## Before

https://github.com/user-attachments/assets/f4ec4d7d-8c18-43ea-9464-c18e8b8dce60

https://github.com/user-attachments/assets/76f89ce6-bd89-49d6-a987-e9e5d5f9842a

### After

https://github.com/user-attachments/assets/dac919b9-d19c-4fb3-99bf-be02a460ad8c

https://github.com/user-attachments/assets/e5329f84-f1cf-4776-a789-8d12bea17ece
2025-03-03 09:56:13 +00:00
Flrande
5d3c365d97 fix(editor): format text in code block (#10575)
Closes: [BS-2724](https://linear.app/affine-design/issue/BS-2724/code-block%E9%87%8C%E4%B8%8D%E5%BA%94%E8%AF%A5%E6%98%BE%E7%A4%BAtoolbar)
2025-03-03 08:52:38 +00:00
renovate
b05315c6fa chore: bump up shiki version to v3 (#10534)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [shiki](https://redirect.github.com/shikijs/shiki) ([source](https://redirect.github.com/shikijs/shiki/tree/HEAD/packages/shiki)) | [`^2.0.0` -> `^3.0.0`](https://renovatebot.com/diffs/npm/shiki/2.5.0/3.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/shiki/3.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/shiki/3.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/shiki/2.5.0/3.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/shiki/2.5.0/3.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>shikijs/shiki (shiki)</summary>

### [`v3.1.0`](https://redirect.github.com/shikijs/shiki/releases/tag/v3.1.0)

[Compare Source](https://redirect.github.com/shikijs/shiki/compare/v3.0.0...v3.1.0)

#####    🚀 Features

-   **engine-js**: Bump deps to work around Safari bug with some grammars  -  by [@&#8203;slevithan](https://redirect.github.com/slevithan) in [https://github.com/shikijs/shiki/issues/941](https://redirect.github.com/shikijs/shiki/issues/941) [<samp>(47205)</samp>](https://redirect.github.com/shikijs/shiki/commit/4720501b)
-   **twoslash**: Upgrade twoslash v0.3, require typescript v5.5+, close [#&#8203;950](https://redirect.github.com/shikijs/shiki/issues/950), close [#&#8203;951](https://redirect.github.com/shikijs/shiki/issues/951)  -  by [@&#8203;antfu](https://redirect.github.com/antfu) in [https://github.com/shikijs/shiki/issues/950](https://redirect.github.com/shikijs/shiki/issues/950) and [https://github.com/shikijs/shiki/issues/951](https://redirect.github.com/shikijs/shiki/issues/951) [<samp>(5c6f9)</samp>](https://redirect.github.com/shikijs/shiki/commit/5c6f9e92)

#####    🐞 Bug Fixes

-   **monaco**: Handle missing settings in textmate theme func  -  by [@&#8203;felipetodev](https://redirect.github.com/felipetodev) in [https://github.com/shikijs/shiki/issues/939](https://redirect.github.com/shikijs/shiki/issues/939) [<samp>(19f75)</samp>](https://redirect.github.com/shikijs/shiki/commit/19f75f66)

#####     [View changes on GitHub](https://redirect.github.com/shikijs/shiki/compare/v3.0.0...v3.1.0)

### [`v3.0.0`](https://redirect.github.com/shikijs/shiki/releases/tag/v3.0.0)

[Compare Source](https://redirect.github.com/shikijs/shiki/compare/v2.5.0...v3.0.0)

#####    🚨 Breaking Changes

-   Remove deprecated apis for v3.0  -  by [@&#8203;antfu](https://redirect.github.com/antfu) in [https://github.com/shikijs/shiki/issues/900](https://redirect.github.com/shikijs/shiki/issues/900) [<samp>(55c15)</samp>](https://redirect.github.com/shikijs/shiki/commit/55c1554b)
-   Remove `node10` typescript resolution support  -  by [@&#8203;userquin](https://redirect.github.com/userquin) in [https://github.com/shikijs/shiki/issues/923](https://redirect.github.com/shikijs/shiki/issues/923) [<samp>(ccb58)</samp>](https://redirect.github.com/shikijs/shiki/commit/ccb5856b)
-   **twoslash**: Make default `moduleResolution` to `bundler`  -  by [@&#8203;antfu](https://redirect.github.com/antfu) in [https://github.com/shikijs/shiki/issues/936](https://redirect.github.com/shikijs/shiki/issues/936) [<samp>(e924d)</samp>](https://redirect.github.com/shikijs/shiki/commit/e924d4b1)

#####    🐞 Bug Fixes

-   **transformers**:
    -   Also remove extra newline token, fix [#&#8203;915](https://redirect.github.com/shikijs/shiki/issues/915)  -  by [@&#8203;antfu](https://redirect.github.com/antfu) in [https://github.com/shikijs/shiki/issues/915](https://redirect.github.com/shikijs/shiki/issues/915) [<samp>(cc591)</samp>](https://redirect.github.com/shikijs/shiki/commit/cc5913eb)
    -   Support matching comments in comments, fix [#&#8203;934](https://redirect.github.com/shikijs/shiki/issues/934)  -  by [@&#8203;antfu](https://redirect.github.com/antfu) in [https://github.com/shikijs/shiki/issues/934](https://redirect.github.com/shikijs/shiki/issues/934) [<samp>(6efc8)</samp>](https://redirect.github.com/shikijs/shiki/commit/6efc8979)
    -   Fix matching indices for word-highlight  -  by [@&#8203;artt](https://redirect.github.com/artt) in [https://github.com/shikijs/shiki/issues/909](https://redirect.github.com/shikijs/shiki/issues/909) [<samp>(57a09)</samp>](https://redirect.github.com/shikijs/shiki/commit/57a09ade)

#####     [View changes on GitHub](https://redirect.github.com/shikijs/shiki/compare/v2.5.0...v3.0.0)

</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 was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/toeverything/AFFiNE).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNzYuMiIsInVwZGF0ZWRJblZlciI6IjM5LjE3Ni4yIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5IiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->
2025-03-01 02:33:49 +00:00
L-Sun
61541a2d15 fix(editor): patch android backspace key binding with beforeInput (#10523)
Close [BS-1869](https://linear.app/affine-design/issue/BS-1869/[bug]-android-chrome-%E8%BE%93%E5%85%A5%E9%94%99%E8%AF%AF)

## Problem
On Android devices, keyboard events do not properly capture key information, causing the backspace key and other keyboard functionalities to malfunction. This is due to the specific behavior of Android platform, as discussed in:
- https://stackoverflow.com/a/68188679
- https://stackoverflow.com/a/66724830

## Solution
1. Added special handling for Android platform in `KeyboardControl` class by using `beforeInput` event instead of `keyDown` event
2. Implemented `androidBindKeymapPatch` function to handle special key events on Android platform
3. Updated event handling logic in related components, including:
   - CodeBlock
   - ListKeymap
   - ParagraphKeymap
   - PageKeyboardManager

## Changes
- Added `androidBindKeymapPatch` function for handling key events on Android platform
- Modified `KeyboardControl.bindHotkey` method to add `beforeInput` event handling for Android
- Unified event object access using `ctx.get('defaultState').event` instead of `keyboardState.raw`
- Updated key event handling logic in multiple components

## Before

https://github.com/user-attachments/assets/e8602de4-d584-4adf-816f-369f38312022

## After

https://github.com/user-attachments/assets/f9e1680e-28ff-4d52-bdab-7683cdcb6f82
2025-02-28 13:03:00 +00:00
fundon
abc3f9f23f chore(editor): bump @floating-ui/dom to 1.6.13 (#10425) 2025-02-25 07:06:27 +00:00
forehalo
2e0f0c624a chore: set base version to 0.20 (#10382) 2025-02-24 04:44:42 +00:00
donteatfriedrice
2d41c2ff8d chore: bump theme (#10358) 2025-02-24 10:08:47 +08:00
donteatfriedrice
2b11941c0e chore: bump theme (#10290) 2025-02-19 11:37:19 +00:00
Saul-Mirone
d111f8ac88 feat(editor): add WidgetViewExtension (#10180)
Closes: [BS-2282](https://linear.app/affine-design/issue/BS-2282/replace-widgetviewmapextension-with-widgetextension)
2025-02-14 11:00:01 +00:00
L-Sun
9d08f446cc refactor(editor): remove redundant edgeless icons (#10169)
Continue [BS-2240](https://linear.app/affine-design/issue/BS-2240/%E6%B8%85%E7%90%86%E9%87%8D%E5%A4%8D%E7%9A%84icon)

This PR removes `icons/edgeless.ts` and refactor with `@blocksuite/icons` for reducing redundant icons
2025-02-14 05:03:26 +00:00
Saul-Mirone
9321ce94a7 refactor(editor): remove global types in config (#10143)
Closes: [BS-2554](https://linear.app/affine-design/issue/BS-2554/remove-global-types-in-block-config)
2025-02-13 04:35:35 +00:00
Saul-Mirone
e7cc710f8e refactor(editor): remove service global type (#10129)
Closes: [BS-2566](https://linear.app/affine-design/issue/BS-2566/remove-global-types-in-service)
2025-02-12 11:46:10 +00:00
donteatfriedrice
30612de1ad fix(core): wrap code in ai chat (#10108)
[BS-2540](https://linear.app/affine-design/issue/BS-2540/ai-chat-中-code-block-需要默认换行)
2025-02-12 09:43:52 +00:00
Saul-Mirone
17bf75e843 refactor(editor): remove dependency of command global types (#9903)
Closes: [BS-2216](https://linear.app/affine-design/issue/BS-2216/remove-global-types-in-command)
2025-01-27 12:28:46 +00:00
renovate
b715d2648e chore: bump up shiki version to v2 (#9793)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [shiki](https://redirect.github.com/shikijs/shiki) ([source](https://redirect.github.com/shikijs/shiki/tree/HEAD/packages/shiki)) | [`^1.14.1` -> `^2.0.0`](https://renovatebot.com/diffs/npm/shiki/1.29.1/2.0.3) | [![age](https://developer.mend.io/api/mc/badges/age/npm/shiki/2.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/shiki/2.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/shiki/1.29.1/2.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/shiki/1.29.1/2.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) |
| [shiki](https://redirect.github.com/shikijs/shiki) ([source](https://redirect.github.com/shikijs/shiki/tree/HEAD/packages/shiki)) | [`^1.12.0` -> `^2.0.0`](https://renovatebot.com/diffs/npm/shiki/1.29.1/2.0.3) | [![age](https://developer.mend.io/api/mc/badges/age/npm/shiki/2.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/shiki/2.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/shiki/1.29.1/2.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/shiki/1.29.1/2.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>shikijs/shiki (shiki)</summary>

### [`v2.0.3`](https://redirect.github.com/shikijs/shiki/releases/tag/v2.0.3)

[Compare Source](https://redirect.github.com/shikijs/shiki/compare/v2.0.2...v2.0.3)

#####    🐞 Bug Fixes

-   **core**: Soft require `engine` options  -  by [@&#8203;antfu](https://redirect.github.com/antfu) [<samp>(10a6f)</samp>](https://redirect.github.com/shikijs/shiki/commit/10a6f781)

#####     [View changes on GitHub](https://redirect.github.com/shikijs/shiki/compare/v2.0.2...v2.0.3)

### [`v2.0.2`](https://redirect.github.com/shikijs/shiki/releases/tag/v2.0.2)

[Compare Source](https://redirect.github.com/shikijs/shiki/compare/v2.0.1...v2.0.2)

#####    🐞 Bug Fixes

-   Mark `engine` required in `createHighlighterCore`  -  by [@&#8203;antfu](https://redirect.github.com/antfu) [<samp>(1212f)</samp>](https://redirect.github.com/shikijs/shiki/commit/1212f473)

#####     [View changes on GitHub](https://redirect.github.com/shikijs/shiki/compare/v2.0.1...v2.0.2)

### [`v2.0.1`](https://redirect.github.com/shikijs/shiki/releases/tag/v2.0.1)

[Compare Source](https://redirect.github.com/shikijs/shiki/compare/v2.0.0...v2.0.1)

#####    🚀 Features

-   Improve warning messages  -  by [@&#8203;antfu](https://redirect.github.com/antfu) [<samp>(0f27a)</samp>](https://redirect.github.com/shikijs/shiki/commit/0f27a20d)

#####    🐞 Bug Fixes

-   Warn about missing deprecation  -  by [@&#8203;antfu](https://redirect.github.com/antfu) [<samp>(708e3)</samp>](https://redirect.github.com/shikijs/shiki/commit/708e3f24)
-   **colorized-brackets**: Use object style `htmlStyle`  -  by [@&#8203;antfu](https://redirect.github.com/antfu) [<samp>(eab5b)</samp>](https://redirect.github.com/shikijs/shiki/commit/eab5bd18)

#####     [View changes on GitHub](https://redirect.github.com/shikijs/shiki/compare/v2.0.0...v2.0.1)

### [`v2.0.0`](https://redirect.github.com/shikijs/shiki/releases/tag/v2.0.0)

[Compare Source](https://redirect.github.com/shikijs/shiki/compare/v1.29.1...v2.0.0)

##### Read the announcement: [Shiki v2](https://shiki.style/blog/v2)

#####     [View changes on GitHub](https://redirect.github.com/shikijs/shiki/compare/v1.29.1...v2.0.0)

</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 these updates again.

---

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

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/toeverything/AFFiNE).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5IiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->
2025-01-21 14:46:19 +00:00
doodlewind
14ca171a18 chore(web): bump theme (#9801) 2025-01-20 13:51:24 +00:00
CatsJuice
7d1d167858 chore: bump theme (#9732) 2025-01-17 09:22:15 +00:00
Saul-Mirone
d21ef47ae8 chore(editor): rename std.doc to std.store (#9596) 2025-01-09 04:16:28 +00:00
forehalo
c0ed74dfed chore: standardize tsconfig (#9568) 2025-01-08 04:07:56 +00:00
L-Sun
6e0468c70a chore(editor): revert padding and layout of code block toolbar (#9562)
Close [BS-1767](https://linear.app/affine-design/issue/BS-1767/code-block调整边距)

This PR reverts padding and layout of code block toolbar.

![CleanShot 2025-01-07 at 12.39.37@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/MyRfgiN4RuBxJfrza3SG/7f278d03-40c4-4592-a844-77a5179149fd.png)
2025-01-07 04:53:04 +00:00
Saul-Mirone
f778d1a28a refactor(editor): move extension to store (#9552) 2025-01-06 15:15:14 +00:00
Saul-Mirone
fc863e484c refactor(editor): remove selection global types (#9532)
Closes: [BS-2217](https://linear.app/affine-design/issue/BS-2217/remove-global-types-in-selection)
2025-01-06 03:45:11 +00:00
Saul-Mirone
397a48380e refactor(editor): simplify tsconfig (#9439) 2024-12-30 16:15:34 +00:00
fundon
a5641ae608 feat(editor): update edgeless color palette (#9243)
Closes: [BS-1475](https://linear.app/affine-design/issue/BS-1475/颜色主题更新) [BS-1803](https://linear.app/affine-design/issue/BS-1803/fill-color色板影响的yuan素) [BS-1804](https://linear.app/affine-design/issue/BS-1804/border-color色板影响的yuan素) [BS-1815](https://linear.app/affine-design/issue/BS-1815/连线文字配色略瞎)

### What's Changed

* refactor `EdgelessLineWidthPanel` component, the previous width is fixed and cannot be used in the new design
* refactor `EdgelessColorPanel` and `EdgelessColorButton` components, make them simple and reusable
* delete redundant `EdgelessOneRowColorPanel` component
* unity and update color palette, if the previously set color is not in the latest color palette, the custom color button will be selected
2024-12-30 03:36:34 +00:00
forehalo
12542f51f9 chore: bump base version to 0.19.0 2024-12-28 00:27:50 +08:00
Saul-Mirone
6ebefbbf2b refactor(editor): extract code block (#9397) 2024-12-27 14:45:11 +00:00