aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authornetop://ウィビ <paul@webb.page>2026-04-24 16:37:49 -0700
committernetop://ウィビ <paul@webb.page>2026-04-24 16:37:49 -0700
commitc013ed57bf3d7dd83bd59a9b984d87aebde6003c (patch)
tree31d25456496f013f13f3cae1ded376d5323b3200 /source
parent510fd8cbe53abb39cba2c7cbaaefcf2783dc0066 (diff)
downloadgraphiql-c013ed57bf3d7dd83bd59a9b984d87aebde6003c.tar.gz
graphiql-c013ed57bf3d7dd83bd59a9b984d87aebde6003c.zip
Migrate from Deno/JSR to npm publishing
- @sveltejs/package builds dist/ for @eeeooolll/graphiql with three entry points (./, ./component, ./splitter) - Vitest + svelte-check replace Deno test/check; runes shim no longer needed since the Svelte plugin compiles .svelte.ts at runtime - Drop $app/environment dep in Editor.svelte to support non-SvelteKit consumers - Refactor TabBar tab element from nested <button> to role=tab <div> per PLAN.md gotcha; svelte-check flagged the invalid HTML - README now documents npm install, integration patterns for Yoga, Apollo, graphql-modules, Hono/Bun/Deno, plus APQ + keyboard table
Diffstat (limited to 'source')
-rw-r--r--source/library/components/Editor.svelte3
-rw-r--r--source/library/components/TabBar.svelte15
2 files changed, 13 insertions, 5 deletions
diff --git a/source/library/components/Editor.svelte b/source/library/components/Editor.svelte
index f2bf82d..393812a 100644
--- a/source/library/components/Editor.svelte
+++ b/source/library/components/Editor.svelte
@@ -1,7 +1,6 @@
<script lang="ts">
/*** IMPORT ------------------------------------------- ***/
- import { browser } from "$app/environment";
import { onMount } from "svelte";
import type { Extension } from "@codemirror/state";
import type { EditorView } from "@codemirror/view";
@@ -33,7 +32,7 @@
let view = $state<EditorView | null>(null);
onMount(() => {
- if (!browser)
+ if (typeof globalThis.document === "undefined")
return;
let disposed = false;
diff --git a/source/library/components/TabBar.svelte b/source/library/components/TabBar.svelte
index 9c34f20..0bfec02 100644
--- a/source/library/components/TabBar.svelte
+++ b/source/library/components/TabBar.svelte
@@ -130,13 +130,22 @@
}
</style>
-<div class="tabbar">
+<div class="tabbar" role="tablist">
{#each tabs as tab (tab.id)}
- <button
+ <div
+ aria-selected={tab.id === activeId}
class="tab"
class:active={tab.id === activeId}
ondblclick={() => startEditing(tab)}
onclick={() => onSelect(tab.id)}
+ onkeydown={(e) => {
+ if (e.key === "Enter" || e.key === " ") {
+ e.preventDefault();
+ onSelect(tab.id);
+ }
+ }}
+ role="tab"
+ tabindex="0"
>
{#if editingId === tab.id}
<input
@@ -157,7 +166,7 @@
class="close"
onclick={(e) => handleClose(e, tab.id)}
>×</button>
- </button>
+ </div>
{/each}
<button aria-label="New tab" class="add" onclick={onAdd}>+</button>
</div>