@blocksuite/editor@0.4.0
版本发布时间: 2023-02-18 23:50:15
toeverything/blocksuite最新发布版本:v0.9.0(2023-10-18 20:24:04)
Announcing BlockSuite 0.4.0
💠 We are excited to announce the release of BlockSuite 0.4.0! This new version is shipped in AFFiNE Alpha "Downhills". With 484 pull requests merged and 15 new contributors involved, BlockSuite has evolved significantly over this period.
📦 Blocks & UI Components
- The DragHandle component is supported (#543 #572 #592 #593 #742 #698) by @Himself65 @fundon. This allows for convenient reordering of blocks.
- The BlockHub component is supported (#731 #773 #915 #1092 #1108 #1112 #1173) by @thorseraq. This makes it easy to insert blocks from a visible positioned popup.
- The SlashMenu component is supported (#571 #791 #917 #1072 #1202 #1191) by @lawvs. This provides Notion-like quick menu when pressing the
/
key. - The new
affine:surface
block flavour (#517 #664 #716 #721 #739 #740 #774 #775 #797 #809) is added by @doodlewind @Himself65. This is a singleton block type that contains whiteboard elements and is always displayed at the top-level inside the page. - The new ShapeElement is supported (#790 #808 #1104) by @doodlewind @alt1o. This is a supported element type inside the phasor surface renderer.
- The new
affine:database
block flavour (#770 #831 #909 #913 #920 #959 #960 #961) is added by @Himself65 (experimental). This is the foundation of view transforming. - The indenting of multiple blocks is supported (#1093) by @Innei.
- The bracket autocomplete for native range selected text is supported (#630) by @lawvs.
- The block level selection can be kept during scroll (#1003), supported by @fundon.
- The new EdgelessToolbar component is supported (#923) by @thorseraq. This ships with the default edgeless UI container.
🏗️ Architecture & Editor Infra
- The class-based block model is replaced by zod-based schema (#859 #868) by @Himself65. This allows for more declarative and block definition.
- The block-specific methods are abstracted into
BlockService
(#856 #857) by @Himself65. This provides composable ways defining block methods. - The new
addBlockByFlavour
API is supported (#628) by @Himself65. This allows for adding blocks in a type-safe way. - The feature flag mechanism is supported (#658 #690 #695) This allows for enabling or disabling feature at runtime, and also makes the single-master development possible by merging immature features into master but opt-out by default.
- The
BlockTag
entity is supported (#734) by @Himself65. This enables attaching group-able tags onto blocks. - The new
virgo
package is added (#912 #932 #943 #944 #948 #974 #1243) by @Flrande. This is a tiny rich-text editing component we designed to replace Quill in the future. - The new
phasor
package is added (#546 #552 #806 #890 #891) by @doodlewind. This is a canvas-based renderer designed for optimized whiteboard content rendering. - The new
global
package is added (#618) by @Himself65. This allows for better cross-package typing and reusability of common utils.
📚 Misc
- Image blob uploading support (#735 #786 #918 #1188).
- HMR support in playground (#621 #1050).
- URL-based markdown import in playground (#825).
- Adaptive height support for QuickFormatBar (#777).
- YDoc binary exporting support in playground (#509).
- Mode switch support in edgeless mode (#514).
- Markdown import support for image and code block (#544).
- Markdown export support for del and underline format (#651).
- Ctrl-enter hotkey support (#821).
- CSS debug menu support (#901).
- Debug log support (#710 #928).
- New
SimpleAffineEditor
pre-configured editor component (#811). - Use random room by-default in playground (#594).
- New BlockSuite logo (#966 #1119).
🧹 Refactoring
- The
affine:group
block flavour is renamed toaffine:frame
(#520). - The
SelectionController
is replaced byMouseModeController
(#745). - The
AwarenessAdapter
is replaced byAwarenessStore
(#780). - The
Signal.fromEvent
is replaced bySignal.disposableListener
(#1114). - The
IndexedDBBlobProvider
is replaced byDuplexBlobProvider
(#866). - The
affine:shape
block flavour is removed (#804). - The disposable callbacks are replaced by
DisposableGroup
(#760). - The
PrelimText
type is removed (#1146). - The
page
field inText
is removed (#1146).
🙌 New Contributors
- @zoulamZero made their first contribution in https://github.com/toeverything/blocksuite/pull/584
- @fi3ework made their first contribution in https://github.com/toeverything/blocksuite/pull/587
- @AkaraChen made their first contribution in https://github.com/toeverything/blocksuite/pull/596
- @fundon made their first contribution in https://github.com/toeverything/blocksuite/pull/607
- @pengx17 made their first contribution in https://github.com/toeverything/blocksuite/pull/673
- @Innei made their first contribution in https://github.com/toeverything/blocksuite/pull/569
- @jackeydou made their first contribution in https://github.com/toeverything/blocksuite/pull/701
- @pionxzh made their first contribution in https://github.com/toeverything/blocksuite/pull/712
- @SteinsHead made their first contribution in https://github.com/toeverything/blocksuite/pull/718
- @pingren made their first contribution in https://github.com/toeverything/blocksuite/pull/798
- @co-decode made their first contribution in https://github.com/toeverything/blocksuite/pull/1013
- @Agility6 made their first contribution in https://github.com/toeverything/blocksuite/pull/1068
- @gotjoshua made their first contribution in https://github.com/toeverything/blocksuite/pull/1131
- @lzlme made their first contribution in https://github.com/toeverything/blocksuite/pull/1199
- @zqran made their first contribution in https://github.com/toeverything/blocksuite/pull/1262
🐛 Detailed Bugfixes
- fix: incorrect code block short ligatures (#511)
- fix: add a minimum limit on the drag-and-drop width of images (#513)
- fix: unexpected behaviour of markdown shortcut when creating code block and inline code (#512)
- fix: code block language does not keep after refreshing page (#516)
- fix: when image size too large, option operation should show inside (#515)
- fix: remove css files (#523)
- fix: keep image meta fields in clipboard (#519)
- fix: remove css import (#524)
- fix: indent operation in rich text (#528)
- fix: select all with hot key at the start of the line (#537)
- fix: paste at the start of line (#540)
- fix: use
animationend
event (#541) - fix: toast dom not removed (#542)
- fix: update block cache when mouse move (#549)
- fix: phasor ts config (#550)
- fix: indent should not work under some block (#553)
- fix: cursor lose outside container (#555)
- fix: export HTML or Markdown format lost (#547)
- fix: drag handle appear in edgeless mode (#557)
- fix: delete selected content on cut (#548)
- fix: drag position in list block (#563)
- fix(playground): split room in different version (#568)
- fix: block shouldn't highlighted when not dragging (#578)
- fix: cleanup drag handle (#579)
- fix: multi-line title size after undo/redo (#584)
- fix: use flex in children container (#586)
- fix: native selection (#588)
- fix: move drag handle outside blocks (#598)
- fix: keep cursor to title when deleting at the start of the first block (#580)
- fix: hide drag handle on wheel (#604)
- fix: image rect (#606)
- fix: remove unused detection (#614)
- fix:
captureSync
on creating code block & filter hotkey listener (#597) - fix: move drag handle when resize window (#622)
- fix: code block unexpectedly get focus (#631)
- fix: keep code block option popup open on hover (#634)
- fix: use manual shallow copy on
DOMRect
(#643) - fix: optimize
isForward
detection inSelectionManager
(#640) - fix: delete code block when selected (#637)
- fix: return the correct delta result in
sliceToDelta
(#635) - fix: import
@blocksuite/blocks
cause ts error in other monorepos (#654) - fix: drag handle behavior in Firefox browser (#656)
- fix: parse inline html into single paragraph (#659)
- fix(blocks): set supressWarning to true of quill-cursors (#661)
- fix: query code block container when loading (#666)
- fix: global types unreachable in downstream package (#668)
- fix: blot types (#665)
- fix: type
SurfaceBlockModel
(#672) - fix: peer cursor updates sometimes does not emit "change" event (#673)
- fix: blob import with cors header (#678)
- fix: cant reach the last block in nesting (#677)
- fix: collect wrong BaseBlockModel[] at _block() (#681)
- fix: line number for wrapped lines (#680)
- fix: adapting parent index of blocks to binarySearchBlockEditingState (#685)
- fix: should check that parentIndex is not undefined (#688)
- fix: use
Partial
in defaultFlags (#691) - fix: disable hotkey format and redo/undo in readonly mode (#693)
- fix: undo/redo is unavailable in title (#701)
- fix: revert .nvmrc (#705)
- fix: bring children to father model (#707)
- fix: handle children when delete a block (#708)
- fix: delete selected text on enter (#712)
- fix: hide mock line element properly (#713)
- fix: should keep first line format when pasted into a new line (#715)
- fix: should not create link in readonly mode (#719)
- fix: incorrect comparison in
assertEquals
(#725) - fix: uniform event handler outside of rich text (#724)
- fix: click bottom should add a new paragraph block (#727)
- fix: flaky test case with raw enter press (#730)
- fix: surface history with transact origin (#746)
- fix: indicator lifecycle on direct opening edgeless mode (#748)
- fix: use
requestAnimationFrame
(#751) - fix: replace text when paste to a block (#718)
- fix(global): compatibility with cjs (#767)
- fix: block hub subscribe (#769)
- fix: edgeless selection rect index over block hub (#781)
- fix: reuse comparePoint to decide dragging direction during native selection (#783)
- fix: add font family for blockHub & fix menu padding (#787)
- fix: embed component lifecycle warning (#788)
- fix: drop throw error when using drag handle (#789)
- fix: try to re-attach the quill when connected (#792)
- fix: parse partially select text in
sliceToDelta
(#798) - fix: slash menu position at line start (#805)
- fix: avoid irrelevant global style mutation (#817)
- fix: browser compatibility issues (#819)
- fix(global): exports in package.json (#820)
- fix(editor): move themes to top level (#822)
- fix(blocks): use
isPageTitleElement
(#828) - fix(playground): type on
env.d.ts
(#832) - fix(edgeless): surface structure with
?init=empty
(#836) - fix(global): improve test case on
isEqual
(#842) - fix: handle None selection in format quick bar (#830)
- fix: update append behavior (#848)
- fix: enable slash menu on playground (#849)
- fix(blocks): forbid user to delete a block inside database block (#850)
- fix(blocks): add readonly restriction in
DefaultSelectionManager
(#852) - fix: keep native range on cross-block dragging (#845)
- fix(next-example): remove ts-ignore (#871)
- fix: update code type (#867)
- fix: keep native range on cross-frame dragging (#876)
- fix: should select full text of the first block in edgeless mode (#883)
- fix: should select text in title after selecting text in frame (#887)
- fix: delete children by default (#895)
- fix: database settings sidebar position (#898)
- fix: typing on the end of code (#905)
- fix: block hub card list hover state & hovertip style (#911)
- fix: keep blank-area-click cursor in edgeless mode (#878)
- fix: wrap update using transact (#921)
- fix: redundant parents are selected during drag selection (#904)
- fix: block hub z-index (#940)
- fix(blocks): disable database when not enabled (#950)
- fix: format bar position is unstable (#951)
- fix(blocks): rich text type on database block (#953)
- fix(blocks): editing state in database block (#954)
- fix: drag handle can not escape database block when moving mouse (#957)
- fix(blocks): enable database flag in block hub (#964)
- fix(virgo): fix unexpected space (#973)
- fix: sync selected blocks to selection-manager when clicking draghandle (#975)
- fix: add event to quill keyboard context (#979)
- fix: add version to cancel workflow (#981)
- fix: handle native range on dragging out of frame (#886)
- fix(blocks): select cell in database block (#984)
- fix: return
Disposable
inSignal.once()
(#986) - fix(playground): use logo.svg (#987)
- fix: isAtLineEdge with format (#947)
- fix(virgo): fix getDeltasByVRange (#991)
- fix: format bar position at line edge (#980)
- fix: render
selectedRects
based on viewport scroll (#988) - fix: should set overflow to hidden on body (#997)
- fix(blocks): frame selection rect (#998)
- fix(virgo): fix toVRange (#1001)
- fix: clear selection when press esc keydown (#993)
- fix: click title when divider block on the first (#1006)
- fix(blocks): press enter on title (#1008)
- fix: prohibit creating divider within quote (#1013)
- fix: remove event listener with options (#1025)
- fix: unable to select embed block #994 (#1028)
- fix: keydown position in line edge and empty line (#1021)
- fix(store): support remote update signal (#1035)
- fix: build exports (#1038)
- fix: replacing keyboard module (#1039)
- fix: local dev sourcemap issue (#1047)
- fix: refresh drag handle state when hovering on code block and image block (#1051)
- fix(blocks): paragraph font weight on children (#1060)
- fix: unstable text selection in edgeless mode (#1065)
- fix: edgeless-toolbar style (#1068)
- fix: keydown at line edge (#1043)
- fix: abort format bar when popstate (#1048)
- fix: try register code block service (#1080)
- fix(editor): do not parse redundant divs in HtmlParser (#1082)
- fix(blocks): correct rect positions (#1083)
- fix: ensure change code block language can work (#1086)
- fix: drag block selection area is mismatch when page scroll down (#1095)
- fix(blocks): image block resize border (#1102)
- fix(editor): emoji font-family (#1113)
- fix: arrow up and down in edgeless page (#1122)
- fix: should use clientX/clientY to create startRange in edgeless mode (#1138)
- fix(virgo): unit text not render spaces (#1148)
- fix: unable to close popup widget on code block (#1149)
- fix: update slash menu (#1130)
- fix(global): namespace BlockSuiteInternal (#1155)
- fix(playground): database example (#1156)
- fix: move drag handle to the same level with editor-container (#1161)
- fix: hide link popup when scroll (#1165)
- fix: focus temp element during copy (#1167)
- fix: update slash menu styles (#1169)
- fix: enhance error message in SSR mode (#1174)
- fix: uppercase in words (#1177)
- fix: fix cors fetch in chrome (#1196)
- fix: keep native range selection when scrolling with scroll wheel (#1195)
- fix: format bar action status (#1199)
- fix: ignore fetch cache by Image element (#1206)
- fix(playground): load function from map (#1209)
- fix(blocks): drag handle position (#1211)
- fix: hide editing popup in readonly mode (#1212)
- fix: quote font style (#1217)
- fix: disable shortcut "h" to shown/hidden dat.gui css debug menu (#1226)
- fix(phasor): dpr offset (#1239)
- fix: incorrect
mergeCodeBlocks
text operation (#1237) - fix: when screen height is low, place the last tooltip on top of card (#1238)
- fix: revert cursor flag (#1252)
- fix: fast drag sync selection box (#1251)
- fix: update format bar action status when node mution (#1254)
- fix: keep code-block from retrieving hover state when affine-default-page hasn't been renderer (#1255)
- fix: image selection offset (#1223)
- fix: locate insert position from block hub in scrollable page (#1256)
- fix: clean slash menu after soft enter (#1257)
- fix: enter ime should not confirm link (#1263)
- fix: update the default value of
@blocksuite/react
(#1262) - fix(virgo): select from the start of line using shift+arrow (#1266)
- fix: slash with shift key (#1267)
Full Changelog: https://github.com/toeverything/blocksuite/compare/@blocksuite/editor@0.3.1...@blocksuite/editor@0.4.0