@graphlearning/graphl-flow 0.3.0 → 0.4.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
@@ -29,6 +29,18 @@
29
29
  .gf-group .gf-group[data-toned] { background: var(--gf-tint); border-color: color-mix(in srgb, var(--gf-accent) 35%, transparent); }
30
30
  /* A bare group only arranges: no frame, fill or padding, at any depth. */
31
31
  .gf-group[data-bare], .gf-group .gf-group[data-bare] { border: 0; padding: 0; background: none; border-radius: 0; }
32
+ /* A notebook cell: the `[n]` gutter, then the input (stretched to the cell, no bar) over its outputs.
33
+ The gutter is a fixed width in ch, so every cell's input starts at the same x. */
34
+ .gf-group[data-cell], .gf-group .gf-group[data-cell] {
35
+ display: grid; grid-template-columns: auto 1fr; column-gap: 8px;
36
+ border: 0; padding: 0; background: none; border-radius: 0;
37
+ }
38
+ .gf-cell-n {
39
+ box-sizing: content-box; min-width: 5ch; padding-top: 9px; text-align: right; user-select: none;
40
+ font: 15px/1.6 'IBM Plex Mono', ui-monospace, monospace; color: var(--gf-code-gutter);
41
+ }
42
+ .gf-group[data-cell] > .gf-body > .gf-code:first-child:not([data-output]) { justify-self: stretch; }
43
+ .gf-group[data-cell] > .gf-body > .gf-code:first-child > .gf-code-bar { display: none; }
32
44
  .gf-group-head { margin-bottom: 10px; }
33
45
  .gf-group-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; }
34
46
  .gf-group-sub { margin-top: 2px; font-size: 14px; color: var(--gf-muted); }
@@ -122,6 +134,10 @@
122
134
  .gf-fold { color: var(--gf-code-gutter); font-style: italic; background: color-mix(in srgb, var(--gf-code-gutter) 10%, transparent); user-select: none; }
123
135
  .gf-prompt { color: var(--gf-ok); user-select: none; }
124
136
  .gf-line[data-kind='out'] { color: var(--gf-muted); }
137
+ /* A cell's printed output: plain text on the page, in ink — it is the result, not a terminal echo. */
138
+ .gf-code[data-output] { border: 0; border-radius: 0; background: none; padding: 2px 0; }
139
+ .gf-code[data-output] .gf-line { padding-left: 12px; }
140
+ .gf-code[data-output] .gf-line[data-kind='out'] { color: var(--gf-ink); }
125
141
  .gf-line[data-kind='err'] { color: var(--gf-err); }
126
142
  .tok-var { color: var(--gf-code-var); }
127
143
  .tok-method { color: var(--gf-code-method); }
package/dist/types.d.ts CHANGED
@@ -57,6 +57,11 @@ export interface Group extends Base {
57
57
  bare?: boolean;
58
58
  /** Distribute the children over the group's full height when it is stretched taller than them. */
59
59
  spread?: boolean;
60
+ /**
61
+ * A notebook cell: the execution count drawn as `[n]` in a gutter (`true`: not run yet, `[ ]`),
62
+ * the children — the input `code` first, then its outputs — stacked beside it. No frame or head.
63
+ */
64
+ cell?: number | true;
60
65
  children: SceneNode[];
61
66
  }
62
67
  /** One table row: its cells, plus an optional id, a short tag in a leading gutter, and a tone. */
@@ -97,6 +102,8 @@ export interface Code extends Base {
97
102
  highlight?: number[];
98
103
  /** A terminal: `$ cmd` lines are commands, `! text` errors, the rest output. No line numbers. */
99
104
  terminal?: boolean;
105
+ /** A notebook cell's printed output: plain text, no frame or line numbers; `! text` is an error. */
106
+ output?: boolean;
100
107
  }
101
108
  /** An axis in DATA units. `labels` makes it categorical: one slot per label (bar charts). */
102
109
  export interface PlotAxis {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphlearning/graphl-flow",
3
- "version": "0.3.0",
3
+ "version": "0.4.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": {