@glyphjs/components 0.4.0 → 0.6.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/index.cjs +296 -140
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -24
- package/dist/index.d.ts +36 -24
- package/dist/index.js +296 -140
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -22,18 +22,19 @@ declare const calloutDefinition: GlyphComponentDefinition<CalloutData>;
|
|
|
22
22
|
interface ChartData {
|
|
23
23
|
type: 'line' | 'bar' | 'area' | 'ohlc';
|
|
24
24
|
series: {
|
|
25
|
-
name: string;
|
|
25
|
+
name: string | InlineNode[];
|
|
26
26
|
data: DataRecord[];
|
|
27
27
|
}[];
|
|
28
28
|
xAxis?: {
|
|
29
29
|
key: string;
|
|
30
|
-
label?: string;
|
|
30
|
+
label?: string | InlineNode[];
|
|
31
31
|
};
|
|
32
32
|
yAxis?: {
|
|
33
33
|
key: string;
|
|
34
|
-
label?: string;
|
|
34
|
+
label?: string | InlineNode[];
|
|
35
35
|
};
|
|
36
36
|
legend?: boolean;
|
|
37
|
+
markdown?: boolean;
|
|
37
38
|
}
|
|
38
39
|
type DataRecord = Record<string, number | string>;
|
|
39
40
|
|
|
@@ -71,7 +72,7 @@ declare const stepsDefinition: GlyphComponentDefinition<StepsData>;
|
|
|
71
72
|
|
|
72
73
|
interface TableColumn {
|
|
73
74
|
key: string;
|
|
74
|
-
label: string;
|
|
75
|
+
label: string | InlineNode[];
|
|
75
76
|
sortable?: boolean;
|
|
76
77
|
filterable?: boolean;
|
|
77
78
|
type?: 'string' | 'number' | 'date' | 'boolean';
|
|
@@ -84,6 +85,7 @@ interface TableData {
|
|
|
84
85
|
columns: TableColumn[];
|
|
85
86
|
rows: Record<string, unknown>[];
|
|
86
87
|
aggregation?: TableAggregation[];
|
|
88
|
+
markdown?: boolean;
|
|
87
89
|
}
|
|
88
90
|
/**
|
|
89
91
|
* Renders an interactive data table with optional sorting, filtering,
|
|
@@ -97,9 +99,10 @@ declare const tableDefinition: GlyphComponentDefinition<TableData>;
|
|
|
97
99
|
/** Shape of the validated `data` for a `ui:tabs` block. */
|
|
98
100
|
interface TabsData {
|
|
99
101
|
tabs: {
|
|
100
|
-
label: string;
|
|
101
|
-
content: string;
|
|
102
|
+
label: string | InlineNode[];
|
|
103
|
+
content: string | InlineNode[];
|
|
102
104
|
}[];
|
|
105
|
+
markdown?: boolean;
|
|
103
106
|
}
|
|
104
107
|
/**
|
|
105
108
|
* `ui:tabs` component.
|
|
@@ -141,7 +144,7 @@ declare const timelineDefinition: GlyphComponentDefinition<TimelineData>;
|
|
|
141
144
|
|
|
142
145
|
interface GraphNodeData {
|
|
143
146
|
id: string;
|
|
144
|
-
label: string;
|
|
147
|
+
label: string | InlineNode[];
|
|
145
148
|
type?: string;
|
|
146
149
|
style?: Record<string, string>;
|
|
147
150
|
group?: string;
|
|
@@ -149,7 +152,7 @@ interface GraphNodeData {
|
|
|
149
152
|
interface GraphEdgeData {
|
|
150
153
|
from: string;
|
|
151
154
|
to: string;
|
|
152
|
-
label?: string;
|
|
155
|
+
label?: string | InlineNode[];
|
|
153
156
|
type?: string;
|
|
154
157
|
style?: Record<string, string>;
|
|
155
158
|
}
|
|
@@ -159,6 +162,7 @@ interface GraphData {
|
|
|
159
162
|
edges: GraphEdgeData[];
|
|
160
163
|
layout?: 'top-down' | 'left-right' | 'bottom-up' | 'radial' | 'force';
|
|
161
164
|
interactionMode?: 'modifier-key' | 'click-to-activate' | 'always';
|
|
165
|
+
markdown?: boolean;
|
|
162
166
|
}
|
|
163
167
|
declare function Graph({ data, block, outgoingRefs, onNavigate, onInteraction, container, }: GlyphComponentProps<GraphData>): ReactElement;
|
|
164
168
|
|
|
@@ -196,19 +200,19 @@ declare function computeForceLayout(nodes: GraphNode[], edges: GraphEdge[]): Lay
|
|
|
196
200
|
declare const graphDefinition: GlyphComponentDefinition<GraphData>;
|
|
197
201
|
|
|
198
202
|
interface Attribute {
|
|
199
|
-
name: string;
|
|
203
|
+
name: string | InlineNode[];
|
|
200
204
|
type: string;
|
|
201
205
|
primaryKey?: boolean;
|
|
202
206
|
}
|
|
203
207
|
interface Entity {
|
|
204
208
|
id: string;
|
|
205
|
-
label: string;
|
|
209
|
+
label: string | InlineNode[];
|
|
206
210
|
attributes?: Attribute[];
|
|
207
211
|
}
|
|
208
212
|
interface Relationship {
|
|
209
213
|
from: string;
|
|
210
214
|
to: string;
|
|
211
|
-
label?: string;
|
|
215
|
+
label?: string | InlineNode[];
|
|
212
216
|
cardinality: '1:1' | '1:N' | 'N:1' | 'N:M';
|
|
213
217
|
}
|
|
214
218
|
interface RelationData {
|
|
@@ -216,6 +220,7 @@ interface RelationData {
|
|
|
216
220
|
relationships: Relationship[];
|
|
217
221
|
layout?: 'top-down' | 'left-right';
|
|
218
222
|
interactionMode?: 'modifier-key' | 'click-to-activate' | 'always';
|
|
223
|
+
markdown?: boolean;
|
|
219
224
|
}
|
|
220
225
|
declare function Relation({ data, block }: GlyphComponentProps<RelationData>): ReactElement;
|
|
221
226
|
|
|
@@ -276,8 +281,9 @@ interface CodeDiffData {
|
|
|
276
281
|
language?: string;
|
|
277
282
|
before: string;
|
|
278
283
|
after: string;
|
|
279
|
-
beforeLabel?: string;
|
|
280
|
-
afterLabel?: string;
|
|
284
|
+
beforeLabel?: string | InlineNode[];
|
|
285
|
+
afterLabel?: string | InlineNode[];
|
|
286
|
+
markdown?: boolean;
|
|
281
287
|
}
|
|
282
288
|
declare function CodeDiff({ data, block }: GlyphComponentProps<CodeDiffData>): ReactElement;
|
|
283
289
|
|
|
@@ -301,19 +307,20 @@ type FlowchartNodeType = 'start' | 'end' | 'process' | 'decision';
|
|
|
301
307
|
interface FlowchartNodeData {
|
|
302
308
|
id: string;
|
|
303
309
|
type: FlowchartNodeType;
|
|
304
|
-
label: string;
|
|
310
|
+
label: string | InlineNode[];
|
|
305
311
|
}
|
|
306
312
|
interface FlowchartEdgeData {
|
|
307
313
|
from: string;
|
|
308
314
|
to: string;
|
|
309
|
-
label?: string;
|
|
315
|
+
label?: string | InlineNode[];
|
|
310
316
|
}
|
|
311
317
|
interface FlowchartData {
|
|
312
|
-
title?: string;
|
|
318
|
+
title?: string | InlineNode[];
|
|
313
319
|
nodes: FlowchartNodeData[];
|
|
314
320
|
edges: FlowchartEdgeData[];
|
|
315
321
|
direction: 'top-down' | 'left-right';
|
|
316
322
|
interactionMode?: 'modifier-key' | 'click-to-activate' | 'always';
|
|
323
|
+
markdown?: boolean;
|
|
317
324
|
}
|
|
318
325
|
declare function Flowchart({ data, block, container, }: GlyphComponentProps<FlowchartData>): ReactElement;
|
|
319
326
|
|
|
@@ -336,18 +343,19 @@ declare const fileTreeDefinition: GlyphComponentDefinition<FileTreeData>;
|
|
|
336
343
|
type MessageType = 'message' | 'reply' | 'self';
|
|
337
344
|
interface Actor {
|
|
338
345
|
id: string;
|
|
339
|
-
label: string;
|
|
346
|
+
label: string | InlineNode[];
|
|
340
347
|
}
|
|
341
348
|
interface Message {
|
|
342
349
|
from: string;
|
|
343
350
|
to: string;
|
|
344
|
-
label: string;
|
|
351
|
+
label: string | InlineNode[];
|
|
345
352
|
type: MessageType;
|
|
346
353
|
}
|
|
347
354
|
interface SequenceData {
|
|
348
|
-
title?: string;
|
|
355
|
+
title?: string | InlineNode[];
|
|
349
356
|
actors: Actor[];
|
|
350
357
|
messages: Message[];
|
|
358
|
+
markdown?: boolean;
|
|
351
359
|
}
|
|
352
360
|
declare function Sequence({ data, container }: GlyphComponentProps<SequenceData>): ReactElement;
|
|
353
361
|
|
|
@@ -373,6 +381,8 @@ interface ArchitectureData {
|
|
|
373
381
|
children: ArchitectureNode[];
|
|
374
382
|
edges: ArchitectureEdge[];
|
|
375
383
|
layout?: 'top-down' | 'left-right' | 'bottom-up';
|
|
384
|
+
interactionMode?: 'modifier-key' | 'click-to-activate' | 'always';
|
|
385
|
+
showZoomControls?: boolean;
|
|
376
386
|
}
|
|
377
387
|
interface PositionedArchNode {
|
|
378
388
|
id: string;
|
|
@@ -413,7 +423,7 @@ interface ArchitectureLayout {
|
|
|
413
423
|
}
|
|
414
424
|
declare function computeArchitectureLayout(data: ArchitectureData): Promise<ArchitectureLayout>;
|
|
415
425
|
|
|
416
|
-
declare function Architecture({ data, container, }: GlyphComponentProps<ArchitectureData>): ReactElement;
|
|
426
|
+
declare function Architecture({ data, container, block, }: GlyphComponentProps<ArchitectureData>): ReactElement;
|
|
417
427
|
|
|
418
428
|
declare const architectureDefinition: GlyphComponentDefinition<ArchitectureData>;
|
|
419
429
|
|
|
@@ -432,12 +442,13 @@ declare const mindMapDefinition: GlyphComponentDefinition<MindMapData>;
|
|
|
432
442
|
|
|
433
443
|
interface EquationStep {
|
|
434
444
|
expression: string;
|
|
435
|
-
annotation?: string;
|
|
445
|
+
annotation?: string | InlineNode[];
|
|
436
446
|
}
|
|
437
447
|
interface EquationData {
|
|
438
448
|
expression?: string;
|
|
439
|
-
label?: string;
|
|
449
|
+
label?: string | InlineNode[];
|
|
440
450
|
steps?: EquationStep[];
|
|
451
|
+
markdown?: boolean;
|
|
441
452
|
}
|
|
442
453
|
declare function Equation({ data }: GlyphComponentProps<EquationData>): ReactElement;
|
|
443
454
|
|
|
@@ -695,8 +706,8 @@ declare const formDefinition: GlyphComponentDefinition<FormData>;
|
|
|
695
706
|
|
|
696
707
|
interface KanbanCard {
|
|
697
708
|
id: string;
|
|
698
|
-
title: string;
|
|
699
|
-
description?: string;
|
|
709
|
+
title: string | InlineNode[];
|
|
710
|
+
description?: string | InlineNode[];
|
|
700
711
|
priority?: 'high' | 'medium' | 'low';
|
|
701
712
|
tags?: string[];
|
|
702
713
|
}
|
|
@@ -709,6 +720,7 @@ interface KanbanColumn {
|
|
|
709
720
|
interface KanbanData {
|
|
710
721
|
title?: string;
|
|
711
722
|
columns: KanbanColumn[];
|
|
723
|
+
markdown?: boolean;
|
|
712
724
|
}
|
|
713
725
|
declare function Kanban({ data, block, onInteraction, }: GlyphComponentProps<KanbanData>): ReactElement;
|
|
714
726
|
|
package/dist/index.d.ts
CHANGED
|
@@ -22,18 +22,19 @@ declare const calloutDefinition: GlyphComponentDefinition<CalloutData>;
|
|
|
22
22
|
interface ChartData {
|
|
23
23
|
type: 'line' | 'bar' | 'area' | 'ohlc';
|
|
24
24
|
series: {
|
|
25
|
-
name: string;
|
|
25
|
+
name: string | InlineNode[];
|
|
26
26
|
data: DataRecord[];
|
|
27
27
|
}[];
|
|
28
28
|
xAxis?: {
|
|
29
29
|
key: string;
|
|
30
|
-
label?: string;
|
|
30
|
+
label?: string | InlineNode[];
|
|
31
31
|
};
|
|
32
32
|
yAxis?: {
|
|
33
33
|
key: string;
|
|
34
|
-
label?: string;
|
|
34
|
+
label?: string | InlineNode[];
|
|
35
35
|
};
|
|
36
36
|
legend?: boolean;
|
|
37
|
+
markdown?: boolean;
|
|
37
38
|
}
|
|
38
39
|
type DataRecord = Record<string, number | string>;
|
|
39
40
|
|
|
@@ -71,7 +72,7 @@ declare const stepsDefinition: GlyphComponentDefinition<StepsData>;
|
|
|
71
72
|
|
|
72
73
|
interface TableColumn {
|
|
73
74
|
key: string;
|
|
74
|
-
label: string;
|
|
75
|
+
label: string | InlineNode[];
|
|
75
76
|
sortable?: boolean;
|
|
76
77
|
filterable?: boolean;
|
|
77
78
|
type?: 'string' | 'number' | 'date' | 'boolean';
|
|
@@ -84,6 +85,7 @@ interface TableData {
|
|
|
84
85
|
columns: TableColumn[];
|
|
85
86
|
rows: Record<string, unknown>[];
|
|
86
87
|
aggregation?: TableAggregation[];
|
|
88
|
+
markdown?: boolean;
|
|
87
89
|
}
|
|
88
90
|
/**
|
|
89
91
|
* Renders an interactive data table with optional sorting, filtering,
|
|
@@ -97,9 +99,10 @@ declare const tableDefinition: GlyphComponentDefinition<TableData>;
|
|
|
97
99
|
/** Shape of the validated `data` for a `ui:tabs` block. */
|
|
98
100
|
interface TabsData {
|
|
99
101
|
tabs: {
|
|
100
|
-
label: string;
|
|
101
|
-
content: string;
|
|
102
|
+
label: string | InlineNode[];
|
|
103
|
+
content: string | InlineNode[];
|
|
102
104
|
}[];
|
|
105
|
+
markdown?: boolean;
|
|
103
106
|
}
|
|
104
107
|
/**
|
|
105
108
|
* `ui:tabs` component.
|
|
@@ -141,7 +144,7 @@ declare const timelineDefinition: GlyphComponentDefinition<TimelineData>;
|
|
|
141
144
|
|
|
142
145
|
interface GraphNodeData {
|
|
143
146
|
id: string;
|
|
144
|
-
label: string;
|
|
147
|
+
label: string | InlineNode[];
|
|
145
148
|
type?: string;
|
|
146
149
|
style?: Record<string, string>;
|
|
147
150
|
group?: string;
|
|
@@ -149,7 +152,7 @@ interface GraphNodeData {
|
|
|
149
152
|
interface GraphEdgeData {
|
|
150
153
|
from: string;
|
|
151
154
|
to: string;
|
|
152
|
-
label?: string;
|
|
155
|
+
label?: string | InlineNode[];
|
|
153
156
|
type?: string;
|
|
154
157
|
style?: Record<string, string>;
|
|
155
158
|
}
|
|
@@ -159,6 +162,7 @@ interface GraphData {
|
|
|
159
162
|
edges: GraphEdgeData[];
|
|
160
163
|
layout?: 'top-down' | 'left-right' | 'bottom-up' | 'radial' | 'force';
|
|
161
164
|
interactionMode?: 'modifier-key' | 'click-to-activate' | 'always';
|
|
165
|
+
markdown?: boolean;
|
|
162
166
|
}
|
|
163
167
|
declare function Graph({ data, block, outgoingRefs, onNavigate, onInteraction, container, }: GlyphComponentProps<GraphData>): ReactElement;
|
|
164
168
|
|
|
@@ -196,19 +200,19 @@ declare function computeForceLayout(nodes: GraphNode[], edges: GraphEdge[]): Lay
|
|
|
196
200
|
declare const graphDefinition: GlyphComponentDefinition<GraphData>;
|
|
197
201
|
|
|
198
202
|
interface Attribute {
|
|
199
|
-
name: string;
|
|
203
|
+
name: string | InlineNode[];
|
|
200
204
|
type: string;
|
|
201
205
|
primaryKey?: boolean;
|
|
202
206
|
}
|
|
203
207
|
interface Entity {
|
|
204
208
|
id: string;
|
|
205
|
-
label: string;
|
|
209
|
+
label: string | InlineNode[];
|
|
206
210
|
attributes?: Attribute[];
|
|
207
211
|
}
|
|
208
212
|
interface Relationship {
|
|
209
213
|
from: string;
|
|
210
214
|
to: string;
|
|
211
|
-
label?: string;
|
|
215
|
+
label?: string | InlineNode[];
|
|
212
216
|
cardinality: '1:1' | '1:N' | 'N:1' | 'N:M';
|
|
213
217
|
}
|
|
214
218
|
interface RelationData {
|
|
@@ -216,6 +220,7 @@ interface RelationData {
|
|
|
216
220
|
relationships: Relationship[];
|
|
217
221
|
layout?: 'top-down' | 'left-right';
|
|
218
222
|
interactionMode?: 'modifier-key' | 'click-to-activate' | 'always';
|
|
223
|
+
markdown?: boolean;
|
|
219
224
|
}
|
|
220
225
|
declare function Relation({ data, block }: GlyphComponentProps<RelationData>): ReactElement;
|
|
221
226
|
|
|
@@ -276,8 +281,9 @@ interface CodeDiffData {
|
|
|
276
281
|
language?: string;
|
|
277
282
|
before: string;
|
|
278
283
|
after: string;
|
|
279
|
-
beforeLabel?: string;
|
|
280
|
-
afterLabel?: string;
|
|
284
|
+
beforeLabel?: string | InlineNode[];
|
|
285
|
+
afterLabel?: string | InlineNode[];
|
|
286
|
+
markdown?: boolean;
|
|
281
287
|
}
|
|
282
288
|
declare function CodeDiff({ data, block }: GlyphComponentProps<CodeDiffData>): ReactElement;
|
|
283
289
|
|
|
@@ -301,19 +307,20 @@ type FlowchartNodeType = 'start' | 'end' | 'process' | 'decision';
|
|
|
301
307
|
interface FlowchartNodeData {
|
|
302
308
|
id: string;
|
|
303
309
|
type: FlowchartNodeType;
|
|
304
|
-
label: string;
|
|
310
|
+
label: string | InlineNode[];
|
|
305
311
|
}
|
|
306
312
|
interface FlowchartEdgeData {
|
|
307
313
|
from: string;
|
|
308
314
|
to: string;
|
|
309
|
-
label?: string;
|
|
315
|
+
label?: string | InlineNode[];
|
|
310
316
|
}
|
|
311
317
|
interface FlowchartData {
|
|
312
|
-
title?: string;
|
|
318
|
+
title?: string | InlineNode[];
|
|
313
319
|
nodes: FlowchartNodeData[];
|
|
314
320
|
edges: FlowchartEdgeData[];
|
|
315
321
|
direction: 'top-down' | 'left-right';
|
|
316
322
|
interactionMode?: 'modifier-key' | 'click-to-activate' | 'always';
|
|
323
|
+
markdown?: boolean;
|
|
317
324
|
}
|
|
318
325
|
declare function Flowchart({ data, block, container, }: GlyphComponentProps<FlowchartData>): ReactElement;
|
|
319
326
|
|
|
@@ -336,18 +343,19 @@ declare const fileTreeDefinition: GlyphComponentDefinition<FileTreeData>;
|
|
|
336
343
|
type MessageType = 'message' | 'reply' | 'self';
|
|
337
344
|
interface Actor {
|
|
338
345
|
id: string;
|
|
339
|
-
label: string;
|
|
346
|
+
label: string | InlineNode[];
|
|
340
347
|
}
|
|
341
348
|
interface Message {
|
|
342
349
|
from: string;
|
|
343
350
|
to: string;
|
|
344
|
-
label: string;
|
|
351
|
+
label: string | InlineNode[];
|
|
345
352
|
type: MessageType;
|
|
346
353
|
}
|
|
347
354
|
interface SequenceData {
|
|
348
|
-
title?: string;
|
|
355
|
+
title?: string | InlineNode[];
|
|
349
356
|
actors: Actor[];
|
|
350
357
|
messages: Message[];
|
|
358
|
+
markdown?: boolean;
|
|
351
359
|
}
|
|
352
360
|
declare function Sequence({ data, container }: GlyphComponentProps<SequenceData>): ReactElement;
|
|
353
361
|
|
|
@@ -373,6 +381,8 @@ interface ArchitectureData {
|
|
|
373
381
|
children: ArchitectureNode[];
|
|
374
382
|
edges: ArchitectureEdge[];
|
|
375
383
|
layout?: 'top-down' | 'left-right' | 'bottom-up';
|
|
384
|
+
interactionMode?: 'modifier-key' | 'click-to-activate' | 'always';
|
|
385
|
+
showZoomControls?: boolean;
|
|
376
386
|
}
|
|
377
387
|
interface PositionedArchNode {
|
|
378
388
|
id: string;
|
|
@@ -413,7 +423,7 @@ interface ArchitectureLayout {
|
|
|
413
423
|
}
|
|
414
424
|
declare function computeArchitectureLayout(data: ArchitectureData): Promise<ArchitectureLayout>;
|
|
415
425
|
|
|
416
|
-
declare function Architecture({ data, container, }: GlyphComponentProps<ArchitectureData>): ReactElement;
|
|
426
|
+
declare function Architecture({ data, container, block, }: GlyphComponentProps<ArchitectureData>): ReactElement;
|
|
417
427
|
|
|
418
428
|
declare const architectureDefinition: GlyphComponentDefinition<ArchitectureData>;
|
|
419
429
|
|
|
@@ -432,12 +442,13 @@ declare const mindMapDefinition: GlyphComponentDefinition<MindMapData>;
|
|
|
432
442
|
|
|
433
443
|
interface EquationStep {
|
|
434
444
|
expression: string;
|
|
435
|
-
annotation?: string;
|
|
445
|
+
annotation?: string | InlineNode[];
|
|
436
446
|
}
|
|
437
447
|
interface EquationData {
|
|
438
448
|
expression?: string;
|
|
439
|
-
label?: string;
|
|
449
|
+
label?: string | InlineNode[];
|
|
440
450
|
steps?: EquationStep[];
|
|
451
|
+
markdown?: boolean;
|
|
441
452
|
}
|
|
442
453
|
declare function Equation({ data }: GlyphComponentProps<EquationData>): ReactElement;
|
|
443
454
|
|
|
@@ -695,8 +706,8 @@ declare const formDefinition: GlyphComponentDefinition<FormData>;
|
|
|
695
706
|
|
|
696
707
|
interface KanbanCard {
|
|
697
708
|
id: string;
|
|
698
|
-
title: string;
|
|
699
|
-
description?: string;
|
|
709
|
+
title: string | InlineNode[];
|
|
710
|
+
description?: string | InlineNode[];
|
|
700
711
|
priority?: 'high' | 'medium' | 'low';
|
|
701
712
|
tags?: string[];
|
|
702
713
|
}
|
|
@@ -709,6 +720,7 @@ interface KanbanColumn {
|
|
|
709
720
|
interface KanbanData {
|
|
710
721
|
title?: string;
|
|
711
722
|
columns: KanbanColumn[];
|
|
723
|
+
markdown?: boolean;
|
|
712
724
|
}
|
|
713
725
|
declare function Kanban({ data, block, onInteraction, }: GlyphComponentProps<KanbanData>): ReactElement;
|
|
714
726
|
|