@graphlearning/graphl-flow 0.6.0 → 0.7.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/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,18 @@
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
+ /* A full-screen program's grid: every row the full width, inverse video as the terminal draws it. */
165
+ .gf-tty .gf-line { color: var(--gf-ink); }
166
+ .gf-tty [data-inverse] { background: var(--gf-code-var); color: var(--gf-code-bg); }
167
+ .gf-tty [data-bold] { font-weight: 600; }
152
168
  .tok-var { color: var(--gf-code-var); }
153
169
  .tok-method { color: var(--gf-code-method); }
154
170
  .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,33 @@ 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
+ * shell prompt is a command (`ana@web-01:~$`, `[ana@web-02 ~]$`, zsh's `ana@mac ~ %`; `#` is root),
126
+ * everything else output, drawn in ink. A command row exactly `cols` wide WRAPPED, so the next row
127
+ * continues the command. No `$ ` convention and no `!` marks: the transcript is not edited.
128
+ */
129
+ console?: boolean;
130
+ /** The console's width in columns, for wrapped command rows. Default 80. */
131
+ cols?: number;
132
+ }
133
+ /**
134
+ * A full-screen program (`top`, `less`, `nano`) as a terminal screen showed it: exactly `rows`, each
135
+ * drawn in a fixed `cols`-wide grid, with the program's inverse-video and bold runs. Captured from a
136
+ * real virtual terminal, never typed. Rows are addressable as `<tty>.R<n>` (1-based) for `focus`.
137
+ */
138
+ export interface Tty extends Base {
139
+ type: 'tty';
140
+ /** The window title. */
141
+ title?: string;
142
+ /** The screen's rows, top to bottom; shorter rows are padded, so the grid is always cols × rows. */
143
+ screen: string[];
144
+ /** Default 80. */
145
+ cols?: number;
146
+ /** Inverse-video runs: [row, from, to] — 0-based row, columns [from, to). */
147
+ inverse?: [number, number, number][];
148
+ /** Bold runs, the same shape. */
149
+ bold?: [number, number, number][];
123
150
  }
124
151
  /** An axis in DATA units. `labels` makes it categorical: one slot per label (bar charts). */
125
152
  export interface PlotAxis {
@@ -184,7 +211,7 @@ export interface Note extends Base {
184
211
  type: 'note';
185
212
  text: string;
186
213
  }
187
- export type SceneNode = Item | Group | Table | Code | Plot | Tree | Note;
214
+ export type SceneNode = Item | Group | Table | Code | Plot | Tree | Note | Tty;
188
215
  export interface Edge {
189
216
  /** A node id, or a table row as `<table>.<row>`. */
190
217
  from: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphlearning/graphl-flow",
3
- "version": "0.6.0",
3
+ "version": "0.7.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": {