diff --git a/demos/simple/demo.js b/demos/simple/demo.js index 2693990..63e3e72 100644 --- a/demos/simple/demo.js +++ b/demos/simple/demo.js @@ -123,6 +123,14 @@ function main() { trackManager.addPOI(event.coordinate); }); }); + + document.querySelector('#createNewPart').addEventListener('click', () => { + trackManager.createNewPart(); + }); + document.querySelector('#changeActivePart').addEventListener('click', () => { + const nextPart = (trackManager.activePart() + 1) % trackManager.partsCount(); + trackManager.workOnPart(nextPart); + }); } main(); diff --git a/demos/simple/simple.html b/demos/simple/simple.html index 13aeb49..2b5e2ba 100644 --- a/demos/simple/simple.html +++ b/demos/simple/simple.html @@ -51,7 +51,11 @@ reverse
Add poi - +
+ Add a new line string +
+ Change active line string +
diff --git a/demos/simple/style.js b/demos/simple/style.js index 5729a70..fbada9f 100644 --- a/demos/simple/style.js +++ b/demos/simple/style.js @@ -12,6 +12,8 @@ export const sketchControlPoint = { export const trackLine = { "stroke-width": 6, "stroke-color": "purple", + "text-value": ["concat", "", ["get", "part"]], + "text-fill-color": "#fff", }; export const trackLineModifying = { @@ -27,7 +29,7 @@ export const poiPoint = { "text-font": "bold 11px Inter", "text-fill-color": "#000", // use 'concat' to convert number to string - "text-value": ["concat", ["get", "index"], ""], + "text-value": ["concat", "", ["get", "part"]], }; export const numberedControlPoint = { @@ -35,7 +37,7 @@ export const numberedControlPoint = { "circle-fill-color": "#ffffffdd", "text-color": "blue", // use 'concat' to convert number to string - "text-value": ["concat", ["get", "index"], ""], + "text-value": ["concat", "", ["get", "part"]], }; export const snappedTrue = { diff --git a/package-lock.json b/package-lock.json index fd609cf..c7d9d8f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@geoblocks/edittrack", - "version": "1.3.17", + "version": "2.0.0-beta.15", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@geoblocks/edittrack", - "version": "1.3.17", + "version": "2.0.0-beta.15", "license": "BSD-3-Clause", "devDependencies": { "@geoblocks/elevation-profile": "0.0.20", @@ -419,62 +419,6 @@ "@lit-labs/ssr-dom-shim": "^1.2.0" } }, - "node_modules/@lmdb/lmdb-darwin-arm64": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/@lmdb/lmdb-darwin-arm64/-/lmdb-darwin-arm64-2.8.5.tgz", - "integrity": "sha512-KPDeVScZgA1oq0CiPBcOa3kHIqU+pTOwRFDIhxvmf8CTNvqdZQYp5cCKW0bUk69VygB2PuTiINFWbY78aR2pQw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@lmdb/lmdb-darwin-x64": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/@lmdb/lmdb-darwin-x64/-/lmdb-darwin-x64-2.8.5.tgz", - "integrity": "sha512-w/sLhN4T7MW1nB3R/U8WK5BgQLz904wh+/SmA2jD8NnF7BLLoUgflCNxOeSPOWp8geP6nP/+VjWzZVip7rZ1ug==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@lmdb/lmdb-linux-arm": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/@lmdb/lmdb-linux-arm/-/lmdb-linux-arm-2.8.5.tgz", - "integrity": "sha512-c0TGMbm2M55pwTDIfkDLB6BpIsgxV4PjYck2HiOX+cy/JWiBXz32lYbarPqejKs9Flm7YVAKSILUducU9g2RVg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@lmdb/lmdb-linux-arm64": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/@lmdb/lmdb-linux-arm64/-/lmdb-linux-arm64-2.8.5.tgz", - "integrity": "sha512-vtbZRHH5UDlL01TT5jB576Zox3+hdyogvpcbvVJlmU5PdL3c5V7cj1EODdh1CHPksRl+cws/58ugEHi8bcj4Ww==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, "node_modules/@lmdb/lmdb-linux-x64": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/@lmdb/lmdb-linux-x64/-/lmdb-linux-x64-2.8.5.tgz", @@ -489,20 +433,6 @@ "linux" ] }, - "node_modules/@lmdb/lmdb-win32-x64": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/@lmdb/lmdb-win32-x64/-/lmdb-win32-x64-2.8.5.tgz", - "integrity": "sha512-4wvrf5BgnR8RpogHhtpCPJMKBmvyZPhhUtEwMJbXh0ni2BucpfF07jlmyM11zRqQ2XIq6PbC2j7W7UCCcm1rRQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, "node_modules/@mischnic/json-sourcemap": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@mischnic/json-sourcemap/-/json-sourcemap-0.1.1.tgz", @@ -518,62 +448,6 @@ "node": ">=12.0.0" } }, - "node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.3.tgz", - "integrity": "sha512-QZHtlVgbAdy2zAqNA9Gu1UpIuI8Xvsd1v8ic6B2pZmeFnFcMWiPLfWXh7TVw4eGEZ/C9TH281KwhVoeQUKbyjw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.3.tgz", - "integrity": "sha512-mdzd3AVzYKuUmiWOQ8GNhl64/IoFGol569zNRdkLReh6LRLHOXxU4U8eq0JwaD8iFHdVGqSy4IjFL4reoWCDFw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.3.tgz", - "integrity": "sha512-fg0uy/dG/nZEXfYilKoRe7yALaNmHoYeIoJuJ7KJ+YyU2bvY8vPv27f7UKhGRpY6euFYqEVhxCFZgAUNQBM3nw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm64": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.3.tgz", - "integrity": "sha512-YxQL+ax0XqBJDZiKimS2XQaf+2wDGVa1enVRGzEvLLVFeqa5kx2bWbtcSXgsxjQB7nRqqIGFIcLteF/sHeVtQg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, "node_modules/@msgpackr-extract/msgpackr-extract-linux-x64": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.3.tgz", @@ -588,20 +462,6 @@ "linux" ] }, - "node_modules/@msgpackr-extract/msgpackr-extract-win32-x64": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.3.tgz", - "integrity": "sha512-x0fWaQtYp4E6sktbsdAqnehxDgEc/VwM7uLsRCYWaiGu0ykYdZPiS8zCWdnjHwyiumousxfBm4SO31eXqwEZhQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1965,153 +1825,6 @@ "@parcel/watcher-win32-x64": "2.4.1" } }, - "node_modules/@parcel/watcher-android-arm64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.4.1.tgz", - "integrity": "sha512-LOi/WTbbh3aTn2RYddrO8pnapixAziFl6SMxHM69r3tvdSm94JtCenaKgk1GRg5FJ5wpMCpHeW+7yqPlvZv7kg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-darwin-arm64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.4.1.tgz", - "integrity": "sha512-ln41eihm5YXIY043vBrrHfn94SIBlqOWmoROhsMVTSXGh0QahKGy77tfEywQ7v3NywyxBBkGIfrWRHm0hsKtzA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-darwin-x64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.4.1.tgz", - "integrity": "sha512-yrw81BRLjjtHyDu7J61oPuSoeYWR3lDElcPGJyOvIXmor6DEo7/G2u1o7I38cwlcoBHQFULqF6nesIX3tsEXMg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-freebsd-x64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.4.1.tgz", - "integrity": "sha512-TJa3Pex/gX3CWIx/Co8k+ykNdDCLx+TuZj3f3h7eOjgpdKM+Mnix37RYsYU4LHhiYJz3DK5nFCCra81p6g050w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-arm-glibc": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.4.1.tgz", - "integrity": "sha512-4rVYDlsMEYfa537BRXxJ5UF4ddNwnr2/1O4MHM5PjI9cvV2qymvhwZSFgXqbS8YoTk5i/JR0L0JDs69BUn45YA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-arm64-glibc": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.4.1.tgz", - "integrity": "sha512-BJ7mH985OADVLpbrzCLgrJ3TOpiZggE9FMblfO65PlOCdG++xJpKUJ0Aol74ZUIYfb8WsRlUdgrZxKkz3zXWYA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-arm64-musl": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.4.1.tgz", - "integrity": "sha512-p4Xb7JGq3MLgAfYhslU2SjoV9G0kI0Xry0kuxeG/41UfpjHGOhv7UoUDAz/jb1u2elbhazy4rRBL8PegPJFBhA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, "node_modules/@parcel/watcher-linux-x64-glibc": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.4.1.tgz", @@ -2154,69 +1867,6 @@ "url": "https://opencollective.com/parcel" } }, - "node_modules/@parcel/watcher-win32-arm64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.4.1.tgz", - "integrity": "sha512-Uq2BPp5GWhrq/lcuItCHoqxjULU1QYEcyjSO5jqqOK8RNFDBQnenMMx4gAl3v8GiWa59E9+uDM7yZ6LxwUIfRg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-win32-ia32": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.4.1.tgz", - "integrity": "sha512-maNRit5QQV2kgHFSYwftmPBxiuK5u4DXjbXx7q6eKjq5dsLXZ4FJiVvlcw35QXzk0KrUecJmuVFbj4uV9oYrcw==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-win32-x64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.4.1.tgz", - "integrity": "sha512-+DvS92F9ezicfswqrvIRM2njcYJbd5mb9CUgtrHCHmvn7pPPa+nMDRu1o1bYYz/l5IB2NVGNJWiH7h1E58IF2A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, "node_modules/@parcel/workers": { "version": "2.12.0", "resolved": "https://registry.npmjs.org/@parcel/workers/-/workers-2.12.0.tgz", @@ -2250,27 +1900,19 @@ "license": "MIT" }, "node_modules/@shikijs/core": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.16.1.tgz", - "integrity": "sha512-aI0hBtw+a6KsJp2jcD4YuQqKpeCbURMZbhHVozDknJpm+KJqeMRkEnfBC8BaKE/5XC+uofPgCLsa/TkTk0Ba0w==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.14.1.tgz", + "integrity": "sha512-KyHIIpKNaT20FtFPFjCQB5WVSTpLR/n+jQXhWHWVUMm9MaOaG9BGOG0MSyt7yA4+Lm+4c9rTc03tt3nYzeYSfw==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/vscode-textmate": "^9.2.0", "@types/hast": "^3.0.4" } }, - "node_modules/@shikijs/vscode-textmate": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-9.2.0.tgz", - "integrity": "sha512-5FinaOp6Vdh/dl4/yaOTh0ZeKch+rYS8DUb38V3GMKYVkdqzxw53lViRKUYkVILRiVQT7dcPC7VvAKOR73zVtQ==", - "dev": true, - "license": "MIT" - }, "node_modules/@swc/core": { - "version": "1.7.22", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.7.22.tgz", - "integrity": "sha512-Asn79WKqyjEuO2VEeSnVjn2YiRMToRhFJwOsQeqftBvwWMn1FGUuzVcXtkQFBk37si8Gh2Vkk/+p0u4K5NxDig==", + "version": "1.7.18", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.7.18.tgz", + "integrity": "sha512-qL9v5N5S38ijmqiQRvCFUUx2vmxWT/JJ2rswElnyaHkOHuVoAFhBB90Ywj4RKjh3R0zOjhEcemENTyF3q3G6WQ==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", @@ -2286,16 +1928,16 @@ "url": "https://opencollective.com/swc" }, "optionalDependencies": { - "@swc/core-darwin-arm64": "1.7.22", - "@swc/core-darwin-x64": "1.7.22", - "@swc/core-linux-arm-gnueabihf": "1.7.22", - "@swc/core-linux-arm64-gnu": "1.7.22", - "@swc/core-linux-arm64-musl": "1.7.22", - "@swc/core-linux-x64-gnu": "1.7.22", - "@swc/core-linux-x64-musl": "1.7.22", - "@swc/core-win32-arm64-msvc": "1.7.22", - "@swc/core-win32-ia32-msvc": "1.7.22", - "@swc/core-win32-x64-msvc": "1.7.22" + "@swc/core-darwin-arm64": "1.7.18", + "@swc/core-darwin-x64": "1.7.18", + "@swc/core-linux-arm-gnueabihf": "1.7.18", + "@swc/core-linux-arm64-gnu": "1.7.18", + "@swc/core-linux-arm64-musl": "1.7.18", + "@swc/core-linux-x64-gnu": "1.7.18", + "@swc/core-linux-x64-musl": "1.7.18", + "@swc/core-win32-arm64-msvc": "1.7.18", + "@swc/core-win32-ia32-msvc": "1.7.18", + "@swc/core-win32-x64-msvc": "1.7.18" }, "peerDependencies": { "@swc/helpers": "*" @@ -2306,95 +1948,10 @@ } } }, - "node_modules/@swc/core-darwin-arm64": { - "version": "1.7.22", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.7.22.tgz", - "integrity": "sha512-B2Bh2W+C7ALdGwDxRWAJ+UtNExfozvwyayGiNkbR3wmDKXXeQfhGM5MK+QYUWKu7UQ6ATq69OyZrxofDobKUug==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0 AND MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-darwin-x64": { - "version": "1.7.22", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.7.22.tgz", - "integrity": "sha512-s34UQntnQ6tL9hS9aX3xG7OfGhpmy05FEEndbHaooGO8O+L5k8uWxhE5KhYCOC0N803sGdZg6YZmKtYrWN/YxA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0 AND MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.7.22", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.7.22.tgz", - "integrity": "sha512-SE69+oos1jLOXx5YdMH//Qc5zQc2xYukajB+0BWmkcFd/S/cCanGWYtdSzYausm8af2Fw1hPJMNIfndJLnBDFw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.7.22", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.7.22.tgz", - "integrity": "sha512-59FzDW/ojgiTj4dlnv3Z3ESuVlzhSAq9X12CNYh4/WTCNA8BoJqOnWMRQKspWtoNlnVviFLMvpek0pGXHndEBA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0 AND MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.7.22", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.7.22.tgz", - "integrity": "sha512-cMQMI8YRO/XR3OrYuiUlWksNsJOZSkA6gSLNyH6eHTw+FOAzv05oJ4SFYe6s1WesrOqRwhpez6y5H6OIP/EKzg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0 AND MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=10" - } - }, "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.7.22", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.7.22.tgz", - "integrity": "sha512-639kA7MXrWqWYfwuSJ+XTg21VYb/5o99R1zJrndoEjEX6m7Wza/sXssQKU5jbbkPoSEKVKNP3n/gazLWiUKgiQ==", + "version": "1.7.18", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.7.18.tgz", + "integrity": "sha512-x9SCqCLzwtlqtD5At3I1a7Gco+EuXnzrJGoucmkpeQohshHuwa+cskqsXO6u1Dz0jXJEuHbBZB9va1wYYfjgFg==", "cpu": [ "x64" ], @@ -2409,9 +1966,9 @@ } }, "node_modules/@swc/core-linux-x64-musl": { - "version": "1.7.22", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.7.22.tgz", - "integrity": "sha512-f3zfGgY8EJQUOk3ve25ZTkNkhB/kHo9QlN2r+0exaE1g9W7X8IS6J8pWzF3hJrV2P9dBi6ofMOt+opVA89JKHA==", + "version": "1.7.18", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.7.18.tgz", + "integrity": "sha512-qtj8iOpMMgKjzxTv+islmEY0JBsbd93nka0gzcTTmGZxKtL5jSUsYQvkxwNPZr5M9NU1fgaR3n1vE6lFmtY0IQ==", "cpu": [ "x64" ], @@ -2425,57 +1982,6 @@ "node": ">=10" } }, - "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.7.22", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.7.22.tgz", - "integrity": "sha512-p/Fav5U+LtTJD/tbbS0dKK8SVVAhXo5Jdm1TDeBPJ4BEIVguYBZEXgD3CW9wY4K34g1hscpiz2Q2rktfhFj1+A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0 AND MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.7.22", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.7.22.tgz", - "integrity": "sha512-HbmfasaCNTqeCTvDjleYj+jJZQ6MlraiVOdhW55KtbA9mAVQdPBq6DDAvR7VOero3wUNYUM/e36otFKgEJI5Rg==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "Apache-2.0 AND MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.7.22", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.7.22.tgz", - "integrity": "sha512-lppIveE+hpe7WXny/9cUT+T6sBM/ND0E+dviKWJ5jFBISj2KWomlSJGUjYEsRGJVPnTEc8uOlKK7etmXBhQx9A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0 AND MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=10" - } - }, "node_modules/@swc/counter": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", @@ -2545,8 +2051,7 @@ "version": "4.3.19", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.19.tgz", "integrity": "sha512-2hHHvQBVE2FiSK4eN0Br6snX9MtolHaTo/batnLjlGRhoQzlCL61iVpxoqO7SfFyOw+P/pwv+0zNHzKoGWz9Cw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@types/hast": { "version": "3.0.4", @@ -2566,9 +2071,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.5.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.2.tgz", - "integrity": "sha512-acJsPTEqYqulZS/Yp/S3GgeE6GZ0qYODUR8aVr/DkhHQ8l9nd4j5x1/ZJy9/gHrRlFMqkO6i0I3E27Alu4jjPg==", + "version": "22.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.0.tgz", + "integrity": "sha512-DkFrJOe+rfdHTqqMg0bSNlGlQ85hSoh2TPzZyhHsXnMtligRWpxUySiyw8FY14ITt24HVCiQPWxS3KO/QlGmWg==", "dev": true, "license": "MIT", "peer": true, @@ -2918,19 +2423,6 @@ "dev": true, "license": "Python-2.0" }, - "node_modules/array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-uniq": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", @@ -3082,9 +2574,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001655", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001655.tgz", - "integrity": "sha512-jRGVy3iSGO5Uutn2owlb5gR6qsGngTw9ZTb4ali9f3glshcNmJ2noam4Mo9zia5P9Dk3jNNydy7vQjuE5dQmfg==", + "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==", "dev": true, "funding": [ { @@ -3868,9 +3360,9 @@ } }, "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "dev": true, "license": "MIT", "engines": { @@ -4268,21 +3760,6 @@ "dev": true, "license": "ISC" }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/geotiff": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.1.3.tgz", @@ -4353,13 +3830,89 @@ "gh-pages-clean": "bin/gh-pages-clean.js" }, "engines": { - "node": ">=10" + "node": ">=10" + } + }, + "node_modules/gh-pages/node_modules/array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-uniq": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gh-pages/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/gh-pages/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/gh-pages/node_modules/globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha512-KVbFv2TQtbzCoxAnfD6JcHZTYCzyliEaaeM/gH8qQdkKr5s0OP9scEgvdcngyk7AVdY6YVW/TJHd+lQ/Df3Daw==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gh-pages/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", @@ -4367,12 +3920,11 @@ "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": "*" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -4391,28 +3943,17 @@ "node": ">=10.13.0" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=10" } }, "node_modules/globals": { @@ -4431,23 +3972,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globby": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", - "integrity": "sha512-KVbFv2TQtbzCoxAnfD6JcHZTYCzyliEaaeM/gH8qQdkKr5s0OP9scEgvdcngyk7AVdY6YVW/TJHd+lQ/Df3Daw==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-union": "^1.0.1", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -4860,132 +4384,6 @@ "lightningcss-win32-x64-msvc": "1.26.0" } }, - "node_modules/lightningcss-darwin-arm64": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.26.0.tgz", - "integrity": "sha512-n4TIvHO1NY1ondKFYpL2ZX0bcC2y6yjXMD6JfyizgR8BCFNEeArINDzEaeqlfX9bXz73Bpz/Ow0nu+1qiDrBKg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-darwin-x64": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.26.0.tgz", - "integrity": "sha512-Rf9HuHIDi1R6/zgBkJh25SiJHF+dm9axUZW/0UoYCW1/8HV0gMI0blARhH4z+REmWiU1yYT/KyNF3h7tHyRXUg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-freebsd-x64": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.26.0.tgz", - "integrity": "sha512-C/io7POAxp6sZxFSVGezjajMlCKQ8KSwISLLGRq8xLQpQMokYrUoqYEwmIX8mLmF6C/CZPk0gFmRSzd8biWM0g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm-gnueabihf": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.26.0.tgz", - "integrity": "sha512-Aag9kqXqkyPSW+dXMgyWk66C984Nay2pY8Nws+67gHlDzV3cWh7TvFlzuaTaVFMVqdDTzN484LSK3u39zFBnzg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm64-gnu": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.26.0.tgz", - "integrity": "sha512-iJmZM7fUyVjH+POtdiCtExG+67TtPUTer7K/5A8DIfmPfrmeGvzfRyBltGhQz13Wi15K1lf2cPYoRaRh6vcwNA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm64-musl": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.26.0.tgz", - "integrity": "sha512-XxoEL++tTkyuvu+wq/QS8bwyTXZv2y5XYCMcWL45b8XwkiS8eEEEej9BkMGSRwxa5J4K+LDeIhLrS23CpQyfig==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, "node_modules/lightningcss-linux-x64-gnu": { "version": "1.26.0", "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.26.0.tgz", @@ -5028,48 +4426,6 @@ "url": "https://opencollective.com/parcel" } }, - "node_modules/lightningcss-win32-arm64-msvc": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.26.0.tgz", - "integrity": "sha512-X/597/cFnCogy9VItj/+7Tgu5VLbAtDF7KZDPdSw0MaL6FL940th1y3HiOzFIlziVvAtbo0RB3NAae1Oofr+Tw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-win32-x64-msvc": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.26.0.tgz", - "integrity": "sha512-pYS3EyGP3JRhfqEFYmfFDiZ9/pVNfy8jVIYtrx9TVNusVyDK3gpW1w/rbvroQ4bDJi7grdUtyrYU6V2xkY/bBw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -5385,27 +4741,6 @@ "node": ">= 14.0.0" } }, - "node_modules/mocha/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/mocha/node_modules/minimatch": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", @@ -6221,6 +5556,52 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -6313,14 +5694,13 @@ } }, "node_modules/shiki": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.16.1.tgz", - "integrity": "sha512-tCJIMaxDVB1mEIJ5TvfZU7kCPB5eo9fli5+21Olc/bmyv+w8kye3JOp+LZRmGkAyT71hrkefQhTiY+o9mBikRQ==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.14.1.tgz", + "integrity": "sha512-FujAN40NEejeXdzPt+3sZ3F2dx1U24BY2XTY01+MG8mbxCiA2XukXdcbyMyLAHJ/1AUUnQd1tZlvIjefWWEJeA==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/core": "1.16.1", - "@shikijs/vscode-textmate": "^9.2.0", + "@shikijs/core": "1.14.1", "@types/hast": "^3.0.4" } }, diff --git a/package.json b/package.json index a8ac38a..671d80b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@geoblocks/edittrack", - "version": "1.3.17", + "version": "2.0.0-beta.15", "description": "Geoblocks edittrack", "scripts": { "eslint": "eslint src test demos", diff --git a/src/interaction/TrackData.ts b/src/interaction/TrackData.ts index f5b7bcd..29e25f3 100644 --- a/src/interaction/TrackData.ts +++ b/src/interaction/TrackData.ts @@ -31,10 +31,19 @@ interface DeletedControlPoint { } export default class TrackData { + private part_: number; private segments: Feature[] = []; private controlPoints: Feature[] = []; private pois: Feature[] = []; + constructor(part: number) { + this.part_ = part; + } + + get part() { + return this.part_; + } + parseFeatures(features: Feature[]): ParsedFeatures { const parsed: ParsedFeatures = { segments: [], diff --git a/src/interaction/TrackInteraction.ts b/src/interaction/TrackInteraction.ts index c04c69c..6b04efd 100644 --- a/src/interaction/TrackInteraction.ts +++ b/src/interaction/TrackInteraction.ts @@ -18,7 +18,6 @@ import {Point} from 'ol/geom'; export interface Options { map: Map; trackLayer: VectorLayer - trackData: TrackData style: StyleLike | FlatStyleLike /** @@ -64,6 +63,10 @@ export default class TrackInteraction extends Interaction { private modifyTrack_: Modify; private deletePoint_: Select; + setTrackData(trackData: TrackData) { + this.modifyTrack_.setTrackData(trackData); + } + controlPointOrPOIAtPixel(pixel: Pixel): Feature|false { return this.getMap().forEachFeatureAtPixel(pixel, (f) => { @@ -88,9 +91,8 @@ export default class TrackInteraction extends Interaction { return draw; } - createModifyInteraction(trackData: TrackData, source: VectorSource, style: StyleLike | FlatStyleLike, hitTolerance: number): Modify { + createModifyInteraction(source: VectorSource, style: StyleLike | FlatStyleLike, hitTolerance: number): Modify { const modify = new Modify({ - trackData: trackData, source: source, style: style, condition: (event) => !this.deleteCondition_(event), @@ -156,7 +158,7 @@ export default class TrackInteraction extends Interaction { source.on('removefeature', () => requestAnimationFrame(() => this.modifyTrack_.updateSketchFeature())); this.drawTrack_ = this.createDrawInteraction(source); - this.modifyTrack_ = this.createModifyInteraction(options.trackData, source, options.style, options.hitTolerance); + this.modifyTrack_ = this.createModifyInteraction(source, options.style, options.hitTolerance); this.deletePoint_ = this.createSelectInteraction(options.trackLayer); this.setActive(false); diff --git a/src/interaction/TrackInteractionModify.ts b/src/interaction/TrackInteractionModify.ts index f757b19..b363bbd 100644 --- a/src/interaction/TrackInteractionModify.ts +++ b/src/interaction/TrackInteractionModify.ts @@ -6,7 +6,7 @@ import LineString from 'ol/geom/LineString.js'; import Point from 'ol/geom/Point.js'; import Event from 'ol/events/Event.js'; import {Geometry} from 'ol/geom'; -import TrackData from './TrackData'; +import type TrackData from './TrackData'; import {Map, MapBrowserEvent} from 'ol'; import type {StyleLike} from 'ol/style/Style.js'; import type {FlatStyleLike} from 'ol/style/flat.js'; @@ -32,7 +32,6 @@ export class ModifyEvent extends Event { export interface Options { source: VectorSource; - trackData: TrackData; style: StyleLike | FlatStyleLike; condition: (mbe: MapBrowserEvent) => boolean; addControlPointCondition: (mbe: MapBrowserEvent) => boolean; @@ -65,7 +64,7 @@ export default class Modify extends PointerInteraction { }); private overlay_: VectorLayer; private lastPixel_: Pixel = [0, 0]; - private trackData_: Options['trackData']; + private trackData_: TrackData; private pointAtCursorFeature_ = new Feature({ geometry: new Point([0, 0]), type: 'sketch', @@ -103,10 +102,16 @@ export default class Modify extends PointerInteraction { updateWhileAnimating: true, updateWhileInteracting: true }); + } - this.trackData_ = options.trackData; + setTrackData(trackData: TrackData) { + this.trackData_ = trackData; + this.overlayFeature.set('part', this.trackData_.part); } + featureInTrackData(feature: Feature | undefined) { + return feature?.get('part') === this.trackData_.part; + } setMap(map: Map) { this.overlay_.setMap(map); @@ -181,6 +186,11 @@ export default class Modify extends PointerInteraction { handleEvent(event: MapBrowserEvent): boolean { const stop = super.handleEvent(event); + // const feature = this.getFeatureAtPixel(event.pixel); + // if (feature?.get('part') !== this.trackData_.part) { + // return false; + // } + if (this.addControlPointCondition_(event)) { const feature = this.getFeatureAtPixel(event.pixel); if (feature && feature.get('type') === 'segment') { @@ -201,6 +211,10 @@ export default class Modify extends PointerInteraction { if (!this.feature_) { return false; } + if (!this.featureInTrackData(this.feature_)) { + this.feature_ = null; + return false; + } this.dragStarted = false; return true; } diff --git a/src/interaction/TrackManager.ts b/src/interaction/TrackManager.ts index 7894c56..ab7dc34 100644 --- a/src/interaction/TrackManager.ts +++ b/src/interaction/TrackManager.ts @@ -1,3 +1,5 @@ +// FIXME: move pois outside of track data + import Feature from 'ol/Feature.js'; import Point from 'ol/geom/Point.js'; @@ -97,7 +99,7 @@ export default class TrackManager { private trackChangeEventListeners_: Function[] = []; // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type private trackHoverEventListeners_: Function[] = []; - private trackData_ = new TrackData(); + private trackData_: TrackData; private router_: Router; get router(): Router { return this.router_; @@ -114,6 +116,7 @@ export default class TrackManager { private updater_: TrackUpdater; private interaction_: TrackInteraction; private historyManager_ = new HistoryManager[]>(); + private parts: TrackData[] = []; constructor(options: Options) { this.map_ = options.map; @@ -127,16 +130,15 @@ export default class TrackManager { this.snapper_ = options.snapper; this.profiler_ = options.profiler; this.densifier_ = options.densifier; + this.updater_ = new TrackUpdater({ profiler: this.profiler_, densifier: this.densifier_, router: this.router_, - trackData: this.trackData_ }); this.interaction_ = new TrackInteraction({ style: options.style, - trackData: this.trackData_, trackLayer: this.trackLayer_, map: this.map_, deleteCondition: options.deleteCondition, @@ -145,6 +147,8 @@ export default class TrackManager { hitTolerance: this.hitTolerance_, }); + this.createNewPart(); + // Hack to test profile synchro // this.closestPointGeom_ = new Point([0, 0]); // this.interaction_.modifyTrack_.overlay_.getSource().addFeature(new Feature({ @@ -163,6 +167,7 @@ export default class TrackManager { if (!this.snapping) { feature.set('snapped', false); } + feature.set('part', this.trackData_.part); // Next line we don't care if the control point will be snapped, or not. const {pointFrom, pointTo, segment} = this.trackData_.pushControlPoint(feature); if (this.snapping && this.snapper_) { @@ -170,6 +175,7 @@ export default class TrackManager { } if (segment) { this.source_.addFeature(segment); + segment.set('part', this.trackData_.part); await this.router_.snapSegment(segment, pointFrom, pointTo); this.updater_.equalizeCoordinates(pointFrom); @@ -183,6 +189,7 @@ export default class TrackManager { const debouncedMapToProfileUpdater = debounce( (coordinate: Coordinate, hover: boolean) => { + // FIXME multi lines: check this if (hover && this.trackData_.getSegments().length > 0) { const segments = this.trackData_.getSegments().map(feature => feature.get('profile')); const best = findClosestPointInLines(segments, coordinate, {tolerance: 1, interpolate: true}); @@ -210,22 +217,26 @@ export default class TrackManager { const type = event.feature.get('type') as FeatureType; if (type === 'POI') { - this.trackData_.updatePOIIndexes(); + // FIXME multi lines: check this + this.trackData_.updatePOIIndexes(); this.onTrackChanged_(); } else if (type === 'controlPoint') { const feature = event.feature as Feature; await this.updater_.updateAdjacentSegmentsGeometries(feature, this.snapping); this.updater_.changeAdjacentSegmentsStyling(feature, ''); await this.updater_.computeAdjacentSegmentsProfile(feature); + // FIXME multi lines: check this this.trackData_.updatePOIIndexes(); this.onTrackChanged_(); } else if (type === 'segment') { const feature = event.feature as Feature; + // FIXME multi lines: check this const indexOfSegment = this.trackData_.getSegments().indexOf(feature); console.assert(indexOfSegment >= 0); const controlPoint = new Feature({ - geometry: new Point(event.coordinate) + geometry: new Point(event.coordinate), + part: this.trackData_.part, }); this.source_.addFeature(controlPoint); const removed = this.trackData_.insertControlPointAt(controlPoint, indexOfSegment + 1); @@ -234,11 +245,14 @@ export default class TrackManager { const {before, after} = this.trackData_.getAdjacentSegments(controlPoint); console.assert(!!before && !!after); + before.set('part', this.trackData_.part); + after.set('part', this.trackData_.part); this.source_.addFeatures([before, after]); await this.updater_.updateAdjacentSegmentsGeometries(controlPoint, this.snapping); this.updater_.changeAdjacentSegmentsStyling(controlPoint, ''); await this.updater_.computeAdjacentSegmentsProfile(controlPoint); + // FIXME multi lines: check this this.trackData_.updatePOIIndexes(); this.onTrackChanged_(); } @@ -254,6 +268,7 @@ export default class TrackManager { console.assert(selected.getGeometry().getType() === 'Point'); const type = selected.get('type') as FeatureType; if (type === 'POI') { + // FIXME multi lines: check this this.trackData_.deletePOI(selected); this.source_.removeFeature(selected); this.onTrackChanged_(); @@ -266,6 +281,7 @@ export default class TrackManager { // add newly created segment to source if (newSegment) { + newSegment.set('part', this.trackData_.part); this.source_.addFeature(newSegment); } @@ -299,10 +315,11 @@ export default class TrackManager { } private pushNewStateToHistoryManager_() { - const segments = this.getSegments(); - const controlPoints = this.getControlPoints(); - const pois = this.getPOIs(); - const features = [...segments, ...controlPoints, ...pois]; + const features = [ + ...this.getAllSegments().flat(), + ...this.getAllControlPoints().flat(), + ...this.getAllPOIs().flat(), + ]; const clonedFeatures = features.map(f => { const nf = f.clone(); nf.setId(f.getId()); @@ -369,6 +386,7 @@ export default class TrackManager { deleteLastPoint() { if (this.mode_) { + // FIXME multi lines: check this if (this.trackData_.getControlPoints().length > 0) { const deletedFeatures = this.trackData_.deleteLastControlPoint(); deletedFeatures.forEach(feature => this.source_.removeFeature(feature)); @@ -402,6 +420,7 @@ export default class TrackManager { private clearInternal_() { this.source_.clear(); this.trackData_.clear(); + // FIXME multi lines: remove all parts ? } /** @@ -418,17 +437,23 @@ export default class TrackManager { */ private async restoreFeaturesInternal_(features: Feature[]): Promise { // should parse features first, compute profile, and then replace the trackdata and add history - const parsedFeatures = this.trackData_.parseFeatures(features); - this.source_.addFeatures(features); - const profileRequests = parsedFeatures.segments.map((segment) => - this.profiler_.computeProfile(segment) - ); - await Promise.all(profileRequests); - this.trackData_.restoreParsedFeatures(parsedFeatures); + const currentPart = this.activePart(); + const featuresByPart = Object.groupBy(features, f => f.get('part')); + for (const [part, featuresInPart] of Object.entries(featuresByPart)) { + const parsedFeatures = this.trackData_.parseFeatures(featuresInPart); + this.source_.addFeatures(featuresInPart); + const profileRequests = parsedFeatures.segments.map((segment) => + this.profiler_.computeProfile(segment) + ); + await Promise.all(profileRequests); + // FIXME: check if part exists + this.workOnPart(parseInt(part)); + this.trackData_.restoreParsedFeatures(parsedFeatures); + } + this.workOnPart(currentPart); } async restoreFeatures(features: Feature[]): Promise { - this.clearInternal_(); await this.restoreFeaturesInternal_(features); this.onTrackChanged_(); } @@ -465,6 +490,29 @@ export default class TrackManager { }); } + getAllSegments(): readonly Feature[][] { + const segments: Feature[][] = []; + for (const tm of this.partsGenerator()) { + segments.push(tm.getSegments() as Feature[]); + } + return segments; + } + + getAllControlPoints(): readonly Feature[][] { + const controlPoints: Feature[][] = []; + for (const tm of this.partsGenerator()) { + controlPoints.push(tm.getControlPoints() as Feature[]); + } + return controlPoints; + } + + getAllPOIs(): readonly Feature[][] { + const pois: Feature[][] = []; + for (const tm of this.partsGenerator()) { + pois.push(tm.getPOIs() as Feature[]); + } + return pois; + } /** * Add a POI and notify track change listeners. @@ -614,4 +662,42 @@ export default class TrackManager { this.source_.changed(); this.shadowTrackLayer_.getSource().changed(); } + + createNewPart(): number { + this.trackData_ = new TrackData(this.parts.length); + this.parts.push(this.trackData_); + this.updater_.setTrackData(this.trackData_); + this.interaction_.setTrackData(this.trackData_); + + return this.trackData_.part; + } + + activePart(): number { + return this.trackData_.part; + } + + partsCount(): number { + return this.parts.length; + } + + workOnPart(index: number) { + this.trackData_ = this.parts[index]; + this.updater_.setTrackData(this.trackData_); + this.interaction_.setTrackData(this.trackData_); + } + + getParts(): TrackData[] { + return this.parts; + } + + // FIXME: find a better name + *partsGenerator(): Generator, void> { + const currentPart = this.activePart(); + const length = this.partsCount(); + for (let i = 0; i < length; i++) { + this.workOnPart(i); + yield this; + } + this.workOnPart(currentPart); + } } diff --git a/src/interaction/TrackUpdater.ts b/src/interaction/TrackUpdater.ts index 782445d..e8e472e 100644 --- a/src/interaction/TrackUpdater.ts +++ b/src/interaction/TrackUpdater.ts @@ -7,7 +7,6 @@ import {equals} from 'ol/coordinate'; import {Densifier} from 'src/densifier'; type TrackUpdaterOptions = { - trackData: TrackData; densifier: Densifier; router: Router; profiler: Profiler; @@ -23,12 +22,15 @@ export default class TrackUpdater { private router: Router; constructor(options: TrackUpdaterOptions) { - this.trackData = options.trackData; this.densifier = options.densifier; this.profiler = options.profiler; this.router = options.router; } + setTrackData(trackData: TrackData) { + this.trackData = trackData; + } + computeAdjacentSegmentsProfile(modifiedControlPoint: Feature): Promise { const promises = []; if (modifiedControlPoint) { diff --git a/tsconfig.json b/tsconfig.json index a1b4525..ffd1ffa 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ES2022", "module": "ES2022", - "lib": ["es2023", "dom"], + "lib": ["ESNext", "dom"], "baseUrl": "./", "skipLibCheck": true,