Commit Graph

427 Commits

Author SHA1 Message Date
Saul-Mirone 8e08b9000d feat(editor): create gfx mindmap package (#11100) 2025-03-24 03:14:22 +00:00
Saul-Mirone 1f0fc9d47a feat(editor): gfx connector package (#11091) 2025-03-22 14:39:05 +00:00
Saul-Mirone e3735f40b8 feat(editor): gfx note package (#11088) 2025-03-22 14:39:04 +00:00
Saul-Mirone c1d426d8e9 refactor(editor): move frame toolbar config and components to its package (#11084) 2025-03-21 16:47:40 +00:00
Saul-Mirone f5fb5c848e refactor(editor): move text toolbar config and components to its package (#11083) 2025-03-21 16:47:40 +00:00
Saul-Mirone f762797772 refactor(editor): move shape toolbar config and components to its package (#11082) 2025-03-21 16:47:39 +00:00
Saul-Mirone 6777c16683 feat(editor): edgeless toolbar widget package (#11064) 2025-03-21 11:45:32 +00:00
Saul-Mirone 8109c718c7 feat(editor): gfx shape package (#11060) 2025-03-21 06:13:11 +00:00
Saul-Mirone e50d09db50 feat(editor): latex inline package (#11051) 2025-03-21 01:38:08 +00:00
Saul-Mirone 57388e4cf7 feat(editor): footnote inline package (#11049) 2025-03-20 16:18:22 +00:00
Saul-Mirone e5e429e7b2 feat(editor): add inline packages (#11048) 2025-03-20 13:47:35 +00:00
pengx17 fad49bb070 feat(editor): audio block (#10947)
AudioMedia entity for loading & controlling a single audio media
AudioMediaManagerService: Global audio state synchronization across tabs
AudioAttachmentService + AudioAttachmentBlock for manipulating AttachmentBlock in affine - e.g., filling transcription (using mock endpoint for now)
Added AudioBlock + AudioPlayer for rendering audio block in affine (new transcription block whose renderer is provided in affine)

fix AF-2292
fix AF-2337
2025-03-20 12:46:15 +00:00
Saul-Mirone 92d76ba571 refactor(editor): merge inline to std (#11025) 2025-03-20 05:46:56 +00:00
Saul-Mirone 75580e881b refactor(editor): move gfx frame title to widget (#11021) 2025-03-20 04:10:56 +00:00
Saul-Mirone 258c70cf07 refactor(editor): store should not rely on inline (#11017) 2025-03-20 01:33:29 +00:00
forehalo f889886b31 refactor(server): e2e utilities (#11000) 2025-03-19 17:00:20 +00:00
forehalo 21c4a29f55 refactor(server): mail service (#10934) 2025-03-19 17:00:19 +00:00
fundon d8567e669a refactor(editor): edgeless bookmark toolbar config extension (#10711) 2025-03-19 02:24:26 +00:00
fundon 251d1d8782 refactor(editor): edgeless attacment toolbar config extension (#10710) 2025-03-19 00:52:22 +00:00
pengx17 a016630a82 feat(electron): create recording through tray (#10526)
- added tray menu for controlling recording status
- recording watcher for monitoring system audio input events
2025-03-18 04:12:30 +00:00
Saul-Mirone 1d04438049 docs(editor): scaffolding docs generator (#10925) 2025-03-17 12:51:08 +00:00
L-Sun d80f1e8067 feat(editor): insert a blank frame slash menu action (#10899)
Close [BS-2517](https://linear.app/affine-design/issue/BS-2517/%E6%B7%BB%E5%8A%A0frame%E5%85%A5%E5%8F%A3)

### What changes:
- add a insert blank frame action to slash menu
- move `EdgelessFrameManager` and `FrameOverlay` extensions to `FrameBlockSpec`
- make `FrameBlockSpec` as a part of `CommonBlockSpecs` such that we can use `EdgelessFrameManager` to create a frame more easily

https://github.com/user-attachments/assets/ddff5866-8933-4ce5-aaf4-873661407ee4
2025-03-17 10:32:55 +00:00
Saul-Mirone d5a5df5e49 test(editor): move blocksuite test to tests folder (#10917) 2025-03-17 06:40:25 +00:00
EYHN 05200ad7b7 feat(nbstore): add blob sync storage (#10752) 2025-03-14 18:05:54 +08:00
Saul-Mirone 05f3069efd feat(editor): add i18n support for block meta display (#10831) 2025-03-13 11:28:56 +00:00
fengmk2 867ae7933f refactor(server): improve oauth login flow (#10648)
close CLOUD-145
2025-03-12 15:27:36 +08:00
doodlewind ad36a9de35 refactor(editor): add gfx turbo renderer package (#10745)
The `ViewportTurboRendererExtension` is now extracted from `@blocksuite/affine-shared` to `@blocksuite/affine-gfx-turbo-renderer` with minimal dependencies, mirroring the gfx text package in #10378.
2025-03-11 03:21:52 +00:00
L-Sun c13d4c575f chore(editor): update slash menu tooltips (#10746)
Close [BS-2676](https://linear.app/affine-design/issue/BS-2676/loom入口增加简介) [BS-2767](https://linear.app/affine-design/issue/BS-2767/table的tooltip需要更新,现在用的是database的)
2025-03-10 12:38:59 +00:00
Saul-Mirone cac05e720a refactor(editor): gfx text package (#10738) 2025-03-10 10:25:21 +00:00
Saul-Mirone 12bc142809 refactor(editor): remove blocks package (#10708) 2025-03-09 05:44:26 +00:00
Saul-Mirone 8aedef0a36 chore(editor): reorg packages (#10702) 2025-03-08 12:00:34 +08:00
L-Sun 05a6845962 refactor(editor): data view slash menu config extension (#10684) 2025-03-07 15:22:41 +00:00
L-Sun 46466e2c3a refactor(editor): code block slash menu config extension (#10683) 2025-03-07 15:22:41 +00:00
L-Sun 83b05aca4d refactor(editor): surface-ref slash menu config extension (#10681) 2025-03-07 09:05:04 +00:00
L-Sun 8d9746e0cc refactor(editor): embed slash menu config extension (#10679) 2025-03-07 08:21:19 +00:00
L-Sun 37a13032ed refactor(editor): note slash menu config extension (#10678) 2025-03-07 08:21:18 +00:00
L-Sun 4be80d87ff refactor(editor): latex slash menu config extension (#10677) 2025-03-07 08:21:18 +00:00
L-Sun ea20751b9b refactor(editor): attachment slash menu config extension (#10676) 2025-03-07 05:48:41 +00:00
L-Sun 34e777e043 refactor(editor): bookmark slash menu config extension (#10675) 2025-03-07 05:48:40 +00:00
L-Sun 4e80ecd591 refactor(editor): image slash menu config extension (#10674) 2025-03-07 05:48:40 +00:00
L-Sun 66ad87c84a refactor(editor): table slash menu config extension (#10673) 2025-03-07 05:48:39 +00:00
L-Sun 0a234fa263 refactor(editor): callout slash menu config extension (#10672) 2025-03-07 04:24:09 +00:00
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
L-Sun 43ce609cba refactor(editor): database slash menu config extension (#10670) 2025-03-07 02:50:27 +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
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
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`](https://github.com/toeverything/AFFiNE/blob/c178debf2d49c40b753e1bcaa6f07270bdde7401/blocksuite/affine/shared/src/services/toolbar-service/config.ts).

1.  Add toolbar configuration file to a block type, such as bookmark block: [`config.ts`](https://github.com/toeverything/AFFiNE/blob/c178debf2d49c40b753e1bcaa6f07270bdde7401/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](https://github.com/toeverything/AFFiNE/blob/c178debf2d49c40b753e1bcaa6f07270bdde7401/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](https://github.com/toeverything/AFFiNE/blob/c178debf2d49c40b753e1bcaa6f07270bdde7401/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
Flrande bd62634a76 feat(editor): add callout block (#10563)
- Add `CalloutBlockModel `
- Implement `CalloutBlockComponent `
- Integrate with slash menu (/)
2025-03-05 09:28:51 +00:00
renovate 54bf4b05f4 chore: bump up copy-webpack-plugin version to v13 (#10530)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [copy-webpack-plugin](https://redirect.github.com/webpack-contrib/copy-webpack-plugin) | [`^12.0.2` -> `^13.0.0`](https://renovatebot.com/diffs/npm/copy-webpack-plugin/12.0.2/13.0.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/copy-webpack-plugin/13.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/copy-webpack-plugin/13.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/copy-webpack-plugin/12.0.2/13.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/copy-webpack-plugin/12.0.2/13.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>webpack-contrib/copy-webpack-plugin (copy-webpack-plugin)</summary>

### [`v13.0.0`](https://redirect.github.com/webpack-contrib/copy-webpack-plugin/blob/HEAD/CHANGELOG.md#1300-2025-02-27)

[Compare Source](https://redirect.github.com/webpack-contrib/copy-webpack-plugin/compare/v12.0.2...v13.0.0)

##### ⚠ BREAKING CHANGES

-   switch from `globby` and `fast-glob` to `tinyglobby` ([#&#8203;795](https://redirect.github.com/webpack-contrib/copy-webpack-plugin/issues/795)) ([19fd937](https://redirect.github.com/webpack-contrib/copy-webpack-plugin/commit/19fd937705ccb2161619e1e919f0b37b47453368))

For more information please visit [`tinyglobby`](https://redirect.github.com/SuperchupuDev/tinyglobby).

The breaking change only affects the developer who used these options - [`gitignore`](https://redirect.github.com/sindresorhus/globby#gitignore) and [`ignoreFiles`](https://redirect.github.com/sindresorhus/globby#gitignore) in the `globOptions` option.

Please migrate to the [`ignore`](https://redirect.github.com/SuperchupuDev/tinyglobby#options) option.

##### Bug Fixes

-   concurrency option is limited to files now ([#&#8203;796](https://redirect.github.com/webpack-contrib/copy-webpack-plugin/issues/796)) ([d42469c](https://redirect.github.com/webpack-contrib/copy-webpack-plugin/commit/d42469cfdc99a81f0f0ba97f6561f0e0db143994))
-   the order of patterns provided by the developer is respected

##### [12.0.2](https://redirect.github.com/webpack-contrib/copy-webpack-plugin/compare/v12.0.1...v12.0.2) (2024-01-17)

##### Bug Fixes

-   improve perf ([#&#8203;764](https://redirect.github.com/webpack-contrib/copy-webpack-plugin/issues/764)) ([a7379a9](https://redirect.github.com/webpack-contrib/copy-webpack-plugin/commit/a7379a9907b78e27b9fa44b474fd2a35671d806d))

##### [12.0.1](https://redirect.github.com/webpack-contrib/copy-webpack-plugin/compare/v12.0.0...v12.0.1) (2024-01-11)

##### Bug Fixes

-   improve perf ([#&#8203;760](https://redirect.github.com/webpack-contrib/copy-webpack-plugin/issues/760)) ([55036ab](https://redirect.github.com/webpack-contrib/copy-webpack-plugin/commit/55036ab50357326dafdbeb7dc91c93b75796fadd))

</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-02-28 14:48:52 +00:00