@glyphjs/components 0.3.0 → 0.5.1

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.d.cts CHANGED
@@ -4,7 +4,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
 
5
5
  interface CalloutData {
6
6
  type: 'info' | 'warning' | 'error' | 'tip';
7
- title?: string;
7
+ title?: string | InlineNode[];
8
8
  content: string | InlineNode[];
9
9
  markdown?: boolean;
10
10
  }
@@ -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
  }
@@ -158,6 +161,8 @@ interface GraphData {
158
161
  nodes: GraphNodeData[];
159
162
  edges: GraphEdgeData[];
160
163
  layout?: 'top-down' | 'left-right' | 'bottom-up' | 'radial' | 'force';
164
+ interactionMode?: 'modifier-key' | 'click-to-activate' | 'always';
165
+ markdown?: boolean;
161
166
  }
162
167
  declare function Graph({ data, block, outgoingRefs, onNavigate, onInteraction, container, }: GlyphComponentProps<GraphData>): ReactElement;
163
168
 
@@ -195,27 +200,29 @@ declare function computeForceLayout(nodes: GraphNode[], edges: GraphEdge[]): Lay
195
200
  declare const graphDefinition: GlyphComponentDefinition<GraphData>;
196
201
 
197
202
  interface Attribute {
198
- name: string;
203
+ name: string | InlineNode[];
199
204
  type: string;
200
205
  primaryKey?: boolean;
201
206
  }
202
207
  interface Entity {
203
208
  id: string;
204
- label: string;
209
+ label: string | InlineNode[];
205
210
  attributes?: Attribute[];
206
211
  }
207
212
  interface Relationship {
208
213
  from: string;
209
214
  to: string;
210
- label?: string;
215
+ label?: string | InlineNode[];
211
216
  cardinality: '1:1' | '1:N' | 'N:1' | 'N:M';
212
217
  }
213
218
  interface RelationData {
214
219
  entities: Entity[];
215
220
  relationships: Relationship[];
216
221
  layout?: 'top-down' | 'left-right';
222
+ interactionMode?: 'modifier-key' | 'click-to-activate' | 'always';
223
+ markdown?: boolean;
217
224
  }
218
- declare function Relation({ data }: GlyphComponentProps<RelationData>): ReactElement;
225
+ declare function Relation({ data, block }: GlyphComponentProps<RelationData>): ReactElement;
219
226
 
220
227
  declare const relationDefinition: GlyphComponentDefinition<RelationData>;
221
228
 
@@ -274,8 +281,9 @@ interface CodeDiffData {
274
281
  language?: string;
275
282
  before: string;
276
283
  after: string;
277
- beforeLabel?: string;
278
- afterLabel?: string;
284
+ beforeLabel?: string | InlineNode[];
285
+ afterLabel?: string | InlineNode[];
286
+ markdown?: boolean;
279
287
  }
280
288
  declare function CodeDiff({ data, block }: GlyphComponentProps<CodeDiffData>): ReactElement;
281
289
 
@@ -299,20 +307,22 @@ type FlowchartNodeType = 'start' | 'end' | 'process' | 'decision';
299
307
  interface FlowchartNodeData {
300
308
  id: string;
301
309
  type: FlowchartNodeType;
302
- label: string;
310
+ label: string | InlineNode[];
303
311
  }
304
312
  interface FlowchartEdgeData {
305
313
  from: string;
306
314
  to: string;
307
- label?: string;
315
+ label?: string | InlineNode[];
308
316
  }
309
317
  interface FlowchartData {
310
- title?: string;
318
+ title?: string | InlineNode[];
311
319
  nodes: FlowchartNodeData[];
312
320
  edges: FlowchartEdgeData[];
313
321
  direction: 'top-down' | 'left-right';
322
+ interactionMode?: 'modifier-key' | 'click-to-activate' | 'always';
323
+ markdown?: boolean;
314
324
  }
315
- declare function Flowchart({ data, container }: GlyphComponentProps<FlowchartData>): ReactElement;
325
+ declare function Flowchart({ data, block, container, }: GlyphComponentProps<FlowchartData>): ReactElement;
316
326
 
317
327
  declare const flowchartDefinition: GlyphComponentDefinition<FlowchartData>;
318
328
 
@@ -333,18 +343,19 @@ declare const fileTreeDefinition: GlyphComponentDefinition<FileTreeData>;
333
343
  type MessageType = 'message' | 'reply' | 'self';
334
344
  interface Actor {
335
345
  id: string;
336
- label: string;
346
+ label: string | InlineNode[];
337
347
  }
338
348
  interface Message {
339
349
  from: string;
340
350
  to: string;
341
- label: string;
351
+ label: string | InlineNode[];
342
352
  type: MessageType;
343
353
  }
344
354
  interface SequenceData {
345
- title?: string;
355
+ title?: string | InlineNode[];
346
356
  actors: Actor[];
347
357
  messages: Message[];
358
+ markdown?: boolean;
348
359
  }
349
360
  declare function Sequence({ data, container }: GlyphComponentProps<SequenceData>): ReactElement;
350
361
 
@@ -429,12 +440,13 @@ declare const mindMapDefinition: GlyphComponentDefinition<MindMapData>;
429
440
 
430
441
  interface EquationStep {
431
442
  expression: string;
432
- annotation?: string;
443
+ annotation?: string | InlineNode[];
433
444
  }
434
445
  interface EquationData {
435
446
  expression?: string;
436
- label?: string;
447
+ label?: string | InlineNode[];
437
448
  steps?: EquationStep[];
449
+ markdown?: boolean;
438
450
  }
439
451
  declare function Equation({ data }: GlyphComponentProps<EquationData>): ReactElement;
440
452
 
@@ -692,8 +704,8 @@ declare const formDefinition: GlyphComponentDefinition<FormData>;
692
704
 
693
705
  interface KanbanCard {
694
706
  id: string;
695
- title: string;
696
- description?: string;
707
+ title: string | InlineNode[];
708
+ description?: string | InlineNode[];
697
709
  priority?: 'high' | 'medium' | 'low';
698
710
  tags?: string[];
699
711
  }
@@ -706,6 +718,7 @@ interface KanbanColumn {
706
718
  interface KanbanData {
707
719
  title?: string;
708
720
  columns: KanbanColumn[];
721
+ markdown?: boolean;
709
722
  }
710
723
  declare function Kanban({ data, block, onInteraction, }: GlyphComponentProps<KanbanData>): ReactElement;
711
724
 
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
 
5
5
  interface CalloutData {
6
6
  type: 'info' | 'warning' | 'error' | 'tip';
7
- title?: string;
7
+ title?: string | InlineNode[];
8
8
  content: string | InlineNode[];
9
9
  markdown?: boolean;
10
10
  }
@@ -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
  }
@@ -158,6 +161,8 @@ interface GraphData {
158
161
  nodes: GraphNodeData[];
159
162
  edges: GraphEdgeData[];
160
163
  layout?: 'top-down' | 'left-right' | 'bottom-up' | 'radial' | 'force';
164
+ interactionMode?: 'modifier-key' | 'click-to-activate' | 'always';
165
+ markdown?: boolean;
161
166
  }
162
167
  declare function Graph({ data, block, outgoingRefs, onNavigate, onInteraction, container, }: GlyphComponentProps<GraphData>): ReactElement;
163
168
 
@@ -195,27 +200,29 @@ declare function computeForceLayout(nodes: GraphNode[], edges: GraphEdge[]): Lay
195
200
  declare const graphDefinition: GlyphComponentDefinition<GraphData>;
196
201
 
197
202
  interface Attribute {
198
- name: string;
203
+ name: string | InlineNode[];
199
204
  type: string;
200
205
  primaryKey?: boolean;
201
206
  }
202
207
  interface Entity {
203
208
  id: string;
204
- label: string;
209
+ label: string | InlineNode[];
205
210
  attributes?: Attribute[];
206
211
  }
207
212
  interface Relationship {
208
213
  from: string;
209
214
  to: string;
210
- label?: string;
215
+ label?: string | InlineNode[];
211
216
  cardinality: '1:1' | '1:N' | 'N:1' | 'N:M';
212
217
  }
213
218
  interface RelationData {
214
219
  entities: Entity[];
215
220
  relationships: Relationship[];
216
221
  layout?: 'top-down' | 'left-right';
222
+ interactionMode?: 'modifier-key' | 'click-to-activate' | 'always';
223
+ markdown?: boolean;
217
224
  }
218
- declare function Relation({ data }: GlyphComponentProps<RelationData>): ReactElement;
225
+ declare function Relation({ data, block }: GlyphComponentProps<RelationData>): ReactElement;
219
226
 
220
227
  declare const relationDefinition: GlyphComponentDefinition<RelationData>;
221
228
 
@@ -274,8 +281,9 @@ interface CodeDiffData {
274
281
  language?: string;
275
282
  before: string;
276
283
  after: string;
277
- beforeLabel?: string;
278
- afterLabel?: string;
284
+ beforeLabel?: string | InlineNode[];
285
+ afterLabel?: string | InlineNode[];
286
+ markdown?: boolean;
279
287
  }
280
288
  declare function CodeDiff({ data, block }: GlyphComponentProps<CodeDiffData>): ReactElement;
281
289
 
@@ -299,20 +307,22 @@ type FlowchartNodeType = 'start' | 'end' | 'process' | 'decision';
299
307
  interface FlowchartNodeData {
300
308
  id: string;
301
309
  type: FlowchartNodeType;
302
- label: string;
310
+ label: string | InlineNode[];
303
311
  }
304
312
  interface FlowchartEdgeData {
305
313
  from: string;
306
314
  to: string;
307
- label?: string;
315
+ label?: string | InlineNode[];
308
316
  }
309
317
  interface FlowchartData {
310
- title?: string;
318
+ title?: string | InlineNode[];
311
319
  nodes: FlowchartNodeData[];
312
320
  edges: FlowchartEdgeData[];
313
321
  direction: 'top-down' | 'left-right';
322
+ interactionMode?: 'modifier-key' | 'click-to-activate' | 'always';
323
+ markdown?: boolean;
314
324
  }
315
- declare function Flowchart({ data, container }: GlyphComponentProps<FlowchartData>): ReactElement;
325
+ declare function Flowchart({ data, block, container, }: GlyphComponentProps<FlowchartData>): ReactElement;
316
326
 
317
327
  declare const flowchartDefinition: GlyphComponentDefinition<FlowchartData>;
318
328
 
@@ -333,18 +343,19 @@ declare const fileTreeDefinition: GlyphComponentDefinition<FileTreeData>;
333
343
  type MessageType = 'message' | 'reply' | 'self';
334
344
  interface Actor {
335
345
  id: string;
336
- label: string;
346
+ label: string | InlineNode[];
337
347
  }
338
348
  interface Message {
339
349
  from: string;
340
350
  to: string;
341
- label: string;
351
+ label: string | InlineNode[];
342
352
  type: MessageType;
343
353
  }
344
354
  interface SequenceData {
345
- title?: string;
355
+ title?: string | InlineNode[];
346
356
  actors: Actor[];
347
357
  messages: Message[];
358
+ markdown?: boolean;
348
359
  }
349
360
  declare function Sequence({ data, container }: GlyphComponentProps<SequenceData>): ReactElement;
350
361
 
@@ -429,12 +440,13 @@ declare const mindMapDefinition: GlyphComponentDefinition<MindMapData>;
429
440
 
430
441
  interface EquationStep {
431
442
  expression: string;
432
- annotation?: string;
443
+ annotation?: string | InlineNode[];
433
444
  }
434
445
  interface EquationData {
435
446
  expression?: string;
436
- label?: string;
447
+ label?: string | InlineNode[];
437
448
  steps?: EquationStep[];
449
+ markdown?: boolean;
438
450
  }
439
451
  declare function Equation({ data }: GlyphComponentProps<EquationData>): ReactElement;
440
452
 
@@ -692,8 +704,8 @@ declare const formDefinition: GlyphComponentDefinition<FormData>;
692
704
 
693
705
  interface KanbanCard {
694
706
  id: string;
695
- title: string;
696
- description?: string;
707
+ title: string | InlineNode[];
708
+ description?: string | InlineNode[];
697
709
  priority?: 'high' | 'medium' | 'low';
698
710
  tags?: string[];
699
711
  }
@@ -706,6 +718,7 @@ interface KanbanColumn {
706
718
  interface KanbanData {
707
719
  title?: string;
708
720
  columns: KanbanColumn[];
721
+ markdown?: boolean;
709
722
  }
710
723
  declare function Kanban({ data, block, onInteraction, }: GlyphComponentProps<KanbanData>): ReactElement;
711
724