0.5.0
版本发布时间: 2023-04-26 01:01:12
toeverything/blocksuite最新发布版本:v0.9.0(2023-10-18 20:24:04)
🍬 We're thrilled to announce the release of BlockSuite 0.5.0! This version is shipped in the first AFFiNE Client, including 660 pull requests merged from our vibrant community of developers, with 14 more new contributors. Here are some highlights of what you can expect from this release:
- 🔮 There is now support for nestable block model fields definitions.
- 🗄️ A new
DatabaseBlock
is available to use as a table. The data structure has been redesigned and moved to the block level. - 🔎 Cross-page indexing is possible through the
SearchIndexer
andBacklinkIndexer
. - 🎨 There are many enhanced edgeless and whiteboard editing capabilities, including a new
@blocksuite/connector
package that provides pathfinding support for computing shape connectors. - 📖 The documentation site is available, including onboarding documents and tutorials. The site can be accessed at blocksuite.affine.pro.
🚀 Features
-
Store (@Saul-Mirone @lawvs @doodlewind)
- Array proxy (#2088), Y.Map deep proxy (#2111), and support for deep proxied values (#2145).
- Support
DisposableGroup.addFromEvent
(#1527). - Support role in block schema (#2023).
- Support Slots on model for blocks (#2067).
- Indexer (#2091) and normalization of subpage in meta (#2167).
-
Edgeless (@alt1o @doodlewind)
- Support for various tools and modes, including drag and drop (#1417), view control panel (#1423), brush tool (#1418, #1458), text tool (#1563), and component toolbar (#1703).
- Basic hotkeys support (#1750) and pressing the ESC key to return to the default state (#1833).
- Active state maintenance between clicking frames (#1836) and support for bringToFront and sendToBack (#1945).
- Connectors can be attached to elements at any position (#1963) and copy-paste support in edgeless clipboard (#1965).
- Edgeless frame background (#2027), shape fill and stroke color support (#2042), and background grid optimization (#2047).
- Double-click the blank space to add text (#2163).
- Additional shapes (#1339) and brush support (#1337).
- Connector support (#1793) and shape border style support (#2166).
-
Subpage (@lawvs)
- Addition of subPageIds in pageMeta and related events (#1716).
- Unification of subpage and slot naming (#1782).
- Addition of subpage test case (#1832).
- Refactoring to check subpage reference (#2022).
- Normalization of subpage in meta (#2167).
- Subpage meta synchronization (#2190).
-
Database block (@zqran)
- Rich-text column soft enter support (#1765).
- Improved handling of placeholders, insertion, and selection (#1785, #1795, #1770).
- Enhanced database styling (#1831, #1855, #1861) and column operations (#1879, #1884, #1887).
- Tag color selection (#1917), renaming and deletion (#1891), and copy-paste support (#1908).
- More actions support (#1916) and drag and drop column width adjustment (#1931).
- Database conversion (#1941) and column operations with shortcuts (#2019).
- Title and tag length limits (#2000) and drag and drop row insertion (#2046).
- Icon and style updates (#2063, #2068) and mobile compatibility (#2187).
- Virgo integration for number input replacement (#2144) and select tag length limit update (#2230).
-
Virgo (@Flrande)
- Dynamic attribute schema and renderer (#1462).
- Handler to take over Virgo input (#1495).
- Support
VEditor.requestUpdate
and v-text update (#1523). - Support
setMarks
(#1711). - VEditor support for string parameter (#1895).
- Support
setText
(#2107).
-
Selection (@fundon)
- ExtendBlockRange API (#1684) and dragged content preview (#1872).
- Dragging blocks under block-level selection (#1946) and scroll wheel support to move dragging blocks (#1977).
- Highlight selected blocks in edgeless (#2024) and triple-click to select all text of block (#2037).
🙌 New Contributors
- @shengxinjing made their first contribution in #1269
- @qinluhe made their first contribution in #1313
- @PerfectPan made their first contribution in #1325
- @AlessioGr made their first contribution in #1387
- @suica made their first contribution in #1665
- @hanchayi made their first contribution in #1732
- @VictorNanka made their first contribution in #1799
- @adityash1 made their first contribution in #1903
- @yuusheng made their first contribution in #1988
- @blurname made their first contribution in #1990
- @luke358 made their first contribution in #2060
- @SkyeSun made their first contribution in #2087
- @DataDaoDe made their first contribution in #2096
- @zuozijian3720 made their first contribution in #2213
🐛 Detailed Refactoring and Bugfixes
- refactor: add
text
prop in schema (#1281) - refactor: migrate
SelectedBlock
toBlockRange
(#1334) - refactor: remove redundant cachedSelectedBlocks (#1332)
- refactor: add side effect in store (#1340)
- refactor: optimize some code in virgo (#1360)
- refactor: remove code block button (#1365)
- refactor: remove
depth
andparentIndex
fromBaseBlockModel
(#1372) - refactor: reorganize range structure (#1366)
- refactor: detect elements with Node.compareDocumentPosition in block selection (#1356)
- refactor: simplify test (#1379)
- refactor: migrate
BlockSuiteModelProps
toBlockModelProps
(#1408) - refactor: clearly distinguish lit's
state
andproperty
(#1428) - refactor: remove
handlePageEvent
timer (#1431) - refactor: simplify keyboard behavior (#1438)
- refactor:
Signal
->Slot
(#1481) - refactor: simplify code block language list logic (#1486)
- refactor: split basic
DefaultSelectionManager
modules (#1494) - refactor: remove redundant selection manager fields (#1496)
- refactor:
SelectionRect
->DraggingArea
(#1500) - refactor: extract
setSelectedBlocks
and slot effects (#1502) - refactor: remove
resetSelectedBlockByRect
(#1503) - refactor: switch to
selection.viewport
(#1506) - refactor: remove redundant selection manager fields (#1507)
- refactor: switch to
page.readonly
(#1511) - refactor: add
selection.state.draggingArea
(#1512) - refactor: extract block hub templates (#1521)
- refactor: move
codeBlockOption
to code block (#1519) - refactor:
Slot.disposableListener
->Slot.fromEvent
(#1526) - refactor: code option use viewport element (#1565)
- refactor: remove the deprecated
addBlock
api (#1613) - refactor: add async query for dom mutation scenario (#1621)
- refactor: replace
getRichTextByModel
withgetVirgoByModel
(#1626) - refactor: strict text attributes check (#1731)
- refactor: migrate nativeKeydown to hotkey (#1751)
- refactor: replace input tag with VEditor in database block (#1746)
- refactor: extract
getPopperPosition
function (#1816) - refactor: add
getRichTextBoundingBox
test action (#1819) - refactor: improve stability of inline suggestion (#1817)
- refactor: split
handleLineStartBackspace
(#1910) - refactor: check subpage reference (#2022)
- refactor: clean short key (#2051)
- refactor: extract keydown observer (#2062)
- refactor: remove redundant slot (#2140)
- refactor: remove
@blocksuite/react
package (#2179) - refactor: subpage meta sync (#2190)
- refactor: use
@toeverything/y-indexeddb
(#2207) - refactor: use virgo element as the ref node when obtaining the vRange (#2239)
- refactor: subpage update (#2264)
- refactor(blocks): replace textarea in title with virgo (#1168)
- refactor(blocks): replace quill with virgo (#1433)
- refactor(blocks): improve code-block highlight performance (#1682)
- refactor(blocks): add cache for highlight in code-block (#1762)
- refactor(blocks):
builtInSchemas
->AffineSchemas
(#1763) - refactor(blocks): prevent auto scroll in edgeless mode (#1830)
- refactor(code): replace
setTimeout
withResizeObserver
(#1680) - refactor(database):
tag
->column
(#1739) - refactor(database): optimize column related naming (#1913)
- refactor(database): remove
mode
in crdt model (#1918) - refactor(database): flatten
internalProperty
andproperty
(#1919) - refactor(database): add
DatabaseManager
andpage.db
entity (#1922) - refactor(database):
columns
->cells
(#1925) - refactor(database):
columnSchema
->column
(#1934) - refactor(database): split column header component file (#1957)
- refactor(database):
columnSchema
->column
(#1960) - refactor(database): column header (#1987)
- refactor(database): toolbar and row container (#1989)
- refactor(database): separate title (#1997)
- refactor(database): separate select type column (#1998)
- refactor(edgeless): split toolbar modules (#1348)
- refactor(edgeless): hotkeys (#1835)
- refactor(edgeless): add frame and update selection (#1834)
- refactor(editor): move content parser out of editor lifecycle (#1748)
- refactor(global): move global database types into blocks (#2278)
- refactor(phasor): switch to
getElementsBound
(#1445) - refactor(phasor): move edgeless viewport to
surface.viewport
(#1477) - refactor(selection): switch to
document.elementsFromPoint
(#1530) - refactor(selection): keep setSelectedBlocks logic simple (#1706)
- refactor(store): remove redundant type param (#1756)
- refactor(store): support synchronous
createPage
(#1760) - refactor(store):
addBlockByFlavour
->addBlock
(#1764) - refactor(store): remove redundant
moveBlocksToParent
(#1787) - refactor(store): remove
deleteBlockById
andupdateBlockById
(#1923) - refactor(store): set doc.guid to workspace id (#1958)
- refactor(store): init internal props should respect ext in schema (#2025)
- refactor(store): move cell and column to database props and add database model (#2053)
- refactor(store): use map proxy for object props (#2128)
- refactor(virgo): switch to
rootElement
(#1454) - refactor(virgo): use tuple (#1455)
- refactor(virgo): setTimeout -> requestAnimationFrame (#1461)
- refactor(virgo): update and refactor some API (#1483)
- refactor(virgo): rename and make virgo support decoration (#1499)
- refactor(virgo): extract events into event service (#1729)
- refactor(virgo): improve virgo render performance (#1890)
- refactor(virgo): expose event service (#1896)
- refactor(virgo): support range services and CI testing (#1912)
- refactor(virgo): rename some utils files (#2113)
- refactor(virgo): support forged v-text node (#2254)
- fix: edgeless selection rect doesn't follow viewport update (#1273)
- fix: align title and content (#1240)
- fix: extra characters when paste (#1280)
- fix: link icon should not wrap (#1286)
- fix: tab should not indent code block (#1295)
- fix: popup menu should follow position of image (#1300)
- fix: copy button of code block menu doesn't work (#1144)
- fix: sub selected blocks should not be drawn when pressing tab key (#1325)
- fix: fineTuneHmr sourcemap (#1329)
- fix: text overflow when font-family fallback fails until "Hiragino Sans GB" (#1336)
- fix: enhance drag handle styles (#1322)
- fix: tweak slash menu edge (#1349)
- fix: format bar should follow selection block (#1358)
- fix: use
merge
deep clone (#1359) - fix: inline code break when pressing Enter followed by Backspace twice (#1353)
- fix: make embed test stable (#1362)
- fix: update selection state (#1367)
- fix: composing enter at title should not wrap (#1374)
- fix: remove redundant scrollbars (#1381)
- fix: format bar should follow selection convert (#1388)
- fix: unfocus rich-text on starting block selection (#1400)
- fix: cut for multi-block selection (#1389)
- fix: selection container should be on top of blocks (#1403)
- fix: paste in block-level selection (#1396)
- fix: typo (#1419)
- fix: slash menu icon size (#1446)
- fix: missing title migration on multipe pages (#1452)
- fix: should render nothing when no page model (#1451)
- fix: unsafe type cast in getStartModelBySelection (#1457)
- fix: title with ime (#1465)
- fix: skip image block when show format bar (#1464)
- fix: filter hotkey on title (#1466)
- fix: should ignore page/frame in selected models (#1473)
- fix: error when tab (#1475)
- fix: error when drag in edgeless (#1476)
- fix: should throw error when page error (#1376)
- fix: cursor doesn't go to the end of the line for line-breaks (#1448)
- fix: should cancel when select selected point outside the selected element (#1484)
- fix: remove valueInitializer in workspace meta (#1490)
- fix: commonFieldsUpdated won't be triggered (#1491)
- fix: some typos (#1510)
- fix: hide code block horizontal scrollbar (#1497)
- fix: download image (#1515)
- fix: tooltip not appeat due to overflow (#1522)
- fix: code option follow scroll (#1524)
- fix: readonly should not edit (#1535)
- fix: drawing content should not cover the brush menu (#1545)
- fix: affine-text style (#1549)
- fix: fix css bug in code block (#1554)
- fix: placeholder with IME (#1559)
- fix: invalid regex error of slash menu (#1584)
- fix: not activate format button when only partial selected text has style (#1573)
- fix: remove redundant
scrollIntoViewIfNeeded
(#1582) - fix: long duration of drag handle transition (#1598)
- fix: fix selection sync error (#1602)
- fix: fix the console error when dragging the dividing line (#1587)
- fix: allow scroll to view as needed (#1604)
- fix: update the calculation method of format (#1585)
- fix: hide drag handle when mouse hovering over title (#1615)
- fix: mouse hovering flickering on blockhub (#1618)
- fix: cursor position on click in code block (#1622)
- fix: date & time string can not be inserted using the slash menu (#1625)
- fix: link not work in editableable content (#1637)
- fix: text styles when using CJK IME (#1636)
- fix: compatible with old data (#1646)
- fix: inconsistent input states between using and not using IME (#1647)
- fix: edgeless panning with zoom (#1649)
- fix: cursor hidden in code block empty line (#1654)
- fix: press enter twice at end of code block with content can jump out (#1624)
- fix: code block wrap not work (#1657)
- fix: code block cannot enter spaces (#1668)
- fix: open two tabs in readonly (#1670)
- fix: cursor lost in title when undo/redo (#1695)
- fix: code option covered by header (#1718)
- fix: dbclick format bar should not hide (#1715)
- fix: clear selection when selecting one block (#1734)
- fix: code block caret position (#1698)
- fix: update column name (#1735)
- fix: contentParser update logic (#1741)
- fix: unneeded focus title in edgeless mode (#1747)
- fix: zoom in/out shortcut key on mac should be metakey (#1727)
- fix: sync title meta when add page block (#1789)
- fix: button-text-color (#1799)
- fix: lang-button without line break (#1825)
- fix: do not allow text in button to be selected (#1804)
- fix: paste into list error (#1863)
- fix: optimize page padding for drag-handle and mobile (#1867)
- fix: remove extra whitespace after reference node (#1889)
- fix: indent correctly when deleting list item (#1907)
- fix: add paragraph when insert divider (#1927)
- fix: tooltip should be hidden when the submenu list is opened (#1924)
- fix: button disable style (#1975)
- fix: throw error when switching mode under block-level selection (#1979)
- fix: position of creating frame when using block-hub (#1986)
- fix: reverse dark mode icon and add tooltip (#1995)
- fix: connector-controller's position not scaled by zoom (#1981)
- fix: check import package itself (#2030)
- fix: do not assumed that the page block must appear before the surface block in ymap (#2058)
- fix: hide hover rect on active frame (#2059)
- fix: avoid clicking on the icon to close (#2066)
- fix: unable to scroll to bottom (#2041)
- fix: retain line break for pasting into code block (#2076)
- fix: dispose editor wrapper (#2079)
- fix: callback control for event removal (#2078)
- fix: use
onPress
rather than deprecatedonClick
for nextui components (#2101) - fix: onShowSearch alter the searchState (#2098)
- fix: enabel database flag (#2104)
- fix: date incorrect (#2137)
- fix:
affine-link
shouldn't leak style (#2150) - fix: delete emoji completely (#2153)
- fix: delete emoji in the middle of text (#2165)
- fix: indexeddb blob storage (#2200)
- fix: remove unused logic in provider (#2201)
- fix: small cleanup related to clipboard (#2197)
- fix: the vRange is wrong in some cases (#2198)
- fix: incorrect behavior when paste code from GitHub (#2185)
- fix: test flaky (#2217)
- fix:
compareDocumentPosition
usage (#2202) - fix: delete emoji forward (#2227)
- fix: exported html content color (#2237)
- fix: code block scroll back (#2240)
- fix:
selection
wrong when type many times in one frame (#2238) - fix: reference node ime compatibility (#2232)
- fix: return new model after delete selection (#2266)
- fix: error text style in edgeless mode (#2189)
- fix: pasting content displays excess content (#2276)
- fix(blocks): fix click handler in page container (#1301)
- fix(blocks): move h1-h6 paragraph children into parent (#1338)
- fix(blocks): prevent propagation when pressing Enter in title (#1444)
- fix(blocks): missing target when mouse fall into between two blocks and Y axis wrongly calculated (#1471)
- fix(blocks): update placeholder precisely (#1546)
- fix(blocks): placeholder in title still displayed when using IME (#1556)
- fix(blocks): fix remote-selection offset (#1561)
- fix(blocks): line number in code-block not updated in time (#1566)
- fix(blocks): fix link mock selection offset (#1572)
- fix(blocks): set attribute to be null when un-format (#1562)
- fix(blocks): update paragraph type with new vRange (#1583)
- fix(blocks): pointer lost when formatting with backticks (#1588)
- fix(blocks): click copy option in code block (#1610)
- fix(blocks): add placeholder for heading (#1608)
- fix(blocks): autofocus code block (#1609)
- fix(blocks): workaround for cursor hidden (#1627)
- fix(blocks): fix keyboard handler when in edgeless mode (#1632)
- fix(blocks): paste not work in title (#1656)
- fix(blocks): cursor in codeblock moves to start (#1672)
- fix(blocks): numbered list prefix won't update when previous sibling changed (#1679)
- fix(blocks): code block indent incorrectly (#1681)
- fix(blocks): resize observer not work as expected (#1723)
- fix(blocks): code-block should support dark mode (#1726)
- fix(blocks): inherit behaviour about inline format (#1822)
- fix(blocks): placeholder kept when inputting with IME in empty line (#1846)
- fix(blocks): drop-down arrow for code language switching should not be displayed (#1871)
- fix(blocks): remote selection should be updated when switch to default mode from edgeless mode (#1894)
- fix(blocks): prevent link bar appeared when range is collapsed (#1898)
- fix(blocks): copy behavior (#1969)
- fix(blocks):
pre-wrap
->break-spaces
(#1984) - fix(blocks): import reference error (#2029)
- fix(blocks): overwrite the default behavior when consecutive spaces (#2141)
- fix(blocks): prevent default browser behavior for undo/redo (#2229)
- fix(blocks,react,next-example): next.js cannot read window during SSR (#1407)
- fix(database): sync state after cell input blur (#1754)
- fix(database): undo should work in database title and rich-text (#1838)
- fix(database): hide text that exceeds column width (#1877)
- fix(database): remove property from columns data structure (#1951)
- fix(database): show the add column button on the right side of database correctly (#1955)
- fix(database): missing import custom lit component path (#2021)
- fix(database): shortcut keys to convert to database (#2032)
- fix(database): should the indicator display correctly when resize the window (#2090)
- fix(database): show or hide column popup (#2094)
- fix(database): select instead of add when select option is exsit (#2114)
- fix(database): viewportElement does not exsit (#2121)
- fix(database):
registerColumnHeader
follows database block life cycle (#2157) - fix(database): drag database error (#2221)
- fix(database): text in database cannot be selected (#2259)
- fix(docs): multiple editors in doc (#1859)
- fix(docs): dark mode (#1874)
- fix(docs): add missing that-clause (#2095)
- fix(drag-handle): height of drag handle line when zooming in/out in edgeless mode (#1790)
- fix(drag-handle): improve indicator offset in edgeless mode (#1797)
- fix(drag-handle): display only in the currently activated frame (#1837)
- fix(drag-handle): selected block cant be reached (#1994)
- fix(drag-handle): should be hidden when moving canvas in edgeless (#2142)
- fix(edgeless): enable shape hover rect & add test actions (#1412)
- fix(edgeless): frame active state on click (#1415)
- fix(edgeless): brush menu cannot be closed after switch editor mode (#1537)
- fix(edgeless): sync selection box for panned canvas on switching mouse mode (#1539)
- fix(edgeless): redundant side effect on clicking edgeless toolbar (#1547)
- fix(edgeless): update brush color (#1612)
- fix(edgeless): cursor in different mouse mode (#1619)
- fix(edgeless): selection resize (#1651)
- fix(edgeless): background linear-gradient -> radial-gradient (#1721)
- fix(edgeless): merge view control toolbar into mouse mode toolbar (#1720)
- fix(edgeless): adjust frame min width (#1738)
- fix(edgeless): hide redundant edgeless menu entry (#1815)
- fix(edgeless): the edgeless toolbar should not be able to display two submenus (#1813)
- fix(edgeless): drag handle should only appear in actived frame block (#1820)
- fix(edgeless): pinch event compatible (#1821)
- fix(edgeless): when zooming with the mouse, the behavior is not as expected (#1869)
- fix(edgeless): brush offset when drawing (#1935)
- fix(edgeless): add text frame mask z-index (#2080)
- fix(edgeless): using color codes instead of using actual color values (#2086)
- fix(edgeless): storage of corrected connector attached points (#2158)
- fix(edgeless): resize-Manager not consider zoom (#2135)
- fix(edgeless): when editing text, should hidden component toolbar (#2160)
- fix(edgeless): auto remove empty text frame (#2164)
- fix(edgeless): offset when resizing connector (#2210)
- fix(edgeless): should not add text when double click toolbar button (#2216)
- fix(edgeless): new frame is constructed using a relative coordinate (#2220)
- fix(edgeless): default frame background (#2258)
- fix(edgeless): popover color (#2255)
- fix(editor): should hide drag handle when target model props changed (#1638)
- fix(editor): some safari compatibility issues (#1688)
- fix(embed): don't show image option menu on selecting (#1404)
- fix(format-bar): safari compatibility (#1678)
- fix(format-bar): update state on change in keyboard selection (#2100)
- fix(link): consecutive identical reference nodes should not be merged (#2231)
- fix(phasor): adapt to resized canvas (#1299)
- fix(phasor): use consistent rounded rect radius (#1603)
- fix(phasor): add test:unit:coverage (#2061)
- fix(playground): edgeless blank (#1470)
- fix(playground): clear selection on clicking undo/redo buttons (#1752)
- fix(playground): dark mode style for images (#1982)
- fix(selection): select text by double-clicking in edgeless mode (#1906)
- fix(selection): drag handle should cover all selected blocks (#1944)
- fix(selection): dragging blocks scale in edgeless mode (#1978)
- fix(selection): improve position of indicator in nested list (#2099)
- fix(selection): should add offset to selected blocks in edgeless (#2139)
- fix(selection): should clean selected blocks when dropping blocks in edgeless (#2132)
- fix(selection): embed width should not exceed maximum width (#2171)
- fix(selection): should be cleared when dragging block card from the BlockHub (#2168)
- fix(selection): should be cleared when activing shape or frame in edgeless (#2186)
- fix(store): lazy initialize yjs models (#1536)
- fix(store): y array should clear old index when proxied (#2215)
- fix(store): fix data of rich text cells in store (#2218)
- fix(virgo): fix css in virgo (#1311)
- fix(virgo): fix toVRange (#1426)
- fix(virgo): getLine not work in the end of line (#1460)
- fix(virgo): handle some edge cases in nativePointToTextPoint (#1489)
- fix(virgo): container should be non-editable when in read-only mode (#1501)
- fix(virgo): support
deleteWordBackward
input type (#1538) - fix(virgo): cursor offset when using IME (#1543)
- fix(virgo): support
deleteContentForward
input type (#1641) - fix(virgo): cursor may sometimes shift within a code block (#1642)
- fix(virgo): synchronizing selection can potentially result in an infinite loop (#1644)
- fix(virgo): fix dbclick in first word (#1661)
- fix(virgo): auto scroll to the focus text (#1683)
- fix(virgo): render error in title when first charaster is space (#1692)
- fix(virgo): arrow up and down will lose focus (#1710)
- fix(virgo): soft keyboard closed when inputting in mobile (#1779)
- fix(virgo): remove autofocus (#1882)
- fix(virgo): unexpected cursor position when inputting Chinese in mobild phone (#1893)
- fix(virgo): timing problem of selection synchronization (#1999)
- fix(virgo): ime inserts text in unexpected position (#2031)
- fix(virgo): static styles -> styleMap (#2083)
- fix(virgo): no-wrap style for code block (#2118)
- fix(virgo): auto scroll to cursor when inputting (#2119)
- fix(virgo): the cursor may jump to the beginning when quickly typing (#2219)
- fix(virgo): getTextPoint offset calculation (#2223)
Full Changelog: https://github.com/toeverything/blocksuite/compare/@blocksuite/editor@0.4.1...0.5.0