Merge branch 'develop'

This commit is contained in:
Alice Gaudon 2021-11-21 20:25:08 +01:00
commit 6e630c2715
5 changed files with 35 additions and 14 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "swaf", "name": "swaf",
"version": "0.24.7", "version": "0.24.8",
"description": "Structure Web Application Framework.", "description": "Structure Web Application Framework.",
"repository": "https://eternae.ink/ashpie/swaf", "repository": "https://eternae.ink/ashpie/swaf",
"author": "Alice Gaudon <alice@gaudon.pro>", "author": "Alice Gaudon <alice@gaudon.pro>",
@ -70,6 +70,7 @@
"dependencies": { "dependencies": {
"@rollup/plugin-commonjs": "^21.0.1", "@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-node-resolve": "^13.0.6", "@rollup/plugin-node-resolve": "^13.0.6",
"@rollup/plugin-url": "^6.1.0",
"argon2": "^0.28.2", "argon2": "^0.28.2",
"clear-module": "^4.1.1", "clear-module": "^4.1.1",
"compression": "^1.7.4", "compression": "^1.7.4",
@ -98,7 +99,7 @@
"rollup-plugin-svelte": "^7.1.0", "rollup-plugin-svelte": "^7.1.0",
"rollup-plugin-terser": "^7.0.2", "rollup-plugin-terser": "^7.0.2",
"svelte": "^3.35.0", "svelte": "^3.35.0",
"svelte-preprocess": "4.6.9", "svelte-preprocess": "^4.9.8",
"ts-node": "^10.4.0", "ts-node": "^10.4.0",
"tslog": "^3.0.1", "tslog": "^3.0.1",
"uuid": "^8.0.0", "uuid": "^8.0.0",

View File

@ -6,6 +6,7 @@ import commonjs from "@rollup/plugin-commonjs";
import {terser} from "rollup-plugin-terser"; import {terser} from "rollup-plugin-terser";
import livereloadRollupPlugin from "rollup-plugin-livereload"; import livereloadRollupPlugin from "rollup-plugin-livereload";
import imageminPlugin from "rollup-plugin-imagemin"; import imageminPlugin from "rollup-plugin-imagemin";
import url from "@rollup/plugin-url";
const production = process.env.ENV === 'production'; const production = process.env.ENV === 'production';
const buildDir = process.env.BUILD_DIR; const buildDir = process.env.BUILD_DIR;
@ -41,6 +42,15 @@ export default commandLineArgs => ({
// Extract css into separate files // Extract css into separate files
cssOnlyRollupPlugin({output: 'bundle.css'}), cssOnlyRollupPlugin({output: 'bundle.css'}),
url({
include: [
'**/*.woff2?',
'**/*.ttf',
],
limit: 0,
fileName: path.join('../', 'fonts', '[name][extname]'),
}),
// If you have external dependencies installed from // If you have external dependencies installed from
// npm, you'll most likely need these plugins. In // npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration - // some cases you'll need additional configuration -

View File

@ -11,6 +11,7 @@
document.querySelectorAll('a[target="_blank"]').forEach(el => { document.querySelectorAll('a[target="_blank"]').forEach(el => {
if (!el.classList.contains('no-icon')) { if (!el.classList.contains('no-icon')) {
el.classList.add('no-icon');
el.appendChild(iconElement.cloneNode(true)); el.appendChild(iconElement.cloneNode(true));
} }
}); });
@ -18,6 +19,13 @@
onMount(() => { onMount(() => {
addExternalLinkIcons(); addExternalLinkIcons();
new MutationObserver(() => {
addExternalLinkIcons();
}).observe(document.body, {
childList: true,
subtree: true,
});
}); });
</script> </script>

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import {replaceIcons} from "../../ts/icons.js"; import {replaceIcons} from "../../ts/icons.js";
import {onMount} from "svelte"; import {afterUpdate, onMount} from "svelte";
export let name: string; export let name: string;
@ -8,6 +8,9 @@
replaceIcons(true); replaceIcons(true);
}); });
afterUpdate(() => {
replaceIcons(false);
});
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@ -601,6 +601,15 @@
is-module "^1.0.0" is-module "^1.0.0"
resolve "^1.19.0" resolve "^1.19.0"
"@rollup/plugin-url@^6.1.0":
version "6.1.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-url/-/plugin-url-6.1.0.tgz#1234bba9aa30b5972050bdfcf8fcbb1cb8070465"
integrity sha512-FJNWBnBB7nLzbcaGmu1no+U/LlRR67TtgfRFP+VEKSrWlDTE6n9jMns/N4Q/VL6l4x6kTHQX4HQfwTcldaAfHQ==
dependencies:
"@rollup/pluginutils" "^3.1.0"
make-dir "^3.1.0"
mime "^2.4.6"
"@rollup/pluginutils@4": "@rollup/pluginutils@4":
version "4.1.1" version "4.1.1"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.1.tgz#1d4da86dd4eded15656a57d933fda2b9a08d47ec" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.1.tgz#1d4da86dd4eded15656a57d933fda2b9a08d47ec"
@ -7344,17 +7353,7 @@ svelte-check@^2.2.8:
svelte-preprocess "^4.0.0" svelte-preprocess "^4.0.0"
typescript "*" typescript "*"
svelte-preprocess@4.6.9: svelte-preprocess@^4.0.0, svelte-preprocess@^4.9.8:
version "4.6.9"
resolved "https://registry.yarnpkg.com/svelte-preprocess/-/svelte-preprocess-4.6.9.tgz#073d923eb351b98b6c6a454ba5feee981cd9dbf5"
integrity sha512-SROWH0rB0DJ+0Ii264cprmNu/NJyZacs5wFD71ya93Cg/oA2lKHgQm4F6j0EWA4ktFMzeuJJm/eX6fka39hEHA==
dependencies:
"@types/pug" "^2.0.4"
"@types/sass" "^1.16.0"
detect-indent "^6.0.0"
strip-indent "^3.0.0"
svelte-preprocess@^4.0.0:
version "4.9.8" version "4.9.8"
resolved "https://registry.yarnpkg.com/svelte-preprocess/-/svelte-preprocess-4.9.8.tgz#fd40afebfb352f469beab289667485ebf0d811da" resolved "https://registry.yarnpkg.com/svelte-preprocess/-/svelte-preprocess-4.9.8.tgz#fd40afebfb352f469beab289667485ebf0d811da"
integrity sha512-EQS/oRZzMtYdAprppZxY3HcysKh11w54MgA63ybtL+TAZ4hVqYOnhw41JVJjWN9dhPnNjjLzvbZ2tMhTsla1Og== integrity sha512-EQS/oRZzMtYdAprppZxY3HcysKh11w54MgA63ybtL+TAZ4hVqYOnhw41JVJjWN9dhPnNjjLzvbZ2tMhTsla1Og==