spell-ui 0.8.11 → 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.
- package/README-components.md +5 -3
- package/dist/{Dragging-B93hbRxF.js → Dragging-tHPSvf3G.js} +56 -13
- package/dist/Dragging-tHPSvf3G.js.map +1 -0
- package/dist/_spell-element/DOMElement.d.ts +8 -1
- package/dist/_spell-element/drawnWindow.d.ts +62 -0
- package/dist/_util/Dragging.d.ts +7 -0
- package/dist/components/components.types.d.ts +2 -0
- package/dist/components/ui-diagram/UIDiagram.d.ts +3 -0
- package/dist/components/ui-graph/GraphLayout.d.ts +54 -0
- package/dist/components/ui-graph/UIGraph.d.ts +355 -0
- package/dist/components/ui-graph/UIGraph.en.d.ts +137 -0
- package/dist/components/ui-graph/UIGraph.es.d.ts +48 -0
- package/dist/components/ui-graph/UIGraph.types.d.ts +193 -0
- package/dist/components/ui-graph/index.d.ts +5 -0
- package/dist/components/ui-json/UIJson.d.ts +275 -10
- package/dist/components/ui-json/UIJson.en.d.ts +148 -9
- package/dist/components/ui-json/UIJson.es.d.ts +34 -3
- package/dist/components/ui-json/index.d.ts +2 -2
- package/dist/components/ui-split-panel/UISplitPanel.d.ts +2 -16
- package/dist/components/ui-tree/UITree.d.ts +758 -26
- package/dist/components/ui-tree/UITree.en.d.ts +113 -3
- package/dist/components/ui-tree/UITree.es.d.ts +24 -0
- package/dist/components/ui-tree/UITree.types.d.ts +34 -0
- package/dist/components/ui-tree/UITreeItem.d.ts +40 -1
- package/dist/components/ui-tree/UITreeItem.en.d.ts +9 -0
- package/dist/components/ui-tree/UITreeItem.es.d.ts +2 -0
- package/dist/components/ui-tree/index.d.ts +3 -2
- package/dist/components/ui-tree-diagram/UITreeDiagram.d.ts +3 -0
- package/dist/{components.es-DEa8Ep42.js → components.es-DilRG1VO.js} +117 -9
- package/dist/components.es-DilRG1VO.js.map +1 -0
- package/dist/core.js +713 -671
- package/dist/core.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +97 -96
- package/dist/jsx.d.ts +489 -20
- package/dist/ui-diagram.js +2 -2
- package/dist/ui-diagram.js.map +1 -1
- package/dist/ui-graph.editor-DLsXPyby.js +5 -0
- package/dist/ui-graph.editor-DLsXPyby.js.map +1 -0
- package/dist/ui-graph.js +1295 -0
- package/dist/ui-graph.js.map +1 -0
- package/dist/ui-json.editor-BS-v1bqO.js +5 -0
- package/dist/ui-json.editor-BS-v1bqO.js.map +1 -0
- package/dist/ui-json.js +629 -32
- package/dist/ui-json.js.map +1 -1
- package/dist/ui-property-editor.js +3 -2
- package/dist/ui-property-editor.js.map +1 -1
- package/dist/ui-root.js +34 -3
- package/dist/ui-root.js.map +1 -1
- package/dist/ui-site-nav.js +4 -4
- package/dist/ui-site-nav.js.map +1 -1
- package/dist/ui-split-panel.js +31 -61
- package/dist/ui-split-panel.js.map +1 -1
- package/dist/ui-tree-diagram.js +1 -1
- package/dist/ui-tree-diagram.js.map +1 -1
- package/dist/ui-tree.editor-Bqsa0dYQ.js +5 -0
- package/dist/ui-tree.editor-Bqsa0dYQ.js.map +1 -0
- package/dist/ui-tree.js +1734 -237
- package/dist/ui-tree.js.map +1 -1
- package/dist/util/PaneSizes.d.ts +42 -0
- package/dist/util/index.d.ts +2 -0
- package/package.json +1 -1
- package/dist/Dragging-B93hbRxF.js.map +0 -1
- package/dist/components.es-DEa8Ep42.js.map +0 -1
- package/dist/ui-json.editor-BgZbrB_W.js +0 -5
- package/dist/ui-json.editor-BgZbrB_W.js.map +0 -1
- package/dist/ui-tree.editor-BoQztwdz.js +0 -5
- package/dist/ui-tree.editor-BoQztwdz.js.map +0 -1
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The English vocabulary of `<ui-json>`: every name the tag uses.
|
|
3
|
-
* - Its tag, attributes, events
|
|
4
|
-
*
|
|
5
|
-
* -
|
|
6
|
-
*
|
|
3
|
+
* - Its tag, attributes, events, parts, states and texts.
|
|
4
|
+
* The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).
|
|
5
|
+
* - Ours, not Fomantic's (epic `elemental-spell` P31; the outline from epic `from-jarvis` P3).
|
|
6
|
+
* - The source pieces (`source`, `load`, `ui-loaded` ... `ui-error`, the loader and error parts, the states and texts)
|
|
7
|
+
* are shared with `<ui-code>` and `<ui-markdown>`: `UIT.Source*`, which `LoadableComponent` reads.
|
|
7
8
|
* - Its `ui-changed` is its own, with the parsed `value`.
|
|
8
|
-
*
|
|
9
|
+
* - `value` is the DOM element's property (any JSON value): not an attribute.
|
|
10
|
+
* `item`, also a property, sets it from a thing's `data` (a tree's `detail` pane hands it the pick).
|
|
9
11
|
*/
|
|
10
12
|
/****************
|
|
11
13
|
* ### `jsonVocabulary`
|
|
12
|
-
* The names of `<ui-json>`, JSON data held in a page
|
|
14
|
+
* The names of `<ui-json>`, JSON data held in a page and drawn as an outline whose objects and arrays open and close:
|
|
15
|
+
* `<div class="ui json" part="viewer">` holding its header (`part="header"`) and a `<div class="row">` per line.
|
|
13
16
|
****************/
|
|
14
17
|
export declare const jsonVocabulary: {
|
|
15
18
|
readonly tag: "ui-json";
|
|
16
19
|
readonly icon: "code";
|
|
17
20
|
readonly topics: readonly ["data display", "modules"];
|
|
18
|
-
readonly aka: readonly ["data", "data island", "json script", "application/json", "data block", "datos"];
|
|
21
|
+
readonly aka: readonly ["data", "data island", "json script", "application/json", "data block", "json viewer", "json tree", "object inspector", "pretty print", "datos"];
|
|
22
|
+
readonly skeleton: "4 line paragraph";
|
|
19
23
|
readonly noun: "JSON data";
|
|
20
24
|
readonly partOfSpeech: "property";
|
|
21
25
|
readonly description: string;
|
|
@@ -29,6 +33,36 @@ export declare const jsonVocabulary: {
|
|
|
29
33
|
readonly values: readonly ["eager", "visible", "idle"];
|
|
30
34
|
readonly default: "eager";
|
|
31
35
|
readonly description: string;
|
|
36
|
+
}, {
|
|
37
|
+
readonly name: "depth";
|
|
38
|
+
readonly group: "behaviour";
|
|
39
|
+
readonly kind: "number";
|
|
40
|
+
readonly default: 1;
|
|
41
|
+
readonly description: string;
|
|
42
|
+
}, {
|
|
43
|
+
readonly name: "quotes";
|
|
44
|
+
readonly group: "appearance";
|
|
45
|
+
readonly kind: "boolean";
|
|
46
|
+
readonly default: true;
|
|
47
|
+
readonly description: string;
|
|
48
|
+
}, {
|
|
49
|
+
readonly name: "no-header";
|
|
50
|
+
readonly group: "appearance";
|
|
51
|
+
readonly kind: "boolean";
|
|
52
|
+
readonly default: false;
|
|
53
|
+
readonly description: "Hides the header: the Copy and quotes buttons.";
|
|
54
|
+
}, {
|
|
55
|
+
readonly name: "editable";
|
|
56
|
+
readonly group: "behaviour";
|
|
57
|
+
readonly kind: "boolean";
|
|
58
|
+
readonly default: false;
|
|
59
|
+
readonly description: string;
|
|
60
|
+
}, {
|
|
61
|
+
readonly name: "editors";
|
|
62
|
+
readonly group: "behaviour";
|
|
63
|
+
readonly kind: "json";
|
|
64
|
+
readonly reflect: false;
|
|
65
|
+
readonly description: string;
|
|
32
66
|
}];
|
|
33
67
|
readonly events: readonly [{
|
|
34
68
|
readonly name: "ui-loaded";
|
|
@@ -52,9 +86,42 @@ export declare const jsonVocabulary: {
|
|
|
52
86
|
readonly detail: "{ kind: 'load' | 'cross-origin' | 'file-protocol' | 'save' | 'conflict' | 'no-saver' | 'render', source?: string, error: unknown }";
|
|
53
87
|
readonly cancelable: true;
|
|
54
88
|
readonly description: string;
|
|
89
|
+
}, {
|
|
90
|
+
readonly name: "ui-navigating";
|
|
91
|
+
readonly cancelable: true;
|
|
92
|
+
readonly detail: "{ path: (string | number)[], key: string | number | undefined, value: unknown, part: \"key\" | \"value\" }";
|
|
93
|
+
readonly description: string;
|
|
94
|
+
}, {
|
|
95
|
+
readonly name: "ui-copied";
|
|
96
|
+
readonly detail: "{ content: string }";
|
|
97
|
+
readonly description: "The Copy button copied `content`, as JSON.";
|
|
55
98
|
}];
|
|
56
99
|
readonly slots: readonly [];
|
|
57
|
-
readonly parts: readonly [
|
|
100
|
+
readonly parts: readonly [{
|
|
101
|
+
readonly name: "loader";
|
|
102
|
+
readonly description: "The `<ui-loader>` shown while `source` loads.";
|
|
103
|
+
}, {
|
|
104
|
+
readonly name: "error";
|
|
105
|
+
readonly description: "The `<ui-message>` shown when loading or showing failed.";
|
|
106
|
+
}, {
|
|
107
|
+
readonly name: "viewer";
|
|
108
|
+
readonly description: "The box round it all.";
|
|
109
|
+
}, {
|
|
110
|
+
readonly name: "header";
|
|
111
|
+
readonly description: "The bar above the data: Copy, then the quotes button.";
|
|
112
|
+
}, {
|
|
113
|
+
readonly name: "row";
|
|
114
|
+
readonly description: "Each line.";
|
|
115
|
+
}, {
|
|
116
|
+
readonly name: "toggle";
|
|
117
|
+
readonly description: "Each object's or array's open / close button, a chevron in the left gutter; Alt-click: its whole branch.";
|
|
118
|
+
}, {
|
|
119
|
+
readonly name: "preview";
|
|
120
|
+
readonly description: "A closed object or array, on one line.";
|
|
121
|
+
}, {
|
|
122
|
+
readonly name: "editor";
|
|
123
|
+
readonly description: "The control a key or value is edited in (`editable`).";
|
|
124
|
+
}];
|
|
58
125
|
readonly states: readonly [{
|
|
59
126
|
readonly name: "loading";
|
|
60
127
|
readonly description: "Fetching `source`.";
|
|
@@ -68,5 +135,77 @@ export declare const jsonVocabulary: {
|
|
|
68
135
|
readonly name: "dirty";
|
|
69
136
|
readonly description: "`content` changed since it was loaded or saved.";
|
|
70
137
|
}];
|
|
71
|
-
readonly texts: readonly [
|
|
138
|
+
readonly texts: readonly [{
|
|
139
|
+
readonly key: "sourceLoading";
|
|
140
|
+
readonly text: "Loading {source}";
|
|
141
|
+
readonly description: "Accessible name of the loader.";
|
|
142
|
+
}, {
|
|
143
|
+
readonly key: "sourceLoadError";
|
|
144
|
+
readonly text: "Couldn't load {source}.";
|
|
145
|
+
readonly description: "The fetch failed.";
|
|
146
|
+
}, {
|
|
147
|
+
readonly key: "sourceCrossOrigin";
|
|
148
|
+
readonly text: "Can't show {source}: only files from this site can be shown.";
|
|
149
|
+
readonly description: "`source` is on another origin.";
|
|
150
|
+
}, {
|
|
151
|
+
readonly key: "sourceFileProtocol";
|
|
152
|
+
readonly text: "Can't load {source}: this page was opened from disk. Open it from a web server to see it.";
|
|
153
|
+
readonly description: "The page is a `file://` page.";
|
|
154
|
+
}, {
|
|
155
|
+
readonly key: "sourceRenderError";
|
|
156
|
+
readonly text: "Couldn't show {source}.";
|
|
157
|
+
readonly description: "The text arrived, but couldn't be shown.";
|
|
158
|
+
}, {
|
|
159
|
+
readonly key: "jsonCopy";
|
|
160
|
+
readonly text: "Copy JSON";
|
|
161
|
+
readonly description: "The header's Copy button.";
|
|
162
|
+
}, {
|
|
163
|
+
readonly key: "jsonCopied";
|
|
164
|
+
readonly text: "Copied";
|
|
165
|
+
readonly description: "The Copy button, for a moment after it copied.";
|
|
166
|
+
}, {
|
|
167
|
+
readonly key: "jsonQuotes";
|
|
168
|
+
readonly text: "Quotes round keys";
|
|
169
|
+
readonly description: "The quotes button's name (a toggle).";
|
|
170
|
+
}, {
|
|
171
|
+
readonly key: "jsonQuotesOff";
|
|
172
|
+
readonly text: "Hide the quotes round keys";
|
|
173
|
+
readonly description: "The quotes button's tooltip, on.";
|
|
174
|
+
}, {
|
|
175
|
+
readonly key: "jsonQuotesOn";
|
|
176
|
+
readonly text: "Show the quotes round keys";
|
|
177
|
+
readonly description: "The quotes button's tooltip, off.";
|
|
178
|
+
}, {
|
|
179
|
+
readonly key: "jsonEditKey";
|
|
180
|
+
readonly text: "Key";
|
|
181
|
+
readonly description: "The field a key is edited in.";
|
|
182
|
+
}, {
|
|
183
|
+
readonly key: "jsonEditValue";
|
|
184
|
+
readonly text: "Value";
|
|
185
|
+
readonly description: "The control a value is edited in.";
|
|
186
|
+
}, {
|
|
187
|
+
readonly key: "jsonOpen";
|
|
188
|
+
readonly text: "Open {key}";
|
|
189
|
+
readonly description: "A closed object's or array's toggle.";
|
|
190
|
+
}, {
|
|
191
|
+
readonly key: "jsonClose";
|
|
192
|
+
readonly text: "Close {key}";
|
|
193
|
+
readonly description: "An open object's or array's toggle.";
|
|
194
|
+
}, {
|
|
195
|
+
readonly key: "jsonAllInside";
|
|
196
|
+
readonly text: "Alt: everything inside";
|
|
197
|
+
readonly description: "Added to a toggle's tooltip.";
|
|
198
|
+
}, {
|
|
199
|
+
readonly key: "jsonTop";
|
|
200
|
+
readonly text: "the data";
|
|
201
|
+
readonly description: "The top value's name, in its toggle's label.";
|
|
202
|
+
}, {
|
|
203
|
+
readonly key: "jsonEmpty";
|
|
204
|
+
readonly text: "No data";
|
|
205
|
+
readonly description: "Nothing to show: no text, or a `source` still loading.";
|
|
206
|
+
}, {
|
|
207
|
+
readonly key: "jsonInvalid";
|
|
208
|
+
readonly text: "This isn't JSON: {message}";
|
|
209
|
+
readonly description: "The error message when its text isn't JSON; `{message}` is the parser's.";
|
|
210
|
+
}];
|
|
72
211
|
};
|
|
@@ -1,12 +1,43 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `<ui-json>` in Spanish: `<es-json>`, with the names and texts only it uses (from `UIJson.en.ts`).
|
|
3
3
|
* - JSON is JSON in every language.
|
|
4
|
-
* - The names it shares with other
|
|
5
|
-
* in `components.es.ts`, with the values every tag shares.
|
|
4
|
+
* - The names it shares with other tags (`source`, `load`, `editable`, `ui-navigating`, `header`, `row` ...) are
|
|
5
|
+
* translated once, for every tag: in `components.es.ts`, with the values every tag shares.
|
|
6
6
|
*/
|
|
7
7
|
export declare const jsonEs: {
|
|
8
8
|
readonly lang: "es";
|
|
9
9
|
readonly tag: "ui-json";
|
|
10
10
|
readonly name: "json";
|
|
11
|
-
readonly aka: readonly ["datos", "datos json", "isla de datos"];
|
|
11
|
+
readonly aka: readonly ["datos", "datos json", "isla de datos", "visor json", "árbol json", "inspector de objetos"];
|
|
12
|
+
readonly attributes: {
|
|
13
|
+
readonly depth: "profundidad";
|
|
14
|
+
readonly quotes: "comillas";
|
|
15
|
+
readonly "no-header": "sin-encabezado";
|
|
16
|
+
readonly editors: "editores";
|
|
17
|
+
};
|
|
18
|
+
readonly parts: {
|
|
19
|
+
readonly viewer: "visor";
|
|
20
|
+
readonly toggle: "plegador";
|
|
21
|
+
readonly preview: "vista-previa";
|
|
22
|
+
};
|
|
23
|
+
readonly texts: {
|
|
24
|
+
readonly sourceLoading: "Cargando {source}";
|
|
25
|
+
readonly sourceLoadError: "No se pudo cargar {source}.";
|
|
26
|
+
readonly sourceCrossOrigin: "No se puede mostrar {source}: solo se pueden mostrar archivos de este sitio.";
|
|
27
|
+
readonly sourceFileProtocol: "No se puede cargar {source}: esta página se abrió desde el disco. Ábrela desde un servidor web para verla.";
|
|
28
|
+
readonly sourceRenderError: "No se pudo mostrar {source}.";
|
|
29
|
+
readonly jsonCopy: "Copiar JSON";
|
|
30
|
+
readonly jsonCopied: "Copiado";
|
|
31
|
+
readonly jsonQuotes: "Comillas en las claves";
|
|
32
|
+
readonly jsonQuotesOff: "Quitar las comillas de las claves";
|
|
33
|
+
readonly jsonQuotesOn: "Poner comillas en las claves";
|
|
34
|
+
readonly jsonEditKey: "Clave";
|
|
35
|
+
readonly jsonEditValue: "Valor";
|
|
36
|
+
readonly jsonOpen: "Abrir {key}";
|
|
37
|
+
readonly jsonClose: "Cerrar {key}";
|
|
38
|
+
readonly jsonAllInside: "Alt: todo lo de dentro";
|
|
39
|
+
readonly jsonTop: "los datos";
|
|
40
|
+
readonly jsonEmpty: "Sin datos";
|
|
41
|
+
readonly jsonInvalid: "Esto no es JSON: {message}";
|
|
42
|
+
};
|
|
12
43
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { JsonChild } from './JsonChild';
|
|
2
|
-
import { DOMJsonElement, UIJson } from './UIJson';
|
|
3
|
-
export { DOMJsonElement, JsonChild, UIJson };
|
|
2
|
+
import { DOMJsonElement, JSON_EDITOR_KINDS, UIJson, JsonEditorKind, JsonNavigateDetail } from './UIJson';
|
|
3
|
+
export { DOMJsonElement, JSON_EDITOR_KINDS, JsonChild, UIJson, type JsonEditorKind, type JsonNavigateDetail };
|
|
@@ -14,7 +14,8 @@ import { splitPanelVocabulary } from './UISplitPanel.en';
|
|
|
14
14
|
* and its place is its inline `order`, between the bars'. So a running program in one keeps running.
|
|
15
15
|
* - The price: Tab reaches the bars after every pane, not between them.
|
|
16
16
|
* - The sizes aren't remembered here: `ui-changed` hands over `sizes`, to keep and give back as `columns` or `rows`.
|
|
17
|
-
* - Sizes, in `columns` or `rows`: a comma list, one for each pane (`"20
|
|
17
|
+
* - Sizes, in `columns` or `rows`: a comma list, one for each pane (`"20%, *, 380px"`), read by `E.PaneSizes`,
|
|
18
|
+
* as `<ui-tree>` reads its columns' `size`.
|
|
18
19
|
* - a number, `px` or `em`: fixed
|
|
19
20
|
* - `%`: that share of what the fixed panes leave
|
|
20
21
|
* - `*`, or missing: an equal share of the percent left
|
|
@@ -179,14 +180,6 @@ export declare class UISplitPanel extends E.UIComponent<typeof splitPanelVocabul
|
|
|
179
180
|
* - Neither gets smaller than `min-size` (px), and the growing pane keeps `DEFAULT_MIN_SHARE` of the room.
|
|
180
181
|
*/
|
|
181
182
|
private moveBeside;
|
|
182
|
-
/**
|
|
183
|
-
* One `PaneSize` per pane from `spec`, in the form `columns` and `rows` take.
|
|
184
|
-
* - Cut or padded to `count`: a missing or unreadable entry counts as `*`.
|
|
185
|
-
* - `*` entries share the percent the `%` entries leave, equally (at least 1% each).
|
|
186
|
-
*/
|
|
187
|
-
static sizesFor(spec: string, count: number): PaneSize[];
|
|
188
|
-
/** `sizes` in the form `columns` and `rows` take: `"60%,40%"`. */
|
|
189
|
-
static sizeText(sizes: PaneSize[]): string;
|
|
190
183
|
/**
|
|
191
184
|
* The least and most `pane` may be dragged to, px: its own `min-` and `max-height` (`-width` side by side).
|
|
192
185
|
* - Its least: only px count; `auto` is 0.
|
|
@@ -202,10 +195,3 @@ export declare class UISplitPanel extends E.UIComponent<typeof splitPanelVocabul
|
|
|
202
195
|
}
|
|
203
196
|
export interface UISplitPanel extends E.AttributeValues<typeof splitPanelVocabulary> {
|
|
204
197
|
}
|
|
205
|
-
/** One pane's size, e.g. `{ value: 20, units: "%" }`. */
|
|
206
|
-
export type PaneSize = {
|
|
207
|
-
/** How much, in `units`. */
|
|
208
|
-
value: number;
|
|
209
|
-
/** `px`, `em`, `%` or `auto` (its `value` unused). */
|
|
210
|
-
units: string;
|
|
211
|
-
};
|