Commit Graph

679 Commits

Author SHA1 Message Date
Saul-Mirone
12bc142809 refactor(editor): remove blocks package (#10708) 2025-03-09 05:44:26 +00:00
EYHN
4677049b5c feat(core): add public user service (#10695) 2025-03-07 08:00:27 +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
EYHN
5c8b81581c feat(core): doc level awareness (#10646) 2025-03-06 06:05:45 +00:00
liuyi
7e61a0b2fc refactor(graphql): codegen (#10626) 2025-03-06 12:06:19 +08:00
CatsJuice
6b08e3f5d4 feat(core): support create new template in starter-bar (#10570) 2025-03-06 02:05:29 +00: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
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
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
Saul-Mirone
b8ecfbdae6 refactor(editor): remove assertExists (#10615) 2025-03-05 00:13:08 +00:00
Saul-Mirone
66d9d576e0 refactor(editor): add gfx entry in bs global package (#10612) 2025-03-04 12:46:50 +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.

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/lEGcysB4lFTEbCwZ8jMv/c1ba558a-2d84-403c-aa81-864b0338c861.png)
2025-03-04 05:38:44 +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
7227b7f8f6 chore: bump up oxlint version to v0.15.12 (#10206)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [oxlint](https://oxc.rs) ([source](https://redirect.github.com/oxc-project/oxc/tree/HEAD/npm/oxlint)) | [`0.15.10` -> `0.15.12`](https://renovatebot.com/diffs/npm/oxlint/0.15.10/0.15.12) | [![age](https://developer.mend.io/api/mc/badges/age/npm/oxlint/0.15.12?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/oxlint/0.15.12?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/oxlint/0.15.10/0.15.12?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/oxlint/0.15.10/0.15.12?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>oxc-project/oxc (oxlint)</summary>

### [`v0.15.12`](https://redirect.github.com/oxc-project/oxc/releases/tag/oxlint_v0.15.12): oxlint v0.15.12

[Compare Source](https://redirect.github.com/oxc-project/oxc/compare/oxlint_v0.15.11...oxlint_v0.15.12)

#### \[0.15.12] - 2025-02-24

##### Features

-   [`914dd46`](https://redirect.github.com/oxc-project/oxc/commit/914dd46) linter: Add eslint/max-depth ([#&#8203;9173](https://redirect.github.com/oxc-project/oxc/issues/9173)) (ikkz)
-   [`0b08159`](https://redirect.github.com/oxc-project/oxc/commit/0b08159) linter: Add eslint/max-lines-per-function ([#&#8203;9161](https://redirect.github.com/oxc-project/oxc/issues/9161)) (ikkz)
-   [`cc8dd48`](https://redirect.github.com/oxc-project/oxc/commit/cc8dd48) linter: Add unicorn/no-invalid-fetch-options rule ([#&#8203;9212](https://redirect.github.com/oxc-project/oxc/issues/9212)) (Mikhail Baev)
-   [`af13b1b`](https://redirect.github.com/oxc-project/oxc/commit/af13b1b) linter: Promote `eslint/no-eval` to `correctness` ([#&#8203;9231](https://redirect.github.com/oxc-project/oxc/issues/9231)) (dalaoshu)
-   [`542bbd7`](https://redirect.github.com/oxc-project/oxc/commit/542bbd7) linter: Support `import-x` plugin name ([#&#8203;9074](https://redirect.github.com/oxc-project/oxc/issues/9074)) (Sysix)
-   [`d266c29`](https://redirect.github.com/oxc-project/oxc/commit/d266c29) linter: Add eslint/max-nested-callbacks ([#&#8203;9172](https://redirect.github.com/oxc-project/oxc/issues/9172)) (ikkz)
-   [`86795d0`](https://redirect.github.com/oxc-project/oxc/commit/86795d0) linter: Implement grouped-accessor-pairs ([#&#8203;9065](https://redirect.github.com/oxc-project/oxc/issues/9065)) (yefan)
-   [`d70bad3`](https://redirect.github.com/oxc-project/oxc/commit/d70bad3) linter: Add eslint/no-unneeded-ternary rule ([#&#8203;9160](https://redirect.github.com/oxc-project/oxc/issues/9160)) (Cédric DIRAND)
-   [`4bd86e6`](https://redirect.github.com/oxc-project/oxc/commit/4bd86e6) linter: Add `fixer` for `unicorn/catch-error-name` ([#&#8203;9165](https://redirect.github.com/oxc-project/oxc/issues/9165)) (dalaoshu)

##### Bug Fixes

-   [`94bd2d8`](https://redirect.github.com/oxc-project/oxc/commit/94bd2d8) language_server: Fix `clippy::significant_drop_in_scrutinee` warning ([#&#8203;9234](https://redirect.github.com/oxc-project/oxc/issues/9234)) (Boshen)
-   [`69091c0`](https://redirect.github.com/oxc-project/oxc/commit/69091c0) linter: Correct default for `eslint/no-eval` ([#&#8203;9312](https://redirect.github.com/oxc-project/oxc/issues/9312)) (dalaoshu)
-   [`3031845`](https://redirect.github.com/oxc-project/oxc/commit/3031845) linter: Add option "allowTypeImports" for rule "no-restricted-imports" ([#&#8203;7894](https://redirect.github.com/oxc-project/oxc/issues/7894)) (Alexander S.)

##### Documentation

-   [`6c0f006`](https://redirect.github.com/oxc-project/oxc/commit/6c0f006) linter: Improve the documentation of eslint/no-useless-concat ([#&#8203;9179](https://redirect.github.com/oxc-project/oxc/issues/9179)) (Tom)
-   [`3414824`](https://redirect.github.com/oxc-project/oxc/commit/3414824) oxc: Enable `clippy::too_long_first_doc_paragraph` ([#&#8203;9237](https://redirect.github.com/oxc-project/oxc/issues/9237)) (Boshen)

##### Refactor

-   [`fb7df52`](https://redirect.github.com/oxc-project/oxc/commit/fb7df52) linter: Allow indirect `eval` by default for `eslint/no-eval` ([#&#8203;9302](https://redirect.github.com/oxc-project/oxc/issues/9302)) (dalaoshu)
-   [`b6fc0f6`](https://redirect.github.com/oxc-project/oxc/commit/b6fc0f6) linter: Improve `unicorn/consistent-function-scoping` ([#&#8203;9163](https://redirect.github.com/oxc-project/oxc/issues/9163)) (dalaoshu)

### [`v0.15.11`](https://redirect.github.com/oxc-project/oxc/blob/HEAD/npm/oxlint/CHANGELOG.md#01511---2025-02-16)

[Compare Source](https://redirect.github.com/oxc-project/oxc/compare/oxlint_v0.15.10...oxlint_v0.15.11)

##### Features

-   [`5d508a4`](https://redirect.github.com/oxc-project/oxc/commit/5d508a4) linter: Support `env` and `globals` in `overrides` configuration ([#&#8203;8915](https://redirect.github.com/oxc-project/oxc/issues/8915)) (Sysix)

</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:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNjcuMSIsInVwZGF0ZWRJblZlciI6IjM5LjE3Ni4yIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5IiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->
2025-02-28 10:43:57 +00:00
L-Sun
d476d3b1df fix(editor): android keyboard can not be opened (#10502)
Close [BS-2674](https://linear.app/affine-design/issue/BS-2674/[android]-%E6%96%87%E6%9C%AC%E7%BC%96%E8%BE%91%E5%8C%BA%E5%9F%9F%E7%82%B9%E5%87%BB%E5%90%8E%E6%97%A0%E6%B3%95%E6%BF%80%E6%B4%BB%E9%94%AE%E7%9B%98) [BS-2609](https://linear.app/affine-design/issue/BS-2609/[android]-%E8%BE%93%E5%85%A5%E7%9A%84-toolbar-%E6%B2%A1%E6%9C%89%E4%BA%86)
2025-02-28 08:23:26 +00:00
pengx17
cd0bec5d31 fix(core): at menu ux (#10485)
fix AF-2285

1. loading icon will be rendered to the group name
2. make the focused item more stable
2025-02-28 02:34:29 +00:00
Saul-Mirone
4c736bc190 feat(editor): type safe draft model and transformer (#10486) 2025-02-27 09:19:49 +00:00
Saul-Mirone
ce87dcf58e feat(editor): schema extension (#10447)
1. **Major Architectural Change: Schema Management**
   - Moved from `workspace.schema` to `store.schema` throughout the codebase
   - Removed schema property from Workspace and Doc interfaces
   - Added `BlockSchemaExtension` pattern across multiple block types

2. **Block Schema Extensions Added**
   - Added new `BlockSchemaExtension` to numerous block types including:
     - DataView, Surface, Attachment, Bookmark, Code
     - Database, Divider, EdgelessText, Embed blocks (Figma, Github, HTML, etc.)
     - Frame, Image, Latex, List, Note, Paragraph
     - Root, Surface Reference, Table blocks

3. **Import/Export System Updates**
   - Updated import functions to accept `schema` parameter:
     - `importHTMLToDoc`
     - `importHTMLZip`
     - `importMarkdownToDoc`
     - `importMarkdownZip`
     - `importNotionZip`
   - Modified export functions to use new schema pattern

4. **Test Infrastructure Updates**
   - Updated test files to use new schema extensions
   - Modified test document creation to include schema extensions
   - Removed direct schema registration in favor of extensions

5. **Service Layer Changes**
   - Updated various services to use `getAFFiNEWorkspaceSchema()`
   - Modified transformer initialization to use document schema
   - Updated collection initialization patterns

6. **Version Management**
   - Removed version-related properties and methods from:
     - `WorkspaceMetaImpl`
     - `TestMeta`
     - `DocImpl`
   - Removed `blockVersions` and `workspaceVersion/pageVersion`

7. **Store and Extension Updates**
   - Added new store extensions and adapters
   - Updated store initialization patterns
   - Added new schema-related functionality in store extension

This PR represents a significant architectural shift in how schemas are managed, moving from a workspace-centric to a store-centric approach, while introducing a more extensible block schema system through `BlockSchemaExtension`. The changes touch multiple layers of the application including core functionality, services, testing infrastructure, and import/export capabilities.
2025-02-26 11:31:29 +00:00
fundon
866b096304 fix(core): fix doc url parsing with custom domain names (#10444)
Closes: [AF-2279](https://affine-pro.slack.com/archives/C06CTBH5L4R/p1740552397245649?thread_ts=1740547457.278239&cid=C06CTBH5L4R)
2025-02-26 07:35:25 +00:00
donteatfriedrice
d63f16da5e fix(editor): affine preview root style (#10420)
Fix [BS-2677](https://linear.app/affine-design/issue/BS-2677/linked-doc-embed-view样式错误)

1. Only show the border of embed synced doc block (in note) when hover.
2. Fix affine preview root padding style, set padding only when affine preview root in embed synced doc block (in surface).
3. Only add the footnote config extension to the chat panel and chat block center peek. For footnotes in other page preview scenarios, such as footnote nodes within embed synced doc blocks or embed linked doc blocks, the hover effect should be maintained.
2025-02-26 04:25:24 +00:00
EYHN
2ec7de7e32 fix(core): add linked doc button (#10417) 2025-02-25 13:03:56 +08:00
Peng Xiao
7e892b3a7e fix(core): unused blobs query (#10399) 2025-02-25 10:58:43 +08:00
JimmFly
848145150d fix(core): close popover after successful invite in member editor (#10388) 2025-02-25 09:51:22 +08:00
Saul-Mirone
6289981fd1 refactor(editor): optimize extension register and effects (#10406)
Key Changes:

1. **Code Reorganization and Consolidation**
   - Created new centralized extension management through new files:
     - `enableEditorExtension` in `extensions/entry/enable-editor.ts`
     - `enablePreviewExtension` in `extensions/entry/enable-preview.ts`
   - Removed several spec-related files that are now consolidated:
     - Removed `specs/edgeless.ts`
     - Removed `specs/page.ts`
     - Removed `specs/preview.ts`

2. **Template Management**
   - Added new `register-templates.ts` file to handle template registration
   - Moved template registration logic from `specs/edgeless.ts` to this new file
   - Templates now include both edgeless and sticker templates

3. **Extension Management Changes**
   - Simplified extension enabling process through new centralized functions
   - `enableEditorExtension` now handles both page and edgeless modes
   - `enablePreviewExtension` consolidates preview-related extensions
   - Removed duplicate code for extension management

4. **Preview Functionality Updates**
   - Streamlined preview spec management
   - Consolidated footnote configuration
   - Improved theme and preview extension handling

5. **Dependencies and Effects**
   - Updated how effects are registered and managed
   - Simplified initialization process in `index.ts`
   - More organized approach to handling framework providers

The main theme of this PR appears to be code consolidation and simplification, moving from multiple specialized files to more centralized, reusable extension management. This should make the codebase more maintainable and reduce duplication while keeping the same functionality.

The changes primarily affect the editor's extension system, preview functionality, and template management, making these systems more modular and easier to maintain.
2025-02-24 10:37:59 +00:00
donteatfriedrice
1b2a4377fd feat(editor): update footnote node style and config (#10392)
[BS-2581](https://linear.app/affine-design/issue/BS-2581/优化-footnote-node-正文样式)
2025-02-24 08:15:04 +00:00
forehalo
b71fe291d1 fix(core): version control session (#10384) 2025-02-24 04:44:43 +00:00
Saul-Mirone
eef2f004b8 refactor(editor): reorg blocksuite ai code (#10372)
### TL;DR

Relocated AI-related code from `presets` directory to a dedicated `ai` directory for better organization and maintainability.

### What changed?

- Moved AI-related code from `blocksuite/presets/ai` to `blocksuite/ai`
- Relocated AI chat block code from `blocksuite/blocks` to `blocksuite/ai/blocks`
- Updated imports across files to reflect new directory structure
- Renamed `registerBlocksuitePresetsCustomComponents` to `registerAIEffects`
- Fixed path references in GitHub workflow file

### How to test?

1. Build and run the application
2. Verify AI functionality works as expected:
   - Test AI chat blocks
   - Check AI panel functionality
   - Verify AI copilot features
   - Ensure AI-related UI components render correctly

### Why make this change?

This restructuring improves code organization by:
- Giving AI features a dedicated directory that better reflects their importance
- Making the codebase more maintainable by grouping related AI functionality
- Reducing confusion by removing AI code from the more general `presets` directory
- Creating clearer boundaries between AI and non-AI related code
2025-02-23 09:26:00 +00:00
Saul-Mirone
2cf9a8f286 refactor: reorganize specs and adapter extensions (#10359)
### TL;DR
Refactored `SpecProvider` singleton access pattern and reorganized adapter/extension code structure.

### What changed?
- Changed `SpecProvider.getInstance()` to `SpecProvider._` for cleaner singleton access
- Moved adapter/extension code from `_common` directory to dedicated `adapters` and `extensions` folders
- Consolidated adapter extensions into a single file
- Removed unused dependencies from package.json
- Deleted unnecessary schema files
- Extracted `MobileSpecsPatches` class into the mobile patching code
- Updated all references to use the new `SpecProvider._` accessor

### How to test?
- Verify all specs are properly registered and accessible via `SpecProvider._`
- Test adapter functionality for HTML, Markdown, Notion HTML and plain text
- Check mobile-specific features and patches work correctly
- Ensure preview functionality works in both page and edgeless modes

### Why make this change?
- Improves code organization by properly separating adapters and extensions
- Simplifies singleton access pattern
- Removes unnecessary dependencies and files
- Makes the codebase more maintainable by consolidating related functionality
2025-02-21 14:25:35 +00:00
pengx17
6e399ce34b fix(core): unused blobs query (#10350)
The default limit is 100.
2025-02-21 10:14:00 +00:00
Peng Xiao
dff68b9aae fix(core): blocksuite editor runtime configs in correct timing (#10344) 2025-02-21 17:16:53 +08:00
Cats Juice
09cc5c392b refactor(core): new workspace selector and create dialog (#10323) 2025-02-21 17:16:38 +08:00
Saul-Mirone
adcc6b578c refactor(editor): move editor components to frontend core (#10335)
### TL;DR
Moved editor components from BlockSuite presets to AFFiNE core and updated imports accordingly.

### What changed?
- Relocated `EdgelessEditor` and `PageEditor` components from BlockSuite presets to AFFiNE core
- Removed basic editor examples from playground
- Updated import paths across the codebase to reference new component locations
- Added editor effects registration in AFFiNE core
- Removed editor exports from BlockSuite presets

### How to test?
1. Launch the application
2. Verify both page and edgeless editors load correctly
3. Confirm editor functionality remains intact including:
   - Document editing
   - Mode switching
   - Editor toolbars and controls
   - Multiple editor instances

### Why make this change?
This change better aligns with AFFiNE's architecture by moving editor components closer to where they are used. It reduces coupling with BlockSuite presets and gives AFFiNE more direct control over editor customization and implementation.
2025-02-21 04:28:54 +00:00
JimmFly
785951bbfa fix(core): adjust copy link button styles (#10337)
close PD-2344
![CleanShot 2025-02-21 at 11 22 32@2x](https://github.com/user-attachments/assets/97d1052b-c900-47df-89ba-476787a28587)
![CleanShot 2025-02-21 at 11 22 08@2x](https://github.com/user-attachments/assets/2b455797-dfc8-4572-95ac-3ee8b33b0528)
2025-02-21 03:58:03 +00:00
Saul-Mirone
5ac15f12e6 refactor: replace editor container with editor host (#10328)
### TL;DR
Refactored editor access to use `EditorHost` instead of `AffineEditorContainer` and updated mode access through `DocModeProvider`.

### What changed?
- Changed editor property types from `AffineEditorContainer` to `EditorHost` across multiple components
- Updated mode access to use `DocModeProvider` service instead of direct editor mode access
- Modified editor references to use `editor.host` where appropriate
- Updated scroll and highlight utilities to work with `EditorHost`

### How to test?
1. Open a document in both page and edgeless modes
2. Verify outline panel functionality works as expected
3. Test outline viewer navigation and highlighting
4. Confirm mobile outline menu operates correctly
5. Check that frame panel and TOC features work in all modes

### Why make this change?
This change improves architectural consistency by using `EditorHost` directly and accessing mode through the proper service provider. This makes the code more maintainable and follows better dependency practices by using the correct abstraction levels.
2025-02-20 14:20:32 +00:00
Saul-Mirone
1516903c77 refactor: move doc-title and ai-chat-block components (#10316)
### TL;DR
Moved doc title and AI chat block components to more appropriate locations while removing unused backlink functionality.

### What changed?
- Relocated doc title component from presets to affine-components
- Moved AI chat block from presets/blocks to blocks directory
- Removed unused backlink-related code and components
- Updated imports across files to reference new component locations
- Consolidated AI-related exports through a single entry point

### How to test?
1. Verify doc title still renders correctly in documents
2. Confirm AI chat functionality works as expected
3. Check that no backlink-related features are accessible
4. Ensure all AI features continue to work through the new import paths

### Why make this change?
This reorganization improves code organization by:
- Placing components closer to their related functionality
- Removing dead/unused code around backlinks
- Simplifying the import structure for AI-related features
- Making the codebase more maintainable by consolidating related components
2025-02-20 10:45:47 +00:00
EYHN
5042d9f644 fix(nbstore): check before save empty update (#10304) 2025-02-20 04:24:50 +00:00
JimmFly
1d339c682b fix(core): adjust share menu and upgrade-to-team page style (#10299)
close PD-2330 PD-2331 AF-2238
2025-02-20 04:10:52 +00:00
forehalo
02f567f2c0 chore(core): better doc action error message (#10288) 2025-02-19 10:38:38 +00:00
JimmFly
b456feee63 fix(core): unexpected redirect to expired page after accepting invitation (#10257)
Co-authored-by: EYHN <cneyhn@gmail.com>
2025-02-19 09:10:12 +00:00
JimmFly
487158b9ca fix(core): incorrect permissions displayed in member management (#10269) 2025-02-19 16:58:06 +08:00
JimmFly
e5a1595980 feat(core): add tracking events to doc role management (#10221) 2025-02-19 16:39:50 +08:00
pengx17
29f8a627b6 fix(core): center peek doc view circular deps (#10253) 2025-02-19 02:23:53 +00:00
EYHN
5a7ab880c1 fix(core): fix ios blob upload (#10263) 2025-02-19 10:07:46 +08:00