diff --git a/package-lock.json b/package-lock.json index 4462fc17..230f7ce9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@recogito/text-annotator-monorepo", - "version": "3.0.0-rc.41", + "version": "3.0.0-rc.44", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@recogito/text-annotator-monorepo", - "version": "3.0.0-rc.41", + "version": "3.0.0-rc.44", "license": "BSD-3-Clause", "workspaces": [ "./packages/text-annotator", @@ -29,20 +29,20 @@ } }, "node_modules/@annotorious/annotorious": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@annotorious/annotorious/-/annotorious-3.0.0.tgz", - "integrity": "sha512-nw6RMSGF6FiXfnNJbhJvl0NKw+2optk5fRNxkNxVICID3E3HUo1luLZadzuBmyn5RDV7iF2tDsJt558x7DxCOA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@annotorious/annotorious/-/annotorious-3.0.2.tgz", + "integrity": "sha512-kzKEciBg5IMo37NJBF0xvhLATe2r+Ax5RMbt3t+ovNTQQxs3Miuvapk19Bo44JyouCon/9xH/dKMBCa4JeiStA==", "license": "BSD-3-Clause", "dependencies": { - "@annotorious/core": "3.0.0", + "@annotorious/core": "3.0.2", "rbush": "^4.0.1", "uuid": "^10.0.0" } }, "node_modules/@annotorious/core": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@annotorious/core/-/core-3.0.0.tgz", - "integrity": "sha512-Q9HJapiMWdmrCVnets7ZEbRUn+XtlgpcHJsmkfgVWf8zO5ERmlzGIwZ4cVpm4gd+OBOeOzJiyTwFHZICv3+0iw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@annotorious/core/-/core-3.0.2.tgz", + "integrity": "sha512-jNat3SpPiJPa4Nb+CyyWiCLODzhWH08lzGGwK38eF/cvkRhsSahRGmHbFNNnr4LR/pBIteFbED98X3JOxEll4A==", "license": "BSD-3-Clause", "dependencies": { "dequal": "^2.0.3", @@ -52,13 +52,13 @@ } }, "node_modules/@annotorious/openseadragon": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@annotorious/openseadragon/-/openseadragon-3.0.0.tgz", - "integrity": "sha512-gp5dLQEngjies4vD8g1OjEAB93ZdHpuRNHtpbTEy+xrJqBfHnOv7tgdYdlbCBLBJbzNclA+QQbisOIrwIR1sAg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@annotorious/openseadragon/-/openseadragon-3.0.2.tgz", + "integrity": "sha512-o+1ph5XK8r2VwJeeDhTjQY9zvRtvmTGZwfaggohefaVwWhaNAv3iZQGZjM9minV/eXeMQbVzkxJX0P+0D1t0og==", "license": "BSD-3-Clause", "dependencies": { - "@annotorious/annotorious": "3.0.0", - "@annotorious/core": "3.0.0", + "@annotorious/annotorious": "3.0.2", + "@annotorious/core": "3.0.2", "pixi.js": "^7.4.2", "uuid": "^10.0.0" }, @@ -67,15 +67,15 @@ } }, "node_modules/@annotorious/react": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@annotorious/react/-/react-3.0.0.tgz", - "integrity": "sha512-XdwD9ojQ+aIsQqV//c3Wj1b89P84t4AY7/QDp0UjeeCxaQBIUsAwwLzysBuzzPOvWtoCk1D6zqYIyFJ3QyPRtg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@annotorious/react/-/react-3.0.2.tgz", + "integrity": "sha512-uPMqH0n91tHLIsua0UBIAaIN65apvzXJO2fhLAoVZ45doMOHe0nAeDj5FD4hee1hUAo5CefJ7XnDVLuKlPD8fw==", "license": "BSD-3-Clause", "dependencies": { - "@annotorious/annotorious": "3.0.0", - "@annotorious/core": "3.0.0", - "@annotorious/openseadragon": "3.0.0", - "@neodrag/react": "^2.0.4" + "@annotorious/annotorious": "3.0.2", + "@annotorious/core": "3.0.2", + "@annotorious/openseadragon": "3.0.2", + "@floating-ui/react": "^0.26.23" }, "peerDependencies": { "openseadragon": "^3.0.0 || ^4.0.0 || ^5.0.0", @@ -994,12 +994,6 @@ "resolve": "~1.22.2" } }, - "node_modules/@neodrag/react": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@neodrag/react/-/react-2.0.4.tgz", - "integrity": "sha512-zjqaTXAtJWEyTECVus5TRpEnLxq3jqSQRr7y4+Iu4iRczun4KixQ7vRa1yObbFi6rgrC60adEYN6kxXON8CAwA==", - "license": "MIT" - }, "node_modules/@pixi/accessibility": { "version": "7.4.2", "resolved": "https://registry.npmjs.org/@pixi/accessibility/-/accessibility-7.4.2.tgz", @@ -1424,9 +1418,9 @@ "license": "MIT" }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.1.tgz", - "integrity": "sha512-2thheikVEuU7ZxFXubPDOtspKn1x0yqaYQwvALVtEcvFhMifPADBrgRPyHV0TF3b+9BgvgjgagVyvA/UqPZHmg==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.2.tgz", + "integrity": "sha512-fSuPrt0ZO8uXeS+xP3b+yYTCBUd05MoSp2N/MFOgjhhUhMmchXlpTQrTpI8T+YAwAQuK7MafsCOxW7VrPMrJcg==", "cpu": [ "arm" ], @@ -1438,9 +1432,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.1.tgz", - "integrity": "sha512-t1lLYn4V9WgnIFHXy1d2Di/7gyzBWS8G5pQSXdZqfrdCGTwi1VasRMSS81DTYb+avDs/Zz4A6dzERki5oRYz1g==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.2.tgz", + "integrity": "sha512-xGU5ZQmPlsjQS6tzTTGwMsnKUtu0WVbl0hYpTPauvbRAnmIvpInhJtgjj3mcuJpEiuUw4v1s4BimkdfDWlh7gA==", "cpu": [ "arm64" ], @@ -1452,9 +1446,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.1.tgz", - "integrity": "sha512-AH/wNWSEEHvs6t4iJ3RANxW5ZCK3fUnmf0gyMxWCesY1AlUj8jY7GC+rQE4wd3gwmZ9XDOpL0kcFnCjtN7FXlA==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.2.tgz", + "integrity": "sha512-99AhQ3/ZMxU7jw34Sq8brzXqWH/bMnf7ZVhvLk9QU2cOepbQSVTns6qoErJmSiAvU3InRqC2RRZ5ovh1KN0d0Q==", "cpu": [ "arm64" ], @@ -1466,9 +1460,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.1.tgz", - "integrity": "sha512-dO0BIz/+5ZdkLZrVgQrDdW7m2RkrLwYTh2YMFG9IpBtlC1x1NPNSXkfczhZieOlOLEqgXOFH3wYHB7PmBtf+Bg==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.2.tgz", + "integrity": "sha512-ZbRaUvw2iN/y37x6dY50D8m2BnDbBjlnMPotDi/qITMJ4sIxNY33HArjikDyakhSv0+ybdUxhWxE6kTI4oX26w==", "cpu": [ "x64" ], @@ -1480,9 +1474,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.1.tgz", - "integrity": "sha512-sWWgdQ1fq+XKrlda8PsMCfut8caFwZBmhYeoehJ05FdI0YZXk6ZyUjWLrIgbR/VgiGycrFKMMgp7eJ69HOF2pQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.2.tgz", + "integrity": "sha512-ztRJJMiE8nnU1YFcdbd9BcH6bGWG1z+jP+IPW2oDUAPxPjo9dverIOyXz76m6IPA6udEL12reYeLojzW2cYL7w==", "cpu": [ "arm" ], @@ -1494,9 +1488,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.1.tgz", - "integrity": "sha512-9OIiSuj5EsYQlmwhmFRA0LRO0dRRjdCVZA3hnmZe1rEwRk11Jy3ECGGq3a7RrVEZ0/pCsYWx8jG3IvcrJ6RCew==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.2.tgz", + "integrity": "sha512-flOcGHDZajGKYpLV0JNc0VFH361M7rnV1ee+NTeC/BQQ1/0pllYcFmxpagltANYt8FYf9+kL6RSk80Ziwyhr7w==", "cpu": [ "arm" ], @@ -1508,9 +1502,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.1.tgz", - "integrity": "sha512-0kuAkRK4MeIUbzQYu63NrJmfoUVicajoRAL1bpwdYIYRcs57iyIV9NLcuyDyDXE2GiZCL4uhKSYAnyWpjZkWow==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.2.tgz", + "integrity": "sha512-69CF19Kp3TdMopyteO/LJbWufOzqqXzkrv4L2sP8kfMaAQ6iwky7NoXTp7bD6/irKgknDKM0P9E/1l5XxVQAhw==", "cpu": [ "arm64" ], @@ -1522,9 +1516,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.1.tgz", - "integrity": "sha512-/6dYC9fZtfEY0vozpc5bx1RP4VrtEOhNQGb0HwvYNwXD1BBbwQ5cKIbUVVU7G2d5WRE90NfB922elN8ASXAJEA==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.2.tgz", + "integrity": "sha512-48pD/fJkTiHAZTnZwR0VzHrao70/4MlzJrq0ZsILjLW/Ab/1XlVUStYyGt7tdyIiVSlGZbnliqmult/QGA2O2w==", "cpu": [ "arm64" ], @@ -1536,9 +1530,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.1.tgz", - "integrity": "sha512-ltUWy+sHeAh3YZ91NUsV4Xg3uBXAlscQe8ZOXRCVAKLsivGuJsrkawYPUEyCV3DYa9urgJugMLn8Z3Z/6CeyRQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.2.tgz", + "integrity": "sha512-cZdyuInj0ofc7mAQpKcPR2a2iu4YM4FQfuUzCVA2u4HI95lCwzjoPtdWjdpDKyHxI0UO82bLDoOaLfpZ/wviyQ==", "cpu": [ "ppc64" ], @@ -1550,9 +1544,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.1.tgz", - "integrity": "sha512-BggMndzI7Tlv4/abrgLwa/dxNEMn2gC61DCLrTzw8LkpSKel4o+O+gtjbnkevZ18SKkeN3ihRGPuBxjaetWzWg==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.2.tgz", + "integrity": "sha512-RL56JMT6NwQ0lXIQmMIWr1SW28z4E4pOhRRNqwWZeXpRlykRIlEpSWdsgNWJbYBEWD84eocjSGDu/XxbYeCmwg==", "cpu": [ "riscv64" ], @@ -1564,9 +1558,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.1.tgz", - "integrity": "sha512-z/9rtlGd/OMv+gb1mNSjElasMf9yXusAxnRDrBaYB+eS1shFm6/4/xDH1SAISO5729fFKUkJ88TkGPRUh8WSAA==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.2.tgz", + "integrity": "sha512-PMxkrWS9z38bCr3rWvDFVGD6sFeZJw4iQlhrup7ReGmfn7Oukrr/zweLhYX6v2/8J6Cep9IEA/SmjXjCmSbrMQ==", "cpu": [ "s390x" ], @@ -1578,9 +1572,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.1.tgz", - "integrity": "sha512-kXQVcWqDcDKw0S2E0TmhlTLlUgAmMVqPrJZR+KpH/1ZaZhLSl23GZpQVmawBQGVhyP5WXIsIQ/zqbDBBYmxm5w==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.2.tgz", + "integrity": "sha512-B90tYAUoLhU22olrafY3JQCFLnT3NglazdwkHyxNDYF/zAxJt5fJUB/yBoWFoIQ7SQj+KLe3iL4BhOMa9fzgpw==", "cpu": [ "x64" ], @@ -1592,9 +1586,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.1.tgz", - "integrity": "sha512-CbFv/WMQsSdl+bpX6rVbzR4kAjSSBuDgCqb1l4J68UYsQNalz5wOqLGYj4ZI0thGpyX5kc+LLZ9CL+kpqDovZA==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.2.tgz", + "integrity": "sha512-7twFizNXudESmC9oneLGIUmoHiiLppz/Xs5uJQ4ShvE6234K0VB1/aJYU3f/4g7PhssLGKBVCC37uRkkOi8wjg==", "cpu": [ "x64" ], @@ -1606,9 +1600,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.1.tgz", - "integrity": "sha512-3Q3brDgA86gHXWHklrwdREKIrIbxC0ZgU8lwpj0eEKGBQH+31uPqr0P2v11pn0tSIxHvcdOWxa4j+YvLNx1i6g==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.2.tgz", + "integrity": "sha512-9rRero0E7qTeYf6+rFh3AErTNU1VCQg2mn7CQcI44vNUWM9Ze7MSRS/9RFuSsox+vstRt97+x3sOhEey024FRQ==", "cpu": [ "arm64" ], @@ -1620,9 +1614,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.1.tgz", - "integrity": "sha512-tNg+jJcKR3Uwe4L0/wY3Ro0H+u3nrb04+tcq1GSYzBEmKLeOQF2emk1whxlzNqb6MMrQ2JOcQEpuuiPLyRcSIw==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.2.tgz", + "integrity": "sha512-5rA4vjlqgrpbFVVHX3qkrCo/fZTj1q0Xxpg+Z7yIo3J2AilW7t2+n6Q8Jrx+4MrYpAnjttTYF8rr7bP46BPzRw==", "cpu": [ "ia32" ], @@ -1634,9 +1628,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.1.tgz", - "integrity": "sha512-xGiIH95H1zU7naUyTKEyOA/I0aexNMUdO9qRv0bLKN3qu25bBdrxZHqA3PTJ24YNN/GdMzG4xkDcd/GvjuhfLg==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.2.tgz", + "integrity": "sha512-6UUxd0+SKomjdzuAcp+HAmxw1FlGBnl1v2yEPSabtx4lBfdXHDVsW7+lQkgz9cNFJGY3AWR7+V8P5BqkD9L9nA==", "cpu": [ "x64" ], @@ -1878,9 +1872,9 @@ } }, "node_modules/@types/node": { - "version": "22.5.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.1.tgz", - "integrity": "sha512-KkHsxej0j9IW1KKOOAA/XBA0z08UFSrRQHErzEfA3Vgq57eXIMYboIlHJuYIfd+lwCQjtKqUu3UnmKbtUc9yRw==", + "version": "22.5.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.2.tgz", + "integrity": "sha512-acJsPTEqYqulZS/Yp/S3GgeE6GZ0qYODUR8aVr/DkhHQ8l9nd4j5x1/ZJy9/gHrRlFMqkO6i0I3E27Alu4jjPg==", "dev": true, "license": "MIT", "dependencies": { @@ -1902,9 +1896,9 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "18.3.4", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.4.tgz", - "integrity": "sha512-J7W30FTdfCxDDjmfRM+/JqLHBIyl7xUIp9kwK637FGmY7+mkSFSe6L4jpZzhj5QMfLssSDP4/i75AKkrdC7/Jw==", + "version": "18.3.5", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.5.tgz", + "integrity": "sha512-WeqMfGJLGuLCqHGYRGHxnKrXcTitc6L/nBUWfWPcTarG3t9PsquqUMuVeXZeca+mglY4Vo5GZjCi0A3Or2lnxA==", "dev": true, "license": "MIT", "dependencies": { @@ -2390,9 +2384,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001653", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001653.tgz", - "integrity": "sha512-XGWQVB8wFQ2+9NZwZ10GxTYC5hk0Fa+q8cSkr0tgvMhYhMHP/QC+WTgrePMDBWiWc/pV+1ik82Al20XOK25Gcw==", + "version": "1.0.30001655", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001655.tgz", + "integrity": "sha512-jRGVy3iSGO5Uutn2owlb5gR6qsGngTw9ZTb4ali9f3glshcNmJ2noam4Mo9zia5P9Dk3jNNydy7vQjuE5dQmfg==", "dev": true, "funding": [ { @@ -3725,9 +3719,9 @@ } }, "node_modules/postcss": { - "version": "8.4.41", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz", - "integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==", + "version": "8.4.43", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.43.tgz", + "integrity": "sha512-gJAQVYbh5R3gYm33FijzCZj7CHyQ3hWMgJMprLUlIYqCwTeZhBQ19wp0e9mA25BUbEvY5+EXuuaAjqQsrBxQBQ==", "dev": true, "funding": [ { @@ -3897,9 +3891,9 @@ } }, "node_modules/rollup": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.1.tgz", - "integrity": "sha512-ZnYyKvscThhgd3M5+Qt3pmhO4jIRR5RGzaSovB6Q7rGNrK5cUncrtLmcTTJVSdcKXyZjW8X8MB0JMSuH9bcAJg==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.2.tgz", + "integrity": "sha512-e3TapAgYf9xjdLvKQCkQTnbTKd4a6jwlpQSJJFokHGaX2IVjoEqkIIhiQfqsi0cdwlOD+tQGuOd5AJkc5RngBw==", "dev": true, "license": "MIT", "dependencies": { @@ -3913,22 +3907,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.21.1", - "@rollup/rollup-android-arm64": "4.21.1", - "@rollup/rollup-darwin-arm64": "4.21.1", - "@rollup/rollup-darwin-x64": "4.21.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.21.1", - "@rollup/rollup-linux-arm-musleabihf": "4.21.1", - "@rollup/rollup-linux-arm64-gnu": "4.21.1", - "@rollup/rollup-linux-arm64-musl": "4.21.1", - "@rollup/rollup-linux-powerpc64le-gnu": "4.21.1", - "@rollup/rollup-linux-riscv64-gnu": "4.21.1", - "@rollup/rollup-linux-s390x-gnu": "4.21.1", - "@rollup/rollup-linux-x64-gnu": "4.21.1", - "@rollup/rollup-linux-x64-musl": "4.21.1", - "@rollup/rollup-win32-arm64-msvc": "4.21.1", - "@rollup/rollup-win32-ia32-msvc": "4.21.1", - "@rollup/rollup-win32-x64-msvc": "4.21.1", + "@rollup/rollup-android-arm-eabi": "4.21.2", + "@rollup/rollup-android-arm64": "4.21.2", + "@rollup/rollup-darwin-arm64": "4.21.2", + "@rollup/rollup-darwin-x64": "4.21.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.21.2", + "@rollup/rollup-linux-arm-musleabihf": "4.21.2", + "@rollup/rollup-linux-arm64-gnu": "4.21.2", + "@rollup/rollup-linux-arm64-musl": "4.21.2", + "@rollup/rollup-linux-powerpc64le-gnu": "4.21.2", + "@rollup/rollup-linux-riscv64-gnu": "4.21.2", + "@rollup/rollup-linux-s390x-gnu": "4.21.2", + "@rollup/rollup-linux-x64-gnu": "4.21.2", + "@rollup/rollup-linux-x64-musl": "4.21.2", + "@rollup/rollup-win32-arm64-msvc": "4.21.2", + "@rollup/rollup-win32-ia32-msvc": "4.21.2", + "@rollup/rollup-win32-x64-msvc": "4.21.2", "fsevents": "~2.3.2" } }, @@ -4275,9 +4269,9 @@ } }, "node_modules/tsconfck": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.1.tgz", - "integrity": "sha512-00eoI6WY57SvZEVjm13stEVE90VkEdJAFGgpFLTsZbJyW/LwFQ7uQxJHWpZ2hzSWgCPKc9AnBnNP+0X7o3hAmQ==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.3.tgz", + "integrity": "sha512-ulNZP1SVpRDesxeMLON/LtWM8HIgAJEIVpVVhBM6gsmvQ8+Rh+ZG7FWGvHh7Ah3pRABwVJWklWCr/BTZSv0xnQ==", "dev": true, "license": "MIT", "bin": { @@ -4501,9 +4495,9 @@ } }, "node_modules/vite-plugin-dts": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-4.0.3.tgz", - "integrity": "sha512-+xnTsaONwU2kV6zhRjtbRJSGN41uFR/whqmcb4k4fftLFDJElxthp0PP5Fq8gMeM9ytWMt1yk5gGgekLREWYQQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-4.1.0.tgz", + "integrity": "sha512-sRlmt9k2q8MrX4F2058N3KmB6WyJ3Ao6QaExOv1X99F3j0GhPziEz1zscWQ1q2r1PeFc96L7GIUu8Pl2DPr2Hg==", "dev": true, "license": "MIT", "dependencies": { @@ -4795,25 +4789,25 @@ }, "packages/extension-tei": { "name": "@recogito/text-annotator-tei", - "version": "3.0.0-rc.41", + "version": "3.0.0-rc.44", "license": "BSD-3-Clause", "devDependencies": { "CETEIcean": "^1.9.3", "typescript": "5.5.4", "vite": "^5.4.2", - "vite-plugin-dts": "^4.0.3" + "vite-plugin-dts": "^4.1.0" }, "peerDependencies": { - "@annotorious/core": "^3.0.0", - "@recogito/text-annotator": "3.0.0-rc.41" + "@annotorious/core": "^3.0.2", + "@recogito/text-annotator": "3.0.0-rc.44" } }, "packages/text-annotator": { "name": "@recogito/text-annotator", - "version": "3.0.0-rc.41", + "version": "3.0.0-rc.44", "license": "BSD-3-Clause", "dependencies": { - "@annotorious/core": "^3.0.0", + "@annotorious/core": "^3.0.2", "colord": "^2.9.3", "debounce": "^2.1.0", "dequal": "^2.0.3", @@ -4828,20 +4822,20 @@ "svelte": "^4.2.19", "typescript": "5.5.4", "vite": "^5.4.2", - "vite-plugin-dts": "^4.0.3", + "vite-plugin-dts": "^4.1.0", "vitest": "^2.0.5" } }, "packages/text-annotator-react": { "name": "@recogito/react-text-annotator", - "version": "3.0.0-rc.41", + "version": "3.0.0-rc.44", "license": "BSD-3-Clause", "dependencies": { - "@annotorious/core": "^3.0.0", - "@annotorious/react": "^3.0.0", + "@annotorious/core": "^3.0.2", + "@annotorious/react": "^3.0.2", "@floating-ui/react": "^0.26.23", - "@recogito/text-annotator": "3.0.0-rc.41", - "@recogito/text-annotator-tei": "3.0.0-rc.41", + "@recogito/text-annotator": "3.0.0-rc.44", + "@recogito/text-annotator-tei": "3.0.0-rc.44", "CETEIcean": "^1.9.3" }, "devDependencies": { @@ -4851,7 +4845,7 @@ "react-dom": "^18.3.1", "typescript": "5.5.4", "vite": "^5.4.2", - "vite-plugin-dts": "^4.0.3", + "vite-plugin-dts": "^4.1.0", "vite-tsconfig-paths": "^5.0.1" }, "peerDependencies": { diff --git a/package.json b/package.json index 1f2562f7..a5867b69 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@recogito/text-annotator-monorepo", - "version": "3.0.0-rc.41", + "version": "3.0.0-rc.44", "description": "Recogito Text Annotator monorepo", "author": "Rainer Simon", "repository": { diff --git a/packages/extension-tei/package.json b/packages/extension-tei/package.json index 084a2a9e..8a266a47 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.41", + "version": "3.0.0-rc.44", "description": "Recogito Text Annotator TEI extension", "author": "Rainer Simon", "license": "BSD-3-Clause", @@ -29,10 +29,10 @@ "CETEIcean": "^1.9.3", "typescript": "5.5.4", "vite": "^5.4.2", - "vite-plugin-dts": "^4.0.3" + "vite-plugin-dts": "^4.1.0" }, "peerDependencies": { - "@annotorious/core": "^3.0.0", - "@recogito/text-annotator": "3.0.0-rc.41" + "@annotorious/core": "^3.0.2", + "@recogito/text-annotator": "3.0.0-rc.44" } } \ No newline at end of file diff --git a/packages/text-annotator-react/package.json b/packages/text-annotator-react/package.json index 585f81f4..0312a715 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.41", + "version": "3.0.0-rc.44", "description": "Recogito Text Annotator React bindings", "author": "Rainer Simon", "license": "BSD-3-Clause", @@ -30,7 +30,7 @@ "react-dom": "^18.3.1", "typescript": "5.5.4", "vite": "^5.4.2", - "vite-plugin-dts": "^4.0.3", + "vite-plugin-dts": "^4.1.0", "vite-tsconfig-paths": "^5.0.1" }, "peerDependencies": { @@ -44,11 +44,11 @@ } }, "dependencies": { - "@annotorious/core": "^3.0.0", - "@annotorious/react": "^3.0.0", + "@annotorious/core": "^3.0.2", + "@annotorious/react": "^3.0.2", "@floating-ui/react": "^0.26.23", - "@recogito/text-annotator": "3.0.0-rc.41", - "@recogito/text-annotator-tei": "3.0.0-rc.41", + "@recogito/text-annotator": "3.0.0-rc.44", + "@recogito/text-annotator-tei": "3.0.0-rc.44", "CETEIcean": "^1.9.3" } } \ No newline at end of file diff --git a/packages/text-annotator-react/src/TextAnnotatorPopup.tsx b/packages/text-annotator-react/src/TextAnnotatorPopup.tsx index 6d5d9470..e93d67eb 100644 --- a/packages/text-annotator-react/src/TextAnnotatorPopup.tsx +++ b/packages/text-annotator-react/src/TextAnnotatorPopup.tsx @@ -15,13 +15,17 @@ import { interface TextAnnotationPopupProps { - popup(props: TextAnnotatorPopupProps): ReactNode; + popup(props: TextAnnotationPopupContentProps): ReactNode; } -export interface TextAnnotatorPopupProps { +interface TextAnnotationPopupContentProps { - selected: { annotation: TextAnnotation, editable?: boolean }[]; + annotation: TextAnnotation; + + editable?: boolean; + + event?: PointerEvent; } @@ -110,7 +114,11 @@ export const TextAnnotatorPopup = (props: TextAnnotationPopupProps) => { style={floatingStyles} {...getFloatingProps()} {...getStopEventsPropagationProps()}> - {props.popup({ selected })} + {props.popup({ + annotation: selected[0].annotation, + editable: selected[0].editable, + event + })} ) : null; diff --git a/packages/text-annotator/package.json b/packages/text-annotator/package.json index db49876c..877c0137 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.41", + "version": "3.0.0-rc.44", "description": "A JavaScript text annotation library", "author": "Rainer Simon", "license": "BSD-3-Clause", @@ -33,11 +33,11 @@ "svelte": "^4.2.19", "typescript": "5.5.4", "vite": "^5.4.2", - "vite-plugin-dts": "^4.0.3", + "vite-plugin-dts": "^4.1.0", "vitest": "^2.0.5" }, "dependencies": { - "@annotorious/core": "^3.0.0", + "@annotorious/core": "^3.0.2", "colord": "^2.9.3", "debounce": "^2.1.0", "dequal": "^2.0.3", diff --git a/packages/text-annotator/src/SelectionHandler.ts b/packages/text-annotator/src/SelectionHandler.ts index d1e3714c..b1f6be73 100644 --- a/packages/text-annotator/src/SelectionHandler.ts +++ b/packages/text-annotator/src/SelectionHandler.ts @@ -68,8 +68,6 @@ export const createSelectionHandler = ( } } - container.addEventListener('selectstart', onSelectStart); - const onSelectionChange = debounce((evt: PointerEvent) => { if (!currentAnnotatingEnabled) return; @@ -130,8 +128,6 @@ export const createSelectionHandler = ( } }); - document.addEventListener('selectionchange', onSelectionChange); - // Select events don't carry information about the mouse button // Therefore, to prevent right-click selection, we need to listen // to the initial pointerdown event and remember the button @@ -143,8 +139,6 @@ export const createSelectionHandler = ( isLeftClick = evt.button === 0; } - document.addEventListener('pointerdown', onPointerDown); - const onPointerUp = (evt: PointerEvent) => { const annotatable = !(evt.target as Node).parentElement?.closest(NOT_ANNOTATABLE_SELECTOR); if (!annotatable || !isLeftClick) @@ -180,19 +174,24 @@ export const createSelectionHandler = ( } } + container.addEventListener('pointerdown', onPointerDown); document.addEventListener('pointerup', onPointerUp); + container.addEventListener('selectstart', onSelectStart); + document.addEventListener('selectionchange', onSelectionChange); + const destroy = () => { currentTarget = undefined; lastPointerDown = undefined; onSelectionChange.clear(); + container.removeEventListener('pointerdown', onPointerDown); + document.removeEventListener('pointerup', onPointerUp); + container.removeEventListener('selectstart', onSelectStart); document.removeEventListener('selectionchange', onSelectionChange); - document.removeEventListener('pointerdown', onPointerDown); - document.removeEventListener('pointerup', onPointerUp); } return { diff --git a/packages/text-annotator/src/highlight/baseRenderer.ts b/packages/text-annotator/src/highlight/baseRenderer.ts index 976460ec..0afa5e50 100644 --- a/packages/text-annotator/src/highlight/baseRenderer.ts +++ b/packages/text-annotator/src/highlight/baseRenderer.ts @@ -45,9 +45,9 @@ export interface Renderer { } -export const createBaseRenderer = ( +export const createBaseRenderer = ( container: HTMLElement, - state: TextAnnotatorState, + state: T, viewport: ViewportState, renderer: RendererImplementation ): Renderer => { diff --git a/packages/text-annotator/src/highlight/span/spansRenderer.ts b/packages/text-annotator/src/highlight/span/spansRenderer.ts index 47dd7f13..eb9d052b 100644 --- a/packages/text-annotator/src/highlight/span/spansRenderer.ts +++ b/packages/text-annotator/src/highlight/span/spansRenderer.ts @@ -114,8 +114,8 @@ const createRenderer = (container: HTMLElement): RendererImplementation => { } -export const createSpansRenderer = ( +export const createSpansRenderer = ( container: HTMLElement, - state: TextAnnotatorState, + state: T, viewport: ViewportState ) => createBaseRenderer(container, state, viewport, createRenderer(container)); diff --git a/packages/text-annotator/src/index.ts b/packages/text-annotator/src/index.ts index 4ca291f0..8cfb3b69 100644 --- a/packages/text-annotator/src/index.ts +++ b/packages/text-annotator/src/index.ts @@ -3,6 +3,7 @@ export * from './model'; export * from './state'; export * from './utils'; export * from './presence/PresencePainterOptions'; +export * from './SelectionHandler'; export * from './TextAnnotator'; export * from './TextAnnotatorOptions'; @@ -25,6 +26,7 @@ export type { ParseResult, User, UserSelectActionExpression, + ViewportState, W3CAnnotation, W3CAnnotationBody, W3CAnnotationTarget diff --git a/packages/text-annotator/src/state/TextAnnotationStore.ts b/packages/text-annotator/src/state/TextAnnotationStore.ts index c8c643db..e64fb0f2 100644 --- a/packages/text-annotator/src/state/TextAnnotationStore.ts +++ b/packages/text-annotator/src/state/TextAnnotationStore.ts @@ -1,29 +1,31 @@ import type { Filter, Origin, Store } from '@annotorious/core'; import type { TextAnnotation } from '../model'; -export interface TextAnnotationStore extends Omit, 'addAnnotation' | 'bulkAddAnnotation'> { +export interface TextAnnotationStore extends Omit, 'addAnnotation' | 'bulkAddAnnotation'> { // Minor changes to default Annotorious store - text store returns feedback // on annotations that failed to render, to support lazy document loading scenarios - addAnnotation(annotation: TextAnnotation, origin?: Origin): boolean; + addAnnotation(annotation: T, origin?: Origin): boolean; - bulkAddAnnotation(annotations: TextAnnotation[], replace: boolean, origin?: Origin): TextAnnotation[]; + bulkAddAnnotation(annotations: T[], replace: boolean, origin?: Origin): T[]; - bulkUpsertAnnotations(annotations: TextAnnotation[], origin?: Origin): TextAnnotation[]; + bulkUpsertAnnotations(annotations: T[], origin?: Origin): T[]; getAnnotationBounds(id: string, hintX?: number, hintY?: number, buffer?: number): DOMRect; + getAnnotationRects(id: string): DOMRect[]; + getAt(x: number, y: number, filter?: Filter): TextAnnotation | undefined; - getIntersecting(minX: number, minY: number, maxX: number, maxY: number): AnnotationRects[]; + getIntersecting(minX: number, minY: number, maxX: number, maxY: number): AnnotationRects[]; recalculatePositions(): void; } -export interface AnnotationRects { +export interface AnnotationRects { - annotation: TextAnnotation; + annotation: T; rects: Rect[]; diff --git a/packages/text-annotator/src/state/TextAnnotatorState.ts b/packages/text-annotator/src/state/TextAnnotatorState.ts index c1e044f0..e2a889a2 100644 --- a/packages/text-annotator/src/state/TextAnnotatorState.ts +++ b/packages/text-annotator/src/state/TextAnnotatorState.ts @@ -14,9 +14,9 @@ import type { TextAnnotation, TextAnnotationTarget } from '../model'; import type { TextAnnotationStore } from './TextAnnotationStore'; import { isRevived, reviveAnnotation, reviveTarget } from '../utils'; -export interface TextAnnotatorState extends AnnotatorState { +export interface TextAnnotatorState extends AnnotatorState { - store: TextAnnotationStore; + store: TextAnnotationStore; selection: SelectionState; @@ -130,6 +130,8 @@ export const createTextAnnotatorState = ( return tree.getAnnotationBounds(id); } + const getAnnotationRects = (id: string): DOMRect[] => tree.getAnnotationRects(id); + const recalculatePositions = () => tree.recalculate(); store.observe(({ changes }) => { @@ -155,6 +157,7 @@ export const createTextAnnotatorState = ( bulkUpdateTargets, bulkUpsertAnnotations, getAnnotationBounds, + getAnnotationRects, getAt, getIntersecting: tree.getIntersecting, recalculatePositions, diff --git a/packages/text-annotator/src/state/spatialTree.ts b/packages/text-annotator/src/state/spatialTree.ts index 675ffe76..9260c3e9 100644 --- a/packages/text-annotator/src/state/spatialTree.ts +++ b/packages/text-annotator/src/state/spatialTree.ts @@ -76,7 +76,6 @@ export const createSpatialTree = (store: Store, container: HTMLE const insert = (target: TextAnnotationTarget) => { const rects = toItems(target, container.getBoundingClientRect()); - rects.forEach(rect => tree.insert(rect)); index.set(target.annotation, rects); } diff --git a/packages/text-annotator/src/utils/mergeClientRects.ts b/packages/text-annotator/src/utils/mergeClientRects.ts index e106fb30..cd7bed62 100644 --- a/packages/text-annotator/src/utils/mergeClientRects.ts +++ b/packages/text-annotator/src/utils/mergeClientRects.ts @@ -103,3 +103,54 @@ export const mergeClientRects = (rects: DOMRect[]) => rects.reduce((merged, rect return wasMerged ? next : [ ...next, rectA ]; }, [] as DOMRect[]); + +/* Pixels that rects can be apart vertically while still +// being considered to be on the same line. +const TOLERANCE = 3; + +export const mergeClientRects = (rects: DOMRect[]) => { + const lines: DOMRect[][] = []; + + // Sort rects from the top, to make grouping simpler + rects.sort((a, b) => a.top - b.top); + + // Group rects into lines + for (const rect of rects) { + if (lines.length === 0 || Math.abs(rect.top - lines[lines.length - 1][0].top) > TOLERANCE) { + // Start a new line + lines.push([rect]); + } else { + lines[lines.length - 1].push(rect); + } + } + + // Merge lines + const mergedRects = lines.map(line => { + const top = Math.min(...line.map(r => r.top)); + const bottom = Math.max(...line.map(r => r.bottom)); + const left = Math.min(...line.map(r => r.left)); + const right = Math.max(...line.map(r => r.right)); + + return { + top: top, + bottom: bottom, + left: left, + right: right, + height: bottom - top, + width: right - left + } as DOMRect; + }).filter(r => r.height > 0 && r.width > 0); + + // Checks if the given rect contains any other rects + const containsOthers = (rect: DOMRect) => mergedRects.some(other => + other !== rect && + other.left >= rect.left && + other.right <= rect.right && + other.top >= rect.top && + other.bottom <= rect.bottom + ); + + // Remove all rects that contain other rects (block-level elements!) + return mergedRects.filter(rect => !containsOthers(rect)); +} +*/