@readium/decorator 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +5 -1
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -18,7 +18,11 @@ npm install @readium/decorator
18
18
 
19
19
  - **Comms**: `DecorationController` (your app logic) and `Decorator` (the DOM renderer) talk over a small message-passing interface, handled for you by `DirectCommsChannel` (below).
20
20
  - **Groups**: every decoration belongs to a `group` (an arbitrary string you choose — `"tts"`, `"search-results"`, `"annotations"`, etc). `applyDecorations` replaces *all* decorations for one group at a time, diffing against that group's previous state. Separate groups don't interfere with each other, and each can independently opt into activation (tap/click) and hover tracking depending on which callbacks its `DecorationObserver` declares.
21
- - **Locators**: each decoration's `locator` is a `Locator` instance from `@readium/shared`, identifying the text range (or other target) to decorate within a resource.
21
+ - **Locators**: each decoration's `locator` is a `Locator` instance from `@readium/shared`, identifying the text range (or other target) to decorate within a resource. Resolving a `Locator` to an actual DOM range tries each of the following in order, falling through when a strategy is absent, invalid, or unresolvable:
22
+ 1. `locations`' `domRange` — an exact node/offset selection
23
+ 2. a WICG text-fragment directive (`:~:text=...`) found in `locations.fragments`
24
+ 3. `text.highlight` — a quote search, disambiguated by `text.before`/`text.after`
25
+ 4. `locations`' `cssSelector`, then an element id from `locations.fragments`
22
26
 
23
27
  ## Usage
24
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readium/decorator",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "description": "Standalone decoration controller and renderer for HTML content",
6
6
  "author": "readium",
@@ -32,8 +32,8 @@
32
32
  "node": ">=18"
33
33
  },
34
34
  "dependencies": {
35
- "@readium/navigator-html-injectables": "2.6.3",
36
- "@readium/shared": "2.4.0"
35
+ "@readium/navigator-html-injectables": "2.7.0",
36
+ "@readium/shared": "2.5.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "rimraf": "^6.1.2",