@graphlearning/graphl-flow 0.6.0 → 0.8.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 +32 -5
- package/dist/Code.d.ts +46 -0
- package/dist/Tty.d.ts +12 -0
- package/dist/highlight.d.ts +7 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1879 -1483
- package/dist/index.js.map +1 -1
- package/dist/styles.css +19 -0
- package/dist/types.d.ts +30 -2
- package/package.json +1 -1
package/dist/styles.css
CHANGED
|
@@ -137,6 +137,10 @@
|
|
|
137
137
|
.gf-dots i + i + i { background: #27c93f; }
|
|
138
138
|
.gf-code-body { padding-block: 8px; }
|
|
139
139
|
.gf-line { display: flex; white-space: pre; padding-right: 16px; color: var(--gf-code-var); }
|
|
140
|
+
/* A row is a FLEX container, and flex drops a text run that is only whitespace: a blank terminal row
|
|
141
|
+
collapsed to nothing, and a screen row's leading spaces vanished (0.7: Debian's login banner lost
|
|
142
|
+
its blank lines, man's 7-column indent was gone). A row is always one row tall; runs are spans. */
|
|
143
|
+
.gf-line { min-height: 1lh; }
|
|
140
144
|
.gf-code[data-terminal] .gf-line { padding-left: 14px; }
|
|
141
145
|
.gf-ln { flex: none; box-sizing: content-box; min-width: 3ch; padding: 0 12px 0 10px; text-align: right; color: var(--gf-code-gutter); user-select: none; }
|
|
142
146
|
.gf-line[data-lit] { background: color-mix(in srgb, var(--gf-accent) 16%, transparent); box-shadow: inset 3px 0 0 var(--gf-accent); }
|
|
@@ -149,6 +153,21 @@
|
|
|
149
153
|
.gf-code[data-output] .gf-line { padding-left: 12px; }
|
|
150
154
|
.gf-code[data-output] .gf-line[data-kind='out'] { color: var(--gf-ink); }
|
|
151
155
|
.gf-line[data-kind='err'] { color: var(--gf-err); }
|
|
156
|
+
/* A real console (0.7): the prompt as bash colours it, output in INK — in a Linux lesson the output is
|
|
157
|
+
the subject, not chrome. Root's prompt is the error colour: `#` should look like what it is. */
|
|
158
|
+
.gf-code[data-console] .gf-line, .gf-tty .gf-line { padding-left: 14px; }
|
|
159
|
+
.gf-code[data-console] .gf-line[data-kind='out'] { color: var(--gf-ink); }
|
|
160
|
+
.gf-ps { color: var(--gf-code-punct); user-select: none; }
|
|
161
|
+
.gf-ps-who { color: var(--gf-ok); font-weight: 600; }
|
|
162
|
+
.gf-ps-cwd { color: var(--gf-code-method); font-weight: 600; }
|
|
163
|
+
.gf-ps[data-root] .gf-ps-who { color: var(--gf-err); }
|
|
164
|
+
/* psql's transaction state (0.8): `*` a transaction is open, `!` it failed and will roll back. */
|
|
165
|
+
.gf-ps-tx { color: var(--gf-code-number); font-weight: 600; }
|
|
166
|
+
.gf-ps-tx[data-tx='!'] { color: var(--gf-err); }
|
|
167
|
+
/* A full-screen program's grid: every row the full width, inverse video as the terminal draws it. */
|
|
168
|
+
.gf-tty .gf-line { color: var(--gf-ink); }
|
|
169
|
+
.gf-tty [data-inverse] { background: var(--gf-code-var); color: var(--gf-code-bg); }
|
|
170
|
+
.gf-tty [data-bold] { font-weight: 600; }
|
|
152
171
|
.tok-var { color: var(--gf-code-var); }
|
|
153
172
|
.tok-method { color: var(--gf-code-method); }
|
|
154
173
|
.tok-keyword { color: var(--gf-code-keyword); }
|
package/dist/types.d.ts
CHANGED
|
@@ -109,7 +109,7 @@ export interface Code extends Base {
|
|
|
109
109
|
type: 'code';
|
|
110
110
|
/** The source. A template literal's common indent and outer blank lines are dropped. */
|
|
111
111
|
code: string;
|
|
112
|
-
lang?: 'python' | 'sql' | 'scala' | 'java' | 'js' | 'ts' | 'shell' | 'hcl' | 'text';
|
|
112
|
+
lang?: 'python' | 'sql' | 'scala' | 'java' | 'js' | 'ts' | 'shell' | 'hcl' | 'ini' | 'nginx' | 'nft' | 'text';
|
|
113
113
|
/** The tab label; for a terminal, its title. */
|
|
114
114
|
filename?: string;
|
|
115
115
|
/** Only these 1-based, inclusive line ranges; each skipped run folds to `··· N lines`. */
|
|
@@ -120,6 +120,34 @@ export interface Code extends Base {
|
|
|
120
120
|
terminal?: boolean;
|
|
121
121
|
/** A notebook cell's printed output: plain text, no frame or line numbers; `! text` is an error. */
|
|
122
122
|
output?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* A REAL console transcript, row for row as an 80-column terminal drew it: a row starting with a
|
|
125
|
+
* prompt is a command (`ana@web-01:~$`, `[ana@web-02 ~]$`, zsh's `ana@mac ~ %`; `#` is root — or psql's
|
|
126
|
+
* `syndica=>`, whose continuation rows `syndica-*>` are more lines of the same statement),
|
|
127
|
+
* everything else output, drawn in ink. A command row exactly `cols` wide WRAPPED, so the next row
|
|
128
|
+
* continues the command. No `$ ` convention and no `!` marks: the transcript is not edited.
|
|
129
|
+
*/
|
|
130
|
+
console?: boolean;
|
|
131
|
+
/** The console's width in columns, for wrapped command rows. Default 80. */
|
|
132
|
+
cols?: number;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* A full-screen program (`top`, `less`, `nano`) as a terminal screen showed it: exactly `rows`, each
|
|
136
|
+
* drawn in a fixed `cols`-wide grid, with the program's inverse-video and bold runs. Captured from a
|
|
137
|
+
* real virtual terminal, never typed. Rows are addressable as `<tty>.R<n>` (1-based) for `focus`.
|
|
138
|
+
*/
|
|
139
|
+
export interface Tty extends Base {
|
|
140
|
+
type: 'tty';
|
|
141
|
+
/** The window title. */
|
|
142
|
+
title?: string;
|
|
143
|
+
/** The screen's rows, top to bottom; shorter rows are padded, so the grid is always cols × rows. */
|
|
144
|
+
screen: string[];
|
|
145
|
+
/** Default 80. */
|
|
146
|
+
cols?: number;
|
|
147
|
+
/** Inverse-video runs: [row, from, to] — 0-based row, columns [from, to). */
|
|
148
|
+
inverse?: [number, number, number][];
|
|
149
|
+
/** Bold runs, the same shape. */
|
|
150
|
+
bold?: [number, number, number][];
|
|
123
151
|
}
|
|
124
152
|
/** An axis in DATA units. `labels` makes it categorical: one slot per label (bar charts). */
|
|
125
153
|
export interface PlotAxis {
|
|
@@ -184,7 +212,7 @@ export interface Note extends Base {
|
|
|
184
212
|
type: 'note';
|
|
185
213
|
text: string;
|
|
186
214
|
}
|
|
187
|
-
export type SceneNode = Item | Group | Table | Code | Plot | Tree | Note;
|
|
215
|
+
export type SceneNode = Item | Group | Table | Code | Plot | Tree | Note | Tty;
|
|
188
216
|
export interface Edge {
|
|
189
217
|
/** A node id, or a table row as `<table>.<row>`. */
|
|
190
218
|
from: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphlearning/graphl-flow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Declarative diagram engine — authors describe groups, items and edges; the browser lays them out and the engine draws the edges.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|