diff --git a/Control/package-lock.json b/Control/package-lock.json index 37692be0b..0b2cebdbb 100644 --- a/Control/package-lock.json +++ b/Control/package-lock.json @@ -14,7 +14,7 @@ ], "license": "GPL-3.0", "dependencies": { - "@aliceo2/web-ui": "2.7.3", + "@aliceo2/web-ui": "file:../Framework", "@grpc/grpc-js": "1.12.0", "@grpc/proto-loader": "0.7.0", "google-protobuf": "3.21.0", @@ -34,27 +34,42 @@ "node": ">= 20.x" } }, - "node_modules/@aliceo2/web-ui": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/@aliceo2/web-ui/-/web-ui-2.7.3.tgz", - "integrity": "sha512-3BkVsCLBXtLiDT0vtkpReqUdGigab2XfGPULUKMmMu9fVtiJoERn9BDHfJGzhL9ugMLT31HlG2tO1N9eU7ubHQ==", - "inBundle": true, + "../Framework": { + "name": "@aliceo2/web-ui", + "version": "2.7.4", "license": "GPL-3.0", "dependencies": { - "express": "^4.21.1", - "helmet": "^7.1.0", + "express": "^4.21.2", + "helmet": "^8.0.0", "jsonwebtoken": "^9.0.0", "kafkajs": "^2.2.0", "mithril": "1.1.7", "mysql": "^2.18.1", "openid-client": "^5.6.0", - "winston": "3.15.0", + "winston": "3.17.0", "ws": "^8.18.0" }, + "devDependencies": { + "@eslint/js": "^9.17.0", + "@stylistic/eslint-plugin-js": "^2.12.0", + "eslint": "^9.17.0", + "eslint-plugin-jsdoc": "^50.6.0", + "globals": "^15.14.0", + "mocha": "^11.0.1", + "nock": "13.5.0", + "nyc": "^17.1.0", + "puppeteer": "^23.11.1", + "sinon": "19.0.2", + "supertest": "^7.0.0" + }, "engines": { "node": ">= 20.x" } }, + "node_modules/@aliceo2/web-ui": { + "resolved": "../Framework", + "link": true + }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", @@ -336,28 +351,6 @@ "node": ">=6.9.0" } }, - "node_modules/@colors/colors": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", - "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/@dabh/diagnostics": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", - "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "colorspace": "1.1.x", - "enabled": "2.0.x", - "kuler": "^2.0.0" - } - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", @@ -1133,13 +1126,6 @@ "undici-types": "~6.20.0" } }, - "node_modules/@types/triple-beam": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", - "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==", - "inBundle": true, - "license": "MIT" - }, "node_modules/@types/yauzl": { "version": "2.10.3", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", @@ -1157,20 +1143,6 @@ "dev": true, "license": "ISC" }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/acorn": { "version": "8.14.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", @@ -1311,13 +1283,6 @@ "dev": true, "license": "Python-2.0" }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "inBundle": true, - "license": "MIT" - }, "node_modules/asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", @@ -1337,13 +1302,6 @@ "node": ">=4" } }, - "node_modules/async": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", - "inBundle": true, - "license": "MIT" - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -1454,16 +1412,6 @@ "node": ">=10.0.0" } }, - "node_modules/bignumber.js": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", - "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", @@ -1477,48 +1425,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/body-parser": { - "version": "1.20.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", - "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.13.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/body-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/body-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "inBundle": true, - "license": "MIT" - }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1620,19 +1526,9 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", - "inBundle": true, + "dev": true, "license": "BSD-3-Clause" }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/caching-transform": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", @@ -1653,7 +1549,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "inBundle": true, + "dev": true, "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", @@ -1840,17 +1736,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/color": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", - "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.3", - "color-string": "^1.6.0" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1871,45 +1756,6 @@ "inBundle": true, "license": "MIT" }, - "node_modules/color-string": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", - "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" - } - }, - "node_modules/color/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "inBundle": true, - "license": "MIT" - }, - "node_modules/colorspace": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", - "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "color": "^3.1.3", - "text-hex": "1.0.x" - } - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -1947,29 +1793,6 @@ "dev": true, "license": "MIT" }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", @@ -1977,23 +1800,6 @@ "dev": true, "license": "MIT" }, - "node_modules/cookie": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", - "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", - "inBundle": true, - "license": "MIT" - }, "node_modules/cookiejar": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", @@ -2001,13 +1807,6 @@ "dev": true, "license": "MIT" }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "inBundle": true, - "license": "MIT" - }, "node_modules/cosmiconfig": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", @@ -2113,7 +1912,7 @@ "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==", - "inBundle": true, + "dev": true, "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", @@ -2151,27 +1950,6 @@ "node": ">=0.4.0" } }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, "node_modules/devtools-protocol": { "version": "0.0.1367902", "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1367902.tgz", @@ -2223,19 +2001,12 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "inBundle": true, + "dev": true, "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" } }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "inBundle": true, - "license": "MIT" - }, "node_modules/electron-to-chromium": { "version": "1.5.68", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.68.tgz", @@ -2250,23 +2021,6 @@ "dev": true, "license": "MIT" }, - "node_modules/enabled": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", - "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", - "inBundle": true, - "license": "MIT" - }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -2300,7 +2054,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "inBundle": true, + "dev": true, "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.4" @@ -2313,7 +2067,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "inBundle": true, + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -2336,13 +2090,6 @@ "node": ">=6" } }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "inBundle": true, - "license": "MIT" - }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -2542,76 +2289,6 @@ "node": ">=0.10.0" } }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.3", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.7.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.3.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.3", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", - "proxy-addr": "~2.0.7", - "qs": "6.13.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.19.0", - "serve-static": "1.16.2", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/express/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/express/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "inBundle": true, - "license": "MIT" - }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -2685,13 +2362,6 @@ "pend": "~1.2.0" } }, - "node_modules/fecha": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", - "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", - "inBundle": true, - "license": "MIT" - }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -2718,42 +2388,6 @@ "node": ">=8" } }, - "node_modules/finalhandler": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", - "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/finalhandler/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "inBundle": true, - "license": "MIT" - }, "node_modules/find-cache-dir": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", @@ -2821,13 +2455,6 @@ "dev": true, "license": "ISC" }, - "node_modules/fn.name": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", - "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", - "inBundle": true, - "license": "MIT" - }, "node_modules/foreground-child": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", @@ -2875,26 +2502,6 @@ "url": "https://ko-fi.com/tunnckoCore/commissions" } }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/fromentries": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", @@ -2942,7 +2549,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "inBundle": true, + "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2972,7 +2579,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "inBundle": true, + "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -3113,7 +2720,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.1.0.tgz", "integrity": "sha512-FQoVQnqcdk4hVM4JN1eromaun4iuS34oStkdlLENLdpULsuQcTyXj8w7ayhuUfPwEYZ1ZOooOTT6fdA9Vmx/RA==", - "inBundle": true, + "dev": true, "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.4" @@ -3153,7 +2760,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "inBundle": true, + "dev": true, "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" @@ -3166,7 +2773,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.1.0.tgz", "integrity": "sha512-QLdzI9IIO1Jg7f9GT1gXpPpXArAn6cS31R1eEZqz08Gc+uQ8/XiqHWt17Fiw+2p6oTTIq5GXEpQkAlA88YRl/Q==", - "inBundle": true, + "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.7" @@ -3182,7 +2789,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "inBundle": true, + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3222,7 +2829,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "inBundle": true, + "dev": true, "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -3241,16 +2848,6 @@ "he": "bin/he" } }, - "node_modules/helmet": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/helmet/-/helmet-7.2.0.tgz", - "integrity": "sha512-ZRiwvN089JfMXokizgqEPXsl2Guk094yExfoDXR0cBYWxtBbaSww/w+vT4WEJsBW2iTUi1GgZ6swmoug3Oy4Xw==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=16.0.0" - } - }, "node_modules/hexoid": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-2.0.0.tgz", @@ -3268,23 +2865,6 @@ "dev": true, "license": "MIT" }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/http-proxy-agent": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", @@ -3311,19 +2891,6 @@ "node": ">= 14" } }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -3407,7 +2974,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "inBundle": true, + "dev": true, "license": "ISC" }, "node_modules/ip-address": { @@ -3423,16 +2990,6 @@ "node": ">= 12" } }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -3520,7 +3077,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "inBundle": true, + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -3559,13 +3116,6 @@ "node": ">=0.10.0" } }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "inBundle": true, - "license": "MIT" - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -3707,16 +3257,6 @@ "@pkgjs/parseargs": "^0.11.0" } }, - "node_modules/jose": { - "version": "4.15.9", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz", - "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==", - "inBundle": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/panva" - } - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -3808,7 +3348,7 @@ "version": "9.0.2", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", - "inBundle": true, + "dev": true, "license": "MIT", "dependencies": { "jws": "^3.2.2", @@ -3838,7 +3378,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "inBundle": true, + "dev": true, "license": "MIT", "dependencies": { "buffer-equal-constant-time": "1.0.1", @@ -3850,7 +3390,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "inBundle": true, + "dev": true, "license": "MIT", "dependencies": { "jwa": "^1.4.1", @@ -3861,7 +3401,6 @@ "version": "2.2.4", "resolved": "https://registry.npmjs.org/kafkajs/-/kafkajs-2.2.4.tgz", "integrity": "sha512-j/YeapB1vfPT2iOIUn/vxdyKEuhuY2PxMBvf5JWux6iSaukAccrMtXEY/Lb7OvavDhOWME589bpLrEdnVHjfjA==", - "inBundle": true, "license": "MIT", "engines": { "node": ">=14.0.0" @@ -3877,13 +3416,6 @@ "json-buffer": "3.0.1" } }, - "node_modules/kuler": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", - "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", - "inBundle": true, - "license": "MIT" - }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -3946,42 +3478,42 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", - "inBundle": true, + "dev": true, "license": "MIT" }, "node_modules/lodash.isboolean": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", - "inBundle": true, + "dev": true, "license": "MIT" }, "node_modules/lodash.isinteger": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", - "inBundle": true, + "dev": true, "license": "MIT" }, "node_modules/lodash.isnumber": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", - "inBundle": true, + "dev": true, "license": "MIT" }, "node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", - "inBundle": true, + "dev": true, "license": "MIT" }, "node_modules/lodash.isstring": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", - "inBundle": true, + "dev": true, "license": "MIT" }, "node_modules/lodash.merge": { @@ -3995,7 +3527,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", - "inBundle": true, + "dev": true, "license": "MIT" }, "node_modules/log-symbols": { @@ -4015,24 +3547,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/logform": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz", - "integrity": "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "@colors/colors": "1.6.0", - "@types/triple-beam": "^1.3.2", - "fecha": "^4.2.0", - "ms": "^2.1.1", - "safe-stable-stringify": "^2.3.1", - "triple-beam": "^1.3.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, "node_modules/long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", @@ -4076,54 +3590,21 @@ "semver": "bin/semver.js" } }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", - "inBundle": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "inBundle": true, + "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" } }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "inBundle": true, - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "inBundle": true, + "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -4133,7 +3614,7 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "inBundle": true, + "dev": true, "license": "MIT", "dependencies": { "mime-db": "1.52.0" @@ -4165,17 +3646,6 @@ "node": ">=16 || 14 >=14.17" } }, - "node_modules/mithril": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/mithril/-/mithril-1.1.7.tgz", - "integrity": "sha512-1SAkGeVrIVvkUHlPHvR3pXdWzNfTzmS/fBAe+rC2ApEBfZFFc+idi8Qg/M5JoW/sZkIDXSfQYVgvENMIhBIVAg==", - "inBundle": true, - "license": "MIT", - "bin": { - "bundle": "bundler/bin/bundle", - "ospec": "ospec/bin/ospec" - } - }, "node_modules/mitt": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", @@ -4261,30 +3731,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "inBundle": true, - "license": "MIT" - }, - "node_modules/mysql": { - "version": "2.18.1", - "resolved": "https://registry.npmjs.org/mysql/-/mysql-2.18.1.tgz", - "integrity": "sha512-Bca+gk2YWmqp2Uf6k5NFEurwY/0td0cpebAucFpY/3jhrwrVGuxU2uQFCHjU19SJfje0yQvi+rVWdq78hR5lig==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "bignumber.js": "9.0.0", - "readable-stream": "2.3.7", - "safe-buffer": "5.1.2", - "sqlstring": "2.3.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mysql/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "inBundle": true, + "dev": true, "license": "MIT" }, "node_modules/natural-compare": { @@ -4294,16 +3741,6 @@ "dev": true, "license": "MIT" }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/netmask": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", @@ -4612,21 +4049,11 @@ "node": ">=6" } }, - "node_modules/object-hash": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz", - "integrity": "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, "node_modules/object-inspect": { "version": "1.13.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", - "inBundle": true, + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -4635,29 +4062,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/oidc-token-hash": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/oidc-token-hash/-/oidc-token-hash-5.0.3.tgz", - "integrity": "sha512-IF4PcGgzAr6XXSff26Sk/+P4KZFJVuHAJZj3wgO3vX2bMdNVp/QXTP3P7CEm9V1IdG8lDLY3HhiqpsE/nOwpPw==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": "^10.13.0 || >=12.0.0" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -4668,52 +4072,6 @@ "wrappy": "1" } }, - "node_modules/one-time": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", - "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "fn.name": "1.x.x" - } - }, - "node_modules/openid-client": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.7.1.tgz", - "integrity": "sha512-jDBPgSVfTnkIh71Hg9pRvtJc6wTwqjRkN88+gCFtYWrlP4Yx2Dsrow8uPi3qLr/aeymPF3o2+dS+wOpglK04ew==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "jose": "^4.15.9", - "lru-cache": "^6.0.0", - "object-hash": "^2.2.0", - "oidc-token-hash": "^5.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/panva" - } - }, - "node_modules/openid-client/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "inBundle": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/openid-client/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "inBundle": true, - "license": "ISC" - }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -4874,16 +4232,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -4938,13 +4286,6 @@ "dev": true, "license": "ISC" }, - "node_modules/path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", - "inBundle": true, - "license": "MIT" - }, "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -5050,13 +4391,6 @@ "node": ">= 0.8.0" } }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "inBundle": true, - "license": "MIT" - }, "node_modules/process-on-spawn": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.1.0.tgz", @@ -5121,20 +4455,6 @@ "inBundle": true, "license": "Apache-2.0" }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/proxy-agent": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz", @@ -5253,7 +4573,7 @@ "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "inBundle": true, + "dev": true, "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.0.6" @@ -5302,55 +4622,6 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/readable-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "inBundle": true, - "license": "MIT" - }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -5482,6 +4753,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, "funding": [ { "type": "github", @@ -5496,31 +4768,13 @@ "url": "https://feross.org/support" } ], - "inBundle": true, - "license": "MIT" - }, - "node_modules/safe-stable-stringify": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", - "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "inBundle": true, "license": "MIT" }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "inBundle": true, + "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -5529,58 +4783,6 @@ "node": ">=10" } }, - "node_modules/send": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", - "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/send/node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "inBundle": true, - "license": "MIT" - }, - "node_modules/send/node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/serialize-javascript": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", @@ -5591,22 +4793,6 @@ "randombytes": "^2.1.0" } }, - "node_modules/serve-static": { - "version": "1.16.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", - "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.19.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -5618,7 +4804,7 @@ "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==", - "inBundle": true, + "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", @@ -5632,13 +4818,6 @@ "node": ">= 0.4" } }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "inBundle": true, - "license": "ISC" - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -5666,7 +4845,7 @@ "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==", - "inBundle": true, + "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.7", @@ -5694,23 +4873,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "is-arrayish": "^0.3.1" - } - }, - "node_modules/simple-swizzle/node_modules/is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", - "inBundle": true, - "license": "MIT" - }, "node_modules/sinon": { "version": "19.0.2", "resolved": "https://registry.npmjs.org/sinon/-/sinon-19.0.2.tgz", @@ -5833,36 +4995,6 @@ "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", "dev": true }, - "node_modules/sqlstring": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", - "integrity": "sha512-ooAzh/7dxIG5+uDik1z/Rd1vli0+38izZhGzSa34FwR7IbelPWCCKSNIl8jlL/F7ERvy8CB2jNeM1E9i9mXMAQ==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/streamx": { "version": "2.21.1", "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.21.1.tgz", @@ -5877,23 +5009,6 @@ "bare-events": "^2.2.0" } }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/string_decoder/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "inBundle": true, - "license": "MIT" - }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -6146,13 +5261,6 @@ "b4a": "^1.6.4" } }, - "node_modules/text-hex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", - "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", - "inBundle": true, - "license": "MIT" - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -6179,26 +5287,6 @@ "node": ">=8.0" } }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/triple-beam": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", - "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 14.0.0" - } - }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -6241,20 +5329,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/typed-query-selector": { "version": "2.12.0", "resolved": "https://registry.npmjs.org/typed-query-selector/-/typed-query-selector-2.12.0.tgz", @@ -6288,16 +5362,6 @@ "inBundle": true, "license": "MIT" }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/update-browserslist-db": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", @@ -6339,23 +5403,6 @@ "punycode": "^2.1.0" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "inBundle": true, - "license": "MIT" - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -6366,16 +5413,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -6399,74 +5436,6 @@ "dev": true, "license": "ISC" }, - "node_modules/winston": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.15.0.tgz", - "integrity": "sha512-RhruH2Cj0bV0WgNL+lOfoUBI4DVfdUNjVnJGVovWZmrcKtrFTTRzgXYK2O9cymSGjrERCtaAeHwMNnUWXlwZow==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "@colors/colors": "^1.6.0", - "@dabh/diagnostics": "^2.0.2", - "async": "^3.2.3", - "is-stream": "^2.0.0", - "logform": "^2.6.0", - "one-time": "^1.0.0", - "readable-stream": "^3.4.0", - "safe-stable-stringify": "^2.3.1", - "stack-trace": "0.0.x", - "triple-beam": "^1.3.0", - "winston-transport": "^4.7.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/winston-transport": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz", - "integrity": "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "logform": "^2.7.0", - "readable-stream": "^3.6.2", - "triple-beam": "^1.3.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/winston-transport/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/winston/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "inBundle": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -6616,7 +5585,7 @@ "version": "8.18.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", - "inBundle": true, + "dev": true, "license": "MIT", "engines": { "node": ">=10.0.0" diff --git a/Control/package.json b/Control/package.json index e82570c5c..46382ceda 100644 --- a/Control/package.json +++ b/Control/package.json @@ -33,17 +33,12 @@ "protobuf/" ], "dependencies": { - "@aliceo2/web-ui": "2.7.3", + "@aliceo2/web-ui": "file:../Framework", "@grpc/grpc-js": "1.12.0", "@grpc/proto-loader": "0.7.0", "google-protobuf": "3.21.0", "kafkajs": "2.2.4" }, - "bundledDependencies": [ - "@aliceo2/web-ui", - "@grpc/grpc-js", - "@grpc/proto-loader" - ], "devDependencies": { "eslint": "^8.56.0", "jsonwebtoken": "^9.0.2", diff --git a/Control/public/common/buttons/DropdownCopyValue.js b/Control/public/common/buttons/DropdownCopyValue.js new file mode 100644 index 000000000..b055339dd --- /dev/null +++ b/Control/public/common/buttons/DropdownCopyValue.js @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2019-2020 CERN and copyright holders of ALICE O2. + * See http://alice-o2.web.cern.ch/copyright for details of the copyright holders. + * All rights not expressly granted are reserved. + * + * This software is distributed under the terms of the GNU General Public + * License v3 (GPL Version 3), copied verbatim in the file "COPYING". + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. +*/ + +import {h,CopyToClipboardComponent,DropdownComponent } from '/js/src/index.js'; +import { iconCaretBottom } from '/js/src/icons.js'; +/** + * Build a component which a dropdown with values and provides a copy to clipboard actionable icon + * @param {String|vnode} text - text to be displayed + * @param {String} type - type of the text + * @param {Array} options - options for the dropdown + * @return {vnode} + */ +export const DropdownCopyValue = (text, type,options) => + h('.flex-row.items-center.btn-group', [ + h(`${type}`, text), + DropdownComponent( + h('.btn.btn-group-item.last-item', iconCaretBottom()), + h('.flex-column.p2.g3', + [ + options.map((option) => + h(CopyToClipboardComponent, { value: option.value, id: option.value }, option.label) + ) + ], + ), + { + alignment: 'right', + } + ), + ]); diff --git a/Control/public/pages/Environment/components/environmentStateSummary.js b/Control/public/pages/Environment/components/environmentStateSummary.js index 94b1d1695..39010699e 100644 --- a/Control/public/pages/Environment/components/environmentStateSummary.js +++ b/Control/public/pages/Environment/components/environmentStateSummary.js @@ -14,9 +14,9 @@ import {h} from '/js/src/index.js'; import {ALIECS_STATE_COLOR} from '../../../common/constants/stateColors.js'; -import {textWithCopyClipboard} from '../../../common/buttons/textWithCopyClipboard.js'; import {parseObject} from '../../../common/utils.js'; import {EnvironmentState} from '../../../common/enums/EnvironmentState.enum.js'; +import {DropdownCopyValue} from '../../../common/buttons/DropdownCopyValue.js'; /** * Build a component which represents a summary of the state of the environment with the environment id, state and creation time * @param {EnvironmentInfo} environment - DTO representing an environment @@ -32,11 +32,23 @@ export const environmentStateSummary = (environment) => { transitionTime = parseObject(userVars['run_start_time_ms'], 'run_start_time_ms'); transitionLabel = 'Running since: '; } + + var commaSeparated = [currentRunNumber, id].join(',').toString(); + var SlashSeparated = [currentRunNumber, id].join('/').toString(); + + var options = [ + {label: 'Environment Id: ' + id, value:id}, + ]; + + state === EnvironmentState.RUNNING && options.push({label: 'Run Number: ' + currentRunNumber, value:currentRunNumber}, + {label: 'RunNumber, environmentId ', value:commaSeparated}, + {label: 'RunNumber / environmentId ', value:SlashSeparated}, + ); return h(`.flex-row.g2.p2.white.bg-${ALIECS_STATE_COLOR[state]}`, [ - textWithCopyClipboard(id, 'h3'), + DropdownCopyValue('Copy', 'p', options), h('h3', title), - state === EnvironmentState.RUNNING && textWithCopyClipboard(currentRunNumber, 'h3'), + // state === EnvironmentState.RUNNING && textWithCopyClipboard(currentRunNumber, 'h3'), h('.ph1.flex-grow.flex-column.flex-center.text-right', transitionLabel + transitionTime) ]); }; diff --git a/Framework/Frontend/css/src/bootstrap.css b/Framework/Frontend/css/src/bootstrap.css index 48becc761..c5415d655 100644 --- a/Framework/Frontend/css/src/bootstrap.css +++ b/Framework/Frontend/css/src/bootstrap.css @@ -50,6 +50,9 @@ --space-m: 1rem; --space-l: 2rem; --space-xl: 4rem; + + /* fixed size */ + --ui-component-large: 850px; } /* reset what specific browsers do */ @@ -308,6 +311,10 @@ svg.icon { height: 1em; width: 1em; margin-bottom: -0.2em; } .dropup-open>.dropup-menu { display: block; } .dropup-menu { box-shadow: 0 8px 17px 2px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); display: none; position: absolute; bottom: calc(100% + 0.1rem); left: 0.1rem; z-index: 1000; font-size: 1rem; background-color: #fff; border: 1px solid rgba(0, 0, 0, .15); border-radius: .25rem; } +/* popover */ + +.popover { flex-shrink: 0;flex-wrap: wrap;align-items: flex-start;position: absolute;top: 0;left: 0;z-index: 1002;max-width: var(--ui-component-large); } + /* tooltip */ .tooltip {position: relative; display: inline-block; border-bottom: 1px dotted black;} .tooltip .tooltiptext {visibility: hidden; width: 118px; background-color: #555; color: #fff; text-align: center; padding: 3px; border-radius: 6px; position: absolute; z-index: 1;} diff --git a/Framework/Frontend/js/src/components/Component.js b/Framework/Frontend/js/src/components/Component.js new file mode 100644 index 000000000..91818c81f --- /dev/null +++ b/Framework/Frontend/js/src/components/Component.js @@ -0,0 +1,16 @@ +/** + * @license + * Copyright CERN and copyright holders of ALICE O2. This software is + * distributed under the terms of the GNU General Public License v3 (GPL + * Version 3), copied verbatim in the file "COPYING". + * + * See http://alice-o2.web.cern.ch/license for full licensing information. + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ + +/** + * @typedef {(vnode|string|number|Array<(vnode|string|number)>|null)} Component + */ diff --git a/Framework/Frontend/js/src/components/CopyToClipboardComponent.js b/Framework/Frontend/js/src/components/CopyToClipboardComponent.js new file mode 100644 index 000000000..f2207d194 --- /dev/null +++ b/Framework/Frontend/js/src/components/CopyToClipboardComponent.js @@ -0,0 +1,125 @@ +/** + * @license + * Copyright CERN and copyright holders of ALICE O2. This software is + * distributed under the terms of the GNU General Public License v3 (GPL + * Version 3), copied verbatim in the file "COPYING". + * + * See http://alice-o2.web.cern.ch/license for full licensing information. + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ + +import { StatefulComponent } from './StatefulComponent.js'; +import { iconCheck, iconLinkIntact } from '../icons.js'; +import { h } from '../renderer.js'; + +/** + * Represents a component that allows copying text to the clipboard. + */ +export class CopyToClipboardComponent extends StatefulComponent { + /** + * Constructs a new CopyToClipboardComponent. + */ + constructor() { + super(); + this._successStateTimeout = null; + } + + /** + * Copies the specified text to the clipboard. + * + * @param {string} clipboardTargetValue The text to be copied to the clipboard. + * @returns {void} + */ + copyToClipboard(clipboardTargetValue) { + navigator.clipboard.writeText(clipboardTargetValue); + this._successStateTimeout = setTimeout(() => { + this._successStateTimeout = null; + this.notify(); + }, 2000); + this.notify(); + } + + /** + * Checks the availability of the clipboard and provides a message if it is not accessible. + * + * @throws {Error} Throws an error with a descriptive message if the clipboard is not available. + * @returns {void} + */ + checkClipboardAvailability() { + if (!this.isContextSecure()) { + throw new Error('Clipboard not available in a non-secure context.'); + } + + if (!this.isClipboardSupported()) { + throw new Error('Clipboard API is not supported in this browser.'); + } + + if (this.isWindowEmbedded()) { + throw new Error('Clipboard access is restricted in iframes.'); + } + } + + /** + * Checks if context is secure (HTTPS) + * + * @returns {boolean} Returns `true` if context is secure + */ + isContextSecure() { + return window.isSecureContext; + } + + /** + * Checks if the clipboard API is available in the user's browser. + * + * @returns {boolean} Returns `true` if it is available + */ + isClipboardSupported() { + return Boolean(navigator.clipboard); + } + + /** + * Check if the window is embeded in a frame. + * + * @returns {boolean} Returns `true` if it is embeded + */ + isWindowEmbedded() { + return window !== window.parent; + } + + /** + * Renders the button that allows copying text to the clipboard. + * + * @param {vnode} vnode The virtual DOM node containing the attrs and children. + * @returns {Component} The copyToClipboard button component + */ + view(vnode) { + const { attrs, children } = vnode; + const { value: clipboardTargetValue = '', id } = attrs; + let available = true; + let message = ''; + + try { + this.checkClipboardAvailability(); + } catch ({ message: errorMessage }) { + available = false; + message = errorMessage; + } + + const defaultContent = [iconLinkIntact(), children]; + const successContent = [iconCheck(), h('', 'Copied!')]; + + return h( + 'button.btn.btn-primary', + { + id: `copy-${id}`, + onclick: () => this.copyToClipboard(clipboardTargetValue), + disabled: !available, + title: message || null, + }, + h('div.flex-row.g1', this._successStateTimeout ? successContent : defaultContent), + ); + } +} diff --git a/Framework/Frontend/js/src/components/DropdownComponent.js b/Framework/Frontend/js/src/components/DropdownComponent.js new file mode 100644 index 000000000..23e49e1ee --- /dev/null +++ b/Framework/Frontend/js/src/components/DropdownComponent.js @@ -0,0 +1,45 @@ +/** + * @license + * Copyright CERN and copyright holders of ALICE O2. This software is + * distributed under the terms of the GNU General Public License v3 (GPL + * Version 3), copied verbatim in the file "COPYING". + * + * See http://alice-o2.web.cern.ch/license for full licensing information. + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ + +import {h} from '../renderer.js'; +import {PopoverTriggerPreConfiguration} from './PopoverPreConfigurations.js'; +import {PopoverAnchors} from './PopoverEngine.js'; +import {popover} from './popover.js'; + +/** + * Renders a dropdown component + * + * @param {Component} trigger the component triggering the dropdown opening trigger + * @param {Component} content the content of the dropdown + * @param {Object} [configuration] dropdown configuration + * @param {'left'|'right'} [configuration.alignment='left'] defines the alignment of the dropdown + * @param {popoverVisibilityChangeCallback} [configuration.onVisibilityChange] function called when the visibility changes + * @return {Component} the dropdown component + */ +export const DropdownComponent = ( + trigger, + content, + configuration, +) => { + configuration = configuration || {}; + const {alignment = 'left'} = configuration; + return popover( + trigger, + h('.dropdown', content), + { + ...PopoverTriggerPreConfiguration.click, + anchor: alignment === 'left' ? PopoverAnchors.BOTTOM_START : PopoverAnchors.BOTTOM_END, + onVisibilityChange: configuration.onVisibilityChange, + }, + ); +}; diff --git a/Framework/Frontend/js/src/components/PopoverEngine.js b/Framework/Frontend/js/src/components/PopoverEngine.js new file mode 100644 index 000000000..47478f831 --- /dev/null +++ b/Framework/Frontend/js/src/components/PopoverEngine.js @@ -0,0 +1,491 @@ +/** + * @license + * Copyright CERN and copyright holders of ALICE O2. This software is + * distributed under the terms of the GNU General Public License v3 (GPL + * Version 3), copied verbatim in the file "COPYING". + * + * See http://alice-o2.web.cern.ch/license for full licensing information. + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ + +/** + * @typedef BoundingBoxProjector + * + * Object able to project a bounding box 2D data to only one of its dimensions + * + * @template T + * + * @property {(subject: {left: T, top: T} | {x: T, y: T}) => T} getPosition return the position of the subject + * @property {(subject: {left: T, top: T} | {x: T, y: T}, position: T) => void} setPosition set the position of the subject to a given value + * @property {(subject: {width: T, height: T}) => t} getSize return the size of the subject + * @property {(subject: {width: T, height: T}, size: T) => void} setSize set the size of the subject to a given value + * @property {(subject: {width: T, height: T}, size: T) => void} setMaxSize set the maximum size of the subject to a given value + */ + +/** + * @type BoundingBoxProjector + */ +const verticalProjector = Object.freeze({ + getPosition: (subject) => 'top' in subject ? subject.top : subject.y, + + setPosition: (subject, position) => { + if ('top' in subject) { + subject.top = position; + } else { + subject.y = position; + } + }, + + getSize: (subject) => subject.height, + + setSize: (subject, size) => { + subject.height = size; + }, + + setMaxSize: (subject, size) => { + subject.maxHeight = size; + }, +}); + +/** + * @type BoundingBoxProjector + */ +const horizontalProjector = Object.freeze({ + getPosition: (subject) => 'left' in subject ? subject.left : subject.x, + + setPosition: (subject, position) => { + if ('left' in subject) { + subject.left = position; + } else { + subject.y = position; + } + }, + + getSize: (subject) => subject.width, + + setSize: (subject, size) => { + subject.width = size; + }, + + setMaxSize: (subject, size) => { + subject.maxWidth = size; + }, +}); + +/** + * @typedef {number} PopoverAnchor + */ + +/** + * @typedef {number} MainAxisPopoverPosition + */ + +/** + * @typedef {number} CrossAxisPopoverPosition + */ + +/** + * Available popover position related to the trigger on main axis + * + * @type {{BEFORE: MainAxisPopoverPosition, AFTER: MainAxisPopoverPosition}} + */ +const MainAxisPositions = { + BEFORE: 0, // Popover will be before the trigger on the main axis + AFTER: 1, // Popover will be after the trigger on the main axis +}; + +/** + * Available popover position related to the trigger on cross axis + * + * @type {{START: CrossAxisPopoverPosition, END: CrossAxisPopoverPosition, MIDDLE: CrossAxisPopoverPosition}} + */ +const CrossAxisPositions = { + START: 0, // The start of the popover will be aligned with the start of the trigger on the cross axis + MIDDLE: 1, // The popover will be centered against the trigger on the cross axis + END: 2, // The end of the popover will be aligned with the end of the trigger on the cross axis +}; + +/** + * @type {Object} + * + * Defines the position of the popover related to the trigger + */ +export const PopoverAnchors = { + // Main axis vertical + TOP_START: 0, + TOP_MIDDLE: 1, + TOP_END: 2, + + BOTTOM_START: 3, + BOTTOM_MIDDLE: 4, + BOTTOM_END: 5, + + // Main axis horizontal + LEFT_START: 6, + LEFT_MIDDLE: 7, + LEFT_END: 8, + + RIGHT_START: 9, + RIGHT_MIDDLE: 10, + RIGHT_END: 11, +}; + +/** + * Class to position and resize a popover element relatively to a trigger in a given display zone + * + * Popover position is done around 2 axis: + * - Main axis, which is the side where the popover will be placed. For example if the main axis is horizontal, the popover will either be + * on the right or on the left of the trigger + * - Cross axis, which is the other axis + */ +class PopoverEngine { + /** + * Constructor + * + * @param {HTMLElement} trigger the bounding box of the trigger + * @param {HTMLElement} popover the bounding box of the popover + * @param {BoundingBox} displayBoundingBox the bounding box of the display zone, representing the limits where the popover may be drawn + * @param {{x: number, y: number}} displayZoneMargins the margins to apply at the edge of the display zone + * @param {{main: MainAxisPopoverPosition, cross: CrossAxisPopoverPosition}} position the position of the popover relative to the trigger + * @param {{main: BoundingBoxProjector, cross: BoundingBoxProjector}} projectors the axis projectors + * @param {object} [configuration] additional configuration + * @param {boolean} [configuration.imperativeSize=false] if true, size of the popover will be removed before re-computing size and position. + * This is useful when the popover content size is based on the popover size (displaying an image for example) but this should not be + * used with scrollable content, because it will reset scroll on every render + */ + constructor( + trigger, + popover, + displayBoundingBox, + displayZoneMargins, + position, + projectors, + configuration, + ) { + this._popover = popover; + + this._triggerBoundingBox = trigger.getBoundingClientRect(); + + this._mainAxisPosition = position.main; + this._crossAxisPosition = position.cross; + + this._mainAxisProjector = projectors.main; + this._crossAxisProjector = projectors.cross; + + this._displayBoundingBox = displayBoundingBox; + this._displayZoneMargins = displayZoneMargins; + + const { imperativeSize = false } = configuration ?? {}; + this._imperativeSize = imperativeSize; + } + + /** + * Fit the popover to the drawing zone then position it + * + * @return {void} + */ + fitAndPosition() { + this.resizeAlongMainAxis(); + this.resizeAlongCrossAxis(); + this.positionAlongMainAxis(); + this.positionAlongCrossAxis(); + } + + /** + * Reset the popover to its default size and position + * + * @return {void} + */ + reset() { + this._popover.style.removeProperty('left'); + this._popover.style.removeProperty('top'); + if (this._imperativeSize) { + this._popover.style.removeProperty('width'); + this._popover.style.removeProperty('height'); + } + } + + /** + * Resize the popover along the main axis to not overflow of the display bounding box + * + * @return {void} + */ + resizeAlongMainAxis() { + // Round pessimistically the space available because bounding client rect might return float-values + const availableSpaceBefore = Math.floor(this._triggerStartMainAxis); + const availableSpaceAfter = Math.floor(this._availableSpaceInMainAxis - this._triggerEndMainAxis); + + let sizeToSet = null; + if ( + availableSpaceBefore <= this._popoverContentSizeMainAxis + && availableSpaceAfter <= this._popoverContentSizeMainAxis + ) { + let mainAxisSize; + + // Put where there is the most space + if (availableSpaceBefore > availableSpaceAfter) { + // More space before + this._mainAxisPosition = MainAxisPositions.BEFORE; + mainAxisSize = availableSpaceBefore; + } else if (availableSpaceBefore < availableSpaceAfter) { + // More space after + this._mainAxisPosition = MainAxisPositions.AFTER; + mainAxisSize = availableSpaceAfter; + } else { + // Same space + mainAxisSize = availableSpaceBefore; + } + + sizeToSet = `${mainAxisSize}px`; + } + (this._imperativeSize ? this._mainAxisProjector.setSize : this._mainAxisProjector.setMaxSize)(this._popover.style, sizeToSet); + } + + /** + * Resize the popover along the cross axis to not overflow of the display bounding box + * + * @return {void} + */ + resizeAlongCrossAxis() { + const availableSpaceInCrossAxis = Math.floor(this._availableSpaceInCrossAxis); + + let sizeToSet = null; + if (this._popoverContentSizeCrossAxis >= availableSpaceInCrossAxis) { + sizeToSet = `${availableSpaceInCrossAxis}px`; + } + (this._imperativeSize ? this._crossAxisProjector.setSize : this._crossAxisProjector.setMaxSize)(this._popover.style, sizeToSet); + } + + /** + * Position the popover along the main axis + * + * @return {void} + */ + positionAlongMainAxis() { + let mainAxisPosition; + + /* + * Round optimistically, to avoid the popover being resized to be put before/after not fitting because size imprecision make it + * bigger than newly computed available space + */ + const doesFitBeforeAlongMainAxis = Math.ceil(this._triggerStartMainAxis) >= Math.floor(this._popoverSizeMainAxis); + const doesFitAfterAlongMainAxis = Math.ceil(this._availableSpaceInMainAxis - this._triggerEndMainAxis) + >= Math.floor(this._popoverSizeMainAxis); + + if (this._mainAxisPosition === MainAxisPositions.BEFORE && doesFitBeforeAlongMainAxis || !doesFitAfterAlongMainAxis) { + mainAxisPosition = this._triggerStartMainAxis - this._popoverSizeMainAxis; + } else { + mainAxisPosition = this._triggerEndMainAxis; + } + + // Popover is placed absolutely relatively to the document, and its position should be offset by the window scroll + mainAxisPosition += this._mainAxisProjector.getPosition(this._offsets); + + this._mainAxisProjector.setPosition(this._popover.style, `${mainAxisPosition}px`); + } + + /** + * Position the popover along the cross axis + * + * @return {void} + */ + positionAlongCrossAxis() { + let targetStartCrossAxis; + + if (this._crossAxisPosition === CrossAxisPositions.START) { + targetStartCrossAxis = this._triggerStartCrossAxis; + } else if (this._crossAxisPosition === CrossAxisPositions.END) { + targetStartCrossAxis = this._triggerStartCrossAxis + this._triggerSizeCrossAxis - this._popoverSizeCrossAxis; + } else { + targetStartCrossAxis = this._triggerStartCrossAxis + (this._triggerSizeCrossAxis - this._popoverSizeCrossAxis) / 2; + } + + targetStartCrossAxis += this._crossAxisProjector.getPosition(this._offsets); + + const crossMargin = this._crossAxisProjector.getPosition(this._displayZoneMargins); + const crossAxisMinPosition = this._crossAxisProjector.getPosition(this._displayBoundingBox) + crossMargin; + + // Add the start margin that is deduced when computing the available space + const crossAxisMaxPosition = crossMargin + this._availableSpaceInCrossAxis - this._popoverSizeCrossAxis; + + const crossAxisPosition = Math.max( + crossAxisMinPosition, + Math.min( + crossAxisMaxPosition, + targetStartCrossAxis, + ), + ); + this._crossAxisProjector.setPosition(this._popover.style, `${crossAxisPosition}px`); + } + + /** + * Returns the total available space along the main axis + * + * @return {number} the available space + * @private + */ + get _availableSpaceInMainAxis() { + return this._mainAxisProjector.getSize(this._displayBoundingBox) + - this._mainAxisProjector.getPosition(this._displayZoneMargins); + } + + /** + * Returns the total available space along the cross axis + * + * @return {number} the available space + * @private + */ + get _availableSpaceInCrossAxis() { + return this._crossAxisProjector.getSize(this._displayBoundingBox) + - this._crossAxisProjector.getPosition(this._displayZoneMargins) * 2; + } + + /** + * Return the position of the start of the trigger along the main axis + * + * @return {number} the start position + * @private + */ + get _triggerStartMainAxis() { + return this._mainAxisProjector.getPosition(this._triggerBoundingBox); + } + + /** + * Return the position of the end of the trigger along the main axis + * + * @return {number} the end position + * @private + */ + get _triggerEndMainAxis() { + return this._triggerStartMainAxis + this._mainAxisProjector.getSize(this._triggerBoundingBox); + } + + /** + * Return the position of the trigger along the cross axis + * + * @return {number} the start position + * @private + */ + get _triggerStartCrossAxis() { + return this._crossAxisProjector.getPosition(this._triggerBoundingBox); + } + + /** + * Return the size of the trigger along the cross axis + * + * @return {number} the size + * @private + */ + get _triggerSizeCrossAxis() { + return this._crossAxisProjector.getSize(this._triggerBoundingBox); + } + + /** + * Return the current bounding box of the popover + * + * @return {DOMRect} The bounding box + */ + get popoverBoundingBox() { + return this._popover.getBoundingClientRect(); + } + + /** + * Return the size of the popover along the main axis + * + * @return {number} the size + * @private + */ + get _popoverSizeMainAxis() { + return this._mainAxisProjector.getSize(this.popoverBoundingBox); + } + + /** + * Return the content size of the popover along the main axis + * + * @return {number} the size + * @private + */ + get _popoverContentSizeMainAxis() { + return this._mainAxisProjector.getSize(this._popoverContentSize); + } + + /** + * Return the size of the popover along the cross axis + * + * @return {number} the size + * @private + */ + get _popoverSizeCrossAxis() { + return this._crossAxisProjector.getSize(this.popoverBoundingBox); + } + + /** + * Return the content size of the popover along the cross axis + * + * @return {number} the size + * @private + */ + get _popoverContentSizeCrossAxis() { + return this._crossAxisProjector.getSize(this._popoverContentSize); + } + + /** + * The popover is placed absolutely relatively to the document, and it should be offset by the window's scroll + * + * @return {{top: number, left: number}} the offsets + * @private + */ + get _offsets() { + return { top: window.scrollY, left: window.scrollX }; + } + + /** + * Return the content size of the popover + * + * @return {{width: number, height: number}} the size + * @private + */ + get _popoverContentSize() { + return { width: this._popover.scrollWidth, height: this._popover.scrollHeight }; + } +} + +/** + * Creates and return a new popover engine + * + * @param {HTMLElement} trigger the bounding box of the trigger + * @param {HTMLElement} popover the bounding box of the popover + * @param {BoundingBox} displayBoundingBox the bounding box of the display zone, representing the limits where the popover may be drawn + * @param {{x: number, y: number}} displayZoneMargins the margins to apply at the edge of the display zone + * @param {PopoverAnchor} anchor the anchor to place the popover + * @param {object} [configuration] additional configuration + * @param {boolean} [configuration.imperativeSize=false] if true, size of the popover will be removed before re-computing size and position, + * and size will be imperative (width instead of max-width). This is useful when the popover content size is based on the popover size + * (displaying an image for example) but this should not be used with scrollable content, because it will reset scroll on every render, + * or with popover for which height might be reduced dynamically (dropdown options being filtered) + * @return {PopoverEngine} the created popover engine + */ +export const createPopoverEngine = (trigger, popover, displayBoundingBox, displayZoneMargins, anchor, configuration) => { + // Top and Bottom are the 6 first anchors + const mainAxisProjector = anchor / 6 < 1 ? verticalProjector : horizontalProjector; + const crossAxisProjector = anchor / 6 < 1 ? horizontalProjector : verticalProjector; + + // Top goes from 0 to 2 and Left goes from 6 to 8 + const mainAxisPosition = Math.floor(anchor / 3) % 2 === 0 ? MainAxisPositions.BEFORE : MainAxisPositions.AFTER; + + // Anchors are always START, MIDDLE, END, START, MIDDLE, END and so on + const crossAxisPosition = [CrossAxisPositions.START, CrossAxisPositions.MIDDLE, CrossAxisPositions.END][anchor % 3]; + + return new PopoverEngine( + trigger, + popover, + displayBoundingBox, + displayZoneMargins, + { main: mainAxisPosition, cross: crossAxisPosition }, + { main: mainAxisProjector, cross: crossAxisProjector }, + configuration, + ); +}; diff --git a/Framework/Frontend/js/src/components/PopoverPreConfigurations.js b/Framework/Frontend/js/src/components/PopoverPreConfigurations.js new file mode 100644 index 000000000..ca66cbd11 --- /dev/null +++ b/Framework/Frontend/js/src/components/PopoverPreConfigurations.js @@ -0,0 +1,73 @@ +/** + * @license + * Copyright CERN and copyright holders of ALICE O2. This software is + * distributed under the terms of the GNU General Public License v3 (GPL + * Version 3), copied verbatim in the file "COPYING". + * + * See http://alice-o2.web.cern.ch/license for full licensing information. + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ +import { documentClickTaggedEventRegistry } from '../utilities/documentClickTaggedEventRegistry.js'; + +export const PopoverTriggerPreConfiguration = Object.freeze({ + click: Object.freeze({ + // eslint-disable-next-line require-jsdoc + onTriggerNodeChange: function (previousTriggerNode, newTriggerNode) { + // eslint-disable-next-line require-jsdoc + const hideDropdownOnEscape = (e) => e.key === 'Escape' && this.hidePopover(); + // eslint-disable-next-line require-jsdoc + const handleClick = (e) => { + documentClickTaggedEventRegistry.tagEvent(e, this.key); + this.togglePopover(); + }; + + if (previousTriggerNode) { + documentClickTaggedEventRegistry.removeListener(this.hidePopover); + window.removeEventListener('keyup', hideDropdownOnEscape); + previousTriggerNode.removeEventListener('click', handleClick); + } + + if (newTriggerNode) { + newTriggerNode.addEventListener('click', handleClick); + documentClickTaggedEventRegistry.addListenerForAnyExceptTagged(this.hidePopover, this.key); + window.addEventListener('keyup', hideDropdownOnEscape); + } + }, + // eslint-disable-next-line require-jsdoc + onPopoverNodeChange: function (previousPopoverNode, newPopoverNode) { + // eslint-disable-next-line require-jsdoc + const handleClick = (e) => documentClickTaggedEventRegistry.tagEvent(e, this.key); + + if (previousPopoverNode) { + previousPopoverNode.removeEventListener('click', handleClick); + } + + if (newPopoverNode) { + newPopoverNode.addEventListener('click', handleClick); + } + }, + }), + + /** + * Partial popover configuration for hover-based popover + * + * @type {Readonly>} + */ + hover: Object.freeze({ + // eslint-disable-next-line require-jsdoc + onTriggerNodeChange: function (previousTriggerNode, newTriggerNode) { + if (previousTriggerNode) { + previousTriggerNode.removeEventListener('mouseenter', this.showPopover); + previousTriggerNode.removeEventListener('mouseleave', this.hidePopover); + } + + if (newTriggerNode) { + newTriggerNode.addEventListener('mouseenter', this.showPopover); + newTriggerNode.addEventListener('mouseleave', this.hidePopover); + } + }, + }), +}); diff --git a/Framework/Frontend/js/src/components/StatefulComponent.js b/Framework/Frontend/js/src/components/StatefulComponent.js new file mode 100644 index 000000000..38de21619 --- /dev/null +++ b/Framework/Frontend/js/src/components/StatefulComponent.js @@ -0,0 +1,47 @@ +/** + * @license + * Copyright CERN and copyright holders of ALICE O2. This software is + * distributed under the terms of the GNU General Public License v3 (GPL + * Version 3), copied verbatim in the file "COPYING". + * + * See http://alice-o2.web.cern.ch/license for full licensing information. + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ +import Observable from '../Observable.js'; + +// No static property in es2020, using module encapsulation instead +let _renderer = null; + +/** + * Specific component that can triggers re-render on its own when its property changes + * + * Some components do not really require models, for example dropdowns. However, we need a way for these components to trigger re-render + * without having to pass a model all the way along to it. This is the purpose of this component: calling their notify function will trigger + * a re-render + * At the application startup, a renderer should be provided in order for the component to trigger re-rendering (use the function + * `useRenderer` once, passing the global model to it) + */ +export class StatefulComponent extends Observable { + /** + * Set the current renderer that the stateful components should notify when their state changed + * + * @param {{notify: function}} renderer the renderer to use + * @return {void} + */ + static useRenderer(renderer) { + _renderer = renderer; + } + + /** + * @inheritDoc + */ + notify() { + super.notify(); + if (_renderer) { + _renderer.notify(); + } + } +} diff --git a/Framework/Frontend/js/src/components/createPortal.js b/Framework/Frontend/js/src/components/createPortal.js new file mode 100644 index 000000000..12413a275 --- /dev/null +++ b/Framework/Frontend/js/src/components/createPortal.js @@ -0,0 +1,116 @@ +/** + * @license + * Copyright CERN and copyright holders of ALICE O2. This software is + * distributed under the terms of the GNU General Public License v3 (GPL + * Version 3), copied verbatim in the file "COPYING". + * + * See http://alice-o2.web.cern.ch/license for full licensing information. + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ + +import Observable from '../Observable.js'; +import {documentClickTaggedEventRegistry} from '../utilities/documentClickTaggedEventRegistry.js'; +import {h, mount} from '../renderer.js'; + +/** + * Mithril component that displays its content as child of custom dom elements (document's root by default) that can be out of the current + * elements tree + */ +class Portal { + /** + * Component's constructor + * @param {{attrs: {container: (HTMLElement|undefined)}}} props the component's properties + */ + constructor({attrs: {container}}) { + // Container is the actual element that will be the parent of the portal's target + this.container = container || document.body; + // Because portal's target will be mounted on its own dom tree, it has its own model to trigger re-render when the portal is re-rendered + this.model = new Observable(); + + /** + * @type {HTMLElement|null} + * @private + */ + this._portalSource = null; + this._propagateClick = this._propagateClick.bind(this); + } + + // eslint-disable-next-line require-jsdoc + oncreate({dom, children, text}) { + /* + * For simplicity, create a div that will serve as root for portal's target. + * Doing so, it will be easier to clean it when portal is removed + * If this div breaks tree, use `oncreate` and `onupdate` on children to use the target's actual dom element as rootNode + * (this cannot work with text) + */ + this.rootNode = document.createElement('div'); + this.rootNode.addEventListener('click', this._propagateClick); + + this._portalSource = dom; + + this.container.append(this.rootNode); + // Wrap children in a component to be able to update the mounted view function when portal is updated without changing mounting point + this.content = { + view: () => children || text, + }; + mount(this.rootNode, this.content, this.model, false); + } + + // eslint-disable-next-line require-jsdoc + onupdate({dom, children, text}) { + if (!this.content) { + return; + } + + this._portalSource = dom; + + // Update the view then notify, which will trigger a rendering of the new children + this.content.view = () => children || text; + this.model.notify(); + } + + // eslint-disable-next-line require-jsdoc + onremove() { + this._portalSource = null; + if (this.container.contains(this.rootNode)) { + // Unmount the node in order for its lifecycle functions to be called + mount(this.rootNode, () => null, false); + this.rootNode.removeEventListener('click', this._propagateClick); + this.rootNode.remove(); + } + } + + // eslint-disable-next-line require-jsdoc + view() { + return h('.d-none'); + } + + /** + * Propagate the given click event to the portal source if it exists + * + * @param {Event} event the click event to propagate + * @return {void} + * @private + */ + _propagateClick(event) { + if (this._portalSource) { + const eventToPropagate = new Event('click', {bubbles: true}); + const tags = documentClickTaggedEventRegistry.getEventTags(event); + documentClickTaggedEventRegistry.tagEvent(eventToPropagate, tags); + event.stopPropagation(); + this._portalSource.dispatchEvent(eventToPropagate); + } + } +} + +/** + * Create a portal to render a component outside its parent + * + * @param {Component} component the component to render + * @param {Element} [container] the container in which component should be rendered (document's body by default) + * @return {Component} the created portal that proxy the component + */ +export const createPortal = (component, container) => h(Portal, {container}, component); diff --git a/Framework/Frontend/js/src/components/getUniqueId.js b/Framework/Frontend/js/src/components/getUniqueId.js new file mode 100644 index 000000000..e05a150fb --- /dev/null +++ b/Framework/Frontend/js/src/components/getUniqueId.js @@ -0,0 +1,25 @@ +/** + * @license + * Copyright CERN and copyright holders of ALICE O2. This software is + * distributed under the terms of the GNU General Public License v3 (GPL + * Version 3), copied verbatim in the file "COPYING". + * + * See http://alice-o2.web.cern.ch/license for full licensing information. + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ + +const generator = window.crypto && window.crypto.randomUUID + ? () => window.crypto.randomUUID() + : () => `${Math.random()}-${Date.now()}`.replace('.', ''); + +/** + * Returns a probably unique identifier + * + * Uses crypto if available, but uniqueness is not guaranteed, do not use this for security purpose! + * + * @return {string} a (probably) unique identifier + */ +export const getUniqueId = () => generator(); diff --git a/Framework/Frontend/js/src/components/popover.js b/Framework/Frontend/js/src/components/popover.js new file mode 100644 index 000000000..1a2f3276b --- /dev/null +++ b/Framework/Frontend/js/src/components/popover.js @@ -0,0 +1,318 @@ +/** + * @license + * Copyright CERN and copyright holders of ALICE O2. This software is + * distributed under the terms of the GNU General Public License v3 (GPL + * Version 3), copied verbatim in the file "COPYING". + * + * See http://alice-o2.web.cern.ch/license for full licensing information. + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ + +import {h} from '../renderer.js'; +import {createPortal} from './createPortal.js'; +import {createPopoverEngine} from './PopoverEngine.js'; +import {StatefulComponent} from './StatefulComponent.js'; +import {getUniqueId} from './getUniqueId.js'; + +/** + * Default margin to apply at the edge of the display zone + * + * @type {{left: number, top: number}} + */ +const DEFAULT_DISPLAY_ZONE_MARGIN = {left: 15, top: 15}; + +/** + * @callback onTriggerNodeChange Function called when the trigger node change (this bound to the popover component instance) + * + * @this PopoverComponent + * + * @param {HTMLElement|null} previousTriggerNode the previous trigger node if it exists (null if the node is created) + * @param {HTMLElement|null} newTriggerNode the new trigger node if it exists (null if the node is removed) + * @return {void} + */ + +/** + * @callback onPopoverNodeChange Function called when the popover node change (this bound to the popover component instance) + * + * @this PopoverComponent + * + * @param {HTMLElement|null} previousPopoverNode the previous popover node if it exists (null if the node is created) + * @param {HTMLElement|null} newPopoverNode the new popover node if it exists (null if the node is removed) + * @return {void} + */ + +/** + * @callback popoverShowConditionCallback Function called before displaying the popover to eventually prevent the display + * + * @this PopoverComponent + * + * @return {boolean} if false, popover will not be displayed + */ + +/** + * @callback popoverVisibilityChangeCallback function called when the visibility of the popover changes + * + * @param {boolean} visibility the new visibility + * @return {void} + */ + +/** + * @typedef PopoverConfiguration the configuration of the popover + * + * @property {PopoverAnchor} anchor the anchor of the popover + * @property {onTriggerNodeChange} onTriggerNodeChange function called when the trigger DOM node changes + * @property {{x: number, y: number}} displayZoneMargins the margins to apply at the edges to display zone + * @property {onPopoverNodeChange} [onPopoverNodeChange] function called when the popover DOM node changes + * @property {popoverVisibilityChangeCallback} [onVisibilityChange] function called when the visibility changes + * @property {popoverShowConditionCallback} [showCondition] function called before showing the popover + * @property {string[]|string} [popoverClass] css classes to apply to the popover (in addition to the default ones) + * @property {boolean} [scroll=true] if true, popover overflow will be set to scroll + */ + +/** + * Component to display a popover triggered on specific actions + */ +class PopoverComponent extends StatefulComponent { + /** + * Constructor + * + * @param {Component} trigger the trigger component + * @param {Component} content the popover component + * @param {PopoverConfiguration} configuration the popover options + */ + constructor({attrs: {trigger, content, configuration}}) { + super(); + + this._triggerComponent = trigger; + this._contentComponent = content; + + this._isVisible = false; + + /** @type {HTMLElement|null} */ + this._popoverNode = null; + + /** @type {HTMLElement|null} */ + this._triggerNode = null; + + this.configuration = configuration; + + this._popoverKey = getUniqueId(); + + this.showPopover = this.showPopover.bind(this); + this.hidePopover = this.hidePopover.bind(this); + this.togglePopover = this.togglePopover.bind(this); + } + + // eslint-disable-next-line require-jsdoc + onbeforeupdate({attrs: {trigger, content, configuration}}) { + this._triggerComponent = trigger; + this._contentComponent = content; + this.configuration = configuration; + + this.updatePopover(); + } + + /** + * Update the popover's node visibility and position + * + * @return {void} + */ + updatePopover() { + if (this._popoverNode === null || this._triggerNode === null) { + return; + } + + if (this._isVisible) { + this._popoverNode.style.display = 'flex'; + + const engine = createPopoverEngine( + this._triggerNode, + this._popoverNode, + { + width: window.innerWidth, + height: window.innerHeight, + left: 0, + top: 0, + }, + this._displayZoneMargins, + this._anchor, + {imperativeSize: !this._scroll}, + ); + engine.reset(); + engine.fitAndPosition(); + } else { + this._popoverNode.style.display = 'none'; + } + } + + /** + * Sets the visibility of the popover + * + * @param {boolean} visibility the visibility to set + * @return {void} + */ + setVisibility(visibility) { + if (visibility !== this._isVisible) { + this._isVisible = visibility; + this.updatePopover(); + this._onVisibilityChange(visibility); + this.notify(); + } + } + + /** + * Toggle the visibility of the popover + * + * @return {void} + */ + togglePopover() { + this.setVisibility(!this._isVisible); + } + + /** + * Shows the popover + * + * @return {void} + */ + showPopover() { + this.setVisibility(this._showCondition()); + } + + /** + * Hides the popover + * + * @return {void} + */ + hidePopover() { + this.setVisibility(false); + } + + /** + * Returns the current trigger node + * + * @return {HTMLElement} the trigger node + */ + get triggerNode() { + return this._triggerNode; + } + + /** + * Set the current trigger node + * + * @param {HTMLElement} node the new trigger element + */ + set triggerNode(node) { + if (this._triggerNode !== node) { + this._onTriggerNodeChange(this._triggerNode, node); + this._triggerNode = node; + } + } + + /** + * Set the current popover node + * + * @param {HTMLElement} node the new popover element + */ + set popoverNode(node) { + if (this._popoverNode !== node) { + this._onPopoverNodeChange(this._popoverNode, node); + this._popoverNode = node; + this.updatePopover(); + } + } + + /** + * Renders the component + * + * @return {Component} the popover component + */ + view() { + return [ + h('.popover-trigger', { + ['data-popover-key']: this._popoverKey, + oncreate: ({dom}) => { + this.triggerNode = dom; + }, + onupdate: ({dom}) => { + this.triggerNode = dom; + }, + onremove: () => { + this.triggerNode = null; + }, + }, this._triggerComponent), + createPortal(h('', { + class: [ + 'popover', + 'shadow-level3', + 'br2', + 'bg-white', + ...this._scroll ? ['scroll-x', 'scroll-y'] : [], + ...this._popoverClasses, + ].join(' '), + ['data-popover-key']: this._popoverKey, + oncreate: ({dom}) => { + this.popoverNode = dom; + }, + onupdate: ({dom}) => { + this.popoverNode = dom; + }, + onremove: () => { + this.popoverNode = null; + }, + }, this._contentComponent)), + ]; + } + + /** + * Return the unique popover key + * + * @return {string} the key + */ + get key() { + return this._popoverKey; + } + + /** + * Set the current configuration + * + * @param {PopoverConfiguration} configuration the popover options + */ + set configuration(configuration) { + const { + anchor, + onTriggerNodeChange, + onPopoverNodeChange = () => { + }, + onVisibilityChange = () => { + }, + showCondition, + popoverClass = [], + displayZoneMargins = {}, + scroll = true, + } = configuration; + this._anchor = anchor; + this._onTriggerNodeChange = onTriggerNodeChange.bind(this); + this._onPopoverNodeChange = onPopoverNodeChange.bind(this); + this._onVisibilityChange = onVisibilityChange.bind(this); + this._showCondition = showCondition ? showCondition.bind(this) : () => true; + this._popoverClasses = Array.isArray(popoverClass) ? popoverClass : [popoverClass]; + this._displayZoneMargins = { + ...DEFAULT_DISPLAY_ZONE_MARGIN, + ...displayZoneMargins, + }; + this._scroll = scroll; + } +} + +/** + * Display a popover and its trigger (trigger is always displayed) + * + * @param {Component} trigger the element which will display the popover when popover is active + * @param {Component} content the actual content of the popover + * @param {PopoverConfiguration} configuration the popover configuration + * @returns {Component} the resulting trigger and popover + */ +export const popover = (trigger, content, configuration) => h(PopoverComponent, {trigger, content, configuration}); diff --git a/Framework/Frontend/js/src/index.js b/Framework/Frontend/js/src/index.js index 7a9a88a14..25671cdd3 100644 --- a/Framework/Frontend/js/src/index.js +++ b/Framework/Frontend/js/src/index.js @@ -23,6 +23,7 @@ export { default as QueryRouter } from './QueryRouter.js'; // Utils export { default as switchCase } from './switchCase.js'; +export { documentClickTaggedEventRegistry } from './utilities/documentClickTaggedEventRegistry.js'; // Formatters export { formatTimeDuration } from './formatter/formatTimeDuration.js'; @@ -36,6 +37,16 @@ export { default as WebSocketClient } from './WebSocketClient.js'; export { default as Loader } from './Loader.js'; export { default as BrowserStorage } from './BrowserStorage.js'; +// Reusable components +export { StatefulComponent } from './components/StatefulComponent.js'; +export { CopyToClipboardComponent } from './components/CopyToClipboardComponent.js'; +export { createPortal } from './components/createPortal.js'; +export { DropdownComponent } from './components/DropdownComponent.js'; +export { getUniqueId } from './components/getUniqueId.js'; +export { popover } from './components/popover.js'; +export { PopoverAnchors } from './components/PopoverEngine.js'; +export { PopoverTriggerPreConfiguration } from './components/PopoverPreConfigurations.js'; + // All icons helpers, namespaced with prefix 'icon*' export * from './icons.js'; diff --git a/Framework/Frontend/js/src/utilities/documentClickTaggedEventRegistry.js b/Framework/Frontend/js/src/utilities/documentClickTaggedEventRegistry.js new file mode 100644 index 000000000..eb4ba74c3 --- /dev/null +++ b/Framework/Frontend/js/src/utilities/documentClickTaggedEventRegistry.js @@ -0,0 +1,104 @@ +/** + * @license + * Copyright CERN and copyright holders of ALICE O2. This software is + * distributed under the terms of the GNU General Public License v3 (GPL + * Version 3), copied verbatim in the file "COPYING". + * + * See http://alice-o2.web.cern.ch/license for full licensing information. + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ + +/** + * Registry to handle tagged events + * This system allow to + * - add tags on some events at one point of the bubbling + * - listen to events that DO not have a given tags + * + * In order to work, an event listener must flush the registry in the last handler of the bubbling list + */ +class TaggedEventRegistry { + /** + * Constructor + */ + constructor() { + this._listenersExceptTagged = new Map(); + this._eventTagsMap = new Map(); + } + + /** + * Add a listener that will be triggered when registry is flushed with an event that contains NONE of the given tags + * To avoid memory leaks, do not forget to unregister the listener when needed + * + * @param {function} listener the listener to call if none of the tags is applied to the event + * @param {...string[]} tags the list of tags that the event must NOT have to trigger listener + * + * @return {void} + */ + addListenerForAnyExceptTagged(listener, ...tags) { + const unifiedTags = [ + ...tags, + ...this._listenersExceptTagged.get(listener) || [], + ]; + this._listenersExceptTagged.set(listener, unifiedTags); + } + + /** + * Remove the given listener from the notification list (it will NEVER be called anymore) + * The given function must be the same reference that the one passed to {@see addListenerForAnyExceptTagged} + * + * @param {function} listener the listener for which restriction must be edited + * + * @return {void} + */ + removeListener(listener) { + this._listenersExceptTagged.delete(listener); + } + + /** + * Add a tag to a given event + * + * @param {Event} e the event to tag + * @param {string|string[]} tag the tag to add + * + * @return {void} + */ + tagEvent(e, tag) { + if (!this._eventTagsMap.has(e)) { + this._eventTagsMap.set(e, []); + } + this._eventTagsMap.get(e).push(...Array.isArray(tag) ? tag : [tag]); + } + + /** + * Call all the registered listeners for which the given event's tags match the restrictions + * + * @param {Event} e the event to listen to + * + * @return {void} + */ + flush(e) { + const eventTags = this._eventTagsMap.get(e) || []; + this._listenersExceptTagged.forEach((tags, listener) => { + if (!tags.some((tag) => eventTags.includes(tag))) { + listener(e); + } + }); + this._eventTagsMap = new Map(); + } + + /** + * Returns the tags related to a given event + * + * @param {Event} e the event + * @return {string[]} the tags attached to the event + */ + getEventTags(e) { + return this._eventTagsMap.get(e); + } +} + +export const documentClickTaggedEventRegistry = new TaggedEventRegistry(); +document.addEventListener('click', documentClickTaggedEventRegistry.flush.bind(documentClickTaggedEventRegistry));