@elaraai/e3-ui 1.0.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/CLA.md +26 -0
- package/CONTRIBUTING.md +28 -0
- package/LICENSE.md +31 -0
- package/README.md +149 -0
- package/dist/src/buttons.d.ts +2 -0
- package/dist/src/buttons.d.ts.map +1 -0
- package/dist/src/buttons.js +2 -0
- package/dist/src/buttons.js.map +1 -0
- package/dist/src/data.d.ts +241 -0
- package/dist/src/data.d.ts.map +1 -0
- package/dist/src/data.js +195 -0
- package/dist/src/data.js.map +1 -0
- package/dist/src/derive.d.ts +33 -0
- package/dist/src/derive.d.ts.map +1 -0
- package/dist/src/derive.js +64 -0
- package/dist/src/derive.js.map +1 -0
- package/dist/src/diff.d.ts +335 -0
- package/dist/src/diff.d.ts.map +1 -0
- package/dist/src/diff.js +197 -0
- package/dist/src/diff.js.map +1 -0
- package/dist/src/index.d.ts +25 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +25 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/manifest.d.ts +27 -0
- package/dist/src/manifest.d.ts.map +1 -0
- package/dist/src/manifest.js +29 -0
- package/dist/src/manifest.js.map +1 -0
- package/dist/src/ontology.d.ts +517 -0
- package/dist/src/ontology.d.ts.map +1 -0
- package/dist/src/ontology.js +311 -0
- package/dist/src/ontology.js.map +1 -0
- package/dist/src/ui.d.ts +57 -0
- package/dist/src/ui.d.ts.map +1 -0
- package/dist/src/ui.js +72 -0
- package/dist/src/ui.js.map +1 -0
- package/dist/src/utils.d.ts +21 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/src/utils.js +24 -0
- package/dist/src/utils.js.map +1 -0
- package/dist/test/data.examples.d.ts +20 -0
- package/dist/test/data.examples.d.ts.map +1 -0
- package/dist/test/data.examples.js +156 -0
- package/dist/test/data.examples.js.map +1 -0
- package/dist/test/diff.examples.d.ts +138 -0
- package/dist/test/diff.examples.d.ts.map +1 -0
- package/dist/test/diff.examples.js +964 -0
- package/dist/test/diff.examples.js.map +1 -0
- package/dist/test/ontology.examples.d.ts +412 -0
- package/dist/test/ontology.examples.d.ts.map +1 -0
- package/dist/test/ontology.examples.js +298 -0
- package/dist/test/ontology.examples.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Ontology component — graph editor for an `OntologyType`-bound dataset.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* The Ontology card surfaces a ReactFlow-driven node/link graph editor over
|
|
10
|
+
* the value of a single {@link Data.bind} binding whose source dataset is
|
|
11
|
+
* typed as {@link OntologyType}. Mutations (add / delete / reconnect /
|
|
12
|
+
* update node) write the whole next-ontology back through `binding.write`,
|
|
13
|
+
* so the same staged-buffer + commit / discard / merge machinery that
|
|
14
|
+
* powers `Diff` is reused unchanged.
|
|
15
|
+
*
|
|
16
|
+
* Declared via the `EastUI.component` extension API — the React renderer
|
|
17
|
+
* lives in `@elaraai/e3-ui-components` and is wired via
|
|
18
|
+
* `implementUIComponent(OntologyComponent, EastChakraOntology)` at module
|
|
19
|
+
* load time.
|
|
20
|
+
*
|
|
21
|
+
* @packageDocumentation
|
|
22
|
+
*/
|
|
23
|
+
import { NullType, StringType, DateTimeType, BooleanType, ArrayType, StructType, VariantType, OptionType, FunctionType, type ExprType, type SubtypeExprOrValue } from '@elaraai/east';
|
|
24
|
+
import { DensityType, type DensityLiteral, type UIComponentType } from '@elaraai/east-ui';
|
|
25
|
+
import { DiffBindingType } from './data.js';
|
|
26
|
+
/**
|
|
27
|
+
* Discriminator for the kind of business element a node represents.
|
|
28
|
+
*
|
|
29
|
+
* @property process - A unit of execution / activity.
|
|
30
|
+
* @property resource - A consumable or capacity tracked by the business.
|
|
31
|
+
* @property kpi - A measurable indicator.
|
|
32
|
+
* @property decision - A point at which the business chooses among options.
|
|
33
|
+
* @property data - A dataset or signal flowing through the business.
|
|
34
|
+
* @property objective - A strategic goal the business pursues.
|
|
35
|
+
* @property policy - A rule constraining other elements.
|
|
36
|
+
* @property document - Reference material — a procedure, contract, spec.
|
|
37
|
+
* @property computation - A derived quantity / model output.
|
|
38
|
+
* @property group - A visual container for related nodes (no semantics).
|
|
39
|
+
*/
|
|
40
|
+
export declare const NodeKindType: VariantType<{
|
|
41
|
+
readonly process: NullType;
|
|
42
|
+
readonly resource: NullType;
|
|
43
|
+
readonly kpi: NullType;
|
|
44
|
+
readonly decision: NullType;
|
|
45
|
+
readonly data: NullType;
|
|
46
|
+
readonly objective: NullType;
|
|
47
|
+
readonly policy: NullType;
|
|
48
|
+
readonly document: NullType;
|
|
49
|
+
readonly computation: NullType;
|
|
50
|
+
readonly group: NullType;
|
|
51
|
+
}>;
|
|
52
|
+
/** Type alias for {@link NodeKindType}. */
|
|
53
|
+
export type NodeKindType = typeof NodeKindType;
|
|
54
|
+
/**
|
|
55
|
+
* Discriminator for the relationship semantics between two nodes.
|
|
56
|
+
*
|
|
57
|
+
* @property uses - Source uses target as input.
|
|
58
|
+
* @property produces - Source produces target as output.
|
|
59
|
+
* @property results_in - Source's outcome culminates in target.
|
|
60
|
+
* @property gets_data_from - Source reads data from target.
|
|
61
|
+
* @property inserts_data_into - Source writes data into target.
|
|
62
|
+
* @property informs - Source provides context that shapes target.
|
|
63
|
+
* @property drives - Source motivates / triggers target.
|
|
64
|
+
* @property constrains - Source limits the behaviour of target.
|
|
65
|
+
* @property defines - Source specifies the definition of target.
|
|
66
|
+
* @property executes - Source carries out target.
|
|
67
|
+
* @property references - Source points at target for documentation.
|
|
68
|
+
* @property validates - Source checks target for correctness.
|
|
69
|
+
* @property measures - Source quantifies target.
|
|
70
|
+
* @property simulates - Source models target.
|
|
71
|
+
* @property contains - Source visually groups target (for `group` nodes).
|
|
72
|
+
* @property used_by - Inverse of `uses`.
|
|
73
|
+
*/
|
|
74
|
+
export declare const LinkKindType: VariantType<{
|
|
75
|
+
readonly uses: NullType;
|
|
76
|
+
readonly produces: NullType;
|
|
77
|
+
readonly results_in: NullType;
|
|
78
|
+
readonly gets_data_from: NullType;
|
|
79
|
+
readonly inserts_data_into: NullType;
|
|
80
|
+
readonly informs: NullType;
|
|
81
|
+
readonly drives: NullType;
|
|
82
|
+
readonly constrains: NullType;
|
|
83
|
+
readonly defines: NullType;
|
|
84
|
+
readonly executes: NullType;
|
|
85
|
+
readonly references: NullType;
|
|
86
|
+
readonly validates: NullType;
|
|
87
|
+
readonly measures: NullType;
|
|
88
|
+
readonly simulates: NullType;
|
|
89
|
+
readonly contains: NullType;
|
|
90
|
+
readonly used_by: NullType;
|
|
91
|
+
}>;
|
|
92
|
+
/** Type alias for {@link LinkKindType}. */
|
|
93
|
+
export type LinkKindType = typeof LinkKindType;
|
|
94
|
+
/**
|
|
95
|
+
* A directed relationship between two nodes.
|
|
96
|
+
*
|
|
97
|
+
* @property id - Stable identifier for the link.
|
|
98
|
+
* @property source - `id` of the source node.
|
|
99
|
+
* @property target - `id` of the target node.
|
|
100
|
+
* @property type - The relationship semantics — see {@link LinkKindType}.
|
|
101
|
+
*/
|
|
102
|
+
export declare const LinkType: StructType<{
|
|
103
|
+
readonly id: StringType;
|
|
104
|
+
readonly source: StringType;
|
|
105
|
+
readonly target: StringType;
|
|
106
|
+
readonly type: VariantType<{
|
|
107
|
+
readonly uses: NullType;
|
|
108
|
+
readonly produces: NullType;
|
|
109
|
+
readonly results_in: NullType;
|
|
110
|
+
readonly gets_data_from: NullType;
|
|
111
|
+
readonly inserts_data_into: NullType;
|
|
112
|
+
readonly informs: NullType;
|
|
113
|
+
readonly drives: NullType;
|
|
114
|
+
readonly constrains: NullType;
|
|
115
|
+
readonly defines: NullType;
|
|
116
|
+
readonly executes: NullType;
|
|
117
|
+
readonly references: NullType;
|
|
118
|
+
readonly validates: NullType;
|
|
119
|
+
readonly measures: NullType;
|
|
120
|
+
readonly simulates: NullType;
|
|
121
|
+
readonly contains: NullType;
|
|
122
|
+
readonly used_by: NullType;
|
|
123
|
+
}>;
|
|
124
|
+
}>;
|
|
125
|
+
/** Type alias for {@link LinkType}. */
|
|
126
|
+
export type LinkType = typeof LinkType;
|
|
127
|
+
/**
|
|
128
|
+
* A node in the ontology graph.
|
|
129
|
+
*
|
|
130
|
+
* @property id - Stable identifier for the node.
|
|
131
|
+
* @property name - Display name.
|
|
132
|
+
* @property description - Optional long-form description.
|
|
133
|
+
* @property type - Discriminator — see {@link NodeKindType}.
|
|
134
|
+
*/
|
|
135
|
+
export declare const NodeType: StructType<{
|
|
136
|
+
readonly id: StringType;
|
|
137
|
+
readonly name: StringType;
|
|
138
|
+
readonly description: OptionType<StringType>;
|
|
139
|
+
readonly type: VariantType<{
|
|
140
|
+
readonly process: NullType;
|
|
141
|
+
readonly resource: NullType;
|
|
142
|
+
readonly kpi: NullType;
|
|
143
|
+
readonly decision: NullType;
|
|
144
|
+
readonly data: NullType;
|
|
145
|
+
readonly objective: NullType;
|
|
146
|
+
readonly policy: NullType;
|
|
147
|
+
readonly document: NullType;
|
|
148
|
+
readonly computation: NullType;
|
|
149
|
+
readonly group: NullType;
|
|
150
|
+
}>;
|
|
151
|
+
}>;
|
|
152
|
+
/** Type alias for {@link NodeType}. */
|
|
153
|
+
export type NodeType = typeof NodeType;
|
|
154
|
+
/**
|
|
155
|
+
* Versioning + provenance metadata attached to an ontology value.
|
|
156
|
+
*
|
|
157
|
+
* @property version - Semver string identifying the schema revision.
|
|
158
|
+
* @property created - Timestamp when this ontology was first written.
|
|
159
|
+
* @property updated - Timestamp of the most recent edit.
|
|
160
|
+
* @property description - Optional caption shown beside the editor header.
|
|
161
|
+
*/
|
|
162
|
+
export declare const OntologyMetadataType: StructType<{
|
|
163
|
+
readonly version: StringType;
|
|
164
|
+
readonly created: DateTimeType;
|
|
165
|
+
readonly updated: DateTimeType;
|
|
166
|
+
readonly description: OptionType<StringType>;
|
|
167
|
+
}>;
|
|
168
|
+
/** Type alias for {@link OntologyMetadataType}. */
|
|
169
|
+
export type OntologyMetadataType = typeof OntologyMetadataType;
|
|
170
|
+
/**
|
|
171
|
+
* The full ontology value carried by an `OntologyType`-typed dataset.
|
|
172
|
+
*
|
|
173
|
+
* @property nodes - Every node in the graph.
|
|
174
|
+
* @property links - Every relationship between nodes. Each link's `source`
|
|
175
|
+
* and `target` must match a node's `id`; orphaned links are surfaced as
|
|
176
|
+
* warnings in the editor.
|
|
177
|
+
* @property metadata - Optional versioning + provenance metadata.
|
|
178
|
+
*/
|
|
179
|
+
export declare const OntologyType: StructType<{
|
|
180
|
+
readonly nodes: ArrayType<StructType<{
|
|
181
|
+
readonly id: StringType;
|
|
182
|
+
readonly name: StringType;
|
|
183
|
+
readonly description: OptionType<StringType>;
|
|
184
|
+
readonly type: VariantType<{
|
|
185
|
+
readonly process: NullType;
|
|
186
|
+
readonly resource: NullType;
|
|
187
|
+
readonly kpi: NullType;
|
|
188
|
+
readonly decision: NullType;
|
|
189
|
+
readonly data: NullType;
|
|
190
|
+
readonly objective: NullType;
|
|
191
|
+
readonly policy: NullType;
|
|
192
|
+
readonly document: NullType;
|
|
193
|
+
readonly computation: NullType;
|
|
194
|
+
readonly group: NullType;
|
|
195
|
+
}>;
|
|
196
|
+
}>>;
|
|
197
|
+
readonly links: ArrayType<StructType<{
|
|
198
|
+
readonly id: StringType;
|
|
199
|
+
readonly source: StringType;
|
|
200
|
+
readonly target: StringType;
|
|
201
|
+
readonly type: VariantType<{
|
|
202
|
+
readonly uses: NullType;
|
|
203
|
+
readonly produces: NullType;
|
|
204
|
+
readonly results_in: NullType;
|
|
205
|
+
readonly gets_data_from: NullType;
|
|
206
|
+
readonly inserts_data_into: NullType;
|
|
207
|
+
readonly informs: NullType;
|
|
208
|
+
readonly drives: NullType;
|
|
209
|
+
readonly constrains: NullType;
|
|
210
|
+
readonly defines: NullType;
|
|
211
|
+
readonly executes: NullType;
|
|
212
|
+
readonly references: NullType;
|
|
213
|
+
readonly validates: NullType;
|
|
214
|
+
readonly measures: NullType;
|
|
215
|
+
readonly simulates: NullType;
|
|
216
|
+
readonly contains: NullType;
|
|
217
|
+
readonly used_by: NullType;
|
|
218
|
+
}>;
|
|
219
|
+
}>>;
|
|
220
|
+
readonly metadata: OptionType<StructType<{
|
|
221
|
+
readonly version: StringType;
|
|
222
|
+
readonly created: DateTimeType;
|
|
223
|
+
readonly updated: DateTimeType;
|
|
224
|
+
readonly description: OptionType<StringType>;
|
|
225
|
+
}>>;
|
|
226
|
+
}>;
|
|
227
|
+
/** Type alias for {@link OntologyType}. */
|
|
228
|
+
export type OntologyType = typeof OntologyType;
|
|
229
|
+
/**
|
|
230
|
+
* Visual style escape hatches for the Ontology editor. Every visible surface
|
|
231
|
+
* is tokenable; defaults come from the host's design system (Elara AI bsys
|
|
232
|
+
* tokens — see the renderer in `@elaraai/e3-ui-components`).
|
|
233
|
+
*
|
|
234
|
+
* @property nodeBackground - Card background for non-selected nodes.
|
|
235
|
+
* @property nodeBorderColor - Card border colour for non-selected nodes.
|
|
236
|
+
* @property nodeSelectedBackground - Card background when a node is
|
|
237
|
+
* focused / selected.
|
|
238
|
+
* @property nodeSelectedBorderColor - Card border colour when a node is
|
|
239
|
+
* focused / selected.
|
|
240
|
+
* @property nodeAccentColor - Default colour for the 2px top stripe when no
|
|
241
|
+
* kind-specific accent is defined. Per-kind accents come from the
|
|
242
|
+
* renderer's bsys palette and are not exposed here.
|
|
243
|
+
* @property edgeColor - Default stroke for edges.
|
|
244
|
+
* @property edgeEmphasizedColor - Stroke for edges in the hover / selected /
|
|
245
|
+
* focused states.
|
|
246
|
+
* @property labelBackground - Background for edge label pills.
|
|
247
|
+
* @property labelBorderColor - Border for edge label pills.
|
|
248
|
+
* @property panelBackground - Background for the outer editor frame.
|
|
249
|
+
* @property panelBorderColor - Border for the outer editor frame.
|
|
250
|
+
* @property headerBackground - Background for the eyebrow header strip.
|
|
251
|
+
* @property footerBackground - Background for the commit-bar footer.
|
|
252
|
+
* @property gridColor - Canvas grid line colour (major + minor).
|
|
253
|
+
* @property minimapMaskColor - Mask colour for the off-screen region in
|
|
254
|
+
* the minimap.
|
|
255
|
+
*/
|
|
256
|
+
export declare const OntologyStyleType: StructType<{
|
|
257
|
+
readonly nodeBackground: OptionType<StringType>;
|
|
258
|
+
readonly nodeBorderColor: OptionType<StringType>;
|
|
259
|
+
readonly nodeSelectedBackground: OptionType<StringType>;
|
|
260
|
+
readonly nodeSelectedBorderColor: OptionType<StringType>;
|
|
261
|
+
readonly nodeAccentColor: OptionType<StringType>;
|
|
262
|
+
readonly edgeColor: OptionType<StringType>;
|
|
263
|
+
readonly edgeEmphasizedColor: OptionType<StringType>;
|
|
264
|
+
readonly labelBackground: OptionType<StringType>;
|
|
265
|
+
readonly labelBorderColor: OptionType<StringType>;
|
|
266
|
+
readonly panelBackground: OptionType<StringType>;
|
|
267
|
+
readonly panelBorderColor: OptionType<StringType>;
|
|
268
|
+
readonly headerBackground: OptionType<StringType>;
|
|
269
|
+
readonly footerBackground: OptionType<StringType>;
|
|
270
|
+
readonly gridColor: OptionType<StringType>;
|
|
271
|
+
readonly minimapMaskColor: OptionType<StringType>;
|
|
272
|
+
}>;
|
|
273
|
+
/** Type alias for {@link OntologyStyleType}. */
|
|
274
|
+
export type OntologyStyleType = typeof OntologyStyleType;
|
|
275
|
+
/** Re-exported from {@link Data}; see {@link DiffBindingType}. */
|
|
276
|
+
export { DiffBindingType } from './data.js';
|
|
277
|
+
/**
|
|
278
|
+
* Schema for the `Ontology` extension component. Internal IR shape — the
|
|
279
|
+
* developer-facing factory `Ontology.Root` accepts a {@link Data.bind}
|
|
280
|
+
* handle's `binding` field and forwards it as `binding`.
|
|
281
|
+
*
|
|
282
|
+
* @property binding - The binding the editor reads + writes. The
|
|
283
|
+
* underlying source dataset must be typed as {@link OntologyType};
|
|
284
|
+
* this is a developer-side contract (the IR carrier itself is type-erased).
|
|
285
|
+
* @property readonly - Render without per-node / per-link mutation
|
|
286
|
+
* surfaces. The footer commit-bar and the property drawer still render
|
|
287
|
+
* but Save / Delete / Add-node are hidden, and the canvas blocks
|
|
288
|
+
* drag-handles + context menus. Default `false`.
|
|
289
|
+
* @property hideMiniMap - Suppress the minimap overlay. None ⇒ false.
|
|
290
|
+
* @property hideSearch - Suppress the search field in the toolbar.
|
|
291
|
+
* None ⇒ false.
|
|
292
|
+
* @property density - Information-density preset (`comfortable` | `compact`
|
|
293
|
+
* | `condensed`). Defaults to `comfortable`.
|
|
294
|
+
* @property onCommitted - Fired after a successful commit (the bound
|
|
295
|
+
* dataset has been updated).
|
|
296
|
+
* @property onDiscarded - Fired after a successful discard (the staging
|
|
297
|
+
* buffer was dropped).
|
|
298
|
+
* @property style - Visual style escape hatches — see
|
|
299
|
+
* {@link OntologyStyleType}.
|
|
300
|
+
*/
|
|
301
|
+
export declare const OntologyPayloadType: StructType<{
|
|
302
|
+
readonly binding: StructType<{
|
|
303
|
+
readonly source: ArrayType<VariantType<{
|
|
304
|
+
readonly field: StringType;
|
|
305
|
+
}>>;
|
|
306
|
+
readonly patch: OptionType<ArrayType<VariantType<{
|
|
307
|
+
readonly field: StringType;
|
|
308
|
+
}>>>;
|
|
309
|
+
readonly mode: VariantType<{
|
|
310
|
+
readonly staged: NullType;
|
|
311
|
+
readonly direct: NullType;
|
|
312
|
+
}>;
|
|
313
|
+
}>;
|
|
314
|
+
readonly readonly: OptionType<BooleanType>;
|
|
315
|
+
readonly hideMiniMap: OptionType<BooleanType>;
|
|
316
|
+
readonly hideSearch: OptionType<BooleanType>;
|
|
317
|
+
readonly density: OptionType<VariantType<{
|
|
318
|
+
readonly comfortable: NullType;
|
|
319
|
+
readonly compact: NullType;
|
|
320
|
+
readonly condensed: NullType;
|
|
321
|
+
}>>;
|
|
322
|
+
readonly onCommitted: OptionType<FunctionType<[], NullType>>;
|
|
323
|
+
readonly onDiscarded: OptionType<FunctionType<[], NullType>>;
|
|
324
|
+
readonly style: OptionType<StructType<{
|
|
325
|
+
readonly nodeBackground: OptionType<StringType>;
|
|
326
|
+
readonly nodeBorderColor: OptionType<StringType>;
|
|
327
|
+
readonly nodeSelectedBackground: OptionType<StringType>;
|
|
328
|
+
readonly nodeSelectedBorderColor: OptionType<StringType>;
|
|
329
|
+
readonly nodeAccentColor: OptionType<StringType>;
|
|
330
|
+
readonly edgeColor: OptionType<StringType>;
|
|
331
|
+
readonly edgeEmphasizedColor: OptionType<StringType>;
|
|
332
|
+
readonly labelBackground: OptionType<StringType>;
|
|
333
|
+
readonly labelBorderColor: OptionType<StringType>;
|
|
334
|
+
readonly panelBackground: OptionType<StringType>;
|
|
335
|
+
readonly panelBorderColor: OptionType<StringType>;
|
|
336
|
+
readonly headerBackground: OptionType<StringType>;
|
|
337
|
+
readonly footerBackground: OptionType<StringType>;
|
|
338
|
+
readonly gridColor: OptionType<StringType>;
|
|
339
|
+
readonly minimapMaskColor: OptionType<StringType>;
|
|
340
|
+
}>>;
|
|
341
|
+
}>;
|
|
342
|
+
/** Type alias for {@link OntologyPayloadType}. */
|
|
343
|
+
export type OntologyPayloadType = typeof OntologyPayloadType;
|
|
344
|
+
/**
|
|
345
|
+
* Internal `EastUI.component` carrier. Renderers register against this in
|
|
346
|
+
* `@elaraai/e3-ui-components`. Most callers should use {@link Ontology.Root}
|
|
347
|
+
* (which wraps this with the handle-friendly API) rather than touching
|
|
348
|
+
* `OntologyComponent` directly.
|
|
349
|
+
*/
|
|
350
|
+
export declare const OntologyComponent: import("@elaraai/east-ui").UIComponentDef<StructType<{
|
|
351
|
+
readonly binding: StructType<{
|
|
352
|
+
readonly source: ArrayType<VariantType<{
|
|
353
|
+
readonly field: StringType;
|
|
354
|
+
}>>;
|
|
355
|
+
readonly patch: OptionType<ArrayType<VariantType<{
|
|
356
|
+
readonly field: StringType;
|
|
357
|
+
}>>>;
|
|
358
|
+
readonly mode: VariantType<{
|
|
359
|
+
readonly staged: NullType;
|
|
360
|
+
readonly direct: NullType;
|
|
361
|
+
}>;
|
|
362
|
+
}>;
|
|
363
|
+
readonly readonly: OptionType<BooleanType>;
|
|
364
|
+
readonly hideMiniMap: OptionType<BooleanType>;
|
|
365
|
+
readonly hideSearch: OptionType<BooleanType>;
|
|
366
|
+
readonly density: OptionType<VariantType<{
|
|
367
|
+
readonly comfortable: NullType;
|
|
368
|
+
readonly compact: NullType;
|
|
369
|
+
readonly condensed: NullType;
|
|
370
|
+
}>>;
|
|
371
|
+
readonly onCommitted: OptionType<FunctionType<[], NullType>>;
|
|
372
|
+
readonly onDiscarded: OptionType<FunctionType<[], NullType>>;
|
|
373
|
+
readonly style: OptionType<StructType<{
|
|
374
|
+
readonly nodeBackground: OptionType<StringType>;
|
|
375
|
+
readonly nodeBorderColor: OptionType<StringType>;
|
|
376
|
+
readonly nodeSelectedBackground: OptionType<StringType>;
|
|
377
|
+
readonly nodeSelectedBorderColor: OptionType<StringType>;
|
|
378
|
+
readonly nodeAccentColor: OptionType<StringType>;
|
|
379
|
+
readonly edgeColor: OptionType<StringType>;
|
|
380
|
+
readonly edgeEmphasizedColor: OptionType<StringType>;
|
|
381
|
+
readonly labelBackground: OptionType<StringType>;
|
|
382
|
+
readonly labelBorderColor: OptionType<StringType>;
|
|
383
|
+
readonly panelBackground: OptionType<StringType>;
|
|
384
|
+
readonly panelBorderColor: OptionType<StringType>;
|
|
385
|
+
readonly headerBackground: OptionType<StringType>;
|
|
386
|
+
readonly footerBackground: OptionType<StringType>;
|
|
387
|
+
readonly gridColor: OptionType<StringType>;
|
|
388
|
+
readonly minimapMaskColor: OptionType<StringType>;
|
|
389
|
+
}>>;
|
|
390
|
+
}>>;
|
|
391
|
+
/**
|
|
392
|
+
* Options for {@link Ontology.Root}.
|
|
393
|
+
*
|
|
394
|
+
* @property binding - The binding to surface. Pass `view.binding` from a
|
|
395
|
+
* {@link Data.bind} handle whose source dataset is typed as
|
|
396
|
+
* {@link OntologyType}, or hand-build a descriptor of shape
|
|
397
|
+
* {@link DiffBindingType}.
|
|
398
|
+
* @property readonly - Render without mutation surfaces. The footer
|
|
399
|
+
* commit-bar and property drawer still render. Defaults to false.
|
|
400
|
+
* @property hideMiniMap - Suppress the minimap overlay. Defaults to false.
|
|
401
|
+
* @property hideSearch - Suppress the search field. Defaults to false.
|
|
402
|
+
* @property density - Information-density preset (`comfortable` | `compact`
|
|
403
|
+
* | `condensed`). Defaults to `comfortable`.
|
|
404
|
+
* @property onCommitted - Fired after a successful commit.
|
|
405
|
+
* @property onDiscarded - Fired after a successful discard.
|
|
406
|
+
* @property style - Visual style escape hatches — see
|
|
407
|
+
* {@link OntologyStyleType}.
|
|
408
|
+
*/
|
|
409
|
+
export interface OntologyOptions {
|
|
410
|
+
/** Binding to surface. Typically `view.binding`. */
|
|
411
|
+
binding: SubtypeExprOrValue<DiffBindingType>;
|
|
412
|
+
/** Render without mutation surfaces. Defaults to false. */
|
|
413
|
+
readonly?: SubtypeExprOrValue<OptionType<BooleanType>>;
|
|
414
|
+
/** Suppress the minimap overlay. Defaults to false. */
|
|
415
|
+
hideMiniMap?: SubtypeExprOrValue<OptionType<BooleanType>>;
|
|
416
|
+
/** Suppress the search field. Defaults to false. */
|
|
417
|
+
hideSearch?: SubtypeExprOrValue<OptionType<BooleanType>>;
|
|
418
|
+
/** Information-density preset. */
|
|
419
|
+
density?: SubtypeExprOrValue<OptionType<DensityType>> | DensityLiteral;
|
|
420
|
+
/** Fired after a successful commit (the bound dataset is updated). */
|
|
421
|
+
onCommitted?: SubtypeExprOrValue<OptionType<FunctionType<[], NullType>>>;
|
|
422
|
+
/** Fired after a successful discard (the staging buffer was dropped). */
|
|
423
|
+
onDiscarded?: SubtypeExprOrValue<OptionType<FunctionType<[], NullType>>>;
|
|
424
|
+
/** Visual style escape hatches — see {@link OntologyStyleType}. */
|
|
425
|
+
style?: SubtypeExprOrValue<OptionType<OntologyStyleType>>;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* The Ontology component namespace. Surfaces a graph editor over an
|
|
429
|
+
* `OntologyType`-bound dataset, with the same staged-buffer + merge-aware
|
|
430
|
+
* commit pipeline that powers {@link Diff}.
|
|
431
|
+
*
|
|
432
|
+
* @remarks
|
|
433
|
+
* Use `Ontology.Root({ binding: view.binding })` to render the editor.
|
|
434
|
+
* The `Component` property is the internal {@link EastUI.component}
|
|
435
|
+
* carrier that renderers register against — most callers shouldn't need
|
|
436
|
+
* it.
|
|
437
|
+
*/
|
|
438
|
+
export declare const Ontology: {
|
|
439
|
+
/**
|
|
440
|
+
* Build an Ontology editor. Renders the bound graph as a ReactFlow
|
|
441
|
+
* canvas with node/link mutation surfaces wired through the binding.
|
|
442
|
+
*
|
|
443
|
+
* @param options - {@link OntologyOptions}. Only `binding` is required;
|
|
444
|
+
* the rest default to absent / interactive.
|
|
445
|
+
* @returns An East expression of {@link UIComponentType} representing
|
|
446
|
+
* the Ontology editor.
|
|
447
|
+
*
|
|
448
|
+
* @example
|
|
449
|
+
* ```ts
|
|
450
|
+
* import { East } from '@elaraai/east';
|
|
451
|
+
* import { Reactive, UIComponentType } from '@elaraai/east-ui';
|
|
452
|
+
* import { Data, Ontology, OntologyType } from '@elaraai/e3-ui';
|
|
453
|
+
* import * as e3 from '@elaraai/e3';
|
|
454
|
+
*
|
|
455
|
+
* const ontologyInput = e3.input('supply_chain', OntologyType, {
|
|
456
|
+
* nodes: [], links: [], metadata: { type: 'none', value: null },
|
|
457
|
+
* });
|
|
458
|
+
*
|
|
459
|
+
* const editor = East.function([], UIComponentType, (_$) =>
|
|
460
|
+
* Reactive.Root(East.function([], UIComponentType, $ => {
|
|
461
|
+
* const view = $.let(Data.bind([OntologyType], ontologyInput.path));
|
|
462
|
+
* return Ontology.Root({ binding: view.binding });
|
|
463
|
+
* })),
|
|
464
|
+
* );
|
|
465
|
+
* ```
|
|
466
|
+
*/
|
|
467
|
+
readonly Root: (options: OntologyOptions) => ExprType<UIComponentType>;
|
|
468
|
+
/**
|
|
469
|
+
* The internal {@link EastUI.component} carrier. Renderers register
|
|
470
|
+
* against this in `@elaraai/e3-ui-components` via
|
|
471
|
+
* `implementUIComponent(Ontology.Component, EastChakraOntology)`.
|
|
472
|
+
* Most callers should use {@link Ontology.Root} (the handle-friendly
|
|
473
|
+
* factory) and never touch this directly.
|
|
474
|
+
*/
|
|
475
|
+
readonly Component: import("@elaraai/east-ui").UIComponentDef<StructType<{
|
|
476
|
+
readonly binding: StructType<{
|
|
477
|
+
readonly source: ArrayType<VariantType<{
|
|
478
|
+
readonly field: StringType;
|
|
479
|
+
}>>;
|
|
480
|
+
readonly patch: OptionType<ArrayType<VariantType<{
|
|
481
|
+
readonly field: StringType;
|
|
482
|
+
}>>>;
|
|
483
|
+
readonly mode: VariantType<{
|
|
484
|
+
readonly staged: NullType;
|
|
485
|
+
readonly direct: NullType;
|
|
486
|
+
}>;
|
|
487
|
+
}>;
|
|
488
|
+
readonly readonly: OptionType<BooleanType>;
|
|
489
|
+
readonly hideMiniMap: OptionType<BooleanType>;
|
|
490
|
+
readonly hideSearch: OptionType<BooleanType>;
|
|
491
|
+
readonly density: OptionType<VariantType<{
|
|
492
|
+
readonly comfortable: NullType;
|
|
493
|
+
readonly compact: NullType;
|
|
494
|
+
readonly condensed: NullType;
|
|
495
|
+
}>>;
|
|
496
|
+
readonly onCommitted: OptionType<FunctionType<[], NullType>>;
|
|
497
|
+
readonly onDiscarded: OptionType<FunctionType<[], NullType>>;
|
|
498
|
+
readonly style: OptionType<StructType<{
|
|
499
|
+
readonly nodeBackground: OptionType<StringType>;
|
|
500
|
+
readonly nodeBorderColor: OptionType<StringType>;
|
|
501
|
+
readonly nodeSelectedBackground: OptionType<StringType>;
|
|
502
|
+
readonly nodeSelectedBorderColor: OptionType<StringType>;
|
|
503
|
+
readonly nodeAccentColor: OptionType<StringType>;
|
|
504
|
+
readonly edgeColor: OptionType<StringType>;
|
|
505
|
+
readonly edgeEmphasizedColor: OptionType<StringType>;
|
|
506
|
+
readonly labelBackground: OptionType<StringType>;
|
|
507
|
+
readonly labelBorderColor: OptionType<StringType>;
|
|
508
|
+
readonly panelBackground: OptionType<StringType>;
|
|
509
|
+
readonly panelBorderColor: OptionType<StringType>;
|
|
510
|
+
readonly headerBackground: OptionType<StringType>;
|
|
511
|
+
readonly footerBackground: OptionType<StringType>;
|
|
512
|
+
readonly gridColor: OptionType<StringType>;
|
|
513
|
+
readonly minimapMaskColor: OptionType<StringType>;
|
|
514
|
+
}>>;
|
|
515
|
+
}>>;
|
|
516
|
+
};
|
|
517
|
+
//# sourceMappingURL=ontology.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ontology.d.ts","sourceRoot":"","sources":["../../src/ontology.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAEH,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,WAAW,EACX,SAAS,EACT,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,EAIZ,KAAK,QAAQ,EACb,KAAK,kBAAkB,EAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAU,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAElG,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAM5C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;EAWvB,CAAC;AACH,2CAA2C;AAC3C,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;EAiBvB,CAAC;AACH,2CAA2C;AAC3C,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC;AAE/C;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;EAKnB,CAAC;AACH,uCAAuC;AACvC,MAAM,MAAM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