Commit Graph

782 Commits

Author SHA1 Message Date
Saul-Mirone
6e76a3e593 feat(editor): add frame title and mobile toolbar widget extension (#11996)
Closes: BS-3223
Closes: BS-3224

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Introduced new view extensions for frame title and keyboard toolbar widgets with conditional registration based on context and environment.
  - Enhanced widget integration by adding explicit exports for view components.

- **Chores**
  - Updated export paths and package dependencies to improve modularity and compatibility.
  - Removed deprecated widget dependencies and related imports from core packages.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-26 02:45:18 +00:00
Saul-Mirone
25a2b94a43 feat(editor): edgeless auto connect widget extension (#11990)
Closes: BS-3221
Closes: BS-3222

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Introduced extensions that conditionally register edgeless auto-connect and toolbar widgets with associated effects based on the view context.
  - Added new exports for edgeless auto-connect and toolbar widget views, making them available for external use.

- **Chores**
  - Updated dependencies and project references to include the extension loader for improved module integration.
  - Refined workspace configuration to reflect new package dependencies.

- **Refactor**
  - Streamlined registration and effect logic by removing legacy integration points for edgeless auto-connect and toolbar widgets.
  - Reorganized widget export paths to a more modular directory structure.

- **Bug Fixes**
  - Disabled pointer events on the edgeless navigator black background to prevent interaction interference.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-26 01:21:49 +00:00
donteatfriedrice
4887e1d612 refactor(editor): improve footnote URL preprocessor (#11975)
Closes: [BS-3302](https://linear.app/affine-design/issue/BS-3302/處理-affine-中的-redos-風險)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **Bug Fixes**
	- Improved handling of footnote definitions with varied spacing, special characters, and malformed or incomplete entries, ensuring more reliable processing and display.
- **New Features**
	- Introduced advanced parsing for footnote URLs to improve accuracy and validation of footnote content.
- **Tests**
	- Expanded test coverage for footnote processing to include additional edge cases and mixed content scenarios, enhancing overall robustness.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-25 09:17:46 +00:00
fundon
aae65d231c fix(editor): should toggle toolbar when creating connector via auto complete (#11862)
Closes: [BS-2403](https://linear.app/affine-design/issue/BS-2403/[improvement]-edgeless-拖出-connector-时,yuan素的-toolbar-需要消失)
2025-04-24 16:04:45 +00:00
donteatfriedrice
cce31e822f feat(editor): update footnote popup style (#11932)
Closes: [BS-3113](https://linear.app/affine-design/issue/BS-3113/footnote-popup-ui-更新)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added a description display below the chip in the footnote popup when available.

- **Style**
  - Improved the appearance of footnote popups with enhanced border radius, padding, and layout.
  - Updated font styling for labels and descriptions.
  - Simplified chip styling by reducing height and removing unnecessary CSS properties.

- **Bug Fixes**
  - Tooltip content for URL references now displays both the link preview title and URL when available.

- **Refactor**
  - Simplified click handling by attaching it to the container instead of individual elements.
  - Removed unused click event properties from the footnote popup chip.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-24 15:48:30 +00:00
forehalo
4ffa37d1c3 chore: proxy image preview in frontend (#11957)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
	- Images and icons in bookmark cards are now loaded through an image proxy for improved reliability and consistency.
	- Embed blocks for GitHub, Loom, and YouTube now display banner and creator images via an image proxy service for enhanced image loading.

- **Refactor**
	- Simplified backend URL handling and proxy logic for images, resulting in more efficient processing and reduced complexity.
	- Consolidated image proxy middleware and services into a shared adapter module for streamlined imports and improved maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-24 10:23:25 +00:00
Saul-Mirone
1d38e5787b feat(editor): drag handle widget extension (#11962)
Closes: BS-3220
2025-04-24 09:47:36 +00:00
Saul-Mirone
b66d2d58a1 feat(editor): surface block extension (#11961)
Closes: BS-3204
2025-04-24 09:47:36 +00:00
Saul-Mirone
d6e7039b7b refactor(editor): remove unused block dependencies (#11959)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **Chores**
  - Updated package dependencies to reduce the number of direct dependencies for improved maintainability. No changes to user-facing features or functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-24 09:47:35 +00:00
Saul-Mirone
2200bd7b70 feat(editor): text gfx extension (#11951)
Closes: BS-3213
2025-04-24 03:21:54 +00:00
Saul-Mirone
9d90899344 feat(editor): group gfx extension (#11950)
Closes: BS-3208

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Introduced a new group view extension, enhancing how group elements are handled and displayed.
  - Added new store and view modules for group-related features, improving modularity and integration.

- **Refactor**
  - Updated the group element architecture to use extension-based registration for views, toolbars, and effects.
  - Simplified and reorganized exports for group and text modules.

- **Chores**
  - Updated dependencies and project references to improve build consistency and compatibility.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-24 03:21:54 +00:00
doodlewind
2d3130eac9 fix(editor): turbo renderer placeholder for built in template (#11793)
Fixed compat error for new built-in template with test updated.

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/lEGcysB4lFTEbCwZ8jMv/f8c69d3f-9602-4509-994b-7243b26b4656.png)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Added an option to enable or disable bitmap rendering in the renderer settings.
  - Introduced a cooldown period after zooming before block optimization resumes, improving rendering performance and stability.

- **Bug Fixes**
  - Improved handling of cases where block components may be missing, preventing potential runtime errors.

- **Tests**
  - Expanded and refined tests to verify zooming behavior, bitmap caching, and internal state transitions for enhanced reliability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-24 02:40:04 +00:00
Xun Sun
8ea0d78862 fix(editor): preserve tag name updates on modifying tag color (#11744) 2025-04-24 10:09:17 +08:00
Xun Sun
3b4fcbd526 fix(editor): for single-select, picking the original option should make the TagManager disappear (#11745) 2025-04-24 10:09:00 +08:00
Saul-Mirone
20d4911641 refactor(editor): move connector overlay to connector package (#11944) 2025-04-24 01:27:28 +00:00
Saul-Mirone
0cd7111f20 feat(editor): connector gfx extension (#11940)
Closes: BS-3207
2025-04-24 01:27:28 +00:00
Saul-Mirone
9c0633b75c feat(editor): template gfx extension (#11939)
Closes: BS-3212
2025-04-24 00:49:39 +00:00
Saul-Mirone
f0a233368d feat(editor): mindmap gfx extension (#11936)
Closes: BS-3209

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Introduced mind map view and store extensions, enhancing mind map integration and conversion to plain text and markdown formats.
  - Added priority property to quick tools, allowing for custom ordering in the toolbar.
- **Improvements**
  - Toolbar quick tools are now sorted by priority for a more intuitive user experience.
  - Updated toolbar and extension configurations to streamline available tools and extensions.
- **Bug Fixes**
  - Conditional registration of certain components ensures correct behavior in edgeless mode.
- **Chores**
  - Updated dependencies and project references to improve module integration and maintainability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-24 00:49:38 +00:00
Saul-Mirone
bc0530a708 feat(editor) shape gfx extension (#11928)
Closes: BS-3211
2025-04-23 15:46:23 +00:00
Saul-Mirone
61121ab727 feat(editor): brush and note gfx extension (#11927)
Closes: BS-3206
Closes: BS-3210

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Introduced new brush and note view extensions, enhancing integration and extensibility for brush and note tools.
  - Added store extension for brush tools, allowing for improved adapter integration.

- **Improvements**
  - Expanded module exports for brush and note graphics, making store and view functionalities more accessible.
  - Added new dependencies to support extension loading and improved project structure.

- **Refactor**
  - Updated extension arrays and toolbars to use the new view and store extensions for brush and note tools.
  - Removed legacy brush and note tools, effects, and toolbar extensions in favor of the new extension-based approach.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-23 15:46:22 +00:00
Saul-Mirone
ea391779dd feat(editor): inline preset extension (#11919)
Closes: BS-3214
2025-04-23 14:26:20 +00:00
EYHN
4df75ec5d0 fix(core): subscribe search not unsubscribe (#11929) 2025-04-23 13:56:58 +00:00
donteatfriedrice
db5eadb72a feat(editor): add favicon, title, description support for footnote url reference (#11924)
Closes: [BS-3272](https://linear.app/affine-design/issue/BS-3272/footnote-适配-exa-api-返回结果)

## What's Changed

Add link preview data support (favicon, title, description) for URL references in footnotes:
- Store and display URL preview data in footnotes
- Add encoding/decoding support for favicon URLs
- Optimize link preview by using existing preview data when available
2025-04-23 11:57:25 +00:00
Saul-Mirone
16831e8c0e feat(editor): reference, mention and latex inline extension (#11914)
Closes: BS-3215
Closes: BS-3218
Closes: BS-3217
2025-04-23 09:22:16 +00:00
L-Sun
9dbdd4b7ba refactor(editor): add helper function for undo notification (#11903)
### What Changes
- Refactors the `notify` function call with undo button. It is called `notifyWithUndo`, which can  associate the visibility of the `NotificationCard` with the top undo item in history stack, such as undo by shortcut `Cmd+Z`.
- change icon of the "Insert into page" button. Close [BS-3267](https://linear.app/affine-design/issue/BS-3267/frame和group的insert-into-page图标也更换一下)
2025-04-23 05:56:23 +00:00
L-Sun
27ff9ab9f4 refactor(core): move actions to footer of notification card (#11894)
This PR move all actions button to the footer of `NotificationCard`. There are some example as following:

### No Changes
![CleanShot 2025-04-22 at 20.02.58@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/MyRfgiN4RuBxJfrza3SG/1207cbfb-6033-48f4-8a7b-b7b024f16881.png)

![CleanShot 2025-04-22 at 20.03.42@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/MyRfgiN4RuBxJfrza3SG/6da27303-06c3-4f40-b3f9-3cf88759f685.png)

![CleanShot 2025-04-22 at 20.03.57@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/MyRfgiN4RuBxJfrza3SG/a53d2bdf-a103-4275-9833-a55387af6f09.png)

### Changes
### Before
![CleanShot 2025-04-22 at 20.07.40@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/MyRfgiN4RuBxJfrza3SG/d785b12b-480c-4b9d-bb0b-d93dd18939a2.png)

#### After
![CleanShot 2025-04-22 at 20.05.51@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/MyRfgiN4RuBxJfrza3SG/242a9956-6a68-46a7-865a-454117ee997c.png)
2025-04-23 05:41:14 +00:00
Saul-Mirone
b1aecfc1c4 feat(editor): link inline extension (#11910)
Closes: BS-3216
2025-04-23 04:42:24 +00:00
doodlewind
1b2030b36a fix(editor): should not paste in readonly page mode (#11913)
### TL;DR

Prevent pasting content when a document is in readonly mode.

### What changed?

Added a check in the `PageClipboard` class to prevent pasting operations when the document is in readonly mode. The function now returns early if `this.std.store.readonly` is true, preventing any clipboard operations from being executed.

### How to test?

1. Open a document and add some content
2. Set the document to readonly mode: `document.querySelector('affine-page-root')!.doc.readonly = true`
3. Try to paste content into the document using:
   - Regular paste operation
   - Keyboard shortcut (Ctrl+V/Cmd+V)
4. Verify that no content is pasted and the document remains unchanged
5. Set the document back to editable mode and confirm pasting works again

### Why make this change?

This change ensures that documents in readonly mode maintain their integrity by preventing unintended modifications through clipboard operations. This is consistent with the expected behavior of readonly documents, where users should not be able to modify content through any means.
2025-04-23 04:30:26 +00:00
Saul-Mirone
730ed16fc5 refactor(editor): remove old specs (#11909) 2025-04-23 02:57:01 +00:00
Saul-Mirone
2510e7a9a4 feat(editor): inline footnote extension (#11908)
Closes: BS-3219
2025-04-23 01:40:49 +00:00
Saul-Mirone
6fbbfc80e5 refactor(editor): move block-specific extensions to their respective modules (#11907)
### TL;DR

Refactored extension registration to follow a more modular approach by moving extensions to their respective block packages.

### What changed?

- Removed centralized registration of several extensions from `store.ts` in the main package
- Moved the following extensions to their respective block packages:
  - `CodeMarkdownPreprocessorExtension` to the code block package
  - `LatexMarkdownPreprocessorExtension` to the latex block package
  - `EmbedIframeConfigExtensions` and `EmbedIframeService` to the embed block package
  - `ImageStoreSpec` removed from central registration
- Cleaned up unused arrays and imports in the main store file
- Removed empty `defaultBlockPlainTextAdapterMatchers` array

### How to test?

1. Verify that markdown preprocessing for code and latex blocks still works correctly
2. Check that iframe embeds function properly
3. Ensure image handling continues to work as expected
4. Test import/export functionality for all affected block types

### Why make this change?

This change improves code organization by following a more modular architecture where each block package is responsible for registering its own extensions. This approach reduces coupling between packages, makes the codebase more maintainable, and follows the principle that extensions should be registered where they are defined.
2025-04-23 01:16:08 +00:00
Saul-Mirone
24edfc75bd feat(editor): table extension (#11906)
Closes: BS-3205
2025-04-23 01:16:08 +00:00
Saul-Mirone
e57222b89a feat(editor): surface ref extension (#11902)
Closes: BS-3203
2025-04-23 01:16:07 +00:00
L-Sun
020c1a7598 fix(editor): lit change-in-update warning (#11904)
This PR fixed that lit change-in-update warning. Related #9446

### Before

![CleanShot 2025-04-23 at 02.18.16@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/MyRfgiN4RuBxJfrza3SG/e1205c41-7890-4de8-ba14-99a88f66a9ac.png)

### After
![CleanShot 2025-04-23 at 02.18.42@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/MyRfgiN4RuBxJfrza3SG/45bff6e5-a56f-43ac-abe9-6da9b75baca5.png)
2025-04-22 20:25:54 +00:00
Saul-Mirone
45b6cbe8d7 refactor(editor): cleanup dead code (#11893) 2025-04-22 15:51:23 +00:00
Saul-Mirone
43966a6c6b feat(editor): use store extension manager (#11891)
Closes: BS-3284
2025-04-22 15:51:23 +00:00
Saul-Mirone
99ad4e871e feat(editor): use migrated extensions (#11886)
Closes: BS-3283
2025-04-22 15:51:22 +00:00
donteatfriedrice
bbdea71686 fix(editor): add footnote url markdown preprocessor to avoid link node parsing (#11888)
Closes: [BS-3282](https://linear.app/affine-design/issue/BS-3282/预处理-footnote-definition-中的-url-避免-markdown-link-node-parsing)
2025-04-22 14:19:10 +00:00
fundon
4fd468c46f fix(editor): remove unnecessary css styles (#11885) 2025-04-22 10:48:11 +00:00
doouding
b59f6ebde0 refactor: default-tool box selection (#11800)
### Changed
- Rewrite box selection in `default-tool`, the view can decide whether to be selected in box selection by return a boolean value in `onBoxSelected` method
- Cleanup unnecessary states in `default-tool` and some naming problem
2025-04-22 08:18:26 +00:00
doouding
1d58792631 chore: remove frame overlay dependency from default-tool (#11762) 2025-04-22 08:18:25 +00:00
doouding
e0e84d302d refactor: moving connector label to connector view (#11738)
### Changed
Moved connector label moving logic from `default-tool` to connector view.

#### Other infrastructure changes:​​
- Gfx element view now can handles drag events
- Added `context.preventDefault()` support to bypass built-in interactions in extension
- Handle the pointer events in element view will bypass the built-in interactions automatically

> The built-in interactions include element dragging, click selection, drag-to-scale operations, etc.
2025-04-22 08:18:24 +00:00
doouding
21bf009553 refactor: migrate elements clone from default-tool to extension (#11703)
### Changed
- Add `onRequestElementsClone` action to allow extension to define how to clone gfx elements
2025-04-22 08:18:23 +00:00
doouding
52953ce8e3 refactor: redesign element transform manager interface (#11679)
### Change
- Rename `ElementTransformManager` -> `InteractivityManager`
- Now you can `event.on` and `action.onXXX` method to extend interactivity behaviour. The old approach of overriding methods directly is deprecated.
2025-04-22 08:18:23 +00:00
L-Sun
e457e2f8a8 fix(editor): add reference after duplicate edgeless embed doc as note (#11877)
- fix(editor): add reference in the copied note of embed doc
- refactor(editor): add generics parameter `TextAttributes` into `Text`
2025-04-22 08:03:52 +00:00
Saul-Mirone
6d6504e2af feat(editor): replace spec provider with extension manager (#11861)
Closes: BS-3273
2025-04-22 07:40:41 +00:00
fundon
fd67bdf88b fix(editor): should update color of edgeless text when switching theme (#11853)
Closes: [BS-3258](https://linear.app/affine-design/issue/BS-3258/edgeless-text-颜色不符合预期)
2025-04-21 13:54:12 +00:00
Saul-Mirone
846410cdb6 feat(editor): note extension (#11856)
Closes: BS-3200
Closes: BS-3201
2025-04-21 13:18:35 +00:00
L-Sun
a2b40fea20 feat(editor): insertion and duplication actions for embed synced doc (#11852)
Close [BS-3068](https://linear.app/affine-design/issue/BS-3068/在edgeless-的embed-doc-block上,增加-insert-into-page的选项,类似frame)
Close [BS-3069](https://linear.app/affine-design/issue/BS-3069/edgeless下的-embed,覆盖现在的edit行为-,暂定叫做duplicate-into-a-note,复制一个-note)
2025-04-21 11:01:04 +00:00
Saul-Mirone
7c79b1f024 feat(editor): latex and list extensions (#11851)
Closes: BS-3198
Closes: BS-3199
2025-04-21 10:29:31 +00:00