From 4297c348456a83bd9b62bdc5f94dbe21dd81577e Mon Sep 17 00:00:00 2001 From: Ke Wang <453587854@qq.com> Date: Thu, 30 Sep 2021 18:05:43 +0800 Subject: [PATCH] add API `getSerializedRangeFromUid`; bump version --- package.json | 2 +- src/lib/classes/Marker.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c4fd1b2..952ce10 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@notelix/web-marker", - "version": "1.0.12", + "version": "1.0.13", "description": "a web page highlighter", "main": "./build/web-marker.js", "types": "./build/libroot.d.ts", diff --git a/src/lib/classes/Marker.ts b/src/lib/classes/Marker.ts index 1e27c73..2037abb 100644 --- a/src/lib/classes/Marker.ts +++ b/src/lib/classes/Marker.ts @@ -686,6 +686,10 @@ class Marker { range.setEnd(prevNode, this.getInnerText(prevNode).length); } } + + public getSerializedRangeFromUid(uid: string): SerializedRange | null { + return this.state.uidToSerializedRange[uid] || null; + } } export default Marker;