@issuegraph/editor 0.2.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.
- package/README.md +31 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/overlay/projected.d.ts +21 -0
- package/dist/overlay/projected.d.ts.map +1 -0
- package/dist/overlay/projected.js +49 -0
- package/dist/overlay/projected.js.map +1 -0
- package/dist/scale/render.d.ts +19 -0
- package/dist/scale/render.d.ts.map +1 -1
- package/dist/scale/render.js +10 -29
- package/dist/scale/render.js.map +1 -1
- package/dist/workspace/chrome.d.ts +21 -0
- package/dist/workspace/chrome.d.ts.map +1 -0
- package/dist/workspace/chrome.js +178 -0
- package/dist/workspace/chrome.js.map +1 -0
- package/dist/workspace/host.d.ts +148 -0
- package/dist/workspace/host.d.ts.map +1 -0
- package/dist/workspace/host.js +316 -0
- package/dist/workspace/host.js.map +1 -0
- package/dist/workspace/mount.d.ts +139 -0
- package/dist/workspace/mount.d.ts.map +1 -0
- package/dist/workspace/mount.js +882 -0
- package/dist/workspace/mount.js.map +1 -0
- package/dist/workspace/render.d.ts +7 -0
- package/dist/workspace/render.d.ts.map +1 -1
- package/dist/workspace/render.js +1 -0
- package/dist/workspace/render.js.map +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -231,9 +231,39 @@ Ranking a unit's members is `heaviestRow`'s job, in the audit module, **because
|
|
|
231
231
|
|
|
232
232
|
**Dark only.** The pass-2 brief carries "light + dark" over from pass 1; light was cut after that pass. There is no forked token set and no `prefers-color-scheme` block — the palette is the viewer's, reached through its custom properties.
|
|
233
233
|
|
|
234
|
+
## The mount
|
|
235
|
+
|
|
236
|
+
`mountWorkspace` is the shell a host actually consumes — the entry point [`mountViewer`](../viewer) already is for layer 1, in the same shape:
|
|
237
|
+
|
|
238
|
+
```ts
|
|
239
|
+
import { mountWorkspace } from '@issuegraph/editor';
|
|
240
|
+
|
|
241
|
+
const handle = mountWorkspace(element, {
|
|
242
|
+
store, // @issuegraph/store — built by the host, with its own DataSource and OrderDeriver
|
|
243
|
+
project, // (snapshot) => { viewer: ViewerDocument; audit?: AuditInput } — the host's projection
|
|
244
|
+
words, // MountWords: WorkspaceWords plus the picker's and the chrome's
|
|
245
|
+
theme?, themeSelector?,
|
|
246
|
+
canvas?: 'neighbourhood' | 'tree',
|
|
247
|
+
});
|
|
248
|
+
handle.update({ theme }); // new options, redrawn in place; the selection and the focus survive
|
|
249
|
+
handle.dispatch({ kind: 'point', key: '12' }); // a command from the host's own chrome
|
|
250
|
+
handle.state; // the selection, the draft, the scale, the rail window
|
|
251
|
+
handle.destroy(); // every listener off, the nodes it built removed
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**It was the demo's, and it ships because a second host was about to write it again.** `renderWorkspace` publishes every control as `data-ig-command` and the viewer publishes its identities as data, so wiring them to listeners was documented as a mount's job and therefore a host's. The in-repo demo was that mount: a 930-line shell and a 387-line reducer, nine review rounds to get right, and every finding in the shell. The design's layer rule puts the interaction shell in layer 2, not in a host, so it moved here as `workspace/mount.ts` and `workspace/host.ts`, unchanged in what it does.
|
|
255
|
+
|
|
256
|
+
**The reducer is pure and the shell is thin, and that split is the test strategy.** `host.ts` composes `selectionReducer`, `scaleReducer`, `createReducer` and `pickerView`, and adds only what those leave to a mount — the one shared selection, when a draft begins and ends, the rail's scroll offset, the drag that becomes a draft — so every decision runs under `node --test` with no DOM. `mount.ts` is one delegated listener per event, an `innerHTML` assignment of the package's own escaped markup, and the chrome the panels leave to a mount: the add button, the kind chooser, the target search, the delete button, all built with `createElement` and `textContent`. It is driven through jsdom, because a DOM double written for it would be a second place the shell could be wrong about the first.
|
|
257
|
+
|
|
258
|
+
**It touches the element it is given and nothing else.** The document comes from `element.ownerDocument`; a pointer release outside the element is heard on that document rather than on a window; an element is recognised by what it can do rather than by `instanceof` against a global. So the module imports on a runtime with no DOM, and `purity.test.ts` still loads it with the browser globals removed. It installs one `<style>` inside the element carrying every sheet the surface needs — the viewer's, the theme's, the ladder's, the overlays', the picker's, the workspace's and its own `mountStylesheet` — so a host installs nothing by hand.
|
|
259
|
+
|
|
260
|
+
**The canvas draws each edge's write states.** `renderWorkspace` and `renderScaleLadder` take `projected` — the store's own `ProjectedEdge` list — and the ladder attaches an overlay per edge the tier draws: `pending-write`'s dash, an `invalid` or `failed` cross, a `conflict`'s second version, composed with the selection halo on the same line. The mount passes `snapshot.projected` and reconciles the viewer document the host projected with it — the unsettled edges are added, and a landed edge the store hides behind a pending retype or flip is dropped — because the host projects the **order** from the landed document, which must not move for an edit that did not land, while what to **draw** is the store's projection by the store's own contract. The order's status is published on the surface as `data-order="held"` while a write is in flight, in the store's vocabulary, so a host says so without this package inventing the sentence.
|
|
261
|
+
|
|
262
|
+
**Words are the host's, as everywhere here.** `MountWords` extends `WorkspaceWords` with the picker's vocabulary and the chrome's five strings; `keys` is the one optional entry. A command the reducer does not know changes nothing, so a host's own chrome may publish `data-ig-command` on the same attribute outside the element and read it from its own listener — the demo's theme switch does exactly that, and hands the writes log's `retry` and `discard` to `handle.dispatch`.
|
|
263
|
+
|
|
234
264
|
## Status
|
|
235
265
|
|
|
236
|
-
The first-pass review queue lands as its own change.
|
|
266
|
+
The first-pass review queue lands as its own change. The mount is this package's from `0.3.0`; what a host still supplies is what the specification puts there — the data source, the order, the executor holds, the words, the theme — and every listener is the mount's.
|
|
237
267
|
|
|
238
268
|
## Licence
|
|
239
269
|
|
package/dist/index.d.ts
CHANGED
|
@@ -147,4 +147,7 @@ export { type RailWindow, type RailWindowOptions, RAIL_WINDOW, railWindow, } fro
|
|
|
147
147
|
export { type InspectorPosition, type InspectorRelationship, type InspectorView, inspectorView, } from './workspace/inspector.ts';
|
|
148
148
|
export { type Zone, type WorkspaceOptions, type WorkspaceResult, type WorkspaceView, type WorkspaceWords, ZONES, renderWorkspace, } from './workspace/render.ts';
|
|
149
149
|
export { workspaceStylesheet } from './workspace/styles.ts';
|
|
150
|
+
export { type HostCommand, type HostEffect, type HostResult, type HostState, INITIAL_HOST_STATE, KINDS, RAIL_SLACK, railSlackFor, railWindowTarget, reconcileHost, reduceHost, targetMatches, } from './workspace/host.ts';
|
|
151
|
+
export { type CanvasMode, type MountWords, type MountWorkspaceOptions, type WorkspaceHandle, type WorkspaceProjection, type WorkspaceUpdate, CANVAS_MODES, MOUNT_RAIL_COUNT, mountWorkspace, } from './workspace/mount.ts';
|
|
152
|
+
export { mountStylesheet } from './workspace/chrome.ts';
|
|
150
153
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgHG;AAEH,YAAY,EACV,UAAU,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,UAAU,EACV,aAAa,EACb,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEtF,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EACL,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,YAAY,GACb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,KAAK,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EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,aAAa,GACd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,YAAY,EACZ,gBAAgB,EAChB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -144,4 +144,7 @@ export { RAIL_WINDOW, railWindow, } from "./workspace/rail.js";
|
|
|
144
144
|
export { inspectorView, } from "./workspace/inspector.js";
|
|
145
145
|
export { ZONES, renderWorkspace, } from "./workspace/render.js";
|
|
146
146
|
export { workspaceStylesheet } from "./workspace/styles.js";
|
|
147
|
+
export { INITIAL_HOST_STATE, KINDS, RAIL_SLACK, railSlackFor, railWindowTarget, reconcileHost, reduceHost, targetMatches, } from "./workspace/host.js";
|
|
148
|
+
export { CANVAS_MODES, MOUNT_RAIL_COUNT, mountWorkspace, } from "./workspace/mount.js";
|
|
149
|
+
export { mountStylesheet } from "./workspace/chrome.js";
|
|
147
150
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgHG;AAWH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGtF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EA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AAE7B,OAAO,EAGL,aAAa,GACd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAuB,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EAGf,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAGL,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAGL,WAAW,EACX,UAAU,GACX,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAIL,aAAa,GACd,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAML,KAAK,EACL,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAKL,kBAAkB,EAClB,KAAK,EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,aAAa,GACd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAOL,YAAY,EACZ,gBAAgB,EAChB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The overlays a canvas draws for the edges it drew: the store's write states,
|
|
3
|
+
* composed with the one selection.
|
|
4
|
+
*
|
|
5
|
+
* ONE MERGE, TWO CANVASES. The scale ladder and the workspace's tree mode both
|
|
6
|
+
* draw a scene over a document and both owe it the same overlays; written
|
|
7
|
+
* twice, the two drifted within a review round (the tree drew none). So the
|
|
8
|
+
* merge is a pure function over the drawn edges, the store's projection and
|
|
9
|
+
* the selected identity, and both canvases call it.
|
|
10
|
+
*
|
|
11
|
+
* Narrowed to the edges the scene drew, by identity, so an entry for an edge a
|
|
12
|
+
* narrower tier left out attaches to nothing rather than being reported as
|
|
13
|
+
* unattached. `states: ['selected']` is synthesised for the selection — the
|
|
14
|
+
* one state that is not about a write — and folded INTO a projected record for
|
|
15
|
+
* the same edge rather than added beside it, because `attachEdgeOverlays` keys
|
|
16
|
+
* overlays by identity and a second record would replace the first.
|
|
17
|
+
*/
|
|
18
|
+
import type { ProjectedEdge } from '@issuegraph/store';
|
|
19
|
+
import type { ViewerEdge } from '@issuegraph/viewer';
|
|
20
|
+
export declare function overlaysFor(drawn: readonly ViewerEdge[], projected: readonly ProjectedEdge[] | undefined, selectedEdge: string | null | undefined): readonly ProjectedEdge[];
|
|
21
|
+
//# sourceMappingURL=projected.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projected.d.ts","sourceRoot":"","sources":["../../src/overlay/projected.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,SAAS,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,EAC/C,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACtC,SAAS,aAAa,EAAE,CA8B1B"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The overlays a canvas draws for the edges it drew: the store's write states,
|
|
3
|
+
* composed with the one selection.
|
|
4
|
+
*
|
|
5
|
+
* ONE MERGE, TWO CANVASES. The scale ladder and the workspace's tree mode both
|
|
6
|
+
* draw a scene over a document and both owe it the same overlays; written
|
|
7
|
+
* twice, the two drifted within a review round (the tree drew none). So the
|
|
8
|
+
* merge is a pure function over the drawn edges, the store's projection and
|
|
9
|
+
* the selected identity, and both canvases call it.
|
|
10
|
+
*
|
|
11
|
+
* Narrowed to the edges the scene drew, by identity, so an entry for an edge a
|
|
12
|
+
* narrower tier left out attaches to nothing rather than being reported as
|
|
13
|
+
* unattached. `states: ['selected']` is synthesised for the selection — the
|
|
14
|
+
* one state that is not about a write — and folded INTO a projected record for
|
|
15
|
+
* the same edge rather than added beside it, because `attachEdgeOverlays` keys
|
|
16
|
+
* overlays by identity and a second record would replace the first.
|
|
17
|
+
*/
|
|
18
|
+
import { edgeIdentity } from '@issuegraph/core';
|
|
19
|
+
export function overlaysFor(drawn, projected, selectedEdge) {
|
|
20
|
+
const identities = new Set(drawn.map((edge) => edgeIdentity(edge.field, edge.from, edge.to)));
|
|
21
|
+
const selected = selectedEdge === null || selectedEdge === undefined
|
|
22
|
+
? null
|
|
23
|
+
: (drawn.find((edge) => edgeIdentity(edge.field, edge.from, edge.to) === selectedEdge) ?? null);
|
|
24
|
+
const selectedOverlay = selected === null
|
|
25
|
+
? null
|
|
26
|
+
: {
|
|
27
|
+
id: edgeIdentity(selected.field, selected.from, selected.to),
|
|
28
|
+
kind: selected.field,
|
|
29
|
+
from: selected.from,
|
|
30
|
+
to: selected.to,
|
|
31
|
+
states: ['selected'],
|
|
32
|
+
writes: [],
|
|
33
|
+
};
|
|
34
|
+
const overlays = [];
|
|
35
|
+
for (const edge of projected ?? []) {
|
|
36
|
+
if (!identities.has(edge.id) || edge.states.length === 0)
|
|
37
|
+
continue;
|
|
38
|
+
if (selectedOverlay !== null && edge.id === selectedOverlay.id) {
|
|
39
|
+
overlays.push({ ...edge, states: [...edge.states, 'selected'] });
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
overlays.push(edge);
|
|
43
|
+
}
|
|
44
|
+
if (selectedOverlay !== null && !overlays.some((edge) => edge.id === selectedOverlay.id)) {
|
|
45
|
+
overlays.push(selectedOverlay);
|
|
46
|
+
}
|
|
47
|
+
return overlays;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=projected.js.map
|
|
@@ -0,0 +1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,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACnE,IAAI,eAAe,KAAK,IAAI,IAAI,IAAI,CAAC,EAAE,KAAK,eAAe,CAAC,EAAE,EAAE,CAAC;YAC/D,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;YACjE,SAAS;QACX,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,IAAI,eAAe,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC;QACzF,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/scale/render.d.ts
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
* which has no routes.
|
|
31
31
|
*/
|
|
32
32
|
import { type Theme, type ViewerDocument } from '@issuegraph/viewer';
|
|
33
|
+
import type { ProjectedEdge } from '@issuegraph/store';
|
|
33
34
|
import { type ScaleState } from './commands.ts';
|
|
34
35
|
import { type ScaleLadder } from './ladder.ts';
|
|
35
36
|
export interface ScaleLadderOptions {
|
|
@@ -71,6 +72,24 @@ export interface ScaleLadderOptions {
|
|
|
71
72
|
* nothing selected rather than as a halo on a line that is not there.
|
|
72
73
|
*/
|
|
73
74
|
readonly selectedEdge?: string | null | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* The store's projection — every edge to draw, each carrying its write
|
|
77
|
+
* states — so the canvas shows what is HAPPENING to an edge, not only what
|
|
78
|
+
* it is: a `pending-write` dash, an `invalid` or `failed` cross, a
|
|
79
|
+
* `conflict`'s second version.
|
|
80
|
+
*
|
|
81
|
+
* ADDITIVE AND OPTIONAL, like the two options above, and for the same reason:
|
|
82
|
+
* the overlays module already composes the store's projection, and the
|
|
83
|
+
* ladder is the layer that holds the scene the overlays attach to. Without
|
|
84
|
+
* this the only state the canvas could draw was the selection, and a host
|
|
85
|
+
* had no way to show a write in flight on the line it concerns.
|
|
86
|
+
*
|
|
87
|
+
* Resolved against `ladder.canvas.edges` exactly as `selectedEdge` is: an
|
|
88
|
+
* entry naming an edge this tier does not draw contributes nothing. An entry
|
|
89
|
+
* for the selected edge composes with the halo rather than replacing it,
|
|
90
|
+
* because `overlayFor` reads a list of states.
|
|
91
|
+
*/
|
|
92
|
+
readonly projected?: readonly ProjectedEdge[] | undefined;
|
|
74
93
|
}
|
|
75
94
|
export interface ScaleLadderResult {
|
|
76
95
|
readonly ladder: ScaleLadder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/scale/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAEL,KAAK,KAAK,EACV,KAAK,cAAc,EAOpB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/scale/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAEL,KAAK,KAAK,EACV,KAAK,cAAc,EAOpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKvD,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAEL,KAAK,WAAW,EAIjB,MAAM,aAAa,CAAC;AAGrB,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC,mEAAmE;IACnE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClD;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,CAAC;CAC3D;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAyHD,kDAAkD;AAClD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,cAAc,EACrB,OAAO,GAAE,kBAAuB,GAC/B,iBAAiB,CA+DnB"}
|
package/dist/scale/render.js
CHANGED
|
@@ -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 {
|
|
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
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
//
|
|
132
|
-
//
|
|
133
|
-
//
|
|
134
|
-
//
|
|
135
|
-
const
|
|
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 from — rather 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 ||
|
|
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
|
package/dist/scale/render.js.map
CHANGED
|
@@ -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;
|
|
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;AAI5B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAmB,MAAM,eAAe,CAAC;AACrE,OAAO,EAKL,WAAW,GACZ,MAAM,aA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,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC;QACpE,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC;QACzD,YAAY,CAAC,MAAM,CAAC,QAAQ,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"}
|