@graphlearning/graphl-flow 0.5.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
@@ -27,6 +27,13 @@
27
27
  .gf-group[data-spread] > .gf-body { flex: 1; align-content: space-evenly; }
28
28
  /* ...unless it names its OWN tone: then it is a coloured column again (Spark's four columns). */
29
29
  .gf-group .gf-group[data-toned] { background: var(--gf-tint); border-color: color-mix(in srgb, var(--gf-accent) 35%, transparent); }
30
+ /* A dashed group is a place (an AZ): only the line style changes, never the box. */
31
+ .gf-group[data-dashed] { border-style: dashed; }
32
+ /* A group not there yet (`muted`): a grey outline, no tint, the heading dimmed — paint only. Its
33
+ children keep their own paint; an item that is not there is muted itself. */
34
+ .gf-group[data-muted], .gf-group .gf-group[data-muted] { background: none; border-color: var(--gf-line); }
35
+ .gf-group[data-muted] > .gf-group-head { opacity: 0.4; }
36
+ .gf-group[data-muted] > .gf-group-head .gf-icon { filter: grayscale(1); }
30
37
  /* A bare group only arranges: no frame, fill or padding, at any depth. */
31
38
  .gf-group[data-bare], .gf-group .gf-group[data-bare] { border: 0; padding: 0; background: none; border-radius: 0; }
32
39
  /* A notebook cell: the `[n]` gutter, then the input (stretched to the cell, no bar) over its outputs.
@@ -63,6 +70,9 @@
63
70
  .gf-item[data-chip] .gf-item-title { font-weight: 500; font-size: 15px; }
64
71
  .gf-item[data-stack] { flex-direction: column; align-items: center; text-align: center; justify-self: center; }
65
72
  .gf-item-title { font-weight: 600; }
73
+ /* A part not there yet (`muted`): paint only — opacity and a desaturated icon never move a box. */
74
+ .gf-item[data-muted] { opacity: 0.4; }
75
+ .gf-item[data-muted] .gf-icon { filter: grayscale(1); }
66
76
  /* The reading measure: an item's text WRAPS here instead of widening its column. The fit is set by
67
77
  the scene's width, so an unwrapped subtitle shrinks every word in the frame (Barclays: 20px body
68
78
  text at 4K before this). */
@@ -127,6 +137,10 @@
127
137
  .gf-dots i + i + i { background: #27c93f; }
128
138
  .gf-code-body { padding-block: 8px; }
129
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; }
130
144
  .gf-code[data-terminal] .gf-line { padding-left: 14px; }
131
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; }
132
146
  .gf-line[data-lit] { background: color-mix(in srgb, var(--gf-accent) 16%, transparent); box-shadow: inset 3px 0 0 var(--gf-accent); }
@@ -139,6 +153,18 @@
139
153
  .gf-code[data-output] .gf-line { padding-left: 12px; }
140
154
  .gf-code[data-output] .gf-line[data-kind='out'] { color: var(--gf-ink); }
141
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; }
142
168
  .tok-var { color: var(--gf-code-var); }
143
169
  .tok-method { color: var(--gf-code-method); }
144
170
  .tok-keyword { color: var(--gf-code-keyword); }
package/dist/types.d.ts CHANGED
@@ -39,6 +39,11 @@ export interface Item extends Base {
39
39
  stack?: boolean;
40
40
  /** A small framed pill — a thing COUNTED, not described (`Task 1`, `Local disk`). */
41
41
  chip?: boolean;
42
+ /**
43
+ * Not there yet: drawn greyed (icon desaturated, text dimmed) at its full size and place — a part
44
+ * of an architecture the system does not have yet. Paint only, so muting moves nothing.
45
+ */
46
+ muted?: boolean;
42
47
  }
43
48
  /** A container: lays its children out in a row, a column or a grid. */
44
49
  export interface Group extends Base {
@@ -55,6 +60,17 @@ export interface Group extends Base {
55
60
  cols?: number;
56
61
  /** No frame, fill or padding — a group that only arranges its children. */
57
62
  bare?: boolean;
63
+ /**
64
+ * The frame drawn dashed: a boundary that is a PLACE, not a thing (an AWS Availability Zone, a
65
+ * Region). Same width as the solid frame, so dashing a group never moves anything.
66
+ */
67
+ dashed?: boolean;
68
+ /**
69
+ * Not there yet: the frame drawn as a plain grey outline (no tint, a dimmed heading) at its full
70
+ * size and place — a network or a service the system does not have yet. Children are NOT dimmed
71
+ * by it: mute each item that is not there either. Paint only, so muting moves nothing.
72
+ */
73
+ muted?: boolean;
58
74
  /** Distribute the children over the group's full height when it is stretched taller than them. */
59
75
  spread?: boolean;
60
76
  /**
@@ -93,7 +109,7 @@ export interface Code extends Base {
93
109
  type: 'code';
94
110
  /** The source. A template literal's common indent and outer blank lines are dropped. */
95
111
  code: string;
96
- lang?: 'python' | 'sql' | 'scala' | 'java' | 'js' | 'ts' | 'shell' | 'text';
112
+ lang?: 'python' | 'sql' | 'scala' | 'java' | 'js' | 'ts' | 'shell' | 'hcl' | 'ini' | 'nginx' | 'nft' | 'text';
97
113
  /** The tab label; for a terminal, its title. */
98
114
  filename?: string;
99
115
  /** Only these 1-based, inclusive line ranges; each skipped run folds to `··· N lines`. */
@@ -104,6 +120,33 @@ export interface Code extends Base {
104
120
  terminal?: boolean;
105
121
  /** A notebook cell's printed output: plain text, no frame or line numbers; `! text` is an error. */
106
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][];
107
150
  }
108
151
  /** An axis in DATA units. `labels` makes it categorical: one slot per label (bar charts). */
109
152
  export interface PlotAxis {
@@ -168,7 +211,7 @@ export interface Note extends Base {
168
211
  type: 'note';
169
212
  text: string;
170
213
  }
171
- export type SceneNode = Item | Group | Table | Code | Plot | Tree | Note;
214
+ export type SceneNode = Item | Group | Table | Code | Plot | Tree | Note | Tty;
172
215
  export interface Edge {
173
216
  /** A node id, or a table row as `<table>.<row>`. */
174
217
  from: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphlearning/graphl-flow",
3
- "version": "0.5.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": {