spell-ui 0.8.12 → 0.8.13

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.
Files changed (68) hide show
  1. package/README-components.md +5 -3
  2. package/dist/{Dragging-B93hbRxF.js → Dragging-tHPSvf3G.js} +56 -13
  3. package/dist/Dragging-tHPSvf3G.js.map +1 -0
  4. package/dist/_spell-element/DOMElement.d.ts +8 -1
  5. package/dist/_spell-element/drawnWindow.d.ts +62 -0
  6. package/dist/_util/Dragging.d.ts +7 -0
  7. package/dist/components/components.types.d.ts +2 -0
  8. package/dist/components/ui-diagram/UIDiagram.d.ts +3 -0
  9. package/dist/components/ui-graph/GraphLayout.d.ts +54 -0
  10. package/dist/components/ui-graph/UIGraph.d.ts +355 -0
  11. package/dist/components/ui-graph/UIGraph.en.d.ts +137 -0
  12. package/dist/components/ui-graph/UIGraph.es.d.ts +48 -0
  13. package/dist/components/ui-graph/UIGraph.types.d.ts +193 -0
  14. package/dist/components/ui-graph/index.d.ts +5 -0
  15. package/dist/components/ui-json/UIJson.d.ts +275 -10
  16. package/dist/components/ui-json/UIJson.en.d.ts +148 -9
  17. package/dist/components/ui-json/UIJson.es.d.ts +34 -3
  18. package/dist/components/ui-json/index.d.ts +2 -2
  19. package/dist/components/ui-split-panel/UISplitPanel.d.ts +2 -16
  20. package/dist/components/ui-tree/UITree.d.ts +758 -26
  21. package/dist/components/ui-tree/UITree.en.d.ts +113 -3
  22. package/dist/components/ui-tree/UITree.es.d.ts +24 -0
  23. package/dist/components/ui-tree/UITree.types.d.ts +34 -0
  24. package/dist/components/ui-tree/UITreeItem.d.ts +40 -1
  25. package/dist/components/ui-tree/UITreeItem.en.d.ts +9 -0
  26. package/dist/components/ui-tree/UITreeItem.es.d.ts +2 -0
  27. package/dist/components/ui-tree/index.d.ts +3 -2
  28. package/dist/components/ui-tree-diagram/UITreeDiagram.d.ts +3 -0
  29. package/dist/{components.es-DEa8Ep42.js → components.es-DilRG1VO.js} +117 -9
  30. package/dist/components.es-DilRG1VO.js.map +1 -0
  31. package/dist/core.js +713 -671
  32. package/dist/core.js.map +1 -1
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +97 -96
  35. package/dist/jsx.d.ts +489 -20
  36. package/dist/ui-diagram.js +2 -2
  37. package/dist/ui-diagram.js.map +1 -1
  38. package/dist/ui-graph.editor-DLsXPyby.js +5 -0
  39. package/dist/ui-graph.editor-DLsXPyby.js.map +1 -0
  40. package/dist/ui-graph.js +1295 -0
  41. package/dist/ui-graph.js.map +1 -0
  42. package/dist/ui-json.editor-BS-v1bqO.js +5 -0
  43. package/dist/ui-json.editor-BS-v1bqO.js.map +1 -0
  44. package/dist/ui-json.js +629 -32
  45. package/dist/ui-json.js.map +1 -1
  46. package/dist/ui-property-editor.js +3 -2
  47. package/dist/ui-property-editor.js.map +1 -1
  48. package/dist/ui-root.js +34 -3
  49. package/dist/ui-root.js.map +1 -1
  50. package/dist/ui-site-nav.js +4 -4
  51. package/dist/ui-site-nav.js.map +1 -1
  52. package/dist/ui-split-panel.js +31 -61
  53. package/dist/ui-split-panel.js.map +1 -1
  54. package/dist/ui-tree-diagram.js +1 -1
  55. package/dist/ui-tree-diagram.js.map +1 -1
  56. package/dist/ui-tree.editor-Bqsa0dYQ.js +5 -0
  57. package/dist/ui-tree.editor-Bqsa0dYQ.js.map +1 -0
  58. package/dist/ui-tree.js +1734 -237
  59. package/dist/ui-tree.js.map +1 -1
  60. package/dist/util/PaneSizes.d.ts +42 -0
  61. package/dist/util/index.d.ts +2 -0
  62. package/package.json +1 -1
  63. package/dist/Dragging-B93hbRxF.js.map +0 -1
  64. package/dist/components.es-DEa8Ep42.js.map +0 -1
  65. package/dist/ui-json.editor-BgZbrB_W.js +0 -5
  66. package/dist/ui-json.editor-BgZbrB_W.js.map +0 -1
  67. package/dist/ui-tree.editor-BoQztwdz.js +0 -5
  68. package/dist/ui-tree.editor-BoQztwdz.js.map +0 -1
@@ -0,0 +1,355 @@
1
+ import { JSX } from '@solidjs/web';
2
+ import { E } from 'spell/ui/core';
3
+ import { graphVocabulary } from './UIGraph.en';
4
+ import { GRAPH_METRICS, GraphChildView, GraphData, GraphEdge, GraphLayoutResult, GraphNode, GraphPlacedNode, GraphPort, GraphSelection } from './UIGraph.types';
5
+ /****************
6
+ * ### `DOMGraphElement`
7
+ * `<ui-graph>` itself: its script API, over its component.
8
+ ****************/
9
+ export declare class DOMGraphElement extends E.DOMElement<UIGraph> {
10
+ /** Fit the drawing to the view. */
11
+ fit(): void;
12
+ /** Open the node at `path` (its ids from the top, joined by `/`), as `view`, else as its own or the graph's. */
13
+ open(path: string, view?: GraphChildView): Promise<void>;
14
+ /** Close the node at `path`, opened in place; or, drilled into, go back above it. */
15
+ close(path: string): void;
16
+ /** Show the graph at `path` instead of the top (drill); none: back to the top. */
17
+ drillTo(path?: string): Promise<void>;
18
+ /** The graph as it's drawn now: every box and edge, in user units. */
19
+ get layout(): GraphLayoutResult | undefined;
20
+ }
21
+ /****************
22
+ * ### `<ui-graph>`
23
+ * The component behind `<ui-graph>`: a node / edge graph drawn as an SVG, laid out left to right in layers
24
+ * (`GraphLayout`), with ports on the nodes' sides, smooth edges, pan, zoom and fit.
25
+ *
26
+ * - GENERIC: any graph from plain data (`GraphData`).
27
+ * A subclass restyles and relabels it through the hooks below
28
+ * (`nodeLabel()`, `nodeClass()`, `renderNode()`, `edgeClass()` ...), its parts and its `--ui-graph-*` tokens.
29
+ * - A node with `children` has a toggle; opened, they show by `child-view` (or the node's `childView`):
30
+ * - `inline`: the node grows into a container, its graph laid out inside it, recursively
31
+ * - `modal`: a `<ui-modal>` holding another graph of the same tag
32
+ * - `drill`: the drawing shows them instead, with `<ui-breadcrumbs>` back
33
+ * - `children` given as a function (or a promise of a graph) is called the first time it opens.
34
+ * - Paths: how a node, a port or an edge is known.
35
+ * - a node: its ids from the top graph, joined by `/` (`cpu/alu`)
36
+ * - a port: its node's path, `:` and its id
37
+ * - an edge: its graph's path, `#` and its id
38
+ * - So ids should hold none of `/`, `:` or `#`.
39
+ * - Pan: drag; zoom: the wheel, round the pointer; fit: the toolbar's button, and by itself on a new graph.
40
+ * - `path` (`a/b`): the node drilled to.
41
+ * - Set it to drill there.
42
+ * - A drill (double-click a node with children, or its toggle with `child-view="drill"`) or a breadcrumb
43
+ * sets it back, and sends `ui-changed` `{ kind: 'path', path }`.
44
+ * - Click a node, an edge or a port to select it: `ui-selecting` (cancelable), then `ui-changed`.
45
+ * Hovering an edge lights it and its two ends; hovering a node lights its edges.
46
+ * - Text is measured in the graph's real font (`TreeMeasure`, the canvas the tree diagram measures with);
47
+ * a static server render estimates from character counts.
48
+ * - Spell UI's other drawings of boxes and lines, so nobody builds a fourth:
49
+ * - `<ui-tree-diagram>`: a TREE, each node's children under (or beside) it
50
+ * - `<ui-diagram>`: boxes in COLUMNS and the links between them, the NERD drawing, boxes dragged by hand
51
+ * - this one: any GRAPH, cycles too, in layers left to right, with ports on the boxes' sides, wires between
52
+ * them and nested graphs, panned and zoomed
53
+ ****************/
54
+ export declare class UIGraph extends E.UIComponent<typeof graphVocabulary> {
55
+ static vocabulary: {
56
+ readonly tag: "ui-graph";
57
+ readonly icon: "project diagram";
58
+ readonly topics: readonly ["data display", "images", "views"];
59
+ readonly aka: readonly ["graph", "node graph", "network diagram", "flow chart", "dataflow", "netlist", "schematic", "block diagram", "DAG"];
60
+ readonly skeleton: "16 tall";
61
+ readonly noun: "graph";
62
+ readonly description: "A graph draws nodes joined by edges, laid out left to right. A node may hold a graph of its own, opened in place, in a modal, or in its stead.";
63
+ readonly attributes: readonly [{
64
+ readonly name: "graph";
65
+ readonly group: "content";
66
+ readonly kind: "json";
67
+ readonly reflect: false;
68
+ readonly description: string;
69
+ }, {
70
+ readonly name: "child-view";
71
+ readonly group: "behaviour";
72
+ readonly kind: "enum";
73
+ readonly values: readonly ["inline", "modal", "drill"];
74
+ readonly default: "inline";
75
+ readonly description: string;
76
+ }, {
77
+ readonly name: "path";
78
+ readonly group: "behaviour";
79
+ readonly kind: "string";
80
+ readonly default: "";
81
+ readonly description: string;
82
+ }, {
83
+ readonly name: "selected";
84
+ readonly group: "states";
85
+ readonly kind: "json";
86
+ readonly reflect: false;
87
+ readonly description: "PROPERTY: what's selected, `{ kind: 'node' | 'edge' | 'port', id, path }`; `undefined`: nothing. Clicks set it.";
88
+ }, {
89
+ readonly name: "boundary";
90
+ readonly group: "content";
91
+ readonly kind: "json";
92
+ readonly reflect: false;
93
+ readonly description: string;
94
+ }];
95
+ readonly events: readonly [{
96
+ readonly name: "ui-selecting";
97
+ readonly cancelable: true;
98
+ readonly detail: "{ kind: 'node' | 'edge' | 'port', id: string, path: string, item: object, originalEvent?: Event }";
99
+ readonly description: "A node, edge or port is about to be selected by a click: cancel it to keep the selection.";
100
+ }, {
101
+ readonly name: "ui-changed";
102
+ readonly detail: "{ value: { kind: string, id: string, path: string } | undefined, kind?: string, id?: string, path?: string, item?: object, originalEvent?: Event } | { kind: 'path', path: string, originalEvent?: Event }";
103
+ readonly description: string;
104
+ }, {
105
+ readonly name: "ui-node-toggled";
106
+ readonly detail: "{ node: object, path: string, open: boolean, view: 'inline' | 'modal' | 'drill', originalEvent?: Event }";
107
+ readonly description: "A node with children was opened or closed, by a person or by `open()` / `close()`.";
108
+ }];
109
+ readonly slots: readonly [];
110
+ readonly parts: readonly [{
111
+ readonly name: "graph";
112
+ readonly description: "The box round it all.";
113
+ }, {
114
+ readonly name: "canvas";
115
+ readonly description: "The `<svg>`.";
116
+ }, {
117
+ readonly name: "node";
118
+ readonly description: "Each node's `<g>`.";
119
+ }, {
120
+ readonly name: "container";
121
+ readonly description: "A node opened in place, its child graph inside; also part `node`.";
122
+ }, {
123
+ readonly name: "edge";
124
+ readonly description: "Each edge's `<path>`.";
125
+ }, {
126
+ readonly name: "edge-label";
127
+ readonly description: "Each edge's label.";
128
+ }, {
129
+ readonly name: "port";
130
+ readonly description: "Each port's `<g>`: its dot and label.";
131
+ }, {
132
+ readonly name: "pin";
133
+ readonly description: "Each pin, the enclosing node's port, on a modal or drilled graph's side.";
134
+ }, {
135
+ readonly name: "toggle";
136
+ readonly description: "Each node's open / close button.";
137
+ }, {
138
+ readonly name: "toolbar";
139
+ readonly description: "The buttons over the drawing (fit).";
140
+ }, {
141
+ readonly name: "breadcrumbs";
142
+ readonly description: "The trail back up, when drilled in.";
143
+ }];
144
+ readonly states: readonly [{
145
+ readonly name: "drilled";
146
+ readonly description: "It shows a node's children instead of its graph.";
147
+ }, {
148
+ readonly name: "panning";
149
+ readonly description: "A drag is moving the view.";
150
+ }];
151
+ readonly texts: readonly [{
152
+ readonly key: "graphSummary";
153
+ readonly text: "Graph: {count} nodes";
154
+ readonly description: "Name of the drawing.";
155
+ }, {
156
+ readonly key: "graphOpenNode";
157
+ readonly text: "Open {label}";
158
+ readonly description: "A closed node's toggle.";
159
+ }, {
160
+ readonly key: "graphCloseNode";
161
+ readonly text: "Close {label}";
162
+ readonly description: "An open node's toggle.";
163
+ }, {
164
+ readonly key: "graphFit";
165
+ readonly text: "Fit";
166
+ readonly description: "The button that fits the drawing to the view.";
167
+ }, {
168
+ readonly key: "graphTop";
169
+ readonly text: "Top";
170
+ readonly description: "The first breadcrumb, the graph itself.";
171
+ }, {
172
+ readonly key: "graphLoading";
173
+ readonly text: "Loading …";
174
+ readonly description: "A node whose children are loading.";
175
+ }];
176
+ };
177
+ static elementSetup: {
178
+ styleSheets: {
179
+ graph: string;
180
+ };
181
+ delegatesFocus: false;
182
+ DOMElement: typeof DOMGraphElement;
183
+ };
184
+ /** A node's text. */
185
+ nodeLabel(node: GraphNode): string;
186
+ /** Extra classes on a node's `<g>`; `kind-<kind>` is there already. */
187
+ nodeClass(_node: GraphNode): string | undefined;
188
+ /** An edge's text, at its middle; none: no text. */
189
+ edgeLabel(edge: GraphEdge): string | undefined;
190
+ /** Extra classes on an edge's `<path>`. */
191
+ edgeClass(_edge: GraphEdge): string | undefined;
192
+ /** A port's text, beside it inside its node. */
193
+ portLabel(port: GraphPort, _node: GraphNode): string | undefined;
194
+ /** Extra classes on a port's `<g>`. */
195
+ portClass(_port: GraphPort, _node: GraphNode): string | undefined;
196
+ /** The sizes the layout works in; a subclass may make its boxes taller, its layers wider apart ... */
197
+ get metrics(): typeof GRAPH_METRICS;
198
+ /**
199
+ * The breadcrumbs, top first: each one's text, and what picking it does.
200
+ * - None (or one): no breadcrumbs.
201
+ * - Default: the top, then each node drilled into.
202
+ * A subclass that shows its own levels gives its own trail.
203
+ */
204
+ trail(): {
205
+ label: string;
206
+ pick: () => void;
207
+ }[];
208
+ /** The least zoom Fit goes to: a graph bigger than that shows its start, the rest a pan away. `0`: no least. */
209
+ get minFitZoom(): number;
210
+ /** More buttons in the toolbar, before Fit. */
211
+ toolButtons(): JSX.Element;
212
+ /** Something drawn over the canvas (a legend ...), positioned by the subclass's own sheet. */
213
+ overlay(): JSX.Element;
214
+ /** A node was double-clicked: drilled into, when it has children. */
215
+ nodeDoubleClicked(placed: GraphPlacedNode, event: MouseEvent): void;
216
+ /** The detail of the `ui-changed` a selection sends. */
217
+ changedDetail(selection: GraphSelection, item: object, originalEvent: Event): object;
218
+ /**
219
+ * What a node's `<g>` holds: its box and label; the ports and toggle are drawn after it.
220
+ * - Override to draw a node another way; stay inside `placed`'s box, as the layout sized it.
221
+ */
222
+ renderNode(placed: GraphPlacedNode): JSX.Element;
223
+ /** Children loaded from a function or promise, by the node's path. */
224
+ accessor loadedChildren: ReadonlyMap<string, GraphData>;
225
+ /** Paths whose children are loading. */
226
+ accessor loadingPaths: ReadonlySet<string>;
227
+ /** Paths of nodes open in place. */
228
+ accessor openPaths: ReadonlySet<string>;
229
+ /** The nodes drilled into, outermost first. */
230
+ accessor drillPaths: readonly string[];
231
+ /** The node whose children the modal shows. */
232
+ accessor modalPath: string | undefined;
233
+ /** The `graph` property, checked; `undefined`: nothing to draw. */
234
+ get topGraph(): GraphData | undefined;
235
+ /** The node at `path`, from the top; `undefined` when there's none, or its graph isn't loaded. */
236
+ nodeAt(path: string): GraphNode | undefined;
237
+ /** `node`'s child graph, when it's there: given as a graph, or loaded. */
238
+ childrenOf(node: GraphNode, path: string): GraphData | undefined;
239
+ /** The node drilled into last; `undefined` at the top. */
240
+ get drillPath(): string | undefined;
241
+ /** The graph drawn: the top's, or the children of the node drilled into. */
242
+ get shownGraph(): GraphData | undefined;
243
+ /** The ports drawn as pins round the graph shown. */
244
+ get shownBoundary(): readonly GraphPort[];
245
+ /** The graph laid out; `undefined` with nothing to draw. `@derived`: lays out every node. */
246
+ get layout(): GraphLayoutResult | undefined;
247
+ /** The font the labels are drawn in, read once: what they're measured in. */
248
+ private get fontFamily();
249
+ /** The containers first (they're behind), then the boxes. */
250
+ private get containers();
251
+ private get leaves();
252
+ /** Open the node at `path`: its children loaded first, then shown as `view`. */
253
+ openNode(path: string, view?: GraphChildView, originalEvent?: Event): Promise<void>;
254
+ /** Close the node at `path`: in place, with every node open inside it; drilled into, back above it. */
255
+ closeNode(path: string, originalEvent?: Event): void;
256
+ /** Show the graph inside the node at `path`; none: the top. */
257
+ drillTo(path?: string): Promise<void>;
258
+ /** Back up to `depth` nodes drilled into (`0`: the top). */
259
+ goToDrill(depth: number, originalEvent?: Event): void;
260
+ /** The graph shown changed by a drill: `path` follows, and `ui-changed` `{ kind: 'path', path }` says so. */
261
+ private drilled;
262
+ /** `path` was set: drill to it. */
263
+ protected onPathChanged(path: string | undefined): void;
264
+ /**
265
+ * Show the graph inside the node at `path`, drilling through each node on the way and loading lazy children.
266
+ * - `path`: `a/b`; `""`: the top.
267
+ * - Sends nothing: the page asked for it.
268
+ * - A subclass with a path of its own overrides it.
269
+ */
270
+ applyPath(path: string): Promise<void>;
271
+ /** `node`'s children, loaded if they're a function or a promise; false when they failed. */
272
+ protected load(node: GraphNode, path: string): Promise<boolean>;
273
+ /** A toggle was pressed. */
274
+ private toggle;
275
+ /** `drilled`: it shows a node's children. */
276
+ get isDrilled(): boolean;
277
+ /** The path hovered: a node's, an edge's or a port's. */
278
+ accessor hovered: {
279
+ kind: GraphSelection["kind"];
280
+ path: string;
281
+ } | undefined;
282
+ /** The paths lit: the hovered edge and its ends, or the hovered node and its edges. `@derived`: walks the edges. */
283
+ get lit(): ReadonlySet<string>;
284
+ /** The selected path; `undefined`: nothing. */
285
+ get selectedPath(): string | undefined;
286
+ /** Select `selection`: `ui-selecting` (a page may cancel it), then `selected`, then `ui-changed`. */
287
+ protected choose(selection: GraphSelection, item: object, originalEvent: Event): void;
288
+ /** The view: a shift in pixels, then a scale. */
289
+ accessor view: {
290
+ x: number;
291
+ y: number;
292
+ k: number;
293
+ };
294
+ /** A drag is moving the view. */
295
+ accessor isPanning: boolean;
296
+ /** The next layout is fitted to the view: a new graph, or a drill. */
297
+ protected needsFit: boolean;
298
+ /** The view was last set by a fit, not by a person: a change of size fits again. */
299
+ private isFitted;
300
+ /** The last pointer press moved far enough to be a drag: its click selects nothing. */
301
+ private wasDragged;
302
+ /** The `<svg>`. Set as it draws. */
303
+ private svg;
304
+ get isPanningNow(): boolean;
305
+ /** Fit the drawing to the view: all of it, at most one and a half times its size. */
306
+ fit(): void;
307
+ /** A new graph: fit it. */
308
+ protected onGraphChanged(): void;
309
+ /** Fit when asked to, once the drawing's there. */
310
+ protected onLayoutChanged(layout: GraphLayoutResult | undefined, isReady: boolean): void;
311
+ /** While it's in the page: fit again when it first gets a size. */
312
+ protected watchSize(): () => void;
313
+ private readonly onWheel;
314
+ private readonly onPointerDown;
315
+ /** A click on the background clears the selection. */
316
+ private readonly onBackgroundClick;
317
+ /** The modal's box the child graph goes in. Set as it draws. */
318
+ private modalBody;
319
+ /** The modal shows the children of `modalPath`: in a new graph of this same tag (so a subclass's look carries). */
320
+ protected onModalPathChanged(path: string | undefined, isReady: boolean): void;
321
+ /** The modal closed. */
322
+ protected onModalClosed(event: Event): void;
323
+ private modalElement;
324
+ protected get extraClass(): string | undefined;
325
+ render(): JSX.Element;
326
+ /** The modal's heading: the node's label. */
327
+ private modalHeading;
328
+ /** The trail back up (`trail()`), when there's one. */
329
+ private breadcrumbs;
330
+ /** One node: its `<g>` (part `node`, a container's also `container`), what `renderNode()` draws, ports, toggle. */
331
+ private node;
332
+ /** A node's open / close button (part `toggle`), at its top right. */
333
+ private toggleButton;
334
+ /** A port: its dot and label (part `port`). */
335
+ private port;
336
+ /** A pin: the enclosing node's port, on the graph's side (part `pin`). */
337
+ private pin;
338
+ /** One edge: a wide unseen path to hit, the line (part `edge`), its label (part `edge-label`). */
339
+ private edge;
340
+ /** The pointer left `path`: nothing's hovered, unless something else already is. */
341
+ private unhover;
342
+ /** `value` when it's a graph (an object with a `nodes` list); else `undefined`. */
343
+ static graphFrom(value: unknown): GraphData | undefined;
344
+ /** `value` when it's a child view's name. */
345
+ private static viewFrom;
346
+ /** The paths of the nodes that start open (`open`), with given (not lazy) children, all the way down. */
347
+ private static startOpen;
348
+ /** `word` when it's safe in a class and a part name; else `undefined`. */
349
+ private static wordFor;
350
+ /** `text`'s width at `size`, in `family`: measured on the page's one canvas (`TreeMeasure`), else estimated. */
351
+ private static measure;
352
+ }
353
+ /** The vocabulary getters, typed (`UIComponent`'s doc). */
354
+ export interface UIGraph extends E.AttributeValues<typeof graphVocabulary> {
355
+ }
@@ -0,0 +1,137 @@
1
+ /**
2
+ * The English vocabulary of `<ui-graph>`: every name the tag uses.
3
+ * - Its tag, attributes (each with its kind and allowed values), events, parts and texts.
4
+ * The shape is `ComponentVocabulary` (`spell/ui/vocabulary`).
5
+ * - Ours, not Fomantic's: GENERIC, any node / edge graph; netlists are one caller (a subclass restyles it).
6
+ * - Rich properties: `graph`, `selected` and `boundary` (`UIGraph.types.ts`).
7
+ * A static page may give `graph` as JSON in the attribute.
8
+ * - NOT `children` for how children open, though that's the word: it would hide the platform's `Element.children`.
9
+ * So `child-view`.
10
+ */
11
+ /****************
12
+ * ### `graphVocabulary`
13
+ * The names of `<ui-graph>`, a node / edge graph drawn as an SVG:
14
+ * `<div class="ui graph">` holding breadcrumbs (when drilled in), a toolbar and `<svg part="canvas">`.
15
+ ****************/
16
+ export declare const graphVocabulary: {
17
+ readonly tag: "ui-graph";
18
+ readonly icon: "project diagram";
19
+ readonly topics: readonly ["data display", "images", "views"];
20
+ readonly aka: readonly ["graph", "node graph", "network diagram", "flow chart", "dataflow", "netlist", "schematic", "block diagram", "DAG"];
21
+ readonly skeleton: "16 tall";
22
+ readonly noun: "graph";
23
+ readonly description: "A graph draws nodes joined by edges, laid out left to right. A node may hold a graph of its own, opened in place, in a modal, or in its stead.";
24
+ readonly attributes: readonly [{
25
+ readonly name: "graph";
26
+ readonly group: "content";
27
+ readonly kind: "json";
28
+ readonly reflect: false;
29
+ readonly description: string;
30
+ }, {
31
+ readonly name: "child-view";
32
+ readonly group: "behaviour";
33
+ readonly kind: "enum";
34
+ readonly values: readonly ["inline", "modal", "drill"];
35
+ readonly default: "inline";
36
+ readonly description: string;
37
+ }, {
38
+ readonly name: "path";
39
+ readonly group: "behaviour";
40
+ readonly kind: "string";
41
+ readonly default: "";
42
+ readonly description: string;
43
+ }, {
44
+ readonly name: "selected";
45
+ readonly group: "states";
46
+ readonly kind: "json";
47
+ readonly reflect: false;
48
+ readonly description: "PROPERTY: what's selected, `{ kind: 'node' | 'edge' | 'port', id, path }`; `undefined`: nothing. Clicks set it.";
49
+ }, {
50
+ readonly name: "boundary";
51
+ readonly group: "content";
52
+ readonly kind: "json";
53
+ readonly reflect: false;
54
+ readonly description: string;
55
+ }];
56
+ readonly events: readonly [{
57
+ readonly name: "ui-selecting";
58
+ readonly cancelable: true;
59
+ readonly detail: "{ kind: 'node' | 'edge' | 'port', id: string, path: string, item: object, originalEvent?: Event }";
60
+ readonly description: "A node, edge or port is about to be selected by a click: cancel it to keep the selection.";
61
+ }, {
62
+ readonly name: "ui-changed";
63
+ readonly detail: "{ value: { kind: string, id: string, path: string } | undefined, kind?: string, id?: string, path?: string, item?: object, originalEvent?: Event } | { kind: 'path', path: string, originalEvent?: Event }";
64
+ readonly description: string;
65
+ }, {
66
+ readonly name: "ui-node-toggled";
67
+ readonly detail: "{ node: object, path: string, open: boolean, view: 'inline' | 'modal' | 'drill', originalEvent?: Event }";
68
+ readonly description: "A node with children was opened or closed, by a person or by `open()` / `close()`.";
69
+ }];
70
+ readonly slots: readonly [];
71
+ readonly parts: readonly [{
72
+ readonly name: "graph";
73
+ readonly description: "The box round it all.";
74
+ }, {
75
+ readonly name: "canvas";
76
+ readonly description: "The `<svg>`.";
77
+ }, {
78
+ readonly name: "node";
79
+ readonly description: "Each node's `<g>`.";
80
+ }, {
81
+ readonly name: "container";
82
+ readonly description: "A node opened in place, its child graph inside; also part `node`.";
83
+ }, {
84
+ readonly name: "edge";
85
+ readonly description: "Each edge's `<path>`.";
86
+ }, {
87
+ readonly name: "edge-label";
88
+ readonly description: "Each edge's label.";
89
+ }, {
90
+ readonly name: "port";
91
+ readonly description: "Each port's `<g>`: its dot and label.";
92
+ }, {
93
+ readonly name: "pin";
94
+ readonly description: "Each pin, the enclosing node's port, on a modal or drilled graph's side.";
95
+ }, {
96
+ readonly name: "toggle";
97
+ readonly description: "Each node's open / close button.";
98
+ }, {
99
+ readonly name: "toolbar";
100
+ readonly description: "The buttons over the drawing (fit).";
101
+ }, {
102
+ readonly name: "breadcrumbs";
103
+ readonly description: "The trail back up, when drilled in.";
104
+ }];
105
+ readonly states: readonly [{
106
+ readonly name: "drilled";
107
+ readonly description: "It shows a node's children instead of its graph.";
108
+ }, {
109
+ readonly name: "panning";
110
+ readonly description: "A drag is moving the view.";
111
+ }];
112
+ readonly texts: readonly [{
113
+ readonly key: "graphSummary";
114
+ readonly text: "Graph: {count} nodes";
115
+ readonly description: "Name of the drawing.";
116
+ }, {
117
+ readonly key: "graphOpenNode";
118
+ readonly text: "Open {label}";
119
+ readonly description: "A closed node's toggle.";
120
+ }, {
121
+ readonly key: "graphCloseNode";
122
+ readonly text: "Close {label}";
123
+ readonly description: "An open node's toggle.";
124
+ }, {
125
+ readonly key: "graphFit";
126
+ readonly text: "Fit";
127
+ readonly description: "The button that fits the drawing to the view.";
128
+ }, {
129
+ readonly key: "graphTop";
130
+ readonly text: "Top";
131
+ readonly description: "The first breadcrumb, the graph itself.";
132
+ }, {
133
+ readonly key: "graphLoading";
134
+ readonly text: "Loading …";
135
+ readonly description: "A node whose children are loading.";
136
+ }];
137
+ };
@@ -0,0 +1,48 @@
1
+ /**
2
+ * `<ui-graph>` in Spanish:
3
+ * `<es-grafo>`, with the names and texts only it uses (from `UIGraph.en.ts`).
4
+ * - The names it shares with other tags are translated once, for every tag: in `components.es.ts`.
5
+ * - Names stay ASCII (no accents).
6
+ */
7
+ export declare const graphEs: {
8
+ readonly lang: "es";
9
+ readonly tag: "ui-graph";
10
+ readonly name: "grafo";
11
+ readonly aka: readonly ["grafo", "diagrama de nodos", "diagrama de red", "esquema", "diagrama de bloques"];
12
+ readonly attributes: {
13
+ readonly graph: "grafo";
14
+ readonly "child-view": "vista-hijos";
15
+ readonly boundary: "frontera";
16
+ };
17
+ readonly values: {
18
+ readonly "child-view": {
19
+ readonly inline: "en-linea";
20
+ readonly modal: "modal";
21
+ readonly drill: "adentrar";
22
+ };
23
+ };
24
+ readonly events: {
25
+ readonly "ui-node-toggled": "nodo-abierto";
26
+ };
27
+ readonly parts: {
28
+ readonly graph: "grafo";
29
+ readonly canvas: "lienzo";
30
+ readonly node: "nodo";
31
+ readonly container: "contenedor";
32
+ readonly edge: "arista";
33
+ readonly "edge-label": "etiqueta-arista";
34
+ readonly port: "puerto";
35
+ readonly pin: "pin";
36
+ readonly toggle: "abridor";
37
+ readonly toolbar: "barra";
38
+ readonly breadcrumbs: "migas";
39
+ };
40
+ readonly texts: {
41
+ readonly graphSummary: "Grafo: {count} nodos";
42
+ readonly graphOpenNode: "Abrir {label}";
43
+ readonly graphCloseNode: "Cerrar {label}";
44
+ readonly graphFit: "Ajustar";
45
+ readonly graphTop: "Inicio";
46
+ readonly graphLoading: "Cargando …";
47
+ };
48
+ };