Saul-Mirone
fe5f0f62ec
feat(editor): rich text package ( #10689 )
...
This PR performs a significant architectural refactoring by extracting rich text functionality into a dedicated package. Here are the key changes:
1. **New Package Creation**
- Created a new package `@blocksuite/affine-rich-text` to house rich text related functionality
- Moved rich text components, utilities, and types from `@blocksuite/affine-components` to this new package
2. **Dependency Updates**
- Updated multiple block packages to include the new `@blocksuite/affine-rich-text` as a direct dependency:
- block-callout
- block-code
- block-database
- block-edgeless-text
- block-embed
- block-list
- block-note
- block-paragraph
3. **Import Path Updates**
- Refactored all imports that previously referenced rich text functionality from `@blocksuite/affine-components/rich-text` to now use `@blocksuite/affine-rich-text`
- Updated imports for components like:
- DefaultInlineManagerExtension
- RichText types and interfaces
- Text manipulation utilities (focusTextModel, textKeymap, etc.)
- Reference node components and providers
4. **Build Configuration Updates**
- Added references to the new rich text package in the `tsconfig.json` files of all affected packages
- Maintained workspace dependencies using the `workspace:*` version specifier
The primary motivation appears to be:
1. Better separation of concerns by isolating rich text functionality
2. Improved maintainability through more modular package structure
3. Clearer dependencies between packages
4. Potential for better tree-shaking and bundle optimization
This is primarily an architectural improvement that should make the codebase more maintainable and better organized.
2025-03-07 04:08:47 +00:00
Saul-Mirone
84e2dda3f8
refactor(editor): separate lit and slot in global ( #10666 )
2025-03-06 10:24:59 +00:00
L-Sun
797e63f86f
chore(editor): remove unexpected bottom padding of code block ( #10660 )
...
Close [BS-2765](https://linear.app/affine-design/issue/BS-2765/代码块在字数超出宽度时,下巴变大 )
https://github.com/user-attachments/assets/1dc53528-6d36-4b2a-861c-9ca06381c681
2025-03-06 09:26:00 +00:00
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 ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](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 [@​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 [#​950](https://redirect.github.com/shikijs/shiki/issues/950 ), close [#​951](https://redirect.github.com/shikijs/shiki/issues/951 ) - by [@​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 [@​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 [@​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 [@​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 [@​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 [#​915](https://redirect.github.com/shikijs/shiki/issues/915 ) - by [@​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 [#​934](https://redirect.github.com/shikijs/shiki/issues/934 ) - by [@​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 [@​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 ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](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 ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](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 [@​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 [@​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 [@​antfu](https://redirect.github.com/antfu ) [<samp>(0f27a)</samp>](https://redirect.github.com/shikijs/shiki/commit/0f27a20d )
##### 🐞 Bug Fixes
- Warn about missing deprecation - by [@​antfu](https://redirect.github.com/antfu ) [<samp>(708e3)</samp>](https://redirect.github.com/shikijs/shiki/commit/708e3f24 )
- **colorized-brackets**: Use object style `htmlStyle` - by [@​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.

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