summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/simple/package-lock.json711
-rw-r--r--client/simple/package.json5
-rw-r--r--client/simple/src/svg/information-circle-outline.svg6
-rw-r--r--client/simple/src/svg/ionicons/information-circle-outline.svg6
-rw-r--r--client/simple/src/svg/ionicons/newspaper-outline.svg6
-rw-r--r--client/simple/theme_icons.js80
-rw-r--r--client/simple/tools/jinja_svg_catalog.html.edge26
-rw-r--r--client/simple/tools/jinja_svg_catalog.js130
8 files changed, 612 insertions, 358 deletions
diff --git a/client/simple/package-lock.json b/client/simple/package-lock.json
index 7c93e4e2e..336cbacca 100644
--- a/client/simple/package-lock.json
+++ b/client/simple/package-lock.json
@@ -14,9 +14,11 @@
"@eslint/js": "^9.19.0",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.2",
+ "edge.js": "^6.2.1",
"eslint": "^9.19.0",
"filemanager-webpack-plugin": "^8.0.0",
"globals": "^15.14.0",
+ "ionicons": "^7.4.0",
"leaflet": "^1.9.4",
"less": "^4.2.2",
"less-loader": "^12.2.0",
@@ -347,137 +349,6 @@
"url": "https://github.com/sponsors/nzakas"
}
},
- "node_modules/@img/sharp-darwin-arm64": {
- "version": "0.33.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz",
- "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-darwin-arm64": "1.0.4"
- }
- },
- "node_modules/@img/sharp-darwin-x64": {
- "version": "0.33.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz",
- "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-darwin-x64": "1.0.4"
- }
- },
- "node_modules/@img/sharp-libvips-darwin-arm64": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz",
- "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "darwin"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@img/sharp-libvips-darwin-x64": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz",
- "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "darwin"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@img/sharp-libvips-linux-arm": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz",
- "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "linux"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@img/sharp-libvips-linux-arm64": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz",
- "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "linux"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@img/sharp-libvips-linux-s390x": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz",
- "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==",
- "cpu": [
- "s390x"
- ],
- "dev": true,
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "linux"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
"node_modules/@img/sharp-libvips-linux-x64": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz",
@@ -495,109 +366,6 @@
"url": "https://opencollective.com/libvips"
}
},
- "node_modules/@img/sharp-libvips-linuxmusl-arm64": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz",
- "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "linux"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@img/sharp-libvips-linuxmusl-x64": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz",
- "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "linux"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@img/sharp-linux-arm": {
- "version": "0.33.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz",
- "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linux-arm": "1.0.5"
- }
- },
- "node_modules/@img/sharp-linux-arm64": {
- "version": "0.33.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz",
- "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linux-arm64": "1.0.4"
- }
- },
- "node_modules/@img/sharp-linux-s390x": {
- "version": "0.33.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz",
- "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==",
- "cpu": [
- "s390x"
- ],
- "dev": true,
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linux-s390x": "1.0.4"
- }
- },
"node_modules/@img/sharp-linux-x64": {
"version": "0.33.5",
"resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz",
@@ -621,123 +389,6 @@
"@img/sharp-libvips-linux-x64": "1.0.4"
}
},
- "node_modules/@img/sharp-linuxmusl-arm64": {
- "version": "0.33.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz",
- "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linuxmusl-arm64": "1.0.4"
- }
- },
- "node_modules/@img/sharp-linuxmusl-x64": {
- "version": "0.33.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz",
- "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "Apache-2.0",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linuxmusl-x64": "1.0.4"
- }
- },
- "node_modules/@img/sharp-wasm32": {
- "version": "0.33.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz",
- "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==",
- "cpu": [
- "wasm32"
- ],
- "dev": true,
- "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
- "optional": true,
- "dependencies": {
- "@emnapi/runtime": "^1.2.0"
- },
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@img/sharp-wasm32/node_modules/@emnapi/runtime": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.3.1.tgz",
- "integrity": "sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==",
- "dev": true,
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "tslib": "^2.4.0"
- }
- },
- "node_modules/@img/sharp-win32-ia32": {
- "version": "0.33.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz",
- "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==",
- "cpu": [
- "ia32"
- ],
- "dev": true,
- "license": "Apache-2.0 AND LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@img/sharp-win32-x64": {
- "version": "0.33.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz",
- "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "Apache-2.0 AND LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.8",
"dev": true,
@@ -821,6 +472,16 @@
"ieee754": "^1.2.1"
}
},
+ "node_modules/@lukeed/ms": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.2.tgz",
+ "integrity": "sha512-9I2Zn6+NJLfaGoz9jN3lpwDgAYvfGeNYdbAIjJOqzs4Tpc+VU3Jqq4IofSUBKajiDS8k9fZIg18/z13mpk1bsA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
"dev": true,
@@ -853,6 +514,84 @@
"node": ">= 8"
}
},
+ "node_modules/@poppinss/exception": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.0.tgz",
+ "integrity": "sha512-WLneXKQYNClhaMXccO111VQmZahSrcSRDaHRbV6KL5R4pTvK87fMn/MXLUcvOjk0X5dTHDPKF61tM7j826wrjQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.6.0"
+ }
+ },
+ "node_modules/@poppinss/inspect": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@poppinss/inspect/-/inspect-1.0.1.tgz",
+ "integrity": "sha512-kLeEaBSGhlleyYvKc7c9s3uE6xv7cwyulE0EgHf4jU/CL96h0yC4mkdw1wvC1l1PYYQozCGy46FwMBAAMOobCA==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/@poppinss/macroable": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@poppinss/macroable/-/macroable-1.0.4.tgz",
+ "integrity": "sha512-ct43jurbe7lsUX5eIrj4ijO3j/6zIPp7CDnFWXDs7UPAbw1Pu1iH3oAmFdP4jcskKJBURH5M9oTtyeiUXyHX8Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.16.0"
+ }
+ },
+ "node_modules/@poppinss/object-builder": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@poppinss/object-builder/-/object-builder-1.1.0.tgz",
+ "integrity": "sha512-FOrOq52l7u8goR5yncX14+k+Ewi5djnrt1JwXeS/FvnwAPOiveFhiczCDuvXdssAwamtrV2hp5Rw9v+n2T7hQg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.6.0"
+ }
+ },
+ "node_modules/@poppinss/string": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/@poppinss/string/-/string-1.2.0.tgz",
+ "integrity": "sha512-1z78zjqhfjqsvWr+pQzCpRNcZpIM+5vNY5SFOvz28GrL/LRanwtmOku5tBX7jE8/ng3oXaOVrB59lnnXFtvkug==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@lukeed/ms": "^2.0.2",
+ "@types/bytes": "^3.1.5",
+ "@types/pluralize": "^0.0.33",
+ "bytes": "^3.1.2",
+ "case-anything": "^3.1.0",
+ "pluralize": "^8.0.0",
+ "slugify": "^1.6.6",
+ "truncatise": "^0.0.8"
+ },
+ "engines": {
+ "node": ">=20.6.0"
+ }
+ },
+ "node_modules/@poppinss/utils": {
+ "version": "6.9.2",
+ "resolved": "https://registry.npmjs.org/@poppinss/utils/-/utils-6.9.2.tgz",
+ "integrity": "sha512-ypVszZxhwiehhklM5so2BI+nClQJwp7mBUSJh/R1GepeUH1vvD5GtxMz8Lp9dO9oAbKyDmq1jc4g/4E0dv8r2g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@poppinss/exception": "^1.2.0",
+ "@poppinss/object-builder": "^1.1.0",
+ "@poppinss/string": "^1.1.0",
+ "flattie": "^1.1.1",
+ "safe-stable-stringify": "^2.5.0",
+ "secure-json-parse": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=18.16.0"
+ }
+ },
"node_modules/@rollup/pluginutils": {
"version": "5.1.4",
"dev": true,
@@ -920,6 +659,20 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/@stencil/core": {
+ "version": "4.25.3",
+ "resolved": "https://registry.npmjs.org/@stencil/core/-/core-4.25.3.tgz",
+ "integrity": "sha512-wYSMS59jxB2ulWF8oNYOCMCo4NhGsvopn0Q7l7MBDQPRluBrodKRMfJiDV40tkJfYB4tq7o2TvgjcacH1gDNvQ==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "stencil": "bin/stencil"
+ },
+ "engines": {
+ "node": ">=16.0.0",
+ "npm": ">=7.10.0"
+ }
+ },
"node_modules/@trysound/sax": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz",
@@ -938,6 +691,13 @@
"@types/readdir-glob": "*"
}
},
+ "node_modules/@types/bytes": {
+ "version": "3.1.5",
+ "resolved": "https://registry.npmjs.org/@types/bytes/-/bytes-3.1.5.tgz",
+ "integrity": "sha512-VgZkrJckypj85YxEsEavcMmmSOIzkUHqWmM4CCyia5dc54YwsXzJ5uT4fYxBQNEXx+oF1krlhgCbvfubXqZYsQ==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@types/eslint": {
"version": "9.6.1",
"dev": true,
@@ -974,6 +734,13 @@
"undici-types": "~6.20.0"
}
},
+ "node_modules/@types/pluralize": {
+ "version": "0.0.33",
+ "resolved": "https://registry.npmjs.org/@types/pluralize/-/pluralize-0.0.33.tgz",
+ "integrity": "sha512-JOqsl+ZoCpP4e8TDke9W79FDcSgPAR0l6pixx2JHkhnRjvShyYiAYw2LVsnA7K08Y6DeOnaU6ujmENO4os/cYg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@types/readdir-glob": {
"version": "1.1.5",
"dev": true,
@@ -1373,6 +1140,16 @@
"node": ">=8"
}
},
+ "node_modules/astring": {
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/astring/-/astring-1.9.0.tgz",
+ "integrity": "sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "astring": "bin/astring"
+ }
+ },
"node_modules/async": {
"version": "3.2.6",
"dev": true,
@@ -1514,6 +1291,16 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/bytes": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
"node_modules/cacheable": {
"version": "1.8.8",
"dev": true,
@@ -1558,6 +1345,19 @@
],
"license": "CC-BY-4.0"
},
+ "node_modules/case-anything": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/case-anything/-/case-anything-3.1.0.tgz",
+ "integrity": "sha512-rRYnn5Elur8RuNHKoJ2b0tgn+pjYxL7BzWom+JZ7NKKn1lt/yGV/tUNwOovxYa9l9VL5hnXQdMc+mENbhJzosQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/mesqueeb"
+ }
+ },
"node_modules/chalk": {
"version": "4.1.2",
"dev": true,
@@ -1615,6 +1415,13 @@
"node": ">=6.0"
}
},
+ "node_modules/classnames": {
+ "version": "2.5.1",
+ "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz",
+ "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/clean-stack": {
"version": "2.2.0",
"dev": true,
@@ -2150,6 +1957,70 @@
"node": ">=8"
}
},
+ "node_modules/edge-error": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/edge-error/-/edge-error-4.0.2.tgz",
+ "integrity": "sha512-jB76VYn8wapDHKHSOmP3vbKLoa77RJYsTLNmfl8+cuCD69uxZtP3h+kqV+Prw/YkYmN7yHyp4IApE15pDByk0A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.16.0"
+ }
+ },
+ "node_modules/edge-lexer": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/edge-lexer/-/edge-lexer-6.0.3.tgz",
+ "integrity": "sha512-/s15CNnfhZv97bsW+ZgV5rtONULYjhCDYu+usbVLqZ8UQ6b/hQUNvQSIQBXA6Gql9dm72TMBB9sb/eWM2esufg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "edge-error": "^4.0.2"
+ },
+ "engines": {
+ "node": ">=18.16.0"
+ }
+ },
+ "node_modules/edge-parser": {
+ "version": "9.0.4",
+ "resolved": "https://registry.npmjs.org/edge-parser/-/edge-parser-9.0.4.tgz",
+ "integrity": "sha512-vnjzfpqpjM4Mjt9typc1zLoFpC1F6kAObfcdyA6rSy+izIPji2RaQz5jWx5s5iG9hNcuyjtNyGRCLFVfoYhWcA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "acorn": "^8.14.0",
+ "astring": "^1.9.0",
+ "edge-error": "^4.0.2",
+ "edge-lexer": "^6.0.3",
+ "js-stringify": "^1.0.2"
+ },
+ "engines": {
+ "node": ">=18.16.0"
+ }
+ },
+ "node_modules/edge.js": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/edge.js/-/edge.js-6.2.1.tgz",
+ "integrity": "sha512-me875zh6YA0V429hywgQIpHgMvQkondv5XHaP6EsL2yIBpLcBWCl7Ba1cai0SwYhp8iD0IyV3KjpxLrnW7S2Ag==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@poppinss/inspect": "^1.0.1",
+ "@poppinss/macroable": "^1.0.4",
+ "@poppinss/utils": "^6.9.2",
+ "classnames": "^2.5.1",
+ "edge-error": "^4.0.2",
+ "edge-lexer": "^6.0.3",
+ "edge-parser": "^9.0.4",
+ "fs-readdir-recursive": "^1.1.0",
+ "he": "^1.2.0",
+ "js-stringify": "^1.0.2",
+ "property-information": "^6.5.0",
+ "stringify-attributes": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=18.16.0"
+ }
+ },
"node_modules/electron-to-chromium": {
"version": "1.5.90",
"dev": true,
@@ -2276,6 +2147,19 @@
"node": ">=6"
}
},
+ "node_modules/escape-goat": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-4.0.0.tgz",
+ "integrity": "sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/escape-string-regexp": {
"version": "4.0.0",
"dev": true,
@@ -2598,6 +2482,16 @@
"dev": true,
"license": "ISC"
},
+ "node_modules/flattie": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/flattie/-/flattie-1.1.1.tgz",
+ "integrity": "sha512-9UbaD6XdAL97+k/n+N7JwX46K/M6Zc6KcFYskrYL8wbBV/Uyk0CTAMY0VT+qiK5PM7AIc9aTWYtq65U7T+aCNQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/fs-constants": {
"version": "1.0.0",
"dev": true,
@@ -2616,6 +2510,13 @@
"node": ">=12"
}
},
+ "node_modules/fs-readdir-recursive": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz",
+ "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/fs.realpath": {
"version": "1.0.0",
"dev": true,
@@ -2769,6 +2670,16 @@
"node": ">= 0.4"
}
},
+ "node_modules/he": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
+ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "he": "bin/he"
+ }
+ },
"node_modules/hookified": {
"version": "1.7.0",
"dev": true,
@@ -2923,6 +2834,16 @@
"node": ">=10.13.0"
}
},
+ "node_modules/ionicons": {
+ "version": "7.4.0",
+ "resolved": "https://registry.npmjs.org/ionicons/-/ionicons-7.4.0.tgz",
+ "integrity": "sha512-ZK94MMqgzMCPPMhmk8Ouu6goyVHFIlw/ACP6oe3FrikcI0N7CX0xcwVaEbUc0G/v3W0shI93vo+9ve/KpvcNhQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@stencil/core": "^4.0.3"
+ }
+ },
"node_modules/is-binary-path": {
"version": "2.1.0",
"dev": true,
@@ -3060,6 +2981,13 @@
"url": "https://github.com/chalk/supports-color?sponsor=1"
}
},
+ "node_modules/js-stringify": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz",
+ "integrity": "sha512-rtS5ATOo2Q5k1G+DADISilDA6lv79zIiwFd6CcjuIxGKLFm5C+RLImRscVap9k55i+MOZwgliw+NejvkLuGD5g==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/js-tokens": {
"version": "4.0.0",
"dev": true,
@@ -3704,6 +3632,16 @@
"node": ">=8"
}
},
+ "node_modules/pluralize": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz",
+ "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/postcss": {
"version": "8.5.1",
"dev": true,
@@ -3883,6 +3821,17 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/property-information": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.5.0.tgz",
+ "integrity": "sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/prr": {
"version": "1.0.1",
"dev": true,
@@ -4141,6 +4090,16 @@
],
"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==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/safer-buffer": {
"version": "2.1.2",
"dev": true,
@@ -4202,6 +4161,23 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/secure-json-parse": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-3.0.2.tgz",
+ "integrity": "sha512-H6nS2o8bWfpFEV6U38sOSjS7bTbdgbCGU9wEM6W14P5H0QOsz94KCusifV44GpHDTu2nqZbuDNhTzu+mjDSw1w==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fastify"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/fastify"
+ }
+ ],
+ "license": "BSD-3-Clause"
+ },
"node_modules/semver": {
"version": "7.7.0",
"dev": true,
@@ -4326,6 +4302,16 @@
"url": "https://github.com/chalk/slice-ansi?sponsor=1"
}
},
+ "node_modules/slugify": {
+ "version": "1.6.6",
+ "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.6.tgz",
+ "integrity": "sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
"node_modules/source-map": {
"version": "0.6.1",
"dev": true,
@@ -4372,6 +4358,22 @@
"node": ">=8"
}
},
+ "node_modules/stringify-attributes": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/stringify-attributes/-/stringify-attributes-4.0.0.tgz",
+ "integrity": "sha512-6Hq3K153wTTfhEHb4V/viuqmb0DRn08JCrRnmqc4Q/tmoNuvd4DEyqkiiJXtvVz8ZSUhlCQr7zCpCVTgrelesg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "escape-goat": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/strip-ansi": {
"version": "6.0.1",
"dev": true,
@@ -4923,6 +4925,13 @@
"node": ">=8.0"
}
},
+ "node_modules/truncatise": {
+ "version": "0.0.8",
+ "resolved": "https://registry.npmjs.org/truncatise/-/truncatise-0.0.8.tgz",
+ "integrity": "sha512-cXzueh9pzBCsLzhToB4X4gZCb3KYkrsAcBAX97JnazE74HOl3cpBJYEV7nabHeG/6/WXCU5Yujlde/WPBUwnsg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/tslib": {
"version": "2.8.1",
"dev": true,
diff --git a/client/simple/package.json b/client/simple/package.json
index 77660cd0d..2e38f67d6 100644
--- a/client/simple/package.json
+++ b/client/simple/package.json
@@ -4,15 +4,18 @@
"type": "module",
"scripts": {
"build": "vite build",
- "fix": "eslint --fix && stylelint --fix strict 'src/**/*.{css,scss,sass,less,styl,vue,svelte}'"
+ "fix": "eslint --fix && stylelint --fix strict 'src/**/*.{css,scss,sass,less,styl,vue,svelte}'",
+ "icons.html": "node theme_icons.js"
},
"devDependencies": {
"@eslint/js": "^9.19.0",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.2",
+ "edge.js": "^6.2.1",
"eslint": "^9.19.0",
"filemanager-webpack-plugin": "^8.0.0",
"globals": "^15.14.0",
+ "ionicons": "^7.4.0",
"leaflet": "^1.9.4",
"less": "^4.2.2",
"less-loader": "^12.2.0",
diff --git a/client/simple/src/svg/information-circle-outline.svg b/client/simple/src/svg/information-circle-outline.svg
deleted file mode 100644
index b7c300094..000000000
--- a/client/simple/src/svg/information-circle-outline.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" class="ionicon" viewBox="0 0 512 512">
- <title>Information Circle</title>
- <path d="M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184 184-82.39 184-184S349.61 64 248 64z" fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M220 220h32v116"/>
- <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M208 340h88"/>
- <path fill="currentColor" stroke="currentColor" stroke-linecap="round" d="M248 130a26 26 0 1026 26 26 26 0 00-26-26z"/>
-</svg> \ No newline at end of file
diff --git a/client/simple/src/svg/ionicons/information-circle-outline.svg b/client/simple/src/svg/ionicons/information-circle-outline.svg
new file mode 100644
index 000000000..483062105
--- /dev/null
+++ b/client/simple/src/svg/ionicons/information-circle-outline.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
+ <path d="M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184 184-82.39 184-184S349.61 64 248 64z" fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32"/>
+ <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M220 220h32v116"/>
+ <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M208 340h88"/>
+ <path d="M248 130a26 26 0 1026 26 26 26 0 00-26-26z" fill="currentColor" stroke="currentColor" stroke-miterlimit="10" stroke-width="1"/>
+</svg>
diff --git a/client/simple/src/svg/ionicons/newspaper-outline.svg b/client/simple/src/svg/ionicons/newspaper-outline.svg
new file mode 100644
index 000000000..5b743865b
--- /dev/null
+++ b/client/simple/src/svg/ionicons/newspaper-outline.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
+ <path d="M368 415.86V72a24.07 24.07 0 00-24-24H72a24.07 24.07 0 00-24 24v352a40.12 40.12 0 0040 40h328" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/>
+ <path d="M416 464h0a48 48 0 01-48-48V128h72a24 24 0 0124 24v264a48 48 0 01-48 48z" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/>
+ <path d="M240 128h64M240 192h64M112 256h192M112 320h192M112 384h192" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/>
+ <path d="M176 208h-64a16 16 0 01-16-16v-64a16 16 0 0116-16h64a16 16 0 0116 16v64a16 16 0 01-16 16z" fill="currentColor" stroke="currentColor" stroke-linejoin="round" stroke-width="1" />
+</svg>
diff --git a/client/simple/theme_icons.js b/client/simple/theme_icons.js
new file mode 100644
index 000000000..04ae89614
--- /dev/null
+++ b/client/simple/theme_icons.js
@@ -0,0 +1,80 @@
+/**
+ * Generate icons.html for the jinja templates of the simple theme.
+ */
+
+import { argv } from "node:process";
+import { dirname, resolve } from "node:path";
+import { jinja_svg_sets } from "./tools/jinja_svg_catalog.js";
+
+const HERE = dirname(argv[1]) + "/";
+const dest = resolve(HERE, "../../searx/templates/simple/icons.html");
+
+/** @type import("./tools/jinja_svg_catalog.js").JinjaMacro[] */
+const searxng_jinja_macros = [
+ { name: "icon", class: "ion-icon" },
+ { name: "icon_small", class: "ion-icon-small" },
+ { name: "icon_big", class: "ion-icon-big" },
+];
+
+
+const sxng_icon_opts ={
+ multipass: true,
+ plugins: [
+ { name: "removeTitle" },
+ { name: "removeXMLNS" },
+ { name: "addAttributesToSVGElement",
+ params: {
+ attributes: [
+ {
+ "aria-hidden": "true",
+ }]}}]
+};
+
+
+/** @type import("./tools/jinja_svg_catalog.js").IconSet */
+const simple_icons = [
+ {
+ base: resolve(HERE, "node_modules/ionicons/dist/svg"),
+ set: {
+ "alert": "alert-outline.svg",
+ "appstore": "apps-outline.svg",
+ "book": "book-outline.svg",
+ "close": "close-outline.svg",
+ "ellipsis-vertical": "ellipsis-vertical-outline.svg",
+ "file-tray-full": "file-tray-full-outline.svg",
+ "film": "film-outline.svg",
+ "globe": "globe-outline.svg",
+ "heart": "heart-outline.svg",
+ "image": "image-outline.svg",
+ "layers": "layers-outline.svg",
+ "location": "location-outline.svg",
+ "magnet": "magnet-outline.svg",
+ "musical-notes": "musical-notes-outline.svg",
+ "navigate-down": "chevron-down-outline.svg",
+ "navigate-left": "chevron-back-outline.svg",
+ "navigate-right": "chevron-forward-outline.svg",
+ "navigate-up": "chevron-up-outline.svg",
+ "people": "people-outline.svg",
+ "play": "play-outline.svg",
+ "radio": "radio-outline.svg",
+ "school": "school-outline.svg",
+ "search": "search-outline.svg",
+ "settings": "settings-outline.svg",
+ "tv": "tv-outline.svg",
+ },
+ svgo_opts: sxng_icon_opts,
+ },
+ // some of the ionicons are not suitable for a dark theme, we fixed the svg
+ // manually in src/svg/ionicons
+ // - https://github.com/searxng/searxng/pull/4284#issuecomment-2680550342
+ {
+ base: resolve(HERE, "src/svg/ionicons"),
+ set: {
+ "information-circle": "information-circle-outline.svg",
+ "newspaper": "newspaper-outline.svg",
+ },
+ svgo_opts: sxng_icon_opts,
+ }
+];
+
+jinja_svg_sets(dest, searxng_jinja_macros, simple_icons);
diff --git a/client/simple/tools/jinja_svg_catalog.html.edge b/client/simple/tools/jinja_svg_catalog.html.edge
new file mode 100644
index 000000000..ffec58cd5
--- /dev/null
+++ b/client/simple/tools/jinja_svg_catalog.html.edge
@@ -0,0 +1,26 @@
+{{--
+This is a EDGE https://edgejs.dev/ template to generate a HTML Jinja template
+for the backend. Example output of this EDGE template:
+- https://github.com/searxng/searxng/blob/master/searx/templates/simple/icons.html
+--}}
+{#
+Catalog of SVG symbols that can be inserted into the HTML output of a Jinja
+template. This file from:
+
+ client/simple/tools/icon_catalog.edge.html
+#}
+
+{%-
+set catalog = {
+@each((svg, name) in svg_catalog)
+ "{{{name}}}" : """{{{svg}}}""",
+@end
+}
+-%}
+
+@each(macro in macros)
+
+{% macro {{ macro.name }}(action, alt) -%}
+ {{ open_curly_brace }} catalog[action] | replace("{{__jinja_class_placeholder__}}", "{{ macro.class }}") | safe {{ close_curly_brace }}
+{%- endmacro %}
+@end
diff --git a/client/simple/tools/jinja_svg_catalog.js b/client/simple/tools/jinja_svg_catalog.js
new file mode 100644
index 000000000..0adffa5af
--- /dev/null
+++ b/client/simple/tools/jinja_svg_catalog.js
@@ -0,0 +1,130 @@
+import fs from "fs";
+import { resolve, dirname } from "path";
+import { Edge } from 'edge.js';
+import { optimize as svgo } from "svgo";
+import { fileURLToPath } from 'url';
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+const __jinja_class_placeholder__ = "__jinja_class_placeholder__";
+
+// -- types
+
+/**
+ * @typedef {object} IconSet - A set of icons
+ * @property {object[]} set - Array of SVG icons, where property name is the
+ * name of the icon and value is the src of the SVG (relative to base).
+ * @property {string} base - Folder in which the SVG src files are located.
+ * @property {import("svgo").Config} svgo_opts - svgo options for this set.
+ */
+
+/**
+ * @typedef {object} IconSVG - Mapping of icon name to SVG source file.
+ * @property {string} name - Name of the icon isource file.
+ * @property {string} src - Name of the destination file.
+ * @property {import("svgo").Config} svgo_opts - Options passed to svgo.
+ */
+
+/**
+ * @typedef {object} JinjaMacro - Arguments to create a jinja macro
+ * @property {string} name - Name of the jinja macro.
+ * @property {string} class - SVG's class name (value of XML class attribute)
+ */
+
+
+// -- functions
+
+/**
+ * Generate a jinja template with a catalog of SVG icons that can be
+ * used in in other HTML jinja templates.
+ *
+ * @param {string} dest - filename of the generate jinja template.
+ * @param {JinjaMacro} macros - Jinja macros to create.
+ * @param {IconSVG[]} items - Array of SVG items.
+ */
+
+function jinja_svg_catalog(dest, macros, items) {
+
+ const svg_catalog = {};
+ const edge_template = resolve(__dirname, "jinja_svg_catalog.html.edge");
+
+ items.forEach(
+ (item) => {
+
+ /** @type {import("svgo").Config} */
+ const svgo_opts = JSON.parse(JSON.stringify(item.svgo_opts));
+ svgo_opts.plugins.push({
+ name: "addAttributesToSVGElement",
+ params: {
+ attributes: [{ "class": __jinja_class_placeholder__, }]
+ }}
+ );
+
+ try {
+ const raw = fs.readFileSync(item.src, "utf8");
+ const opt = svgo(raw, svgo_opts);
+ svg_catalog[item.name] = opt.data;
+ } catch (err) {
+ console.error(`ERROR: jinja_svg_catalog processing ${item.name} src: ${item.src} -- ${err}`);
+ throw(err);
+ }
+ }
+ );
+
+ fs.mkdir(dirname(dest), { recursive: true }, (err) => {
+ if (err) throw err;
+ });
+
+ const ctx = {
+ svg_catalog: svg_catalog,
+ macros: macros,
+ edge_template: edge_template,
+ __jinja_class_placeholder__: __jinja_class_placeholder__,
+ // see https://github.com/edge-js/edge/issues/162
+ open_curly_brace : "{{",
+ close_curly_brace : "}}"
+ };
+
+ const jinjatmpl = Edge.create().renderRawSync(
+ fs.readFileSync(edge_template, "utf-8"),
+ ctx
+ );
+
+ fs.writeFileSync(dest, jinjatmpl);
+ console.log(`[jinja_svg_catalog] created: ${dest}`);
+}
+
+
+/**
+ * Calls jinja_svg_catalog for a collection of icon sets where each set has its
+ * own parameters.
+ *
+ * @param {string} dest - filename of the generate jinja template.
+ * @param {JinjaMacro} macros - Jinja macros to create.
+ * @param {IconSet[]} sets - Array of SVG sets.
+ */
+function jinja_svg_sets(dest, macros, sets) {
+ /** @type IconSVG[] */
+ const items = [];
+ const all = [];
+ for (const obj of sets) {
+
+ for (const [name, file] of Object.entries(obj.set)) {
+ if (all.includes(name)) {
+ throw new Error(`ERROR: ${name} has already been defined`);
+ }
+ items.push({
+ name: name,
+ src: resolve(obj.base, file),
+ svgo_opts: obj.svgo_opts,
+ });
+ }
+ jinja_svg_catalog(dest, macros, items);
+ }
+}
+
+// -- exports
+
+export {
+ jinja_svg_sets,
+ jinja_svg_catalog,
+};