From 272c601f15606e0a5728d9db0702e26a368aebe3 Mon Sep 17 00:00:00 2001 From: Curtis Dulmage Date: Sat, 27 Jan 2024 18:46:16 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20[Website]=20Add=20some=20debuggi?= =?UTF-8?q?ng=20UI=20(#78)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/blue-jank-crime.md | 5 + .changeset/thick-oranges-exercise.md | 5 + app/website/package.json | 4 +- app/website/src/components/StackLabel.vue | 9 +- app/website/src/hooks/useSupported.ts | 2 +- app/website/src/sections/ManagerDebug.vue | 211 ++++++++++++ app/website/src/sections/StackControls.vue | 2 +- app/website/src/sections/index.ts | 11 +- app/website/src/store/index.ts | 3 + app/website/src/store/useDebugManager.ts | 59 ++++ app/website/src/store/useDebugStore.ts | 11 + app/website/src/store/useEarwurmStore.ts | 7 + app/website/src/styles/global.css | 8 + app/website/src/views/HomeView.vue | 6 +- docs/api.md | 24 +- docs/contributing.md | 17 +- docs/examples.md | 102 +++++- package.json | 14 +- pkg/earwurm/MIGRATION.md | 11 + pkg/earwurm/package.json | 4 +- pkg/earwurm/src/Earwurm.ts | 134 ++++---- pkg/earwurm/src/tests/Earwurm.test.ts | 306 ++++++++++-------- pkg/earwurm/src/tests/helpers.ts | 23 ++ pkg/earwurm/src/tokens.ts | 3 +- pkg/earwurm/src/types.ts | 1 + pkg/helpers/package.json | 2 +- pkg/helpers/unlock-audio-context.ts | 4 +- pkg/mocks/package.json | 2 +- pkg/types/package.json | 2 +- pkg/utilities/package.json | 2 +- pkg/utilities/support.ts | 5 +- pkg/utilities/tests/support.test.ts | 4 +- pnpm-lock.yaml | 356 ++++++++++----------- 33 files changed, 916 insertions(+), 443 deletions(-) create mode 100644 .changeset/blue-jank-crime.md create mode 100644 .changeset/thick-oranges-exercise.md create mode 100644 app/website/src/sections/ManagerDebug.vue create mode 100644 app/website/src/store/useDebugManager.ts create mode 100644 app/website/src/store/useDebugStore.ts create mode 100644 pkg/earwurm/src/tests/helpers.ts diff --git a/.changeset/blue-jank-crime.md b/.changeset/blue-jank-crime.md new file mode 100644 index 0000000..037ce92 --- /dev/null +++ b/.changeset/blue-jank-crime.md @@ -0,0 +1,5 @@ +--- +"earwurm": minor +--- + +Remove timed auto-suspend in favour of exposing `.suspend() / .resume()` methods on `Earuwrm`. diff --git a/.changeset/thick-oranges-exercise.md b/.changeset/thick-oranges-exercise.md new file mode 100644 index 0000000..c58550e --- /dev/null +++ b/.changeset/thick-oranges-exercise.md @@ -0,0 +1,5 @@ +--- +"earwurm": minor +--- + +New `play` event available on `Earwurm` instance. diff --git a/app/website/package.json b/app/website/package.json index a8d3c5f..bc399d8 100644 --- a/app/website/package.json +++ b/app/website/package.json @@ -13,7 +13,7 @@ "type": "module", "engines": { "node": ">=20.10.0", - "pnpm": ">=8.14.0" + "pnpm": ">=8.15.0" }, "scripts": { "clean": "rm -rf dist && rm -rf *.tsbuildinfo", @@ -32,7 +32,7 @@ }, "devDependencies": { "@earwurm/types": "workspace:*", - "@rushstack/eslint-patch": "^1.7.0", + "@rushstack/eslint-patch": "^1.7.2", "@tsconfig/node20": "^20.1.2", "@vitejs/plugin-vue": "^5.0.3", "@vue/eslint-config-prettier": "^9.0.0", diff --git a/app/website/src/components/StackLabel.vue b/app/website/src/components/StackLabel.vue index 52052db..d827660 100644 --- a/app/website/src/components/StackLabel.vue +++ b/app/website/src/components/StackLabel.vue @@ -4,6 +4,7 @@ import {classNames} from '@/helpers'; export interface StackLabelProps { label: string; populated?: boolean; + truncate?: boolean; } defineProps(); @@ -11,7 +12,7 @@ defineProps(); @@ -21,6 +22,7 @@ defineProps(); place-items: center; place-content: center; padding: 0.8rem; + flex: 0 0 auto; min-width: var(--row-height); height: var(--row-height); color: var(--color-primary); @@ -37,8 +39,11 @@ defineProps(); } .Text { + font-size: 1.4rem; +} + +.truncate { @apply truncate; @apply flex-fix-width; - font-size: 1.4rem; } diff --git a/app/website/src/hooks/useSupported.ts b/app/website/src/hooks/useSupported.ts index 652c898..8d74256 100644 --- a/app/website/src/hooks/useSupported.ts +++ b/app/website/src/hooks/useSupported.ts @@ -2,7 +2,7 @@ import {computed} from 'vue'; import {useMounted} from './useMounted'; // Adapted from Vue Use: https://vueuse.org/ -export function useSupported(callback: () => unknown) { +export function useSupported(callback: () => boolean) { const isMounted = useMounted(); return computed(() => { diff --git a/app/website/src/sections/ManagerDebug.vue b/app/website/src/sections/ManagerDebug.vue new file mode 100644 index 0000000..054c380 --- /dev/null +++ b/app/website/src/sections/ManagerDebug.vue @@ -0,0 +1,211 @@ + + + + + diff --git a/app/website/src/sections/StackControls.vue b/app/website/src/sections/StackControls.vue index 695166d..d2e5009 100644 --- a/app/website/src/sections/StackControls.vue +++ b/app/website/src/sections/StackControls.vue @@ -42,7 +42,7 @@ const preparing = computed(() => hasStack.value && !loaded.value);