From 51f7fd59d33d07a4785c32f55ec020e410710935 Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Fri, 22 Mar 2024 14:08:11 +0200 Subject: [PATCH 01/31] Added dependencies to the `text-annotator-react` --- package-lock.json | 5 +++-- packages/text-annotator-react/package.json | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index cba356e9..13d3f0f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,7 +55,6 @@ "version": "3.0.0-rc.19", "resolved": "https://registry.npmjs.org/@annotorious/react/-/react-3.0.0-rc.19.tgz", "integrity": "sha512-EckUfqATkUbSkMqbBZHqI0l1tuo6R9A2omSAt7ODwmyurNFN0XBxcAeqpgiPdri92LzXzx21FnkWjxXnbAa3Bw==", - "peer": true, "dependencies": { "@neodrag/react": "^2.0.3" }, @@ -3868,7 +3867,10 @@ "version": "3.0.0-rc.18", "license": "BSD-3-Clause", "dependencies": { + "@annotorious/core": "^3.0.0-rc.19", + "@annotorious/react": "^3.0.0-rc.19", "@neodrag/react": "^2.0.3", + "@recogito/text-annotator": "*", "CETEIcean": "^1.9.2" }, "devDependencies": { @@ -3883,7 +3885,6 @@ "vite-tsconfig-paths": "^4.3.1" }, "peerDependencies": { - "@annotorious/react": "^3.0.0-rc.19", "react": "16.8.0 || >=17.x || >=18.x", "react-dom": "16.8.0 || >=17.x || >=18.x" } diff --git a/packages/text-annotator-react/package.json b/packages/text-annotator-react/package.json index 0ea1cb61..dab94c9d 100644 --- a/packages/text-annotator-react/package.json +++ b/packages/text-annotator-react/package.json @@ -35,11 +35,13 @@ "vite-tsconfig-paths": "^4.3.1" }, "peerDependencies": { - "@annotorious/react": "^3.0.0-rc.19", "react": "16.8.0 || >=17.x || >=18.x", "react-dom": "16.8.0 || >=17.x || >=18.x" }, "dependencies": { + "@annotorious/core": "^3.0.0-rc.19", + "@annotorious/react": "^3.0.0-rc.19", + "@recogito/text-annotator": "*", "@neodrag/react": "^2.0.3", "CETEIcean": "^1.9.2" } From ce8725613018abe604c0060718cd36cf1da48bd8 Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Fri, 22 Mar 2024 14:10:25 +0200 Subject: [PATCH 02/31] Added peer deps for the `extension-tei` --- package-lock.json | 9 ++++++--- packages/extension-tei/package.json | 7 +++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 13d3f0f2..50351f12 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3830,14 +3830,17 @@ "name": "@recogito/text-annotator-tei", "version": "3.0.0-rc.18", "license": "BSD-3-Clause", - "dependencies": { - "@annotorious/core": "^3.0.0-rc.19" - }, "devDependencies": { + "@annotorious/core": "^3.0.0-rc.19", + "@recogito/text-annotator": "*", "CETEIcean": "^1.9.2", "typescript": "^5.3.3", "vite": "^5.1.3", "vite-plugin-dts": "^3.7.2" + }, + "peerDependencies": { + "@annotorious/core": "^3.0.0-rc.19", + "@recogito/text-annotator": "*" } }, "packages/text-annotator": { diff --git a/packages/extension-tei/package.json b/packages/extension-tei/package.json index d8077a6d..9dc8cfd4 100644 --- a/packages/extension-tei/package.json +++ b/packages/extension-tei/package.json @@ -26,12 +26,15 @@ "./dist/text-annotator.css": "./dist/text-annotator-tei.css" }, "devDependencies": { + "@annotorious/core": "^3.0.0-rc.19", + "@recogito/text-annotator": "*", "CETEIcean": "^1.9.2", "typescript": "^5.3.3", "vite": "^5.1.3", "vite-plugin-dts": "^3.7.2" }, - "dependencies": { - "@annotorious/core": "^3.0.0-rc.19" + "peerDependencies": { + "@annotorious/core": "^3.0.0-rc.19", + "@recogito/text-annotator": "*" } } From 55a57689f67a46174c9ff5ce845d05147f57e070 Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Fri, 22 Mar 2024 15:48:41 +0200 Subject: [PATCH 03/31] Added exact versions usage --- package-lock.json | 1334 ++++++++++++++------ packages/extension-tei/package.json | 4 +- packages/text-annotator-react/package.json | 2 +- 3 files changed, 977 insertions(+), 363 deletions(-) diff --git a/package-lock.json b/package-lock.json index 50351f12..1c44f79a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,59 +15,69 @@ ] }, "node_modules/@ampproject/remapping": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", - "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@annotorious/annotorious": { - "version": "3.0.0-rc.19", - "resolved": "https://registry.npmjs.org/@annotorious/annotorious/-/annotorious-3.0.0-rc.19.tgz", - "integrity": "sha512-DPVW9rFihxqAjMeCSlSce8ae/FzqHg+wtWnqoYf4Z4wVJ+taY/ZYtLYMr+m+uVt7S0er0GtPhU8FEQo6JzZcHQ==", - "peer": true, + "version": "3.0.0-rc.20", + "resolved": "https://registry.npmjs.org/@annotorious/annotorious/-/annotorious-3.0.0-rc.20.tgz", + "integrity": "sha512-E1/WOvjR84qtyHKefcNDaBGOyHR2KRg6yvN0PrfgS7b9u0YsOt8GI20NsRuxFKR+WYmWFM051oNLKXnpKKJTCA==", "dependencies": { + "@annotorious/core": "*", "rbush": "^3.0.1", "uuid": "^9.0.1" - }, - "peerDependencies": { - "@annotorious/core": "*" } }, "node_modules/@annotorious/core": { - "version": "3.0.0-rc.19", - "resolved": "https://registry.npmjs.org/@annotorious/core/-/core-3.0.0-rc.19.tgz", - "integrity": "sha512-FE74AYY8ZK+849gMCNRMZeSPftA4SQBjO9TOGcaGv64Fb2x8tCtQZhLMzpaomOfRsGCdrHXN0nyIcakTaZb5NA==", + "version": "3.0.0-rc.20", + "resolved": "https://registry.npmjs.org/@annotorious/core/-/core-3.0.0-rc.20.tgz", + "integrity": "sha512-75NPHIe9XHmJTd9BpeGEpJtReBAC5SDOZad7Z6Bty+ayahGJIISO9vcMu7zdwewdBk0sh+WLGA/CUXsck0Xjzw==", "dependencies": { "dequal": "^2.0.3", "nanoevents": "^9.0.0", - "nanoid": "^5.0.4", + "nanoid": "^5.0.6", "uuid": "^9.0.1" } }, + "node_modules/@annotorious/openseadragon": { + "version": "3.0.0-rc.20", + "resolved": "https://registry.npmjs.org/@annotorious/openseadragon/-/openseadragon-3.0.0-rc.20.tgz", + "integrity": "sha512-qmrFoWkYGvmXIek7tEFTQgak70Cyu6B904KuZ4LVxOIGYI7aJs9oxyoVsEcUmvPt8IuhI2VjdkFt8z/poegZgg==", + "dependencies": { + "@annotorious/annotorious": "*", + "@annotorious/core": "*", + "pixi.js": "^7.4.2", + "uuid": "^9.0.1" + }, + "peerDependencies": { + "openseadragon": "^3.0.0 || ^4.0.0" + } + }, "node_modules/@annotorious/react": { - "version": "3.0.0-rc.19", - "resolved": "https://registry.npmjs.org/@annotorious/react/-/react-3.0.0-rc.19.tgz", - "integrity": "sha512-EckUfqATkUbSkMqbBZHqI0l1tuo6R9A2omSAt7ODwmyurNFN0XBxcAeqpgiPdri92LzXzx21FnkWjxXnbAa3Bw==", + "version": "3.0.0-rc.20", + "resolved": "https://registry.npmjs.org/@annotorious/react/-/react-3.0.0-rc.20.tgz", + "integrity": "sha512-vvgMvBXjSr4BX4Ie2GRxhUeTGAcP6L3QMURLgECTTWSYnsVxlKkCIlZ1jTQgwAyPNSVDwqHdbxi4YwnFjWcuoQ==", "dependencies": { + "@annotorious/annotorious": "*", + "@annotorious/core": "*", + "@annotorious/openseadragon": "*", "@neodrag/react": "^2.0.3" }, "peerDependencies": { - "@annotorious/annotorious": "*", "openseadragon": "^3.0.0 || ^4.0.0", "react": "16.8.0 || >=17.x || >=18.x", "react-dom": "16.8.0 || >=17.x || >=18.x" }, "peerDependenciesMeta": { - "@annotorious/openseadragon": { - "optional": true - }, "openseadragon": { "optional": true } @@ -85,43 +95,43 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", - "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz", + "integrity": "sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==", "dev": true, "dependencies": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" + "@babel/highlight": "^7.24.2", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", - "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.1.tgz", + "integrity": "sha512-Pc65opHDliVpRHuKfzI+gSA4zcgr65O4cl64fFJIWEEh8JoHIHh0Oez1Eo8Arz8zq/JhgKodQaxEwUPRtZylVA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz", - "integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==", + "version": "7.24.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.3.tgz", + "integrity": "sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", + "@babel/code-frame": "^7.24.2", + "@babel/generator": "^7.24.1", "@babel/helper-compilation-targets": "^7.23.6", "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.23.9", - "@babel/parser": "^7.23.9", - "@babel/template": "^7.23.9", - "@babel/traverse": "^7.23.9", - "@babel/types": "^7.23.9", + "@babel/helpers": "^7.24.1", + "@babel/parser": "^7.24.1", + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.1", + "@babel/types": "^7.24.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -137,14 +147,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", - "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.1.tgz", + "integrity": "sha512-DfCRfZsBcrPEHUfuBMgbJ1Ut01Y/itOs+hY2nFLgqsqXd52/iSiVq5TITtUasIUgm+IIKdY2/1I7auiQOEeC9A==", "dev": true, "dependencies": { - "@babel/types": "^7.23.6", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", + "@babel/types": "^7.24.0", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" }, "engines": { @@ -202,12 +212,12 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", - "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "version": "7.24.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.3.tgz", + "integrity": "sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==", "dev": true, "dependencies": { - "@babel/types": "^7.22.15" + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -233,9 +243,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", - "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz", + "integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==", "dev": true, "engines": { "node": ">=6.9.0" @@ -266,9 +276,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", - "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz", + "integrity": "sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==", "dev": true, "engines": { "node": ">=6.9.0" @@ -293,37 +303,38 @@ } }, "node_modules/@babel/helpers": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.9.tgz", - "integrity": "sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.1.tgz", + "integrity": "sha512-BpU09QqEe6ZCHuIHFphEFgvNSrubve1FtyMton26ekZ85gRGi6LrTF7zArARp2YvyFxloeiRmtSCq5sjh1WqIg==", "dev": true, "dependencies": { - "@babel/template": "^7.23.9", - "@babel/traverse": "^7.23.9", - "@babel/types": "^7.23.9" + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.1", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", - "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", + "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", - "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.1.tgz", + "integrity": "sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -333,12 +344,12 @@ } }, "node_modules/@babel/plugin-transform-react-jsx-self": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.23.3.tgz", - "integrity": "sha512-qXRvbeKDSfwnlJnanVRp0SfuWE5DQhwQr5xtLBzp56Wabyo+4CMosF6Kfp+eOD/4FYpql64XVJ2W0pVLlJZxOQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.24.1.tgz", + "integrity": "sha512-kDJgnPujTmAZ/9q2CN4m2/lRsUUPDvsG3+tSHWUJIzMGTt5U/b/fwWd3RO3n+5mjLrsBrVa5eKFRVSQbi3dF1w==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -348,12 +359,12 @@ } }, "node_modules/@babel/plugin-transform-react-jsx-source": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.23.3.tgz", - "integrity": "sha512-91RS0MDnAWDNvGC6Wio5XYkyWI39FMFO+JK9+4AlgaTH+yWwVTsw7/sn6LK0lH7c5F+TFkpv/3LfCJ1Ydwof/g==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.24.1.tgz", + "integrity": "sha512-1v202n7aUq4uXAieRTKcwPzNyphlCuqHHDcdSNc+vdhoTEZcFMh+L5yZuCmGaIO7bs1nJUNfHB89TZyoL48xNA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -363,33 +374,33 @@ } }, "node_modules/@babel/template": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz", - "integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", + "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", "dev": true, "dependencies": { "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.23.9", - "@babel/types": "^7.23.9" + "@babel/parser": "^7.24.0", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz", - "integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.1.tgz", + "integrity": "sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", + "@babel/code-frame": "^7.24.1", + "@babel/generator": "^7.24.1", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.9", - "@babel/types": "^7.23.9", + "@babel/parser": "^7.24.1", + "@babel/types": "^7.24.0", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -398,9 +409,9 @@ } }, "node_modules/@babel/types": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", - "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", + "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.23.4", @@ -412,9 +423,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", - "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", "cpu": [ "ppc64" ], @@ -428,9 +439,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", - "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", "cpu": [ "arm" ], @@ -444,9 +455,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", - "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", "cpu": [ "arm64" ], @@ -460,9 +471,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", - "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", "cpu": [ "x64" ], @@ -476,9 +487,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", "cpu": [ "arm64" ], @@ -492,9 +503,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", - "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", "cpu": [ "x64" ], @@ -508,9 +519,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", - "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", "cpu": [ "arm64" ], @@ -524,9 +535,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", - "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", "cpu": [ "x64" ], @@ -540,9 +551,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", - "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", "cpu": [ "arm" ], @@ -556,9 +567,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", - "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", "cpu": [ "arm64" ], @@ -572,9 +583,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", - "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", "cpu": [ "ia32" ], @@ -588,9 +599,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", - "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", "cpu": [ "loong64" ], @@ -604,9 +615,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", - "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", "cpu": [ "mips64el" ], @@ -620,9 +631,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", - "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", "cpu": [ "ppc64" ], @@ -636,9 +647,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", - "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", "cpu": [ "riscv64" ], @@ -652,9 +663,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", - "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", "cpu": [ "s390x" ], @@ -668,9 +679,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", - "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", "cpu": [ "x64" ], @@ -684,9 +695,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", - "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", "cpu": [ "x64" ], @@ -700,9 +711,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", - "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", "cpu": [ "x64" ], @@ -716,9 +727,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", - "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", "cpu": [ "x64" ], @@ -732,9 +743,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", - "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", "cpu": [ "arm64" ], @@ -748,9 +759,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", - "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", "cpu": [ "ia32" ], @@ -764,9 +775,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", - "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", "cpu": [ "x64" ], @@ -792,14 +803,14 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -815,9 +826,9 @@ } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "engines": { "node": ">=6.0.0" @@ -830,9 +841,9 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.22", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", - "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", @@ -900,6 +911,19 @@ "node": ">=10" } }, + "node_modules/@microsoft/api-extractor/node_modules/typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/@microsoft/api-extractor/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -942,6 +966,349 @@ "resolved": "https://registry.npmjs.org/@neodrag/react/-/react-2.0.3.tgz", "integrity": "sha512-VtubEZzyB+mmi6bZYKay/UmMuWsG2rsiAV7+O7iLN4YXKOOa7TxJT3alnLRqkntII8X48h2Hs7jSjosqxuAxDQ==" }, + "node_modules/@pixi/accessibility": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/accessibility/-/accessibility-7.4.2.tgz", + "integrity": "sha512-R6VEolm8uyy1FB1F2qaLKxVbzXAFTZCF2ka8fl9lsz7We6ZfO4QpXv9ur7DvzratjCQUQVCKo0/V7xL5q1EV/g==", + "peerDependencies": { + "@pixi/core": "7.4.2", + "@pixi/display": "7.4.2", + "@pixi/events": "7.4.2" + } + }, + "node_modules/@pixi/app": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/app/-/app-7.4.2.tgz", + "integrity": "sha512-ugkH3kOgjT8P1mTMY29yCOgEh+KuVMAn8uBxeY0aMqaUgIMysfpnFv+Aepp2CtvI9ygr22NC+OiKl+u+eEaQHw==", + "peerDependencies": { + "@pixi/core": "7.4.2", + "@pixi/display": "7.4.2" + } + }, + "node_modules/@pixi/assets": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/assets/-/assets-7.4.2.tgz", + "integrity": "sha512-anxho59H9egZwoaEdM5aLvYyxoz6NCy3CaQIvNHD1bbGg8L16Ih0e26QSBR5fu53jl8OjT6M7s+p6n7uu4+fGA==", + "dependencies": { + "@types/css-font-loading-module": "^0.0.12" + }, + "peerDependencies": { + "@pixi/core": "7.4.2" + } + }, + "node_modules/@pixi/color": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/color/-/color-7.4.2.tgz", + "integrity": "sha512-av1LOvhHsiaW8+T4n/FgnOKHby55/w7VcA1HzPIHRBtEcsmxvSCDanT1HU2LslNhrxLPzyVx18nlmalOyt5OBg==", + "dependencies": { + "@pixi/colord": "^2.9.6" + } + }, + "node_modules/@pixi/colord": { + "version": "2.9.6", + "resolved": "https://registry.npmjs.org/@pixi/colord/-/colord-2.9.6.tgz", + "integrity": "sha512-nezytU2pw587fQstUu1AsJZDVEynjskwOL+kibwcdxsMBFqPsFFNA7xl0ii/gXuDi6M0xj3mfRJj8pBSc2jCfA==" + }, + "node_modules/@pixi/compressed-textures": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/compressed-textures/-/compressed-textures-7.4.2.tgz", + "integrity": "sha512-VJrt7el6O4ZJSWkeOGXwrhJaiLg1UBhHB3fj42VR4YloYkAxpfd9K6s6IcbcVz7n9L48APKBMgHyaB2pX2Ck/A==", + "peerDependencies": { + "@pixi/assets": "7.4.2", + "@pixi/core": "7.4.2" + } + }, + "node_modules/@pixi/constants": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-7.4.2.tgz", + "integrity": "sha512-N9vn6Wpz5WIQg7ugUg2+SdqD2u2+NM0QthE8YzLJ4tLH2Iz+/TrnPKUJzeyIqbg3sxJG5ZpGGPiacqIBpy1KyA==" + }, + "node_modules/@pixi/core": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-7.4.2.tgz", + "integrity": "sha512-UbMtgSEnyCOFPzbE6ThB9qopXxbZ5GCof2ArB4FXOC5Xi/83MOIIYg5kf5M8689C5HJMhg2SrJu3xLKppF+CMg==", + "dependencies": { + "@pixi/color": "7.4.2", + "@pixi/constants": "7.4.2", + "@pixi/extensions": "7.4.2", + "@pixi/math": "7.4.2", + "@pixi/runner": "7.4.2", + "@pixi/settings": "7.4.2", + "@pixi/ticker": "7.4.2", + "@pixi/utils": "7.4.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/pixijs" + } + }, + "node_modules/@pixi/display": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-7.4.2.tgz", + "integrity": "sha512-DaD0J7gIlNlzO0Fdlby/0OH+tB5LtCY6rgFeCBKVDnzmn8wKW3zYZRenWBSFJ0Psx6vLqXYkSIM/rcokaKviIw==", + "peerDependencies": { + "@pixi/core": "7.4.2" + } + }, + "node_modules/@pixi/events": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/events/-/events-7.4.2.tgz", + "integrity": "sha512-Jw/w57heZjzZShIXL0bxOvKB+XgGIevyezhGtfF2ZSzQoSBWo+Fj1uE0QwKd0RIaXegZw/DhSmiMJSbNmcjifA==", + "peerDependencies": { + "@pixi/core": "7.4.2", + "@pixi/display": "7.4.2" + } + }, + "node_modules/@pixi/extensions": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/extensions/-/extensions-7.4.2.tgz", + "integrity": "sha512-Hmx2+O0yZ8XIvgomHM9GZEGcy9S9Dd8flmtOK5Aa3fXs/8v7xD08+ANQpN9ZqWU2Xs+C6UBlpqlt2BWALvKKKA==" + }, + "node_modules/@pixi/extract": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/extract/-/extract-7.4.2.tgz", + "integrity": "sha512-JOX27TRWjVEjauGBbF8PU7/g6LYXnivehdgqS5QlVDv1CNHTOrz/j3MdKcVWOhyZPbH5c9sh7lxyRxvd9AIuTQ==", + "peerDependencies": { + "@pixi/core": "7.4.2" + } + }, + "node_modules/@pixi/filter-alpha": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/filter-alpha/-/filter-alpha-7.4.2.tgz", + "integrity": "sha512-9OsKJ+yvY2wIcQXwswj5HQBiwNGymwmqdxfp7mo+nZSBoDmxUqvMZzE9UNJ3eUlswuNvNRO8zNOsQvwdz7WFww==", + "peerDependencies": { + "@pixi/core": "7.4.2" + } + }, + "node_modules/@pixi/filter-blur": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/filter-blur/-/filter-blur-7.4.2.tgz", + "integrity": "sha512-gOXBbIUx6CRZP1fmsis2wLzzSsofrqmIHhbf1gIkZMIQaLsc9T7brj+PaLTTiOiyJgnvGN5j20RZnkERWWKV0Q==", + "peerDependencies": { + "@pixi/core": "7.4.2" + } + }, + "node_modules/@pixi/filter-color-matrix": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/filter-color-matrix/-/filter-color-matrix-7.4.2.tgz", + "integrity": "sha512-ykZiR59Gvj80UKs9qm7jeUTKvn+wWk6HBVJOmJbK9jFK5juakDWp7BbH26U78Q61EWj97kI1FdfcbMkuQ7rqkA==", + "peerDependencies": { + "@pixi/core": "7.4.2" + } + }, + "node_modules/@pixi/filter-displacement": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/filter-displacement/-/filter-displacement-7.4.2.tgz", + "integrity": "sha512-QS/eWp/ivsxef3xapNeGwpPX7vrqQQeo99Fux4k5zsvplnNEsf91t6QYJLG776AbZEu/qh8VYRBA5raIVY/REw==", + "peerDependencies": { + "@pixi/core": "7.4.2" + } + }, + "node_modules/@pixi/filter-fxaa": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/filter-fxaa/-/filter-fxaa-7.4.2.tgz", + "integrity": "sha512-U/ptJgDsfs/r8y2a6gCaiPfDu2IFAxpQ4wtfmBpz6vRhqeE4kI8yNIUx5dZbui57zlsJaW0BNacOQxHU0vLkyQ==", + "peerDependencies": { + "@pixi/core": "7.4.2" + } + }, + "node_modules/@pixi/filter-noise": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/filter-noise/-/filter-noise-7.4.2.tgz", + "integrity": "sha512-Vy9ViBFhZEGh6xKkd3kFWErolZTwv1Y5Qb1bV7qPIYbvBECYsqzlR4uCrrjBV6KKm0PufpG/+NKC5vICZaqKzg==", + "peerDependencies": { + "@pixi/core": "7.4.2" + } + }, + "node_modules/@pixi/graphics": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/graphics/-/graphics-7.4.2.tgz", + "integrity": "sha512-jH4/Tum2RqWzHGzvlwEr7HIVduoLO57Ze705N2zQPkUD57TInn5911aGUeoua7f/wK8cTLGzgB9BzSo2kTdcHw==", + "peerDependencies": { + "@pixi/core": "7.4.2", + "@pixi/display": "7.4.2", + "@pixi/sprite": "7.4.2" + } + }, + "node_modules/@pixi/math": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-7.4.2.tgz", + "integrity": "sha512-7jHmCQoYk6e0rfSKjdNFOPl0wCcdgoraxgteXJTTHv3r0bMNx2pHD9FJ0VvocEUG7XHfj55O3+u7yItOAx0JaQ==" + }, + "node_modules/@pixi/mesh": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/mesh/-/mesh-7.4.2.tgz", + "integrity": "sha512-mEkKyQvvMrYXC3pahvH5WBIKtrtB63WixRr91ANFI7zXD+ESG6Ap6XtxMCJmXDQPwBDNk7SWVMiCflYuchG7kA==", + "peerDependencies": { + "@pixi/core": "7.4.2", + "@pixi/display": "7.4.2" + } + }, + "node_modules/@pixi/mesh-extras": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/mesh-extras/-/mesh-extras-7.4.2.tgz", + "integrity": "sha512-vNR/7wjxjs7sv9fGoKkHyU91ZAD+7EnMHBS5F3CVISlOIFxLi96NNZCB81oUIdky/90pHw40johd/4izR5zTyw==", + "peerDependencies": { + "@pixi/core": "7.4.2", + "@pixi/mesh": "7.4.2" + } + }, + "node_modules/@pixi/mixin-cache-as-bitmap": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/mixin-cache-as-bitmap/-/mixin-cache-as-bitmap-7.4.2.tgz", + "integrity": "sha512-6dgthi2ruUT/lervSrFDQ7vXkEsHo6CxdgV7W/wNdW1dqgQlKfDvO6FhjXzyIMRLSooUf5FoeluVtfsjkUIYrw==", + "peerDependencies": { + "@pixi/core": "7.4.2", + "@pixi/display": "7.4.2", + "@pixi/sprite": "7.4.2" + } + }, + "node_modules/@pixi/mixin-get-child-by-name": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/mixin-get-child-by-name/-/mixin-get-child-by-name-7.4.2.tgz", + "integrity": "sha512-0Cfw8JpQhsixprxiYph4Lj+B5n83Kk4ftNMXgM5xtZz+tVLz5s91qR0MqcdzwTGTJ7utVygiGmS4/3EfR/duRQ==", + "peerDependencies": { + "@pixi/display": "7.4.2" + } + }, + "node_modules/@pixi/mixin-get-global-position": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/mixin-get-global-position/-/mixin-get-global-position-7.4.2.tgz", + "integrity": "sha512-LcsahbVdX4DFS2IcGfNp4KaXuu7SjAwUp/flZSGIfstyKOKb5FWFgihtqcc9ZT4coyri3gs2JbILZub/zPZj1w==", + "peerDependencies": { + "@pixi/core": "7.4.2", + "@pixi/display": "7.4.2" + } + }, + "node_modules/@pixi/particle-container": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/particle-container/-/particle-container-7.4.2.tgz", + "integrity": "sha512-B78Qq86kt0lEa5WtB2YFIm3+PjhKfw9La9R++GBSgABl+g13s2UaZ6BIPxvY3JxWMdxPm4iPrQPFX1QWRN68mw==", + "peerDependencies": { + "@pixi/core": "7.4.2", + "@pixi/display": "7.4.2", + "@pixi/sprite": "7.4.2" + } + }, + "node_modules/@pixi/prepare": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/prepare/-/prepare-7.4.2.tgz", + "integrity": "sha512-PugyMzReCHXUzc3so9PPJj2OdHwibpUNWyqG4mWY2UUkb6c8NAGK1AnAPiscOvLilJcv/XQSFoNhX+N1jrvJEg==", + "peerDependencies": { + "@pixi/core": "7.4.2", + "@pixi/display": "7.4.2", + "@pixi/graphics": "7.4.2", + "@pixi/text": "7.4.2" + } + }, + "node_modules/@pixi/runner": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-7.4.2.tgz", + "integrity": "sha512-LPBpwym4vdyyDY5ucF4INQccaGyxztERyLTY1YN6aqJyyMmnc7iqXlIKt+a0euMBtNoLoxy6MWMvIuZj0JfFPA==" + }, + "node_modules/@pixi/settings": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-7.4.2.tgz", + "integrity": "sha512-pMN+L6aWgvUbwhFIL/BTHKe2ShYGPZ8h9wlVBnFHMtUcJcFLMF1B3lzuvCayZRepOphs6RY0TqvnDvVb585JhQ==", + "dependencies": { + "@pixi/constants": "7.4.2", + "@types/css-font-loading-module": "^0.0.12", + "ismobilejs": "^1.1.0" + } + }, + "node_modules/@pixi/sprite": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/sprite/-/sprite-7.4.2.tgz", + "integrity": "sha512-Ccf/OVQsB+HQV0Fyf5lwD+jk1jeU7uSIqEjbxenNNssmEdB7S5qlkTBV2EJTHT83+T6Z9OMOHsreJZerydpjeg==", + "peerDependencies": { + "@pixi/core": "7.4.2", + "@pixi/display": "7.4.2" + } + }, + "node_modules/@pixi/sprite-animated": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/sprite-animated/-/sprite-animated-7.4.2.tgz", + "integrity": "sha512-QPT6yxCUGOBN+98H3pyIZ1ZO6Y7BN1o0Q2IMZEsD1rNfZJrTYS3Q8VlCG5t2YlFlcB8j5iBo24bZb6FUxLOmsQ==", + "peerDependencies": { + "@pixi/core": "7.4.2", + "@pixi/sprite": "7.4.2" + } + }, + "node_modules/@pixi/sprite-tiling": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/sprite-tiling/-/sprite-tiling-7.4.2.tgz", + "integrity": "sha512-Z8PP6ewy3nuDYL+NeEdltHAhuucVgia33uzAitvH3OqqRSx6a6YRBFbNLUM9Sx+fBO2Lk3PpV1g6QZX+NE5LOg==", + "peerDependencies": { + "@pixi/core": "7.4.2", + "@pixi/display": "7.4.2", + "@pixi/sprite": "7.4.2" + } + }, + "node_modules/@pixi/spritesheet": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/spritesheet/-/spritesheet-7.4.2.tgz", + "integrity": "sha512-YIvHdpXW+AYp8vD0NkjJmrdnVHTZKidCnx6k8ATSuuvCT6O5Tuh2N/Ul2oDj4/QaePy0lVhyhAbZpJW00Jr7mQ==", + "peerDependencies": { + "@pixi/assets": "7.4.2", + "@pixi/core": "7.4.2" + } + }, + "node_modules/@pixi/text": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/text/-/text-7.4.2.tgz", + "integrity": "sha512-rZZWpJNsIQ8WoCWrcVg8Gi6L/PDakB941clo6dO3XjoII2ucoOUcnpe5HIkudxi2xPvS/8Bfq990gFEx50TP5A==", + "peerDependencies": { + "@pixi/core": "7.4.2", + "@pixi/sprite": "7.4.2" + } + }, + "node_modules/@pixi/text-bitmap": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/text-bitmap/-/text-bitmap-7.4.2.tgz", + "integrity": "sha512-lPBMJ83JnpFVL+6ckQ8KO8QmwdPm0z9Zs/M0NgFKH2F+BcjelRNnk80NI3O0qBDYSEDQIE+cFbKoZ213kf7zwA==", + "peerDependencies": { + "@pixi/assets": "7.4.2", + "@pixi/core": "7.4.2", + "@pixi/display": "7.4.2", + "@pixi/mesh": "7.4.2", + "@pixi/text": "7.4.2" + } + }, + "node_modules/@pixi/text-html": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/text-html/-/text-html-7.4.2.tgz", + "integrity": "sha512-duOu8oDYeDNuyPozj2DAsQ5VZBbRiwIXy78Gn7H2pCiEAefw/Uv5jJYwdgneKME0e1tOxz1eOUGKPcI6IJnZjw==", + "peerDependencies": { + "@pixi/core": "7.4.2", + "@pixi/display": "7.4.2", + "@pixi/sprite": "7.4.2", + "@pixi/text": "7.4.2" + } + }, + "node_modules/@pixi/ticker": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-7.4.2.tgz", + "integrity": "sha512-cAvxCh/KI6IW4m3tp2b+GQIf+DoSj9NNmPJmsOeEJ7LzvruG8Ps7SKI6CdjQob5WbceL1apBTDbqZ/f77hFDiQ==", + "dependencies": { + "@pixi/extensions": "7.4.2", + "@pixi/settings": "7.4.2", + "@pixi/utils": "7.4.2" + } + }, + "node_modules/@pixi/utils": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-7.4.2.tgz", + "integrity": "sha512-aU/itcyMC4TxFbmdngmak6ey4kC5c16Y5ntIYob9QnjNAfD/7GTsYIBnP6FqEAyO1eq0MjkAALxdONuay1BG3g==", + "dependencies": { + "@pixi/color": "7.4.2", + "@pixi/constants": "7.4.2", + "@pixi/settings": "7.4.2", + "@types/earcut": "^2.1.0", + "earcut": "^2.2.4", + "eventemitter3": "^4.0.0", + "url": "^0.11.0" + } + }, "node_modules/@recogito/react-text-annotator": { "resolved": "packages/text-annotator-react", "link": true @@ -983,9 +1350,9 @@ "dev": true }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", - "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.0.tgz", + "integrity": "sha512-5ZYPOuaAqEH/W3gYsRkxQATBW3Ii1MfaT4EQstTnLKViLi2gLSQmlmtTpGucNP3sXEpOiI5tdGhjdE111ekyEg==", "cpu": [ "arm" ], @@ -996,9 +1363,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", - "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.0.tgz", + "integrity": "sha512-BSbaCmn8ZadK3UAQdlauSvtaJjhlDEjS5hEVVIN3A4bbl3X+otyf/kOJV08bYiRxfejP3DXFzO2jz3G20107+Q==", "cpu": [ "arm64" ], @@ -1009,9 +1376,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", - "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.0.tgz", + "integrity": "sha512-Ovf2evVaP6sW5Ut0GHyUSOqA6tVKfrTHddtmxGQc1CTQa1Cw3/KMCDEEICZBbyppcwnhMwcDce9ZRxdWRpVd6g==", "cpu": [ "arm64" ], @@ -1022,9 +1389,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", - "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.0.tgz", + "integrity": "sha512-U+Jcxm89UTK592vZ2J9st9ajRv/hrwHdnvyuJpa5A2ngGSVHypigidkQJP+YiGL6JODiUeMzkqQzbCG3At81Gg==", "cpu": [ "x64" ], @@ -1035,9 +1402,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", - "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.0.tgz", + "integrity": "sha512-8wZidaUJUTIR5T4vRS22VkSMOVooG0F4N+JSwQXWSRiC6yfEsFMLTYRFHvby5mFFuExHa/yAp9juSphQQJAijQ==", "cpu": [ "arm" ], @@ -1048,9 +1415,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", - "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.0.tgz", + "integrity": "sha512-Iu0Kno1vrD7zHQDxOmvweqLkAzjxEVqNhUIXBsZ8hu8Oak7/5VTPrxOEZXYC1nmrBVJp0ZcL2E7lSuuOVaE3+w==", "cpu": [ "arm64" ], @@ -1061,9 +1428,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", - "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.0.tgz", + "integrity": "sha512-C31QrW47llgVyrRjIwiOwsHFcaIwmkKi3PCroQY5aVq4H0A5v/vVVAtFsI1nfBngtoRpeREvZOkIhmRwUKkAdw==", "cpu": [ "arm64" ], @@ -1074,9 +1441,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", - "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.0.tgz", + "integrity": "sha512-Oq90dtMHvthFOPMl7pt7KmxzX7E71AfyIhh+cPhLY9oko97Zf2C9tt/XJD4RgxhaGeAraAXDtqxvKE1y/j35lA==", "cpu": [ "riscv64" ], @@ -1087,9 +1454,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", - "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.0.tgz", + "integrity": "sha512-yUD/8wMffnTKuiIsl6xU+4IA8UNhQ/f1sAnQebmE/lyQ8abjsVyDkyRkWop0kdMhKMprpNIhPmYlCxgHrPoXoA==", "cpu": [ "x64" ], @@ -1100,9 +1467,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", - "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.0.tgz", + "integrity": "sha512-9RyNqoFNdF0vu/qqX63fKotBh43fJQeYC98hCaf89DYQpv+xu0D8QFSOS0biA7cGuqJFOc1bJ+m2rhhsKcw1hw==", "cpu": [ "x64" ], @@ -1113,9 +1480,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", - "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.0.tgz", + "integrity": "sha512-46ue8ymtm/5PUU6pCvjlic0z82qWkxv54GTJZgHrQUuZnVH+tvvSP0LsozIDsCBFO4VjJ13N68wqrKSeScUKdA==", "cpu": [ "arm64" ], @@ -1126,9 +1493,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", - "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.0.tgz", + "integrity": "sha512-P5/MqLdLSlqxbeuJ3YDeX37srC8mCflSyTrUsgbU1c/U9j6l2g2GiIdYaGD9QjdMQPMSgYm7hgg0551wHyIluw==", "cpu": [ "ia32" ], @@ -1139,9 +1506,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", - "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.0.tgz", + "integrity": "sha512-UKXUQNbO3DOhzLRwHSpa0HnhhCgNODvfoPWv2FCXme8N/ANFfhIPMGuOT+QuKd16+B5yxZ0HdpNlqPvTMS1qfw==", "cpu": [ "x64" ], @@ -1282,6 +1649,16 @@ "@babel/types": "^7.20.7" } }, + "node_modules/@types/css-font-loading-module": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/@types/css-font-loading-module/-/css-font-loading-module-0.0.12.tgz", + "integrity": "sha512-x2tZZYkSxXqWvTDgveSynfjq/T2HyiZHXb00j/+gy19yp70PHCizM48XFdjBCWH7eHBD0R5i/pw9yMBP/BH5uA==" + }, + "node_modules/@types/earcut": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@types/earcut/-/earcut-2.1.4.tgz", + "integrity": "sha512-qp3m9PPz4gULB9MhjGID7wpo3gJ4bTGXm7ltNDsmOvsPduTeHp8wSW9YckBj3mljeOh4F0m2z/0JKAALRKbmLQ==" + }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -1300,9 +1677,9 @@ } }, "node_modules/@types/node": { - "version": "20.11.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", - "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", + "version": "20.11.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz", + "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -1321,9 +1698,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.2.57", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.57.tgz", - "integrity": "sha512-ZvQsktJgSYrQiMirAN60y4O/LRevIV8hUzSOSNB6gfR3/o3wCBFQx3sPwIYtuDMeiVgsSS3UzCV26tEzgnfvQw==", + "version": "18.2.67", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.67.tgz", + "integrity": "sha512-vkIE2vTIMHQ/xL0rgmuoECBCkZFZeHr49HeWSc24AptMbNRo7pwSBvj73rlJJs9fGKj0koS+V7kQB1jHS0uCgw==", "dev": true, "dependencies": { "@types/prop-types": "*", @@ -1332,9 +1709,9 @@ } }, "node_modules/@types/react-dom": { - "version": "18.2.19", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.19.tgz", - "integrity": "sha512-aZvQL6uUbIJpjZk4U8JZGbau9KDeAwMfmhyWorxgBkqDIEf6ROjRozcmPIicqsUwPUjbkDfHKgGee1Lq65APcA==", + "version": "18.2.22", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.22.tgz", + "integrity": "sha512-fHkBXPeNtfvri6gdsMYyW+dW7RXFo6Ad09nLFK0VQWR7yGLai/Cyvyj696gbwYvBnhGtevUG9cET0pmUbMtoPQ==", "dev": true, "dependencies": { "@types/react": "*" @@ -1378,13 +1755,13 @@ } }, "node_modules/@vitest/expect": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.3.1.tgz", - "integrity": "sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.4.0.tgz", + "integrity": "sha512-Jths0sWCJZ8BxjKe+p+eKsoqev1/T8lYcrjavEaz8auEJ4jAVY0GwW3JKmdVU4mmNPLPHixh4GNXP7GFtAiDHA==", "dev": true, "dependencies": { - "@vitest/spy": "1.3.1", - "@vitest/utils": "1.3.1", + "@vitest/spy": "1.4.0", + "@vitest/utils": "1.4.0", "chai": "^4.3.10" }, "funding": { @@ -1392,12 +1769,12 @@ } }, "node_modules/@vitest/runner": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.3.1.tgz", - "integrity": "sha512-5FzF9c3jG/z5bgCnjr8j9LNq/9OxV2uEBAITOXfoe3rdZJTdO7jzThth7FXv/6b+kdY65tpRQB7WaKhNZwX+Kg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.4.0.tgz", + "integrity": "sha512-EDYVSmesqlQ4RD2VvWo3hQgTJ7ZrFQ2VSJdfiJiArkCerDAGeyF1i6dHkmySqk573jLp6d/cfqCN+7wUB5tLgg==", "dev": true, "dependencies": { - "@vitest/utils": "1.3.1", + "@vitest/utils": "1.4.0", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -1406,9 +1783,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.3.1.tgz", - "integrity": "sha512-EF++BZbt6RZmOlE3SuTPu/NfwBF6q4ABS37HHXzs2LUVPBLx2QoY/K0fKpRChSo8eLiuxcbCVfqKgx/dplCDuQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.4.0.tgz", + "integrity": "sha512-saAFnt5pPIA5qDGxOHxJ/XxhMFKkUSBJmVt5VgDsAqPTX6JP326r5C/c9UuCMPoXNzuudTPsYDZCoJ5ilpqG2A==", "dev": true, "dependencies": { "magic-string": "^0.30.5", @@ -1420,9 +1797,9 @@ } }, "node_modules/@vitest/spy": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.3.1.tgz", - "integrity": "sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.4.0.tgz", + "integrity": "sha512-Ywau/Qs1DzM/8Uc+yA77CwSegizMlcgTJuYGAi0jujOteJOUf1ujunHThYo243KG9nAyWT3L9ifPYZ5+As/+6Q==", "dev": true, "dependencies": { "tinyspy": "^2.2.0" @@ -1432,9 +1809,9 @@ } }, "node_modules/@vitest/utils": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.3.1.tgz", - "integrity": "sha512-d3Waie/299qqRyHTm2DjADeTaNdNSVsnwHPWrs20JMpjh6eiVq7ggggweO8rc4arhf6rRkWuHKwvxGvejUXZZQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.4.0.tgz", + "integrity": "sha512-mx3Yd1/6e2Vt/PUC98DcqTirtfxUyAZ32uK82r8rZzbtBeBo+nqgnjx/LvqQdWsrvNtm14VmurNgcf4nqY5gJg==", "dev": true, "dependencies": { "diff-sequences": "^29.6.3", @@ -1475,13 +1852,13 @@ } }, "node_modules/@vue/compiler-core": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.19.tgz", - "integrity": "sha512-gj81785z0JNzRcU0Mq98E56e4ltO1yf8k5PQ+tV/7YHnbZkrM0fyFyuttnN8ngJZjbpofWE/m4qjKBiLl8Ju4w==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.21.tgz", + "integrity": "sha512-MjXawxZf2SbZszLPYxaFCjxfibYrzr3eYbKxwpLR9EQN+oaziSu3qKVbwBERj1IFIB8OLUewxB5m/BFzi613og==", "dev": true, "dependencies": { "@babel/parser": "^7.23.9", - "@vue/shared": "3.4.19", + "@vue/shared": "3.4.21", "entities": "^4.5.0", "estree-walker": "^2.0.2", "source-map-js": "^1.0.2" @@ -1494,13 +1871,13 @@ "dev": true }, "node_modules/@vue/compiler-dom": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.19.tgz", - "integrity": "sha512-vm6+cogWrshjqEHTzIDCp72DKtea8Ry/QVpQRYoyTIg9k7QZDX6D8+HGURjtmatfgM8xgCFtJJaOlCaRYRK3QA==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.21.tgz", + "integrity": "sha512-IZC6FKowtT1sl0CR5DpXSiEB5ayw75oT2bma1BEhV7RRR1+cfwLrxc2Z8Zq/RGFzJ8w5r9QtCOvTjQgdn0IKmA==", "dev": true, "dependencies": { - "@vue/compiler-core": "3.4.19", - "@vue/shared": "3.4.19" + "@vue/compiler-core": "3.4.21", + "@vue/shared": "3.4.21" } }, "node_modules/@vue/language-core": { @@ -1529,9 +1906,9 @@ } }, "node_modules/@vue/shared": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.19.tgz", - "integrity": "sha512-/KliRRHMF6LoiThEy+4c1Z4KB/gbPrGjWwJR+crg2otgrf/egKzRaCPvJ51S5oetgsgXLfc4Rm5ZgrKHZrtMSw==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.21.tgz", + "integrity": "sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==", "dev": true }, "node_modules/acorn": { @@ -1702,10 +2079,28 @@ "node": ">=8" } }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/caniuse-lite": { - "version": "1.0.30001588", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001588.tgz", - "integrity": "sha512-+hVY9jE44uKLkH0SrUTqxjxqNTOWHsbnQDIKjwkZ3lNTzUUVdBLBGXtj/q5Mp5u98r3droaZAewQuEDzjQdZlQ==", + "version": "1.0.30001600", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001600.tgz", + "integrity": "sha512-+2S9/2JFhYmYaDpZvo0lKkfvuKIglrx68MwOBqMGHhQsNkLjB5xtc/TGoEPs+MxjSyN/72qer2g97nzR641mOQ==", "dev": true, "funding": [ { @@ -1946,6 +2341,22 @@ "node": ">=6" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -1972,10 +2383,15 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/earcut": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" + }, "node_modules/electron-to-chromium": { - "version": "1.4.677", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.677.tgz", - "integrity": "sha512-erDa3CaDzwJOpyvfKhOiJjBVNnMM0qxHq47RheVVwsSQrgBA9ZSGV9kdaOfZDPXcHzhG7lBxhj6A7KvfLJBd6Q==", + "version": "1.4.715", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.715.tgz", + "integrity": "sha512-XzWNH4ZSa9BwVUQSDorPWAUQ5WGuYz7zJUNpNif40zFCiCl20t8zgylmreNmn26h5kiyw2lg7RfTmeMBsDklqg==", "dev": true }, "node_modules/entities": { @@ -1990,10 +2406,29 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/esbuild": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", - "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", "dev": true, "hasInstallScript": true, "bin": { @@ -2003,29 +2438,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.12", - "@esbuild/android-arm": "0.19.12", - "@esbuild/android-arm64": "0.19.12", - "@esbuild/android-x64": "0.19.12", - "@esbuild/darwin-arm64": "0.19.12", - "@esbuild/darwin-x64": "0.19.12", - "@esbuild/freebsd-arm64": "0.19.12", - "@esbuild/freebsd-x64": "0.19.12", - "@esbuild/linux-arm": "0.19.12", - "@esbuild/linux-arm64": "0.19.12", - "@esbuild/linux-ia32": "0.19.12", - "@esbuild/linux-loong64": "0.19.12", - "@esbuild/linux-mips64el": "0.19.12", - "@esbuild/linux-ppc64": "0.19.12", - "@esbuild/linux-riscv64": "0.19.12", - "@esbuild/linux-s390x": "0.19.12", - "@esbuild/linux-x64": "0.19.12", - "@esbuild/netbsd-x64": "0.19.12", - "@esbuild/openbsd-x64": "0.19.12", - "@esbuild/sunos-x64": "0.19.12", - "@esbuild/win32-arm64": "0.19.12", - "@esbuild/win32-ia32": "0.19.12", - "@esbuild/win32-x64": "0.19.12" + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" } }, "node_modules/escalade": { @@ -2055,6 +2490,11 @@ "@types/estree": "^1.0.0" } }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + }, "node_modules/execa": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", @@ -2145,7 +2585,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -2168,6 +2607,24 @@ "node": "*" } }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-stream": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", @@ -2195,6 +2652,17 @@ "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", "dev": true }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -2210,11 +2678,43 @@ "node": ">=4" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/hasown": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", - "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", - "dev": true, + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dependencies": { "function-bind": "^1.1.2" }, @@ -2344,6 +2844,11 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/ismobilejs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ismobilejs/-/ismobilejs-1.1.1.tgz", + "integrity": "sha512-VaFW53yt8QO61k2WJui0dHf4SlL8lxBofUuUmwBo0ljPk0Drz2TiuDW4jo3wDcv41qy/SxrJ+VAzJ/qYqsmzRw==" + }, "node_modules/jju": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", @@ -2516,9 +3021,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.7.tgz", - "integrity": "sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==", + "version": "0.30.8", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", + "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" @@ -2588,9 +3093,9 @@ } }, "node_modules/mlly": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.5.0.tgz", - "integrity": "sha512-NPVQvAY1xr1QoVeG0cy8yUYC7FQcOx6evl/RjT1wL5FvzPnzOysoqB/jmx/DhssT2dYa8nxECLAaFI/+gVLhDQ==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz", + "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==", "dev": true, "dependencies": { "acorn": "^8.11.3", @@ -2643,9 +3148,9 @@ "dev": true }, "node_modules/npm-run-path": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", - "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dev": true, "dependencies": { "path-key": "^4.0.0" @@ -2669,6 +3174,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/onetime": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", @@ -2688,7 +3201,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/openseadragon/-/openseadragon-4.1.0.tgz", "integrity": "sha512-XMMzf5apmshvIvxvqMwiW9dJ07dol4zudvV1oFnoZuIpSZP3c3tlFjGbyOKHGhb1k4jmHQ7b7koG9vCHdKvC/A==", - "devOptional": true, "funding": { "url": "https://opencollective.com/openseadragon" } @@ -2785,6 +3297,47 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pixi.js": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/pixi.js/-/pixi.js-7.4.2.tgz", + "integrity": "sha512-TifqgHGNofO7UCEbdZJOpUu7dUnpu4YZ0o76kfCqxDa4RS8ITc9zjECCbtalmuNXkVhSEZmBKQvE7qhHMqw/xg==", + "dependencies": { + "@pixi/accessibility": "7.4.2", + "@pixi/app": "7.4.2", + "@pixi/assets": "7.4.2", + "@pixi/compressed-textures": "7.4.2", + "@pixi/core": "7.4.2", + "@pixi/display": "7.4.2", + "@pixi/events": "7.4.2", + "@pixi/extensions": "7.4.2", + "@pixi/extract": "7.4.2", + "@pixi/filter-alpha": "7.4.2", + "@pixi/filter-blur": "7.4.2", + "@pixi/filter-color-matrix": "7.4.2", + "@pixi/filter-displacement": "7.4.2", + "@pixi/filter-fxaa": "7.4.2", + "@pixi/filter-noise": "7.4.2", + "@pixi/graphics": "7.4.2", + "@pixi/mesh": "7.4.2", + "@pixi/mesh-extras": "7.4.2", + "@pixi/mixin-cache-as-bitmap": "7.4.2", + "@pixi/mixin-get-child-by-name": "7.4.2", + "@pixi/mixin-get-global-position": "7.4.2", + "@pixi/particle-container": "7.4.2", + "@pixi/prepare": "7.4.2", + "@pixi/sprite": "7.4.2", + "@pixi/sprite-animated": "7.4.2", + "@pixi/sprite-tiling": "7.4.2", + "@pixi/spritesheet": "7.4.2", + "@pixi/text": "7.4.2", + "@pixi/text-bitmap": "7.4.2", + "@pixi/text-html": "7.4.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/pixijs" + } + }, "node_modules/pkg-types": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", @@ -2797,9 +3350,9 @@ } }, "node_modules/postcss": { - "version": "8.4.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", - "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", "dev": true, "funding": [ { @@ -2818,7 +3371,7 @@ "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "source-map-js": "^1.2.0" }, "engines": { "node": "^10 || ^12 || >=14" @@ -2883,6 +3436,20 @@ "node": ">=6" } }, + "node_modules/qs": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.0.tgz", + "integrity": "sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg==", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", @@ -2973,9 +3540,9 @@ } }, "node_modules/rollup": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", - "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.13.0.tgz", + "integrity": "sha512-3YegKemjoQnYKmsBlOHfMLVPPA5xLkQ8MHLLSw/fBrFaVkEayL51DilPpNNLq1exr98F2B1TzrV0FUlN3gWRPg==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -2988,19 +3555,19 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.12.0", - "@rollup/rollup-android-arm64": "4.12.0", - "@rollup/rollup-darwin-arm64": "4.12.0", - "@rollup/rollup-darwin-x64": "4.12.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.12.0", - "@rollup/rollup-linux-arm64-gnu": "4.12.0", - "@rollup/rollup-linux-arm64-musl": "4.12.0", - "@rollup/rollup-linux-riscv64-gnu": "4.12.0", - "@rollup/rollup-linux-x64-gnu": "4.12.0", - "@rollup/rollup-linux-x64-musl": "4.12.0", - "@rollup/rollup-win32-arm64-msvc": "4.12.0", - "@rollup/rollup-win32-ia32-msvc": "4.12.0", - "@rollup/rollup-win32-x64-msvc": "4.12.0", + "@rollup/rollup-android-arm-eabi": "4.13.0", + "@rollup/rollup-android-arm64": "4.13.0", + "@rollup/rollup-darwin-arm64": "4.13.0", + "@rollup/rollup-darwin-x64": "4.13.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.13.0", + "@rollup/rollup-linux-arm64-gnu": "4.13.0", + "@rollup/rollup-linux-arm64-musl": "4.13.0", + "@rollup/rollup-linux-riscv64-gnu": "4.13.0", + "@rollup/rollup-linux-x64-gnu": "4.13.0", + "@rollup/rollup-linux-x64-musl": "4.13.0", + "@rollup/rollup-win32-arm64-msvc": "4.13.0", + "@rollup/rollup-win32-ia32-msvc": "4.13.0", + "@rollup/rollup-win32-x64-msvc": "4.13.0", "fsevents": "~2.3.2" } }, @@ -3045,6 +3612,22 @@ "semver": "bin/semver.js" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -3066,6 +3649,23 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", @@ -3094,9 +3694,9 @@ } }, "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3196,9 +3796,9 @@ } }, "node_modules/svelte": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.11.tgz", - "integrity": "sha512-YIQk3J4X89wOLhjsqIW8tqY3JHPuBdtdOIkASP2PZeAMcSW9RsIjQzMesCrxOF3gdWYC0mKknlKF7OqmLM+Zqg==", + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.12.tgz", + "integrity": "sha512-d8+wsh5TfPwqVzbm4/HCXC783/KPHV60NvwitJnyTA5lWn1elhXMNWhXGCJ7PwPa8qFUnyJNIyuIRt2mT0WMug==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.1", @@ -3287,9 +3887,9 @@ } }, "node_modules/tsconfck": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.0.2.tgz", - "integrity": "sha512-6lWtFjwuhS3XI4HsX4Zg0izOI3FU/AI9EGVlPEUMDIhvLPMD4wkiof0WCoDgW7qY+Dy198g4d9miAqUHWHFH6Q==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.0.3.tgz", + "integrity": "sha512-4t0noZX9t6GcPTfBAbIbbIU4pfpCwh0ueq3S4O/5qXI1VwK1outmxhe9dOiEWqMz3MW2LKgDTpqWV+37IWuVbA==", "dev": true, "bin": { "tsconfck": "bin/tsconfck.js" @@ -3316,9 +3916,9 @@ } }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz", + "integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -3329,9 +3929,9 @@ } }, "node_modules/ufo": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.4.0.tgz", - "integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", + "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", "dev": true }, "node_modules/undici-types": { @@ -3388,6 +3988,15 @@ "punycode": "^2.1.0" } }, + "node_modules/url": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.3.tgz", + "integrity": "sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==", + "dependencies": { + "punycode": "^1.4.1", + "qs": "^6.11.2" + } + }, "node_modules/url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -3398,6 +4007,11 @@ "requires-port": "^1.0.0" } }, + "node_modules/url/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" + }, "node_modules/uuid": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", @@ -3420,14 +4034,14 @@ } }, "node_modules/vite": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.3.tgz", - "integrity": "sha512-UfmUD36DKkqhi/F75RrxvPpry+9+tTkrXfMNZD+SboZqBCMsxKtO52XeGzzuh7ioz+Eo/SYDBbdb0Z7vgcDJew==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.2.tgz", + "integrity": "sha512-FWZbz0oSdLq5snUI0b6sULbz58iXFXdvkZfZWR/F0ZJuKTSPO7v72QPXt6KqYeMFb0yytNp6kZosxJ96Nr/wDQ==", "dev": true, "dependencies": { - "esbuild": "^0.19.3", - "postcss": "^8.4.35", - "rollup": "^4.2.0" + "esbuild": "^0.20.1", + "postcss": "^8.4.36", + "rollup": "^4.13.0" }, "bin": { "vite": "bin/vite.js" @@ -3475,9 +4089,9 @@ } }, "node_modules/vite-node": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.3.1.tgz", - "integrity": "sha512-azbRrqRxlWTJEVbzInZCTchx0X69M/XPTCz4H+TLvlTcR/xH/3hkRqhOakT41fMJCMzXTu4UvegkZiEoJAWvng==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.4.0.tgz", + "integrity": "sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -3523,14 +4137,14 @@ } }, "node_modules/vite-tsconfig-paths": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.3.1.tgz", - "integrity": "sha512-cfgJwcGOsIxXOLU/nELPny2/LUD/lcf1IbfyeKTv2bsupVbTH/xpFtdQlBmIP1GEK2CjjLxYhFfB+QODFAx5aw==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.3.2.tgz", + "integrity": "sha512-0Vd/a6po6Q+86rPlntHye7F31zA2URZMbH8M3saAZ/xR9QoGN/L21bxEGfXdWmFdNkqPpRdxFT7nmNe12e9/uA==", "dev": true, "dependencies": { "debug": "^4.1.1", "globrex": "^0.1.2", - "tsconfck": "^3.0.1" + "tsconfck": "^3.0.3" }, "peerDependencies": { "vite": "*" @@ -3542,16 +4156,16 @@ } }, "node_modules/vitest": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.3.1.tgz", - "integrity": "sha512-/1QJqXs8YbCrfv/GPQ05wAZf2eakUPLPa18vkJAKE7RXOKfVHqMZZ1WlTjiwl6Gcn65M5vpNUB6EFLnEdRdEXQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.4.0.tgz", + "integrity": "sha512-gujzn0g7fmwf83/WzrDTnncZt2UiXP41mHuFYFrdwaLRVQ6JYQEiME2IfEjU3vcFL3VKa75XhI3lFgn+hfVsQw==", "dev": true, "dependencies": { - "@vitest/expect": "1.3.1", - "@vitest/runner": "1.3.1", - "@vitest/snapshot": "1.3.1", - "@vitest/spy": "1.3.1", - "@vitest/utils": "1.3.1", + "@vitest/expect": "1.4.0", + "@vitest/runner": "1.4.0", + "@vitest/snapshot": "1.4.0", + "@vitest/spy": "1.4.0", + "@vitest/utils": "1.4.0", "acorn-walk": "^8.3.2", "chai": "^4.3.10", "debug": "^4.3.4", @@ -3565,7 +4179,7 @@ "tinybench": "^2.5.1", "tinypool": "^0.8.2", "vite": "^5.0.0", - "vite-node": "1.3.1", + "vite-node": "1.4.0", "why-is-node-running": "^2.2.2" }, "bin": { @@ -3580,8 +4194,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.3.1", - "@vitest/ui": "1.3.1", + "@vitest/browser": "1.4.0", + "@vitest/ui": "1.4.0", "happy-dom": "*", "jsdom": "*" }, @@ -3832,7 +4446,7 @@ "license": "BSD-3-Clause", "devDependencies": { "@annotorious/core": "^3.0.0-rc.19", - "@recogito/text-annotator": "*", + "@recogito/text-annotator": "3.0.0-rc.18", "CETEIcean": "^1.9.2", "typescript": "^5.3.3", "vite": "^5.1.3", @@ -3840,7 +4454,7 @@ }, "peerDependencies": { "@annotorious/core": "^3.0.0-rc.19", - "@recogito/text-annotator": "*" + "@recogito/text-annotator": "3.0.0-rc.18" } }, "packages/text-annotator": { @@ -3873,7 +4487,7 @@ "@annotorious/core": "^3.0.0-rc.19", "@annotorious/react": "^3.0.0-rc.19", "@neodrag/react": "^2.0.3", - "@recogito/text-annotator": "*", + "@recogito/text-annotator": "3.0.0-rc.18", "CETEIcean": "^1.9.2" }, "devDependencies": { diff --git a/packages/extension-tei/package.json b/packages/extension-tei/package.json index 9dc8cfd4..8e36a56a 100644 --- a/packages/extension-tei/package.json +++ b/packages/extension-tei/package.json @@ -27,7 +27,7 @@ }, "devDependencies": { "@annotorious/core": "^3.0.0-rc.19", - "@recogito/text-annotator": "*", + "@recogito/text-annotator": "3.0.0-rc.18", "CETEIcean": "^1.9.2", "typescript": "^5.3.3", "vite": "^5.1.3", @@ -35,6 +35,6 @@ }, "peerDependencies": { "@annotorious/core": "^3.0.0-rc.19", - "@recogito/text-annotator": "*" + "@recogito/text-annotator": "3.0.0-rc.18" } } diff --git a/packages/text-annotator-react/package.json b/packages/text-annotator-react/package.json index dab94c9d..258f2fe7 100644 --- a/packages/text-annotator-react/package.json +++ b/packages/text-annotator-react/package.json @@ -41,7 +41,7 @@ "dependencies": { "@annotorious/core": "^3.0.0-rc.19", "@annotorious/react": "^3.0.0-rc.19", - "@recogito/text-annotator": "*", + "@recogito/text-annotator": "3.0.0-rc.18", "@neodrag/react": "^2.0.3", "CETEIcean": "^1.9.2" } From c3c2085ba3897bae1a1c8b67e9b339e56ed3cc6a Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Fri, 22 Mar 2024 16:17:19 +0200 Subject: [PATCH 04/31] Replaced `"^3.0.0-rc.19"` -> `"^3.0.0-rc.20"` --- package-lock.json | 8 ++++---- packages/extension-tei/package.json | 4 ++-- packages/text-annotator-react/package.json | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1c44f79a..3f8d03a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4445,7 +4445,7 @@ "version": "3.0.0-rc.18", "license": "BSD-3-Clause", "devDependencies": { - "@annotorious/core": "^3.0.0-rc.19", + "@annotorious/core": "^3.0.0-rc.20", "@recogito/text-annotator": "3.0.0-rc.18", "CETEIcean": "^1.9.2", "typescript": "^5.3.3", @@ -4453,7 +4453,7 @@ "vite-plugin-dts": "^3.7.2" }, "peerDependencies": { - "@annotorious/core": "^3.0.0-rc.19", + "@annotorious/core": "^3.0.0-rc.20", "@recogito/text-annotator": "3.0.0-rc.18" } }, @@ -4484,8 +4484,8 @@ "version": "3.0.0-rc.18", "license": "BSD-3-Clause", "dependencies": { - "@annotorious/core": "^3.0.0-rc.19", - "@annotorious/react": "^3.0.0-rc.19", + "@annotorious/core": "^3.0.0-rc.20", + "@annotorious/react": "^3.0.0-rc.20", "@neodrag/react": "^2.0.3", "@recogito/text-annotator": "3.0.0-rc.18", "CETEIcean": "^1.9.2" diff --git a/packages/extension-tei/package.json b/packages/extension-tei/package.json index 8e36a56a..cde0c528 100644 --- a/packages/extension-tei/package.json +++ b/packages/extension-tei/package.json @@ -26,7 +26,7 @@ "./dist/text-annotator.css": "./dist/text-annotator-tei.css" }, "devDependencies": { - "@annotorious/core": "^3.0.0-rc.19", + "@annotorious/core": "^3.0.0-rc.20", "@recogito/text-annotator": "3.0.0-rc.18", "CETEIcean": "^1.9.2", "typescript": "^5.3.3", @@ -34,7 +34,7 @@ "vite-plugin-dts": "^3.7.2" }, "peerDependencies": { - "@annotorious/core": "^3.0.0-rc.19", + "@annotorious/core": "^3.0.0-rc.20", "@recogito/text-annotator": "3.0.0-rc.18" } } diff --git a/packages/text-annotator-react/package.json b/packages/text-annotator-react/package.json index 258f2fe7..de3e6e36 100644 --- a/packages/text-annotator-react/package.json +++ b/packages/text-annotator-react/package.json @@ -39,8 +39,8 @@ "react-dom": "16.8.0 || >=17.x || >=18.x" }, "dependencies": { - "@annotorious/core": "^3.0.0-rc.19", - "@annotorious/react": "^3.0.0-rc.19", + "@annotorious/core": "^3.0.0-rc.20", + "@annotorious/react": "^3.0.0-rc.20", "@recogito/text-annotator": "3.0.0-rc.18", "@neodrag/react": "^2.0.3", "CETEIcean": "^1.9.2" From 936af721420721d8bddf2bcd775277420eef8bc3 Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Fri, 22 Mar 2024 16:46:30 +0200 Subject: [PATCH 05/31] Added `^3.0.0-rc.21` version usage --- package-lock.json | 58 +++++++++++----------- packages/extension-tei/package.json | 8 +-- packages/text-annotator-react/package.json | 6 +-- packages/text-annotator/package.json | 2 +- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3f8d03a8..e62849b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,19 +28,19 @@ } }, "node_modules/@annotorious/annotorious": { - "version": "3.0.0-rc.20", - "resolved": "https://registry.npmjs.org/@annotorious/annotorious/-/annotorious-3.0.0-rc.20.tgz", - "integrity": "sha512-E1/WOvjR84qtyHKefcNDaBGOyHR2KRg6yvN0PrfgS7b9u0YsOt8GI20NsRuxFKR+WYmWFM051oNLKXnpKKJTCA==", + "version": "3.0.0-rc.21", + "resolved": "https://registry.npmjs.org/@annotorious/annotorious/-/annotorious-3.0.0-rc.21.tgz", + "integrity": "sha512-P38n6sY3++gDkIkjtcnxtpDhk08+MY49rItxjEuTAWwxw4yHwuX2k5IVeVTW4lW7E72jsHA6PrBMrUz5PExcpg==", "dependencies": { - "@annotorious/core": "*", + "@annotorious/core": "^3.0.0-rc.20", "rbush": "^3.0.1", "uuid": "^9.0.1" } }, "node_modules/@annotorious/core": { - "version": "3.0.0-rc.20", - "resolved": "https://registry.npmjs.org/@annotorious/core/-/core-3.0.0-rc.20.tgz", - "integrity": "sha512-75NPHIe9XHmJTd9BpeGEpJtReBAC5SDOZad7Z6Bty+ayahGJIISO9vcMu7zdwewdBk0sh+WLGA/CUXsck0Xjzw==", + "version": "3.0.0-rc.21", + "resolved": "https://registry.npmjs.org/@annotorious/core/-/core-3.0.0-rc.21.tgz", + "integrity": "sha512-IAa/agVVg0JDEEgfBmHWFvCOCe5qonNlghvhY/9OY+KqtKIu8wt6SqkgvL2u1ZQce+/DpSTjc4ow7fA6Uorzag==", "dependencies": { "dequal": "^2.0.3", "nanoevents": "^9.0.0", @@ -49,12 +49,12 @@ } }, "node_modules/@annotorious/openseadragon": { - "version": "3.0.0-rc.20", - "resolved": "https://registry.npmjs.org/@annotorious/openseadragon/-/openseadragon-3.0.0-rc.20.tgz", - "integrity": "sha512-qmrFoWkYGvmXIek7tEFTQgak70Cyu6B904KuZ4LVxOIGYI7aJs9oxyoVsEcUmvPt8IuhI2VjdkFt8z/poegZgg==", + "version": "3.0.0-rc.21", + "resolved": "https://registry.npmjs.org/@annotorious/openseadragon/-/openseadragon-3.0.0-rc.21.tgz", + "integrity": "sha512-tkZFta+I+gd1dQWQ8Djf57r2qh0eUBikXBDxbPVAAMOcu1NyJkYZEUHWGf0QEFCoc1WIPfGLHPgJl4QSZp7Yog==", "dependencies": { - "@annotorious/annotorious": "*", - "@annotorious/core": "*", + "@annotorious/annotorious": "^3.0.0-rc.20", + "@annotorious/core": "^3.0.0-rc.20", "pixi.js": "^7.4.2", "uuid": "^9.0.1" }, @@ -63,13 +63,13 @@ } }, "node_modules/@annotorious/react": { - "version": "3.0.0-rc.20", - "resolved": "https://registry.npmjs.org/@annotorious/react/-/react-3.0.0-rc.20.tgz", - "integrity": "sha512-vvgMvBXjSr4BX4Ie2GRxhUeTGAcP6L3QMURLgECTTWSYnsVxlKkCIlZ1jTQgwAyPNSVDwqHdbxi4YwnFjWcuoQ==", + "version": "3.0.0-rc.21", + "resolved": "https://registry.npmjs.org/@annotorious/react/-/react-3.0.0-rc.21.tgz", + "integrity": "sha512-B8cDXJVMIhK8JyJNDCSeuK+tcmvhLqqi0CMZ4HbDr4y9UPSfBr42JaiWmoWrneCoR9BPRfmRPCw7L3yoGBHaDw==", "dependencies": { - "@annotorious/annotorious": "*", - "@annotorious/core": "*", - "@annotorious/openseadragon": "*", + "@annotorious/annotorious": "^3.0.0-rc.20", + "@annotorious/core": "^3.0.0-rc.20", + "@annotorious/openseadragon": "^3.0.0-rc.20", "@neodrag/react": "^2.0.3" }, "peerDependencies": { @@ -4034,9 +4034,9 @@ } }, "node_modules/vite": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.2.tgz", - "integrity": "sha512-FWZbz0oSdLq5snUI0b6sULbz58iXFXdvkZfZWR/F0ZJuKTSPO7v72QPXt6KqYeMFb0yytNp6kZosxJ96Nr/wDQ==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.3.tgz", + "integrity": "sha512-+i1oagbvkVIhEy9TnEV+fgXsng13nZM90JQbrcPrf6DvW2mXARlz+DK7DLiDP+qeKoD1FCVx/1SpFL1CLq9Mhw==", "dev": true, "dependencies": { "esbuild": "^0.20.1", @@ -4445,16 +4445,16 @@ "version": "3.0.0-rc.18", "license": "BSD-3-Clause", "devDependencies": { - "@annotorious/core": "^3.0.0-rc.20", - "@recogito/text-annotator": "3.0.0-rc.18", + "@annotorious/core": "^3.0.0-rc.21", + "@recogito/text-annotator": "^3.0.0-rc.18", "CETEIcean": "^1.9.2", "typescript": "^5.3.3", "vite": "^5.1.3", "vite-plugin-dts": "^3.7.2" }, "peerDependencies": { - "@annotorious/core": "^3.0.0-rc.20", - "@recogito/text-annotator": "3.0.0-rc.18" + "@annotorious/core": "^3.0.0-rc.21", + "@recogito/text-annotator": "^3.0.0-rc.18" } }, "packages/text-annotator": { @@ -4462,7 +4462,7 @@ "version": "3.0.0-rc.18", "license": "BSD-3-Clause", "dependencies": { - "@annotorious/core": "^3.0.0-rc.18", + "@annotorious/core": "^3.0.0-rc.21", "colord": "^2.9.3", "rbush": "^3.0.1", "uuid": "^9.0.1" @@ -4484,10 +4484,10 @@ "version": "3.0.0-rc.18", "license": "BSD-3-Clause", "dependencies": { - "@annotorious/core": "^3.0.0-rc.20", - "@annotorious/react": "^3.0.0-rc.20", + "@annotorious/core": "^3.0.0-rc.21", + "@annotorious/react": "^3.0.0-rc.21", "@neodrag/react": "^2.0.3", - "@recogito/text-annotator": "3.0.0-rc.18", + "@recogito/text-annotator": "^3.0.0-rc.18", "CETEIcean": "^1.9.2" }, "devDependencies": { diff --git a/packages/extension-tei/package.json b/packages/extension-tei/package.json index cde0c528..f6dbde0f 100644 --- a/packages/extension-tei/package.json +++ b/packages/extension-tei/package.json @@ -26,15 +26,15 @@ "./dist/text-annotator.css": "./dist/text-annotator-tei.css" }, "devDependencies": { - "@annotorious/core": "^3.0.0-rc.20", - "@recogito/text-annotator": "3.0.0-rc.18", + "@annotorious/core": "^3.0.0-rc.21", + "@recogito/text-annotator": "^3.0.0-rc.18", "CETEIcean": "^1.9.2", "typescript": "^5.3.3", "vite": "^5.1.3", "vite-plugin-dts": "^3.7.2" }, "peerDependencies": { - "@annotorious/core": "^3.0.0-rc.20", - "@recogito/text-annotator": "3.0.0-rc.18" + "@annotorious/core": "^3.0.0-rc.21", + "@recogito/text-annotator": "^3.0.0-rc.18" } } diff --git a/packages/text-annotator-react/package.json b/packages/text-annotator-react/package.json index de3e6e36..688ea1b4 100644 --- a/packages/text-annotator-react/package.json +++ b/packages/text-annotator-react/package.json @@ -39,9 +39,9 @@ "react-dom": "16.8.0 || >=17.x || >=18.x" }, "dependencies": { - "@annotorious/core": "^3.0.0-rc.20", - "@annotorious/react": "^3.0.0-rc.20", - "@recogito/text-annotator": "3.0.0-rc.18", + "@annotorious/core": "^3.0.0-rc.21", + "@annotorious/react": "^3.0.0-rc.21", + "@recogito/text-annotator": "^3.0.0-rc.18", "@neodrag/react": "^2.0.3", "CETEIcean": "^1.9.2" } diff --git a/packages/text-annotator/package.json b/packages/text-annotator/package.json index 86b76f14..3b9d04aa 100644 --- a/packages/text-annotator/package.json +++ b/packages/text-annotator/package.json @@ -37,7 +37,7 @@ "vitest": "^1.3.0" }, "dependencies": { - "@annotorious/core": "^3.0.0-rc.18", + "@annotorious/core": "^3.0.0-rc.21", "colord": "^2.9.3", "rbush": "^3.0.1", "uuid": "^9.0.1" From 03f47d9267fc9a989e5b2f9865a36216d2e33d2e Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Fri, 22 Mar 2024 18:47:22 +0200 Subject: [PATCH 06/31] Added missing `@recogito/text-annotator-tei` --- package-lock.json | 1 + packages/text-annotator-react/package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/package-lock.json b/package-lock.json index e62849b2..ff036390 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4488,6 +4488,7 @@ "@annotorious/react": "^3.0.0-rc.21", "@neodrag/react": "^2.0.3", "@recogito/text-annotator": "^3.0.0-rc.18", + "@recogito/text-annotator-tei": "^3.0.0-rc.18", "CETEIcean": "^1.9.2" }, "devDependencies": { diff --git a/packages/text-annotator-react/package.json b/packages/text-annotator-react/package.json index 688ea1b4..2f548655 100644 --- a/packages/text-annotator-react/package.json +++ b/packages/text-annotator-react/package.json @@ -42,6 +42,7 @@ "@annotorious/core": "^3.0.0-rc.21", "@annotorious/react": "^3.0.0-rc.21", "@recogito/text-annotator": "^3.0.0-rc.18", + "@recogito/text-annotator-tei": "^3.0.0-rc.18", "@neodrag/react": "^2.0.3", "CETEIcean": "^1.9.2" } From 102dbc2201309aebed08b8cff88af8f3936c52b2 Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Mon, 25 Mar 2024 18:55:09 +0200 Subject: [PATCH 07/31] Removed `a9s` bundling from the `text-annotator` --- packages/text-annotator/vite.config.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/text-annotator/vite.config.js b/packages/text-annotator/vite.config.js index c302dd58..d454316b 100644 --- a/packages/text-annotator/vite.config.js +++ b/packages/text-annotator/vite.config.js @@ -20,9 +20,13 @@ export default defineConfig({ fileName: (format) => `text-annotator.${format}.js` }, rollupOptions: { + external: ['@annotorious/core'], output: { - assetFileNames: 'text-annotator.[ext]' + assetFileNames: 'text-annotator.[ext]', + globals: { + '@annotorious/core': 'AnnotoriousCore' + } } } } -}); \ No newline at end of file +}); From 11dd7e1da58bbc5d8ab4d120d0eaf406a811649f Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Mon, 25 Mar 2024 18:57:47 +0200 Subject: [PATCH 08/31] Removed `a9s` bundling from the `text-annotator-react` --- packages/text-annotator-react/vite.config.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/text-annotator-react/vite.config.js b/packages/text-annotator-react/vite.config.js index ef81e64b..145f73d8 100644 --- a/packages/text-annotator-react/vite.config.js +++ b/packages/text-annotator-react/vite.config.js @@ -18,6 +18,7 @@ export default defineConfig(({ command, mode }) => ({ open: '/test/index.html' }, build: { + minify: false, lib: { entry: './src/index.ts', name: 'ReactTextAnnotator', @@ -26,19 +27,17 @@ export default defineConfig(({ command, mode }) => ({ }, rollupOptions: { external: [ - ...Object.keys(packageJson.peerDependencies) + ...Object.keys(packageJson.peerDependencies), + "@annotorious/core", + "@annotorious/react", + "@recogito/text-annotator", + "@recogito/text-annotator-tei" ], output: { preserveModules: true, - assetFileNames: 'react-text-annotator.[ext]', - globals: { - '@annotorious/react': 'AnnotoriousReact', - 'openseadragon': 'OpenSeadragon', - 'react': 'React', - 'react-dom': 'ReactDOM' - } + assetFileNames: 'react-text-annotator.[ext]' } }, sourcemap: true } -})); \ No newline at end of file +})); From 4a49403a6c454f5e5334e950bb1e7b837371f755 Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Tue, 26 Mar 2024 18:08:04 +0200 Subject: [PATCH 09/31] Bumped building deps --- package-lock.json | 57 +++++++--------------- packages/extension-tei/package.json | 2 +- packages/text-annotator-react/package.json | 2 +- packages/text-annotator/package.json | 4 +- 4 files changed, 21 insertions(+), 44 deletions(-) diff --git a/package-lock.json b/package-lock.json index ff036390..f12b34db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -83,17 +83,6 @@ } } }, - "node_modules/@asamuzakjp/dom-selector": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@asamuzakjp/dom-selector/-/dom-selector-2.0.2.tgz", - "integrity": "sha512-x1KXOatwofR6ZAYzXRBL5wrdV0vwNxlTCK9NCuLqAzQYARqGcvFwiJA6A1ERuh+dgeA4Dxm3JBYictIes+SqUQ==", - "dev": true, - "dependencies": { - "bidi-js": "^1.0.3", - "css-tree": "^2.3.1", - "is-potential-custom-element-name": "^1.0.1" - } - }, "node_modules/@babel/code-frame": { "version": "7.24.2", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz", @@ -2020,15 +2009,6 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/bidi-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.0.3.tgz", - "integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==", - "dev": true, - "dependencies": { - "require-from-string": "^2.0.2" - } - }, "node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -2861,12 +2841,11 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/jsdom": { - "version": "23.2.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-23.2.0.tgz", - "integrity": "sha512-L88oL7D/8ufIES+Zjz7v0aes+oBMh2Xnh3ygWvL0OaICOomKEPKuPnIfBJekiXr+BHbbMjrWn/xqrDQuxFTeyA==", + "version": "24.0.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.0.0.tgz", + "integrity": "sha512-UDS2NayCvmXSXVP6mpTj+73JnNQadZlr9N68189xib2tx5Mls7swlTNao26IoHv46BZJFvXygyRtyXd1feAk1A==", "dev": true, "dependencies": { - "@asamuzakjp/dom-selector": "^2.0.1", "cssstyle": "^4.0.1", "data-urls": "^5.0.0", "decimal.js": "^10.4.3", @@ -2875,6 +2854,7 @@ "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.2", "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.7", "parse5": "^7.1.2", "rrweb-cssom": "^0.6.0", "saxes": "^6.0.0", @@ -3174,6 +3154,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/nwsapi": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", + "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", + "dev": true + }, "node_modules/object-inspect": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", @@ -3507,15 +3493,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -4034,9 +4011,9 @@ } }, "node_modules/vite": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.3.tgz", - "integrity": "sha512-+i1oagbvkVIhEy9TnEV+fgXsng13nZM90JQbrcPrf6DvW2mXARlz+DK7DLiDP+qeKoD1FCVx/1SpFL1CLq9Mhw==", + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.6.tgz", + "integrity": "sha512-FPtnxFlSIKYjZ2eosBQamz4CbyrTizbZ3hnGJlh/wMtCrlp1Hah6AzBLjGI5I2urTfNnpovpHdrL6YRuBOPnCA==", "dev": true, "dependencies": { "esbuild": "^0.20.1", @@ -4449,7 +4426,7 @@ "@recogito/text-annotator": "^3.0.0-rc.18", "CETEIcean": "^1.9.2", "typescript": "^5.3.3", - "vite": "^5.1.3", + "vite": "^5.2.6", "vite-plugin-dts": "^3.7.2" }, "peerDependencies": { @@ -4471,10 +4448,10 @@ "@types/jsdom": "^21.1.6", "@types/rbush": "^3.0.3", "@types/uuid": "^9.0.8", - "jsdom": "^23.0.1", + "jsdom": "^24.0.0", "svelte": "^4.2.11", "typescript": "^5.3.3", - "vite": "^5.1.3", + "vite": "^5.2.6", "vite-plugin-dts": "^3.7.2", "vitest": "^1.3.0" } @@ -4498,7 +4475,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^5.3.3", - "vite": "^5.1.3", + "vite": "^5.2.6", "vite-plugin-dts": "^3.7.2", "vite-tsconfig-paths": "^4.3.1" }, diff --git a/packages/extension-tei/package.json b/packages/extension-tei/package.json index f6dbde0f..d8965a71 100644 --- a/packages/extension-tei/package.json +++ b/packages/extension-tei/package.json @@ -30,7 +30,7 @@ "@recogito/text-annotator": "^3.0.0-rc.18", "CETEIcean": "^1.9.2", "typescript": "^5.3.3", - "vite": "^5.1.3", + "vite": "^5.2.6", "vite-plugin-dts": "^3.7.2" }, "peerDependencies": { diff --git a/packages/text-annotator-react/package.json b/packages/text-annotator-react/package.json index 2f548655..dd3e9b81 100644 --- a/packages/text-annotator-react/package.json +++ b/packages/text-annotator-react/package.json @@ -30,7 +30,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^5.3.3", - "vite": "^5.1.3", + "vite": "^5.2.6", "vite-plugin-dts": "^3.7.2", "vite-tsconfig-paths": "^4.3.1" }, diff --git a/packages/text-annotator/package.json b/packages/text-annotator/package.json index 3b9d04aa..468b9d3b 100644 --- a/packages/text-annotator/package.json +++ b/packages/text-annotator/package.json @@ -29,10 +29,10 @@ "@types/jsdom": "^21.1.6", "@types/rbush": "^3.0.3", "@types/uuid": "^9.0.8", - "jsdom": "^23.0.1", + "jsdom": "^24.0.0", "svelte": "^4.2.11", "typescript": "^5.3.3", - "vite": "^5.1.3", + "vite": "^5.2.6", "vite-plugin-dts": "^3.7.2", "vitest": "^1.3.0" }, From 9969234e4c6d5cac22f8079659794650e54fd666 Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Tue, 26 Mar 2024 18:08:59 +0200 Subject: [PATCH 10/31] Removed externalizing of the `a9s/core` --- packages/text-annotator/vite.config.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/text-annotator/vite.config.js b/packages/text-annotator/vite.config.js index d454316b..43712e77 100644 --- a/packages/text-annotator/vite.config.js +++ b/packages/text-annotator/vite.config.js @@ -20,12 +20,8 @@ export default defineConfig({ fileName: (format) => `text-annotator.${format}.js` }, rollupOptions: { - external: ['@annotorious/core'], output: { - assetFileNames: 'text-annotator.[ext]', - globals: { - '@annotorious/core': 'AnnotoriousCore' - } + assetFileNames: 'text-annotator.[ext]' } } } From d56aad679d496eea63c694f4373bb2d614f440b2 Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Tue, 26 Mar 2024 18:11:45 +0200 Subject: [PATCH 11/31] Lock regenerate --- package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index f12b34db..94129272 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4427,7 +4427,7 @@ "CETEIcean": "^1.9.2", "typescript": "^5.3.3", "vite": "^5.2.6", - "vite-plugin-dts": "^3.7.2" + "vite-plugin-dts": "^3.7.3" }, "peerDependencies": { "@annotorious/core": "^3.0.0-rc.21", @@ -4449,11 +4449,11 @@ "@types/rbush": "^3.0.3", "@types/uuid": "^9.0.8", "jsdom": "^24.0.0", - "svelte": "^4.2.11", + "svelte": "^4.2.12", "typescript": "^5.3.3", "vite": "^5.2.6", - "vite-plugin-dts": "^3.7.2", - "vitest": "^1.3.0" + "vite-plugin-dts": "^3.7.3", + "vitest": "^1.4.0" } }, "packages/text-annotator-react": { @@ -4469,15 +4469,15 @@ "CETEIcean": "^1.9.2" }, "devDependencies": { - "@types/react-dom": "^18.2.19", + "@types/react-dom": "^18.2.22", "@vitejs/plugin-react": "^4.2.1", "openseadragon": "4.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^5.3.3", "vite": "^5.2.6", - "vite-plugin-dts": "^3.7.2", - "vite-tsconfig-paths": "^4.3.1" + "vite-plugin-dts": "^3.7.3", + "vite-tsconfig-paths": "^4.3.2" }, "peerDependencies": { "react": "16.8.0 || >=17.x || >=18.x", From e392472b695f8aa28709b6455e8c45c4eb9536b2 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Wed, 27 Mar 2024 11:34:52 +0100 Subject: [PATCH 12/31] Starting overhaul of the store + SPAN-based rendering layer --- package-lock.json | 42 +-- packages/extension-tei/package.json | 2 +- packages/text-annotator-react/package.json | 2 +- packages/text-annotator/package.json | 2 +- packages/text-annotator/src/TextAnnotator.ts | 11 +- .../src/highlight/HighlightStyle.ts | 12 +- .../src/highlight/canvas/highlightRenderer.ts | 15 + .../src/highlight/css/highlights.ts | 26 +- .../text-annotator/src/highlight/index.ts | 3 +- .../src/highlight/span/index.ts | 1 + .../src/highlight/span/spanRenderer.ts | 139 ++++++++ .../src/highlight/span/spans.css | 17 + .../src/highlight/span/spans.ts | 106 +++++++ .../src/state/TextAnnotationStore.ts | 4 +- .../src/state/TextAnnotatorState.ts | 43 +-- .../text-annotator/src/state/spatialTree.ts | 61 ++-- .../text-annotator/test/annotations.w3c.json | 62 +++- .../test/examples/underlines.html | 297 ++++++++++++++++++ packages/text-annotator/test/index.html | 5 +- 19 files changed, 752 insertions(+), 98 deletions(-) create mode 100644 packages/text-annotator/src/highlight/span/index.ts create mode 100644 packages/text-annotator/src/highlight/span/spanRenderer.ts create mode 100644 packages/text-annotator/src/highlight/span/spans.css create mode 100644 packages/text-annotator/src/highlight/span/spans.ts create mode 100644 packages/text-annotator/test/examples/underlines.html diff --git a/package-lock.json b/package-lock.json index 4f7fc813..37332f67 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,20 +28,20 @@ } }, "node_modules/@annotorious/annotorious": { - "version": "3.0.0-rc.21", - "resolved": "https://registry.npmjs.org/@annotorious/annotorious/-/annotorious-3.0.0-rc.21.tgz", - "integrity": "sha512-P38n6sY3++gDkIkjtcnxtpDhk08+MY49rItxjEuTAWwxw4yHwuX2k5IVeVTW4lW7E72jsHA6PrBMrUz5PExcpg==", + "version": "3.0.0-rc.22", + "resolved": "https://registry.npmjs.org/@annotorious/annotorious/-/annotorious-3.0.0-rc.22.tgz", + "integrity": "sha512-vsG2f2LqtONnwQS/GfWMvK2d5o4yR317UsaPHufOMtMLsNgtRFg7xIWV0Y8Fm7KEGh7iNTQYWgb4aUGcmd5G9g==", "peer": true, "dependencies": { - "@annotorious/core": "^3.0.0-rc.20", + "@annotorious/core": "3.0.0-rc.22", "rbush": "^3.0.1", "uuid": "^9.0.1" } }, "node_modules/@annotorious/core": { - "version": "3.0.0-rc.21", - "resolved": "https://registry.npmjs.org/@annotorious/core/-/core-3.0.0-rc.21.tgz", - "integrity": "sha512-IAa/agVVg0JDEEgfBmHWFvCOCe5qonNlghvhY/9OY+KqtKIu8wt6SqkgvL2u1ZQce+/DpSTjc4ow7fA6Uorzag==", + "version": "3.0.0-rc.22", + "resolved": "https://registry.npmjs.org/@annotorious/core/-/core-3.0.0-rc.22.tgz", + "integrity": "sha512-lXcw12hMf7IVAuRbw1RPogfVfXp98YKOet3JB+8wr/RceNM3d1MdrLWT88MhY7EioNi99cslFaXzGJ2lLmyazw==", "dependencies": { "dequal": "^2.0.3", "nanoevents": "^9.0.0", @@ -50,13 +50,13 @@ } }, "node_modules/@annotorious/openseadragon": { - "version": "3.0.0-rc.21", - "resolved": "https://registry.npmjs.org/@annotorious/openseadragon/-/openseadragon-3.0.0-rc.21.tgz", - "integrity": "sha512-tkZFta+I+gd1dQWQ8Djf57r2qh0eUBikXBDxbPVAAMOcu1NyJkYZEUHWGf0QEFCoc1WIPfGLHPgJl4QSZp7Yog==", + "version": "3.0.0-rc.22", + "resolved": "https://registry.npmjs.org/@annotorious/openseadragon/-/openseadragon-3.0.0-rc.22.tgz", + "integrity": "sha512-3ouC3K+4wyUlpsDLaxFuBFQGDV1QnsKO30S0y/Pdzk/yhkSfuMcaho9gBuaIl2YuxCb9jCG6ntt8hNLtIP+YCQ==", "peer": true, "dependencies": { - "@annotorious/annotorious": "^3.0.0-rc.20", - "@annotorious/core": "^3.0.0-rc.20", + "@annotorious/annotorious": "3.0.0-rc.22", + "@annotorious/core": "3.0.0-rc.22", "pixi.js": "^7.4.2", "uuid": "^9.0.1" }, @@ -65,14 +65,14 @@ } }, "node_modules/@annotorious/react": { - "version": "3.0.0-rc.21", - "resolved": "https://registry.npmjs.org/@annotorious/react/-/react-3.0.0-rc.21.tgz", - "integrity": "sha512-B8cDXJVMIhK8JyJNDCSeuK+tcmvhLqqi0CMZ4HbDr4y9UPSfBr42JaiWmoWrneCoR9BPRfmRPCw7L3yoGBHaDw==", + "version": "3.0.0-rc.22", + "resolved": "https://registry.npmjs.org/@annotorious/react/-/react-3.0.0-rc.22.tgz", + "integrity": "sha512-85nwk825P2b72+ZAC6S8DSrF0wj0Lyh/SmPOirGFPMYn8fSUPkbRzr0DpK/GhuX5PekV8Gm0r2qY0Qznt3euSQ==", "peer": true, "dependencies": { - "@annotorious/annotorious": "^3.0.0-rc.20", - "@annotorious/core": "^3.0.0-rc.20", - "@annotorious/openseadragon": "^3.0.0-rc.20", + "@annotorious/annotorious": "3.0.0-rc.22", + "@annotorious/core": "3.0.0-rc.22", + "@annotorious/openseadragon": "3.0.0-rc.22", "@neodrag/react": "^2.0.3" }, "peerDependencies": { @@ -4433,7 +4433,7 @@ "version": "3.0.0-rc.18", "license": "BSD-3-Clause", "dependencies": { - "@annotorious/core": "^3.0.0-rc.21" + "@annotorious/core": "^3.0.0-rc.22" }, "devDependencies": { "CETEIcean": "^1.9.2", @@ -4447,7 +4447,7 @@ "version": "3.0.0-rc.18", "license": "BSD-3-Clause", "dependencies": { - "@annotorious/core": "^3.0.0-rc.21", + "@annotorious/core": "^3.0.0-rc.22", "colord": "^2.9.3", "rbush": "^3.0.1", "uuid": "^9.0.1" @@ -4484,7 +4484,7 @@ "vite-tsconfig-paths": "^4.3.2" }, "peerDependencies": { - "@annotorious/react": "^3.0.0-rc.21", + "@annotorious/react": "^3.0.0-rc.22", "react": "16.8.0 || >=17.x || >=18.x", "react-dom": "16.8.0 || >=17.x || >=18.x" } diff --git a/packages/extension-tei/package.json b/packages/extension-tei/package.json index e5857c16..70a48bf6 100644 --- a/packages/extension-tei/package.json +++ b/packages/extension-tei/package.json @@ -32,6 +32,6 @@ "vite-plugin-dts": "^3.7.3" }, "dependencies": { - "@annotorious/core": "^3.0.0-rc.21" + "@annotorious/core": "^3.0.0-rc.22" } } diff --git a/packages/text-annotator-react/package.json b/packages/text-annotator-react/package.json index 266cb9ab..5e50405b 100644 --- a/packages/text-annotator-react/package.json +++ b/packages/text-annotator-react/package.json @@ -35,7 +35,7 @@ "vite-tsconfig-paths": "^4.3.2" }, "peerDependencies": { - "@annotorious/react": "^3.0.0-rc.21", + "@annotorious/react": "^3.0.0-rc.22", "react": "16.8.0 || >=17.x || >=18.x", "react-dom": "16.8.0 || >=17.x || >=18.x" }, diff --git a/packages/text-annotator/package.json b/packages/text-annotator/package.json index b1401ae6..862430f9 100644 --- a/packages/text-annotator/package.json +++ b/packages/text-annotator/package.json @@ -37,7 +37,7 @@ "vitest": "^1.4.0" }, "dependencies": { - "@annotorious/core": "^3.0.0-rc.21", + "@annotorious/core": "^3.0.0-rc.22", "colord": "^2.9.3", "rbush": "^3.0.1", "uuid": "^9.0.1" diff --git a/packages/text-annotator/src/TextAnnotator.ts b/packages/text-annotator/src/TextAnnotator.ts index e5454025..5497bed2 100644 --- a/packages/text-annotator/src/TextAnnotator.ts +++ b/packages/text-annotator/src/TextAnnotator.ts @@ -1,6 +1,6 @@ import { createAnonymousGuest, createLifecyleObserver, createBaseAnnotator, DrawingStyle, Filter, createUndoStack } from '@annotorious/core'; import type { Annotator, User, PresenceProvider } from '@annotorious/core'; -import { createCanvasHighlightRenderer, createCSSHighlightRenderer } from './highlight'; +import { createCanvasHighlightRenderer, createCSSHighlightRenderer, createSpanHighlightRenderer } from './highlight'; import { createPresencePainter } from './presence'; import { scrollIntoView } from './api'; import { TextAnnotationStore, TextAnnotatorState, createTextAnnotatorState } from './state'; @@ -51,8 +51,10 @@ export const createTextAnnotator = ( console.log('Using experimental CSS Custom Highlight API renderer'); const highlightRenderer = useExperimentalCSSRenderer - ? createCSSHighlightRenderer(container, state, viewport) + ? createSpanHighlightRenderer(container, state, viewport) + // createCSSHighlightRenderer(container, state, viewport) : createCanvasHighlightRenderer(container, state, viewport); + if (opts.style) highlightRenderer.setDrawingStyle(opts.style); @@ -96,6 +98,10 @@ export const createTextAnnotator = ( } } + const setVisible = (visible: boolean) => { + // TODO + } + const destroy = () => { highlightRenderer.destroy(); selectionHandler.destroy(); @@ -114,6 +120,7 @@ export const createTextAnnotator = ( setUser, setSelected, setPresenceProvider, + setVisible, on: lifecycle.on, off: lifecycle.off, scrollIntoView: scrollIntoView(container, store), diff --git a/packages/text-annotator/src/highlight/HighlightStyle.ts b/packages/text-annotator/src/highlight/HighlightStyle.ts index 14280d8e..394347f3 100644 --- a/packages/text-annotator/src/highlight/HighlightStyle.ts +++ b/packages/text-annotator/src/highlight/HighlightStyle.ts @@ -1,4 +1,5 @@ -import type { DrawingStyle } from '@annotorious/core'; +import type { AnnotationState, Color, DrawingStyle } from '@annotorious/core'; +import type { TextAnnotation } from 'src/model'; export const DEFAULT_STYLE: DrawingStyle = { fill: 'rgb(0, 128, 255)', @@ -14,10 +15,15 @@ export interface HighlightStyle extends Pick HighlightStyle) + + diff --git a/packages/text-annotator/src/highlight/canvas/highlightRenderer.ts b/packages/text-annotator/src/highlight/canvas/highlightRenderer.ts index a00ab644..b40792ae 100644 --- a/packages/text-annotator/src/highlight/canvas/highlightRenderer.ts +++ b/packages/text-annotator/src/highlight/canvas/highlightRenderer.ts @@ -115,6 +115,21 @@ export const createCanvasHighlightRenderer = ( ctx.globalAlpha = style.fillOpacity || 1; offsetRects.forEach(({ x, y, width, height }) => ctx.fillRect(x, y - 2.5, width, height + 5)); + + if (style.underlineColor) { + ctx.globalAlpha = 1; + ctx.strokeStyle = style.underlineColor; + + offsetRects.forEach(({ x, y, width, height }) => { + ctx.beginPath(); + ctx.moveTo(x, y + height + 4); + ctx.lineTo(x + width, y + height + 4); + + // Draw the Path + ctx.stroke(); + }); + } + }); setTimeout(() => onDraw(annotationsInView.map(({ annotation }) => annotation)), 1); diff --git a/packages/text-annotator/src/highlight/css/highlights.ts b/packages/text-annotator/src/highlight/css/highlights.ts index bf096145..bea3233c 100644 --- a/packages/text-annotator/src/highlight/css/highlights.ts +++ b/packages/text-annotator/src/highlight/css/highlights.ts @@ -4,11 +4,22 @@ import type { TextAnnotation } from '../../model'; import type { HighlightPainter } from '../HighlightPainter'; import type { AnnotationRects } from 'src/state'; import type { ViewportBounds } from '../viewport'; -import { DEFAULT_SELECTED_STYLE, DEFAULT_STYLE } from '../HighlightStyle'; - -const toCSS = (s: DrawingStyle) => { - const backgroundColor = colord(s.fill || DEFAULT_STYLE.fill).alpha(s.fillOpacity || DEFAULT_STYLE.fillOpacity).toHex(); - return `background-color: ${backgroundColor};` +import { DEFAULT_SELECTED_STYLE, DEFAULT_STYLE, HighlightStyle } from '../HighlightStyle'; + +const toCSS = (s?: HighlightStyle) => { + const backgroundColor = colord(s?.fill || DEFAULT_STYLE.fill) + .alpha(s?.fillOpacity === undefined ? DEFAULT_STYLE.fillOpacity : s.fillOpacity) + .toHex(); + + const rules = [ + `background-color:${backgroundColor}`, + s?.underlineThickness ? `text-decoration:underline` : undefined, + s?.underlineColor ? `text-decoration-color:${s.underlineColor}` : undefined, + s?.underlineOffset ? `text-underline-offset:${s.underlineOffset}px` : undefined, + s?.underlineThickness ? `text-decoration-thickness:${s.underlineThickness}px` : undefined + ].filter(Boolean); + + return rules.join(';'); } export const createHighlights = () => { @@ -51,6 +62,8 @@ export const createHighlights = () => { return `::highlight(_${h.annotation.id}) { ${toCSS(style)} }`; }); + console.log(updatedCSS.join('\n')); + elem.innerHTML = updatedCSS.join('\n'); // After we have the styles, we need to update the Highlights. @@ -58,7 +71,8 @@ export const createHighlights = () => { // available in TypeScript! // @ts-ignore - toRemove.forEach(id => CSS.highlights.delete(`_${id}`)); + CSS.highlights.clear(); + // toRemove.forEach(id => CSS.highlights.delete(`_${id}`)); // Could be improved further by (re-)setting only annotations that // have changes. diff --git a/packages/text-annotator/src/highlight/index.ts b/packages/text-annotator/src/highlight/index.ts index cdd1a143..6ce061c8 100644 --- a/packages/text-annotator/src/highlight/index.ts +++ b/packages/text-annotator/src/highlight/index.ts @@ -1,2 +1,3 @@ export * from './canvas'; -export * from './css'; \ No newline at end of file +export * from './css'; +export * from './span'; \ No newline at end of file diff --git a/packages/text-annotator/src/highlight/span/index.ts b/packages/text-annotator/src/highlight/span/index.ts new file mode 100644 index 00000000..a3985c26 --- /dev/null +++ b/packages/text-annotator/src/highlight/span/index.ts @@ -0,0 +1 @@ +export * from './spanRenderer'; \ No newline at end of file diff --git a/packages/text-annotator/src/highlight/span/spanRenderer.ts b/packages/text-annotator/src/highlight/span/spanRenderer.ts new file mode 100644 index 00000000..504f135d --- /dev/null +++ b/packages/text-annotator/src/highlight/span/spanRenderer.ts @@ -0,0 +1,139 @@ +import type { DrawingStyle, Filter, ViewportState } from '@annotorious/core'; +import type { TextAnnotatorState } from '../../state'; +import type { TextAnnotation } from '../../model'; +import { debounce } from '../../utils'; +import { getViewportBounds, trackViewport } from '../viewport'; +import { createSpans } from './spans'; +import type { HighlightPainter } from '../HighlightPainter'; + +export const createSpanHighlightRenderer = ( + container: HTMLElement, + state: TextAnnotatorState, + viewport: ViewportState +) => { + const { store, selection, hover } = state; + + let customPainter: HighlightPainter; + + let currentStyle: DrawingStyle | ((annotation: TextAnnotation, selected?: boolean) => DrawingStyle) | undefined; + + let currentFilter: Filter | undefined; + + const spans = createSpans(container); + + const onDraw = trackViewport(viewport); + + const onPointerMove = (event: PointerEvent) => { + const {x, y} = container.getBoundingClientRect(); + + const hit = store.getAt(event.clientX - x, event.clientY - y); + const isVisibleHit = hit && (!currentFilter || currentFilter(hit)); + + if (isVisibleHit) { + if (hover.current !== hit.id) { + container.classList.add('hovered'); + hover.set(hit.id); + } + } else { + if (hover.current) { + container.classList.remove('hovered'); + hover.set(null); + } + } + } + + container.addEventListener('pointermove', onPointerMove); + + const refresh = () => { + const bounds = getViewportBounds(container); + + const { minX, minY, maxX, maxY } = bounds; + + const annotationsInView = currentFilter + ? store.getIntersecting(minX, minY, maxX, maxY).filter(({ annotation }) => currentFilter(annotation)) + : store.getIntersecting(minX, minY, maxX, maxY); + + // Get current selection + const selectedIds = selection.selected.map(({ id }) => id); + + spans.refresh(annotationsInView, bounds, selectedIds, currentStyle); + + setTimeout(() => onDraw(annotationsInView.map(({ annotation }) => annotation)), 1); + } + + const setPainter = (painter: HighlightPainter) => { + customPainter = painter; + spans.setPainter(painter); + } + + // Refresh when style changes + const setDrawingStyle = (style: DrawingStyle | ((a: TextAnnotation, selected?: boolean) => DrawingStyle)) => { + currentStyle = style; + refresh(); + } + + // Refresh when filter changes + const setFilter = (filter?: Filter) => { + currentFilter = filter; + refresh(); + } + + // Refresh on store change + const onStoreChange = () => refresh(); + store.observe(onStoreChange); + + // Refresh on selection change + const unsubscribeSelection = selection.subscribe(() => refresh()); + + // Refresh on scroll + document.addEventListener('scroll', refresh, { capture: true, passive: true }); + + // Refresh on resize + const onResize = debounce(() => { + store.recalculatePositions(); + + if (customPainter) + customPainter.reset(); + + refresh(); + }); + + window.addEventListener('resize', onResize); + + const resizeObserver = new ResizeObserver(onResize); + resizeObserver.observe(container); + + // This is an extra precaution. The position of the container + // might shift (without resizing) due to layout changes higher-up + // in the DOM. (This happens in Recogito+ for example) + // const config: MutationObserverInit = { attributes: true, childList: true, subtree: true }; + + // const mutationObserver = new MutationObserver(refresh); + // mutationObserver.observe(document.body, config); + + const destroy = () => { + container.removeEventListener('pointermove', onPointerMove); + + spans.destroy(); + + store.unobserve(onStoreChange); + + unsubscribeSelection(); + + document.removeEventListener('scroll', refresh); + + window.removeEventListener('resize', onResize); + resizeObserver.disconnect(); + + // mutationObserver.disconnect(); + } + + return { + destroy, + refresh, + setDrawingStyle, + setFilter, + setPainter + } + +} \ No newline at end of file diff --git a/packages/text-annotator/src/highlight/span/spans.css b/packages/text-annotator/src/highlight/span/spans.css new file mode 100644 index 00000000..1a7cdf00 --- /dev/null +++ b/packages/text-annotator/src/highlight/span/spans.css @@ -0,0 +1,17 @@ +.r6o-annotatable .r6o-span-highlight-layer { + height: 100%; + left: 0; + pointer-events: none; + position: absolute; + top: 0; + width: 100%; +} + +.r6o-annotation, +.r6o-annotatable .r6o-span-highlight-layer .r6o-annotation { + position: absolute; + background-color: rgba(255, 255, 0, 0.25); + border-bottom: 2px solid rgba(0, 0, 0, 0.8); + display: block; + +} diff --git a/packages/text-annotator/src/highlight/span/spans.ts b/packages/text-annotator/src/highlight/span/spans.ts new file mode 100644 index 00000000..b7d61041 --- /dev/null +++ b/packages/text-annotator/src/highlight/span/spans.ts @@ -0,0 +1,106 @@ +import type { DrawingStyle } from '@annotorious/core'; +import type { TextAnnotation } from '../../model'; +import type { HighlightPainter } from '../HighlightPainter'; +import type { AnnotationRects, Rect } from 'src/state'; +import type { ViewportBounds } from '../viewport'; + +import './spans.css'; + +const computeZIndex = (rect: Rect, all: Rect[]): number => { + const intersects = (a: Rect, b: Rect): boolean => ( + a.x <= b.x + b.width && a.x + a.width >= b.x && + a.y <= b.y + b.height && a.y + a.height >= b.y + ); + + return all.filter(other => ( + rect !== other && + intersects(rect, other) && + other.width > rect.width + )).length; +} + +export const createSpans = (container: HTMLElement) => { + + container.classList.add('r6o-annotatable'); + + const highlightLayer = document.createElement('div'); + highlightLayer.className = 'r6o-span-highlight-layer'; + + container.insertBefore(highlightLayer, container.firstChild); + + let customPainter: HighlightPainter; + + // Currently rendered SPANs for each annotation ID + let currentRendered = new Map(); + + const refresh = ( + highlights: AnnotationRects[], + viewportBounds: ViewportBounds, + selected: string[], + currentStyle: DrawingStyle | ((annotation: TextAnnotation, selected: boolean) => DrawingStyle) + ) => { + if (customPainter) + customPainter.clear(); + + // Currently rendered IDs + const currentRenderedIds = Array.from(currentRendered.keys()) + + // Next rendered IDs + const nextRendered = highlights.map(h => h.annotation.id); + + // Remove annotations that are no longer visible + const toRemove = currentRenderedIds.filter(id => !nextRendered.includes(id)); + toRemove.forEach(id => { + console.log('removing', id); + (currentRendered.get(id) || []).forEach(span => span.remove()); + currentRendered.delete(id); + }); + + // Rects from all visible annotations, for z-index computation + const allRects = highlights.reduce((all, { rects }) => ([...all, ...rects]), []); + + // Add annotations that are visible but not yet rendered + const rendered = highlights + .filter(({ annotation }) => !currentRenderedIds.includes(annotation.id)) + .map(({ rects, annotation }) => { + // Create one SPAN per rect + const spans = rects.map(rect => { + const span = document.createElement('span'); + span.className = 'r6o-annotation'; + span.dataset.annotation = annotation.id; + + span.style.left = `${rect.x}px`; + span.style.top = `${rect.y}px`; + span.style.width = `${rect.width}px`; + span.style.height = `${rect.height}px`; + + const zIndex = computeZIndex(rect, allRects); + + span.style.paddingBottom = `${zIndex * 3.5}px`; + + // TODO style by annotation! + + highlightLayer.appendChild(span); + + return span; + }); + + return { id: annotation.id, spans }; + }); + + rendered.forEach(({ id, spans }) => currentRendered.set(id, spans)); + } + + const setPainter = (painter: HighlightPainter) => customPainter = painter; + + const destroy = () => { + highlightLayer.remove(); + } + + return { + destroy, + refresh, + setPainter + } + +} \ No newline at end of file diff --git a/packages/text-annotator/src/state/TextAnnotationStore.ts b/packages/text-annotator/src/state/TextAnnotationStore.ts index d2be4aa7..07c789f6 100644 --- a/packages/text-annotator/src/state/TextAnnotationStore.ts +++ b/packages/text-annotator/src/state/TextAnnotationStore.ts @@ -15,9 +15,7 @@ export interface TextAnnotationStore extends Omit, 'addAnn getAt(x: number, y: number): TextAnnotation | undefined; - getIntersecting(minX: number, minY: number, maxX: number, maxY: number): TextAnnotation[]; - - getIntersectingRects(minX: number, minY: number, maxX: number, maxY: number): AnnotationRects[]; + getIntersecting(minX: number, minY: number, maxX: number, maxY: number): AnnotationRects[]; recalculatePositions(): void; diff --git a/packages/text-annotator/src/state/TextAnnotatorState.ts b/packages/text-annotator/src/state/TextAnnotatorState.ts index d7e0be98..b1805057 100644 --- a/packages/text-annotator/src/state/TextAnnotatorState.ts +++ b/packages/text-annotator/src/state/TextAnnotatorState.ts @@ -9,9 +9,9 @@ import { Origin, createViewportState } from '@annotorious/core'; -import { IndexedHighlightRect, createSpatialTree } from './spatialTree'; +import { createSpatialTree } from './spatialTree'; import type { TextAnnotation, TextAnnotationTarget } from '../model'; -import type { AnnotationRects, TextAnnotationStore } from './TextAnnotationStore'; +import type { TextAnnotationStore } from './TextAnnotationStore'; import { isRevived, reviveAnnotation, reviveTarget } from '../utils'; export interface TextAnnotatorState extends AnnotatorState { @@ -112,17 +112,8 @@ export const createTextAnnotatorState = ( return annotationId ? store.getAnnotation(annotationId) : undefined; } - const getIntersecting = (minX: number, minY: number, maxX: number, maxY: number) => { - const rects = tree.getIntersectingRects(minX, minY, maxX, maxY); - const ids = Array.from(new Set(rects.map(item => item.annotation.id))); - - // Note that the tree could be slightly out of sync (because it updates - // by listening to changes, just like anyone else) - return ids.map(id => store.getAnnotation(id)).filter(Boolean); - } - const getAnnotationBounds = (id: string, x?: number, y?: number, buffer = 5): DOMRect => { - const rects = tree.getDOMRectsForAnnotation(id); + const rects = tree.getAnnotationRects(id); if (rects.length === 0) return; if (x && y) { @@ -133,30 +124,7 @@ export const createTextAnnotatorState = ( if (match) return match; } - return tree.getBoundsForAnnotation(id); - } - - const getIntersectingRects = ( - minX: number, - minY: number, - maxX: number, - maxY: number - ): AnnotationRects[] => { - const rects = tree.getIntersectingRects(minX, minY, maxX, maxY); - - // Group by annotation ID - const groupedByAnnotationId: { [key:string]: IndexedHighlightRect[] } = rects.reduce((grouped, rect) => { - (grouped[rect.annotation.id] = grouped[rect.annotation.id] || []).push(rect); - return grouped; - }, {}); - - // Resolve annotation IDs. Note that the tree could be slightly out of sync (because - // it updates by listening to changes, just like anyone else) - return Object.entries(groupedByAnnotationId).map(([annotationId, rects]) => ({ - annotation: store.getAnnotation(annotationId), - rects: rects.map(({ minX, minY, maxX, maxY }) => - ({ x: minX, y: minY, width: maxX - minX, height: maxY - minY })) - })).filter(t => Boolean(t.annotation)); + return tree.getAnnotationBounds(id); } const recalculatePositions = () => tree.recalculate(); @@ -185,8 +153,7 @@ export const createTextAnnotatorState = ( bulkUpsertAnnotations, getAnnotationBounds, getAt, - getIntersecting, - getIntersectingRects, + getIntersecting: tree.getIntersecting, recalculatePositions, updateTarget }, diff --git a/packages/text-annotator/src/state/spatialTree.ts b/packages/text-annotator/src/state/spatialTree.ts index ff76dd2d..ea8b9f35 100644 --- a/packages/text-annotator/src/state/spatialTree.ts +++ b/packages/text-annotator/src/state/spatialTree.ts @@ -4,12 +4,13 @@ import type { TextAnnotation, TextAnnotationTarget } from '../model'; import { mergeClientRects } from '../utils'; import { getClientRectsPonyfill } from '../utils/getClientRectsPonyfill'; import { reviveSelector } from '../utils'; +import type { AnnotationRects } from './TextAnnotationStore'; const isFirefox = false; // navigator.userAgent.match(/firefox|fxios/i); if (isFirefox) console.warn('Firefox interop enabled'); -export interface IndexedHighlightRect { +interface IndexedHighlightRect { minX: number; @@ -36,9 +37,7 @@ export const createSpatialTree = (store: Store, container: HTMLE const index = new Map(); // Helper: converts a single text annotation target to a list of hightlight rects - const toItems = (target: TextAnnotationTarget): IndexedHighlightRect[] => { - const offset = container.getBoundingClientRect(); - + const toItems = (target: TextAnnotationTarget, offset: DOMRect): IndexedHighlightRect[] => { const rects = target.selector.flatMap(s => { const isValidRange = s.range instanceof Range && @@ -53,16 +52,20 @@ export const createSpatialTree = (store: Store, container: HTMLE Array.from(revivedRange.getClientRects()); }); - const merged = mergeClientRects(rects); + const merged = mergeClientRects(rects) + // Offset the merged client rects so that coords + // are relative to the parent container + .map(({ left, top, right, bottom }) => + new DOMRect(left - offset.left, top - offset.top, right - left, bottom - top)); return merged.map(rect => { const { x, y, width, height } = rect; return { - minX: x - offset.x, - minY: y - offset.y, - maxX: x - offset.x + width, - maxY: y - offset.y + height, + minX: x, + minY: y, + maxX: x + width, + maxY: y + height, annotation: { id: target.annotation, rects: merged @@ -79,7 +82,8 @@ export const createSpatialTree = (store: Store, container: HTMLE } const insert = (target: TextAnnotationTarget) => { - const rects = toItems(target); + const rects = toItems(target, container.getBoundingClientRect()); + rects.forEach(rect => tree.insert(rect)); index.set(target.annotation, rects); } @@ -101,7 +105,9 @@ export const createSpatialTree = (store: Store, container: HTMLE if (replace) clear(); - const rectsByTarget = targets.map(target => ({ target, rects: toItems(target) })); + const offset = container.getBoundingClientRect(); + + const rectsByTarget = targets.map(target => ({ target, rects: toItems(target, offset) })); rectsByTarget.forEach(({ target, rects }) => index.set(target.annotation, rects)); const allRects = rectsByTarget.reduce((all, { rects }) => [...all, ...rects], []); @@ -127,8 +133,8 @@ export const createSpatialTree = (store: Store, container: HTMLE } } - const getBoundsForAnnotation = (id: string): DOMRect => { - const rects = getDOMRectsForAnnotation(id); + const getAnnotationBounds = (id: string): DOMRect => { + const rects = getAnnotationRects(id); if (rects.length === 0) return undefined; @@ -150,7 +156,7 @@ export const createSpatialTree = (store: Store, container: HTMLE return new DOMRect(left, top, right - left, bottom - top); } - const getDOMRectsForAnnotation = (id: string): DOMRect[] => { + const getAnnotationRects = (id: string): DOMRect[] => { const indexed = index.get(id); if (indexed) { // Reminder: *each* IndexedHighlightRect stores *all* @@ -161,8 +167,25 @@ export const createSpatialTree = (store: Store, container: HTMLE } } - const getIntersectingRects = (minX: number, minY: number, maxX: number, maxY: number) => - tree.search({ minX, minY, maxX, maxY }); + const getIntersecting = ( + minX: number, + minY: number, + maxX: number, + maxY: number, + ): AnnotationRects[] => { + // All rects in this area, regardless of annotation + const rects = tree.search({ minX, minY, maxX, maxY }); + + // Distinct annotation IDs + const annotationIds = new Set(rects.reduce((ids, rect) => ([...ids, rect.annotation.id]), [])); + + // Resolve annotation IDs. Note that the tree could be slightly out of sync (because + // it updates by listening to changes, just like anyone else) + return Array.from(annotationIds).map(annotationId => ({ + annotation: store.getAnnotation(annotationId), + rects: getAnnotationRects(annotationId) + })).filter(t => Boolean(t.annotation)); + } const size = () => tree.all().length; @@ -173,9 +196,9 @@ export const createSpatialTree = (store: Store, container: HTMLE all, clear, getAt, - getBoundsForAnnotation, - getDOMRectsForAnnotation, - getIntersectingRects, + getAnnotationBounds, + getAnnotationRects, + getIntersecting, insert, recalculate, remove, diff --git a/packages/text-annotator/test/annotations.w3c.json b/packages/text-annotator/test/annotations.w3c.json index cb250aa8..a2c81216 100644 --- a/packages/text-annotator/test/annotations.w3c.json +++ b/packages/text-annotator/test/annotations.w3c.json @@ -82,5 +82,65 @@ } ] } + }, + { + "id": "d254db75-0950-4cd0-89c9-6a41af09bd06", + "@context": "http://www.w3.org/ns/anno.jsonld", + "type": "Annotation", + "body": [], + "creator": { + "isGuest": true, + "id": "htjjQ0q46ZxyQajyl__F" + }, + "created": "2024-03-26T12:55:49.144Z", + "target": [ + { + "annotation": "d254db75-0950-4cd0-89c9-6a41af09bd06", + "source": "https://www.gutenberg.org", + "selector": [ + { + "type": "TextQuoteSelector", + "exact": "t as years went by, the", + "prefix": "ry him. Bu", + "suffix": "re came a " + }, + { + "type": "TextPositionSelector", + "start": 988, + "end": 1011 + } + ] + } + ] + }, + { + "id": "7bae8714-63d9-4e31-9458-ca3aa465bd1b", + "@context": "http://www.w3.org/ns/anno.jsonld", + "type": "Annotation", + "body": [], + "creator": { + "isGuest": true, + "id": "htjjQ0q46ZxyQajyl__F" + }, + "created": "2024-03-26T12:56:39.961Z", + "target": [ + { + "annotation": "7bae8714-63d9-4e31-9458-ca3aa465bd1b", + "source": "https://www.gutenberg.org", + "selector": [ + { + "type": "TextQuoteSelector", + "exact": "d to marry him. But as years we", + "prefix": " and wante", + "suffix": "nt by, the" + }, + { + "type": "TextPositionSelector", + "start": 970, + "end": 1001 + } + ] + } + ] } -] +] \ No newline at end of file diff --git a/packages/text-annotator/test/examples/underlines.html b/packages/text-annotator/test/examples/underlines.html new file mode 100644 index 00000000..63fc848f --- /dev/null +++ b/packages/text-annotator/test/examples/underlines.html @@ -0,0 +1,297 @@ + + + + + + Text Annotator | Underlines Style Example + + + + +
+

Homer: The Odyssey

+ +

+ Tell me, O muse, of that ingenious hero who travelled far and wide after he had sacked the famous town of Troy. + Many cities did he visit, and many were the nations with whose manners and customs he was acquainted; moreover + he suffered much by sea while trying to save his own life and bring his men safely home; but do what he might he + could not save his men, for they perished through their own sheer folly in eating the cattle of the Sun-god + Hyperion; so the god prevented them from ever reaching home. Tell me, too, about all these things, O daughter of + Jove, from whatsoever source you may know them. +

+ +
+ Parent not annotabtale! + And its sub-element +
+ +

+ So now all who escaped death in battle or by shipwreck had got safely home except Ulysses, and he, though he was + longing to return to his wife and country, was detained by the goddess Calypso, who had got him into a large + cave and wanted to marry him. But as years went by, there came a time when the gods settled that he should go + back to Ithaca; even then, however, when he was among his own people, his troubles were not yet over; + nevertheless all the gods had now begun to pity him except Neptune, who still persecuted him without ceasing and + would not let him get home. +

+ +
+ Parent annotatable! + But its sub-element is not! +
+ +

+ Now Neptune had gone off to the Ethiopians, who are at the world's end, and lie in two halves, the one looking + West and the other East. He had gone there to accept a hecatomb of sheep and oxen, and was enjoying himself at + his festival; but the other gods met in the house of Olympian Jove, and the sire of gods and men spoke first. At + that moment he was thinking of Aegisthus, who had been killed by Agamemnon's son Orestes; so he said to the + other gods: +

+ +

+ "See now, how men lay blame upon us gods for what is after all nothing but their own folly. Look at Aegisthus; + he must needs make love to Agamemnon's wife unrighteously and then kill Agamemnon, though he knew it would be + the death of him; for I sent Mercury to warn him not to do either of these things, inasmuch as Orestes would be + sure to take his revenge when he grew up and wanted to return home. Mercury told him this in all good will but + he would not listen, and now he has paid for everything in full." +

+ +

+ Then Minerva said, "Father, son of Saturn, King of kings, it served Aegisthus right, and so it would any one + else who does as he did; but Aegisthus is neither here nor there; it is for Ulysses that my heart bleeds, when I + think of his sufferings in that lonely sea-girt island, far away, poor man, from all his friends. It is an + island covered with forest, in the very middle of the sea, and a goddess lives there, daughter of the magician + Atlas, who looks after the bottom of the ocean, and carries the great columns that keep heaven and earth + asunder. This daughter of Atlas has got hold of poor unhappy Ulysses, and keeps trying by every kind of + blandishment to make him forget his home, so that he is tired of life, and thinks of nothing but how he may once + more see the smoke of his own chimneys. You, sir, take no heed of this, and yet when Ulysses was before Troy did + he not propitiate you with many a burnt sacrifice? Why then should you keep on being so angry with him?" +

+ +

+ And Jove said, "My child, what are you talking about? How can I forget Ulysses than whom there is no more + capable man on earth, nor more liberal in his offerings to the immortal gods that live in heaven? Bear in mind, + however, that Neptune is still furious with Ulysses for having blinded an eye of Polyphemus king of the + Cyclopes. Polyphemus is son to Neptune by the nymph Thoosa, daughter to the sea-king Phorcys; therefore though + he will not kill Ulysses outright, he torments him by preventing him from getting home. Still, let us lay our + heads together and see how we can help him to return; Neptune will then be pacified, for if we are all of a mind + he can hardly stand out against us." +

+ +

+ And Minerva said, "Father, son of Saturn, King of kings, if, then, the gods now mean that Ulysses should get + home, we should first send Mercury to the Ogygian island to tell Calypso that we have made up our minds and that + he is to return. In the meantime I will go to Ithaca, to put heart into Ulysses' son Telemachus; I will embolden + him to call the Achaeans in assembly, and speak out to the suitors of his mother Penelope, who persist in eating + up any number of his sheep and oxen; I will also conduct him to Sparta and to Pylos, to see if he can hear + anything about the return of his dear father- for this will make people speak well of him." +

+ +

+ Tell me, O muse, of that ingenious hero who travelled far and wide after he had sacked the famous town of Troy. + Many cities did he visit, and many were the nations with whose manners and customs he was acquainted; moreover + he suffered much by sea while trying to save his own life and bring his men safely home; but do what he might he + could not save his men, for they perished through their own sheer folly in eating the cattle of the Sun-god + Hyperion; so the god prevented them from ever reaching home. Tell me, too, about all these things, O daughter of + Jove, from whatsoever source you may know them. +

+ +

+ So now all who escaped death in battle or by shipwreck had got safely home except Ulysses, and he, though he was + longing to return to his wife and country, was detained by the goddess Calypso, who had got him into a large + cave and wanted to marry him. But as years went by, there came a time when the gods settled that he should go + back to Ithaca; even then, however, when he was among his own people, his troubles were not yet over; + nevertheless all the gods had now begun to pity him except Neptune, who still persecuted him without ceasing and + would not let him get home. +

+ +

+ Now Neptune had gone off to the Ethiopians, who are at the world's end, and lie in two halves, the one looking + West and the other East. He had gone there to accept a hecatomb of sheep and oxen, and was enjoying himself at + his festival; but the other gods met in the house of Olympian Jove, and the sire of gods and men spoke first. At + that moment he was thinking of Aegisthus, who had been killed by Agamemnon's son Orestes; so he said to the + other gods: +

+ +

+ "See now, how men lay blame upon us gods for what is after all nothing but their own folly. Look at Aegisthus; + he must needs make love to Agamemnon's wife unrighteously and then kill Agamemnon, though he knew it would be + the death of him; for I sent Mercury to warn him not to do either of these things, inasmuch as Orestes would be + sure to take his revenge when he grew up and wanted to return home. Mercury told him this in all good will but + he would not listen, and now he has paid for everything in full." +

+ +

+ Then Minerva said, "Father, son of Saturn, King of kings, it served Aegisthus right, and so it would any one + else who does as he did; but Aegisthus is neither here nor there; it is for Ulysses that my heart bleeds, when I + think of his sufferings in that lonely sea-girt island, far away, poor man, from all his friends. It is an + island covered with forest, in the very middle of the sea, and a goddess lives there, daughter of the magician + Atlas, who looks after the bottom of the ocean, and carries the great columns that keep heaven and earth + asunder. This daughter of Atlas has got hold of poor unhappy Ulysses, and keeps trying by every kind of + blandishment to make him forget his home, so that he is tired of life, and thinks of nothing but how he may once + more see the smoke of his own chimneys. You, sir, take no heed of this, and yet when Ulysses was before Troy did + he not propitiate you with many a burnt sacrifice? Why then should you keep on being so angry with him?" +

+ +

+ And Jove said, "My child, what are you talking about? How can I forget Ulysses than whom there is no more + capable man on earth, nor more liberal in his offerings to the immortal gods that live in heaven? Bear in mind, + however, that Neptune is still furious with Ulysses for having blinded an eye of Polyphemus king of the + Cyclopes. Polyphemus is son to Neptune by the nymph Thoosa, daughter to the sea-king Phorcys; therefore though + he will not kill Ulysses outright, he torments him by preventing him from getting home. Still, let us lay our + heads together and see how we can help him to return; Neptune will then be pacified, for if we are all of a mind + he can hardly stand out against us." +

+ +

+ And Minerva said, "Father, son of Saturn, King of kings, if, then, the gods now mean that Ulysses should get + home, we should first send Mercury to the Ogygian island to tell Calypso that we have made up our minds and that + he is to return. In the meantime I will go to Ithaca, to put heart into Ulysses' son Telemachus; I will embolden + him to call the Achaeans in assembly, and speak out to the suitors of his mother Penelope, who persist in eating + up any number of his sheep and oxen; I will also conduct him to Sparta and to Pylos, to see if he can hear + anything about the return of his dear father- for this will make people speak well of him." +

+ +

+ Tell me, O muse, of that ingenious hero who travelled far and wide after he had sacked the famous town of Troy. + Many cities did he visit, and many were the nations with whose manners and customs he was acquainted; moreover + he suffered much by sea while trying to save his own life and bring his men safely home; but do what he might he + could not save his men, for they perished through their own sheer folly in eating the cattle of the Sun-god + Hyperion; so the god prevented them from ever reaching home. Tell me, too, about all these things, O daughter of + Jove, from whatsoever source you may know them. +

+ +

+ So now all who escaped death in battle or by shipwreck had got safely home except Ulysses, and he, though he was + longing to return to his wife and country, was detained by the goddess Calypso, who had got him into a large + cave and wanted to marry him. But as years went by, there came a time when the gods settled that he should go + back to Ithaca; even then, however, when he was among his own people, his troubles were not yet over; + nevertheless all the gods had now begun to pity him except Neptune, who still persecuted him without ceasing and + would not let him get home. +

+ +

+ Now Neptune had gone off to the Ethiopians, who are at the world's end, and lie in two halves, the one looking + West and the other East. He had gone there to accept a hecatomb of sheep and oxen, and was enjoying himself at + his festival; but the other gods met in the house of Olympian Jove, and the sire of gods and men spoke first. At + that moment he was thinking of Aegisthus, who had been killed by Agamemnon's son Orestes; so he said to the + other gods: +

+ +

+ "See now, how men lay blame upon us gods for what is after all nothing but their own folly. Look at Aegisthus; + he must needs make love to Agamemnon's wife unrighteously and then kill Agamemnon, though he knew it would be + the death of him; for I sent Mercury to warn him not to do either of these things, inasmuch as Orestes would be + sure to take his revenge when he grew up and wanted to return home. Mercury told him this in all good will but + he would not listen, and now he has paid for everything in full." +

+ +

+ Then Minerva said, "Father, son of Saturn, King of kings, it served Aegisthus right, and so it would any one + else who does as he did; but Aegisthus is neither here nor there; it is for Ulysses that my heart bleeds, when I + think of his sufferings in that lonely sea-girt island, far away, poor man, from all his friends. It is an + island covered with forest, in the very middle of the sea, and a goddess lives there, daughter of the magician + Atlas, who looks after the bottom of the ocean, and carries the great columns that keep heaven and earth + asunder. This daughter of Atlas has got hold of poor unhappy Ulysses, and keeps trying by every kind of + blandishment to make him forget his home, so that he is tired of life, and thinks of nothing but how he may once + more see the smoke of his own chimneys. You, sir, take no heed of this, and yet when Ulysses was before Troy did + he not propitiate you with many a burnt sacrifice? Why then should you keep on being so angry with him?" +

+ +

+ And Jove said, "My child, what are you talking about? How can I forget Ulysses than whom there is no more + capable man on earth, nor more liberal in his offerings to the immortal gods that live in heaven? Bear in mind, + however, that Neptune is still furious with Ulysses for having blinded an eye of Polyphemus king of the + Cyclopes. Polyphemus is son to Neptune by the nymph Thoosa, daughter to the sea-king Phorcys; therefore though + he will not kill Ulysses outright, he torments him by preventing him from getting home. Still, let us lay our + heads together and see how we can help him to return; Neptune will then be pacified, for if we are all of a mind + he can hardly stand out against us." +

+ +

+ And Minerva said, "Father, son of Saturn, King of kings, if, then, the gods now mean that Ulysses should get + home, we should first send Mercury to the Ogygian island to tell Calypso that we have made up our minds and that + he is to return. In the meantime I will go to Ithaca, to put heart into Ulysses' son Telemachus; I will embolden + him to call the Achaeans in assembly, and speak out to the suitors of his mother Penelope, who persist in eating + up any number of his sheep and oxen; I will also conduct him to Sparta and to Pylos, to see if he can hear + anything about the return of his dear father- for this will make people speak well of him." +

+
+ + + + diff --git a/packages/text-annotator/test/index.html b/packages/text-annotator/test/index.html index f4ebd9a7..2cd953a0 100644 --- a/packages/text-annotator/test/index.html +++ b/packages/text-annotator/test/index.html @@ -290,6 +290,7 @@
var annotations; + r.loadAnnotations('annotations.w3c.json').then(a => annotations = a); r.on('createAnnotation', annotation => { @@ -309,9 +310,10 @@
}); r.on('viewportIntersect', (annotations) => { - console.log('viewport', annotations); + // console.log('viewport', annotations); }); + /* var filterActive = false; var toggleButton = document.getElementById('filter'); @@ -371,6 +373,7 @@
}) } }); + */ } From 6b492616d062603bb509350fe1082068b89934e3 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Wed, 27 Mar 2024 13:05:59 +0100 Subject: [PATCH 13/31] Refactored rendering code --- packages/text-annotator/src/TextAnnotator.ts | 14 +- .../src/TextAnnotatorOptions.ts | 5 +- .../text-annotator/src/highlight/Highlight.ts | 8 + .../src/highlight/HighlightPainter.ts | 9 +- .../src/highlight/HighlightStyle.ts | 23 +- .../{span/spanRenderer.ts => baseRenderer.ts} | 106 ++++++--- .../src/highlight/canvas/canvasRenderer.ts | 121 ++++++++++ .../src/highlight/canvas/highlightRenderer.ts | 214 ------------------ .../src/highlight/canvas/index.ts | 2 +- .../src/highlight/css/highlightRenderer.ts | 139 ------------ .../text-annotator/src/highlight/css/index.ts | 1 - .../highlightsRenderer.ts} | 49 ++-- .../src/highlight/highlights/index.ts | 1 + .../text-annotator/src/highlight/index.ts | 2 +- .../src/highlight/span/index.ts | 2 +- .../span/{spans.css => spansRenderer.css} | 2 - .../span/{spans.ts => spansRenderer.ts} | 33 +-- 17 files changed, 272 insertions(+), 459 deletions(-) create mode 100644 packages/text-annotator/src/highlight/Highlight.ts rename packages/text-annotator/src/highlight/{span/spanRenderer.ts => baseRenderer.ts} (56%) create mode 100644 packages/text-annotator/src/highlight/canvas/canvasRenderer.ts delete mode 100644 packages/text-annotator/src/highlight/canvas/highlightRenderer.ts delete mode 100644 packages/text-annotator/src/highlight/css/highlightRenderer.ts delete mode 100644 packages/text-annotator/src/highlight/css/index.ts rename packages/text-annotator/src/highlight/{css/highlights.ts => highlights/highlightsRenderer.ts} (71%) create mode 100644 packages/text-annotator/src/highlight/highlights/index.ts rename packages/text-annotator/src/highlight/span/{spans.css => spansRenderer.css} (94%) rename packages/text-annotator/src/highlight/span/{spans.ts => spansRenderer.ts} (78%) diff --git a/packages/text-annotator/src/TextAnnotator.ts b/packages/text-annotator/src/TextAnnotator.ts index 5497bed2..68353a66 100644 --- a/packages/text-annotator/src/TextAnnotator.ts +++ b/packages/text-annotator/src/TextAnnotator.ts @@ -1,6 +1,6 @@ import { createAnonymousGuest, createLifecyleObserver, createBaseAnnotator, DrawingStyle, Filter, createUndoStack } from '@annotorious/core'; import type { Annotator, User, PresenceProvider } from '@annotorious/core'; -import { createCanvasHighlightRenderer, createCSSHighlightRenderer, createSpanHighlightRenderer } from './highlight'; +import { createCanvasRenderer, createHighlightsRenderer, createSpansRenderer } from './highlight'; import { createPresencePainter } from './presence'; import { scrollIntoView } from './api'; import { TextAnnotationStore, TextAnnotatorState, createTextAnnotatorState } from './state'; @@ -50,14 +50,12 @@ export const createTextAnnotator = ( if (useExperimentalCSSRenderer) console.log('Using experimental CSS Custom Highlight API renderer'); - const highlightRenderer = useExperimentalCSSRenderer - ? createSpanHighlightRenderer(container, state, viewport) + const highlightRenderer = /* */createSpansRenderer(container, state, viewport) // createCSSHighlightRenderer(container, state, viewport) - : createCanvasHighlightRenderer(container, state, viewport); + //: createCanvasHighlightRenderer(container, state, viewport); - if (opts.style) - highlightRenderer.setDrawingStyle(opts.style); + highlightRenderer.setStyle(opts.style); const selectionHandler = SelectionHandler(container, state, opts.offsetReferenceSelector); @@ -76,7 +74,7 @@ export const createTextAnnotator = ( highlightRenderer.setFilter(filter); const setStyle = (drawingStyle: DrawingStyle | ((annotation: TextAnnotation) => DrawingStyle) | undefined) => - highlightRenderer.setDrawingStyle(drawingStyle); + highlightRenderer.setStyle(drawingStyle); const setUser = (user: User) => { currentUser = user; @@ -86,7 +84,7 @@ export const createTextAnnotator = ( const setPresenceProvider = (provider: PresenceProvider) => { if (provider) { highlightRenderer.setPainter(createPresencePainter(container, provider, opts.presence)); - provider.on('selectionChange', () => highlightRenderer.refresh()); + provider.on('selectionChange', () => highlightRenderer.redraw()); } } diff --git a/packages/text-annotator/src/TextAnnotatorOptions.ts b/packages/text-annotator/src/TextAnnotatorOptions.ts index 1bcc037e..28c91452 100644 --- a/packages/text-annotator/src/TextAnnotatorOptions.ts +++ b/packages/text-annotator/src/TextAnnotatorOptions.ts @@ -1,12 +1,13 @@ import type { DrawingStyle, FormatAdapter, PointerSelectAction } from '@annotorious/core'; import type { PresencePainterOptions } from './presence'; import type { TextAnnotation } from './model'; +import type { HighlightStyleExpression } from './highlight/HighlightStyle'; export interface TextAnnotatorOptions { adapter?: FormatAdapter | null; - experimentalCSSRenderer?: boolean; + renderer?: 'SPAN' | 'CANVAS' | 'CSS_HIGHLIGHT'; offsetReferenceSelector?: string; @@ -14,6 +15,6 @@ export interface TextAnnotatorOptions { presence?: PresencePainterOptions; - style?: DrawingStyle | ((annotation: TextAnnotation) => DrawingStyle); + style?: HighlightStyleExpression; } diff --git a/packages/text-annotator/src/highlight/Highlight.ts b/packages/text-annotator/src/highlight/Highlight.ts new file mode 100644 index 00000000..52b141eb --- /dev/null +++ b/packages/text-annotator/src/highlight/Highlight.ts @@ -0,0 +1,8 @@ +import type { AnnotationState } from '@annotorious/core'; +import type { AnnotationRects } from '../state'; + +export interface Highlight extends AnnotationRects { + + state: AnnotationState; + +} \ No newline at end of file diff --git a/packages/text-annotator/src/highlight/HighlightPainter.ts b/packages/text-annotator/src/highlight/HighlightPainter.ts index ac42915a..d3728b1d 100644 --- a/packages/text-annotator/src/highlight/HighlightPainter.ts +++ b/packages/text-annotator/src/highlight/HighlightPainter.ts @@ -1,4 +1,5 @@ -import type { AnnotationRects } from '../state'; + +import type { Highlight } from './Highlight'; import type { HighlightStyle } from './HighlightStyle'; import type { ViewportBounds } from './viewport'; @@ -8,11 +9,7 @@ export interface HighlightPainter { destroy(): void; - paint( - annotation: AnnotationRects, - viewportBounds: ViewportBounds, - isSelected?: boolean - ): HighlightStyle; + paint(highlight: Highlight, viewportBounds: ViewportBounds): HighlightStyle; reset(): void; diff --git a/packages/text-annotator/src/highlight/HighlightStyle.ts b/packages/text-annotator/src/highlight/HighlightStyle.ts index 394347f3..ea73cf1e 100644 --- a/packages/text-annotator/src/highlight/HighlightStyle.ts +++ b/packages/text-annotator/src/highlight/HighlightStyle.ts @@ -1,16 +1,6 @@ import type { AnnotationState, Color, DrawingStyle } from '@annotorious/core'; import type { TextAnnotation } from 'src/model'; -export const DEFAULT_STYLE: DrawingStyle = { - fill: 'rgb(0, 128, 255)', - fillOpacity: 0.18 -}; - -export const DEFAULT_SELECTED_STYLE: DrawingStyle = { - fill: 'rgb(0, 128, 255)', - fillOpacity: 0.45 -}; - export interface HighlightStyle extends Pick { underlineStyle?: string; @@ -24,6 +14,17 @@ export interface HighlightStyle extends Pick HighlightStyle) + | ((annotation: TextAnnotation, state: AnnotationState, zIndex?: number) => HighlightStyle) + +export const DEFAULT_STYLE: HighlightStyle = { + fill: 'rgb(0, 128, 255)', + fillOpacity: 0.18 +}; + +export const DEFAULT_SELECTED_STYLE: HighlightStyle = { + fill: 'rgb(0, 128, 255)', + fillOpacity: 0.45 +}; + diff --git a/packages/text-annotator/src/highlight/span/spanRenderer.ts b/packages/text-annotator/src/highlight/baseRenderer.ts similarity index 56% rename from packages/text-annotator/src/highlight/span/spanRenderer.ts rename to packages/text-annotator/src/highlight/baseRenderer.ts index 504f135d..6b82b66e 100644 --- a/packages/text-annotator/src/highlight/span/spanRenderer.ts +++ b/packages/text-annotator/src/highlight/baseRenderer.ts @@ -1,25 +1,57 @@ import type { DrawingStyle, Filter, ViewportState } from '@annotorious/core'; -import type { TextAnnotatorState } from '../../state'; -import type { TextAnnotation } from '../../model'; -import { debounce } from '../../utils'; -import { getViewportBounds, trackViewport } from '../viewport'; -import { createSpans } from './spans'; -import type { HighlightPainter } from '../HighlightPainter'; - -export const createSpanHighlightRenderer = ( +import type { TextAnnotatorState } from '../state'; +import type { TextAnnotation } from '../model'; +import { debounce } from '../utils'; +import { ViewportBounds, getViewportBounds, trackViewport } from './viewport'; +import type { HighlightPainter } from './HighlightPainter'; +import type { Highlight } from './Highlight'; +import type { HighlightStyleExpression } from './HighlightStyle'; + +export interface RendererImplementation { + + destroy(): void; + + redraw( + + highlights:Highlight[], + + bounds: ViewportBounds, + + style?: HighlightStyleExpression, + + painter?: HighlightPainter + + ): void; + +} + +export interface Renderer { + + destroy(): void; + + redraw(): void; + + setStyle(style?: HighlightStyleExpression): void; + + setFilter(filter?: Filter): void; + + setPainter(painter?: HighlightPainter): void; + +} + +export const createBaseRenderer = ( container: HTMLElement, state: TextAnnotatorState, - viewport: ViewportState -) => { + viewport: ViewportState, + renderer: RendererImplementation +): Renderer => { const { store, selection, hover } = state; - let customPainter: HighlightPainter; - - let currentStyle: DrawingStyle | ((annotation: TextAnnotation, selected?: boolean) => DrawingStyle) | undefined; + let currentStyle: HighlightStyleExpression | undefined; let currentFilter: Filter | undefined; - const spans = createSpans(container); + let customPainter: HighlightPainter; const onDraw = trackViewport(viewport); @@ -44,7 +76,10 @@ export const createSpanHighlightRenderer = ( container.addEventListener('pointermove', onPointerMove); - const refresh = () => { + const redraw = () => { + if (customPainter) + customPainter.clear(); + const bounds = getViewportBounds(container); const { minX, minY, maxX, maxY } = bounds; @@ -53,40 +88,45 @@ export const createSpanHighlightRenderer = ( ? store.getIntersecting(minX, minY, maxX, maxY).filter(({ annotation }) => currentFilter(annotation)) : store.getIntersecting(minX, minY, maxX, maxY); - // Get current selection const selectedIds = selection.selected.map(({ id }) => id); - spans.refresh(annotationsInView, bounds, selectedIds, currentStyle); + const highlights: Highlight[] = annotationsInView.map(({ annotation, rects }) => { + const selected = selectedIds.includes(annotation.id); + const hovered = annotation.id === hover.current; + + // TODO minor API changes coming up soon... + return { annotation, rects, state: { selected, hover: hovered, custom: {} }}; + }) + + renderer.redraw(highlights, bounds, currentStyle, customPainter); setTimeout(() => onDraw(annotationsInView.map(({ annotation }) => annotation)), 1); } - const setPainter = (painter: HighlightPainter) => { + const setPainter = (painter: HighlightPainter) => { customPainter = painter; - spans.setPainter(painter); + redraw(); } - // Refresh when style changes - const setDrawingStyle = (style: DrawingStyle | ((a: TextAnnotation, selected?: boolean) => DrawingStyle)) => { + const setStyle = (style?: HighlightStyleExpression) => { currentStyle = style; - refresh(); + redraw(); } - // Refresh when filter changes const setFilter = (filter?: Filter) => { currentFilter = filter; - refresh(); + redraw(); } // Refresh on store change - const onStoreChange = () => refresh(); + const onStoreChange = () => redraw(); store.observe(onStoreChange); // Refresh on selection change - const unsubscribeSelection = selection.subscribe(() => refresh()); + const unsubscribeSelection = selection.subscribe(() => redraw()); // Refresh on scroll - document.addEventListener('scroll', refresh, { capture: true, passive: true }); + document.addEventListener('scroll', redraw, { capture: true, passive: true }); // Refresh on resize const onResize = debounce(() => { @@ -95,7 +135,7 @@ export const createSpanHighlightRenderer = ( if (customPainter) customPainter.reset(); - refresh(); + redraw(); }); window.addEventListener('resize', onResize); @@ -105,7 +145,7 @@ export const createSpanHighlightRenderer = ( // This is an extra precaution. The position of the container // might shift (without resizing) due to layout changes higher-up - // in the DOM. (This happens in Recogito+ for example) + // in the DOM. (This happens in Recogito for example) // const config: MutationObserverInit = { attributes: true, childList: true, subtree: true }; // const mutationObserver = new MutationObserver(refresh); @@ -114,13 +154,13 @@ export const createSpanHighlightRenderer = ( const destroy = () => { container.removeEventListener('pointermove', onPointerMove); - spans.destroy(); + renderer.destroy(); store.unobserve(onStoreChange); unsubscribeSelection(); - document.removeEventListener('scroll', refresh); + document.removeEventListener('scroll', redraw); window.removeEventListener('resize', onResize); resizeObserver.disconnect(); @@ -130,8 +170,8 @@ export const createSpanHighlightRenderer = ( return { destroy, - refresh, - setDrawingStyle, + redraw, + setStyle, setFilter, setPainter } diff --git a/packages/text-annotator/src/highlight/canvas/canvasRenderer.ts b/packages/text-annotator/src/highlight/canvas/canvasRenderer.ts new file mode 100644 index 00000000..5ce62131 --- /dev/null +++ b/packages/text-annotator/src/highlight/canvas/canvasRenderer.ts @@ -0,0 +1,121 @@ +import type { ViewportBounds } from '../viewport'; +import { debounce } from '../../utils'; +import type { HighlightStyle } from '../HighlightStyle'; +import { DEFAULT_SELECTED_STYLE, DEFAULT_STYLE, HighlightStyleExpression } from '../HighlightStyle'; +import type { HighlightPainter } from '../HighlightPainter'; +import { createBaseRenderer, type RendererImplementation } from '../baseRenderer'; +import type { Highlight } from '../Highlight'; +import type { TextAnnotatorState } from 'src/state'; +import type { ViewportState } from '@annotorious/core'; + +const createCanvas = () => { + const canvas = document.createElement('canvas'); + canvas.width = window.innerWidth; + canvas.height = window.innerHeight; + canvas.className = 'r6o-highlight-layer bg'; + return canvas; +} + +const resetCanvas = (canvas: HTMLCanvasElement, highres?: boolean) => { + canvas.width = highres ? 2 * window.innerWidth : window.innerWidth; + canvas.height = highres ? 2 * window.innerHeight : window.innerHeight; + + if (highres) { + // Note that resizing the canvas resets the context + const context = canvas.getContext('2d'); + context.scale(2, 2); + context.translate(0.5, 0.5); + } +} + +const createRenderer = (container: HTMLElement): RendererImplementation => { + + container.classList.add('r6o-annotatable'); + + const canvas = createCanvas(); + const ctx = canvas.getContext('2d'); + + container.insertBefore(canvas, container.firstChild); + + const redraw = ( + highlights: Highlight[], + viewportBounds: ViewportBounds, + currentStyle?: HighlightStyleExpression, + painter?: HighlightPainter + ) => requestAnimationFrame(() => { + + const { width, height } = canvas; + + // New render loop - clear canvases + ctx.clearRect(-0.5, -0.5, width + 1, height + 1); + + if (painter) + painter.clear(); + + const { top, left } = viewportBounds; + + highlights.forEach(h => { + const base: HighlightStyle = currentStyle + ? typeof currentStyle === 'function' + ? currentStyle(h.annotation, h.state) + : currentStyle + : h.state?.selected + ? DEFAULT_SELECTED_STYLE + : DEFAULT_STYLE; + + // Trigger the custom painter (if any) as a side-effect + const style = painter ? painter.paint(h, viewportBounds) || base : base; + + // Offset annotation rects by current scroll position + const offsetRects = h.rects.map(({ x, y, width, height }) => ({ + x: x + left, + y: y + top, + width, + height + })); + + ctx.fillStyle = style.fill; + ctx.globalAlpha = style.fillOpacity || 1; + + offsetRects.forEach(({ x, y, width, height }) => ctx.fillRect(x, y - 2.5, width, height + 5)); + + if (style.underlineColor) { + ctx.globalAlpha = 1; + ctx.strokeStyle = style.underlineColor; + + offsetRects.forEach(({ x, y, width, height }) => { + ctx.beginPath(); + ctx.moveTo(x, y + height + 4); + ctx.lineTo(x + width, y + height + 4); + + // Draw the Path + ctx.stroke(); + }); + } + }); + }); + + const onResize = debounce(() => { + resetCanvas(canvas); + }); + + window.addEventListener('resize', onResize); + + const destroy = () => { + container.removeChild(canvas); + + window.removeEventListener('resize', onResize); + } + + return { + destroy, + redraw + } + +} + +export const createCanvasRenderer = ( + container: HTMLElement, + state: TextAnnotatorState, + viewport: ViewportState +) => createBaseRenderer(container, state, viewport, createRenderer(container)); \ No newline at end of file diff --git a/packages/text-annotator/src/highlight/canvas/highlightRenderer.ts b/packages/text-annotator/src/highlight/canvas/highlightRenderer.ts deleted file mode 100644 index b40792ae..00000000 --- a/packages/text-annotator/src/highlight/canvas/highlightRenderer.ts +++ /dev/null @@ -1,214 +0,0 @@ -import type { DrawingStyle, Filter, ViewportState } from '@annotorious/core'; -import type { TextAnnotation } from '../../model'; -import type { TextAnnotatorState } from '../../state'; -import { getViewportBounds, trackViewport } from '../viewport'; -import { debounce } from '../../utils'; -import { DEFAULT_SELECTED_STYLE, DEFAULT_STYLE, type HighlightStyle } from '../HighlightStyle'; -import type { HighlightPainter } from '../HighlightPainter'; - -const createCanvas = () => { - const canvas = document.createElement('canvas'); - canvas.width = window.innerWidth; - canvas.height = window.innerHeight; - canvas.className = 'r6o-highlight-layer bg'; - return canvas; -} - -const resetCanvas = (canvas: HTMLCanvasElement, highres?: boolean) => { - canvas.width = highres ? 2 * window.innerWidth : window.innerWidth; - canvas.height = highres ? 2 * window.innerHeight : window.innerHeight; - - if (highres) { - // Note that resizing the canvas resets the context - const context = canvas.getContext('2d'); - context.scale(2, 2); - context.translate(0.5, 0.5); - } -} - -export const createCanvasHighlightRenderer = ( - container: HTMLElement, - state: TextAnnotatorState, - viewport: ViewportState -) => { - const { store, selection, hover } = state; - - let currentStyle: DrawingStyle | ((annotation: TextAnnotation, selected?: boolean) => DrawingStyle) | undefined; - - let currentFilter: Filter | undefined; - - let customPainter: HighlightPainter; - - const onDraw = trackViewport(viewport); - - container.classList.add('r6o-annotatable'); - - const canvas = createCanvas(); - const ctx = canvas.getContext('2d'); - - container.insertBefore(canvas, container.firstChild); - - const onPointerMove = (event: PointerEvent) => { - const {x, y} = container.getBoundingClientRect(); - - const hit = store.getAt(event.clientX - x, event.clientY - y); - const isVisibleHit = hit && (!currentFilter || currentFilter(hit)); - - if (isVisibleHit) { - if (hover.current !== hit.id) { - container.classList.add('hovered'); - hover.set(hit.id); - } - } else { - if (hover.current) { - container.classList.remove('hovered'); - hover.set(null); - } - } - } - - container.addEventListener('pointermove', onPointerMove); - - const refresh = () => requestAnimationFrame(() => { - const bounds = getViewportBounds(container); - - const { top, left, minX, minY, maxX, maxY } = bounds; - - const annotationsInView = currentFilter - ? store.getIntersectingRects(minX, minY, maxX, maxY).filter(({ annotation }) => currentFilter(annotation)) - : store.getIntersectingRects(minX, minY, maxX, maxY); - - const { width, height } = canvas; - - // Get current selection - const selectedIds = new Set(selection.selected.map(({ id }) => id)); - - // New render loop - clear canvases - ctx.clearRect(-0.5, -0.5, width + 1, height + 1); - - if (customPainter) - customPainter.clear(); - - annotationsInView.forEach(h => { - const isSelected = selectedIds.has(h.annotation.id); - - const base: HighlightStyle = currentStyle - ? typeof currentStyle === 'function' - ? currentStyle(h.annotation, isSelected) - : currentStyle - : isSelected - ? DEFAULT_SELECTED_STYLE - : DEFAULT_STYLE; - - // Trigger the custom painter (if any) as a side-effect - const style = customPainter ? customPainter.paint(h, bounds, isSelected) || base : base; - - // Offset annotation rects by current scroll position - const offsetRects = h.rects.map(({ x, y, width, height }) => ({ - x: x + left, - y: y + top, - width, - height - })); - - ctx.fillStyle = style.fill; - ctx.globalAlpha = style.fillOpacity || 1; - - offsetRects.forEach(({ x, y, width, height }) => ctx.fillRect(x, y - 2.5, width, height + 5)); - - if (style.underlineColor) { - ctx.globalAlpha = 1; - ctx.strokeStyle = style.underlineColor; - - offsetRects.forEach(({ x, y, width, height }) => { - ctx.beginPath(); - ctx.moveTo(x, y + height + 4); - ctx.lineTo(x + width, y + height + 4); - - // Draw the Path - ctx.stroke(); - }); - } - - }); - - setTimeout(() => onDraw(annotationsInView.map(({ annotation }) => annotation)), 1); - }); - - const setDrawingStyle = (style: DrawingStyle | ((a: TextAnnotation, selected?: boolean) => DrawingStyle)) => { - currentStyle = style; - refresh(); - } - - const setFilter = (filter?: Filter) => { - currentFilter = filter; - refresh(); - } - - // Redraw on store change - const onStoreChange = () => refresh(); - store.observe(onStoreChange); - - // Redraw on selection change - const unsubscribeSelection = selection.subscribe(() => refresh()); - - // Redraw on scroll - const onScroll = () => refresh(); - document.addEventListener('scroll', onScroll, { capture: true, passive: true }); - - // Redraw on resize. Note that in cases where the element resized - // due to a window resize, onResize will be triggered twice. This - // is probably not a huge issue. But definitely an area for - // future optimization. In terms of how to do this: there's - // probably no ideal solution, but one straightforward way - // would be to just set a flag in - const onResize = debounce(() => { - resetCanvas(canvas); - - store.recalculatePositions(); - - if (customPainter) - customPainter.reset(); - - refresh(); - }); - - window.addEventListener('resize', onResize); - - const resizeObserver = new ResizeObserver(onResize); - resizeObserver.observe(container); - - const config: MutationObserverInit = { attributes: true, childList: true, subtree: true }; - - // This is an extra precaution. The position of the container - // might shift (without resizing) due to layout changes higher-up - // in the DOM. (This happens in Recogito+ for example) - const mutationObserver = new MutationObserver(refresh); - mutationObserver.observe(document.body, config); - - const destroy = () => { - container.removeEventListener('pointermove', onPointerMove); - - container.removeChild(canvas); - - store.unobserve(onStoreChange); - - unsubscribeSelection(); - - document.removeEventListener('scroll', onScroll); - - window.removeEventListener('resize', onResize); - resizeObserver.disconnect(); - - mutationObserver.disconnect(); - } - - return { - destroy, - refresh, - setDrawingStyle, - setFilter, - setPainter: (painter: HighlightPainter) => customPainter = painter - } - -} diff --git a/packages/text-annotator/src/highlight/canvas/index.ts b/packages/text-annotator/src/highlight/canvas/index.ts index ef7c33cf..802b801a 100644 --- a/packages/text-annotator/src/highlight/canvas/index.ts +++ b/packages/text-annotator/src/highlight/canvas/index.ts @@ -1 +1 @@ -export * from './highlightRenderer'; \ No newline at end of file +export * from './canvasRenderer'; \ No newline at end of file diff --git a/packages/text-annotator/src/highlight/css/highlightRenderer.ts b/packages/text-annotator/src/highlight/css/highlightRenderer.ts deleted file mode 100644 index 3d163a68..00000000 --- a/packages/text-annotator/src/highlight/css/highlightRenderer.ts +++ /dev/null @@ -1,139 +0,0 @@ -import type { DrawingStyle, Filter, ViewportState } from '@annotorious/core'; -import type { TextAnnotatorState } from '../../state'; -import type { TextAnnotation } from '../../model'; -import { debounce } from '../../utils'; -import { getViewportBounds, trackViewport } from '../viewport'; -import type { HighlightPainter } from '../HighlightPainter'; -import { createHighlights } from './highlights'; - -export const createCSSHighlightRenderer = ( - container: HTMLElement, - state: TextAnnotatorState, - viewport: ViewportState -) => { - const { store, selection, hover } = state; - - let customPainter: HighlightPainter; - - let currentStyle: DrawingStyle | ((annotation: TextAnnotation, selected?: boolean) => DrawingStyle) | undefined; - - let currentFilter: Filter | undefined; - - const highlights = createHighlights(); - - const onDraw = trackViewport(viewport); - - const onPointerMove = (event: PointerEvent) => { - const {x, y} = container.getBoundingClientRect(); - - const hit = store.getAt(event.clientX - x, event.clientY - y); - const isVisibleHit = hit && (!currentFilter || currentFilter(hit)); - - if (isVisibleHit) { - if (hover.current !== hit.id) { - container.classList.add('hovered'); - hover.set(hit.id); - } - } else { - if (hover.current) { - container.classList.remove('hovered'); - hover.set(null); - } - } - } - - container.addEventListener('pointermove', onPointerMove); - - const refresh = () => { - const bounds = getViewportBounds(container); - - const { minX, minY, maxX, maxY } = bounds; - - const annotationsInView = currentFilter - ? store.getIntersectingRects(minX, minY, maxX, maxY).filter(({ annotation }) => currentFilter(annotation)) - : store.getIntersectingRects(minX, minY, maxX, maxY); - - // Get current selection - const selectedIds = selection.selected.map(({ id }) => id); - - highlights.refresh(annotationsInView, bounds, selectedIds, currentStyle); - - setTimeout(() => onDraw(annotationsInView.map(({ annotation }) => annotation)), 1); - } - - const setPainter = (painter: HighlightPainter) => { - customPainter = painter; - highlights.setPainter(painter); - } - - // Refresh when style changes - const setDrawingStyle = (style: DrawingStyle | ((a: TextAnnotation, selected?: boolean) => DrawingStyle)) => { - currentStyle = style; - refresh(); - } - - // Refresh when filter changes - const setFilter = (filter?: Filter) => { - currentFilter = filter; - refresh(); - } - - // Refresh on store change - const onStoreChange = () => refresh(); - store.observe(onStoreChange); - - // Refresh on selection change - const unsubscribeSelection = selection.subscribe(() => refresh()); - - // Refresh on scroll - document.addEventListener('scroll', refresh, { capture: true, passive: true }); - - // Refresh on resize - const onResize = debounce(() => { - store.recalculatePositions(); - - if (customPainter) - customPainter.reset(); - - refresh(); - }); - - window.addEventListener('resize', onResize); - - const resizeObserver = new ResizeObserver(onResize); - resizeObserver.observe(container); - - // This is an extra precaution. The position of the container - // might shift (without resizing) due to layout changes higher-up - // in the DOM. (This happens in Recogito+ for example) - const config: MutationObserverInit = { attributes: true, childList: true, subtree: true }; - - const mutationObserver = new MutationObserver(refresh); - mutationObserver.observe(document.body, config); - - const destroy = () => { - container.removeEventListener('pointermove', onPointerMove); - - highlights.destroy(); - - store.unobserve(onStoreChange); - - unsubscribeSelection(); - - document.removeEventListener('scroll', refresh); - - window.removeEventListener('resize', onResize); - resizeObserver.disconnect(); - - mutationObserver.disconnect(); - } - - return { - destroy, - refresh, - setDrawingStyle, - setFilter, - setPainter - } - -} \ No newline at end of file diff --git a/packages/text-annotator/src/highlight/css/index.ts b/packages/text-annotator/src/highlight/css/index.ts deleted file mode 100644 index f9a054f1..00000000 --- a/packages/text-annotator/src/highlight/css/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './highlightRenderer' diff --git a/packages/text-annotator/src/highlight/css/highlights.ts b/packages/text-annotator/src/highlight/highlights/highlightsRenderer.ts similarity index 71% rename from packages/text-annotator/src/highlight/css/highlights.ts rename to packages/text-annotator/src/highlight/highlights/highlightsRenderer.ts index bea3233c..b98c8dd1 100644 --- a/packages/text-annotator/src/highlight/css/highlights.ts +++ b/packages/text-annotator/src/highlight/highlights/highlightsRenderer.ts @@ -1,10 +1,11 @@ -import type { DrawingStyle } from '@annotorious/core'; +import type { ViewportState } from '@annotorious/core'; import { colord } from 'colord'; -import type { TextAnnotation } from '../../model'; import type { HighlightPainter } from '../HighlightPainter'; -import type { AnnotationRects } from 'src/state'; +import type { TextAnnotatorState } from 'src/state'; import type { ViewportBounds } from '../viewport'; -import { DEFAULT_SELECTED_STYLE, DEFAULT_STYLE, HighlightStyle } from '../HighlightStyle'; +import { DEFAULT_SELECTED_STYLE, DEFAULT_STYLE, HighlightStyle, HighlightStyleExpression } from '../HighlightStyle'; +import { RendererImplementation, createBaseRenderer } from '../baseRenderer'; +import type { Highlight } from '../Highlight'; const toCSS = (s?: HighlightStyle) => { const backgroundColor = colord(s?.fill || DEFAULT_STYLE.fill) @@ -22,48 +23,41 @@ const toCSS = (s?: HighlightStyle) => { return rules.join(';'); } -export const createHighlights = () => { +export const createRenderer = (): RendererImplementation => { const elem = document.createElement('style'); document.getElementsByTagName('head')[0].appendChild(elem); - let customPainter: HighlightPainter; - let currentRendered = new Set(); - const refresh = ( - highlights: AnnotationRects[], + const redraw = ( + highlights: Highlight[], viewportBounds: ViewportBounds, - selected: string[], - currentStyle: DrawingStyle | ((annotation: TextAnnotation, selected: boolean) => DrawingStyle) + currentStyle?: HighlightStyleExpression, + painter?: HighlightPainter ) => { - if (customPainter) - customPainter.clear(); + if (painter) + painter.clear(); // Next set of rendered annotation IDs and selections const nextRendered = new Set(highlights.map(h => h.annotation.id)); - const nextSelected = new Set(selected); // Annotations currently in this stylesheet that no longer need rendering const toRemove = Array.from(currentRendered).filter(id => !nextRendered.has(id)); // For simplicity, re-generate the whole stylesheet const updatedCSS = highlights.map(h => { - const isSelected = nextSelected.has(h.annotation.id); - const base = currentStyle ? typeof currentStyle === 'function' - ? currentStyle(h.annotation, isSelected) + ? currentStyle(h.annotation, h.state) : currentStyle - : isSelected ? DEFAULT_SELECTED_STYLE : DEFAULT_STYLE; + : h.state?.selected ? DEFAULT_SELECTED_STYLE : DEFAULT_STYLE; // Trigger the custom painter (if any) as a side-effect - const style = customPainter ? customPainter.paint(h, viewportBounds, isSelected) || base : base; + const style = painter ? painter.paint(h, viewportBounds) || base : base; return `::highlight(_${h.annotation.id}) { ${toCSS(style)} }`; }); - console.log(updatedCSS.join('\n')); - elem.innerHTML = updatedCSS.join('\n'); // After we have the styles, we need to update the Highlights. @@ -89,8 +83,6 @@ export const createHighlights = () => { currentRendered = nextRendered; } - const setPainter = (painter: HighlightPainter) => customPainter = painter; - const destroy = () => { // Clear all highlights from the Highlight Registry // @ts-ignore @@ -102,8 +94,13 @@ export const createHighlights = () => { return { destroy, - refresh, - setPainter + redraw } -} \ No newline at end of file +} + +export const createHighlightsRenderer = ( + container: HTMLElement, + state: TextAnnotatorState, + viewport: ViewportState +) => createBaseRenderer(container, state, viewport, createRenderer()); \ No newline at end of file diff --git a/packages/text-annotator/src/highlight/highlights/index.ts b/packages/text-annotator/src/highlight/highlights/index.ts new file mode 100644 index 00000000..535943b5 --- /dev/null +++ b/packages/text-annotator/src/highlight/highlights/index.ts @@ -0,0 +1 @@ +export * from './highlightsRenderer' diff --git a/packages/text-annotator/src/highlight/index.ts b/packages/text-annotator/src/highlight/index.ts index 6ce061c8..0c2eda06 100644 --- a/packages/text-annotator/src/highlight/index.ts +++ b/packages/text-annotator/src/highlight/index.ts @@ -1,3 +1,3 @@ export * from './canvas'; -export * from './css'; +export * from './highlights'; export * from './span'; \ No newline at end of file diff --git a/packages/text-annotator/src/highlight/span/index.ts b/packages/text-annotator/src/highlight/span/index.ts index a3985c26..9d1fe54f 100644 --- a/packages/text-annotator/src/highlight/span/index.ts +++ b/packages/text-annotator/src/highlight/span/index.ts @@ -1 +1 @@ -export * from './spanRenderer'; \ No newline at end of file +export * from './spansRenderer'; \ No newline at end of file diff --git a/packages/text-annotator/src/highlight/span/spans.css b/packages/text-annotator/src/highlight/span/spansRenderer.css similarity index 94% rename from packages/text-annotator/src/highlight/span/spans.css rename to packages/text-annotator/src/highlight/span/spansRenderer.css index 1a7cdf00..988803ca 100644 --- a/packages/text-annotator/src/highlight/span/spans.css +++ b/packages/text-annotator/src/highlight/span/spansRenderer.css @@ -7,11 +7,9 @@ width: 100%; } -.r6o-annotation, .r6o-annotatable .r6o-span-highlight-layer .r6o-annotation { position: absolute; background-color: rgba(255, 255, 0, 0.25); border-bottom: 2px solid rgba(0, 0, 0, 0.8); display: block; - } diff --git a/packages/text-annotator/src/highlight/span/spans.ts b/packages/text-annotator/src/highlight/span/spansRenderer.ts similarity index 78% rename from packages/text-annotator/src/highlight/span/spans.ts rename to packages/text-annotator/src/highlight/span/spansRenderer.ts index b7d61041..224f038a 100644 --- a/packages/text-annotator/src/highlight/span/spans.ts +++ b/packages/text-annotator/src/highlight/span/spansRenderer.ts @@ -1,10 +1,12 @@ -import type { DrawingStyle } from '@annotorious/core'; -import type { TextAnnotation } from '../../model'; +import type { ViewportState } from '@annotorious/core'; +import type { Rect, TextAnnotatorState } from '../../state'; import type { HighlightPainter } from '../HighlightPainter'; -import type { AnnotationRects, Rect } from 'src/state'; import type { ViewportBounds } from '../viewport'; +import { createBaseRenderer, type RendererImplementation } from '../baseRenderer'; +import type { Highlight } from '../Highlight'; +import type { HighlightStyleExpression } from '../HighlightStyle'; -import './spans.css'; +import './spansRenderer.css'; const computeZIndex = (rect: Rect, all: Rect[]): number => { const intersects = (a: Rect, b: Rect): boolean => ( @@ -19,7 +21,7 @@ const computeZIndex = (rect: Rect, all: Rect[]): number => { )).length; } -export const createSpans = (container: HTMLElement) => { +const createRenderer = (container: HTMLElement): RendererImplementation => { container.classList.add('r6o-annotatable'); @@ -33,11 +35,11 @@ export const createSpans = (container: HTMLElement) => { // Currently rendered SPANs for each annotation ID let currentRendered = new Map(); - const refresh = ( - highlights: AnnotationRects[], + const redraw = ( + highlights: Highlight[], viewportBounds: ViewportBounds, - selected: string[], - currentStyle: DrawingStyle | ((annotation: TextAnnotation, selected: boolean) => DrawingStyle) + style?: HighlightStyleExpression, + painter?: HighlightPainter ) => { if (customPainter) customPainter.clear(); @@ -91,16 +93,19 @@ export const createSpans = (container: HTMLElement) => { rendered.forEach(({ id, spans }) => currentRendered.set(id, spans)); } - const setPainter = (painter: HighlightPainter) => customPainter = painter; - const destroy = () => { highlightLayer.remove(); } return { destroy, - refresh, - setPainter + redraw } -} \ No newline at end of file +} + +export const createSpansRenderer = ( + container: HTMLElement, + state: TextAnnotatorState, + viewport: ViewportState +) => createBaseRenderer(container, state, viewport, createRenderer(container)); \ No newline at end of file From d0e9e95c263c4b53374022c8e5f40bd7ac60923c Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Wed, 27 Mar 2024 13:30:30 +0100 Subject: [PATCH 14/31] Cleanup --- packages/text-annotator/src/TextAnnotator.ts | 28 ++++++++++++------- .../src/TextAnnotatorOptions.ts | 4 ++- .../src/highlight/span/spansRenderer.ts | 2 -- packages/text-annotator/test/index.html | 7 ++--- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/packages/text-annotator/src/TextAnnotator.ts b/packages/text-annotator/src/TextAnnotator.ts index 68353a66..8370ed4f 100644 --- a/packages/text-annotator/src/TextAnnotator.ts +++ b/packages/text-annotator/src/TextAnnotator.ts @@ -5,11 +5,13 @@ import { createPresencePainter } from './presence'; import { scrollIntoView } from './api'; import { TextAnnotationStore, TextAnnotatorState, createTextAnnotatorState } from './state'; import type { TextAnnotation } from './model'; -import type { TextAnnotatorOptions } from './TextAnnotatorOptions'; +import type { RendererType, TextAnnotatorOptions } from './TextAnnotatorOptions'; import { SelectionHandler } from './SelectionHandler'; import './TextAnnotator.css'; +const USE_DEFAULT_RENDERER: RendererType = 'SPANS'; + export interface TextAnnotator extends Annotator { element: HTMLElement; @@ -42,17 +44,23 @@ export const createTextAnnotator = ( let currentUser: User = createAnonymousGuest(); - // Switch on CSS Custom Highlight rendering, if requested in the init - // opts and API is available in this browser - // @ts-ignore - const useExperimentalCSSRenderer = opts.experimentalCSSRenderer && Boolean(CSS.highlights); + // Use selected renderer, or fall back to default. If CSS_HIGHLIGHT is + // requested, check if CSS Custom Highlights are supported, and fall + // back to default renderer if not. + const useRenderer: RendererType = + opts.renderer === 'CSS_HIGHLIGHTS' + ? Boolean(CSS.highlights) ? 'CSS_HIGHLIGHTS' : USE_DEFAULT_RENDERER + : opts.renderer || USE_DEFAULT_RENDERER; + + const highlightRenderer = + useRenderer === 'SPANS' ? createSpansRenderer(container, state, viewport) : + useRenderer === 'CSS_HIGHLIGHTS' ? createHighlightsRenderer(container, state, viewport) : + useRenderer === 'CANVAS' ? createCanvasRenderer(container, state, viewport) : undefined; - if (useExperimentalCSSRenderer) - console.log('Using experimental CSS Custom Highlight API renderer'); + if (!highlightRenderer) + throw `Unknown renderer implementation: ${useRenderer}`; - const highlightRenderer = /* */createSpansRenderer(container, state, viewport) - // createCSSHighlightRenderer(container, state, viewport) - //: createCanvasHighlightRenderer(container, state, viewport); + console.log(`Using ${useRenderer} renderer`); if (opts.style) highlightRenderer.setStyle(opts.style); diff --git a/packages/text-annotator/src/TextAnnotatorOptions.ts b/packages/text-annotator/src/TextAnnotatorOptions.ts index 28c91452..5a354896 100644 --- a/packages/text-annotator/src/TextAnnotatorOptions.ts +++ b/packages/text-annotator/src/TextAnnotatorOptions.ts @@ -7,7 +7,7 @@ export interface TextAnnotatorOptions { adapter?: FormatAdapter | null; - renderer?: 'SPAN' | 'CANVAS' | 'CSS_HIGHLIGHT'; + renderer?: RendererType; offsetReferenceSelector?: string; @@ -18,3 +18,5 @@ export interface TextAnnotatorOptions { style?: HighlightStyleExpression; } + +export type RendererType = 'SPANS' | 'CANVAS' | 'CSS_HIGHLIGHTS'; diff --git a/packages/text-annotator/src/highlight/span/spansRenderer.ts b/packages/text-annotator/src/highlight/span/spansRenderer.ts index 224f038a..a81d83a5 100644 --- a/packages/text-annotator/src/highlight/span/spansRenderer.ts +++ b/packages/text-annotator/src/highlight/span/spansRenderer.ts @@ -53,7 +53,6 @@ const createRenderer = (container: HTMLElement): RendererImplementation => { // Remove annotations that are no longer visible const toRemove = currentRenderedIds.filter(id => !nextRendered.includes(id)); toRemove.forEach(id => { - console.log('removing', id); (currentRendered.get(id) || []).forEach(span => span.remove()); currentRendered.delete(id); }); @@ -65,7 +64,6 @@ const createRenderer = (container: HTMLElement): RendererImplementation => { const rendered = highlights .filter(({ annotation }) => !currentRenderedIds.includes(annotation.id)) .map(({ rects, annotation }) => { - // Create one SPAN per rect const spans = rects.map(rect => { const span = document.createElement('span'); span.className = 'r6o-annotation'; diff --git a/packages/text-annotator/test/index.html b/packages/text-annotator/test/index.html index 2cd953a0..12b17010 100644 --- a/packages/text-annotator/test/index.html +++ b/packages/text-annotator/test/index.html @@ -284,8 +284,7 @@
var contentContainer = document.getElementById('content'); var r = createTextAnnotator(contentContainer, { - adapter: W3CTextFormat('https://www.gutenberg.org', contentContainer), - experimentalCSSRenderer: true + adapter: W3CTextFormat('https://www.gutenberg.org', contentContainer) }); var annotations; @@ -310,10 +309,9 @@
}); r.on('viewportIntersect', (annotations) => { - // console.log('viewport', annotations); + console.log('viewport', annotations); }); - /* var filterActive = false; var toggleButton = document.getElementById('filter'); @@ -373,7 +371,6 @@
}) } }); - */ } From db334c50b79051fc6a638aa0d18b3090c012957e Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Wed, 27 Mar 2024 14:00:29 +0100 Subject: [PATCH 15/31] SpansRenderer now implements full styling --- .../src/highlight/HighlightPainter.ts | 23 +- .../src/highlight/baseRenderer.ts | 3 +- .../src/highlight/span/spansRenderer.css | 4 +- .../src/highlight/span/spansRenderer.ts | 39 ++- .../test/examples/underlines.html | 297 ------------------ packages/text-annotator/test/index.html | 12 +- 6 files changed, 63 insertions(+), 315 deletions(-) delete mode 100644 packages/text-annotator/test/examples/underlines.html diff --git a/packages/text-annotator/src/highlight/HighlightPainter.ts b/packages/text-annotator/src/highlight/HighlightPainter.ts index d3728b1d..297ecf83 100644 --- a/packages/text-annotator/src/highlight/HighlightPainter.ts +++ b/packages/text-annotator/src/highlight/HighlightPainter.ts @@ -1,6 +1,7 @@ import type { Highlight } from './Highlight'; -import type { HighlightStyle } from './HighlightStyle'; +import { DEFAULT_SELECTED_STYLE, DEFAULT_STYLE } from './HighlightStyle'; +import type { HighlightStyle, HighlightStyleExpression } from './HighlightStyle'; import type { ViewportBounds } from './viewport'; export interface HighlightPainter { @@ -13,4 +14,24 @@ export interface HighlightPainter { reset(): void; +} + +/** Helper **/ +export const paint = ( + highlight: Highlight, + viewportBounds: ViewportBounds, + style?: HighlightStyleExpression, + painter?: HighlightPainter, + zIndex?: number +) => { + const base: HighlightStyle = style + ? typeof style === 'function' + ? style(highlight.annotation, highlight.state, zIndex) + : style + : highlight.state?.selected + ? DEFAULT_SELECTED_STYLE + : DEFAULT_STYLE; + + // Trigger the custom painter (if any) as a side-effect + return painter ? painter.paint(highlight, viewportBounds) || base : base; } \ No newline at end of file diff --git a/packages/text-annotator/src/highlight/baseRenderer.ts b/packages/text-annotator/src/highlight/baseRenderer.ts index 6b82b66e..36036b35 100644 --- a/packages/text-annotator/src/highlight/baseRenderer.ts +++ b/packages/text-annotator/src/highlight/baseRenderer.ts @@ -1,6 +1,5 @@ -import type { DrawingStyle, Filter, ViewportState } from '@annotorious/core'; +import type { Filter, ViewportState } from '@annotorious/core'; import type { TextAnnotatorState } from '../state'; -import type { TextAnnotation } from '../model'; import { debounce } from '../utils'; import { ViewportBounds, getViewportBounds, trackViewport } from './viewport'; import type { HighlightPainter } from './HighlightPainter'; diff --git a/packages/text-annotator/src/highlight/span/spansRenderer.css b/packages/text-annotator/src/highlight/span/spansRenderer.css index 988803ca..7c2c1b26 100644 --- a/packages/text-annotator/src/highlight/span/spansRenderer.css +++ b/packages/text-annotator/src/highlight/span/spansRenderer.css @@ -8,8 +8,8 @@ } .r6o-annotatable .r6o-span-highlight-layer .r6o-annotation { + border-style: solid; + border-width: 0; position: absolute; - background-color: rgba(255, 255, 0, 0.25); - border-bottom: 2px solid rgba(0, 0, 0, 0.8); display: block; } diff --git a/packages/text-annotator/src/highlight/span/spansRenderer.ts b/packages/text-annotator/src/highlight/span/spansRenderer.ts index a81d83a5..bb88b267 100644 --- a/packages/text-annotator/src/highlight/span/spansRenderer.ts +++ b/packages/text-annotator/src/highlight/span/spansRenderer.ts @@ -1,10 +1,11 @@ import type { ViewportState } from '@annotorious/core'; +import { colord } from 'colord'; import type { Rect, TextAnnotatorState } from '../../state'; -import type { HighlightPainter } from '../HighlightPainter'; +import { paint, type HighlightPainter } from '../HighlightPainter'; import type { ViewportBounds } from '../viewport'; import { createBaseRenderer, type RendererImplementation } from '../baseRenderer'; import type { Highlight } from '../Highlight'; -import type { HighlightStyleExpression } from '../HighlightStyle'; +import { DEFAULT_STYLE, type HighlightStyleExpression } from '../HighlightStyle'; import './spansRenderer.css'; @@ -38,7 +39,7 @@ const createRenderer = (container: HTMLElement): RendererImplementation => { const redraw = ( highlights: Highlight[], viewportBounds: ViewportBounds, - style?: HighlightStyleExpression, + currentStyle?: HighlightStyleExpression, painter?: HighlightPainter ) => { if (customPainter) @@ -63,11 +64,11 @@ const createRenderer = (container: HTMLElement): RendererImplementation => { // Add annotations that are visible but not yet rendered const rendered = highlights .filter(({ annotation }) => !currentRenderedIds.includes(annotation.id)) - .map(({ rects, annotation }) => { - const spans = rects.map(rect => { + .map(highlight => { + const spans = highlight.rects.map(rect => { const span = document.createElement('span'); span.className = 'r6o-annotation'; - span.dataset.annotation = annotation.id; + span.dataset.annotation = highlight.annotation.id; span.style.left = `${rect.x}px`; span.style.top = `${rect.y}px`; @@ -75,17 +76,33 @@ const createRenderer = (container: HTMLElement): RendererImplementation => { span.style.height = `${rect.height}px`; const zIndex = computeZIndex(rect, allRects); - - span.style.paddingBottom = `${zIndex * 3.5}px`; - - // TODO style by annotation! + + const style = paint(highlight, viewportBounds, currentStyle, painter, zIndex); + + const backgroundColor = colord(style?.fill || DEFAULT_STYLE.fill) + .alpha(style?.fillOpacity === undefined ? DEFAULT_STYLE.fillOpacity : style.fillOpacity) + .toHex(); + + span.style.backgroundColor = backgroundColor; + + if (style.underlineStyle) + span.style.borderStyle = style.underlineStyle; + + if (style.underlineColor) + span.style.borderColor = style.underlineColor; + + if (style.underlineThickness) + span.style.borderBottomWidth = `${style.underlineThickness}px`; + + if (style.underlineOffset) + span.style.paddingBottom = `${style.underlineOffset}px`; highlightLayer.appendChild(span); return span; }); - return { id: annotation.id, spans }; + return { id: highlight.annotation.id, spans }; }); rendered.forEach(({ id, spans }) => currentRendered.set(id, spans)); diff --git a/packages/text-annotator/test/examples/underlines.html b/packages/text-annotator/test/examples/underlines.html deleted file mode 100644 index 63fc848f..00000000 --- a/packages/text-annotator/test/examples/underlines.html +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - Text Annotator | Underlines Style Example - - - - -
-

Homer: The Odyssey

- -

- Tell me, O muse, of that ingenious hero who travelled far and wide after he had sacked the famous town of Troy. - Many cities did he visit, and many were the nations with whose manners and customs he was acquainted; moreover - he suffered much by sea while trying to save his own life and bring his men safely home; but do what he might he - could not save his men, for they perished through their own sheer folly in eating the cattle of the Sun-god - Hyperion; so the god prevented them from ever reaching home. Tell me, too, about all these things, O daughter of - Jove, from whatsoever source you may know them. -

- -
- Parent not annotabtale! - And its sub-element -
- -

- So now all who escaped death in battle or by shipwreck had got safely home except Ulysses, and he, though he was - longing to return to his wife and country, was detained by the goddess Calypso, who had got him into a large - cave and wanted to marry him. But as years went by, there came a time when the gods settled that he should go - back to Ithaca; even then, however, when he was among his own people, his troubles were not yet over; - nevertheless all the gods had now begun to pity him except Neptune, who still persecuted him without ceasing and - would not let him get home. -

- -
- Parent annotatable! - But its sub-element is not! -
- -

- Now Neptune had gone off to the Ethiopians, who are at the world's end, and lie in two halves, the one looking - West and the other East. He had gone there to accept a hecatomb of sheep and oxen, and was enjoying himself at - his festival; but the other gods met in the house of Olympian Jove, and the sire of gods and men spoke first. At - that moment he was thinking of Aegisthus, who had been killed by Agamemnon's son Orestes; so he said to the - other gods: -

- -

- "See now, how men lay blame upon us gods for what is after all nothing but their own folly. Look at Aegisthus; - he must needs make love to Agamemnon's wife unrighteously and then kill Agamemnon, though he knew it would be - the death of him; for I sent Mercury to warn him not to do either of these things, inasmuch as Orestes would be - sure to take his revenge when he grew up and wanted to return home. Mercury told him this in all good will but - he would not listen, and now he has paid for everything in full." -

- -

- Then Minerva said, "Father, son of Saturn, King of kings, it served Aegisthus right, and so it would any one - else who does as he did; but Aegisthus is neither here nor there; it is for Ulysses that my heart bleeds, when I - think of his sufferings in that lonely sea-girt island, far away, poor man, from all his friends. It is an - island covered with forest, in the very middle of the sea, and a goddess lives there, daughter of the magician - Atlas, who looks after the bottom of the ocean, and carries the great columns that keep heaven and earth - asunder. This daughter of Atlas has got hold of poor unhappy Ulysses, and keeps trying by every kind of - blandishment to make him forget his home, so that he is tired of life, and thinks of nothing but how he may once - more see the smoke of his own chimneys. You, sir, take no heed of this, and yet when Ulysses was before Troy did - he not propitiate you with many a burnt sacrifice? Why then should you keep on being so angry with him?" -

- -

- And Jove said, "My child, what are you talking about? How can I forget Ulysses than whom there is no more - capable man on earth, nor more liberal in his offerings to the immortal gods that live in heaven? Bear in mind, - however, that Neptune is still furious with Ulysses for having blinded an eye of Polyphemus king of the - Cyclopes. Polyphemus is son to Neptune by the nymph Thoosa, daughter to the sea-king Phorcys; therefore though - he will not kill Ulysses outright, he torments him by preventing him from getting home. Still, let us lay our - heads together and see how we can help him to return; Neptune will then be pacified, for if we are all of a mind - he can hardly stand out against us." -

- -

- And Minerva said, "Father, son of Saturn, King of kings, if, then, the gods now mean that Ulysses should get - home, we should first send Mercury to the Ogygian island to tell Calypso that we have made up our minds and that - he is to return. In the meantime I will go to Ithaca, to put heart into Ulysses' son Telemachus; I will embolden - him to call the Achaeans in assembly, and speak out to the suitors of his mother Penelope, who persist in eating - up any number of his sheep and oxen; I will also conduct him to Sparta and to Pylos, to see if he can hear - anything about the return of his dear father- for this will make people speak well of him." -

- -

- Tell me, O muse, of that ingenious hero who travelled far and wide after he had sacked the famous town of Troy. - Many cities did he visit, and many were the nations with whose manners and customs he was acquainted; moreover - he suffered much by sea while trying to save his own life and bring his men safely home; but do what he might he - could not save his men, for they perished through their own sheer folly in eating the cattle of the Sun-god - Hyperion; so the god prevented them from ever reaching home. Tell me, too, about all these things, O daughter of - Jove, from whatsoever source you may know them. -

- -

- So now all who escaped death in battle or by shipwreck had got safely home except Ulysses, and he, though he was - longing to return to his wife and country, was detained by the goddess Calypso, who had got him into a large - cave and wanted to marry him. But as years went by, there came a time when the gods settled that he should go - back to Ithaca; even then, however, when he was among his own people, his troubles were not yet over; - nevertheless all the gods had now begun to pity him except Neptune, who still persecuted him without ceasing and - would not let him get home. -

- -

- Now Neptune had gone off to the Ethiopians, who are at the world's end, and lie in two halves, the one looking - West and the other East. He had gone there to accept a hecatomb of sheep and oxen, and was enjoying himself at - his festival; but the other gods met in the house of Olympian Jove, and the sire of gods and men spoke first. At - that moment he was thinking of Aegisthus, who had been killed by Agamemnon's son Orestes; so he said to the - other gods: -

- -

- "See now, how men lay blame upon us gods for what is after all nothing but their own folly. Look at Aegisthus; - he must needs make love to Agamemnon's wife unrighteously and then kill Agamemnon, though he knew it would be - the death of him; for I sent Mercury to warn him not to do either of these things, inasmuch as Orestes would be - sure to take his revenge when he grew up and wanted to return home. Mercury told him this in all good will but - he would not listen, and now he has paid for everything in full." -

- -

- Then Minerva said, "Father, son of Saturn, King of kings, it served Aegisthus right, and so it would any one - else who does as he did; but Aegisthus is neither here nor there; it is for Ulysses that my heart bleeds, when I - think of his sufferings in that lonely sea-girt island, far away, poor man, from all his friends. It is an - island covered with forest, in the very middle of the sea, and a goddess lives there, daughter of the magician - Atlas, who looks after the bottom of the ocean, and carries the great columns that keep heaven and earth - asunder. This daughter of Atlas has got hold of poor unhappy Ulysses, and keeps trying by every kind of - blandishment to make him forget his home, so that he is tired of life, and thinks of nothing but how he may once - more see the smoke of his own chimneys. You, sir, take no heed of this, and yet when Ulysses was before Troy did - he not propitiate you with many a burnt sacrifice? Why then should you keep on being so angry with him?" -

- -

- And Jove said, "My child, what are you talking about? How can I forget Ulysses than whom there is no more - capable man on earth, nor more liberal in his offerings to the immortal gods that live in heaven? Bear in mind, - however, that Neptune is still furious with Ulysses for having blinded an eye of Polyphemus king of the - Cyclopes. Polyphemus is son to Neptune by the nymph Thoosa, daughter to the sea-king Phorcys; therefore though - he will not kill Ulysses outright, he torments him by preventing him from getting home. Still, let us lay our - heads together and see how we can help him to return; Neptune will then be pacified, for if we are all of a mind - he can hardly stand out against us." -

- -

- And Minerva said, "Father, son of Saturn, King of kings, if, then, the gods now mean that Ulysses should get - home, we should first send Mercury to the Ogygian island to tell Calypso that we have made up our minds and that - he is to return. In the meantime I will go to Ithaca, to put heart into Ulysses' son Telemachus; I will embolden - him to call the Achaeans in assembly, and speak out to the suitors of his mother Penelope, who persist in eating - up any number of his sheep and oxen; I will also conduct him to Sparta and to Pylos, to see if he can hear - anything about the return of his dear father- for this will make people speak well of him." -

- -

- Tell me, O muse, of that ingenious hero who travelled far and wide after he had sacked the famous town of Troy. - Many cities did he visit, and many were the nations with whose manners and customs he was acquainted; moreover - he suffered much by sea while trying to save his own life and bring his men safely home; but do what he might he - could not save his men, for they perished through their own sheer folly in eating the cattle of the Sun-god - Hyperion; so the god prevented them from ever reaching home. Tell me, too, about all these things, O daughter of - Jove, from whatsoever source you may know them. -

- -

- So now all who escaped death in battle or by shipwreck had got safely home except Ulysses, and he, though he was - longing to return to his wife and country, was detained by the goddess Calypso, who had got him into a large - cave and wanted to marry him. But as years went by, there came a time when the gods settled that he should go - back to Ithaca; even then, however, when he was among his own people, his troubles were not yet over; - nevertheless all the gods had now begun to pity him except Neptune, who still persecuted him without ceasing and - would not let him get home. -

- -

- Now Neptune had gone off to the Ethiopians, who are at the world's end, and lie in two halves, the one looking - West and the other East. He had gone there to accept a hecatomb of sheep and oxen, and was enjoying himself at - his festival; but the other gods met in the house of Olympian Jove, and the sire of gods and men spoke first. At - that moment he was thinking of Aegisthus, who had been killed by Agamemnon's son Orestes; so he said to the - other gods: -

- -

- "See now, how men lay blame upon us gods for what is after all nothing but their own folly. Look at Aegisthus; - he must needs make love to Agamemnon's wife unrighteously and then kill Agamemnon, though he knew it would be - the death of him; for I sent Mercury to warn him not to do either of these things, inasmuch as Orestes would be - sure to take his revenge when he grew up and wanted to return home. Mercury told him this in all good will but - he would not listen, and now he has paid for everything in full." -

- -

- Then Minerva said, "Father, son of Saturn, King of kings, it served Aegisthus right, and so it would any one - else who does as he did; but Aegisthus is neither here nor there; it is for Ulysses that my heart bleeds, when I - think of his sufferings in that lonely sea-girt island, far away, poor man, from all his friends. It is an - island covered with forest, in the very middle of the sea, and a goddess lives there, daughter of the magician - Atlas, who looks after the bottom of the ocean, and carries the great columns that keep heaven and earth - asunder. This daughter of Atlas has got hold of poor unhappy Ulysses, and keeps trying by every kind of - blandishment to make him forget his home, so that he is tired of life, and thinks of nothing but how he may once - more see the smoke of his own chimneys. You, sir, take no heed of this, and yet when Ulysses was before Troy did - he not propitiate you with many a burnt sacrifice? Why then should you keep on being so angry with him?" -

- -

- And Jove said, "My child, what are you talking about? How can I forget Ulysses than whom there is no more - capable man on earth, nor more liberal in his offerings to the immortal gods that live in heaven? Bear in mind, - however, that Neptune is still furious with Ulysses for having blinded an eye of Polyphemus king of the - Cyclopes. Polyphemus is son to Neptune by the nymph Thoosa, daughter to the sea-king Phorcys; therefore though - he will not kill Ulysses outright, he torments him by preventing him from getting home. Still, let us lay our - heads together and see how we can help him to return; Neptune will then be pacified, for if we are all of a mind - he can hardly stand out against us." -

- -

- And Minerva said, "Father, son of Saturn, King of kings, if, then, the gods now mean that Ulysses should get - home, we should first send Mercury to the Ogygian island to tell Calypso that we have made up our minds and that - he is to return. In the meantime I will go to Ithaca, to put heart into Ulysses' son Telemachus; I will embolden - him to call the Achaeans in assembly, and speak out to the suitors of his mother Penelope, who persist in eating - up any number of his sheep and oxen; I will also conduct him to Sparta and to Pylos, to see if he can hear - anything about the return of his dear father- for this will make people speak well of him." -

-
- - - - diff --git a/packages/text-annotator/test/index.html b/packages/text-annotator/test/index.html index 12b17010..e19a912a 100644 --- a/packages/text-annotator/test/index.html +++ b/packages/text-annotator/test/index.html @@ -283,13 +283,21 @@
window.onload = async () => { var contentContainer = document.getElementById('content'); + const style = ((annotation, state, z) => ({ + fillOpacity: 0.2, + underlineColor: '#00ff00', + underlineOffset: z * 3.5, + underlineThickness: 2 + })); + var r = createTextAnnotator(contentContainer, { - adapter: W3CTextFormat('https://www.gutenberg.org', contentContainer) + adapter: W3CTextFormat('https://www.gutenberg.org', contentContainer), + renderer: 'SPANS', + style }); var annotations; - r.loadAnnotations('annotations.w3c.json').then(a => annotations = a); r.on('createAnnotation', annotation => { From 9afdf265ef6dccfc96ad6731959fbc699bdaafdd Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Wed, 27 Mar 2024 14:23:48 +0100 Subject: [PATCH 16/31] Simplified SPAN rendering + enabled presence painter --- package-lock.json | 1 + packages/text-annotator/package.json | 1 + packages/text-annotator/src/TextAnnotator.ts | 2 +- .../src/highlight/baseRenderer.ts | 15 ++-- .../src/highlight/span/spansRenderer.ts | 90 +++++++++---------- 5 files changed, 53 insertions(+), 56 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9c8b0a37..f993e386 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4448,6 +4448,7 @@ "dependencies": { "@annotorious/core": "^3.0.0-rc.22", "colord": "^2.9.3", + "dequal": "^2.0.3", "rbush": "^3.0.1", "uuid": "^9.0.1" }, diff --git a/packages/text-annotator/package.json b/packages/text-annotator/package.json index 862430f9..57cb5948 100644 --- a/packages/text-annotator/package.json +++ b/packages/text-annotator/package.json @@ -39,6 +39,7 @@ "dependencies": { "@annotorious/core": "^3.0.0-rc.22", "colord": "^2.9.3", + "dequal": "^2.0.3", "rbush": "^3.0.1", "uuid": "^9.0.1" } diff --git a/packages/text-annotator/src/TextAnnotator.ts b/packages/text-annotator/src/TextAnnotator.ts index 8370ed4f..451386a6 100644 --- a/packages/text-annotator/src/TextAnnotator.ts +++ b/packages/text-annotator/src/TextAnnotator.ts @@ -92,7 +92,7 @@ export const createTextAnnotator = ( const setPresenceProvider = (provider: PresenceProvider) => { if (provider) { highlightRenderer.setPainter(createPresencePainter(container, provider, opts.presence)); - provider.on('selectionChange', () => highlightRenderer.redraw()); + provider.on('selectionChange', () => highlightRenderer.redraw(true)); } } diff --git a/packages/text-annotator/src/highlight/baseRenderer.ts b/packages/text-annotator/src/highlight/baseRenderer.ts index 36036b35..60635e29 100644 --- a/packages/text-annotator/src/highlight/baseRenderer.ts +++ b/packages/text-annotator/src/highlight/baseRenderer.ts @@ -18,7 +18,9 @@ export interface RendererImplementation { style?: HighlightStyleExpression, - painter?: HighlightPainter + painter?: HighlightPainter, + + force?: boolean ): void; @@ -28,7 +30,7 @@ export interface Renderer { destroy(): void; - redraw(): void; + redraw(force?: boolean): void; setStyle(style?: HighlightStyleExpression): void; @@ -75,7 +77,7 @@ export const createBaseRenderer = ( container.addEventListener('pointermove', onPointerMove); - const redraw = () => { + const redraw = (forced: boolean = false) => { if (customPainter) customPainter.clear(); @@ -97,7 +99,7 @@ export const createBaseRenderer = ( return { annotation, rects, state: { selected, hover: hovered, custom: {} }}; }) - renderer.redraw(highlights, bounds, currentStyle, customPainter); + renderer.redraw(highlights, bounds, currentStyle, customPainter, forced); setTimeout(() => onDraw(annotationsInView.map(({ annotation }) => annotation)), 1); } @@ -125,7 +127,8 @@ export const createBaseRenderer = ( const unsubscribeSelection = selection.subscribe(() => redraw()); // Refresh on scroll - document.addEventListener('scroll', redraw, { capture: true, passive: true }); + const onScroll = () => redraw(); + document.addEventListener('scroll', onScroll, { capture: true, passive: true }); // Refresh on resize const onResize = debounce(() => { @@ -159,7 +162,7 @@ export const createBaseRenderer = ( unsubscribeSelection(); - document.removeEventListener('scroll', redraw); + document.removeEventListener('scroll', onScroll); window.removeEventListener('resize', onResize); resizeObserver.disconnect(); diff --git a/packages/text-annotator/src/highlight/span/spansRenderer.ts b/packages/text-annotator/src/highlight/span/spansRenderer.ts index bb88b267..445fc001 100644 --- a/packages/text-annotator/src/highlight/span/spansRenderer.ts +++ b/packages/text-annotator/src/highlight/span/spansRenderer.ts @@ -1,5 +1,6 @@ import type { ViewportState } from '@annotorious/core'; import { colord } from 'colord'; +import { dequal } from 'dequal/lite'; import type { Rect, TextAnnotatorState } from '../../state'; import { paint, type HighlightPainter } from '../HighlightPainter'; import type { ViewportBounds } from '../viewport'; @@ -33,79 +34,70 @@ const createRenderer = (container: HTMLElement): RendererImplementation => { let customPainter: HighlightPainter; - // Currently rendered SPANs for each annotation ID - let currentRendered = new Map(); + // Currently rendered highlights + let currentRendered: Highlight[] = []; const redraw = ( highlights: Highlight[], viewportBounds: ViewportBounds, currentStyle?: HighlightStyleExpression, - painter?: HighlightPainter + painter?: HighlightPainter, + force?: boolean ) => { - if (customPainter) - customPainter.clear(); - - // Currently rendered IDs - const currentRenderedIds = Array.from(currentRendered.keys()) + // Only redraw if annotations or annotation states changed + const noChanges = dequal(currentRendered, highlights); + if (noChanges && !force) return; - // Next rendered IDs - const nextRendered = highlights.map(h => h.annotation.id); + highlightLayer.innerHTML = ''; - // Remove annotations that are no longer visible - const toRemove = currentRenderedIds.filter(id => !nextRendered.includes(id)); - toRemove.forEach(id => { - (currentRendered.get(id) || []).forEach(span => span.remove()); - currentRendered.delete(id); - }); + if (customPainter) + customPainter.clear(); // Rects from all visible annotations, for z-index computation const allRects = highlights.reduce((all, { rects }) => ([...all, ...rects]), []); - // Add annotations that are visible but not yet rendered - const rendered = highlights - .filter(({ annotation }) => !currentRenderedIds.includes(annotation.id)) - .map(highlight => { - const spans = highlight.rects.map(rect => { - const span = document.createElement('span'); - span.className = 'r6o-annotation'; - span.dataset.annotation = highlight.annotation.id; - - span.style.left = `${rect.x}px`; - span.style.top = `${rect.y}px`; - span.style.width = `${rect.width}px`; - span.style.height = `${rect.height}px`; - - const zIndex = computeZIndex(rect, allRects); + highlights.forEach(highlight => { + const spans = highlight.rects.map(rect => { + const span = document.createElement('span'); + span.className = 'r6o-annotation'; + span.dataset.annotation = highlight.annotation.id; + + span.style.left = `${rect.x}px`; + span.style.top = `${rect.y}px`; + span.style.width = `${rect.width}px`; + span.style.height = `${rect.height}px`; - const style = paint(highlight, viewportBounds, currentStyle, painter, zIndex); + const zIndex = computeZIndex(rect, allRects); - const backgroundColor = colord(style?.fill || DEFAULT_STYLE.fill) - .alpha(style?.fillOpacity === undefined ? DEFAULT_STYLE.fillOpacity : style.fillOpacity) - .toHex(); + const style = paint(highlight, viewportBounds, currentStyle, painter, zIndex); - span.style.backgroundColor = backgroundColor; + const backgroundColor = colord(style?.fill || DEFAULT_STYLE.fill) + .alpha(style?.fillOpacity === undefined ? DEFAULT_STYLE.fillOpacity : style.fillOpacity) + .toHex(); - if (style.underlineStyle) - span.style.borderStyle = style.underlineStyle; + span.style.backgroundColor = backgroundColor; - if (style.underlineColor) - span.style.borderColor = style.underlineColor; + if (style.underlineStyle) + span.style.borderStyle = style.underlineStyle; - if (style.underlineThickness) - span.style.borderBottomWidth = `${style.underlineThickness}px`; + if (style.underlineColor) + span.style.borderColor = style.underlineColor; - if (style.underlineOffset) - span.style.paddingBottom = `${style.underlineOffset}px`; + if (style.underlineThickness) + span.style.borderBottomWidth = `${style.underlineThickness}px`; - highlightLayer.appendChild(span); + if (style.underlineOffset) + span.style.paddingBottom = `${style.underlineOffset}px`; - return span; - }); + highlightLayer.appendChild(span); - return { id: highlight.annotation.id, spans }; + return span; }); - rendered.forEach(({ id, spans }) => currentRendered.set(id, spans)); + return { id: highlight.annotation.id, spans }; + }); + + currentRendered = highlights; } const destroy = () => { From 8d60f7fa9498964c6bc82abf032c48bcb2c74975 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Wed, 27 Mar 2024 14:35:54 +0100 Subject: [PATCH 17/31] Implemented .setVisible for SPAN renderer --- packages/text-annotator/src/TextAnnotator.ts | 5 ++--- packages/text-annotator/src/highlight/baseRenderer.ts | 7 ++++++- .../src/highlight/canvas/canvasRenderer.ts | 5 +++++ .../src/highlight/highlights/highlightsRenderer.ts | 5 +++++ .../src/highlight/span/spansRenderer.css | 4 ++++ .../text-annotator/src/highlight/span/spansRenderer.ts | 10 +++++++++- packages/text-annotator/test/index.html | 3 +++ 7 files changed, 34 insertions(+), 5 deletions(-) diff --git a/packages/text-annotator/src/TextAnnotator.ts b/packages/text-annotator/src/TextAnnotator.ts index 451386a6..37b89dbc 100644 --- a/packages/text-annotator/src/TextAnnotator.ts +++ b/packages/text-annotator/src/TextAnnotator.ts @@ -104,9 +104,8 @@ export const createTextAnnotator = ( } } - const setVisible = (visible: boolean) => { - // TODO - } + const setVisible = (visible: boolean) => + highlightRenderer.setVisible(visible); const destroy = () => { highlightRenderer.destroy(); diff --git a/packages/text-annotator/src/highlight/baseRenderer.ts b/packages/text-annotator/src/highlight/baseRenderer.ts index 60635e29..378404ff 100644 --- a/packages/text-annotator/src/highlight/baseRenderer.ts +++ b/packages/text-annotator/src/highlight/baseRenderer.ts @@ -24,6 +24,8 @@ export interface RendererImplementation { ): void; + setVisible(visible: boolean): void; + } export interface Renderer { @@ -38,6 +40,8 @@ export interface Renderer { setPainter(painter?: HighlightPainter): void; + setVisible(visible: boolean): void; + } export const createBaseRenderer = ( @@ -175,7 +179,8 @@ export const createBaseRenderer = ( redraw, setStyle, setFilter, - setPainter + setPainter, + setVisible: renderer.setVisible } } \ No newline at end of file diff --git a/packages/text-annotator/src/highlight/canvas/canvasRenderer.ts b/packages/text-annotator/src/highlight/canvas/canvasRenderer.ts index 5ce62131..49e63a8b 100644 --- a/packages/text-annotator/src/highlight/canvas/canvasRenderer.ts +++ b/packages/text-annotator/src/highlight/canvas/canvasRenderer.ts @@ -101,6 +101,10 @@ const createRenderer = (container: HTMLElement): RendererImplementation => { window.addEventListener('resize', onResize); + const setVisible = (visible: boolean) => { + console.log('setVisible not implemented on Canvas renderer'); + } + const destroy = () => { container.removeChild(canvas); @@ -109,6 +113,7 @@ const createRenderer = (container: HTMLElement): RendererImplementation => { return { destroy, + setVisible, redraw } diff --git a/packages/text-annotator/src/highlight/highlights/highlightsRenderer.ts b/packages/text-annotator/src/highlight/highlights/highlightsRenderer.ts index b98c8dd1..7bb9f2d6 100644 --- a/packages/text-annotator/src/highlight/highlights/highlightsRenderer.ts +++ b/packages/text-annotator/src/highlight/highlights/highlightsRenderer.ts @@ -83,6 +83,10 @@ export const createRenderer = (): RendererImplementation => { currentRendered = nextRendered; } + const setVisible = (visible: boolean) => { + console.log('setVisible not implemented on CSS Custom Highlights renderer'); + } + const destroy = () => { // Clear all highlights from the Highlight Registry // @ts-ignore @@ -94,6 +98,7 @@ export const createRenderer = (): RendererImplementation => { return { destroy, + setVisible, redraw } diff --git a/packages/text-annotator/src/highlight/span/spansRenderer.css b/packages/text-annotator/src/highlight/span/spansRenderer.css index 7c2c1b26..cd1b51c6 100644 --- a/packages/text-annotator/src/highlight/span/spansRenderer.css +++ b/packages/text-annotator/src/highlight/span/spansRenderer.css @@ -7,6 +7,10 @@ width: 100%; } +.r6o-annotatable .r6o-span-highlight-layer.hidden { + display: none; +} + .r6o-annotatable .r6o-span-highlight-layer .r6o-annotation { border-style: solid; border-width: 0; diff --git a/packages/text-annotator/src/highlight/span/spansRenderer.ts b/packages/text-annotator/src/highlight/span/spansRenderer.ts index 445fc001..230952be 100644 --- a/packages/text-annotator/src/highlight/span/spansRenderer.ts +++ b/packages/text-annotator/src/highlight/span/spansRenderer.ts @@ -100,13 +100,21 @@ const createRenderer = (container: HTMLElement): RendererImplementation => { currentRendered = highlights; } + const setVisible = (visible: boolean) => { + if (visible) + highlightLayer.classList.remove('hidden'); + else + highlightLayer.classList.add('hidden'); + } + const destroy = () => { highlightLayer.remove(); } return { destroy, - redraw + redraw, + setVisible } } diff --git a/packages/text-annotator/test/index.html b/packages/text-annotator/test/index.html index e19a912a..18d6a338 100644 --- a/packages/text-annotator/test/index.html +++ b/packages/text-annotator/test/index.html @@ -379,6 +379,9 @@
}) } }); + + // Make global so we can manipulate from the console + window.r = r; } From 0ffb7fc9e9b2e7d305f44b16967d0e713d838116 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Wed, 27 Mar 2024 15:03:11 +0100 Subject: [PATCH 18/31] Mutation observer now ignores changes coming from the renderers --- .../text-annotator/src/highlight/baseRenderer.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/text-annotator/src/highlight/baseRenderer.ts b/packages/text-annotator/src/highlight/baseRenderer.ts index 378404ff..1756d7a3 100644 --- a/packages/text-annotator/src/highlight/baseRenderer.ts +++ b/packages/text-annotator/src/highlight/baseRenderer.ts @@ -152,10 +152,14 @@ export const createBaseRenderer = ( // This is an extra precaution. The position of the container // might shift (without resizing) due to layout changes higher-up // in the DOM. (This happens in Recogito for example) - // const config: MutationObserverInit = { attributes: true, childList: true, subtree: true }; + const config: MutationObserverInit = { attributes: true, childList: true, subtree: true }; - // const mutationObserver = new MutationObserver(refresh); - // mutationObserver.observe(document.body, config); + const mutationObserver = new MutationObserver((records: MutationRecord[]) => { + const isInternal = records.every(record => record.target === container || container.contains(record.target)); + if (!isInternal) redraw(true); + }); + + mutationObserver.observe(document.body, config); const destroy = () => { container.removeEventListener('pointermove', onPointerMove); @@ -171,7 +175,7 @@ export const createBaseRenderer = ( window.removeEventListener('resize', onResize); resizeObserver.disconnect(); - // mutationObserver.disconnect(); + mutationObserver.disconnect(); } return { From c1dd038e3c21ad69f05bf2140b62388acde0b97d Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Wed, 27 Mar 2024 15:09:29 +0100 Subject: [PATCH 19/31] v3.0.0-rc.19 --- package-lock.json | 198 ++++++++++++++------- package.json | 2 +- packages/extension-tei/package.json | 8 +- packages/text-annotator-react/package.json | 10 +- packages/text-annotator/package.json | 6 +- 5 files changed, 141 insertions(+), 83 deletions(-) diff --git a/package-lock.json b/package-lock.json index f993e386..1cc459fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@recogito/text-annotator-monorepo", - "version": "3.0.0-rc.18", + "version": "3.0.0-rc.19", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@recogito/text-annotator-monorepo", - "version": "3.0.0-rc.18", + "version": "3.0.0-rc.19", "license": "BSD-3-Clause", "workspaces": [ "./packages/text-annotator", @@ -840,37 +840,38 @@ } }, "node_modules/@microsoft/api-extractor": { - "version": "7.39.0", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.39.0.tgz", - "integrity": "sha512-PuXxzadgnvp+wdeZFPonssRAj/EW4Gm4s75TXzPk09h3wJ8RS3x7typf95B4vwZRrPTQBGopdUl+/vHvlPdAcg==", + "version": "7.43.0", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.43.0.tgz", + "integrity": "sha512-GFhTcJpB+MI6FhvXEI9b2K0snulNLWHqC/BbcJtyNYcKUiw7l3Lgis5ApsYncJ0leALX7/of4XfmXk+maT111w==", "dev": true, "dependencies": { - "@microsoft/api-extractor-model": "7.28.3", + "@microsoft/api-extractor-model": "7.28.13", "@microsoft/tsdoc": "0.14.2", "@microsoft/tsdoc-config": "~0.16.1", - "@rushstack/node-core-library": "3.62.0", - "@rushstack/rig-package": "0.5.1", - "@rushstack/ts-command-line": "4.17.1", - "colors": "~1.2.1", + "@rushstack/node-core-library": "4.0.2", + "@rushstack/rig-package": "0.5.2", + "@rushstack/terminal": "0.10.0", + "@rushstack/ts-command-line": "4.19.1", "lodash": "~4.17.15", + "minimatch": "~3.0.3", "resolve": "~1.22.1", "semver": "~7.5.4", "source-map": "~0.6.1", - "typescript": "5.3.3" + "typescript": "5.4.2" }, "bin": { "api-extractor": "bin/api-extractor" } }, "node_modules/@microsoft/api-extractor-model": { - "version": "7.28.3", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.28.3.tgz", - "integrity": "sha512-wT/kB2oDbdZXITyDh2SQLzaWwTOFbV326fP0pUwNW00WeliARs0qjmXBWmGWardEzp2U3/axkO3Lboqun6vrig==", + "version": "7.28.13", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.28.13.tgz", + "integrity": "sha512-39v/JyldX4MS9uzHcdfmjjfS6cYGAoXV+io8B5a338pkHiSt+gy2eXQ0Q7cGFJ7quSa1VqqlMdlPrB6sLR/cAw==", "dev": true, "dependencies": { "@microsoft/tsdoc": "0.14.2", "@microsoft/tsdoc-config": "~0.16.1", - "@rushstack/node-core-library": "3.62.0" + "@rushstack/node-core-library": "4.0.2" } }, "node_modules/@microsoft/api-extractor/node_modules/lru-cache": { @@ -901,9 +902,9 @@ } }, "node_modules/@microsoft/api-extractor/node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", + "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -1521,12 +1522,11 @@ ] }, "node_modules/@rushstack/node-core-library": { - "version": "3.62.0", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.62.0.tgz", - "integrity": "sha512-88aJn2h8UpSvdwuDXBv1/v1heM6GnBf3RjEy6ZPP7UnzHNCqOHA2Ut+ScYUbXcqIdfew9JlTAe3g+cnX9xQ/Aw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-4.0.2.tgz", + "integrity": "sha512-hyES82QVpkfQMeBMteQUnrhASL/KHPhd7iJ8euduwNJG4mu2GSOKybf0rOEjOm1Wz7CwJEUm9y0yD7jg2C1bfg==", "dev": true, "dependencies": { - "colors": "~1.2.1", "fs-extra": "~7.0.1", "import-lazy": "~4.0.0", "jju": "~1.4.0", @@ -1577,24 +1577,66 @@ "dev": true }, "node_modules/@rushstack/rig-package": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.5.1.tgz", - "integrity": "sha512-pXRYSe29TjRw7rqxD4WS3HN/sRSbfr+tJs4a9uuaSIBAITbUggygdhuG0VrO0EO+QqH91GhYMN4S6KRtOEmGVA==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.5.2.tgz", + "integrity": "sha512-mUDecIJeH3yYGZs2a48k+pbhM6JYwWlgjs2Ca5f2n1G2/kgdgP9D/07oglEGf6mRyXEnazhEENeYTSNDRCwdqA==", "dev": true, "dependencies": { "resolve": "~1.22.1", "strip-json-comments": "~3.1.1" } }, + "node_modules/@rushstack/terminal": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.10.0.tgz", + "integrity": "sha512-UbELbXnUdc7EKwfH2sb8ChqNgapUOdqcCIdQP4NGxBpTZV2sQyeekuK3zmfQSa/MN+/7b4kBogl2wq0vpkpYGw==", + "dev": true, + "dependencies": { + "@rushstack/node-core-library": "4.0.2", + "supports-color": "~8.1.1" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@rushstack/terminal/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@rushstack/terminal/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, "node_modules/@rushstack/ts-command-line": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.17.1.tgz", - "integrity": "sha512-2jweO1O57BYP5qdBGl6apJLB+aRIn5ccIRTPDyULh0KMwVzFqWtw6IZWt1qtUoZD/pD2RNkIOosH6Cq45rIYeg==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.19.1.tgz", + "integrity": "sha512-J7H768dgcpG60d7skZ5uSSwyCZs/S2HrWP1Ds8d1qYAyaaeJmpmmLr9BVw97RjFzmQPOYnoXcKA4GkqDCkduQg==", "dev": true, "dependencies": { + "@rushstack/terminal": "0.10.0", "@types/argparse": "1.0.38", "argparse": "~1.0.9", - "colors": "~1.2.1", "string-argv": "~0.3.1" } }, @@ -1900,6 +1942,30 @@ } } }, + "node_modules/@vue/language-core/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@vue/language-core/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@vue/shared": { "version": "3.4.21", "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.21.tgz", @@ -2016,12 +2082,13 @@ "dev": true }, "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "node_modules/browserslist": { @@ -2185,15 +2252,6 @@ "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==" }, - "node_modules/colors": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.5.tgz", - "integrity": "sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==", - "dev": true, - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -2222,6 +2280,12 @@ "integrity": "sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==", "dev": true }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -3064,18 +3128,15 @@ } }, "node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "*" } }, "node_modules/mlly": { @@ -4095,17 +4156,18 @@ } }, "node_modules/vite-plugin-dts": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-3.7.3.tgz", - "integrity": "sha512-26eTlBYdpjRLWCsTJebM8vkCieE+p9gP3raf+ecDnzzK5E3FG6VE1wcy55OkRpfWWVlVvKkYFe6uvRHYWx7Nog==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-3.8.0.tgz", + "integrity": "sha512-wt9ST1MwS5lkxHtA3M30+lSA3TO8RnaUu3YUPmGgY1iKm+vWZmB7KBss6qspyUlto9ynLNHYG2eJ09d2Q4/7Qg==", "dev": true, "dependencies": { - "@microsoft/api-extractor": "7.39.0", + "@microsoft/api-extractor": "7.43.0", "@rollup/pluginutils": "^5.1.0", - "@vue/language-core": "^1.8.26", + "@vue/language-core": "^1.8.27", "debug": "^4.3.4", "kolorist": "^1.8.0", - "vue-tsc": "^1.8.26" + "magic-string": "^0.30.8", + "vue-tsc": "^1.8.27" }, "engines": { "node": "^14.18.0 || >=16.0.0" @@ -4426,24 +4488,22 @@ }, "packages/extension-tei": { "name": "@recogito/text-annotator-tei", - "version": "3.0.0-rc.18", + "version": "3.0.0-rc.19", "license": "BSD-3-Clause", "devDependencies": { - "@annotorious/core": "^3.0.0-rc.21", - "@recogito/text-annotator": "^3.0.0-rc.18", "CETEIcean": "^1.9.2", - "typescript": "^5.3.3", + "typescript": "^5.4.3", "vite": "^5.2.6", "vite-plugin-dts": "^3.7.3" }, "peerDependencies": { "@annotorious/core": "^3.0.0-rc.22", - "@recogito/text-annotator": "^3.0.0-rc.18" + "@recogito/text-annotator": "^3.0.0-rc.19" } }, "packages/text-annotator": { "name": "@recogito/text-annotator", - "version": "3.0.0-rc.18", + "version": "3.0.0-rc.19", "license": "BSD-3-Clause", "dependencies": { "@annotorious/core": "^3.0.0-rc.22", @@ -4458,22 +4518,22 @@ "@types/uuid": "^9.0.8", "jsdom": "^24.0.0", "svelte": "^4.2.12", - "typescript": "^5.3.3", + "typescript": "^5.4.3", "vite": "^5.2.6", - "vite-plugin-dts": "^3.7.3", + "vite-plugin-dts": "^3.8.0", "vitest": "^1.4.0" } }, "packages/text-annotator-react": { "name": "@recogito/react-text-annotator", - "version": "3.0.0-rc.18", + "version": "3.0.0-rc.19", "license": "BSD-3-Clause", "dependencies": { "@annotorious/core": "^3.0.0-rc.22", "@annotorious/react": "^3.0.0-rc.22", "@neodrag/react": "^2.0.3", - "@recogito/text-annotator": "^3.0.0-rc.18", - "@recogito/text-annotator-tei": "^3.0.0-rc.18", + "@recogito/text-annotator": "^3.0.0-rc.19", + "@recogito/text-annotator-tei": "^3.0.0-rc.19", "CETEIcean": "^1.9.2" }, "devDependencies": { @@ -4482,9 +4542,9 @@ "openseadragon": "4.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", - "typescript": "^5.3.3", + "typescript": "^5.4.3", "vite": "^5.2.6", - "vite-plugin-dts": "^3.7.3", + "vite-plugin-dts": "^3.8.0", "vite-tsconfig-paths": "^4.3.2" }, "peerDependencies": { diff --git a/package.json b/package.json index 775d5197..895944a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@recogito/text-annotator-monorepo", - "version": "3.0.0-rc.18", + "version": "3.0.0-rc.19", "description": "Recogito Text Annotator monorepo", "author": "Rainer Simon", "repository": { diff --git a/packages/extension-tei/package.json b/packages/extension-tei/package.json index 173ed686..0aa1ebd5 100644 --- a/packages/extension-tei/package.json +++ b/packages/extension-tei/package.json @@ -1,6 +1,6 @@ { "name": "@recogito/text-annotator-tei", - "version": "3.0.0-rc.18", + "version": "3.0.0-rc.19", "description": "Recogito Text Annotator TEI extension", "author": "Rainer Simon", "license": "BSD-3-Clause", @@ -26,15 +26,13 @@ "./dist/text-annotator.css": "./dist/text-annotator-tei.css" }, "devDependencies": { - "@annotorious/core": "^3.0.0-rc.21", - "@recogito/text-annotator": "^3.0.0-rc.18", "CETEIcean": "^1.9.2", - "typescript": "^5.3.3", + "typescript": "^5.4.3", "vite": "^5.2.6", "vite-plugin-dts": "^3.7.3" }, "peerDependencies": { "@annotorious/core": "^3.0.0-rc.22", - "@recogito/text-annotator": "^3.0.0-rc.18" + "@recogito/text-annotator": "^3.0.0-rc.19" } } diff --git a/packages/text-annotator-react/package.json b/packages/text-annotator-react/package.json index df15ee71..9671f2c4 100644 --- a/packages/text-annotator-react/package.json +++ b/packages/text-annotator-react/package.json @@ -1,6 +1,6 @@ { "name": "@recogito/react-text-annotator", - "version": "3.0.0-rc.18", + "version": "3.0.0-rc.19", "description": "Recogito Text Annotator React bindings", "author": "Rainer Simon", "license": "BSD-3-Clause", @@ -29,9 +29,9 @@ "openseadragon": "4.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", - "typescript": "^5.3.3", + "typescript": "^5.4.3", "vite": "^5.2.6", - "vite-plugin-dts": "^3.7.3", + "vite-plugin-dts": "^3.8.0", "vite-tsconfig-paths": "^4.3.2" }, "peerDependencies": { @@ -41,8 +41,8 @@ "dependencies": { "@annotorious/core": "^3.0.0-rc.22", "@annotorious/react": "^3.0.0-rc.22", - "@recogito/text-annotator": "^3.0.0-rc.18", - "@recogito/text-annotator-tei": "^3.0.0-rc.18", + "@recogito/text-annotator": "^3.0.0-rc.19", + "@recogito/text-annotator-tei": "^3.0.0-rc.19", "@neodrag/react": "^2.0.3", "CETEIcean": "^1.9.2" } diff --git a/packages/text-annotator/package.json b/packages/text-annotator/package.json index 57cb5948..114593eb 100644 --- a/packages/text-annotator/package.json +++ b/packages/text-annotator/package.json @@ -1,6 +1,6 @@ { "name": "@recogito/text-annotator", - "version": "3.0.0-rc.18", + "version": "3.0.0-rc.19", "description": "A JavaScript text annotation library", "author": "Rainer Simon", "license": "BSD-3-Clause", @@ -31,9 +31,9 @@ "@types/uuid": "^9.0.8", "jsdom": "^24.0.0", "svelte": "^4.2.12", - "typescript": "^5.3.3", + "typescript": "^5.4.3", "vite": "^5.2.6", - "vite-plugin-dts": "^3.7.3", + "vite-plugin-dts": "^3.8.0", "vitest": "^1.4.0" }, "dependencies": { From e1175151a260dcf23e91cf39e50e3967147d83c0 Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Wed, 27 Mar 2024 18:53:17 +0200 Subject: [PATCH 20/31] Exported `NOT_ANNOTATABLE_CLASS` --- packages/text-annotator/src/utils/splitAnnotatableRanges.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/text-annotator/src/utils/splitAnnotatableRanges.ts b/packages/text-annotator/src/utils/splitAnnotatableRanges.ts index f580fe79..eacec43a 100644 --- a/packages/text-annotator/src/utils/splitAnnotatableRanges.ts +++ b/packages/text-annotator/src/utils/splitAnnotatableRanges.ts @@ -1,4 +1,4 @@ -const NOT_ANNOTATABLE_CLASS = 'not-annotatable'; +export const NOT_ANNOTATABLE_CLASS = 'not-annotatable'; export const NOT_ANNOTATABLE_SELECTOR = `.${NOT_ANNOTATABLE_CLASS}`; From f29db41ee86141c07663ab1bb081250860d055f0 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Thu, 28 Mar 2024 09:08:00 +0100 Subject: [PATCH 21/31] Changed from 'force' to 'lazy' flag --- packages/text-annotator/src/TextAnnotator.ts | 2 +- packages/text-annotator/src/highlight/baseRenderer.ts | 8 ++++---- .../text-annotator/src/highlight/span/spansRenderer.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/text-annotator/src/TextAnnotator.ts b/packages/text-annotator/src/TextAnnotator.ts index 37b89dbc..fa52189b 100644 --- a/packages/text-annotator/src/TextAnnotator.ts +++ b/packages/text-annotator/src/TextAnnotator.ts @@ -92,7 +92,7 @@ export const createTextAnnotator = ( const setPresenceProvider = (provider: PresenceProvider) => { if (provider) { highlightRenderer.setPainter(createPresencePainter(container, provider, opts.presence)); - provider.on('selectionChange', () => highlightRenderer.redraw(true)); + provider.on('selectionChange', () => highlightRenderer.redraw()); } } diff --git a/packages/text-annotator/src/highlight/baseRenderer.ts b/packages/text-annotator/src/highlight/baseRenderer.ts index 1756d7a3..8972b099 100644 --- a/packages/text-annotator/src/highlight/baseRenderer.ts +++ b/packages/text-annotator/src/highlight/baseRenderer.ts @@ -20,7 +20,7 @@ export interface RendererImplementation { painter?: HighlightPainter, - force?: boolean + lazy?: boolean ): void; @@ -81,7 +81,7 @@ export const createBaseRenderer = ( container.addEventListener('pointermove', onPointerMove); - const redraw = (forced: boolean = false) => { + const redraw = (lazy: boolean = true) => { if (customPainter) customPainter.clear(); @@ -103,7 +103,7 @@ export const createBaseRenderer = ( return { annotation, rects, state: { selected, hover: hovered, custom: {} }}; }) - renderer.redraw(highlights, bounds, currentStyle, customPainter, forced); + renderer.redraw(highlights, bounds, currentStyle, customPainter, lazy); setTimeout(() => onDraw(annotationsInView.map(({ annotation }) => annotation)), 1); } @@ -131,7 +131,7 @@ export const createBaseRenderer = ( const unsubscribeSelection = selection.subscribe(() => redraw()); // Refresh on scroll - const onScroll = () => redraw(); + const onScroll = () => redraw(true); document.addEventListener('scroll', onScroll, { capture: true, passive: true }); // Refresh on resize diff --git a/packages/text-annotator/src/highlight/span/spansRenderer.ts b/packages/text-annotator/src/highlight/span/spansRenderer.ts index 230952be..a3ad6c47 100644 --- a/packages/text-annotator/src/highlight/span/spansRenderer.ts +++ b/packages/text-annotator/src/highlight/span/spansRenderer.ts @@ -42,11 +42,11 @@ const createRenderer = (container: HTMLElement): RendererImplementation => { viewportBounds: ViewportBounds, currentStyle?: HighlightStyleExpression, painter?: HighlightPainter, - force?: boolean + lazy?: boolean ) => { // Only redraw if annotations or annotation states changed const noChanges = dequal(currentRendered, highlights); - if (noChanges && !force) return; + if (noChanges && lazy) return; highlightLayer.innerHTML = ''; From 2b5a0f49627490a20854a276f5c829f8b8f7985b Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Thu, 28 Mar 2024 13:29:25 +0200 Subject: [PATCH 22/31] Replaced `DrawingStyle` with `HighlightStyleExpression` --- packages/text-annotator/src/TextAnnotator.ts | 7 ++++--- packages/text-annotator/src/TextAnnotatorOptions.ts | 4 ++-- packages/text-annotator/src/highlight/index.ts | 5 ++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/text-annotator/src/TextAnnotator.ts b/packages/text-annotator/src/TextAnnotator.ts index 37b89dbc..1c29df08 100644 --- a/packages/text-annotator/src/TextAnnotator.ts +++ b/packages/text-annotator/src/TextAnnotator.ts @@ -1,6 +1,6 @@ -import { createAnonymousGuest, createLifecyleObserver, createBaseAnnotator, DrawingStyle, Filter, createUndoStack } from '@annotorious/core'; +import { createAnonymousGuest, createLifecyleObserver, createBaseAnnotator, Filter, createUndoStack } from '@annotorious/core'; import type { Annotator, User, PresenceProvider } from '@annotorious/core'; -import { createCanvasRenderer, createHighlightsRenderer, createSpansRenderer } from './highlight'; +import { createCanvasRenderer, createHighlightsRenderer, createSpansRenderer, type HighlightStyleExpression } from './highlight'; import { createPresencePainter } from './presence'; import { scrollIntoView } from './api'; import { TextAnnotationStore, TextAnnotatorState, createTextAnnotatorState } from './state'; @@ -10,6 +10,7 @@ import { SelectionHandler } from './SelectionHandler'; import './TextAnnotator.css'; + const USE_DEFAULT_RENDERER: RendererType = 'SPANS'; export interface TextAnnotator extends Annotator { @@ -81,7 +82,7 @@ export const createTextAnnotator = ( const setFilter = (filter?: Filter) => highlightRenderer.setFilter(filter); - const setStyle = (drawingStyle: DrawingStyle | ((annotation: TextAnnotation) => DrawingStyle) | undefined) => + const setStyle = (drawingStyle: HighlightStyleExpression | undefined) => highlightRenderer.setStyle(drawingStyle); const setUser = (user: User) => { diff --git a/packages/text-annotator/src/TextAnnotatorOptions.ts b/packages/text-annotator/src/TextAnnotatorOptions.ts index 5a354896..01d4f725 100644 --- a/packages/text-annotator/src/TextAnnotatorOptions.ts +++ b/packages/text-annotator/src/TextAnnotatorOptions.ts @@ -1,7 +1,7 @@ -import type { DrawingStyle, FormatAdapter, PointerSelectAction } from '@annotorious/core'; +import type { FormatAdapter, PointerSelectAction } from '@annotorious/core'; import type { PresencePainterOptions } from './presence'; import type { TextAnnotation } from './model'; -import type { HighlightStyleExpression } from './highlight/HighlightStyle'; +import type { HighlightStyleExpression } from './highlight'; export interface TextAnnotatorOptions { diff --git a/packages/text-annotator/src/highlight/index.ts b/packages/text-annotator/src/highlight/index.ts index 0c2eda06..318d2628 100644 --- a/packages/text-annotator/src/highlight/index.ts +++ b/packages/text-annotator/src/highlight/index.ts @@ -1,3 +1,6 @@ +export * from './Highlight'; +export * from './HighlightStyle'; +export * from './HighlightPainter'; export * from './canvas'; export * from './highlights'; -export * from './span'; \ No newline at end of file +export * from './span'; From a9f4e2cf651571f911db65d409cdb2f92bc9f9e2 Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Thu, 28 Mar 2024 13:30:16 +0200 Subject: [PATCH 23/31] Replaced `DrawingStyle` with `HighlightStyleExpression` for the TEI --- packages/text-annotator-react/src/TextAnnotator.tsx | 7 ++++--- packages/text-annotator-react/src/tei/TEIAnnotator.tsx | 10 +++++----- packages/text-annotator/src/TextAnnotator.ts | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/text-annotator-react/src/TextAnnotator.tsx b/packages/text-annotator-react/src/TextAnnotator.tsx index 5fcf352f..6176f2e3 100644 --- a/packages/text-annotator-react/src/TextAnnotator.tsx +++ b/packages/text-annotator-react/src/TextAnnotator.tsx @@ -1,11 +1,12 @@ import { ReactNode, useContext, useEffect, useRef } from 'react'; -import { AnnotoriousContext, DrawingStyle, Filter } from '@annotorious/react'; +import { AnnotoriousContext, Filter } from '@annotorious/react'; import type { FormatAdapter } from '@annotorious/core'; -import type { TextAnnotation, TextAnnotatorOptions } from '@recogito/text-annotator'; +import type { HighlightStyleExpression, TextAnnotation, TextAnnotatorOptions } from '@recogito/text-annotator'; import { createTextAnnotator } from '@recogito/text-annotator'; import '@recogito/text-annotator/dist/text-annotator.css'; + export interface TextAnnotatorProps extends Omit, 'adapter'> { children?: ReactNode | JSX.Element; @@ -14,7 +15,7 @@ export interface TextAnnotatorProps extends Omit DrawingStyle); + style?: HighlightStyleExpression className?: string; diff --git a/packages/text-annotator-react/src/tei/TEIAnnotator.tsx b/packages/text-annotator-react/src/tei/TEIAnnotator.tsx index 8e9f4e1c..284481fb 100644 --- a/packages/text-annotator-react/src/tei/TEIAnnotator.tsx +++ b/packages/text-annotator-react/src/tei/TEIAnnotator.tsx @@ -1,8 +1,8 @@ import { Children, ReactElement, ReactNode, cloneElement, useContext, useEffect } from 'react'; -import { AnnotoriousContext, DrawingStyle, Filter } from '@annotorious/react'; +import { AnnotoriousContext, Filter } from '@annotorious/react'; import { TEIPlugin } from '@recogito/text-annotator-tei'; -import { createTextAnnotator } from '@recogito/text-annotator'; -import type { TextAnnotatorOptions, TextAnnotation } from '@recogito/text-annotator'; +import { createTextAnnotator, HighlightStyleExpression } from '@recogito/text-annotator'; +import type { TextAnnotatorOptions } from '@recogito/text-annotator'; import '@recogito/text-annotator/dist/text-annotator.css'; @@ -12,7 +12,7 @@ export type TEIAnnotatorProps = TextAnnotatorOptions & { filter?: Filter; - style?: DrawingStyle | ((annotation: TextAnnotation) => DrawingStyle); + style?: HighlightStyleExpression } @@ -48,4 +48,4 @@ export const TEIAnnotator = (props: TEIAnnotatorProps) => { ) : null; -} \ No newline at end of file +} diff --git a/packages/text-annotator/src/TextAnnotator.ts b/packages/text-annotator/src/TextAnnotator.ts index 1c29df08..214f087e 100644 --- a/packages/text-annotator/src/TextAnnotator.ts +++ b/packages/text-annotator/src/TextAnnotator.ts @@ -82,8 +82,8 @@ export const createTextAnnotator = ( const setFilter = (filter?: Filter) => highlightRenderer.setFilter(filter); - const setStyle = (drawingStyle: HighlightStyleExpression | undefined) => - highlightRenderer.setStyle(drawingStyle); + const setStyle = (style: HighlightStyleExpression | undefined) => + highlightRenderer.setStyle(style); const setUser = (user: User) => { currentUser = user; From 5394bdd34cc1c423cfd4ff859b61a2b42e635e81 Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Thu, 28 Mar 2024 20:29:00 +0200 Subject: [PATCH 24/31] Decreased log level to debug --- packages/text-annotator/src/TextAnnotator.ts | 2 +- packages/text-annotator/src/highlight/canvas/canvasRenderer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/text-annotator/src/TextAnnotator.ts b/packages/text-annotator/src/TextAnnotator.ts index 1e85807a..fb55f33c 100644 --- a/packages/text-annotator/src/TextAnnotator.ts +++ b/packages/text-annotator/src/TextAnnotator.ts @@ -61,7 +61,7 @@ export const createTextAnnotator = ( if (!highlightRenderer) throw `Unknown renderer implementation: ${useRenderer}`; - console.log(`Using ${useRenderer} renderer`); + console.debug(`Using ${useRenderer} renderer`); if (opts.style) highlightRenderer.setStyle(opts.style); diff --git a/packages/text-annotator/src/highlight/canvas/canvasRenderer.ts b/packages/text-annotator/src/highlight/canvas/canvasRenderer.ts index 49e63a8b..c792a92d 100644 --- a/packages/text-annotator/src/highlight/canvas/canvasRenderer.ts +++ b/packages/text-annotator/src/highlight/canvas/canvasRenderer.ts @@ -123,4 +123,4 @@ export const createCanvasRenderer = ( container: HTMLElement, state: TextAnnotatorState, viewport: ViewportState -) => createBaseRenderer(container, state, viewport, createRenderer(container)); \ No newline at end of file +) => createBaseRenderer(container, state, viewport, createRenderer(container)); From 412d9acd21a6bb45a4cdae98337df3cc32a07bc1 Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Thu, 28 Mar 2024 22:21:21 +0200 Subject: [PATCH 25/31] Added nested not annotatable content example --- packages/text-annotator/test/index.html | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/text-annotator/test/index.html b/packages/text-annotator/test/index.html index 18d6a338..8be3f13d 100644 --- a/packages/text-annotator/test/index.html +++ b/packages/text-annotator/test/index.html @@ -24,7 +24,8 @@ } #content .not-annotatable { - background-color: wheat; + color: dimgray; + border: 3px solid wheat; } h1 { @@ -107,13 +108,16 @@
other gods:

-

- "See now, how men lay blame upon us gods for what is after all nothing but their own folly. Look at Aegisthus; - he must needs make love to Agamemnon's wife unrighteously and then kill Agamemnon, though he knew it would be - the death of him; for I sent Mercury to warn him not to do either of these things, inasmuch as Orestes would be - sure to take his revenge when he grew up and wanted to return home. Mercury told him this in all good will but - he would not listen, and now he has paid for everything in full." -

+
+

Not annotatable block!

+

+ "See now, how men lay blame upon us gods for what is after all nothing but their own folly. Look at Aegisthus; + he must needs make love to Agamemnon's wife unrighteously and then kill Agamemnon, though he knew it would be + the death of him; for I sent Mercury to warn him not to do either of these things, inasmuch as Orestes would be + sure to take his revenge when he grew up and wanted to return home. Mercury told him this in all good will but + he would not listen, and now he has paid for everything in full." +

+

Then Minerva said, "Father, son of Saturn, King of kings, it served Aegisthus right, and so it would any one From a89112a504a1c1b7137c5385411c6ea65cfd480c Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Fri, 29 Mar 2024 12:32:26 +0200 Subject: [PATCH 26/31] Fixed split on the nested not annotatable --- packages/text-annotator/src/utils/splitAnnotatableRanges.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/text-annotator/src/utils/splitAnnotatableRanges.ts b/packages/text-annotator/src/utils/splitAnnotatableRanges.ts index eacec43a..d91f45da 100644 --- a/packages/text-annotator/src/utils/splitAnnotatableRanges.ts +++ b/packages/text-annotator/src/utils/splitAnnotatableRanges.ts @@ -14,7 +14,10 @@ const iterateNotAnnotatableElements = function*(range: Range): Generator - node instanceof HTMLElement && node.classList.contains(NOT_ANNOTATABLE_CLASS) && range.intersectsNode(node) + node instanceof HTMLElement // Only elements that can have the class applied + && node.classList.contains(NOT_ANNOTATABLE_CLASS) // Only elements that are not annotatable + && !node.parentElement.closest(NOT_ANNOTATABLE_SELECTOR) // Only elements that are not descendants of a not annotatable element + && range.intersectsNode(node) // Only elements that are within the range ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP ); From 5389543dbfe8812a472482324bd7fd3c51b4e1aa Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Fri, 29 Mar 2024 11:35:03 +0100 Subject: [PATCH 27/31] v3.0.0-rc.20 --- package-lock.json | 214 +++++++++++---------- package.json | 2 +- packages/extension-tei/package.json | 8 +- packages/text-annotator-react/package.json | 12 +- packages/text-annotator/package.json | 6 +- 5 files changed, 128 insertions(+), 114 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1cc459fa..ded76994 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@recogito/text-annotator-monorepo", - "version": "3.0.0-rc.19", + "version": "3.0.0-rc.20", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@recogito/text-annotator-monorepo", - "version": "3.0.0-rc.19", + "version": "3.0.0-rc.20", "license": "BSD-3-Clause", "workspaces": [ "./packages/text-annotator", @@ -1340,9 +1340,9 @@ "dev": true }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.1.tgz", - "integrity": "sha512-4C4UERETjXpC4WpBXDbkgNVgHyWfG3B/NKY46e7w5H134UDOFqUJKpsLm0UYmuupW+aJmRgeScrDNfvZ5WV80A==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.2.tgz", + "integrity": "sha512-3XFIDKWMFZrMnao1mJhnOT1h2g0169Os848NhhmGweEcfJ4rCi+3yMCOLG4zA61rbJdkcrM/DjVZm9Hg5p5w7g==", "cpu": [ "arm" ], @@ -1353,9 +1353,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.1.tgz", - "integrity": "sha512-TrTaFJ9pXgfXEiJKQ3yQRelpQFqgRzVR9it8DbeRzG0RX7mKUy0bqhCFsgevwXLJepQKTnLl95TnPGf9T9AMOA==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.2.tgz", + "integrity": "sha512-GdxxXbAuM7Y/YQM9/TwwP+L0omeE/lJAR1J+olu36c3LqqZEBdsIWeQ91KBe6nxwOnb06Xh7JS2U5ooWU5/LgQ==", "cpu": [ "arm64" ], @@ -1366,9 +1366,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.1.tgz", - "integrity": "sha512-fz7jN6ahTI3cKzDO2otQuybts5cyu0feymg0bjvYCBrZQ8tSgE8pc0sSNEuGvifrQJWiwx9F05BowihmLxeQKw==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.2.tgz", + "integrity": "sha512-mCMlpzlBgOTdaFs83I4XRr8wNPveJiJX1RLfv4hggyIVhfB5mJfN4P8Z6yKh+oE4Luz+qq1P3kVdWrCKcMYrrA==", "cpu": [ "arm64" ], @@ -1379,9 +1379,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.1.tgz", - "integrity": "sha512-WTvdz7SLMlJpektdrnWRUN9C0N2qNHwNbWpNo0a3Tod3gb9leX+yrYdCeB7VV36OtoyiPAivl7/xZ3G1z5h20g==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.2.tgz", + "integrity": "sha512-yUoEvnH0FBef/NbB1u6d3HNGyruAKnN74LrPAfDQL3O32e3k3OSfLrPgSJmgb3PJrBZWfPyt6m4ZhAFa2nZp2A==", "cpu": [ "x64" ], @@ -1392,9 +1392,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.1.tgz", - "integrity": "sha512-dBHQl+7wZzBYcIF6o4k2XkAfwP2ks1mYW2q/Gzv9n39uDcDiAGDqEyml08OdY0BIct0yLSPkDTqn4i6czpBLLw==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.2.tgz", + "integrity": "sha512-GYbLs5ErswU/Xs7aGXqzc3RrdEjKdmoCrgzhJWyFL0r5fL3qd1NPcDKDowDnmcoSiGJeU68/Vy+OMUluRxPiLQ==", "cpu": [ "arm" ], @@ -1405,9 +1405,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.1.tgz", - "integrity": "sha512-bur4JOxvYxfrAmocRJIW0SADs3QdEYK6TQ7dTNz6Z4/lySeu3Z1H/+tl0a4qDYv0bCdBpUYM0sYa/X+9ZqgfSQ==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.2.tgz", + "integrity": "sha512-L1+D8/wqGnKQIlh4Zre9i4R4b4noxzH5DDciyahX4oOz62CphY7WDWqJoQ66zNR4oScLNOqQJfNSIAe/6TPUmQ==", "cpu": [ "arm64" ], @@ -1418,9 +1418,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.1.tgz", - "integrity": "sha512-ssp77SjcDIUSoUyj7DU7/5iwM4ZEluY+N8umtCT9nBRs3u045t0KkW02LTyHouHDomnMXaXSZcCSr2bdMK63kA==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.2.tgz", + "integrity": "sha512-tK5eoKFkXdz6vjfkSTCupUzCo40xueTOiOO6PeEIadlNBkadH1wNOH8ILCPIl8by/Gmb5AGAeQOFeLev7iZDOA==", "cpu": [ "arm64" ], @@ -1430,10 +1430,23 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.13.2.tgz", + "integrity": "sha512-zvXvAUGGEYi6tYhcDmb9wlOckVbuD+7z3mzInCSTACJ4DQrdSLPNUeDIcAQW39M3q6PDquqLWu7pnO39uSMRzQ==", + "cpu": [ + "ppc64le" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.1.tgz", - "integrity": "sha512-Jv1DkIvwEPAb+v25/Unrnnq9BO3F5cbFPT821n3S5litkz+O5NuXuNhqtPx5KtcwOTtaqkTsO+IVzJOsxd11aQ==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.2.tgz", + "integrity": "sha512-C3GSKvMtdudHCN5HdmAMSRYR2kkhgdOfye4w0xzyii7lebVr4riCgmM6lRiSCnJn2w1Xz7ZZzHKuLrjx5620kw==", "cpu": [ "riscv64" ], @@ -1444,9 +1457,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.13.1.tgz", - "integrity": "sha512-U564BrhEfaNChdATQaEODtquCC7Ez+8Hxz1h5MAdMYj0AqD0GA9rHCpElajb/sQcaFL6NXmHc5O+7FXpWMa73Q==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.13.2.tgz", + "integrity": "sha512-l4U0KDFwzD36j7HdfJ5/TveEQ1fUTjFFQP5qIt9gBqBgu1G8/kCaq5Ok05kd5TG9F8Lltf3MoYsUMw3rNlJ0Yg==", "cpu": [ "s390x" ], @@ -1457,9 +1470,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.1.tgz", - "integrity": "sha512-zGRDulLTeDemR8DFYyFIQ8kMP02xpUsX4IBikc7lwL9PrwR3gWmX2NopqiGlI2ZVWMl15qZeUjumTwpv18N7sQ==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.2.tgz", + "integrity": "sha512-xXMLUAMzrtsvh3cZ448vbXqlUa7ZL8z0MwHp63K2IIID2+DeP5iWIT6g1SN7hg1VxPzqx0xZdiDM9l4n9LRU1A==", "cpu": [ "x64" ], @@ -1470,9 +1483,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.1.tgz", - "integrity": "sha512-VTk/MveyPdMFkYJJPCkYBw07KcTkGU2hLEyqYMsU4NjiOfzoaDTW9PWGRsNwiOA3qI0k/JQPjkl/4FCK1smskQ==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.2.tgz", + "integrity": "sha512-M/JYAWickafUijWPai4ehrjzVPKRCyDb1SLuO+ZyPfoXgeCEAlgPkNXewFZx0zcnoIe3ay4UjXIMdXQXOZXWqA==", "cpu": [ "x64" ], @@ -1483,9 +1496,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.1.tgz", - "integrity": "sha512-L+hX8Dtibb02r/OYCsp4sQQIi3ldZkFI0EUkMTDwRfFykXBPptoz/tuuGqEd3bThBSLRWPR6wsixDSgOx/U3Zw==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.2.tgz", + "integrity": "sha512-2YWwoVg9KRkIKaXSh0mz3NmfurpmYoBBTAXA9qt7VXk0Xy12PoOP40EFuau+ajgALbbhi4uTj3tSG3tVseCjuA==", "cpu": [ "arm64" ], @@ -1496,9 +1509,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.1.tgz", - "integrity": "sha512-+dI2jVPfM5A8zme8riEoNC7UKk0Lzc7jCj/U89cQIrOjrZTCWZl/+IXUeRT2rEZ5j25lnSA9G9H1Ob9azaF/KQ==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.2.tgz", + "integrity": "sha512-2FSsE9aQ6OWD20E498NYKEQLneShWes0NGMPQwxWOdws35qQXH+FplabOSP5zEe1pVjurSDOGEVCE2agFwSEsw==", "cpu": [ "ia32" ], @@ -1509,9 +1522,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.1.tgz", - "integrity": "sha512-YY1Exxo2viZ/O2dMHuwQvimJ0SqvL+OAWQLLY6rvXavgQKjhQUzn7nc1Dd29gjB5Fqi00nrBWctJBOyfVMIVxw==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.2.tgz", + "integrity": "sha512-7h7J2nokcdPePdKykd8wtc8QqqkqxIrUz7MHj6aNr8waBRU//NLDVnNjQnqQO6fqtjrtCdftpbTuOKAyrAQETQ==", "cpu": [ "x64" ], @@ -1742,9 +1755,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.2.72", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.72.tgz", - "integrity": "sha512-/e7GWxGzXQF7OJAua7UAYqYi/4VpXEfbGtmYQcAQwP3SjjjAXfybTf/JK5S+SaetB/ChXl8Y2g1hCsj7jDXxcg==", + "version": "18.2.73", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.73.tgz", + "integrity": "sha512-XcGdod0Jjv84HOC7N5ziY3x+qL0AfmubvKOZ9hJjJ2yd5EE+KYjWhdOjt387e9HPheHkdggF9atTifMRtyAaRA==", "dev": true, "dependencies": { "@types/prop-types": "*", @@ -1752,9 +1765,9 @@ } }, "node_modules/@types/react-dom": { - "version": "18.2.22", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.22.tgz", - "integrity": "sha512-fHkBXPeNtfvri6gdsMYyW+dW7RXFo6Ad09nLFK0VQWR7yGLai/Cyvyj696gbwYvBnhGtevUG9cET0pmUbMtoPQ==", + "version": "18.2.23", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.23.tgz", + "integrity": "sha512-ZQ71wgGOTmDYpnav2knkjr3qXdAFu0vsk8Ci5w3pGAIdj7/kKAyn+VsQDhXsmzzzepAiI9leWMmubXz690AI/A==", "dev": true, "dependencies": { "@types/react": "*" @@ -1952,9 +1965,9 @@ } }, "node_modules/@vue/language-core/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -2439,9 +2452,9 @@ "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" }, "node_modules/electron-to-chromium": { - "version": "1.4.717", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.717.tgz", - "integrity": "sha512-6Fmg8QkkumNOwuZ/5mIbMU9WI3H2fmn5ajcVya64I5Yr5CcNmO7vcLt0Y7c96DCiMO5/9G+4sI2r6eEvdg1F7A==", + "version": "1.4.721", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.721.tgz", + "integrity": "sha512-k1x2r6foI8iJOp+1qTxbbrrWMsOiHkzGBYwYigaq+apO1FSqtn44KTo3Sy69qt7CRr7149zTcsDvH7MUKsOuIQ==", "dev": true }, "node_modules/entities": { @@ -3584,9 +3597,9 @@ } }, "node_modules/rollup": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.13.1.tgz", - "integrity": "sha512-hFi+fU132IvJ2ZuihN56dwgpltpmLZHZWsx27rMCTZ2sYwrqlgL5sECGy1eeV2lAihD8EzChBVVhsXci0wD4Tg==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.13.2.tgz", + "integrity": "sha512-MIlLgsdMprDBXC+4hsPgzWUasLO9CE4zOkj/u6j+Z6j5A4zRY+CtiXAdJyPtgCsc42g658Aeh1DlrdVEJhsL2g==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -3599,20 +3612,21 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.13.1", - "@rollup/rollup-android-arm64": "4.13.1", - "@rollup/rollup-darwin-arm64": "4.13.1", - "@rollup/rollup-darwin-x64": "4.13.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.13.1", - "@rollup/rollup-linux-arm64-gnu": "4.13.1", - "@rollup/rollup-linux-arm64-musl": "4.13.1", - "@rollup/rollup-linux-riscv64-gnu": "4.13.1", - "@rollup/rollup-linux-s390x-gnu": "4.13.1", - "@rollup/rollup-linux-x64-gnu": "4.13.1", - "@rollup/rollup-linux-x64-musl": "4.13.1", - "@rollup/rollup-win32-arm64-msvc": "4.13.1", - "@rollup/rollup-win32-ia32-msvc": "4.13.1", - "@rollup/rollup-win32-x64-msvc": "4.13.1", + "@rollup/rollup-android-arm-eabi": "4.13.2", + "@rollup/rollup-android-arm64": "4.13.2", + "@rollup/rollup-darwin-arm64": "4.13.2", + "@rollup/rollup-darwin-x64": "4.13.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.13.2", + "@rollup/rollup-linux-arm64-gnu": "4.13.2", + "@rollup/rollup-linux-arm64-musl": "4.13.2", + "@rollup/rollup-linux-powerpc64le-gnu": "4.13.2", + "@rollup/rollup-linux-riscv64-gnu": "4.13.2", + "@rollup/rollup-linux-s390x-gnu": "4.13.2", + "@rollup/rollup-linux-x64-gnu": "4.13.2", + "@rollup/rollup-linux-x64-musl": "4.13.2", + "@rollup/rollup-win32-arm64-msvc": "4.13.2", + "@rollup/rollup-win32-ia32-msvc": "4.13.2", + "@rollup/rollup-win32-x64-msvc": "4.13.2", "fsevents": "~2.3.2" } }, @@ -3799,21 +3813,21 @@ } }, "node_modules/strip-literal": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.0.0.tgz", - "integrity": "sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", + "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", "dev": true, "dependencies": { - "js-tokens": "^8.0.2" + "js-tokens": "^9.0.0" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/strip-literal/node_modules/js-tokens": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz", - "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", + "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", "dev": true }, "node_modules/supports-color": { @@ -4079,13 +4093,13 @@ } }, "node_modules/vite": { - "version": "5.2.6", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.6.tgz", - "integrity": "sha512-FPtnxFlSIKYjZ2eosBQamz4CbyrTizbZ3hnGJlh/wMtCrlp1Hah6AzBLjGI5I2urTfNnpovpHdrL6YRuBOPnCA==", + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.7.tgz", + "integrity": "sha512-k14PWOKLI6pMaSzAuGtT+Cf0YmIx12z9YGon39onaJNy8DLBfBJrzg9FQEmkAM5lpHBZs9wksWAsyF/HkpEwJA==", "dev": true, "dependencies": { "esbuild": "^0.20.1", - "postcss": "^8.4.36", + "postcss": "^8.4.38", "rollup": "^4.13.0" }, "bin": { @@ -4156,9 +4170,9 @@ } }, "node_modules/vite-plugin-dts": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-3.8.0.tgz", - "integrity": "sha512-wt9ST1MwS5lkxHtA3M30+lSA3TO8RnaUu3YUPmGgY1iKm+vWZmB7KBss6qspyUlto9ynLNHYG2eJ09d2Q4/7Qg==", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-3.8.1.tgz", + "integrity": "sha512-zEYyQxH7lKto1VTKZHF3ZZeOPkkJgnMrePY4VxDHfDSvDjmYMMfWjZxYmNwW8QxbaItWJQhhXY+geAbyNphI7g==", "dev": true, "dependencies": { "@microsoft/api-extractor": "7.43.0", @@ -4488,22 +4502,22 @@ }, "packages/extension-tei": { "name": "@recogito/text-annotator-tei", - "version": "3.0.0-rc.19", + "version": "3.0.0-rc.20", "license": "BSD-3-Clause", "devDependencies": { "CETEIcean": "^1.9.2", "typescript": "^5.4.3", - "vite": "^5.2.6", - "vite-plugin-dts": "^3.7.3" + "vite": "^5.2.7", + "vite-plugin-dts": "^3.8.1" }, "peerDependencies": { "@annotorious/core": "^3.0.0-rc.22", - "@recogito/text-annotator": "^3.0.0-rc.19" + "@recogito/text-annotator": "^3.0.0-rc.20" } }, "packages/text-annotator": { "name": "@recogito/text-annotator", - "version": "3.0.0-rc.19", + "version": "3.0.0-rc.20", "license": "BSD-3-Clause", "dependencies": { "@annotorious/core": "^3.0.0-rc.22", @@ -4519,32 +4533,32 @@ "jsdom": "^24.0.0", "svelte": "^4.2.12", "typescript": "^5.4.3", - "vite": "^5.2.6", - "vite-plugin-dts": "^3.8.0", + "vite": "^5.2.7", + "vite-plugin-dts": "^3.8.1", "vitest": "^1.4.0" } }, "packages/text-annotator-react": { "name": "@recogito/react-text-annotator", - "version": "3.0.0-rc.19", + "version": "3.0.0-rc.20", "license": "BSD-3-Clause", "dependencies": { "@annotorious/core": "^3.0.0-rc.22", "@annotorious/react": "^3.0.0-rc.22", "@neodrag/react": "^2.0.3", - "@recogito/text-annotator": "^3.0.0-rc.19", - "@recogito/text-annotator-tei": "^3.0.0-rc.19", + "@recogito/text-annotator": "^3.0.0-rc.20", + "@recogito/text-annotator-tei": "^3.0.0-rc.20", "CETEIcean": "^1.9.2" }, "devDependencies": { - "@types/react-dom": "^18.2.22", + "@types/react-dom": "^18.2.23", "@vitejs/plugin-react": "^4.2.1", "openseadragon": "4.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^5.4.3", - "vite": "^5.2.6", - "vite-plugin-dts": "^3.8.0", + "vite": "^5.2.7", + "vite-plugin-dts": "^3.8.1", "vite-tsconfig-paths": "^4.3.2" }, "peerDependencies": { diff --git a/package.json b/package.json index 895944a6..efd4d17a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@recogito/text-annotator-monorepo", - "version": "3.0.0-rc.19", + "version": "3.0.0-rc.20", "description": "Recogito Text Annotator monorepo", "author": "Rainer Simon", "repository": { diff --git a/packages/extension-tei/package.json b/packages/extension-tei/package.json index 0aa1ebd5..8944b5bf 100644 --- a/packages/extension-tei/package.json +++ b/packages/extension-tei/package.json @@ -1,6 +1,6 @@ { "name": "@recogito/text-annotator-tei", - "version": "3.0.0-rc.19", + "version": "3.0.0-rc.20", "description": "Recogito Text Annotator TEI extension", "author": "Rainer Simon", "license": "BSD-3-Clause", @@ -28,11 +28,11 @@ "devDependencies": { "CETEIcean": "^1.9.2", "typescript": "^5.4.3", - "vite": "^5.2.6", - "vite-plugin-dts": "^3.7.3" + "vite": "^5.2.7", + "vite-plugin-dts": "^3.8.1" }, "peerDependencies": { "@annotorious/core": "^3.0.0-rc.22", - "@recogito/text-annotator": "^3.0.0-rc.19" + "@recogito/text-annotator": "^3.0.0-rc.20" } } diff --git a/packages/text-annotator-react/package.json b/packages/text-annotator-react/package.json index 9671f2c4..41cf82e1 100644 --- a/packages/text-annotator-react/package.json +++ b/packages/text-annotator-react/package.json @@ -1,6 +1,6 @@ { "name": "@recogito/react-text-annotator", - "version": "3.0.0-rc.19", + "version": "3.0.0-rc.20", "description": "Recogito Text Annotator React bindings", "author": "Rainer Simon", "license": "BSD-3-Clause", @@ -24,14 +24,14 @@ "module": "./dist/react-text-annotator.es.js", "types": "./dist/index.d.ts", "devDependencies": { - "@types/react-dom": "^18.2.22", + "@types/react-dom": "^18.2.23", "@vitejs/plugin-react": "^4.2.1", "openseadragon": "4.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^5.4.3", - "vite": "^5.2.6", - "vite-plugin-dts": "^3.8.0", + "vite": "^5.2.7", + "vite-plugin-dts": "^3.8.1", "vite-tsconfig-paths": "^4.3.2" }, "peerDependencies": { @@ -41,8 +41,8 @@ "dependencies": { "@annotorious/core": "^3.0.0-rc.22", "@annotorious/react": "^3.0.0-rc.22", - "@recogito/text-annotator": "^3.0.0-rc.19", - "@recogito/text-annotator-tei": "^3.0.0-rc.19", + "@recogito/text-annotator": "^3.0.0-rc.20", + "@recogito/text-annotator-tei": "^3.0.0-rc.20", "@neodrag/react": "^2.0.3", "CETEIcean": "^1.9.2" } diff --git a/packages/text-annotator/package.json b/packages/text-annotator/package.json index 114593eb..f601cfbe 100644 --- a/packages/text-annotator/package.json +++ b/packages/text-annotator/package.json @@ -1,6 +1,6 @@ { "name": "@recogito/text-annotator", - "version": "3.0.0-rc.19", + "version": "3.0.0-rc.20", "description": "A JavaScript text annotation library", "author": "Rainer Simon", "license": "BSD-3-Clause", @@ -32,8 +32,8 @@ "jsdom": "^24.0.0", "svelte": "^4.2.12", "typescript": "^5.4.3", - "vite": "^5.2.6", - "vite-plugin-dts": "^3.8.0", + "vite": "^5.2.7", + "vite-plugin-dts": "^3.8.1", "vitest": "^1.4.0" }, "dependencies": { From 94d4d0dceb6dd990f23f74867a961bd0860a8620 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Fri, 29 Mar 2024 11:42:43 +0100 Subject: [PATCH 28/31] Rendering bugfix --- packages/text-annotator/src/highlight/baseRenderer.ts | 4 ++-- packages/text-annotator/src/highlight/span/spansRenderer.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/text-annotator/src/highlight/baseRenderer.ts b/packages/text-annotator/src/highlight/baseRenderer.ts index 8972b099..a7f6f2df 100644 --- a/packages/text-annotator/src/highlight/baseRenderer.ts +++ b/packages/text-annotator/src/highlight/baseRenderer.ts @@ -81,7 +81,7 @@ export const createBaseRenderer = ( container.addEventListener('pointermove', onPointerMove); - const redraw = (lazy: boolean = true) => { + const redraw = (lazy: boolean = false) => { if (customPainter) customPainter.clear(); @@ -120,7 +120,7 @@ export const createBaseRenderer = ( const setFilter = (filter?: Filter) => { currentFilter = filter; - redraw(); + redraw(false); } // Refresh on store change diff --git a/packages/text-annotator/src/highlight/span/spansRenderer.ts b/packages/text-annotator/src/highlight/span/spansRenderer.ts index a3ad6c47..d1f57759 100644 --- a/packages/text-annotator/src/highlight/span/spansRenderer.ts +++ b/packages/text-annotator/src/highlight/span/spansRenderer.ts @@ -44,6 +44,8 @@ const createRenderer = (container: HTMLElement): RendererImplementation => { painter?: HighlightPainter, lazy?: boolean ) => { + console.log('redraw, lazy =', lazy); + // Only redraw if annotations or annotation states changed const noChanges = dequal(currentRendered, highlights); if (noChanges && lazy) return; From c1a91be430e26215da1b14418c7fe546b0d4999d Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Fri, 29 Mar 2024 11:46:57 +0100 Subject: [PATCH 29/31] Added update-version script + bumped to v3.0.0-rc.21 --- package.json | 2 +- packages/extension-tei/package.json | 6 +-- packages/text-annotator-react/package.json | 8 +-- packages/text-annotator/package.json | 4 +- update-version.js | 58 ++++++++++++++++++++++ 5 files changed, 68 insertions(+), 10 deletions(-) create mode 100644 update-version.js diff --git a/package.json b/package.json index efd4d17a..d3ed24ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@recogito/text-annotator-monorepo", - "version": "3.0.0-rc.20", + "version": "3.0.0-rc.21", "description": "Recogito Text Annotator monorepo", "author": "Rainer Simon", "repository": { diff --git a/packages/extension-tei/package.json b/packages/extension-tei/package.json index 8944b5bf..9461c358 100644 --- a/packages/extension-tei/package.json +++ b/packages/extension-tei/package.json @@ -1,6 +1,6 @@ { "name": "@recogito/text-annotator-tei", - "version": "3.0.0-rc.20", + "version": "3.0.0-rc.21", "description": "Recogito Text Annotator TEI extension", "author": "Rainer Simon", "license": "BSD-3-Clause", @@ -33,6 +33,6 @@ }, "peerDependencies": { "@annotorious/core": "^3.0.0-rc.22", - "@recogito/text-annotator": "^3.0.0-rc.20" + "@recogito/text-annotator": "3.0.0-rc.21" } -} +} \ No newline at end of file diff --git a/packages/text-annotator-react/package.json b/packages/text-annotator-react/package.json index 41cf82e1..a4c7d62a 100644 --- a/packages/text-annotator-react/package.json +++ b/packages/text-annotator-react/package.json @@ -1,6 +1,6 @@ { "name": "@recogito/react-text-annotator", - "version": "3.0.0-rc.20", + "version": "3.0.0-rc.21", "description": "Recogito Text Annotator React bindings", "author": "Rainer Simon", "license": "BSD-3-Clause", @@ -41,9 +41,9 @@ "dependencies": { "@annotorious/core": "^3.0.0-rc.22", "@annotorious/react": "^3.0.0-rc.22", - "@recogito/text-annotator": "^3.0.0-rc.20", - "@recogito/text-annotator-tei": "^3.0.0-rc.20", + "@recogito/text-annotator": "3.0.0-rc.21", + "@recogito/text-annotator-tei": "3.0.0-rc.21", "@neodrag/react": "^2.0.3", "CETEIcean": "^1.9.2" } -} +} \ No newline at end of file diff --git a/packages/text-annotator/package.json b/packages/text-annotator/package.json index f601cfbe..3953e29b 100644 --- a/packages/text-annotator/package.json +++ b/packages/text-annotator/package.json @@ -1,6 +1,6 @@ { "name": "@recogito/text-annotator", - "version": "3.0.0-rc.20", + "version": "3.0.0-rc.21", "description": "A JavaScript text annotation library", "author": "Rainer Simon", "license": "BSD-3-Clause", @@ -43,4 +43,4 @@ "rbush": "^3.0.1", "uuid": "^9.0.1" } -} +} \ No newline at end of file diff --git a/update-version.js b/update-version.js new file mode 100644 index 00000000..150de241 --- /dev/null +++ b/update-version.js @@ -0,0 +1,58 @@ +const fs = require('fs'); +const path = require('path'); + +const searchDirectories = (dir, fileList = []) => { + const files = fs.readdirSync(dir); + + files.forEach(file => { + const filePath = path.join(dir, file); + if (fs.statSync(filePath).isDirectory()) { + if (file !== 'node_modules') + fileList = searchDirectories(filePath, fileList); + } else { + if (file === 'package.json') { + fileList.push(filePath); + } + } + }); + + return fileList; +}; + +const updateVersionNumbers = (filePath, newVersion) => { + try { + let packageJson = fs.readFileSync(filePath, 'utf8'); + const packageData = JSON.parse(packageJson); + + packageData.version = newVersion; + + ['dependencies', 'peerDependencies'].forEach(depType => { + if (packageData[depType]) { + for (const dep in packageData[depType]) { + if (dep.startsWith('@recogito/text-')) { + packageData[depType][dep] = newVersion; + } + } + } + }); + + fs.writeFileSync(filePath, JSON.stringify(packageData, null, 2), 'utf8'); + console.log(`Updated ${filePath}`); + } catch (error) { + console.error(`Error updating ${filePath}: ${error}`); + } +} + +const main = () => { + const newVersion = process.argv[2]; + + const packageJsonFiles = searchDirectories('.'); + + packageJsonFiles.forEach(filePath => { + updateVersionNumbers(filePath, newVersion); + }); + + console.log(`All package.json files updated to version ${newVersion}`); +}; + +main(); \ No newline at end of file From 263a67ea2096dcc0d16be187393c6b94cecfe9bf Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Fri, 29 Mar 2024 11:48:34 +0100 Subject: [PATCH 30/31] Removed debug log statement --- packages/text-annotator/src/highlight/span/spansRenderer.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/text-annotator/src/highlight/span/spansRenderer.ts b/packages/text-annotator/src/highlight/span/spansRenderer.ts index d1f57759..cf77c871 100644 --- a/packages/text-annotator/src/highlight/span/spansRenderer.ts +++ b/packages/text-annotator/src/highlight/span/spansRenderer.ts @@ -43,9 +43,7 @@ const createRenderer = (container: HTMLElement): RendererImplementation => { currentStyle?: HighlightStyleExpression, painter?: HighlightPainter, lazy?: boolean - ) => { - console.log('redraw, lazy =', lazy); - + ) => { // Only redraw if annotations or annotation states changed const noChanges = dequal(currentRendered, highlights); if (noChanges && lazy) return; From 727877681b4c47a87eb7c1b1a034eacf12444995 Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko Date: Thu, 4 Apr 2024 14:01:26 +0300 Subject: [PATCH 31/31] Added text-specific `setStyle` override --- packages/text-annotator/src/TextAnnotator.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/text-annotator/src/TextAnnotator.ts b/packages/text-annotator/src/TextAnnotator.ts index fb55f33c..2d6e2a28 100644 --- a/packages/text-annotator/src/TextAnnotator.ts +++ b/packages/text-annotator/src/TextAnnotator.ts @@ -17,6 +17,8 @@ export interface TextAnnotator extends Annot element: HTMLElement; + setStyle(style: HighlightStyleExpression | undefined): void; + // Returns true if successful (or false if the annotation is not currently rendered) scrollIntoView(annotation: TextAnnotation): boolean;