isotone 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +53 -51
- package/dist/{chunk-WMNR7KVD.js → chunk-YFQXGHNT.js} +2 -2
- package/dist/{chunk-WMNR7KVD.js.map → chunk-YFQXGHNT.js.map} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +63 -19
- package/dist/index.js.map +1 -1
- package/dist/isotone.global.js +38 -22
- package/dist/serve.js +1 -1
- package/dist/vite-plugin.js +1 -1
- package/docs/assets/preview.jpg +0 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,14 +1,41 @@
|
|
|
1
1
|
# Isotone
|
|
2
2
|
|
|
3
|
-
Point at
|
|
3
|
+
Point at the part of your app you want changed, say what should change, and your
|
|
4
|
+
coding agent gets the exact element, page and screen size with your note.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
Notes stay in your project with the route, viewport, and element references your
|
|
7
|
-
agent needs. No account, database, or hosted service.
|
|
6
|
+

|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
## Why
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
Coding agents write UI fast, but telling one which piece of UI you mean is slow.
|
|
11
|
+
You type "the label above the number in the first stats card", the agent guesses
|
|
12
|
+
a component, and the next round goes to correcting the guess. Comparing two
|
|
13
|
+
design directions is worse: you ask for one, review it, ask for the other, and
|
|
14
|
+
try to remember what the first looked like.
|
|
15
|
+
|
|
16
|
+
Some agents let you select an element, Claude Code among them, but only inside
|
|
17
|
+
the browser they ship with. You lose your own browser with its sign-ins,
|
|
18
|
+
extensions, devtools and window sizes, and each selection lives in a single chat
|
|
19
|
+
message.
|
|
20
|
+
|
|
21
|
+
Isotone is a purpose-built tool for design engineering with a coding agent. It
|
|
22
|
+
runs in your dev server and adds a small panel to the page you already have open:
|
|
23
|
+
|
|
24
|
+
- Pin one or more elements and write a note. The note records the route, the
|
|
25
|
+
viewport, and a selector and the visible text of every pinned element.
|
|
26
|
+
- Keep a backlog. Notes go to a JSON file in your project, so you can keep
|
|
27
|
+
writing while the agent works through them.
|
|
28
|
+
- Follow progress. The agent marks a note as started and closes it when the
|
|
29
|
+
change is verified, and the panel updates without a reload.
|
|
30
|
+
- Compare variants. The agent can build two or three versions of a component.
|
|
31
|
+
You switch between them on the live page, comment on one, or keep the default.
|
|
32
|
+
- Use any agent. Agents read notes with `npx isotone --json`, so nothing depends
|
|
33
|
+
on a particular agent, editor or browser.
|
|
34
|
+
|
|
35
|
+
There is no account, database or hosted service, and nothing is added to
|
|
36
|
+
production builds.
|
|
37
|
+
|
|
38
|
+
## Install
|
|
12
39
|
|
|
13
40
|
Run in the project you want to review:
|
|
14
41
|
|
|
@@ -17,14 +44,11 @@ npm install -D isotone
|
|
|
17
44
|
npx isotone init --yes
|
|
18
45
|
```
|
|
19
46
|
|
|
20
|
-
|
|
21
|
-
workflow to `AGENTS.md
|
|
22
|
-
the printed instructions.
|
|
23
|
-
|
|
24
|
-
Already using the previous package? Follow the [migration guide](docs/migration.md)
|
|
25
|
-
to keep your notes, variants, and project setup.
|
|
47
|
+
`init` detects your setup, prints the integration to add, and adds a short
|
|
48
|
+
workflow to `AGENTS.md` so your agent knows the loop. It does not edit app code.
|
|
26
49
|
|
|
27
|
-
For **Vite**, add the plugin
|
|
50
|
+
For **Vite**, add the plugin next to your existing plugins. It works with any
|
|
51
|
+
Vite framework:
|
|
28
52
|
|
|
29
53
|
```ts
|
|
30
54
|
import { defineConfig } from 'vite';
|
|
@@ -35,9 +59,6 @@ export default defineConfig({
|
|
|
35
59
|
});
|
|
36
60
|
```
|
|
37
61
|
|
|
38
|
-
Works with any Vite framework. The panel brings its own React runtime and is
|
|
39
|
-
only injected by the development server.
|
|
40
|
-
|
|
41
62
|
For **any other dev server**, run `npx isotone serve` and add this to your
|
|
42
63
|
development HTML:
|
|
43
64
|
|
|
@@ -45,52 +66,33 @@ development HTML:
|
|
|
45
66
|
<script src="http://127.0.0.1:4123/isotone.js" defer></script>
|
|
46
67
|
```
|
|
47
68
|
|
|
48
|
-
[
|
|
49
|
-
|
|
69
|
+
The [integration guide](docs/integrations.md) covers Next and other route
|
|
70
|
+
handlers, React embeds, themes and production guards. Node.js 20 or later is
|
|
71
|
+
required. Coming from the previous package? See the [migration guide](docs/migration.md).
|
|
50
72
|
|
|
51
73
|
## The loop
|
|
52
74
|
|
|
53
|
-
1. Open Feedback with **⌘/Ctrl + Shift +
|
|
75
|
+
1. Open Feedback with **⌘/Ctrl + Shift + .**, pin elements, write a note and send.
|
|
54
76
|
2. Your agent reads `npx isotone --json`, marks the note it starts with
|
|
55
|
-
`npx isotone --working <id>`, makes and
|
|
56
|
-
`npx isotone --done <id>`.
|
|
57
|
-
3. Review the result. For alternatives,
|
|
58
|
-
[
|
|
59
|
-
|
|
60
|
-
The panel lists the current page's notes. When other pages have open notes too,
|
|
61
|
-
a row of page chips lets you include them.
|
|
62
|
-
|
|
63
|
-
Click a saved note to edit it. **Enter** sends; **Shift + Enter** adds a newline.
|
|
64
|
-
While selecting elements, click to pin or Tab to a page control and press Space.
|
|
65
|
-
Enter or Escape finishes selection. The selected element text stays attached to
|
|
66
|
-
the note; closing the panel preserves your draft.
|
|
67
|
-
|
|
68
|
-
## Themes
|
|
69
|
-
|
|
70
|
-
The panel follows the rendered page by default. Set `theme` on the Vite plugin,
|
|
71
|
-
`mountIteration`, or `IterationPanel`:
|
|
72
|
-
|
|
73
|
-
```ts
|
|
74
|
-
iteration({ theme: 'auto' }); // page background; the default
|
|
75
|
-
iteration({ theme: 'system' }); // operating system preference
|
|
76
|
-
iteration({ theme: 'light' }); // explicit light, or 'dark'
|
|
77
|
-
```
|
|
77
|
+
`npx isotone --working <id>`, makes and checks the change, then closes it
|
|
78
|
+
with `npx isotone --done <id>`.
|
|
79
|
+
3. Review the result on the page. For alternatives, ask for
|
|
80
|
+
[variants](docs/variants.md) and switch between them in place.
|
|
78
81
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
The panel lists the current page's notes. When other pages have open notes,
|
|
83
|
+
page chips let you include them. Click a saved note to edit it. **Enter** sends
|
|
84
|
+
and **Shift + Enter** adds a newline. While selecting, click to pin, hold
|
|
85
|
+
**Shift** to use the page normally, and press Enter or Escape to finish.
|
|
83
86
|
|
|
84
87
|
## Updates
|
|
85
88
|
|
|
86
|
-
The dev server checks
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
content. Use `checkForUpdates: false` to opt out. [Update details](docs/updates.md).
|
|
89
|
+
The dev server checks npm for a newer version at most once a day and shows the
|
|
90
|
+
upgrade command in the panel. The check sends no project content and stays quiet
|
|
91
|
+
offline. Set `checkForUpdates: false` to turn it off. [Update details](docs/updates.md).
|
|
90
92
|
|
|
91
93
|
## For maintainers
|
|
92
94
|
|
|
93
95
|
[Development and contributing](https://github.com/aaroi/isotone/blob/main/docs/development.md)
|
|
94
|
-
covers the source, design language, checks
|
|
96
|
+
covers the source, design language, checks and releases.
|
|
95
97
|
|
|
96
98
|
MIT.
|
|
@@ -7,7 +7,7 @@ import { randomUUID } from "crypto";
|
|
|
7
7
|
|
|
8
8
|
// package.json
|
|
9
9
|
var name = "isotone";
|
|
10
|
-
var version = "1.0.
|
|
10
|
+
var version = "1.0.8";
|
|
11
11
|
|
|
12
12
|
// src/update.ts
|
|
13
13
|
var UPDATE_ENDPOINT = "/api/iteration/update";
|
|
@@ -228,4 +228,4 @@ export {
|
|
|
228
228
|
checkUpdate,
|
|
229
229
|
startUpdateCheck
|
|
230
230
|
};
|
|
231
|
-
//# sourceMappingURL=chunk-
|
|
231
|
+
//# sourceMappingURL=chunk-YFQXGHNT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/update.ts","../package.json"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { mkdir, open, readFile, rename, rm, stat, writeFile } from 'node:fs/promises';\nimport { dirname, join, resolve } from 'node:path';\nimport { tmpdir } from 'node:os';\nimport { randomUUID } from 'node:crypto';\nimport type { UpdateInfo } from './core/update';\nimport { name as packageName, version as currentVersion } from '../package.json';\n\nexport const UPDATE_ENDPOINT = '/api/iteration/update';\nconst REGISTRY_URL = `https://registry.npmjs.org/${packageName}/latest`;\nconst CHECK_TIMEOUT = 5_000;\nconst CACHE_TTL = 24 * 60 * 60 * 1000;\nconst CACHE_FILE = join(tmpdir(), `isotone-update-${process.getuid?.() ?? 'user'}-v1.json`);\n\ntype Manager = 'npm' | 'pnpm' | 'yarn';\nexport type { UpdateInfo } from './core/update';\n\ninterface Version { parts: bigint[]; prerelease: string[] }\nfunction parseVersion(value: string): Version {\n if (value.length > 256) throw new Error('Invalid version.');\n const match = /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-([\\da-zA-Z-]+(?:\\.[\\da-zA-Z-]+)*))?(?:\\+([\\da-zA-Z-]+(?:\\.[\\da-zA-Z-]+)*))?$/.exec(value);\n if (!match) throw new Error('Invalid version.');\n const prerelease = match[4]?.split('.') ?? [];\n if (prerelease.some((part) => /^0\\d+$/.test(part))) throw new Error('Invalid version.');\n return { parts: match.slice(1, 4).map(BigInt), prerelease };\n}\n\n/** SemVer precedence, including numeric prereleases and ignored build metadata. */\nexport function compareVersions(a: string, b: string): number {\n const left = parseVersion(a), right = parseVersion(b);\n for (let i = 0; i < 3; i++) {\n if (left.parts[i] !== right.parts[i]) return left.parts[i] > right.parts[i] ? 1 : -1;\n }\n if (!left.prerelease.length || !right.prerelease.length) {\n return left.prerelease.length === right.prerelease.length ? 0 : left.prerelease.length ? -1 : 1;\n }\n for (let i = 0; i < Math.max(left.prerelease.length, right.prerelease.length); i++) {\n const x = left.prerelease[i], y = right.prerelease[i];\n if (x === y) continue;\n if (x === undefined || y === undefined) return x === undefined ? -1 : 1;\n const nx = /^\\d+$/.test(x), ny = /^\\d+$/.test(y);\n if (nx && ny) return BigInt(x) > BigInt(y) ? 1 : -1;\n if (nx !== ny) return nx ? -1 : 1;\n return x > y ? 1 : -1;\n }\n return 0;\n}\n\nfunction manifest(directory: string): Record<string, unknown> | null {\n try {\n const value = JSON.parse(readFileSync(join(directory, 'package.json'), 'utf8'));\n return value && typeof value === 'object' && !Array.isArray(value) ? value : null;\n } catch { return null; }\n}\n\nfunction findProject(cwd: string): { directory: string; json: Record<string, unknown> | null } {\n let directory = resolve(cwd);\n while (true) {\n const json = manifest(directory);\n if (json) return { directory, json };\n if (dirname(directory) === directory || existsSync(join(directory, '.git'))) return { directory: resolve(cwd), json: null };\n directory = dirname(directory);\n }\n}\n\nfunction dependencyOwner(project: ReturnType<typeof findProject>): ReturnType<typeof findProject> {\n let directory = project.directory;\n while (true) {\n const json = manifest(directory);\n if (['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies'].some((key) => {\n const dependencies = json?.[key];\n return dependencies && typeof dependencies === 'object' && Object.hasOwn(dependencies, packageName);\n })) return { directory, json };\n if (dirname(directory) === directory || existsSync(join(directory, '.git'))) return project;\n directory = dirname(directory);\n }\n}\n\nexport function upgradePlan(cwd: string, latest: string, override?: Manager): Pick<UpdateInfo, 'upgrade' | 'message'> {\n parseVersion(latest); // Only a validated version can enter a copied command.\n const project = dependencyOwner(findProject(cwd));\n if (project.json?.name === packageName) return { upgrade: null, message: 'This is the source checkout; update its source instead of adding itself as a dependency.' };\n let manager = override;\n let directory = project.directory;\n const locks = new Set<Manager>();\n while (!manager) {\n const declared = manifest(directory)?.packageManager;\n if (typeof declared === 'string') {\n const match = /^(npm|pnpm|yarn)@/.exec(declared);\n if (!match) return { upgrade: null, message: 'The declared package manager is not supported by this command. Upgrade with your project’s package manager.' };\n manager = match[1] as Manager;\n break;\n }\n if (['bun.lock', 'bun.lockb'].some((file) => existsSync(join(directory, file)))) return { upgrade: null, message: 'This project uses Bun. Upgrade with the project’s package manager.' };\n if (existsSync(join(directory, 'pnpm-lock.yaml'))) locks.add('pnpm');\n if (existsSync(join(directory, 'yarn.lock'))) locks.add('yarn');\n if (['package-lock.json', 'npm-shrinkwrap.json'].some((file) => existsSync(join(directory, file)))) locks.add('npm');\n if (locks.size || dirname(directory) === directory || existsSync(join(directory, '.git'))) break;\n directory = dirname(directory);\n }\n if (!manager && locks.size > 1) return { upgrade: null, message: 'Multiple package-manager lockfiles found. Pass --manager npm, pnpm or yarn.' };\n manager ??= [...locks][0] ?? 'npm';\n const production = project.json?.dependencies as Record<string, unknown> | undefined;\n const optional = project.json?.optionalDependencies as Record<string, unknown> | undefined;\n const peers = project.json?.peerDependencies as Record<string, unknown> | undefined;\n if (optional?.[packageName] || peers?.[packageName]) return { upgrade: null, message: 'Review this optional/peer dependency manually with your package manager.' };\n const dev = production?.[packageName] ? '' : ' -D';\n let workspace = manager === 'pnpm' && existsSync(join(project.directory, 'pnpm-workspace.yaml')) ? ' -w' : '';\n if (manager === 'yarn' && project.json?.workspaces) {\n const declared = project.json.packageManager;\n if (typeof declared !== 'string' || !/^yarn@\\d+\\./.test(declared)) return { upgrade: null, message: 'Declare the Yarn version in packageManager before updating a workspace-root dependency; Yarn Classic and modern Yarn use different root flags.' };\n if (declared.startsWith('yarn@1.')) workspace = ' -W';\n }\n const command = manager === 'npm'\n ? `npm install${dev} --save-exact ${packageName}@${latest}`\n : `${manager} add${dev}${workspace} --exact ${packageName}@${latest}`;\n return { upgrade: { manager, command, cwd: project.directory } };\n}\n\nexport async function fetchLatest(fetcher: typeof fetch = fetch, signal?: AbortSignal): Promise<string> {\n const controller = new AbortController();\n const abort = () => controller.abort();\n if (signal?.aborted) abort();\n else signal?.addEventListener('abort', abort, { once: true });\n const timer = setTimeout(abort, CHECK_TIMEOUT);\n try {\n if (controller.signal.aborted) throw new Error('Update check cancelled.');\n const response = await fetcher(REGISTRY_URL, { signal: controller.signal, redirect: 'error', headers: { accept: 'application/json' } });\n if (!response.ok) throw new Error(`Registry returned HTTP ${response.status}.`);\n if (!response.body) throw new Error('Registry returned an empty response.');\n const reader = response.body.getReader();\n const chunks: Uint8Array[] = [];\n let bytes = 0;\n try {\n while (true) {\n const { value, done } = await reader.read();\n if (done) break;\n bytes += value.byteLength;\n if (bytes > 64 * 1024) {\n await reader.cancel();\n throw new Error('Registry response was too large.');\n }\n chunks.push(value);\n }\n } finally { reader.releaseLock(); }\n const data = JSON.parse(Buffer.concat(chunks).toString('utf8'));\n if (typeof data.version !== 'string') throw new Error('Registry returned no version.');\n parseVersion(data.version);\n return data.version;\n } finally { clearTimeout(timer); signal?.removeEventListener('abort', abort); }\n}\n\nexport function updateInfo(latest: string, cwd: string, manager?: Manager): UpdateInfo {\n const order = compareVersions(latest, currentVersion);\n return {\n currentVersion, latestVersion: latest,\n status: order > 0 ? 'available' : order < 0 ? 'ahead' : 'current',\n ...(order > 0 ? upgradePlan(cwd, latest, manager) : { upgrade: null }),\n };\n}\n\nexport async function checkUpdate(cwd: string, manager?: Manager, fetcher?: typeof fetch, signal?: AbortSignal): Promise<UpdateInfo> {\n try { return updateInfo(await fetchLatest(fetcher, signal), cwd, manager); }\n catch { return { currentVersion, latestVersion: null, status: 'unavailable', upgrade: null, message: 'Could not check npm for updates. The installed version remains usable; try again when online.' }; }\n}\n\ninterface CachedCheck { checkedAt: number; latestVersion: string | null }\nasync function readCache(file: string): Promise<CachedCheck | null> {\n try {\n if ((await stat(file)).size > 4096) return null;\n const data = JSON.parse(await readFile(file, 'utf8'));\n if (!Number.isFinite(data.checkedAt) || data.checkedAt > Date.now() || Date.now() - data.checkedAt >= CACHE_TTL) return null;\n if (data.latestVersion !== null) parseVersion(data.latestVersion);\n return data;\n } catch { return null; }\n}\n\nasync function saveCache(file: string, latestVersion: string | null): Promise<void> {\n const temporary = `${file}.${randomUUID()}.tmp`;\n try {\n await writeFile(temporary, JSON.stringify({ checkedAt: Date.now(), latestVersion }), { mode: 0o600, flag: 'wx' });\n await rename(temporary, file);\n } finally { await rm(temporary, { force: true }); }\n}\n\n/** One bounded request a day, including failed attempts, shared across dev servers. */\nexport function startUpdateCheck(cwd: string, enabled = true, options: { cacheFile?: string; fetcher?: typeof fetch; env?: NodeJS.ProcessEnv } = {}): { getSnapshot(): UpdateInfo; ready: Promise<void>; dispose(): void } {\n const controller = new AbortController();\n const env = options.env ?? process.env;\n const off = !enabled || env.ISOTONE_UPDATE_CHECK === '0' || (!!env.CI && env.CI !== 'false' && env.CI !== '0') || env.NODE_ENV === 'test' || !!env.VITEST;\n let info: UpdateInfo = { currentVersion, latestVersion: null, status: off ? 'disabled' : 'checking', upgrade: null };\n const ready = off ? Promise.resolve() : (async () => {\n const file = options.cacheFile ?? CACHE_FILE;\n let locked = false;\n try {\n const cache = await readCache(file);\n if (cache) { info = cache.latestVersion ? updateInfo(cache.latestVersion, cwd) : { ...info, status: 'unavailable' }; return; }\n await mkdir(dirname(file), { recursive: true });\n try { await (await open(`${file}.lock`, 'wx', 0o600)).close(); locked = true; }\n catch {\n // A concurrent server owns the request. Recover an abandoned lease next time.\n if (Date.now() - (await stat(`${file}.lock`)).mtimeMs > CHECK_TIMEOUT * 3) await rm(`${file}.lock`, { force: true });\n info = { ...info, status: 'unavailable' };\n return;\n }\n const refreshed = await readCache(file);\n if (refreshed) { info = refreshed.latestVersion ? updateInfo(refreshed.latestVersion, cwd) : { ...info, status: 'unavailable' }; return; }\n await saveCache(file, null);\n info = await checkUpdate(cwd, undefined, options.fetcher, controller.signal);\n if (info.latestVersion) await saveCache(file, info.latestVersion);\n } catch { info = { currentVersion, latestVersion: null, status: 'unavailable', upgrade: null }; }\n finally { if (locked) await rm(`${file}.lock`, { force: true }).catch(() => {}); }\n })();\n return { getSnapshot: () => info, ready, dispose: () => controller.abort() };\n}\n","{\n \"name\": \"isotone\",\n \"version\": \"1.0.7\",\n \"type\": \"module\",\n \"license\": \"MIT\",\n \"description\": \"Local feedback and design variants for your running web app. Pin elements, leave notes, and give your coding agent the context to make the change.\",\n \"engines\": {\n \"node\": \">=20\"\n },\n \"exports\": {\n \"./react\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n },\n \"./core\": {\n \"types\": \"./dist/core.d.ts\",\n \"import\": \"./dist/core.js\"\n },\n \"./server\": {\n \"types\": \"./dist/server.d.ts\",\n \"import\": \"./dist/server.js\"\n },\n \"./serve\": {\n \"types\": \"./dist/serve.d.ts\",\n \"import\": \"./dist/serve.js\"\n },\n \"./vite\": {\n \"types\": \"./dist/vite-plugin.d.ts\",\n \"import\": \"./dist/vite-plugin.js\"\n },\n \"./cli\": {\n \"types\": \"./dist/cli.d.ts\",\n \"import\": \"./dist/cli.js\"\n }\n },\n \"files\": [\n \"dist\",\n \"docs/assets/preview.jpg\",\n \"docs/integrations.md\",\n \"docs/migration.md\",\n \"docs/updates.md\",\n \"docs/variants.md\",\n \"docs/third-party-notices.md\",\n \"AGENTS.md\",\n \"CHANGELOG.md\"\n ],\n \"bin\": {\n \"isotone\": \"./dist/cli.js\"\n },\n \"scripts\": {\n \"typecheck\": \"tsc --noEmit\",\n \"lint\": \"biome lint .\",\n \"lint:fix\": \"biome lint --write .\",\n \"test\": \"vitest run\",\n \"test:watch\": \"vitest\",\n \"build\": \"tsup\",\n \"check\": \"pnpm typecheck && pnpm lint && pnpm build && pnpm test\",\n \"prepublishOnly\": \"pnpm check\",\n \"dev\": \"vite --config examples/vite.config.ts\",\n \"check:package\": \"node scripts/check-package.mjs\"\n },\n \"peerDependencies\": {\n \"react\": \"^18 || ^19\",\n \"react-dom\": \"^18 || ^19\",\n \"vite\": \"^5 || ^6 || ^7 || ^8\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"2.5.7\",\n \"@types/node\": \"24.13.3\",\n \"@types/react\": \"^19\",\n \"@types/react-dom\": \"^19\",\n \"jsdom\": \"^30.0.1\",\n \"react\": \"^19\",\n \"react-dom\": \"^19\",\n \"tsup\": \"^8\",\n \"typescript\": \"^5\",\n \"vite\": \"^7\",\n \"vitest\": \"^4.1.10\",\n \"lucide-react\": \"^1.55.0\"\n },\n \"keywords\": [\n \"feedback\",\n \"review\",\n \"dev-tool\",\n \"vite-plugin\",\n \"coding-agent\",\n \"annotations\",\n \"design-review\",\n \"variants\",\n \"iteration\"\n ],\n \"sideEffects\": false,\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/aaroi/isotone.git\"\n },\n \"homepage\": \"https://github.com/aaroi/isotone#readme\",\n \"bugs\": \"https://github.com/aaroi/isotone/issues\",\n \"peerDependenciesMeta\": {\n \"react\": {\n \"optional\": true\n },\n \"react-dom\": {\n \"optional\": true\n },\n \"vite\": {\n \"optional\": true\n }\n }\n}\n"],"mappings":";AAAA,SAAS,YAAY,oBAAoB;AACzC,SAAS,OAAO,MAAM,UAAU,QAAQ,IAAI,MAAM,iBAAiB;AACnE,SAAS,SAAS,MAAM,eAAe;AACvC,SAAS,cAAc;AACvB,SAAS,kBAAkB;;;ACHzB,WAAQ;AACR,cAAW;;;ADMN,IAAM,kBAAkB;AAC/B,IAAM,eAAe,8BAA8B,IAAW;AAC9D,IAAM,gBAAgB;AACtB,IAAM,YAAY,KAAK,KAAK,KAAK;AACjC,IAAM,aAAa,KAAK,OAAO,GAAG,kBAAkB,QAAQ,SAAS,KAAK,MAAM,UAAU;AAM1F,SAAS,aAAa,OAAwB;AAC5C,MAAI,MAAM,SAAS,IAAK,OAAM,IAAI,MAAM,kBAAkB;AAC1D,QAAM,QAAQ,4HAA4H,KAAK,KAAK;AACpJ,MAAI,CAAC,MAAO,OAAM,IAAI,MAAM,kBAAkB;AAC9C,QAAM,aAAa,MAAM,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC;AAC5C,MAAI,WAAW,KAAK,CAAC,SAAS,SAAS,KAAK,IAAI,CAAC,EAAG,OAAM,IAAI,MAAM,kBAAkB;AACtF,SAAO,EAAE,OAAO,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,MAAM,GAAG,WAAW;AAC5D;AAGO,SAAS,gBAAgB,GAAW,GAAmB;AAC5D,QAAM,OAAO,aA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AK,QAAW,QAAQ,SAAS,WAAW,MAAM;AAC3E,UAAI,KAAK,cAAe,OAAM,UAAU,MAAM,KAAK,aAAa;AAAA,IAClE,QAAQ;AAAE,aAAO,EAAE,yBAAgB,eAAe,MAAM,QAAQ,eAAe,SAAS,KAAK;AAAA,IAAG,UAChG;AAAU,UAAI,OAAQ,OAAM,GAAG,GAAG,IAAI,SAAS,EAAE,OAAO,KAAK,CAAC,EAAE,MAAM,MAAM;AAAA,MAAC,CAAC;AAAA,IAAG;AAAA,EACnF,GAAG;AACH,SAAO,EAAE,aAAa,MAAM,MAAM,OAAO,SAAS,MAAM,WAAW,MAAM,EAAE;AAC7E;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/update.ts","../package.json"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { mkdir, open, readFile, rename, rm, stat, writeFile } from 'node:fs/promises';\nimport { dirname, join, resolve } from 'node:path';\nimport { tmpdir } from 'node:os';\nimport { randomUUID } from 'node:crypto';\nimport type { UpdateInfo } from './core/update';\nimport { name as packageName, version as currentVersion } from '../package.json';\n\nexport const UPDATE_ENDPOINT = '/api/iteration/update';\nconst REGISTRY_URL = `https://registry.npmjs.org/${packageName}/latest`;\nconst CHECK_TIMEOUT = 5_000;\nconst CACHE_TTL = 24 * 60 * 60 * 1000;\nconst CACHE_FILE = join(tmpdir(), `isotone-update-${process.getuid?.() ?? 'user'}-v1.json`);\n\ntype Manager = 'npm' | 'pnpm' | 'yarn';\nexport type { UpdateInfo } from './core/update';\n\ninterface Version { parts: bigint[]; prerelease: string[] }\nfunction parseVersion(value: string): Version {\n if (value.length > 256) throw new Error('Invalid version.');\n const match = /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-([\\da-zA-Z-]+(?:\\.[\\da-zA-Z-]+)*))?(?:\\+([\\da-zA-Z-]+(?:\\.[\\da-zA-Z-]+)*))?$/.exec(value);\n if (!match) throw new Error('Invalid version.');\n const prerelease = match[4]?.split('.') ?? [];\n if (prerelease.some((part) => /^0\\d+$/.test(part))) throw new Error('Invalid version.');\n return { parts: match.slice(1, 4).map(BigInt), prerelease };\n}\n\n/** SemVer precedence, including numeric prereleases and ignored build metadata. */\nexport function compareVersions(a: string, b: string): number {\n const left = parseVersion(a), right = parseVersion(b);\n for (let i = 0; i < 3; i++) {\n if (left.parts[i] !== right.parts[i]) return left.parts[i] > right.parts[i] ? 1 : -1;\n }\n if (!left.prerelease.length || !right.prerelease.length) {\n return left.prerelease.length === right.prerelease.length ? 0 : left.prerelease.length ? -1 : 1;\n }\n for (let i = 0; i < Math.max(left.prerelease.length, right.prerelease.length); i++) {\n const x = left.prerelease[i], y = right.prerelease[i];\n if (x === y) continue;\n if (x === undefined || y === undefined) return x === undefined ? -1 : 1;\n const nx = /^\\d+$/.test(x), ny = /^\\d+$/.test(y);\n if (nx && ny) return BigInt(x) > BigInt(y) ? 1 : -1;\n if (nx !== ny) return nx ? -1 : 1;\n return x > y ? 1 : -1;\n }\n return 0;\n}\n\nfunction manifest(directory: string): Record<string, unknown> | null {\n try {\n const value = JSON.parse(readFileSync(join(directory, 'package.json'), 'utf8'));\n return value && typeof value === 'object' && !Array.isArray(value) ? value : null;\n } catch { return null; }\n}\n\nfunction findProject(cwd: string): { directory: string; json: Record<string, unknown> | null } {\n let directory = resolve(cwd);\n while (true) {\n const json = manifest(directory);\n if (json) return { directory, json };\n if (dirname(directory) === directory || existsSync(join(directory, '.git'))) return { directory: resolve(cwd), json: null };\n directory = dirname(directory);\n }\n}\n\nfunction dependencyOwner(project: ReturnType<typeof findProject>): ReturnType<typeof findProject> {\n let directory = project.directory;\n while (true) {\n const json = manifest(directory);\n if (['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies'].some((key) => {\n const dependencies = json?.[key];\n return dependencies && typeof dependencies === 'object' && Object.hasOwn(dependencies, packageName);\n })) return { directory, json };\n if (dirname(directory) === directory || existsSync(join(directory, '.git'))) return project;\n directory = dirname(directory);\n }\n}\n\nexport function upgradePlan(cwd: string, latest: string, override?: Manager): Pick<UpdateInfo, 'upgrade' | 'message'> {\n parseVersion(latest); // Only a validated version can enter a copied command.\n const project = dependencyOwner(findProject(cwd));\n if (project.json?.name === packageName) return { upgrade: null, message: 'This is the source checkout; update its source instead of adding itself as a dependency.' };\n let manager = override;\n let directory = project.directory;\n const locks = new Set<Manager>();\n while (!manager) {\n const declared = manifest(directory)?.packageManager;\n if (typeof declared === 'string') {\n const match = /^(npm|pnpm|yarn)@/.exec(declared);\n if (!match) return { upgrade: null, message: 'The declared package manager is not supported by this command. Upgrade with your project’s package manager.' };\n manager = match[1] as Manager;\n break;\n }\n if (['bun.lock', 'bun.lockb'].some((file) => existsSync(join(directory, file)))) return { upgrade: null, message: 'This project uses Bun. Upgrade with the project’s package manager.' };\n if (existsSync(join(directory, 'pnpm-lock.yaml'))) locks.add('pnpm');\n if (existsSync(join(directory, 'yarn.lock'))) locks.add('yarn');\n if (['package-lock.json', 'npm-shrinkwrap.json'].some((file) => existsSync(join(directory, file)))) locks.add('npm');\n if (locks.size || dirname(directory) === directory || existsSync(join(directory, '.git'))) break;\n directory = dirname(directory);\n }\n if (!manager && locks.size > 1) return { upgrade: null, message: 'Multiple package-manager lockfiles found. Pass --manager npm, pnpm or yarn.' };\n manager ??= [...locks][0] ?? 'npm';\n const production = project.json?.dependencies as Record<string, unknown> | undefined;\n const optional = project.json?.optionalDependencies as Record<string, unknown> | undefined;\n const peers = project.json?.peerDependencies as Record<string, unknown> | undefined;\n if (optional?.[packageName] || peers?.[packageName]) return { upgrade: null, message: 'Review this optional/peer dependency manually with your package manager.' };\n const dev = production?.[packageName] ? '' : ' -D';\n let workspace = manager === 'pnpm' && existsSync(join(project.directory, 'pnpm-workspace.yaml')) ? ' -w' : '';\n if (manager === 'yarn' && project.json?.workspaces) {\n const declared = project.json.packageManager;\n if (typeof declared !== 'string' || !/^yarn@\\d+\\./.test(declared)) return { upgrade: null, message: 'Declare the Yarn version in packageManager before updating a workspace-root dependency; Yarn Classic and modern Yarn use different root flags.' };\n if (declared.startsWith('yarn@1.')) workspace = ' -W';\n }\n const command = manager === 'npm'\n ? `npm install${dev} --save-exact ${packageName}@${latest}`\n : `${manager} add${dev}${workspace} --exact ${packageName}@${latest}`;\n return { upgrade: { manager, command, cwd: project.directory } };\n}\n\nexport async function fetchLatest(fetcher: typeof fetch = fetch, signal?: AbortSignal): Promise<string> {\n const controller = new AbortController();\n const abort = () => controller.abort();\n if (signal?.aborted) abort();\n else signal?.addEventListener('abort', abort, { once: true });\n const timer = setTimeout(abort, CHECK_TIMEOUT);\n try {\n if (controller.signal.aborted) throw new Error('Update check cancelled.');\n const response = await fetcher(REGISTRY_URL, { signal: controller.signal, redirect: 'error', headers: { accept: 'application/json' } });\n if (!response.ok) throw new Error(`Registry returned HTTP ${response.status}.`);\n if (!response.body) throw new Error('Registry returned an empty response.');\n const reader = response.body.getReader();\n const chunks: Uint8Array[] = [];\n let bytes = 0;\n try {\n while (true) {\n const { value, done } = await reader.read();\n if (done) break;\n bytes += value.byteLength;\n if (bytes > 64 * 1024) {\n await reader.cancel();\n throw new Error('Registry response was too large.');\n }\n chunks.push(value);\n }\n } finally { reader.releaseLock(); }\n const data = JSON.parse(Buffer.concat(chunks).toString('utf8'));\n if (typeof data.version !== 'string') throw new Error('Registry returned no version.');\n parseVersion(data.version);\n return data.version;\n } finally { clearTimeout(timer); signal?.removeEventListener('abort', abort); }\n}\n\nexport function updateInfo(latest: string, cwd: string, manager?: Manager): UpdateInfo {\n const order = compareVersions(latest, currentVersion);\n return {\n currentVersion, latestVersion: latest,\n status: order > 0 ? 'available' : order < 0 ? 'ahead' : 'current',\n ...(order > 0 ? upgradePlan(cwd, latest, manager) : { upgrade: null }),\n };\n}\n\nexport async function checkUpdate(cwd: string, manager?: Manager, fetcher?: typeof fetch, signal?: AbortSignal): Promise<UpdateInfo> {\n try { return updateInfo(await fetchLatest(fetcher, signal), cwd, manager); }\n catch { return { currentVersion, latestVersion: null, status: 'unavailable', upgrade: null, message: 'Could not check npm for updates. The installed version remains usable; try again when online.' }; }\n}\n\ninterface CachedCheck { checkedAt: number; latestVersion: string | null }\nasync function readCache(file: string): Promise<CachedCheck | null> {\n try {\n if ((await stat(file)).size > 4096) return null;\n const data = JSON.parse(await readFile(file, 'utf8'));\n if (!Number.isFinite(data.checkedAt) || data.checkedAt > Date.now() || Date.now() - data.checkedAt >= CACHE_TTL) return null;\n if (data.latestVersion !== null) parseVersion(data.latestVersion);\n return data;\n } catch { return null; }\n}\n\nasync function saveCache(file: string, latestVersion: string | null): Promise<void> {\n const temporary = `${file}.${randomUUID()}.tmp`;\n try {\n await writeFile(temporary, JSON.stringify({ checkedAt: Date.now(), latestVersion }), { mode: 0o600, flag: 'wx' });\n await rename(temporary, file);\n } finally { await rm(temporary, { force: true }); }\n}\n\n/** One bounded request a day, including failed attempts, shared across dev servers. */\nexport function startUpdateCheck(cwd: string, enabled = true, options: { cacheFile?: string; fetcher?: typeof fetch; env?: NodeJS.ProcessEnv } = {}): { getSnapshot(): UpdateInfo; ready: Promise<void>; dispose(): void } {\n const controller = new AbortController();\n const env = options.env ?? process.env;\n const off = !enabled || env.ISOTONE_UPDATE_CHECK === '0' || (!!env.CI && env.CI !== 'false' && env.CI !== '0') || env.NODE_ENV === 'test' || !!env.VITEST;\n let info: UpdateInfo = { currentVersion, latestVersion: null, status: off ? 'disabled' : 'checking', upgrade: null };\n const ready = off ? Promise.resolve() : (async () => {\n const file = options.cacheFile ?? CACHE_FILE;\n let locked = false;\n try {\n const cache = await readCache(file);\n if (cache) { info = cache.latestVersion ? updateInfo(cache.latestVersion, cwd) : { ...info, status: 'unavailable' }; return; }\n await mkdir(dirname(file), { recursive: true });\n try { await (await open(`${file}.lock`, 'wx', 0o600)).close(); locked = true; }\n catch {\n // A concurrent server owns the request. Recover an abandoned lease next time.\n if (Date.now() - (await stat(`${file}.lock`)).mtimeMs > CHECK_TIMEOUT * 3) await rm(`${file}.lock`, { force: true });\n info = { ...info, status: 'unavailable' };\n return;\n }\n const refreshed = await readCache(file);\n if (refreshed) { info = refreshed.latestVersion ? updateInfo(refreshed.latestVersion, cwd) : { ...info, status: 'unavailable' }; return; }\n await saveCache(file, null);\n info = await checkUpdate(cwd, undefined, options.fetcher, controller.signal);\n if (info.latestVersion) await saveCache(file, info.latestVersion);\n } catch { info = { currentVersion, latestVersion: null, status: 'unavailable', upgrade: null }; }\n finally { if (locked) await rm(`${file}.lock`, { force: true }).catch(() => {}); }\n })();\n return { getSnapshot: () => info, ready, dispose: () => controller.abort() };\n}\n","{\n \"name\": \"isotone\",\n \"version\": \"1.0.8\",\n \"type\": \"module\",\n \"license\": \"MIT\",\n \"description\": \"Local feedback and design variants for your running web app. Pin elements, leave notes, and give your coding agent the context to make the change.\",\n \"engines\": {\n \"node\": \">=20\"\n },\n \"exports\": {\n \"./react\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n },\n \"./core\": {\n \"types\": \"./dist/core.d.ts\",\n \"import\": \"./dist/core.js\"\n },\n \"./server\": {\n \"types\": \"./dist/server.d.ts\",\n \"import\": \"./dist/server.js\"\n },\n \"./serve\": {\n \"types\": \"./dist/serve.d.ts\",\n \"import\": \"./dist/serve.js\"\n },\n \"./vite\": {\n \"types\": \"./dist/vite-plugin.d.ts\",\n \"import\": \"./dist/vite-plugin.js\"\n },\n \"./cli\": {\n \"types\": \"./dist/cli.d.ts\",\n \"import\": \"./dist/cli.js\"\n }\n },\n \"files\": [\n \"dist\",\n \"docs/assets/preview.jpg\",\n \"docs/integrations.md\",\n \"docs/migration.md\",\n \"docs/updates.md\",\n \"docs/variants.md\",\n \"docs/third-party-notices.md\",\n \"AGENTS.md\",\n \"CHANGELOG.md\"\n ],\n \"bin\": {\n \"isotone\": \"./dist/cli.js\"\n },\n \"scripts\": {\n \"typecheck\": \"tsc --noEmit\",\n \"lint\": \"biome lint .\",\n \"lint:fix\": \"biome lint --write .\",\n \"test\": \"vitest run\",\n \"test:watch\": \"vitest\",\n \"build\": \"tsup\",\n \"check\": \"pnpm typecheck && pnpm lint && pnpm build && pnpm test\",\n \"prepublishOnly\": \"pnpm check\",\n \"dev\": \"vite --config examples/vite.config.ts\",\n \"check:package\": \"node scripts/check-package.mjs\"\n },\n \"peerDependencies\": {\n \"react\": \"^18 || ^19\",\n \"react-dom\": \"^18 || ^19\",\n \"vite\": \"^5 || ^6 || ^7 || ^8\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"2.5.7\",\n \"@types/node\": \"24.13.3\",\n \"@types/react\": \"^19\",\n \"@types/react-dom\": \"^19\",\n \"jsdom\": \"^30.0.1\",\n \"react\": \"^19\",\n \"react-dom\": \"^19\",\n \"tsup\": \"^8\",\n \"typescript\": \"^5\",\n \"vite\": \"^7\",\n \"vitest\": \"^4.1.10\",\n \"lucide-react\": \"^1.55.0\"\n },\n \"keywords\": [\n \"feedback\",\n \"review\",\n \"dev-tool\",\n \"vite-plugin\",\n \"coding-agent\",\n \"annotations\",\n \"design-review\",\n \"variants\",\n \"iteration\"\n ],\n \"sideEffects\": false,\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/aaroi/isotone.git\"\n },\n \"homepage\": \"https://github.com/aaroi/isotone#readme\",\n \"bugs\": \"https://github.com/aaroi/isotone/issues\",\n \"peerDependenciesMeta\": {\n \"react\": {\n \"optional\": true\n },\n \"react-dom\": {\n \"optional\": true\n },\n \"vite\": {\n \"optional\": true\n }\n }\n}\n"],"mappings":";AAAA,SAAS,YAAY,oBAAoB;AACzC,SAAS,OAAO,MAAM,UAAU,QAAQ,IAAI,MAAM,iBAAiB;AACnE,SAAS,SAAS,MAAM,eAAe;AACvC,SAAS,cAAc;AACvB,SAAS,kBAAkB;;;ACHzB,WAAQ;AACR,cAAW;;;ADMN,IAAM,kBAAkB;AAC/B,IAAM,eAAe,8BAA8B,IAAW;AAC9D,IAAM,gBAAgB;AACtB,IAAM,YAAY,KAAK,KAAK,KAAK;AACjC,IAAM,a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AAC;AAC9C,UAAI;AAAE,eAAO,MAAM,KAAK,GAAG,IAAI,SAAS,MAAM,GAAK,GAAG,MAAM;AAAG,iBAAS;AAAA,MAAM,QACxE;AAEJ,YAAI,KAAK,IAAI,KAAK,MAAM,KAAK,GAAG,IAAI,OAAO,GAAG,UAAU,gBAAgB,EAAG,OAAM,GAAG,GAAG,IAAI,SAAS,EAAE,OAAO,KAAK,CAAC;AACnH,eAAO,EAAE,GAAG,MAAM,QAAQ,cAAc;AACxC;AAAA,MACF;AACA,YAAM,YAAY,MAAM,UAAU,IAAI;AACtC,UAAI,WAAW;AAAE,eAAO,UAAU,gBAAgB,WAAW,UAAU,eAAe,GAAG,IAAI,EAAE,GAAG,MAAM,QAAQ,cAAc;AAAG;AAAA,MAAQ;AACzI,YAAM,UAAU,MAAM,IAAI;AAC1B,aAAO,MAAM,YAAY,KAAK,QAAW,QAAQ,SAAS,WAAW,MAAM;AAC3E,UAAI,KAAK,cAAe,OAAM,UAAU,MAAM,KAAK,aAAa;AAAA,IAClE,QAAQ;AAAE,aAAO,EAAE,yBAAgB,eAAe,MAAM,QAAQ,eAAe,SAAS,KAAK;AAAA,IAAG,UAChG;AAAU,UAAI,OAAQ,OAAM,GAAG,GAAG,IAAI,SAAS,EAAE,OAAO,KAAK,CAAC,EAAE,MAAM,MAAM;AAAA,MAAC,CAAC;AAAA,IAAG;AAAA,EACnF,GAAG;AACH,SAAO,EAAE,aAAa,MAAM,MAAM,OAAO,SAAS,MAAM,WAAW,MAAM,EAAE;AAC7E;","names":[]}
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -781,7 +781,17 @@ ${APPEARANCE_CSS}
|
|
|
781
781
|
.isotone-panel[data-open='true'] { display: flex; }
|
|
782
782
|
.isotone-variants-panel { flex-shrink: 1; max-height: calc(100dvh - 76px); }
|
|
783
783
|
.isotone-notes-panel { flex-shrink: 0; max-height: calc(100dvh - 76px); padding: var(--iso-space); gap: var(--iso-space); }
|
|
784
|
-
.isotone-root .isotone-panel { background: var(--iso-bg); border: 1px solid var(--iso-line); border-radius: 12px; box-shadow: var(--iso-panel-shadow);
|
|
784
|
+
.isotone-root .isotone-panel { background: var(--iso-bg); border: 1px solid var(--iso-line); border-radius: 12px; box-shadow: var(--iso-panel-shadow); }
|
|
785
|
+
/* The close control sits on the panel's top-left corner, half outside it, with
|
|
786
|
+
the same face as a note's delete button, a touch larger. It fades in while the
|
|
787
|
+
pointer is over the panel; keyboard focus and touch screens always show it. */
|
|
788
|
+
.isotone-panel-close { position: absolute; left: -9px; top: -9px; z-index: 3; width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; isolation: isolate; color: var(--iso-muted); background: none; opacity: 0; }
|
|
789
|
+
.isotone-panel-close::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; z-index: -1; background: var(--iso-bg); box-shadow: 0 0 0 1px var(--iso-edge); transition: background-color 120ms ease; }
|
|
790
|
+
.isotone-root .isotone-panel > .isotone-panel-close { transition: opacity 220ms ease, color 120ms ease; }
|
|
791
|
+
.isotone-root .isotone-panel:hover > .isotone-panel-close, .isotone-panel-close:focus-visible { opacity: 1; }
|
|
792
|
+
.isotone-root .isotone-panel > .isotone-panel-close:hover { color: var(--iso-fg); }
|
|
793
|
+
.isotone-panel-close:hover::before { background: var(--iso-control-hover-face); }
|
|
794
|
+
@media (hover: none) { .isotone-panel-close { opacity: 1; } }
|
|
785
795
|
.isotone-panel-head { flex: 0 0 42px; min-height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 14px; gap: 8px; border-bottom: 1px solid var(--iso-line); }
|
|
786
796
|
.isotone-root .isotone-notes-panel > .isotone-panel-head { display: none; }
|
|
787
797
|
.isotone-root .isotone-vars > .isotone-panel-head { order: 2; flex: 0 0 auto; min-height: 48px; padding: var(--iso-space); border: 0; }
|
|
@@ -795,6 +805,8 @@ ${APPEARANCE_CSS}
|
|
|
795
805
|
.isotone-count { margin-left: 5px; color: var(--iso-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
|
|
796
806
|
.isotone-vars { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
|
|
797
807
|
.isotone-vars { min-height: min(var(--iso-menu-need, 0px), calc(100dvh - 76px)); }
|
|
808
|
+
/* The panel no longer clips, so its corner close can overhang; the variants body clips itself. */
|
|
809
|
+
.isotone-root .isotone-panel > .isotone-vars { overflow: hidden; border-radius: 11px; }
|
|
798
810
|
.isotone-vars-body { flex: 1; overflow-y: auto; min-height: 0; overscroll-behavior: contain; padding: var(--iso-space); display: flex; flex-direction: column; gap: var(--iso-space); }
|
|
799
811
|
/* The footer overlaps only the scroller's bottom padding: content fades beneath
|
|
800
812
|
it while scrolling, but the last control remains fully visible at the end. */
|
|
@@ -914,7 +926,9 @@ ${FEEDBACK_LAYOUT_CSS}
|
|
|
914
926
|
.isotone-pick::after, .isotone-send::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; }
|
|
915
927
|
.isotone-send { display: grid; place-items: center; margin-left: auto; flex: none; }
|
|
916
928
|
.isotone-notice { font-size: 10px; color: var(--iso-muted); }
|
|
917
|
-
.isotone-hint { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 14px; border-radius: 24px; background: var(--iso-bg); box-shadow: var(--iso-shadow); font-size: 11px; white-space: nowrap; }
|
|
929
|
+
.isotone-hint { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 14px; border-radius: 24px; background: var(--iso-bg); box-shadow: var(--iso-shadow); font-size: 11px; white-space: nowrap; transition: opacity 120ms ease; }
|
|
930
|
+
/* Near the pointer the hint fades and lets the page underneath be hovered and pinned. */
|
|
931
|
+
.isotone-root .isotone-hint[data-away='true'] { opacity: 0; pointer-events: none; }
|
|
918
932
|
.isotone-hint button { display: flex; align-items: center; gap: 8px; border-radius: 14px; padding: 5px 9px; }
|
|
919
933
|
.isotone-hint kbd { font: inherit; color: var(--iso-muted); }
|
|
920
934
|
.isotone-hover { position: fixed; pointer-events: none; border: 1px solid var(--iso-pick-line); background: var(--iso-pick-fill); border-radius: 5px; z-index: 2147483001; }
|
|
@@ -942,6 +956,8 @@ ${FEEDBACK_LAYOUT_CSS}
|
|
|
942
956
|
.isotone-root button:not(:disabled):active > svg { transform: none; }
|
|
943
957
|
}
|
|
944
958
|
.isotone-root[data-instant='true'] *, .isotone-root[data-instant='true'] *::before, .isotone-root[data-instant='true'] *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation: none !important; }
|
|
959
|
+
/* Instant mode follows any key press, but the corner close only ever appears under the pointer, so it keeps its fade. */
|
|
960
|
+
.isotone-root[data-instant='true'] .isotone-panel > .isotone-panel-close { transition-duration: 220ms, 120ms !important; }
|
|
945
961
|
${UPDATE_NOTICE_CSS}
|
|
946
962
|
`;
|
|
947
963
|
function ensurePanelStyles(target) {
|
|
@@ -1827,6 +1843,8 @@ function IterationPanel({
|
|
|
1827
1843
|
null
|
|
1828
1844
|
);
|
|
1829
1845
|
const [hoverRect, setHoverRect] = useState3(null);
|
|
1846
|
+
const [hintAway, setHintAway] = useState3(false);
|
|
1847
|
+
const hintRef = useRef4(null);
|
|
1830
1848
|
const [rects, setRects] = useState3([]);
|
|
1831
1849
|
const [text, setText] = useState3("");
|
|
1832
1850
|
const [notes, setNotes] = useState3([]);
|
|
@@ -2276,6 +2294,11 @@ function IterationPanel({
|
|
|
2276
2294
|
cancelAnimationFrame(frame);
|
|
2277
2295
|
const deferred = e.shiftKey;
|
|
2278
2296
|
frame = requestAnimationFrame(() => {
|
|
2297
|
+
const hint = hintRef.current?.getBoundingClientRect();
|
|
2298
|
+
const reach = 48;
|
|
2299
|
+
setHintAway(
|
|
2300
|
+
!!hint && e.clientX > hint.left - reach && e.clientX < hint.right + reach && e.clientY > hint.top - reach && e.clientY < hint.bottom + reach
|
|
2301
|
+
);
|
|
2279
2302
|
const el = deferred ? null : elementAt(e);
|
|
2280
2303
|
setHoverRect(el ? el.getBoundingClientRect() : null);
|
|
2281
2304
|
});
|
|
@@ -2320,6 +2343,7 @@ function IterationPanel({
|
|
|
2320
2343
|
document.body.style.cursor = cursor;
|
|
2321
2344
|
cancelAnimationFrame(frame);
|
|
2322
2345
|
setHoverRect(null);
|
|
2346
|
+
setHintAway(false);
|
|
2323
2347
|
window.removeEventListener("mousemove", onMove, true);
|
|
2324
2348
|
window.removeEventListener("click", onClick, true);
|
|
2325
2349
|
window.removeEventListener("keydown", onKey, true);
|
|
@@ -2376,7 +2400,7 @@ function IterationPanel({
|
|
|
2376
2400
|
window.removeEventListener("resize", schedule);
|
|
2377
2401
|
};
|
|
2378
2402
|
}, [targets, picking]);
|
|
2379
|
-
const variantsPanel = variants && /* @__PURE__ */
|
|
2403
|
+
const variantsPanel = variants && /* @__PURE__ */ jsxs4(
|
|
2380
2404
|
"section",
|
|
2381
2405
|
{
|
|
2382
2406
|
id: `${id}-variants`,
|
|
@@ -2388,21 +2412,27 @@ function IterationPanel({
|
|
|
2388
2412
|
ref: (node) => {
|
|
2389
2413
|
node?.toggleAttribute("inert", !variantsOpen);
|
|
2390
2414
|
},
|
|
2391
|
-
children:
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2415
|
+
children: [
|
|
2416
|
+
/* @__PURE__ */ jsx5(PanelClose, { label: "Close variants", onClose: () => {
|
|
2417
|
+
setVariantsOpen(false);
|
|
2418
|
+
setExpanded(false);
|
|
2419
|
+
} }),
|
|
2420
|
+
/* @__PURE__ */ jsx5(
|
|
2421
|
+
VariantsView,
|
|
2422
|
+
{
|
|
2423
|
+
source: variants,
|
|
2424
|
+
active: variantsOpen,
|
|
2425
|
+
onClose: () => {
|
|
2426
|
+
setVariantsOpen(false);
|
|
2427
|
+
setExpanded(false);
|
|
2428
|
+
},
|
|
2429
|
+
onFeedback: notesAvailable ? feedback : void 0,
|
|
2430
|
+
onSaved: loadNotes,
|
|
2431
|
+
onManage: notesAvailable ? queueRemoval : void 0,
|
|
2432
|
+
pendingActions
|
|
2433
|
+
}
|
|
2434
|
+
)
|
|
2435
|
+
]
|
|
2406
2436
|
}
|
|
2407
2437
|
);
|
|
2408
2438
|
const notesPanel = notesAvailable && /* @__PURE__ */ jsxs4(
|
|
@@ -2418,6 +2448,17 @@ function IterationPanel({
|
|
|
2418
2448
|
node?.toggleAttribute("inert", !notesOpen);
|
|
2419
2449
|
},
|
|
2420
2450
|
children: [
|
|
2451
|
+
/* @__PURE__ */ jsx5(
|
|
2452
|
+
PanelClose,
|
|
2453
|
+
{
|
|
2454
|
+
label: "Close feedback",
|
|
2455
|
+
onClose: () => {
|
|
2456
|
+
setNotesOpen(false);
|
|
2457
|
+
setExpanded(false);
|
|
2458
|
+
setPicking(false);
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
),
|
|
2421
2462
|
/* @__PURE__ */ jsxs4("div", { className: "isotone-panel-head", children: [
|
|
2422
2463
|
/* @__PURE__ */ jsxs4("h2", { children: [
|
|
2423
2464
|
"Feedback",
|
|
@@ -2633,7 +2674,7 @@ function IterationPanel({
|
|
|
2633
2674
|
className: "isotone-root",
|
|
2634
2675
|
children: [
|
|
2635
2676
|
/* @__PURE__ */ jsx5("div", { className: "isotone-rail-track", "aria-hidden": "true" }),
|
|
2636
|
-
picking && /* @__PURE__ */ jsxs4("div", { className: "isotone-hint", "data-isotone": true, children: [
|
|
2677
|
+
picking && /* @__PURE__ */ jsxs4("div", { ref: hintRef, className: "isotone-hint", "data-isotone": true, "data-away": hintAway, children: [
|
|
2637
2678
|
/* @__PURE__ */ jsxs4("span", { children: [
|
|
2638
2679
|
targets.length,
|
|
2639
2680
|
" selected \xB7 click to add or remove \xB7 hold \u21E7 to use the page"
|
|
@@ -2786,6 +2827,9 @@ function IterationPanel({
|
|
|
2786
2827
|
}
|
|
2787
2828
|
);
|
|
2788
2829
|
}
|
|
2830
|
+
function PanelClose({ label, onClose }) {
|
|
2831
|
+
return /* @__PURE__ */ jsx5("button", { type: "button", className: "isotone-panel-close", "aria-label": label, title: label, onClick: onClose, children: /* @__PURE__ */ jsx5(Icon2, { name: "close", size: 12 }) });
|
|
2832
|
+
}
|
|
2789
2833
|
|
|
2790
2834
|
// src/react/IterationMount.tsx
|
|
2791
2835
|
import { createRoot } from "react-dom/client";
|