Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
81b7041f27d5c5590d41ae634a1d2ba8854879f2
6 changes: 5 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
lint:
name: JS and HBS
name: JS, HBS, Prettier, Types
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
Expand All @@ -23,3 +23,7 @@ jobs:
run: pnpm lint:js
- name: Lint HBS
run: pnpm lint:hbs
- name: Lint Prettier
run: pnpm lint:format
- name: Lint Types
run: pnpm lint:types
6 changes: 1 addition & 5 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,14 @@ const importOrder = [
swachInternals,
];
const importOrderParserPlugins = ['typescript', 'decorators-legacy'];
const importOrderSeparation = true;
const importOrderSortSpecifiers = true;

module.exports = {
plugins: [
'prettier-plugin-ember-template-tag',
'@trivago/prettier-plugin-sort-imports',
'@ianvs/prettier-plugin-sort-imports',
],
importOrder,
importOrderParserPlugins,
importOrderSeparation,
importOrderSortSpecifiers,
overrides: [
{
files: '*.{js,gjs,ts,gts,mjs,mts,cjs,cts}',
Expand Down
3 changes: 0 additions & 3 deletions app/app.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import Application from '@ember/application';

import { InitSentryForEmber } from '@sentry/ember';
import loadInitializers from 'ember-load-initializers';
import Resolver from 'ember-resolver';

import { importSync, isDevelopingApp, macroCondition } from '@embroider/macros';

import config from 'swach/config/environment';

if (macroCondition(isDevelopingApp())) {
Expand Down
1 change: 0 additions & 1 deletion app/authenticators/cognito.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { service } from '@ember/service';

import CognitoAuthenticator from 'ember-cognito/authenticators/cognito';

export default class CognitoAuthenticatorExtended extends CognitoAuthenticator {
Expand Down
36 changes: 29 additions & 7 deletions app/components/about.ts → app/components/about.gts
Original file line number Diff line number Diff line change
@@ -1,15 +1,43 @@
import { on } from '@ember/modifier';
import { action } from '@ember/object';
import type Owner from '@ember/owner';
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';

import type { IpcRenderer } from 'electron';

interface AboutSignature {
Element: HTMLDivElement;
}

export default class AboutComponent extends Component<AboutSignature> {
<template>
<div class="text-xs">
<h6 class="font-semibold mt-4 text-heading text-sm">
About
</h6>

<p class="mt-2">
Version:
{{this.version}}
</p>

<p>
Copyright ©
{{this.copyrightYear}}
Ship Shape Consulting LLC.
</p>

<p>
All rights reserved.
</p>

<p>
<a href class="hover:text-alt-hover" {{on "click" this.visitWebsite}}>
https://swach.io/
</a>
</p>
</div>
</template>
declare ipcRenderer: IpcRenderer;

copyrightYear = new Date().getFullYear();
Expand Down Expand Up @@ -38,9 +66,3 @@ export default class AboutComponent extends Component<AboutSignature> {
}
}
}

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
About: typeof AboutComponent;
}
}
26 changes: 0 additions & 26 deletions app/components/about.hbs

This file was deleted.

39 changes: 31 additions & 8 deletions app/components/alpha-input.ts → app/components/alpha-input.gts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { hash } from '@ember/helper';
import { on } from '@ember/modifier';
import { action, set } from '@ember/object';
import Component from '@glimmer/component';

// @ts-expect-error TODO: fix this
import OneWayInputMask from 'ember-inputmask/_app_/components/one-way-input-mask.js';
import type { SelectedColorModel } from 'swach/components/rgb-input';
import { rgbaToHex } from 'swach/data-models/color';

Expand All @@ -10,11 +13,37 @@ interface AlphaInputSignature {
selectedColor: SelectedColorModel;
update: (value: string | number) => void;
updateColor: () => void;
value?: string;
value?: number;
};
}

export default class AlphaInputComponent extends Component<AlphaInputSignature> {
<template>
<span class="input-prefix">
A:
</span>

<OneWayInputMask
...attributes
maxlength={{4}}
@mask="9[.9[9]]"
@options={{hash
greedy=false
isComplete=this.isComplete
min=0
max=1
oncomplete=this.onComplete
onincomplete=this.onIncomplete
regex=this.alphaRegex
showMaskOnFocus=false
showMaskOnHover=false
unmaskAsNumber=false
}}
@update={{@update}}
@value={{@value}}
{{on "keypress" this.enterPress}}
/>
</template>
alphaRegex = /^[1]$|^[0]$|^(0\.[0-9]{1,2})$/;

@action
Expand Down Expand Up @@ -63,9 +92,3 @@ export default class AlphaInputComponent extends Component<AlphaInputSignature>
set(this.args.selectedColor, `_a`, this.args.selectedColor.a);
}
}

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
AlphaInput: typeof AlphaInputComponent;
}
}
24 changes: 0 additions & 24 deletions app/components/alpha-input.hbs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
import { action, set } from '@ember/object';

import type Sprite from 'ember-animated/-private/sprite';
import TransitionContext from 'ember-animated/-private/transition-context';
import AnimatedContainer from 'ember-animated/components/animated-container';
import AnimatedEach from 'ember-animated/components/animated-each';
import { easeOut } from 'ember-animated/easings/cosine';
import move from 'ember-animated/motions/move';
import { fadeOut } from 'ember-animated/motions/opacity';
// @ts-expect-error TODO: fix this
import DragSortItem from 'ember-drag-sort/components/drag-sort-item';
import DragSortList from 'ember-drag-sort/components/drag-sort-list';

export default class AnimatedDragSortList extends DragSortList {
<template>
{{!@glint-nocheck}}
<AnimatedContainer ...attributes>
{{#AnimatedEach @items duration=400 rules=this.rules as |item index|}}
<DragSortItem
@additionalArgs={{@additionalArgs}}
@item={{item}}
@index={{index}}
@items={{@items}}
@group={{@group}}
@handle={{@handle}}
@class={{@childClass}}
@tagName={{@childTagName}}
@isHorizontal={{@isHorizontal}}
@isRtl={{@isRtl}}
@draggingEnabled={{this.draggingEnabled}}
@dragEndAction={{@dragEndAction}}
@determineForeignPositionAction={{@determineForeignPositionAction}}
@sourceOnly={{@sourceOnly}}
>
{{yield item index}}
</DragSortItem>
{{/AnimatedEach}}
</AnimatedContainer>
</template>
didDrag = false;

dragEnter(event: Event): void {
Expand All @@ -31,11 +59,7 @@ export default class AnimatedDragSortList extends DragSortList {
keptSprites,
insertedSprites,
removedSprites,
}: {
keptSprites: Array<Sprite>;
insertedSprites: Array<Sprite>;
removedSprites: Array<Sprite>;
}): unknown {
}: TransitionContext) {
for (const sprite of insertedSprites) {
if (sprite.finalBounds?.height) {
sprite.startTranslatedBy(0, -sprite.finalBounds.height / 2);
Expand All @@ -53,9 +77,3 @@ export default class AnimatedDragSortList extends DragSortList {
}
}
}

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
AnimatedDragSortList: typeof AnimatedDragSortList;
}
}
22 changes: 0 additions & 22 deletions app/components/animated-drag-sort-list.hbs

This file was deleted.

Loading