From b9c44c91206c03c3adbbb8f50211b830caaf6ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sun, 27 Dec 2020 16:25:00 +0100 Subject: [PATCH 1/4] SES-123 Icons module added --- .../src/app/shared/sc-icons/how-to.RMD | 0 ...ession-companion-icons-registry.service.ts | 0 .../session-companion-icons.component.ts | 20 ++++++++++++++++++ .../session-companion-icons.module.ts | 10 +++++++++ .../src/app/shared/sc-icons/warning.png | Bin 0 -> 3385 bytes 5 files changed, 30 insertions(+) create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/warning.png diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD new file mode 100644 index 0000000..e69de29 diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts new file mode 100644 index 0000000..e69de29 diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts new file mode 100644 index 0000000..701f5b6 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts @@ -0,0 +1,20 @@ +import {ChangeDetectionStrategy, Component, ElementRef, Input} from '@angular/core'; + +@Component({ + selector: 'app-sc-icons', + template: ` + + `, + styles: [':host::ng-deep svg{width: 50px; height: 50px}'], + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class SessionCompanionIcons { + + @Input() + set name(iconName: string) { + this.element.nativeElement.innerHTML = scIcons[iconName] || null; + } + + constructor(private element: ElementRef) { + } +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts new file mode 100644 index 0000000..b79dae7 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts @@ -0,0 +1,10 @@ +import {NgModule} from '@angular/core'; +import {SessionCompanionIconsComponent} from './session-companion-icons.component'; + +@NgModule({ + declarations: [SessionCompanionIconsComponent], + imports: [], + exports: [] +}) +export class SessionCompanionIconsModule { +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/warning.png b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/warning.png new file mode 100644 index 0000000000000000000000000000000000000000..d36ffcbb6a41427fd8599e13f441f4286f73b6ce GIT binary patch literal 3385 zcma)p@b#@;&+nh#AHP5D`*mH{{rcSZ{kmS){kq>*hMUW2IT>{s zF)=Z@KOF5m#Ka^(+xG9$QrokFBKpyGTTVxoC8L0Vi{ zRta#PdQ$dQdWyNp8|jptF#A07H3G1!%@!05B$yb&51JfNe#2bbX9rT&kpd7po(8=$ z{_S@KsbDL=gm2EhbuWf4^A{kPKEV!X10R0(`Rav=myHdK;Mw(}DDC)!gg+HdO8<6K zfl#Ei2lT@_nf~nQ!=J&E&LQq@<5yWZzuedwUENCD>c4JT%1?!~@!o&MUH>a~ko>iI zph@2D+YEGAC~EVGRa`YwFL z=h)C9tCYIrl_!5fUlp}^q1Crg8Hr^1`frqwxK_wu8vTN^X#H@YpafJ2Y=>LDgWE zc3#U#(q5%hyL^4Ht%1SxG=b(Qy-)!m(S6~Ps^ebai} zZe3lM2bL#_srl_C+^mXO+Vq`~t8hejh_0Cdp=(w++c=*AUiV;)NAwS2b8W7d zcjO$N&-Y-t2P#`?{^?utT5}968R^rP8uul}?NiMHl9Jy8WcFdv4&JAG8f0WZvWyZR z6_9El*bk(9*Doom9u=RsD3X{mHt>Q46q|2Wx`QXp8Vrx_dpA+KJ^(jzuDXD|HD$5J zk`>-+TcTyi|3i%FTsUnylBQIS@5PgS^Hu04VSf>}TqdmC zJTjfPb;R6g)8M|s*TQy}(J`wM# zPF++qyx%4vgghLF%7nzP6)YrcFpCcmp@*8kwn9#uinD{Xail#E{j7*4CZ?!OM5!;5 zM@MqLSv>4@DbQ(x6!Nx5MJHYtuAQUBCrwK*=>D=iHTt0jzfAEt2Ts-1cVm<+`EK>c zP5lH3KmNK{qgQIL;~+4vHTB`5S+zI+pY!Q7LWmpiY)?%rp0$fO=BY=u;xU5F0a z-+L^aJc$@e#q6L~dJ+u9}=bE1!CkY}LJ4^D0-^^S4QSdW_R}XC;Es^fxGHk_{7fXF#VZVP~`Yte= z-vgQy`l;b76t|5aFlOS!hO@LZfVO1xx(>z1El(v&N=^dJAN$+Cmwy{3Aux8oUSm-s zES!ig4(n5L$3^S)-vq`eta2V-&T$5?)#h~I82$RDJ+{{iT2rN{e54&V)sZXBGghZVh%)peJ`%zZyJY?T+MV>AVXcaLd`V#s^80Jf z^!OytBG%|f+Wr=_Bc87sDz?konVN4F=RFpL2TxTC_pKdITGe8yIpT*n~ikG`yJo9lq7;_E4vi69E-&s3v;u7C9HZks;xk& zDZjwN1ZS>7loNK(S5!Ul&|qE1^wm8pDu^6hkl@h^@8>CoNCf%MzB;3-x)=#eYB9md z=3KhsduG9i>3t>=4j7?bqLFtp(Tcg1)R|5fiWz2nSsPjCG6znN%}$S2MWv`- z$eDr&0WxPeI9?xOZ8~t9ez*B^O`?;ZS}zOF_tK1W_*&9 z<%kpmi!goUFy9xwDkIwI6vlc=C*6^yUI++U%7nlXh#3qGavGcev^@ng$?If;v}`FQ z1+|_gEvU0EHxGCj>QvK`69&0$d4k*zfLwelN1?s(c&Odk;rsIMGF#TVRtO>8*Uv7{ zmzOD@%f4nnmdYsQas9q-ldi>;hjshlX4ZmtWXY{ZwKe=~`rWFOPkpzx;`CEK>N!fM zBX<9_iS&qeyWk$cJI zDer4(8P`~0%-<}Rk|zZbF5EP3JG$B!OJxA4{8@MbX*+>yamdZW@)x3$G|r55D`vCc zJ;!r@|9D3-*nglD$gJ-y7r?!vZw=F8v-?(bx5Vjhhu(2Ad+~m%qf)cyRB(+)Z3aw| z0t0wxp|7PKGO@>W))q*7lEy9J+v{25X=D?PFNn=MBF=#^!&V-$_9(A3F6=|m0TFx3 z)NMd~%4dEsB7c1u%e`}LFevG=-%}s!{TfK7uN!r~TrXptZFwkabZ-=D9);co0@XDO zbbM1s-BvN+xzRL} z8V;?b45_0F_fk6?0c!_f^(a7AV7O zC2Ht>$noAZ=V9H1@EGf!G*2ya?Q!`2A_iwNND{h?r_7_5rZ5YaqLQtMaU4Obar&n> z+#>vFvp>ojT0aV)(n-B+;81Vdl#UfOGy>91F7P5(cxIQ8uQRS~f8OE9HHaDl89Wy1 z|3MQlF*DB~X35<2!rt=XMCvXQ)#sFM(Q{fC@hZMM{Zdo(TzeIZ*(zj^}MLmV{W$Y?n%w#1n8Bq^1#kVpn<6KjlB4!KmN> literal 0 HcmV?d00001 From 607145f45f38908f5e7c6b43369fdcb44788426e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sun, 27 Dec 2020 16:25:12 +0100 Subject: [PATCH 2/4] Icon module register --- .../ClientApp/package-lock.json | 701 +++++++++++++++++- .../SessionCompanion/ClientApp/package.json | 14 + .../ClientApp/src/app/app.module.ts | 3 +- .../select-role/select-role.component.ts | 3 +- .../components/sign-in/sign-in.component.ts | 12 +- .../src/app/shared/sc-icons/how-to.RMD | 29 + .../shared/sc-icons/icons/sc-icon.model.ts | 105 +++ .../sc-icons/icons/svg-icons/barbarian.svg | 1 + .../shared/sc-icons/icons/svg-icons/bard.svg | 1 + .../sc-icons/icons/svg-icons/cleric.svg | 1 + .../shared/sc-icons/icons/svg-icons/druid.svg | 1 + .../sc-icons/icons/svg-icons/fighter.svg | 1 + .../shared/sc-icons/icons/svg-icons/monk.svg | 1 + .../sc-icons/icons/svg-icons/paladin.svg | 1 + .../sc-icons/icons/svg-icons/ranger.svg | 1 + .../shared/sc-icons/icons/svg-icons/rogue.svg | 1 + .../sc-icons/icons/svg-icons/sorcerer.svg | 1 + .../sc-icons/icons/svg-icons/warlock.svg | 1 + .../sc-icons/icons/svg-icons/wizard.svg | 1 + ...ession-companion-icons-registry.service.ts | 31 + .../session-companion-icons.component.ts | 24 +- .../session-companion-icons.module.ts | 4 +- 22 files changed, 920 insertions(+), 18 deletions(-) create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg diff --git a/SessionCompanion/SessionCompanion/ClientApp/package-lock.json b/SessionCompanion/SessionCompanion/ClientApp/package-lock.json index e784a87..a4391a2 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/package-lock.json +++ b/SessionCompanion/SessionCompanion/ClientApp/package-lock.json @@ -2976,6 +2976,12 @@ "integrity": "sha512-JNbGaHFCLwgHn/iCckiGSOZ1XYHsKFwREtzPwSGCVld1SGhOlmZw2D4ZI94HQCrBHbADzW9m4LER/8olJTRGHA==", "dev": true }, + "@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, "@types/q": { "version": "0.0.32", "resolved": "https://registry.npmjs.org/@types/q/-/q-0.0.32.tgz", @@ -3874,6 +3880,12 @@ "multicast-dns-service-types": "^1.1.0" } }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", + "dev": true + }, "bootstrap": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.4.1.tgz", @@ -4309,6 +4321,12 @@ "restore-cursor": "^3.1.0" } }, + "cli-spinners": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.5.0.tgz", + "integrity": "sha512-PC+AmIuK04E6aeSs/pUccSujsTzBhu4HzC2dL+CfJB/Jcc2qTRbEwZQDfIUpt2Xl8BodYBEq8w4fc0kU2I9DjQ==", + "dev": true + }, "cli-width": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", @@ -4343,6 +4361,54 @@ "shallow-clone": "^3.0.0" } }, + "coa": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", + "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==", + "dev": true, + "requires": { + "@types/q": "^1.5.1", + "chalk": "^2.4.1", + "q": "^1.1.2" + }, + "dependencies": { + "@types/q": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz", + "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -4881,6 +4947,24 @@ "integrity": "sha1-Mh9s9zeCpv91ERE5D8BeLGV9jJs=", "dev": true }, + "css-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-2.1.0.tgz", + "integrity": "sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==", + "dev": true, + "requires": { + "boolbase": "^1.0.0", + "css-what": "^3.2.1", + "domutils": "^1.7.0", + "nth-check": "^1.0.2" + } + }, + "css-select-base-adapter": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", + "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==", + "dev": true + }, "css-selector-tokenizer": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.1.tgz", @@ -4932,6 +5016,30 @@ } } }, + "css-tree": { + "version": "1.0.0-alpha.37", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz", + "integrity": "sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==", + "dev": true, + "requires": { + "mdn-data": "2.0.4", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "css-what": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.4.2.tgz", + "integrity": "sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==", + "dev": true + }, "cssauron": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/cssauron/-/cssauron-1.4.0.tgz", @@ -4941,6 +5049,39 @@ "through": "X.X.X" } }, + "csso": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", + "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", + "dev": true, + "requires": { + "css-tree": "^1.1.2" + }, + "dependencies": { + "css-tree": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.2.tgz", + "integrity": "sha512-wCoWush5Aeo48GLhfHPbmvZs59Z+M7k5+B1xDnXbdWNcEF423DoFdqSWE0PM5aNk5nI5cp1q7ms36zGApY/sKQ==", + "dev": true, + "requires": { + "mdn-data": "2.0.14", + "source-map": "^0.6.1" + } + }, + "mdn-data": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", + "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -5048,6 +5189,23 @@ } } }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "requires": { + "clone": "^1.0.2" + }, + "dependencies": { + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + } + } + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -5254,6 +5412,24 @@ "void-elements": "^2.0.0" } }, + "dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + }, + "dependencies": { + "domelementtype": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.1.0.tgz", + "integrity": "sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w==", + "dev": true + } + } + }, "domain-browser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", @@ -5275,11 +5451,27 @@ "isomorphic-fetch": "^2.2.1" } }, + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, "domino": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/domino/-/domino-2.1.4.tgz", "integrity": "sha512-l70mlQ7IjPKC8kT7GljQXJZmt5OqFL+RE91ik5y5WWQtsd9wP8R7gpFnNu96fK5MqAAZRXfLLsnzKtkty5fWGQ==" }, + "domutils": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", + "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, "duplexify": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", @@ -5493,6 +5685,12 @@ "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", "dev": true }, + "entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", + "dev": true + }, "err-code": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz", @@ -7177,6 +7375,12 @@ "is-extglob": "^2.1.1" } }, + "is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true + }, "is-negative-zero": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", @@ -8036,6 +8240,12 @@ "immediate": "~3.0.5" } }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, "load-json-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", @@ -8087,12 +8297,90 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", + "dev": true + }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, + "lodash.kebabcase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", + "integrity": "sha1-hImxyw0p/4gZXM7KRI/21swpXDY=", + "dev": true + }, + "lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=", + "dev": true + }, + "log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "requires": { + "chalk": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "log4js": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/log4js/-/log4js-4.5.1.tgz", @@ -8267,6 +8555,12 @@ "safe-buffer": "^5.1.2" } }, + "mdn-data": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", + "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==", + "dev": true + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -8954,6 +9248,15 @@ "set-blocking": "~2.0.0" } }, + "nth-check": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", + "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", + "dev": true, + "requires": { + "boolbase": "~1.0.0" + } + }, "num2fraction": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", @@ -9151,6 +9454,73 @@ "isobject": "^3.0.1" } }, + "object.values": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.2.tgz", + "integrity": "sha512-MYC0jvJopr8EK6dPBiO8Nb9mvjdypOachO5REGk6MXzujbBrAisKo3HmdEI6kZDL6fC31Mwee/5YbtMebixeag==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1", + "has": "^1.0.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", + "dev": true + }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "object-inspect": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", + "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==", + "dev": true + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + } + } + }, "obuf": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", @@ -9225,6 +9595,88 @@ "is-wsl": "^1.1.0" } }, + "ora": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.1.0.tgz", + "integrity": "sha512-9tXIMPvjZ7hPTbk8DFq1f7Kow/HU/pQYB60JbNq+QnGwcyhWVZaQ4hM9zQDEsPxw/muLpgiHSaumUZxCAmod/w==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.4.0", + "is-interactive": "^1.0.0", + "log-symbols": "^4.0.0", + "mute-stream": "0.0.8", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "original": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", @@ -9413,6 +9865,23 @@ "readable-stream": "^2.1.5" } }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + }, + "dependencies": { + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + } + } + }, "parse-asn1": { "version": "5.1.5", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", @@ -9747,6 +10216,12 @@ "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", "dev": true }, + "prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "dev": true + }, "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", @@ -10051,8 +10526,7 @@ "q": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", - "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=", - "optional": true + "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=" }, "qjobs": { "version": "1.2.0", @@ -10603,8 +11077,7 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "optional": true + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "schema-utils": { "version": "1.0.0", @@ -11450,6 +11923,12 @@ "figgy-pudding": "^3.5.1" } }, + "stable": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", + "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", + "dev": true + }, "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", @@ -11729,6 +12208,187 @@ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "optional": true }, + "svg-to-ts": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/svg-to-ts/-/svg-to-ts-6.0.0.tgz", + "integrity": "sha512-QdznpIJfuTjP//zY007BhOYAe4ZOII1XviNgmvhgfEnl6MxTyLJWL20JgECvjGJHD+F8DqKOnt7YU7UmUFD6LQ==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "commander": "^4.0.1", + "cosmiconfig": "^6.0.0", + "glob": "^7.1.6", + "lodash.camelcase": "^4.3.0", + "lodash.kebabcase": "^4.1.1", + "lodash.snakecase": "^4.1.1", + "ora": "^5.1.0", + "prettier": "^1.19.1", + "svgo": "^1.3.2", + "typescript": "^3.7.2" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true + }, + "cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "parse-json": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", + "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "typescript": { + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", + "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", + "dev": true + } + } + }, + "svgo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz", + "integrity": "sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "coa": "^2.0.2", + "css-select": "^2.0.0", + "css-select-base-adapter": "^0.1.1", + "css-tree": "1.0.0-alpha.37", + "csso": "^4.0.2", + "js-yaml": "^3.13.1", + "mkdirp": "~0.5.1", + "object.values": "^1.1.0", + "sax": "~1.2.4", + "stable": "^0.1.8", + "unquote": "~1.1.1", + "util.promisify": "~1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "symbol-observable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", @@ -12200,6 +12860,12 @@ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "dev": true }, + "unquote": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", + "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=", + "dev": true + }, "unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", @@ -12324,6 +12990,18 @@ "object.getownpropertydescriptors": "^2.0.3" } }, + "util.promisify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", + "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.2", + "has-symbols": "^1.0.1", + "object.getownpropertydescriptors": "^2.1.0" + } + }, "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -13088,6 +13766,15 @@ "minimalistic-assert": "^1.0.0" } }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "dev": true, + "requires": { + "defaults": "^1.0.3" + } + }, "webdriver-js-extender": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz", @@ -14305,6 +14992,12 @@ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "optional": true }, + "yaml": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", + "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", + "dev": true + }, "yargs": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", diff --git a/SessionCompanion/SessionCompanion/ClientApp/package.json b/SessionCompanion/SessionCompanion/ClientApp/package.json index 8d97cb5..35cdd9e 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/package.json +++ b/SessionCompanion/SessionCompanion/ClientApp/package.json @@ -6,10 +6,23 @@ "start": "ng serve", "build": "ng build", "build:ssr": "ng run SessionCompanion:server:dev", + "generate-icons": "svg-to-ts", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, + "svg-to-ts": { + "conversionType": "constants", + "srcFiles": [ + "./src/app/shared/sc-icons/icons/**/*.svg" + ], + "outputDirectory": "./src/app/shared/sc-icons/icons", + "interfaceName": "SessionCompanionIcon", + "typeName": "scIcon", + "prefix": "scIcon", + "fileName": "sc-icon.model", + "compileSources": true + }, "private": true, "dependencies": { "@angular/animations": "8.2.12", @@ -53,6 +66,7 @@ "karma-coverage-istanbul-reporter": "~2.1.0", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.2", + "svg-to-ts": "^6.0.0", "typescript": "3.5.3" }, "optionalDependencies": { diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index 6bed2fc..74d137e 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -23,9 +23,9 @@ import { import {UserService} from '../services/user.service'; import { StoreModule } from '@ngrx/store'; import { StoreDevtoolsModule } from '@ngrx/store-devtools'; -import { reducers} from './reducers'; import {AppReducer} from './store/reducers/app.reducer'; import {environment} from '../environments/environment'; +import {SessionCompanionIconsModule} from './shared/sc-icons/session-companion-icons.module'; @NgModule({ declarations: [ @@ -54,6 +54,7 @@ BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), MatSidenavModule, MatToolbarModule, MatListModule, + SessionCompanionIconsModule, StoreModule.forRoot({appState: AppReducer}), StoreDevtoolsModule.instrument({ logOnly: environment.production diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-role/select-role.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-role/select-role.component.ts index 12bb627..1565301 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-role/select-role.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-role/select-role.component.ts @@ -12,7 +12,8 @@ import {AddRole} from '../../store/actions/app.actions'; export class SelectRoleComponent { isExpanded = false; - constructor(private router: Router, private store: Store<{ role: string }>) {} + constructor(private router: Router, private store: Store<{ role: string }>) { + } collapse() { this.isExpanded = false; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts index 16ac96e..d9c24be 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts @@ -43,7 +43,7 @@ export class SignInComponent implements OnDestroy, OnInit { onLoginButtonClick() { let role = ''; - this.store.select(s => s.appState.role).subscribe((v)=>{ + this.store.select(s => s.appState.role).subscribe((v) => { role = v; }); this.allSubscriptions.add( @@ -52,7 +52,6 @@ export class SignInComponent implements OnDestroy, OnInit { this.signInFormGroup.get('signIn').value['password']).subscribe( (success) => { this.store.dispatch(new AddUserId({userId: success})); - //TODO zmienić na jedna linie if (role === 'player') { this.router.navigate(['select-character']); } else { @@ -69,13 +68,12 @@ export class SignInComponent implements OnDestroy, OnInit { )); } - onRegisterButtonClick(){ - this.router.navigate(['register']) - //TODO connect with backend + onRegisterButtonClick() { + this.router.navigate(['register']); } - onArrowBackClick(){ - this.router.navigate(['']) + onArrowBackClick() { + this.router.navigate(['']); } collapse() { diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD index e69de29..5ba5504 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD @@ -0,0 +1,29 @@ +Moduł został już dodany i wstrzyknięty do roota apki. + +Aby dodać nową ikonkę, plik svg wstawiamy do folderu icons/svg-icons. +Następnie wpisujemy w konsoli polecenie: +npm run generate-icons + +Zostaną wtedy utworzone nowe klasy z dodaną ikonką. + +Jeśli po tym będziemy chcieli użyć gdzieś naszej ikonki, nie pojawi się ona... +Jest to spowodowane tym, że nie chcemy, aby aplikacja wczytywała w jednym momencie wszystkie nasze ikonki a jedynie te potrzebne +Musi więc ją dodać w odpowiednim momencie do rejestru, w innym wypadku w konsoli dostaniemy komunikat: +![img.png](warning.png) + +Teraz zarejestrujmy naszą ikonkę: + +Dodajemy w konstruktorze danego komponentu: +```typescript +iconRegister: SessionCompanionIconsRegistry +``` + +Następnie dodajemy interesującą nas ikonkę: +```typescript +this.iconRegister.registerIcon(scIconBarbarian); +``` + +Samą ikonkę ładujemy w tagu +```html + +``` diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts new file mode 100644 index 0000000..840ea40 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts @@ -0,0 +1,105 @@ +/* 🤖 this file was generated by svg-to-ts*/ +export const scIconBarbarian: { + name: 'barbarian'; + data: string; +} = { + name: 'barbarian', + data: `` +}; +export const scIconBard: { + name: 'bard'; + data: string; +} = { + name: 'bard', + data: `` +}; +export const scIconCleric: { + name: 'cleric'; + data: string; +} = { + name: 'cleric', + data: `` +}; +export const scIconDruid: { + name: 'druid'; + data: string; +} = { + name: 'druid', + data: `` +}; +export const scIconFighter: { + name: 'fighter'; + data: string; +} = { + name: 'fighter', + data: `` +}; +export const scIconMonk: { + name: 'monk'; + data: string; +} = { + name: 'monk', + data: `` +}; +export const scIconPaladin: { + name: 'paladin'; + data: string; +} = { + name: 'paladin', + data: `` +}; +export const scIconRanger: { + name: 'ranger'; + data: string; +} = { + name: 'ranger', + data: `` +}; +export const scIconRogue: { + name: 'rogue'; + data: string; +} = { + name: 'rogue', + data: `` +}; +export const scIconSorcerer: { + name: 'sorcerer'; + data: string; +} = { + name: 'sorcerer', + data: `` +}; +export const scIconWarlock: { + name: 'warlock'; + data: string; +} = { + name: 'warlock', + data: `` +}; +export const scIconWizard: { + name: 'wizard'; + data: string; +} = { + name: 'wizard', + data: `` +}; +export type scIcon = + | 'barbarian' + | 'bard' + | 'cleric' + | 'druid' + | 'fighter' + | 'monk' + | 'paladin' + | 'ranger' + | 'rogue' + | 'sorcerer' + | 'warlock' + | 'wizard'; +export interface SessionCompanionIcon { + name: scIcon; + data: string; +} +export type SessionCompanionIconNameSubset< + T extends Readonly +> = T[number]['name']; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg new file mode 100644 index 0000000..a4d948e --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg new file mode 100644 index 0000000..565ebe9 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg new file mode 100644 index 0000000..df1b7e5 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg new file mode 100644 index 0000000..036adc9 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg new file mode 100644 index 0000000..4fa6997 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg new file mode 100644 index 0000000..3590be6 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg new file mode 100644 index 0000000..0fb47a7 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg new file mode 100644 index 0000000..4d9aca2 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg new file mode 100644 index 0000000..2e89550 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg new file mode 100644 index 0000000..e26b851 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg new file mode 100644 index 0000000..329c82f --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg new file mode 100644 index 0000000..c61b956 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts index e69de29..0870b10 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts @@ -0,0 +1,31 @@ +import {Injectable} from '@angular/core'; +import { SessionCompanionIcon } from './icons/sc-icon.model'; + +@Injectable({ + providedIn: 'root' +}) +export class SessionCompanionIconsRegistry { + + private registry = new Map(); + + public registerIcons(icons: SessionCompanionIcon[]): void { + icons.forEach((icon: SessionCompanionIcon) => { + if (!this.registry.has(icon.name)) { + this.registry.set(icon.name, icon.data); + } + }); + } + + public registerIcon(icon: SessionCompanionIcon): void { + if (!this.registry.has(icon.name)) { + this.registry.set(icon.name, icon.data); + } + } + + public getIcon(iconName: string): string | undefined { + if (!this.registry.has(iconName)) { + console.warn(`We could not find the Icon with the name ${iconName}, did you add it to the Icon registry?`); + } + return this.registry.get(iconName); + } +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts index 701f5b6..5752798 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts @@ -1,4 +1,6 @@ -import {ChangeDetectionStrategy, Component, ElementRef, Input} from '@angular/core'; +import {ChangeDetectionStrategy, Component, ElementRef, Inject, Input, Optional} from '@angular/core'; +import {SessionCompanionIconsRegistry} from './session-companion-icons-registry.service'; +import { DOCUMENT } from '@angular/common'; @Component({ selector: 'app-sc-icons', @@ -8,13 +10,27 @@ import {ChangeDetectionStrategy, Component, ElementRef, Input} from '@angular/co styles: [':host::ng-deep svg{width: 50px; height: 50px}'], changeDetection: ChangeDetectionStrategy.OnPush }) -export class SessionCompanionIcons { +export class SessionCompanionIconsComponent { + + private svgIcon: SVGElement; @Input() set name(iconName: string) { - this.element.nativeElement.innerHTML = scIcons[iconName] || null; + if (this.svgIcon) { + this.element.nativeElement.removeChild(this.svgIcon); + } + const svgData = this.scIconRegistry.getIcon(iconName); + this.svgIcon = this.svgElementFromString(svgData); + this.element.nativeElement.appendChild(this.svgIcon); } - constructor(private element: ElementRef) { + constructor(private element: ElementRef, private scIconRegistry: SessionCompanionIconsRegistry, + @Optional() @Inject(DOCUMENT) private document: any) { + } + + private svgElementFromString(svgContent: string): SVGElement { + const div = this.document.createElement('DIV'); + div.innerHTML = svgContent; + return div.querySelector('svg') || this.document.createElementNS('http://www.w3.org/2000/svg', 'path'); } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts index b79dae7..eb9152a 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts @@ -4,7 +4,9 @@ import {SessionCompanionIconsComponent} from './session-companion-icons.componen @NgModule({ declarations: [SessionCompanionIconsComponent], imports: [], - exports: [] + exports: [ + SessionCompanionIconsComponent + ] }) export class SessionCompanionIconsModule { } From b82393a62bcb3a3558f02fb61b7cf15ce5572dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sun, 27 Dec 2020 16:33:02 +0100 Subject: [PATCH 3/4] SES-123 Lint errors fix --- .../components/registration/registration.component.html | 8 ++++---- .../src/app/components/sign-in/sign-in.component.html | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.html index c9837d9..59ac6f3 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.html @@ -11,7 +11,7 @@ type="text" required name="username"> - + Username is required person @@ -26,7 +26,7 @@ type="password" name="password"/> lock - + Password is required @@ -40,10 +40,10 @@ type="password" name="confirmPassword"/> lock - + Confirm your password - + Please make sure your passwords match diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.html index 5b673af..4e5cc02 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.html @@ -12,7 +12,7 @@ type="text" required name="username"> - + Username is required person @@ -28,7 +28,7 @@ type="password" name="password"/> lock - + Password is required From e17e3ace58357b188aec951273c6f627a7d8d78c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sun, 27 Dec 2020 17:55:28 +0100 Subject: [PATCH 4/4] SES-123 Added reducers and miissed unsubscribe --- .../SessionCompanion/ClientApp/src/app/app.module.ts | 4 ++-- .../src/app/components/sign-in/sign-in.component.ts | 10 +++++----- .../ClientApp/src/app/store/models/app-state.model.ts | 8 +++++++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index 74d137e..a61df94 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -23,9 +23,9 @@ import { import {UserService} from '../services/user.service'; import { StoreModule } from '@ngrx/store'; import { StoreDevtoolsModule } from '@ngrx/store-devtools'; -import {AppReducer} from './store/reducers/app.reducer'; import {environment} from '../environments/environment'; import {SessionCompanionIconsModule} from './shared/sc-icons/session-companion-icons.module'; +import {reducers} from './store/models/app-state.model'; @NgModule({ declarations: [ @@ -55,7 +55,7 @@ BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), MatToolbarModule, MatListModule, SessionCompanionIconsModule, - StoreModule.forRoot({appState: AppReducer}), + StoreModule.forRoot(reducers), StoreDevtoolsModule.instrument({ logOnly: environment.production }) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts index d9c24be..9f2734b 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts @@ -6,9 +6,9 @@ import {ErrorResponse} from '../../../types/ErrorResponse'; import {Observable, Subscription} from 'rxjs'; import {HttpErrorResponse} from '@angular/common/http'; import {AppStoreModel} from '../../store/models/app-store.model'; -import { Store } from '@ngrx/store'; +import {select, Store} from '@ngrx/store'; import {AddUserId} from '../../store/actions/app.actions'; -import { AppState } from 'src/app/store/models/app-state.model'; +import {AppState} from 'src/app/store/models/app-state.model'; @Component({ selector: 'app-sign-in', @@ -38,14 +38,14 @@ export class SignInComponent implements OnDestroy, OnInit { }); ngOnInit() { - this.role$ = this.store.select(s => s.appState); + this.role$ = this.store.select(s => s.appStore); } onLoginButtonClick() { let role = ''; - this.store.select(s => s.appState.role).subscribe((v) => { + this.store.select(s => s.appStore.role).subscribe((v) => { role = v; - }); + }).unsubscribe(); this.allSubscriptions.add( this.userService.tryLogin( this.signInFormGroup.get('signIn').value['username'], diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/app-state.model.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/app-state.model.ts index 30226ba..8d87023 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/app-state.model.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/app-state.model.ts @@ -1,5 +1,11 @@ import {AppStoreModel} from './app-store.model'; +import {ActionReducerMap} from '@ngrx/store'; +import {AppReducer} from '../reducers/app.reducer'; export interface AppState { - appState: AppStoreModel; + appStore: AppStoreModel; } + +export const reducers: ActionReducerMap = { + appStore: AppReducer, +};