@issuegraph/editor 0.1.0 → 0.3.0

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.
Files changed (49) hide show
  1. package/README.md +35 -3
  2. package/dist/audit/findings.d.ts +5 -2
  3. package/dist/audit/findings.d.ts.map +1 -1
  4. package/dist/audit/findings.js +33 -1
  5. package/dist/audit/findings.js.map +1 -1
  6. package/dist/firstpass/batch.d.ts +10 -0
  7. package/dist/firstpass/batch.d.ts.map +1 -1
  8. package/dist/firstpass/batch.js +26 -7
  9. package/dist/firstpass/batch.js.map +1 -1
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +3 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/overlay/projected.d.ts +21 -0
  15. package/dist/overlay/projected.d.ts.map +1 -0
  16. package/dist/overlay/projected.js +49 -0
  17. package/dist/overlay/projected.js.map +1 -0
  18. package/dist/scale/ladder.d.ts +6 -0
  19. package/dist/scale/ladder.d.ts.map +1 -1
  20. package/dist/scale/ladder.js +13 -0
  21. package/dist/scale/ladder.js.map +1 -1
  22. package/dist/scale/render.d.ts +19 -0
  23. package/dist/scale/render.d.ts.map +1 -1
  24. package/dist/scale/render.js +10 -29
  25. package/dist/scale/render.js.map +1 -1
  26. package/dist/workspace/chrome.d.ts +21 -0
  27. package/dist/workspace/chrome.d.ts.map +1 -0
  28. package/dist/workspace/chrome.js +178 -0
  29. package/dist/workspace/chrome.js.map +1 -0
  30. package/dist/workspace/host.d.ts +148 -0
  31. package/dist/workspace/host.d.ts.map +1 -0
  32. package/dist/workspace/host.js +316 -0
  33. package/dist/workspace/host.js.map +1 -0
  34. package/dist/workspace/mount.d.ts +139 -0
  35. package/dist/workspace/mount.d.ts.map +1 -0
  36. package/dist/workspace/mount.js +882 -0
  37. package/dist/workspace/mount.js.map +1 -0
  38. package/dist/workspace/rail.d.ts.map +1 -1
  39. package/dist/workspace/rail.js +11 -0
  40. package/dist/workspace/rail.js.map +1 -1
  41. package/dist/workspace/render.d.ts +7 -0
  42. package/dist/workspace/render.d.ts.map +1 -1
  43. package/dist/workspace/render.js +66 -5
  44. package/dist/workspace/render.js.map +1 -1
  45. package/dist/workspace/styles.d.ts +1 -1
  46. package/dist/workspace/styles.d.ts.map +1 -1
  47. package/dist/workspace/styles.js +20 -0
  48. package/dist/workspace/styles.js.map +1 -1
  49. package/package.json +6 -4
@@ -30,7 +30,7 @@
30
30
  * which has no routes.
31
31
  */
32
32
  import { element, renderMarkup, renderViewer, resolveTheme, themeCss, viewerStylesheet, } from '@issuegraph/viewer';
33
- import { edgeIdentity } from '@issuegraph/core';
33
+ import { overlaysFor } from "../overlay/projected.js";
34
34
  import { attachEdgeOverlays } from "../overlay/render.js";
35
35
  import { edgeOverlayStylesheet } from "../overlay/styles.js";
36
36
  import { INITIAL_SCALE_STATE } from "./commands.js";
@@ -125,31 +125,14 @@ export function renderScaleLadder(input, options = {}) {
125
125
  const canvas = ladder.tier === 'direct'
126
126
  ? renderViewer(ladder.canvas, { projection: 'graph', theme, selected: options.selected ?? null })
127
127
  : null;
128
- // THE SELECTION HALO, ATTACHED TO THE SCENE THE CANVAS JUST DREW.
129
- //
130
- // Resolved against `ladder.canvas.edges` — the document this canvas was
131
- // rendered from rather than against the caller's input. An identity that
132
- // names an edge this tier does not draw resolves to nothing here, which is
133
- // the same promise every other zone makes: a selection is a NAME, and a name
134
- // that no longer resolves renders as nothing selected.
135
- const selectedEdge = canvas === null || options.selectedEdge === null || options.selectedEdge === undefined
136
- ? null
137
- : (ladder.canvas.edges.find((edge) => edgeIdentity(edge.field, edge.from, edge.to) === options.selectedEdge) ?? null);
138
- // `states: ['selected']` AND NOTHING ELSE, deliberately. The write states are
139
- // the store's to report — this synthesises the one state that is not about a
140
- // write, which is exactly how `EDGE_STATES` describes `selected`. An edge
141
- // that is ALSO mid-write is overlaid by whoever holds those writes; the two
142
- // compose, because `overlayFor` reads a list.
143
- const selectedOverlay = selectedEdge === null
144
- ? null
145
- : {
146
- id: edgeIdentity(selectedEdge.field, selectedEdge.from, selectedEdge.to),
147
- kind: selectedEdge.field,
148
- from: selectedEdge.from,
149
- to: selectedEdge.to,
150
- states: ['selected'],
151
- writes: [],
152
- };
128
+ // THE SELECTION HALO AND THE WRITE STATES, attached to the scene the canvas
129
+ // just drew. Resolved against `ladder.canvas.edges` — the document this canvas
130
+ // was rendered fromrather than against the caller's input: an identity
131
+ // naming an edge this tier does not draw resolves to nothing, which is the
132
+ // promise every zone makes. A selection is a NAME, and a name that no longer
133
+ // resolves renders as nothing selected. The merge itself is `overlaysFor`,
134
+ // shared with the workspace's tree canvas so the two cannot drift.
135
+ const overlays = canvas === null ? [] : overlaysFor(ladder.canvas.edges, options.projected, options.selectedEdge);
153
136
  // `unattached` IS DELIBERATELY NOT SURFACED HERE, and the reason is a fact
154
137
  // about this call site rather than about the value.
155
138
  //
@@ -165,9 +148,7 @@ export function renderScaleLadder(input, options = {}) {
165
148
  // already reports itself through `canvas.diagnostics`. A diagnostic string no
166
149
  // test can make appear is a claim about behaviour nobody can check; the
167
150
  // reasoning is worth more here than the branch.
168
- const overlaid = canvas === null || selectedOverlay === null
169
- ? null
170
- : attachEdgeOverlays(canvas.scene, [selectedOverlay], { theme });
151
+ const overlaid = canvas === null || overlays.length === 0 ? null : attachEdgeOverlays(canvas.scene, overlays, { theme });
171
152
  const chrome = element('section', { class: 'ig-ladder', 'data-tier': ladder.tier }, [
172
153
  ladder.focus === null
173
154
  ? null
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/scale/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAIL,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAG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,CAAC;KAC9B,CAAC,CAAC;IAEH,OAAO;QACL,MAAM;QACN,wEAAwE;QACxE,gEAAgE;QAChE,qEAAqE;QACrE,sDAAsD;QACtD,MAAM,EAAE,GAAG,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,EAAE;QAClH,0EAA0E;QAC1E,sEAAsE;QACtE,wEAAwE;QACxE,yCAAyC;QACzC,MAAM,EAAE,GAAG,gBAAgB,KAAK,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,KAAK,qBAAqB,KAAK,qBAAqB,EAAE;QACvI,WAAW,EAAE,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,IAAI,EAAE,CAAC,CAAC;KACrE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The mount's chrome stylesheet: the controls the mount draws beside the
3
+ * package's own panels, and nothing the panels already style.
4
+ *
5
+ * Same contract as the workspace's, the picker's and the ladder's — layout,
6
+ * weight and state, never a value. Every colour, length and font is a
7
+ * `var(--ig-…)` the host's theme resolves, and `mount.test.ts` scans these
8
+ * bytes for a literal or an unresolvable token, so the rule is enforced rather
9
+ * than remembered.
10
+ *
11
+ * What is styled here is exactly what `mount.ts` builds with `createElement`:
12
+ * the add button, the kind chooser, the target search and its matches, the
13
+ * delete button, the key hints, and the floating chooser a canvas drop places.
14
+ * The picker inside the inspector ships its own sheet, installed alongside.
15
+ *
16
+ * Shipped as a string for the same reason every sibling sheet is: an entry
17
+ * that imports CSS cannot be loaded by a bare Node runtime, and a string needs
18
+ * no bundler.
19
+ */
20
+ export declare const mountStylesheet = "\n.ig-mount {\n position: relative;\n height: 100%;\n min-height: 0;\n}\n\n.ig-mount > .ig-workspace {\n /* THE FLOATING CHOOSER'S BOX. A canvas drop places the kind chooser inside\n the workspace root, so a host that scopes its theme to that root still\n resolves the chooser's tokens; the root is the positioning box for it. */\n position: relative;\n height: 100%;\n box-sizing: border-box;\n}\n\n.ig-mount[data-dragging='true'] {\n cursor: grabbing;\n user-select: none;\n}\n\n.ig-chrome {\n padding: var(--ig-space-tight) var(--ig-space);\n border-top: var(--ig-stroke) solid var(--ig-line);\n display: flex;\n flex-direction: column;\n gap: var(--ig-space-tight);\n font-family: var(--ig-font-ui);\n font-size: var(--ig-font-size-small);\n line-height: var(--ig-line-height);\n color: var(--ig-text-body);\n}\n\n.ig-chrome-sentence {\n margin: 0;\n font-family: var(--ig-font-mono);\n color: var(--ig-text);\n}\n\n.ig-chrome-button {\n font: inherit;\n font-size: var(--ig-font-size-small);\n color: var(--ig-text);\n background: var(--ig-surface-2);\n border: var(--ig-stroke) solid var(--ig-line);\n border-radius: var(--ig-radius);\n padding: var(--ig-space-tight) var(--ig-space);\n cursor: pointer;\n text-align: left;\n}\n\n.ig-chrome-button:hover {\n border-color: var(--ig-accent);\n}\n\n.ig-chrome-button:focus-visible {\n outline: var(--ig-focus-ring) solid var(--ig-focus);\n outline-offset: var(--ig-space-tight);\n}\n\n.ig-chrome-quiet {\n background: none;\n color: var(--ig-text-muted);\n}\n\n.ig-chrome-danger {\n color: var(--ig-state-failed);\n border-color: var(--ig-state-failed);\n}\n\n.ig-chrome-input {\n font: inherit;\n font-size: var(--ig-font-size-small);\n color: var(--ig-text);\n background: var(--ig-surface-2);\n border: var(--ig-stroke) solid var(--ig-line);\n border-radius: var(--ig-radius);\n padding: var(--ig-space-tight) var(--ig-space);\n width: 100%;\n box-sizing: border-box;\n}\n\n.ig-chrome-input:focus-visible {\n outline: var(--ig-focus-ring) solid var(--ig-focus);\n outline-offset: var(--ig-space-tight);\n}\n\n.ig-chrome-kinds {\n display: flex;\n flex-direction: column;\n gap: var(--ig-space-tight);\n}\n\n/* EACH KIND CARRIES ITS HUE ON THE LEFT, the same hue the viewer draws the\n edge in, so the chooser and the canvas name a relationship the same way. */\n.ig-chrome-kinds .ig-chrome-button {\n border-left: var(--ig-terminal-width) solid var(--ig-line);\n}\n\n.ig-chrome-kinds [data-edge='blocked-by'] {\n border-left-color: var(--ig-edge-blocked-by);\n}\n\n.ig-chrome-kinds [data-edge='serialize-with'] {\n border-left-color: var(--ig-edge-serialize-with);\n}\n\n.ig-chrome-kinds [data-edge='together-with'] {\n border-left-color: var(--ig-edge-together-with);\n}\n\n.ig-chrome-kinds [data-edge='duplicate-of'] {\n border-left-color: var(--ig-edge-duplicate-of);\n}\n\n.ig-chrome-kinds [data-edge='decomposed-from'] {\n border-left-color: var(--ig-edge-decomposed-from);\n}\n\n.ig-chrome-matches {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: var(--ig-space-tight);\n}\n\n.ig-chrome-match {\n width: 100%;\n}\n\n.ig-chrome-search,\n.ig-chrome-chooser {\n display: flex;\n flex-direction: column;\n gap: var(--ig-space-tight);\n}\n\n/* PLACED BY THE MOUNT, at the drop point `pickerPlacement` chose: `left` and\n `top` are written inline on the element, so this rule carries the box and\n nothing about where it sits. */\n.ig-chrome-floating {\n position: absolute;\n width: calc(var(--ig-char-width) * 40);\n padding: var(--ig-space-tight) var(--ig-space);\n background: var(--ig-surface-2);\n border: var(--ig-stroke) solid var(--ig-accent);\n border-radius: var(--ig-radius);\n z-index: 2;\n}\n\n.ig-chrome-keys {\n margin: 0;\n font-size: var(--ig-font-size-small);\n color: var(--ig-text-muted);\n}\n";
21
+ //# sourceMappingURL=chrome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../../src/workspace/chrome.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,eAAe,40HA6J3B,CAAC"}
@@ -0,0 +1,178 @@
1
+ /**
2
+ * The mount's chrome stylesheet: the controls the mount draws beside the
3
+ * package's own panels, and nothing the panels already style.
4
+ *
5
+ * Same contract as the workspace's, the picker's and the ladder's — layout,
6
+ * weight and state, never a value. Every colour, length and font is a
7
+ * `var(--ig-…)` the host's theme resolves, and `mount.test.ts` scans these
8
+ * bytes for a literal or an unresolvable token, so the rule is enforced rather
9
+ * than remembered.
10
+ *
11
+ * What is styled here is exactly what `mount.ts` builds with `createElement`:
12
+ * the add button, the kind chooser, the target search and its matches, the
13
+ * delete button, the key hints, and the floating chooser a canvas drop places.
14
+ * The picker inside the inspector ships its own sheet, installed alongside.
15
+ *
16
+ * Shipped as a string for the same reason every sibling sheet is: an entry
17
+ * that imports CSS cannot be loaded by a bare Node runtime, and a string needs
18
+ * no bundler.
19
+ */
20
+ export const mountStylesheet = `
21
+ .ig-mount {
22
+ position: relative;
23
+ height: 100%;
24
+ min-height: 0;
25
+ }
26
+
27
+ .ig-mount > .ig-workspace {
28
+ /* THE FLOATING CHOOSER'S BOX. A canvas drop places the kind chooser inside
29
+ the workspace root, so a host that scopes its theme to that root still
30
+ resolves the chooser's tokens; the root is the positioning box for it. */
31
+ position: relative;
32
+ height: 100%;
33
+ box-sizing: border-box;
34
+ }
35
+
36
+ .ig-mount[data-dragging='true'] {
37
+ cursor: grabbing;
38
+ user-select: none;
39
+ }
40
+
41
+ .ig-chrome {
42
+ padding: var(--ig-space-tight) var(--ig-space);
43
+ border-top: var(--ig-stroke) solid var(--ig-line);
44
+ display: flex;
45
+ flex-direction: column;
46
+ gap: var(--ig-space-tight);
47
+ font-family: var(--ig-font-ui);
48
+ font-size: var(--ig-font-size-small);
49
+ line-height: var(--ig-line-height);
50
+ color: var(--ig-text-body);
51
+ }
52
+
53
+ .ig-chrome-sentence {
54
+ margin: 0;
55
+ font-family: var(--ig-font-mono);
56
+ color: var(--ig-text);
57
+ }
58
+
59
+ .ig-chrome-button {
60
+ font: inherit;
61
+ font-size: var(--ig-font-size-small);
62
+ color: var(--ig-text);
63
+ background: var(--ig-surface-2);
64
+ border: var(--ig-stroke) solid var(--ig-line);
65
+ border-radius: var(--ig-radius);
66
+ padding: var(--ig-space-tight) var(--ig-space);
67
+ cursor: pointer;
68
+ text-align: left;
69
+ }
70
+
71
+ .ig-chrome-button:hover {
72
+ border-color: var(--ig-accent);
73
+ }
74
+
75
+ .ig-chrome-button:focus-visible {
76
+ outline: var(--ig-focus-ring) solid var(--ig-focus);
77
+ outline-offset: var(--ig-space-tight);
78
+ }
79
+
80
+ .ig-chrome-quiet {
81
+ background: none;
82
+ color: var(--ig-text-muted);
83
+ }
84
+
85
+ .ig-chrome-danger {
86
+ color: var(--ig-state-failed);
87
+ border-color: var(--ig-state-failed);
88
+ }
89
+
90
+ .ig-chrome-input {
91
+ font: inherit;
92
+ font-size: var(--ig-font-size-small);
93
+ color: var(--ig-text);
94
+ background: var(--ig-surface-2);
95
+ border: var(--ig-stroke) solid var(--ig-line);
96
+ border-radius: var(--ig-radius);
97
+ padding: var(--ig-space-tight) var(--ig-space);
98
+ width: 100%;
99
+ box-sizing: border-box;
100
+ }
101
+
102
+ .ig-chrome-input:focus-visible {
103
+ outline: var(--ig-focus-ring) solid var(--ig-focus);
104
+ outline-offset: var(--ig-space-tight);
105
+ }
106
+
107
+ .ig-chrome-kinds {
108
+ display: flex;
109
+ flex-direction: column;
110
+ gap: var(--ig-space-tight);
111
+ }
112
+
113
+ /* EACH KIND CARRIES ITS HUE ON THE LEFT, the same hue the viewer draws the
114
+ edge in, so the chooser and the canvas name a relationship the same way. */
115
+ .ig-chrome-kinds .ig-chrome-button {
116
+ border-left: var(--ig-terminal-width) solid var(--ig-line);
117
+ }
118
+
119
+ .ig-chrome-kinds [data-edge='blocked-by'] {
120
+ border-left-color: var(--ig-edge-blocked-by);
121
+ }
122
+
123
+ .ig-chrome-kinds [data-edge='serialize-with'] {
124
+ border-left-color: var(--ig-edge-serialize-with);
125
+ }
126
+
127
+ .ig-chrome-kinds [data-edge='together-with'] {
128
+ border-left-color: var(--ig-edge-together-with);
129
+ }
130
+
131
+ .ig-chrome-kinds [data-edge='duplicate-of'] {
132
+ border-left-color: var(--ig-edge-duplicate-of);
133
+ }
134
+
135
+ .ig-chrome-kinds [data-edge='decomposed-from'] {
136
+ border-left-color: var(--ig-edge-decomposed-from);
137
+ }
138
+
139
+ .ig-chrome-matches {
140
+ list-style: none;
141
+ margin: 0;
142
+ padding: 0;
143
+ display: flex;
144
+ flex-direction: column;
145
+ gap: var(--ig-space-tight);
146
+ }
147
+
148
+ .ig-chrome-match {
149
+ width: 100%;
150
+ }
151
+
152
+ .ig-chrome-search,
153
+ .ig-chrome-chooser {
154
+ display: flex;
155
+ flex-direction: column;
156
+ gap: var(--ig-space-tight);
157
+ }
158
+
159
+ /* PLACED BY THE MOUNT, at the drop point \`pickerPlacement\` chose: \`left\` and
160
+ \`top\` are written inline on the element, so this rule carries the box and
161
+ nothing about where it sits. */
162
+ .ig-chrome-floating {
163
+ position: absolute;
164
+ width: calc(var(--ig-char-width) * 40);
165
+ padding: var(--ig-space-tight) var(--ig-space);
166
+ background: var(--ig-surface-2);
167
+ border: var(--ig-stroke) solid var(--ig-accent);
168
+ border-radius: var(--ig-radius);
169
+ z-index: 2;
170
+ }
171
+
172
+ .ig-chrome-keys {
173
+ margin: 0;
174
+ font-size: var(--ig-font-size-small);
175
+ color: var(--ig-text-muted);
176
+ }
177
+ `;
178
+ //# sourceMappingURL=chrome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chrome.js","sourceRoot":"","sources":["../../src/workspace/chrome.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6J9B,CAAC"}
@@ -0,0 +1,148 @@
1
+ /**
2
+ * The workspace's host reducer — every decision a mount makes, with no DOM.
3
+ *
4
+ * `renderWorkspace` renders and publishes: each control says what it does as
5
+ * `data-ig-command`, and the viewer publishes its two identities, `data-ig-key`
6
+ * and `data-ig-group`. This file is the DECISIONS a mount takes on reading
7
+ * them. The shell in `mount.ts` reads the DOM and turns what it saw into a
8
+ * {@link HostCommand}; this file turns the command into the next state and a
9
+ * list of {@link HostEffect}s the shell then performs against the store.
10
+ *
11
+ * It composes the package's own reducers — `selectionReducer`, `scaleReducer`,
12
+ * `createReducer`, `pickerView` — and adds only what those leave to a mount:
13
+ * which one selection is shared, when the create draft begins and ends, the
14
+ * rail's scroll offset, and the drag that turns a canvas drop into a draft.
15
+ * Nothing here reaches a node, so all of it runs under `node --test` with no
16
+ * DOM, which is the property the package's other reducers are shaped for and
17
+ * the reason this is not written into listeners.
18
+ *
19
+ * ## Lifted from the demo, and why
20
+ *
21
+ * This was the demo's `host.ts`, written once for that page. A second host
22
+ * re-implemented it from scratch and re-ran the review rounds that shaped it;
23
+ * the design kit's layer rule puts the interaction shell in layer 2, not in
24
+ * the host. What stayed behind in the demo is exactly what was demo-shaped:
25
+ * the theme switch, the armed dispatch outcome, and the sandbox reset — none
26
+ * of which a host reducer should know about, and each of which the demo now
27
+ * handles beside the mount rather than through it.
28
+ */
29
+ import { type EdgeField } from '@issuegraph/core';
30
+ import type { GraphDocument, MutationId, Proposal, StoredIssue } from '@issuegraph/store';
31
+ import { type CreateDraft } from '../create/draft.ts';
32
+ import type { KeyIntent } from '../create/keys.ts';
33
+ import type { Point } from '../create/placement.ts';
34
+ import { type ScaleState } from '../scale/commands.ts';
35
+ import { type WorkspaceSelection } from './selection.ts';
36
+ export interface HostState {
37
+ readonly selection: WorkspaceSelection;
38
+ readonly scale: ScaleState;
39
+ readonly auditFiltered: boolean;
40
+ /** The rail window's first slot — a scroll offset in rows, never a rank. */
41
+ readonly railStart: number;
42
+ readonly draft: CreateDraft;
43
+ /** What the reader has typed into the target search. */
44
+ readonly targetQuery: string;
45
+ /** The issue a canvas drag started on, while the pointer is down. */
46
+ readonly drag: string | null;
47
+ /** Where a canvas drop landed, so the kind chooser can be placed there. */
48
+ readonly drop: Point | null;
49
+ }
50
+ export declare const INITIAL_HOST_STATE: HostState;
51
+ /**
52
+ * What the shell saw.
53
+ *
54
+ * `control` carries a `data-ig-command` — the package's own vocabulary
55
+ * (`select-edge`, `focus`, `search`, `retype`, `flip`, …) and the mount's
56
+ * chrome (`add`, `kind`, `target`, `delete`, `retry`, …) share one channel
57
+ * because the shell reads one attribute. `point` and `group` are the viewer's
58
+ * two identities: a focusable issue key, and a mark naming an edge or a slot.
59
+ */
60
+ export type HostCommand = {
61
+ readonly kind: 'point';
62
+ readonly key: string;
63
+ } | {
64
+ readonly kind: 'group';
65
+ readonly id: string;
66
+ } | {
67
+ readonly kind: 'control';
68
+ readonly name: string;
69
+ readonly target?: string | undefined;
70
+ readonly value?: string | undefined;
71
+ } | {
72
+ readonly kind: 'intent';
73
+ readonly intent: KeyIntent;
74
+ } | {
75
+ readonly kind: 'scroll';
76
+ readonly start: number;
77
+ } | {
78
+ readonly kind: 'drag-start';
79
+ readonly key: string;
80
+ } | {
81
+ readonly kind: 'drop';
82
+ readonly key: string | null;
83
+ readonly at: Point;
84
+ };
85
+ /** What the shell performs against the store after reducing. */
86
+ export type HostEffect = {
87
+ readonly kind: 'propose';
88
+ readonly proposal: Proposal;
89
+ } | {
90
+ readonly kind: 'retry';
91
+ readonly mutationId: MutationId;
92
+ } | {
93
+ readonly kind: 'discard';
94
+ readonly mutationId: MutationId;
95
+ } | {
96
+ readonly kind: 'dismiss-change';
97
+ };
98
+ export interface HostResult {
99
+ readonly state: HostState;
100
+ readonly effects: readonly HostEffect[];
101
+ }
102
+ /** The one reducer. `document` is the landed document, for edge lookups. */
103
+ export declare function reduceHost(state: HostState, command: HostCommand, document: GraphDocument): HostResult;
104
+ /**
105
+ * Bring the state back into agreement with a document that moved under it.
106
+ *
107
+ * The store re-renders on every landed write, and a write can remove what the
108
+ * state names: a retype or a flip gives the edge a NEW identity, a delete
109
+ * removes it, and a conflict's rehydrate can drop an issue a draft was aimed
110
+ * at. A selection naming an edge the document no longer carries would leave
111
+ * the inspector showing a picker for nothing — the viewer already refuses a
112
+ * stale selection the same way, so the host does too, from the document
113
+ * rather than from memory of what it just proposed.
114
+ */
115
+ export declare function reconcileHost(state: HostState, document: GraphDocument): HostState;
116
+ /** The issues a target search offers, by reference or title, never the source itself. */
117
+ export declare function targetMatches(issues: readonly StoredIssue[], query: string, source: string | null, limit?: number): readonly StoredIssue[];
118
+ /** The edge kinds, in the format's order — the keyboard path's `1`–`5` is this list. */
119
+ export declare const KINDS: readonly EdgeField[];
120
+ /** How far the reader may scroll into the rail window before it is re-cut around them, in rows. */
121
+ export declare const RAIL_SLACK = 20;
122
+ /**
123
+ * The slack a window of `count` rows actually gets: `RAIL_SLACK`, bounded to a
124
+ * quarter of the window and never below one row. A slack as wide as the window
125
+ * re-cut a small window onto its own start — ArrowDown on the last drawn row
126
+ * computed `offset - slack` at or below the current start, dispatched it
127
+ * unchanged, and keyboard navigation could not leave the first window.
128
+ */
129
+ export declare function railSlackFor(count: number): number;
130
+ /**
131
+ * Where the rail window should be re-cut for a scroll position, or `null` when
132
+ * it should stay where it is.
133
+ *
134
+ * `row` is the first visible row (scroll offset over pitch), `start` the
135
+ * window's current first slot, `count` the window's size and `total` the rows
136
+ * in the order. Inside the window's slack band nothing moves. Outside it, the
137
+ * window is re-cut `RAIL_SLACK` rows above the reader, clamped to the order.
138
+ *
139
+ * THE CLAMP CAN LAND ON THE CURRENT START, AND THAT CASE MUST ANSWER `null`.
140
+ * At the end of a long order the window is already pinned to its last start
141
+ * while the reader is deep inside it, so every scroll position there is
142
+ * "outside the band" and clamps back to the same start. A shell that
143
+ * dispatched that as a change redrew, restored the scroll offset — which
144
+ * fires `scroll` again — and never stopped. The decision is a pure function
145
+ * here so that cycle is refused where it can be tested without a browser.
146
+ */
147
+ export declare function railWindowTarget(row: number, start: number, count: number, total: number): number | null;
148
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/workspace/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,KAAK,SAAS,EAA4B,MAAM,kBAAkB,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAG1F,OAAO,EAAE,KAAK,WAAW,EAAoC,MAAM,oBAAoB,CAAC;AACxF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAuB,KAAK,UAAU,EAAgB,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAEL,KAAK,kBAAkB,EAIxB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,4EAA4E;IAC5E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,wDAAwD;IACxD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,kBAAkB,EAAE,SAS/B,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GACnB;I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