This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@capgo/inappbrowser](https://redirect.github.com/Cap-go/capacitor-inappbrowser) | [`7.6.0` -> `7.6.4`](https://renovatebot.com/diffs/npm/@capgo%2finappbrowser/7.6.0/7.6.4) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [@swc/core](https://swc.rs) ([source](https://redirect.github.com/swc-project/swc)) | [`1.11.11` -> `1.11.13`](https://renovatebot.com/diffs/npm/@swc%2fcore/1.11.11/1.11.13) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [bullmq](https://bullmq.io/) ([source](https://redirect.github.com/taskforcesh/bullmq)) | [`5.44.2` -> `5.44.3`](https://renovatebot.com/diffs/npm/bullmq/5.44.2/5.44.3) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [lib0](https://redirect.github.com/dmonad/lib0) | [`0.2.99` -> `0.2.100`](https://renovatebot.com/diffs/npm/lib0/0.2.99/0.2.100) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [typedoc-plugin-markdown](https://typedoc-plugin-markdown.org) ([source](https://redirect.github.com/typedoc2md/typedoc-plugin-markdown/tree/HEAD/packages/typedoc-plugin-markdown)) | [`4.5.2` -> `4.6.0`](https://renovatebot.com/diffs/npm/typedoc-plugin-markdown/4.5.2/4.6.0) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>Cap-go/capacitor-inappbrowser (@​capgo/inappbrowser)</summary> ### [`v7.6.4`](https://redirect.github.com/Cap-go/capacitor-inappbrowser/blob/HEAD/CHANGELOG.md#764-2025-03-24) [Compare Source](https://redirect.github.com/Cap-go/capacitor-inappbrowser/compare/7.6.3...7.6.4) ### [`v7.6.3`](https://redirect.github.com/Cap-go/capacitor-inappbrowser/blob/HEAD/CHANGELOG.md#763-2025-03-23) [Compare Source](https://redirect.github.com/Cap-go/capacitor-inappbrowser/compare/7.6.2...7.6.3) ### [`v7.6.2`](https://redirect.github.com/Cap-go/capacitor-inappbrowser/blob/HEAD/CHANGELOG.md#762-2025-03-23) [Compare Source](https://redirect.github.com/Cap-go/capacitor-inappbrowser/compare/7.6.1...7.6.2) ### [`v7.6.1`](https://redirect.github.com/Cap-go/capacitor-inappbrowser/blob/HEAD/CHANGELOG.md#761-2025-03-23) [Compare Source](https://redirect.github.com/Cap-go/capacitor-inappbrowser/compare/7.6.0...7.6.1) </details> <details> <summary>swc-project/swc (@​swc/core)</summary> ### [`v1.11.13`](https://redirect.github.com/swc-project/swc/blob/HEAD/CHANGELOG.md#11113---2025-03-24) [Compare Source](https://redirect.github.com/swc-project/swc/compare/v1.11.12...v1.11.13) ##### Features - **(es/minifier)** Merge alt's cons with cons ([#​10256](https://redirect.github.com/swc-project/swc/issues/10256)) ([589bcd7](589bcd70c4)) - **(swc_core)** Expose features of `swc_parallel` ([#​10258](https://redirect.github.com/swc-project/swc/issues/10258)) ([042f19f](042f19ff66)) ##### Performance - **(es/minifier)** Merge `expr_simplifier` into pure optimizer ([#​10202](https://redirect.github.com/swc-project/swc/issues/10202)) ([9c9b0ba](9c9b0baaac)) ### [`v1.11.12`](https://redirect.github.com/swc-project/swc/blob/HEAD/CHANGELOG.md#11112---2025-03-23) [Compare Source](https://redirect.github.com/swc-project/swc/compare/v1.11.11...v1.11.12) ##### Bug Fixes - **(es/minifier)** Make `inline_globals` noop by default ([#​10231](https://redirect.github.com/swc-project/swc/issues/10231)) ([b192dc8](b192dc82e6)) - **(es/minifier)** Fix access to `GLOBALS` in char freq compute ([#​10239](https://redirect.github.com/swc-project/swc/issues/10239)) ([6286663](6286663868)) - **(es/parser)** Fix span of wrong `await` tokens ([#​10252](https://redirect.github.com/swc-project/swc/issues/10252)) ([5c28dc3](5c28dc3964)) - **(es/types)** Fix broken types ([#​10224](https://redirect.github.com/swc-project/swc/issues/10224)) ([540bdf8](540bdf868d)) ##### Documentation - **(es)** Improve documentation ([#​10247](https://redirect.github.com/swc-project/swc/issues/10247)) ([549e38d](549e38db9e)) ##### Features - **(es/fast-lexer)** Enhance identifier handling with Unicode support ([#​10226](https://redirect.github.com/swc-project/swc/issues/10226)) ([482b63a](482b63a905)) - **(es/minifier)** Invoke IIFE into block ([#​10220](https://redirect.github.com/swc-project/swc/issues/10220)) ([c9a6c23](c9a6c23787)) - **(es/minifier)** Remove needless blocks ([#​10234](https://redirect.github.com/swc-project/swc/issues/10234)) ([0817970](08179702bf)) - **(swc_parallel)** Introduce `rayon` mode ([#​10237](https://redirect.github.com/swc-project/swc/issues/10237)) ([3c2213c](3c2213c829)) - **(ts/fast-strip)** Add start/end span information ([#​10251](https://redirect.github.com/swc-project/swc/issues/10251)) ([ab39a62](ab39a62528)) - **(ts/fast-strip)** Improve error message snippet ([#​10253](https://redirect.github.com/swc-project/swc/issues/10253)) ([f4f426c](f4f426c9c9)) - **(ts/fast-strip)** Remove line numbers ([#​10254](https://redirect.github.com/swc-project/swc/issues/10254)) ([40e216d](40e216db82)) ##### Performance - **(es/minifier)** Merge `dead_branch_remover` into pure optimizer ([#​10201](https://redirect.github.com/swc-project/swc/issues/10201)) ([6841523](6841523977)) </details> <details> <summary>taskforcesh/bullmq (bullmq)</summary> ### [`v5.44.3`](https://redirect.github.com/taskforcesh/bullmq/releases/tag/v5.44.3) [Compare Source](https://redirect.github.com/taskforcesh/bullmq/compare/v5.44.2...v5.44.3) ##### Bug Fixes - **flow:** only validate pending dependencies when moving to completed ([#​3164](https://redirect.github.com/taskforcesh/bullmq/issues/3164)) ([d3c397f](d3c397fa3f)) </details> <details> <summary>dmonad/lib0 (lib0)</summary> ### [`v0.2.100`](https://redirect.github.com/dmonad/lib0/releases/tag/v0.2.100) [Compare Source](https://redirect.github.com/dmonad/lib0/compare/v0.2.99...v0.2.100) - \[testing] properly compare objects that don't have a constructor [`a2433fc`](https://redirect.github.com/dmonad/lib0/commit/a2433fc) - \[sha256] docs [`5ee9bf2`](https://redirect.github.com/dmonad/lib0/commit/5ee9bf2) - Merge pull request [#​96](https://redirect.github.com/dmonad/lib0/issues/96) from jthemphill/fix-condititons-spelling [`08fe7d5`](https://redirect.github.com/dmonad/lib0/commit/08fe7d5) - Fix references to nonexistent files in package.json [`2cb51c4`](https://redirect.github.com/dmonad/lib0/commit/2cb51c4) *** </details> <details> <summary>typedoc2md/typedoc-plugin-markdown (typedoc-plugin-markdown)</summary> ### [`v4.6.0`](https://redirect.github.com/typedoc2md/typedoc-plugin-markdown/blob/HEAD/packages/typedoc-plugin-markdown/CHANGELOG.md#460-2025-03-23) [Compare Source](https://redirect.github.com/typedoc2md/typedoc-plugin-markdown/compare/typedoc-plugin-markdown@4.5.2...typedoc-plugin-markdown@4.6.0) This release continues the effort to further align to TypeDoc’s default theme, with improvements that make the plugin more consistent and predictable. ##### Architectural Changes - Introduced support for TypeDoc core routers. This allows output files to be generated in the same structure as the default HTML theme, while still using the plugin’s Markdown theme. - Exported routers to the public API, enabling customization by other plugins. ##### Structural Changes - Package readme's (when "entryPointStrategy" is "packages") are now merged with the package index page producing a single entrypoint for packages with an associated readme. This aligns with the default theme and improves navigation. - To support core routers, a "Hierarchy Summary" page has been introduced to all routers. This feature is turned off by default but can be enabled by setting "includeHierarchySummary" to "true". - When "includeHierarchySummary" is "true", symbols with an available hierarchy now include an associated "Hierarchy" Markdown heading with a "View Summary" link as per the default theme. - Class constructor headings now read "Constructor". This aligns to the TypeDoc internal reflection name and fixes issues with internal anchoring not resolving correctly. ##### Minor Changes - Implemented support for consuming TypeDoc core routers. - Exported routers to public api. - Implemented a hierarchy summary page as per default theme. - Updated "Constructor" titles of classes to fix internal anchor issues. ##### Patch Changes - Fix incompatibility when used with "outputs" ([#​788](https://redirect.github.com/typedoc2md/typedoc-plugin-markdown/issues/788)). - Utilize "anchorPrefix" option to ensure unique anchors linking if required ([#​764](https://redirect.github.com/typedoc2md/typedoc-plugin-markdown/issues/764)). </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. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- 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:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMDcuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIwNy4xIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5IiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->
4.6 KiB
BlockSuite API Documentation / @blocksuite/store / Text
Class: Text
Text is an abstraction of Y.Text. It provides useful methods to manipulate the text content.
Example
const text = new Text('Hello, world!');
text.insert(' blocksuite', 7);
text.delete(7, 1);
text.format(7, 1, { bold: true });
text.join(new Text(' blocksuite'));
text.split(7, 1);
Text delta is a format from Y.js.
Constructors
Constructor
new Text(
input?):Text
Parameters
input?
The input can be a string, a Y.Text instance, or an array of DeltaInsert.
string | YText | DeltaInsert[]
Returns
Text
Accessors
deltas$
Get Signature
get deltas$():
Signal<DeltaOperation[]>
Get the text delta as a signal.
Returns
Signal<DeltaOperation[]>
Methods
applyDelta()
applyDelta(
delta):void
Apply a delta to the text.
Parameters
delta
DeltaOperation[]
The delta to apply.
Returns
void
Example
const text = new Text('Hello, world!');
text.applyDelta([{insert: ' blocksuite', attributes: { bold: true }}]);
clear()
clear():
void
Clear the text content.
Returns
void
clone()
clone():
Text
Clone the text to a new Text instance.
Returns
Text
A new Text instance.
delete()
delete(
index,length):void
Delete the text content.
Parameters
index
number
The index to delete.
length
number
The length to delete.
Returns
void
format()
format(
index,length,format):void
Format the text content.
Parameters
index
number
The index to format.
length
number
The length to format.
format
Record<string, unknown>
The format to apply.
Returns
void
Example
const text = new Text('Hello, world!');
text.format(7, 1, { bold: true });
insert()
insert(
content,index,attributes?):void
Insert content at the specified index.
Parameters
content
string
The content to insert.
index
number
The index to insert.
attributes?
Record<string, unknown>
Returns
void
Example
const text = new Text('Hello, world!');
text.insert(' blocksuite', 7);
join()
join(
other):void
Join current text with another text.
Parameters
other
Text
The other text to join.
Returns
void
Example
const text = new Text('Hello, world!');
const other = new Text(' blocksuite');
text.join(other);
replace()
replace(
index,length,content,attributes?):void
Replace the text content with a new content.
Parameters
index
number
The index to replace.
length
number
The length to replace.
content
string
The content to replace.
attributes?
Record<string, unknown>
The attributes to replace.
Returns
void
Example
const text = new Text('Hello, world!');
text.replace(7, 1, ' blocksuite');
sliceToDelta()
sliceToDelta(
begin,end?):DeltaOperation[]
Slice the text to a delta.
Parameters
begin
number
The begin index.
end?
number
The end index.
Returns
DeltaOperation[]
The delta of the sliced text.
split()
split(
index,length):Text
Split the text into another Text.
Parameters
index
number
The index to split.
length
number = 0
The length to split.
Returns
Text
The right part of the text.
Example
const text = new Text('Hello, world!');
text.split(7, 1);
NOTE: The string included in [index, index + length) will be deleted.
Here are three cases for point position(index + length):
[{insert: 'abc', ...}, {insert: 'def', ...}, {insert: 'ghi', ...}]
1. abc|de|fghi
left: [{insert: 'abc', ...}]
right: [{insert: 'f', ...}, {insert: 'ghi', ...}]
2. abc|def|ghi
left: [{insert: 'abc', ...}]
right: [{insert: 'ghi', ...}]
3. abc|defg|hi
left: [{insert: 'abc', ...}]
right: [{insert: 'hi', ...}]
toDelta()
toDelta():
DeltaOperation[]
Get the text delta.
Returns
DeltaOperation[]
The delta of the text.
toString()
toString():
string
Get the text content as a string. In most cases, you should not use this method. It will lose the delta attributes information.
Returns
string
The text content.