isotone 1.1.3 → 1.2.1
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/AGENTS.md +52 -5
- package/CHANGELOG.md +42 -0
- package/README.md +63 -14
- package/dist/{IterationPanel-phJRYtUO.d.ts → IterationPanel-Bq77d5NT.d.ts} +3 -1
- package/dist/{chunk-K5RAC2BT.js → chunk-2FY2JNPG.js} +3 -5
- package/dist/chunk-2FY2JNPG.js.map +1 -0
- package/dist/{chunk-RKZWO37H.js → chunk-BTJHQXF7.js} +85 -1
- package/dist/chunk-BTJHQXF7.js.map +1 -0
- package/dist/chunk-JCTWHR7U.js +13 -0
- package/dist/chunk-JCTWHR7U.js.map +1 -0
- package/dist/chunk-L6O4HYGP.js +1150 -0
- package/dist/chunk-L6O4HYGP.js.map +1 -0
- package/dist/{chunk-YTEUMO3O.js → chunk-LD7UWI7W.js} +17 -33
- package/dist/chunk-LD7UWI7W.js.map +1 -0
- package/dist/chunk-MX4RQJFV.js +9 -0
- package/dist/chunk-MX4RQJFV.js.map +1 -0
- package/dist/chunk-YPDV3PX4.js +142 -0
- package/dist/chunk-YPDV3PX4.js.map +1 -0
- package/dist/cli.js +1015 -148
- package/dist/cli.js.map +1 -1
- package/dist/core.d.ts +92 -2
- package/dist/core.js +10 -3
- package/dist/index.d.ts +13 -28
- package/dist/index.js +586 -257
- package/dist/index.js.map +1 -1
- package/dist/isotone.global.js +98 -42
- package/dist/serve.d.ts +5 -3
- package/dist/serve.js +60 -23
- package/dist/serve.js.map +1 -1
- package/dist/server.d.ts +7 -0
- package/dist/server.js +24 -11
- package/dist/server.js.map +1 -1
- package/dist/vite-plugin.d.ts +4 -3
- package/dist/vite-plugin.js +23 -19
- package/dist/vite-plugin.js.map +1 -1
- package/docs/blast.md +133 -0
- package/docs/integrations.md +75 -15
- package/docs/migration.md +19 -0
- package/docs/updates.md +110 -4
- package/docs/variants.md +65 -7
- package/package.json +2 -1
- package/dist/chunk-A4DX2V4C.js +0 -7
- package/dist/chunk-A4DX2V4C.js.map +0 -1
- package/dist/chunk-BRBXIGZP.js +0 -593
- package/dist/chunk-BRBXIGZP.js.map +0 -1
- package/dist/chunk-K5RAC2BT.js.map +0 -1
- package/dist/chunk-LXW6WFOC.js +0 -402
- package/dist/chunk-LXW6WFOC.js.map +0 -1
- package/dist/chunk-RKZWO37H.js.map +0 -1
- package/dist/chunk-RQ2YI5KS.js +0 -24
- package/dist/chunk-RQ2YI5KS.js.map +0 -1
- package/dist/chunk-YTEUMO3O.js.map +0 -1
package/dist/core.d.ts
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
/** Read-only snapshot from the local development server. */
|
|
2
|
+
interface UpdateInfo {
|
|
3
|
+
currentVersion: string;
|
|
4
|
+
latestVersion: string | null;
|
|
5
|
+
status: 'checking' | 'available' | 'current' | 'ahead' | 'unavailable' | 'disabled';
|
|
6
|
+
upgrade: {
|
|
7
|
+
manager: 'npm' | 'pnpm' | 'yarn';
|
|
8
|
+
command: string;
|
|
9
|
+
cwd: string;
|
|
10
|
+
} | null;
|
|
11
|
+
message?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The user's request to upgrade Isotone, carried by one feedback note. The
|
|
15
|
+
* local server builds it from its own update check; the browser only asks for
|
|
16
|
+
* it, so the versions and command never come from page content.
|
|
17
|
+
*/
|
|
18
|
+
interface UpdateRequest {
|
|
19
|
+
from: string;
|
|
20
|
+
to: string;
|
|
21
|
+
/** The exact command `check-update` suggests, pinned to `to`. */
|
|
22
|
+
command: string;
|
|
23
|
+
/** The directory to run it in: the manifest that declares Isotone. */
|
|
24
|
+
cwd: string;
|
|
25
|
+
manager: 'npm' | 'pnpm' | 'yarn';
|
|
26
|
+
/** The release's changelog, to summarize for the user afterwards. */
|
|
27
|
+
changelog?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
1
30
|
/**
|
|
2
31
|
* isotone — variants: the framework-free model.
|
|
3
32
|
*
|
|
@@ -44,7 +73,12 @@ interface SelectVariantAxis {
|
|
|
44
73
|
/** The primary option; what a host renders when nothing is selected. */
|
|
45
74
|
defaultOption: string;
|
|
46
75
|
showWhen?: VariantAxisCondition;
|
|
47
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* The part of the page the selector belongs to, shown as a section header in
|
|
78
|
+
* the panel. Usually written as a label prefix instead (`"Header > Logo size"`);
|
|
79
|
+
* see {@link axisSection}. When set, it wins over the prefix, and `''` keeps the
|
|
80
|
+
* selector out of every section with its label shown as written.
|
|
81
|
+
*/
|
|
48
82
|
section?: string;
|
|
49
83
|
}
|
|
50
84
|
interface RangeVariantAxis {
|
|
@@ -86,6 +120,42 @@ interface VariantAction {
|
|
|
86
120
|
action: 'remove-option' | 'remove-axis' | 'keep-default';
|
|
87
121
|
optionId?: string;
|
|
88
122
|
}
|
|
123
|
+
/** How a section and its selector are joined for display: `Header › Logo size`. */
|
|
124
|
+
declare const SECTION_SEPARATOR = " \u203A ";
|
|
125
|
+
interface SectionedLabel {
|
|
126
|
+
/** The section's display name, or `null` for a selector without one. */
|
|
127
|
+
section: string | null;
|
|
128
|
+
/** What the panel prints under the section header. */
|
|
129
|
+
label: string;
|
|
130
|
+
/** Section and label together, for assistive technology, notes and the CLI. */
|
|
131
|
+
fullLabel: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Split a selector label into its section and its own name. `"Header > Logo size"`
|
|
135
|
+
* is the Logo size selector in the Header section. The first separator wins, so
|
|
136
|
+
* `"Header > Nav > Gap"` is `Nav > Gap` in Header. An explicit `section` overrides
|
|
137
|
+
* the prefix: the label then shows as written, less a prefix that repeats the
|
|
138
|
+
* section, and `''` means no section at all.
|
|
139
|
+
*/
|
|
140
|
+
declare function splitSectionLabel(label: string, section?: string): SectionedLabel;
|
|
141
|
+
declare function axisSection(axis: Pick<VariantAxis, 'label' | 'section'>): SectionedLabel;
|
|
142
|
+
interface VariantSection<T extends VariantAxis = VariantAxis> {
|
|
143
|
+
/** Display name, from the section's first selector; `null` for selectors without one. */
|
|
144
|
+
name: string | null;
|
|
145
|
+
/** Case-insensitive identity: `"Header"` and `"header"` are one section. */
|
|
146
|
+
key: string;
|
|
147
|
+
axes: (SectionedLabel & {
|
|
148
|
+
axis: T;
|
|
149
|
+
})[];
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Group axes for the panel. Selectors without a section come first, without a
|
|
153
|
+
* header; sections follow in the order their first selector appears, and every
|
|
154
|
+
* selector keeps its relative order. A dependent axis (`showWhen`) without its
|
|
155
|
+
* own section joins its parent's, so it never jumps away from the control that
|
|
156
|
+
* reveals it. Linear in the number of axes.
|
|
157
|
+
*/
|
|
158
|
+
declare function sectionAxes<T extends VariantAxis>(axes: T[]): VariantSection<T>[];
|
|
89
159
|
/** The primary value of an axis, as the selection string. */
|
|
90
160
|
declare function axisDefault(axis: VariantAxis): string;
|
|
91
161
|
/** True when `value` is legal for the axis. */
|
|
@@ -190,6 +260,9 @@ interface OverlayVariant {
|
|
|
190
260
|
group?: string;
|
|
191
261
|
/** What the panel calls the group's selector. Any member may carry it. */
|
|
192
262
|
groupLabel?: string;
|
|
263
|
+
/** The panel section the group's selector sits in, like an axis `section`.
|
|
264
|
+
* Any member may carry it; a `groupLabel` prefix (`"Header > Logo"`) also works. */
|
|
265
|
+
section?: string;
|
|
193
266
|
createdAt: string;
|
|
194
267
|
/**
|
|
195
268
|
* Repo-relative source path → what the override was derived from. `base`
|
|
@@ -394,6 +467,23 @@ interface NoteContext {
|
|
|
394
467
|
variantAction?: VariantRemoval;
|
|
395
468
|
elements?: IterationElement[];
|
|
396
469
|
variant?: VariantReference | null;
|
|
470
|
+
/** The user's request to upgrade Isotone, built by the local server from
|
|
471
|
+
* its own update check. At most one is open at a time. */
|
|
472
|
+
update?: UpdateRequest;
|
|
473
|
+
/** The agent's question or remark about the note, written with
|
|
474
|
+
* `isotone --reply <id> "<text>"`. Only the CLI writes it; the panel shows it
|
|
475
|
+
* under the note, and the reviewer answers by editing the note. */
|
|
476
|
+
reply?: NoteReply;
|
|
477
|
+
}
|
|
478
|
+
interface NoteReply {
|
|
479
|
+
text: string;
|
|
480
|
+
at: string;
|
|
481
|
+
/** A fingerprint of the note as it was when the agent asked. Until the
|
|
482
|
+
* reviewer edits the note, Blast does not hand it out again. */
|
|
483
|
+
about?: string;
|
|
484
|
+
/** Set when the note has changed since the agent asked: the reviewer's
|
|
485
|
+
* edit answered the question, so it is no longer pending. */
|
|
486
|
+
answered?: boolean;
|
|
397
487
|
}
|
|
398
488
|
/** A note written in the panel, read and answered by the coding agent. */
|
|
399
489
|
interface IterationNote extends NoteContext {
|
|
@@ -486,4 +576,4 @@ declare function createIterationStore(cfg?: IterationStoreConfig): {
|
|
|
486
576
|
readonly hasUnsyncedNotes: boolean;
|
|
487
577
|
};
|
|
488
578
|
|
|
489
|
-
export { type ColorSwatch, type ColorVariantAxis, type IterationElement, type IterationNote, type IterationStoreConfig, KNOBS_EVENT, KNOBS_STORAGE_KEY, type KnobAxis, type LiveVariantSelection, type NodeLike, type NoteContext, OVERLAY_DEFAULT_OPTION, OVERLAY_GROUP_ID, type OverlayGroup, type OverlayVariant, type OverlayVariantStatus, type OverlayVariantsList, type RangeVariantAxis, type RouteGateOptions, type SaveLocation, type SelectVariantAxis, VARIANTS_ENDPOINT, type VariantAction, type VariantAxis, type VariantAxisCondition, type VariantOption, type VariantReference, type VariantRemoval, type VariantSelections, type VariantsSource, applyKnobValues, axisDefault, createIterationStore, createOverlayVariantsSource, createVariantsSource, defaultSelections, describeIterationElement, elementAsNode, formatRangeValue, isAxisVisible, isDirty, isRouteVisible, isValidSelection, knobCssValue, knobDelta, knobVar, knobsFor, overlayAxes, overlayGroups, parseVariantParam, serializeVariantParam, variantAppliesTo, visibleAxes };
|
|
579
|
+
export { type ColorSwatch, type ColorVariantAxis, type IterationElement, type IterationNote, type IterationStoreConfig, KNOBS_EVENT, KNOBS_STORAGE_KEY, type KnobAxis, type LiveVariantSelection, type NodeLike, type NoteContext, type NoteReply, OVERLAY_DEFAULT_OPTION, OVERLAY_GROUP_ID, type OverlayGroup, type OverlayVariant, type OverlayVariantStatus, type OverlayVariantsList, type RangeVariantAxis, type RouteGateOptions, SECTION_SEPARATOR, type SaveLocation, type SectionedLabel, type SelectVariantAxis, type UpdateInfo, type UpdateRequest, VARIANTS_ENDPOINT, type VariantAction, type VariantAxis, type VariantAxisCondition, type VariantOption, type VariantReference, type VariantRemoval, type VariantSection, type VariantSelections, type VariantsSource, applyKnobValues, axisDefault, axisSection, createIterationStore, createOverlayVariantsSource, createVariantsSource, defaultSelections, describeIterationElement, elementAsNode, formatRangeValue, isAxisVisible, isDirty, isRouteVisible, isValidSelection, knobCssValue, knobDelta, knobVar, knobsFor, overlayAxes, overlayGroups, parseVariantParam, sectionAxes, serializeVariantParam, splitSectionLabel, variantAppliesTo, visibleAxes };
|
package/dist/core.js
CHANGED
|
@@ -3,15 +3,17 @@ import {
|
|
|
3
3
|
describeIterationElement,
|
|
4
4
|
elementAsNode,
|
|
5
5
|
isRouteVisible
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2FY2JNPG.js";
|
|
7
7
|
import {
|
|
8
8
|
KNOBS_EVENT,
|
|
9
9
|
KNOBS_STORAGE_KEY,
|
|
10
10
|
OVERLAY_DEFAULT_OPTION,
|
|
11
11
|
OVERLAY_GROUP_ID,
|
|
12
|
+
SECTION_SEPARATOR,
|
|
12
13
|
VARIANTS_ENDPOINT,
|
|
13
14
|
applyKnobValues,
|
|
14
15
|
axisDefault,
|
|
16
|
+
axisSection,
|
|
15
17
|
createOverlayVariantsSource,
|
|
16
18
|
createVariantsSource,
|
|
17
19
|
defaultSelections,
|
|
@@ -26,19 +28,22 @@ import {
|
|
|
26
28
|
overlayAxes,
|
|
27
29
|
overlayGroups,
|
|
28
30
|
parseVariantParam,
|
|
31
|
+
sectionAxes,
|
|
29
32
|
serializeVariantParam,
|
|
33
|
+
splitSectionLabel,
|
|
30
34
|
variantAppliesTo,
|
|
31
35
|
visibleAxes
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import "./chunk-A4DX2V4C.js";
|
|
36
|
+
} from "./chunk-BTJHQXF7.js";
|
|
34
37
|
export {
|
|
35
38
|
KNOBS_EVENT,
|
|
36
39
|
KNOBS_STORAGE_KEY,
|
|
37
40
|
OVERLAY_DEFAULT_OPTION,
|
|
38
41
|
OVERLAY_GROUP_ID,
|
|
42
|
+
SECTION_SEPARATOR,
|
|
39
43
|
VARIANTS_ENDPOINT,
|
|
40
44
|
applyKnobValues,
|
|
41
45
|
axisDefault,
|
|
46
|
+
axisSection,
|
|
42
47
|
createIterationStore,
|
|
43
48
|
createOverlayVariantsSource,
|
|
44
49
|
createVariantsSource,
|
|
@@ -57,7 +62,9 @@ export {
|
|
|
57
62
|
overlayAxes,
|
|
58
63
|
overlayGroups,
|
|
59
64
|
parseVariantParam,
|
|
65
|
+
sectionAxes,
|
|
60
66
|
serializeVariantParam,
|
|
67
|
+
splitSectionLabel,
|
|
61
68
|
variantAppliesTo,
|
|
62
69
|
visibleAxes
|
|
63
70
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as IterationShortcut } from './IterationPanel-
|
|
2
|
-
export { a as IterationPanel, b as IterationPanelProps } from './IterationPanel-
|
|
1
|
+
import { I as IterationShortcut } from './IterationPanel-Bq77d5NT.js';
|
|
2
|
+
export { a as IterationPanel, b as IterationPanelProps } from './IterationPanel-Bq77d5NT.js';
|
|
3
3
|
import { VariantsSource, RouteGateOptions, VariantReference, VariantAction } from './core.js';
|
|
4
|
-
export { ColorSwatch, ColorVariantAxis, IterationElement, IterationNote, IterationStoreConfig, KNOBS_STORAGE_KEY, KnobAxis, NodeLike, NoteContext, OVERLAY_DEFAULT_OPTION, OVERLAY_GROUP_ID, OverlayGroup, OverlayVariant, OverlayVariantStatus, OverlayVariantsList, RangeVariantAxis, SelectVariantAxis, VARIANTS_ENDPOINT, VariantAxis, VariantAxisCondition, VariantOption, VariantRemoval, VariantSelections, applyKnobValues, axisDefault, createOverlayVariantsSource, createVariantsSource, defaultSelections, describeIterationElement, elementAsNode, formatRangeValue, isAxisVisible, isDirty, isRouteVisible, isValidSelection, knobCssValue, knobDelta, knobVar, knobsFor, overlayAxes, overlayGroups, parseVariantParam, serializeVariantParam, visibleAxes } from './core.js';
|
|
4
|
+
export { ColorSwatch, ColorVariantAxis, IterationElement, IterationNote, IterationStoreConfig, KNOBS_STORAGE_KEY, KnobAxis, NodeLike, NoteContext, NoteReply, OVERLAY_DEFAULT_OPTION, OVERLAY_GROUP_ID, OverlayGroup, OverlayVariant, OverlayVariantStatus, OverlayVariantsList, RangeVariantAxis, SECTION_SEPARATOR, SectionedLabel, SelectVariantAxis, UpdateRequest, VARIANTS_ENDPOINT, VariantAxis, VariantAxisCondition, VariantOption, VariantRemoval, VariantSection, VariantSelections, applyKnobValues, axisDefault, axisSection, createOverlayVariantsSource, createVariantsSource, defaultSelections, describeIterationElement, elementAsNode, formatRangeValue, isAxisVisible, isDirty, isRouteVisible, isValidSelection, knobCssValue, knobDelta, knobVar, knobsFor, overlayAxes, overlayGroups, parseVariantParam, sectionAxes, serializeVariantParam, splitSectionLabel, visibleAxes } from './core.js';
|
|
5
5
|
import { I as IterationTheme } from './theme-BWv_ZNhC.js';
|
|
6
6
|
import * as react from 'react';
|
|
7
7
|
|
|
@@ -19,9 +19,14 @@ interface MountIterationOptions {
|
|
|
19
19
|
/**
|
|
20
20
|
* Variants for the panel. A `VariantsSource` is rendered as-is; `'overlay'`
|
|
21
21
|
* builds the overlay adapter against the Vite plugin's same-origin
|
|
22
|
-
* endpoint.
|
|
22
|
+
* endpoint. `'knobs'` is the same adapter for a server that has knobs but no
|
|
23
|
+
* file variants (`isotone serve`), and its empty list says so. With neither
|
|
24
|
+
* this nor `endpoint`, nothing mounts.
|
|
23
25
|
*/
|
|
24
|
-
variants?: VariantsSource | 'overlay';
|
|
26
|
+
variants?: VariantsSource | 'overlay' | 'knobs';
|
|
27
|
+
/** Where `'overlay'` reads variants and knobs. Defaults to the Vite plugin's
|
|
28
|
+
* same-origin endpoint; `isotone serve` passes its own absolute URL. */
|
|
29
|
+
variantsEndpoint?: string;
|
|
25
30
|
/** Which tab a tabbed panel opens on until the reviewer picks one. */
|
|
26
31
|
defaultTab?: 'variants' | 'notes';
|
|
27
32
|
/** Optional localStorage namespace for multi-app origins. */
|
|
@@ -34,31 +39,9 @@ interface MountIterationOptions {
|
|
|
34
39
|
* IterationPanelProps.getPayload. */
|
|
35
40
|
getPayload?: () => unknown;
|
|
36
41
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Self-mount the Iteration panel into a shadow root on `document.body`,
|
|
39
|
-
* outside any app tree, tracking `window.location.pathname` so it needs no
|
|
40
|
-
* router integration.
|
|
41
|
-
*
|
|
42
|
-
* The shadow root is what makes this safe to drop into an app nobody vetted:
|
|
43
|
-
* the host's resets, its `button` and `textarea` rules, its stacking and its
|
|
44
|
-
* global handlers stop at the boundary, so the panel looks the same in every
|
|
45
|
-
* app. Inherited properties and custom properties still cross, which is
|
|
46
|
-
* deliberate — the panel reads `--font-sans` and `--foreground` from the host
|
|
47
|
-
* so it matches the surrounding theme.
|
|
48
|
-
*
|
|
49
|
-
* The host element carries `data-isotone`, and that is load-bearing:
|
|
50
|
-
* `document.elementFromPoint` retargets to the host for anything inside a
|
|
51
|
-
* shadow root, so the element picker's self-exclusion matches on it.
|
|
52
|
-
*
|
|
53
|
-
* The host is created at runtime by `mountIteration` (never part of any HTML
|
|
54
|
-
* React hydrates) and is watched by a MutationObserver: if a whole-document
|
|
55
|
-
* render — a React Router hydration failure made worse by an extension, for
|
|
56
|
-
* instance — replaces `<body>` and drops the host, it is re-appended to the
|
|
57
|
-
* new body, shadow root and all, instead of a fresh mount losing panel state.
|
|
58
|
-
*/
|
|
59
42
|
declare function mountIteration(opts: MountIterationOptions): () => void;
|
|
60
43
|
|
|
61
|
-
declare function VariantsView({ source, showTitle, active, onFeedback, onClose, onSaved, onManage, pendingActions, }: {
|
|
44
|
+
declare function VariantsView({ source, showTitle, active, onFeedback, onClose, onSaved, onManage, pendingActions, emptyText, }: {
|
|
62
45
|
source: VariantsSource;
|
|
63
46
|
showTitle?: boolean;
|
|
64
47
|
active?: boolean;
|
|
@@ -67,6 +50,8 @@ declare function VariantsView({ source, showTitle, active, onFeedback, onClose,
|
|
|
67
50
|
onSaved?: () => void;
|
|
68
51
|
onManage?: (action: VariantAction, reference: VariantReference) => Promise<void>;
|
|
69
52
|
pendingActions?: VariantAction[];
|
|
53
|
+
/** What the list says when this page has no selectors. */
|
|
54
|
+
emptyText?: string;
|
|
70
55
|
}): react.JSX.Element;
|
|
71
56
|
|
|
72
57
|
declare const PANEL_CSS: string;
|