EYHN
4677049b5c
feat(core): add public user service ( #10695 )
2025-03-07 08:00:27 +00:00
Hwang
a08e76c3b5
chore: update project name ( #10658 )
...
Co-authored-by: EYHN <cneyhn@gmail.com >
2025-03-07 15:59:26 +08:00
fengmk2
4446100150
fix(server): correct "Administrators" typo in permissions ( #10690 )
2025-03-07 07:13:36 +00:00
doouding
460e088873
fix: block should not be selectable when dragged into note ( #10664 )
...
### Changed
- Fixed the issue that block can still be selected when dragged into note
- Rewrite grid and layer with extension infra
2025-03-07 04:40:05 +00:00
fundon
8da12025af
fix(core): should invoke cleanup fn when ai sub item list is removed ( #10685 )
...
Closes: [BS-2755](https://linear.app/affine-design/issue/BS-2755/ai-translate-死循环报错 )
2025-03-07 03:35:59 +00:00
L-Sun
750c8a44dc
refactor(editor): add slash menu config extension entry ( #10641 )
...
Close [BS-2744](https://linear.app/affine-design/issue/BS-2744/slash-menu%E6%8F%92%E4%BB%B6%E5%8C%96%EF%BC%9Aaction%E6%B3%A8%E5%86%8C%E5%85%A5%E5%8F%A3 )
This PR mainly focus on providing an entry point for configuring the SlashMenu feature. Therefore, it strives to retain the original code to ensure that the modifications are simple and easy to review. Subsequent PRs will focus on moving different configurations into separate blocks.
### How to use?
Here is the type definition for the slash menu configuration. An important change is the new field `group`, which indicates the sorting and grouping of the menu item. See the comments for details.
```ts
// types.ts
export type SlashMenuContext = {
std: BlockStdScope;
model: BlockModel;
};
export type SlashMenuItemBase = {
name: string;
description?: string;
icon?: TemplateResult;
/**
* This field defines sorting and grouping of menu items like VSCode.
* The first number indicates the group index, the second number indicates the item index in the group.
* The group name is the string between `_` and `@`.
* You can find an example figure in https://code.visualstudio.com/api/references/contribution-points#menu-example
*/
group?: `${number}_${string}@${number}`;
/**
* The condition to show the menu item.
*/
when?: (ctx: SlashMenuContext) => boolean;
};
export type SlashMenuActionItem = SlashMenuItemBase & {
action: (ctx: SlashMenuContext) => void;
tooltip?: SlashMenuTooltip;
/**
* The alias of the menu item for search.
*/
searchAlias?: string[];
};
export type SlashMenuSubMenu = SlashMenuItemBase & {
subMenu: SlashMenuItem[];
};
export type SlashMenuItem = SlashMenuActionItem | SlashMenuSubMenu;
export type SlashMenuConfig = {
/**
* The items in the slash menu. It can be generated dynamically with the context.
*/
items: SlashMenuItem[] | ((ctx: SlashMenuContext) => SlashMenuItem[]);
/**
* Slash menu will not be triggered when the condition is true.
*/
disableWhen?: (ctx: SlashMenuContext) => boolean;
};
// extensions.ts
/**
* The extension to add a slash menu items or configure.
*/
export function SlashMenuConfigExtension(ext: {
id: string;
config: SlashMenuConfig;
}): ExtensionType {
return {
setup: di => {
di.addImpl(SlashMenuConfigIdentifier(ext.id), ext.config);
},
};
}
```
Here is an example, `XXXSlashMenuConfig` adds a `Delete` action to the slash menu, which is assigned to the 8th group named `Actions` at position 0.
```ts
import { SlashMenuConfigExtension, type SlashMenuConfig } from '@blocksuite/affine-widget-slash-menu';
const XXXSlashMenuConfig = SlashMenuConfigExtension({
id: 'XXX',
config: {
items: [
{
name: 'Delete',
description: 'Remove a block.',
searchAlias: ['remove'],
icon: DeleteIcon,
group: '8_Actions@0',
action: ({ std, model }) => {
std.host.doc.deleteBlock(model);
},
},
],
},
});
```
2025-03-06 16:12:06 +00:00
L-Sun
62d8c0c7cb
refactor(editor): adjust folder structure for slash menu extension ( #10588 )
...
Close [BS-2743](https://linear.app/affine-design/issue/BS-2743/slash-menu插件化:调整文件夹结构 )
This PR move slash menu from `affine-root-block` to `widget-affine-slash-menu`, and make it as a `WidgetViewExtension`
2025-03-06 16:12:06 +00:00
forehalo
e02fb4fa94
refactor(core): standardize frontend error handling ( #10667 )
2025-03-06 13:10:18 +00:00
Saul-Mirone
84e2dda3f8
refactor(editor): separate lit and slot in global ( #10666 )
2025-03-06 10:24:59 +00:00
forehalo
56b842f2e1
fix(core): runtime control of telemetry ( #10663 )
2025-03-06 09:56:13 +00:00
fundon
93920f9895
fix(editor): circular dependencies ( #10661 )
...
Closes: [BS-2766](https://linear.app/affine-design/issue/BS-2766/把-converttodatabase-移到-root-block-中,避免循环依赖 )
2025-03-06 09:41:01 +00:00
akumatus
cd884312ea
fix(core): missing clean up subscription ( #10636 )
2025-03-06 07:00:58 +00:00
fundon
ec9bd1f383
feat(editor): add toolbar registry extension ( #9572 )
...
### What's Changed!
#### Added
Manage various types of toolbars uniformly in one place.
* `affine-toolbar-widget`
* `ToolbarRegistryExtension`
The toolbar currently supports and handles several scenarios:
1. Select blocks: `BlockSelection`
2. Select text: `TextSelection` or `NativeSelection`
3. Hover a link: `affine-link` and `affine-reference`
#### Removed
Remove redundant toolbar implementations.
* `attachment` toolbar
* `bookmark` toolbar
* `embed` toolbar
* `formatting` toolbar
* `affine-link` toolbar
* `affine-reference` toolbar
### How to migrate?
Here is an example that can help us migrate some unrefactored toolbars:
Check out the more detailed types of [`ToolbarModuleConfig`](c178debf2d/blocksuite/affine/shared/src/services/toolbar-service/config.ts ).
1. Add toolbar configuration file to a block type, such as bookmark block: [`config.ts`](c178debf2d/blocksuite/affine/block-bookmark/src/configs/toolbar.ts )
```ts
export const builtinToolbarConfig = {
actions: [
{
id: 'a.preview',
content(ctx) {
const model = ctx.getCurrentModelBy(BlockSelection, BookmarkBlockModel);
if (!model) return null;
const { url } = model;
return html`<affine-link-preview .url=${url}></affine-link-preview>`;
},
},
{
id: 'b.conversions',
actions: [
{
id: 'inline',
label: 'Inline view',
run(ctx) {
},
},
{
id: 'card',
label: 'Card view',
disabled: true,
},
{
id: 'embed',
label: 'Embed view',
disabled(ctx) {
},
run(ctx) {
},
},
],
content(ctx) {
},
} satisfies ToolbarActionGroup<ToolbarAction>,
{
id: 'c.style',
actions: [
{
id: 'horizontal',
label: 'Large horizontal style',
},
{
id: 'list',
label: 'Small horizontal style',
},
],
content(ctx) {
},
} satisfies ToolbarActionGroup<ToolbarAction>,
{
id: 'd.caption',
tooltip: 'Caption',
icon: CaptionIcon(),
run(ctx) {
},
},
{
placement: ActionPlacement.More,
id: 'a.clipboard',
actions: [
{
id: 'copy',
label: 'Copy',
icon: CopyIcon(),
run(ctx) {
},
},
{
id: 'duplicate',
label: 'Duplicate',
icon: DuplicateIcon(),
run(ctx) {
},
},
],
},
{
placement: ActionPlacement.More,
id: 'b.refresh',
label: 'Reload',
icon: ResetIcon(),
run(ctx) {
},
},
{
placement: ActionPlacement.More,
id: 'c.delete',
label: 'Delete',
icon: DeleteIcon(),
variant: 'destructive',
run(ctx) {
},
},
],
} as const satisfies ToolbarModuleConfig;
```
2. Add configuration extension to a block spec: [bookmark's spec](c178debf2d/blocksuite/affine/block-bookmark/src/bookmark-spec.ts )
```ts
const flavour = BookmarkBlockSchema.model.flavour;
export const BookmarkBlockSpec: ExtensionType[] = [
...,
ToolbarModuleExtension({
id: BlockFlavourIdentifier(flavour),
config: builtinToolbarConfig,
}),
].flat();
```
3. If the bock type already has a toolbar configuration built in, we can customize it in the following ways:
Check out the [editor's config](c178debf2d/packages/frontend/core/src/blocksuite/extensions/editor-config/index.ts (L51C4-L54C8) ) file.
```ts
// Defines a toolbar configuration for the bookmark block type
const customBookmarkToolbarConfig = {
actions: [
...
]
} as const satisfies ToolbarModuleConfig;
// Adds it into the editor's config
ToolbarModuleExtension({
id: BlockFlavourIdentifier('custom:affine:bookmark'),
config: customBookmarkToolbarConfig,
}),
```
4. If we want to extend the global:
```ts
// Defines a toolbar configuration
const customWildcardToolbarConfig = {
actions: [
...
]
} as const satisfies ToolbarModuleConfig;
// Adds it into the editor's config
ToolbarModuleExtension({
id: BlockFlavourIdentifier('custom:affine:*'),
config: customWildcardToolbarConfig,
}),
```
Currently, only most toolbars in page mode have been refactored. Next is edgeless mode.
2025-03-06 06:46:03 +00:00
EYHN
5c8b81581c
feat(core): doc level awareness ( #10646 )
2025-03-06 06:05:45 +00:00
Saul-Mirone
2b30d756e2
refactor(editor): replace debounce and throttle with lodash ( #10639 )
2025-03-06 04:46:52 +00:00
yoyoyohamapi
824f573ff9
refactor(core): replace ai icons ( #10637 )
2025-03-06 04:23:52 +00:00
JimmFly
edd37b5d54
chore: adjust discord link ( #10645 )
2025-03-06 04:08:26 +00:00
liuyi
7e61a0b2fc
refactor(graphql): codegen ( #10626 )
2025-03-06 12:06:19 +08:00
akumatus
e990a5523e
fix(core): can not clear chat-panel history ( #10634 )
...
Close [BS-2754](https://linear.app/affine-design/issue/BS-2754 ).
### What Changed?
Use the latest session id and display the corresponding historical messages.
2025-03-06 03:19:02 +00:00
CatsJuice
6b08e3f5d4
feat(core): support create new template in starter-bar ( #10570 )
2025-03-06 02:05:29 +00:00
darkskygit
fbb6df3da8
chore(server): return parent id of sessions ( #10638 )
2025-03-05 14:03:36 +00:00
hackerESQ
fed0e0add3
fix: prevent sentry from loading when telemetry is disabled ( #10543 )
...
Co-authored-by: forehalo <forehalo@gmail.com >
2025-03-05 20:09:38 +08:00
EYHN
0015bfbaf2
refactor(core): adjust sentry config ( #10631 )
2025-03-05 11:18:06 +00:00
JimmFly
bb4240f6ef
fix(core): add missing control of modifyDocDefaultRole track event ( #10625 )
2025-03-05 11:02:45 +00:00
JimmFly
cb37c25b14
chore: adjust share menu styles ( #10630 )
...
close AF-2270 AF-2193 AF-2067
2025-03-05 10:42:56 +00:00
Saul-Mirone
7e39893aac
refactor(editor): remove assert functions ( #10629 )
2025-03-05 10:20:02 +00:00
EYHN
201c3438ba
feat(core): add user list service for blocksuite ( #10627 )
2025-03-05 10:06:14 +00:00
pengx17
47d01f5f66
fix(core): db backlink infinite query issue ( #10628 )
...
fix AF-2301
2025-03-05 09:43:05 +00:00
Flrande
bd62634a76
feat(editor): add callout block ( #10563 )
...
- Add `CalloutBlockModel `
- Implement `CalloutBlockComponent `
- Integrate with slash menu (/)
2025-03-05 09:28:51 +00:00
akumatus
1c2a6eac85
feat: responsive chat-panel padding and request ( #10620 )
...
Close [BS-2751](https://linear.app/affine-design/issue/BS-2751 ).
### What Changed?
- Do not send AI gql request when chat-panel is not open.
- When the chat-panel width is greater than 540px, adjust the padding to 24px.
- Optimize the display and hide logic of scroll to end button.
2025-03-05 09:12:03 +00:00
Brooooooklyn
bf7b1646b3
fix(web): add Array#toReversed polyfill ( #10623 )
2025-03-05 07:20:16 +00:00
EYHN
59de4558bd
feat(core): fix sign in background arts block user interaction ( #10621 )
2025-03-05 05:57:01 +00:00
EYHN
61635aa77a
feat(core): add clipper import interface ( #10619 )
2025-03-05 04:22:03 +00:00
EYHN
4daa763c95
fix(core): fix table text content search ( #10488 )
2025-03-05 04:06:44 +00:00
Brooooooklyn
e99b25ae6a
fix(web): add Array#toSpliced and Array#toReversed polyfill ( #10614 )
2025-03-05 02:46:41 +00:00
Saul-Mirone
b8ecfbdae6
refactor(editor): remove assertExists ( #10615 )
2025-03-05 00:13:08 +00:00
akumatus
a6692f70aa
fix(core): text style is not centered when chat-panel is wide ( #10607 )
...
Fix issue [BS-2751](https://linear.app/affine-design/issue/BS-2751 ).
Before:

After:

2025-03-04 15:25:35 +00:00
Saul-Mirone
66d9d576e0
refactor(editor): add gfx entry in bs global package ( #10612 )
2025-03-04 12:46:50 +00:00
Saul-Mirone
5ad3d3c94a
refactor(editor): move figma squircle to shared ( #10610 )
2025-03-04 10:26:58 +00:00
yoyoyohamapi
fd244f909d
fix(core): positioning error in fixed floating submenu ( #10606 )
...
Issue:Close [BS-2150](https://linear.app/affine-design/issue/BS-2150/图片-filterprocessing-二级菜单时而不出现 )
In the AI image menu (based on floating-ui):
- **Floating element**: Submenu items (e.g., "image filter/image processing")
- **Reference element**: Menu item
- **Positioning strategy**: `fixed`
- **Issue**: Specifying the `container` parameter caused the floating element (submenu) to be mounted to the reference element (menu item), leading to incorrect position calculations when floating-ui updated.
```jsx
<menu-item>
<submenu-item style={{ position: 'fixed' }}/>
</menu-item>
```
- **Fix**: Remove the `container` configuration and mount the `fixed`-positioned floating element to the `body` instead.
2025-03-04 09:58:39 +00:00
doodlewind
c418e89fb9
chore(editor): add feature flag entry for testing turbo renderer ( #10581 )
...
The debug pane will be displayed once the `enable_turbo_renderer` feature flag is enabled.

2025-03-04 05:38:44 +00:00
akumatus
321247a2fa
fix(core): add ai 7 day trial hint ( #10587 )
...
Fix issue [BS-2739](https://linear.app/affine-design/issue/BS-2739 ).
2025-03-03 15:10:16 +00:00
Brooooooklyn
899a957fab
fix(native): do not crash on bootstrap if API is not available ( #10582 )
2025-03-03 10:15:42 +00:00
donteatfriedrice
170066050e
feat(core): support latex in ai text renderer ( #10576 )
2025-03-03 09:19:31 +00:00
Brooooooklyn
18bdf830b4
ci: fix native server build ( #10554 )
2025-03-03 05:44:00 +00:00
Brooooooklyn
73fa04e249
chore: unify Cargo deps versions ( #10553 )
2025-03-03 03:30:59 +00:00
pengx17
629aea48df
fix(electron): app menu about action ( #10445 )
...
fix AF-2268
2025-03-03 03:00:17 +00:00
Saul-Mirone
fdde818ddd
feat(editor): add block meta feature flag ( #10548 )
2025-03-03 01:45:33 +00:00
Saul-Mirone
f23f29610c
refactor(editor): remove stable feature flags ( #10547 )
2025-03-02 08:41:12 +00:00
renovate
2b0c91b58b
chore: bump up sonner version to v2 ( #10535 )
...
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [sonner](https://sonner.emilkowal.ski/ ) ([source](https://redirect.github.com/emilkowalski/sonner )) | [`^1.7.1` -> `^2.0.0`](https://renovatebot.com/diffs/npm/sonner/1.7.4/2.0.1 ) | [](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>emilkowalski/sonner (sonner)</summary>
### [`v2.0.1`](https://redirect.github.com/emilkowalski/sonner/releases/tag/v2.0.1 )
[Compare Source](https://redirect.github.com/emilkowalski/sonner/compare/v2.0.0...v2.0.1 )
##### What's Changed
- fix: flush sync error by [@​emilkowalski](https://redirect.github.com/emilkowalski ) in [https://github.com/emilkowalski/sonner/pull/586 ](https://redirect.github.com/emilkowalski/sonner/pull/586 )
- fix: allow users to select text after swipe gesture by [@​emilkowalski](https://redirect.github.com/emilkowalski ) in [https://github.com/emilkowalski/sonner/pull/587 ](https://redirect.github.com/emilkowalski/sonner/pull/587 )
**Full Changelog**: https://github.com/emilkowalski/sonner/compare/v2.0.0...v2.0.1
### [`v2.0.0`](https://redirect.github.com/emilkowalski/sonner/releases/tag/v2.0.0 )
[Compare Source](8665072d34 ...v2.0.0)
Mostly bug fixes, see more at https://sonner.emilkowal.ski/getting-started .
##### What's Changed
- sonner v2.0 by [@​emilkowalski](https://redirect.github.com/emilkowalski ) in [https://github.com/emilkowalski/sonner/pull/558 ](https://redirect.github.com/emilkowalski/sonner/pull/558 )
**Full Changelog**: https://github.com/emilkowalski/sonner/compare/v.2.0.0-beta.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 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 03:28:11 +00:00