From 24206b9fbef786e2191f59c4f90d0a2e0a5f106f Mon Sep 17 00:00:00 2001 From: Ozymandias Date: Sat, 15 Feb 2020 11:58:13 +0200 Subject: [PATCH] - Cleaned up merge artifacts --- .gitignore | 1 + src/app/app-routing.module.ts | 5 -- .../category-tabs/tabbar.component.html | 19 ------ .../category-tabs/tabbar.component.scss | 31 --------- .../category-tabs/tabbar.component.ts | 65 +----------------- .../components/search/search.component.html | 8 --- .../components/search/search.component.scss | 12 ---- .../shared/emoji/emoji.component.html | 18 ----- .../shared/emoji/emoji.component.scss | 64 ----------------- .../shared/emoji/emoji.component.ts | 41 ----------- .../shared/palette/palette.component.html | 3 - .../shared/palette/palette.component.scss | 7 -- .../shared/palette/palette.component.ts | 33 --------- src/app/providers/data.service.ts | 68 ------------------- tsconfig.json | 17 ----- 15 files changed, 2 insertions(+), 390 deletions(-) delete mode 100644 src/app/components/shared/emoji/emoji.component.html delete mode 100644 src/app/components/shared/emoji/emoji.component.scss delete mode 100644 src/app/components/shared/emoji/emoji.component.ts delete mode 100644 src/app/components/shared/palette/palette.component.html delete mode 100644 src/app/components/shared/palette/palette.component.scss delete mode 100644 src/app/components/shared/palette/palette.component.ts delete mode 100644 src/app/providers/data.service.ts diff --git a/.gitignore b/.gitignore index 909b814d6..bd9d24158 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ # compiled output /dist/release /dist/angular +/dist/**/*.pyz /tmp /out-tsc /app-builds diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 8f46673bd..b7062351a 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -24,12 +24,7 @@ const routes: Routes = [ ]; @NgModule({ -<<<<<<< HEAD - imports: [RouterModule.forRoot(routes, { useHash: true })], - exports: [RouterModule] -======= imports: [RouterModule.forRoot(routes, { useHash: true })], exports: [RouterModule], ->>>>>>> c8da92906c2b44849a6c4b3c83ce1e6715699a77 }) export class AppRoutingModule {} diff --git a/src/app/components/category-tabs/tabbar.component.html b/src/app/components/category-tabs/tabbar.component.html index 7f444dc1e..572e00e2a 100644 --- a/src/app/components/category-tabs/tabbar.component.html +++ b/src/app/components/category-tabs/tabbar.component.html @@ -1,21 +1,3 @@ -<<<<<<< HEAD - - - - - -======= ->>>>>>> c8da92906c2b44849a6c4b3c83ce1e6715699a77 diff --git a/src/app/components/category-tabs/tabbar.component.scss b/src/app/components/category-tabs/tabbar.component.scss index 94eca2914..46db2a917 100644 --- a/src/app/components/category-tabs/tabbar.component.scss +++ b/src/app/components/category-tabs/tabbar.component.scss @@ -1,33 +1,3 @@ -<<<<<<< HEAD -$roboto-font-path: "~roboto-fontface/fonts/roboto/"; -@import "~materialize-css/sass/materialize.scss"; - -:host ::ng-deep .tabs { - position: fixed; - z-index: 998; -} - -:host ::ng-deep .tabs, -:host ::ng-deep .tabs .tab, -:host ::ng-deep .tabs .tab a { - @extend .grey-text, .text-lighten-4; - background-color: #333333; -} - -:host ::ng-deep .tabs .tab a:hover { - background-color: #FFFFFF22; -} - -:host ::ng-deep .tabs .tab a.active { - background-color: #FFFFFF33; -} - -:host ::ng-deep .tabs .tab a img { - height: 16px; - margin: 0; - padding: 0 5px 0 0; - filter: invert(0.95); -======= nav { position: fixed; min-width: 100vw; @@ -52,5 +22,4 @@ a.mat-tab-link { fill: inherit !important; } } ->>>>>>> c8da92906c2b44849a6c4b3c83ce1e6715699a77 } diff --git a/src/app/components/category-tabs/tabbar.component.ts b/src/app/components/category-tabs/tabbar.component.ts index 07720aaf4..89fbfaeb7 100644 --- a/src/app/components/category-tabs/tabbar.component.ts +++ b/src/app/components/category-tabs/tabbar.component.ts @@ -1,14 +1,3 @@ -<<<<<<< HEAD -<<<<<<< HEAD -import { Component, OnInit, AfterViewInit, ViewChild, Inject } from "@angular/core"; -import { Router, Event, NavigationEnd } from "@angular/router"; -import { MzTabComponent } from "ngx-materialize"; -import { DataService } from "../../providers/data.service"; -import M from "materialize-css"; -const COMPACT = true; -======= -======= ->>>>>>> c8da92906c2b44849a6c4b3c83ce1e6715699a77 import { Component, OnInit, Inject } from "@angular/core"; import { Router } from "@angular/router"; import { DomSanitizer } from "@angular/platform-browser"; @@ -16,63 +5,18 @@ import { MatIconRegistry } from "@angular/material/icon"; import { DirectoryService, DataService, ICategory, SettingsService } from "../../services"; -// const COMPACT = true; -<<<<<<< HEAD ->>>>>>> - Prepared configs for packaging -======= ->>>>>>> c8da92906c2b44849a6c4b3c83ce1e6715699a77 - - @Component({ selector: "app-tabbar", templateUrl: "./tabbar.component.html", styleUrls: [ "./tabbar.component.scss" ], }) -<<<<<<< HEAD -export class TabbarComponent implements OnInit, AfterViewInit { - @ViewChild(MzTabComponent) tabbar: MzTabComponent; - categories: Array; - items: {}; -======= export class TabbarComponent implements OnInit { categories: Array; ->>>>>>> c8da92906c2b44849a6c4b3c83ce1e6715699a77 compact: boolean; constructor( @Inject(DirectoryService) private dir: DirectoryService, - @Inject(DataService) private data: DataService, -<<<<<<< HEAD - @Inject(Router) public router: Router, - ) { - this.categories = data.getCategories(); - this.items = data.getEmoji(); - this.compact = COMPACT; - } - - ngOnInit() {} - - ngAfterViewInit() { - this.router.events.subscribe((event: Event) => { - if (event instanceof NavigationEnd) { - // this.tabbar.initTabs(); - M - } - }); -<<<<<<< HEAD - const tabbar = this.tabbar.tabs.nativeElement.querySelectorAll("ul.tabs li.tab a"); - for (const tabLabel of Array.from(tabbar) as Array) { - const label = tabLabel.textContent.trim(); - const iconName = this.categories.find((cat) => cat.name === label).icon; - const icon: HTMLImageElement = document.createElement("img"); - icon.src = `../../../assets/emoji/categories/${iconName}`; - if (this.compact) { - tabLabel.innerText = ""; - } - ( tabLabel).prepend(icon); - tabLabel.title = label; -======= -======= @Inject(SettingsService) private prefs: SettingsService, + @Inject(DataService) private data: DataService, @Inject(Router) public router: Router, @Inject(DomSanitizer) private sanitizer: DomSanitizer, @Inject(MatIconRegistry) private registry: MatIconRegistry, @@ -85,7 +29,6 @@ export class TabbarComponent implements OnInit { this.compact = change.value; } }); ->>>>>>> c8da92906c2b44849a6c4b3c83ce1e6715699a77 for (const category of this.categories as ICategory[]) { registry.addSvgIcon( category.icon, @@ -93,14 +36,8 @@ export class TabbarComponent implements OnInit { this.dir.getAsset(`emoji/categories/${category.icon}`) ) ); -<<<<<<< HEAD ->>>>>>> - Prepared configs for packaging - } - } -======= } } ngOnInit() {} ->>>>>>> c8da92906c2b44849a6c4b3c83ce1e6715699a77 } diff --git a/src/app/components/search/search.component.html b/src/app/components/search/search.component.html index d7dffcdcd..86ae7d946 100644 --- a/src/app/components/search/search.component.html +++ b/src/app/components/search/search.component.html @@ -1,10 +1,3 @@ -<<<<<<< HEAD - -
- -=======
->>>>>>> c8da92906c2b44849a6c4b3c83ce1e6715699a77
diff --git a/src/app/components/search/search.component.scss b/src/app/components/search/search.component.scss index 5b49d382b..d038a7ee4 100644 --- a/src/app/components/search/search.component.scss +++ b/src/app/components/search/search.component.scss @@ -1,15 +1,4 @@ .search-bar { -<<<<<<< HEAD - position: fixed; - width: 100vw; - background-color: #333333; - padding: 0 45px; - .search-input{ - height: 2.5rem; - font-size: 1.5rem; - color: #FFFFFFF2; - margin: 10px 0; -======= background-color: var(--primary); color: var(--accent-lighter); position: fixed; @@ -24,6 +13,5 @@ :host ::ng-deep & .mat-form-field-infix { padding: 0; } ->>>>>>> c8da92906c2b44849a6c4b3c83ce1e6715699a77 } } diff --git a/src/app/components/shared/emoji/emoji.component.html b/src/app/components/shared/emoji/emoji.component.html deleted file mode 100644 index 3f76b36c5..000000000 --- a/src/app/components/shared/emoji/emoji.component.html +++ /dev/null @@ -1,18 +0,0 @@ -
- -
- -

- {{ emoji.shortText }} -

-

- {{ emoji.shortName }} -

-
-
diff --git a/src/app/components/shared/emoji/emoji.component.scss b/src/app/components/shared/emoji/emoji.component.scss deleted file mode 100644 index af15c9926..000000000 --- a/src/app/components/shared/emoji/emoji.component.scss +++ /dev/null @@ -1,64 +0,0 @@ -.emoji-card { - position: relative; - min-width: 52px; - width: min-content; - height: 52px; - margin: 4px; - background-color: #ffffff; - transition: transform 0.3s ease 0.05s; - overflow: hidden; - .emoji-icon { - position: relative;; - width: 48px; - height: 48px; - padding: 4px; - line-height: 48px; - font-size: 48px; - overflow: hidden; - &::after { - content: attr(alt); - font-size: 48px; - position: absolute; - top: 0; - left: 0; - background-color: #ffffff; - padding: 4px; - width: 100%; - height: 100%; - } - } - .emoji-blob { - position: absolute; - left: 0; - bottom: 0; - width: 100%; - min-height: 30%; - height: min-content; - overflow: hidden; - opacity: 0; - transition: opacity 0.3s ease 0.05s; - padding: 2px 3px; - .emoji-text { - margin: 0; - margin-bottom: 3px; - font-size: 8px; - line-height: 6px; - } - .emoji-shortname { - margin: 0; - font-size: 8px; - line-height: 8px; - overflow-wrap: break-word; - } - } -} - -.emoji-card:hover { - transform: scale(1.5); - transform-origin: center; - box-shadow: 0 0 3px 1px #333333; - z-index: 999; - .emoji-blob { - opacity: 0.8; - } -} diff --git a/src/app/components/shared/emoji/emoji.component.ts b/src/app/components/shared/emoji/emoji.component.ts deleted file mode 100644 index fa59d03c8..000000000 --- a/src/app/components/shared/emoji/emoji.component.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Component, OnInit, Input } from "@angular/core"; -import { Highlightable } from "@angular/cdk/a11y"; - - -const THEME = "blobmoji"; - - -@Component({ - selector: "app-emoji", - templateUrl: "./emoji.component.html", - styleUrls: [ "./emoji.component.scss" ], -}) -export class EmojiComponent implements OnInit, Highlightable { - @Input() emoji; - @Input() disabled = false; - theme: string = THEME; - style = { - visibility: "visible", - outline: "none", - }; - - constructor() {} - - ngOnInit() {} - - setActiveStyles() { - this.style.outline = "2px solid -webkit-focus-ring-color"; - } - - setInactiveStyles() { - this.style.outline = "none"; - } - - getLabel() { - return this.emoji.name; - } - - click(emoji) { - console.log(emoji.codePoints); - } -} diff --git a/src/app/components/shared/palette/palette.component.html b/src/app/components/shared/palette/palette.component.html deleted file mode 100644 index 46792837d..000000000 --- a/src/app/components/shared/palette/palette.component.html +++ /dev/null @@ -1,3 +0,0 @@ -
- -
diff --git a/src/app/components/shared/palette/palette.component.scss b/src/app/components/shared/palette/palette.component.scss deleted file mode 100644 index e0537b7ef..000000000 --- a/src/app/components/shared/palette/palette.component.scss +++ /dev/null @@ -1,7 +0,0 @@ -.palette { - display: flex; - flex-flow: row wrap; - // display: grid; - // grid-template: repeat(auto-fill, minmax(48px, 1fr)) / repeat(auto-fill, minmax(48px, 1fr)); - padding: 56px 8px 8px 8px; -} diff --git a/src/app/components/shared/palette/palette.component.ts b/src/app/components/shared/palette/palette.component.ts deleted file mode 100644 index b1efba85d..000000000 --- a/src/app/components/shared/palette/palette.component.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Component, OnInit, AfterViewInit, Input, ViewChildren, QueryList } from "@angular/core"; -import { ActiveDescendantKeyManager } from "@angular/cdk/a11y"; -import { ENTER, SPACE } from "@angular/cdk/keycodes"; -import { EmojiComponent } from "../emoji/emoji.component"; - - -@Component({ - selector: "app-palette", - templateUrl: "./palette.component.html", - styleUrls: [ "./palette.component.scss" ], -}) -export class PaletteComponent implements OnInit, AfterViewInit { - @Input() items: Array; - @ViewChildren(EmojiComponent) elems: QueryList; - public keyManager: ActiveDescendantKeyManager; - - constructor() {} - - ngOnInit() {} - - ngAfterViewInit() { - this.keyManager = new ActiveDescendantKeyManager(this.elems) - .withHorizontalOrientation('ltr').withWrap(); - } - - onKeyDown(event: KeyboardEvent) { - if ([ENTER, SPACE].includes(event.keyCode)) { - this.keyManager.activeItem.click(this.keyManager.activeItem.emoji); - } else { - this.keyManager.onKeydown(event); - } - } -} diff --git a/src/app/providers/data.service.ts b/src/app/providers/data.service.ts deleted file mode 100644 index 9401588e6..000000000 --- a/src/app/providers/data.service.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { Injectable } from "@angular/core"; -import { of as observableOf } from "rxjs"; - -import CATEGORIES from "../../assets/data/categories.json"; -import EMOJIS from "../../assets/data/emoji.json"; -import SKINTONES from "../../assets/data/skin-tones.json"; - - -const THEME = "emojitwo"; - - -export interface ICategory { - name: string; - categories: string[]; - icon: string; -} - - -export interface IEmoji { - name: string | null; - codePoints: number[], - imagePath: string; - char: string; - shortText: string; - shortName: string; -} - - -export interface IEmojiList { - [key: string]: IEmoji[]; -} - - -@Injectable() -export class DataService { - theme = THEME; - constructor() {} - - getCategories(): ICategory[] { - return JSON.parse(JSON.stringify(CATEGORIES)); - } - - getEmoji(): IEmojiList { - const res = {...EMOJIS}; - Object.keys(res).forEach((k) => res[k] = []); - for (const category in EMOJIS) { - EMOJIS[category].forEach((e: IEmoji) => { - res[category].push({ ...e, imagePath: `../../../assets/emoji/${this.theme}/${e.imagePath}` }); - }); - } - return res; - } - - getSkinTones(): string[] { - return JSON.parse(JSON.stringify(SKINTONES)); - } - - getFilteredEmoji(query): IEmoji[] { - const normalQuery = query ? query.toLowerCase() : null; - let res = []; - for (const category of Object.values(EMOJIS as IEmojiList)) { - res = res.concat(category.filter((i) => { - return (i.name ? i.name.toLowerCase().includes(normalQuery) : false) || i.shortName.toLowerCase().includes(normalQuery) || i.shortText.includes(query); - }).map((e) => { return { ...e, imagePath: `../../../assets/emoji/${this.theme}/${e.imagePath}` }; })); - } - return res; - } -} diff --git a/tsconfig.json b/tsconfig.json index 41ae3e8d5..3d8c3ce41 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,6 @@ { "compileOnSave": false, "compilerOptions": { -<<<<<<< HEAD - "module": "esnext", - "outDir": "./dist/out-tsc", - "sourceMap": true, - "declaration": false, -======= "baseUrl": "./", "outDir": "./dist/out-tsc", "sourceMap": true, @@ -14,7 +8,6 @@ "downlevelIteration": true, "experimentalDecorators": true, "module": "esnext", ->>>>>>> c8da92906c2b44849a6c4b3c83ce1e6715699a77 "moduleResolution": "node", "importHelpers": true, "target": "es2015", @@ -31,18 +24,8 @@ "DOM.Iterable" ] }, -<<<<<<< HEAD - "include": [ - "main.ts", - "src/**/*" - ], - "exclude": [ - "node_modules" - ] -======= "angularCompilerOptions": { "fullTemplateTypeCheck": true, "strictInjectionParameters": true } ->>>>>>> c8da92906c2b44849a6c4b3c83ce1e6715699a77 }