zzj3720
5a5779c05a
feat(editor): simple table block ( #9740 )
...
close: BS-2122, BS-2125, BS-2124, BS-2420, PD-2073, BS-2126, BS-2469, BS-2470, BS-2478, BS-2471
2025-01-24 10:07:57 +00:00
donteatfriedrice
bdc8dd8d5f
feat(editor): add link preview to footnote popup ( #9869 )
...
[BS-2399](https://linear.app/affine-design/issue/BS-2399/ai-link-的预览支持:获取-fav-icon-标题 )
2025-01-23 09:31:21 +00:00
pengx17
6ac6a8d6d6
feat(core): unused blob management in settings ( #9795 )
...
fix AF-2144, PD-2064, PD-2065, PD-2066
2025-01-23 07:12:17 +00:00
donteatfriedrice
bf797c7a0c
feat(editor): support footnote adapter ( #9844 )
...
[BS-2373](https://linear.app/affine-design/issue/BS-2373/适配-footnote-adapter )
2025-01-22 06:42:35 +00:00
pengx17
4c665594d6
fix(editor): ref on click slots should not be global ( #9830 )
...
fix AF-2129
2025-01-22 05:20:55 +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
Saul-Mirone
5783580054
fix(editor): y reactive deep watch ( #9818 )
...
Closes: [BS-2193](https://linear.app/affine-design/issue/BS-2193/fix-deep-watcher-of-reactive-yjs-data )
2025-01-21 08:08:01 +00:00
donteatfriedrice
f995f216bd
fix(editor): inline latex editor should not be shown when doc is readonly ( #9794 )
...
[BS-2442](https://linear.app/affine-design/issue/BS-2442/只读时-inline-latex-node-点击不应该弹出-modal )
2025-01-20 15:44:07 +00:00
doodlewind
14ca171a18
chore(web): bump theme ( #9801 )
2025-01-20 13:51:24 +00:00
fundon
7436c139ab
fix(core): improve doc title and icon display ( #9755 )
...
Closes: [AF-2132](https://linear.app/affine-design/issue/AF-2132/优化-emoji-title-和-icon-显示 )
2025-01-18 17:29:15 +08:00
donteatfriedrice
df910d7013
feat(editor): add affine inline footnote ( #9745 )
...
[BS-2369](https://linear.app/affine-design/issue/BS-2369/新增-affinetextattribute-footnote ) [BS-2370](https://linear.app/affine-design/issue/BS-2370/支持-footnote-自定义渲染行内内容 ) [BS-2372](https://linear.app/affine-design/issue/BS-2372/提供-footnoteconfigextension ) [BS-2375](https://linear.app/affine-design/issue/BS-2375/footnote-自定义渲染-popup )
### Add new AffineTextAttribute: footnote
```
/**
* FootNote is used to reference a doc, attachment or url.
*/
export interface AffineTextAttributes {
...
footnote?: {
label: string; // label of the footnote
reference: {
type: 'doc' | 'attachment' | 'url'; // type of reference
docId?: string; // the id of the reference doc
url?: string; // the url of the reference network resource
blobId?: string; // the id of the reference attachment
fileName?: string; // the name of the reference attachment
fileType?: string; // the type of the reference attachment
}
} | null
}
```
### FootNoteNodeConfigProvider Extension
#### FootNoteNodeConfig Type Definition
```
type FootNoteNodeRenderer = (
footnote: FootNote,
std: BlockStdScope
) => TemplateResult<1>;
type FootNotePopupRenderer = (
footnote: FootNote,
std: BlockStdScope,
abortController: AbortController
) => TemplateResult<1>;
export interface FootNoteNodeConfig {
customNodeRenderer?: FootNoteNodeRenderer;
customPopupRenderer?: FootNotePopupRenderer;
interactive?: boolean;
hidePopup?: boolean;
}
```
#### FootNoteNodeConfigProvider Class
```
export class FootNoteNodeConfigProvider {
private _customNodeRenderer?: FootNoteNodeRenderer;
private _customPopupRenderer?: FootNotePopupRenderer;
private _hidePopup: boolean;
private _interactive: boolean;
get customNodeRenderer() {
return this._customNodeRenderer;
}
get customPopupRenderer() {
return this._customPopupRenderer;
}
get doc() {
return this.std.store;
}
get hidePopup() {
return this._hidePopup;
}
get interactive() {
return this._interactive;
}
constructor(
config: FootNoteNodeConfig,
readonly std: BlockStdScope
) {
this._customNodeRenderer = config.customNodeRenderer;
this._customPopupRenderer = config.customPopupRenderer;
this._hidePopup = config.hidePopup ?? false;
this._interactive = config.interactive ?? true;
}
setCustomNodeRenderer(renderer: FootNoteNodeRenderer) {
this._customNodeRenderer = renderer;
}
setCustomPopupRenderer(renderer: FootNotePopupRenderer) {
this._customPopupRenderer = renderer;
}
setHidePopup(hidePopup: boolean) {
this._hidePopup = hidePopup;
}
setInteractive(interactive: boolean) {
this._interactive = interactive;
}
}
```
#### FootNoteNodeConfigProvider Extension
```
export const FootNoteNodeConfigIdentifier =
createIdentifier<FootNoteNodeConfigProvider>('AffineFootNoteNodeConfig');
export function FootNoteNodeConfigExtension(
config: FootNoteNodeConfig
): ExtensionType {
return {
setup: di => {
di.addImpl(
FootNoteNodeConfigIdentifier,
provider =>
new FootNoteNodeConfigProvider(config, provider.get(StdIdentifier))
);
},
};
}
```
The footnote node can be extended by this extension.
### FootnoteInlineSpec
```
export const FootNoteInlineSpecExtension = InlineSpecExtension(
'footnote',
provider => {
const std = provider.get(StdIdentifier);
const config =
provider.getOptional(FootNoteNodeConfigIdentifier) ?? undefined;
return {
name: 'footnote',
schema: FootNoteSchema.optional().nullable().catch(undefined),
match: delta => {
return !!delta.attributes?.footnote;
},
renderer: ({ delta }) => {
return html`<affine-footnote-node
.delta=${delta}
.std=${std}
.config=${config}
></affine-footnote-node>`;
},
embed: true,
};
}
);
```
2025-01-17 09:38:43 +00:00
CatsJuice
7d1d167858
chore: bump theme ( #9732 )
2025-01-17 09:22:15 +00:00
doouding
99717196c5
refactor: rewrite blocksuite dnd ( #9595 )
...
### Changed
- Refactored BlockSuite drag-and-drop using @atlaskit/pragmatic-drag-and-drop/element/adapter.
- Updated block dragging to use the new drag-and-drop infrastructure.
### BlockSuite DND API
Access the BlockSuite drag-and-drop API via `std.dnd`. This is a lightweight wrapper around pragmatic-drag-and-drop, offering convenient generic types and more intuitive option names.
#### Drag payload structure
There's some constrain about drag payload. The whole drag payload looks like this:
```typescript
type DragPayload = {
entity: {
type: string
},
from: {
at: 'blocksuite',
docId: string
}
}
```
- The `from` field is auto-generated—no need for manual handling.
- The `entity` field is customizable, but it must include a `type`.
All drag-and-drop methods accept a generic type for entity, ensuring more accurate payloads in event handlers.
```typescript
type BlockEntity = {
type: 'blocks',
blockIds: string[]
}
dnd.draggable<BlockEntity>({
element: someElement,
setDragData: () => {
// the return type must satisfy the generic type
// in this case, it's BlockEntity
return {
type: 'blocks',
blockIds: []
}
}
});
dnd.monitor<BlockEntity>({
// the arguments is same for other event handler
onDrag({ source }) {
// the type of this is BlockEntity
source.data.entity
}
})
```
#### Drop payload
When hover on droppable target. You can set drop payload as well. All drag-and-drop methods accept a second generic type for drop payload.
The drop payload is customizable. Additionally, the DND system will add an `edge` field to the final payload object, indicating the nearest edge of the drop target relative to the current drag position.
```typescript
type DropPayload = {
blockId: string;
}
dnd.dropTarget<BlockEntity, DropPayload>({
getData() {
// the type should be DropPayload
return {
blockId: 'someId'
}
}
});
dnd.monitor<BlockEntity, DropPayload>({
// drag over on drop target
onDrag({ location }) {
const target = location.current.dropTargets[0];
// the type is DropPayload
target.data;
// retrieve the nearest edge of the drop target relative to the current drop position.
target.data.edge;
}
})
```
2025-01-16 12:36:58 +00:00
fundon
7002289c58
fix(editor): avoid drag and drag over updating drag indicator at the same time ( #9656 )
...
* add a `dragging` signal to the file drop manager
* `drag over` logic should not be triggered when inside app
* avoid drag and drag over updating `drag indicator` at the same time
2025-01-15 08:10:08 +00:00
donteatfriedrice
5c4e87ddb5
feat(editor): support text highlight html adapter ( #9632 )
...
[BS-2061](https://linear.app/affine-design/issue/BS-2061/html-adapter-支持-text-highlight-样式 )
2025-01-13 02:20:58 +00:00
fundon
9fa35ed490
fix(editor): drag indicator flickering ( #9636 )
2025-01-11 03:15:07 +00:00
fundon
0b3dba614d
perf(editor): optimize the search for the closest element ( #9587 )
...
Closes: [BS-2275](https://linear.app/affine-design/issue/BS-2275/拖拽-indicator-查找优化 )
2025-01-10 08:21:10 +00:00
pengx17
f78857bb11
feat(editor): add more open doc options to editor toolbar ( #9588 )
...
fix AF-2036, AF-2092
2025-01-09 08:04:21 +00:00
zzj3720
f46a7a073a
fix(editor): component name for the mobile menu is incorrect ( #9604 )
2025-01-09 07:32:49 +00:00
Saul-Mirone
422bac6cbe
refactor(editor): remove readonly in awareness ( #9597 )
2025-01-09 05:15:35 +00:00
Saul-Mirone
d21ef47ae8
chore(editor): rename std.doc to std.store ( #9596 )
2025-01-09 04:16:28 +00:00
Saul-Mirone
3683297ccf
feat(editor): add feature flag service ( #9592 )
2025-01-08 15:46:31 +00:00
Saul-Mirone
5842d45ab1
feat(editor): merge store and blocks ( #9591 )
2025-01-08 13:01:19 +00:00
forehalo
c0ed74dfed
chore: standardize tsconfig ( #9568 )
2025-01-08 04:07:56 +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
CatsJuice
09937a8e4d
chore: bump icons with new design source ( #9529 )
2025-01-06 03:10:03 +00:00
Saul-Mirone
c22804766d
chore(editor): remove common utils in surface block ( #9527 )
2025-01-06 02:41:39 +00:00
Saul-Mirone
c773982ced
refactor(editor): rename store api ( #9518 )
2025-01-04 12:51:56 +00:00
Saul-Mirone
4457cb7266
refactor(editor): rename doc to blocks ( #9510 )
2025-01-03 12:49:33 +00:00
Saul-Mirone
b17dac2201
fix(editor): block selection error when unloaded ( #9511 )
...
Closes: [BS-2305](https://linear.app/affine-design/issue/BS-2305/typeerror-thisblock-is-null )
2025-01-03 10:09:02 +00:00
Saul-Mirone
897c7d4284
refactor(editor): should not rely on doc collection type ( #9501 )
2025-01-03 06:30:27 +00:00
Saul-Mirone
8b6c81f76d
refactor(editor): reduce dependency to doc collection ( #9492 )
2025-01-03 01:59:25 +00:00
Saul-Mirone
597b631918
refactor(editor): extract color picker component ( #9456 )
2024-12-31 07:23:37 +00:00
Fangdun Tsai
83915c2e90
fix(editor): white-space should be set to normal in tooltip ( #9454 )
2024-12-31 15:03:58 +08:00
Saul-Mirone
397a48380e
refactor(editor): simplify tsconfig ( #9439 )
2024-12-30 16:15:34 +00:00
Saul-Mirone
a9f890017e
fix(editor): missing dependencies ( #9436 )
2024-12-30 14:10:37 +00:00
pengx17
ea6fed127b
fix(editor): tooltip styles when having span tags ( #9422 )
...
fix AF-2040
2024-12-30 06:54:03 +00:00
Saul-Mirone
e3b6841944
refactor(editor): reorg block specs ( #9421 )
2024-12-30 05:59:25 +00:00
fundon
b9f2650369
feat(editor): store real color values in edgeless ( #9254 )
...
### What's Changed!
* adds theme type: `ThemeSchema`
* adds default theme: `DefaultTheme`
* stores real color values
2024-12-30 03:36:35 +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
Saul-Mirone
901965b61e
refactor(editor): remove components in blocks/_common ( #9401 )
2024-12-28 01:10:23 +00:00
forehalo
12542f51f9
chore: bump base version to 0.19.0
2024-12-28 00:27:50 +08:00
Saul-Mirone
cbfe38b189
refactor(editor): add middlewares in shared adapter ( #9395 )
2024-12-27 12:32:44 +00:00
Saul-Mirone
5c4058cd73
fix(editor): dnd lag ( #9378 )
2024-12-27 10:34:00 +00:00
Saul-Mirone
2b27d62b0e
refactor(editor): cleanup ts-expect-error ( #9369 )
2024-12-27 05:14:23 +00:00
doodlewind
fe957e3175
fix(editor): eslint useless escape ( #9345 )
2024-12-26 11:09:30 +00:00
doodlewind
71b5cddea1
fix(editor): use nullable inline editor root element ( #9320 )
...
Fixes `sentry-7906c03b79a54ede819c56cc15ad9889`
2024-12-26 07:55:15 +00:00
Saul-Mirone
90173b2fa3
chore(editor): remove typedoc json ( #9324 )
2024-12-26 05:13:41 +00:00
Saul-Mirone
37e44e0341
fix(editor): re-init after yText change in inline editor ( #9312 )
...
Closes: [BS-2143](https://linear.app/affine-design/issue/BS-2143/block通过drag-handle拖动位置后,无法输入 )
2024-12-26 03:51:07 +00:00