@rs-x/react-components 1.0.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/LICENSE +21 -0
- package/dist/chunk-CCEWV2BR.js +39 -0
- package/dist/dist-DTEPJKCA.js +737 -0
- package/dist/index.css +1692 -0
- package/dist/index.d.ts +586 -0
- package/dist/index.js +21298 -0
- package/package.json +74 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
import React$1, { CSSProperties, JSX, ReactNode } from 'react';
|
|
2
|
+
import * as _rs_x_expression_parser from '@rs-x/expression-parser';
|
|
3
|
+
import { IExpression, IExpressionChangeHistory, IExpressionChangeTracker } from '@rs-x/expression-parser';
|
|
4
|
+
import { OnMount, Monaco as Monaco$1 } from '@monaco-editor/react';
|
|
5
|
+
import * as Monaco from 'monaco-editor';
|
|
6
|
+
import * as rxjs from 'rxjs';
|
|
7
|
+
import * as operators from 'rxjs/operators';
|
|
8
|
+
|
|
9
|
+
interface IChangeHistoryPanel {
|
|
10
|
+
version: number;
|
|
11
|
+
canClearSelectedHistory: boolean;
|
|
12
|
+
modelIndex: number;
|
|
13
|
+
expressionIndex: number;
|
|
14
|
+
changeHistoryIndex: number;
|
|
15
|
+
expression: IExpression;
|
|
16
|
+
changeHistory: IExpressionChangeHistory[][];
|
|
17
|
+
onClearSelectedHistory?: () => void;
|
|
18
|
+
onHistoryChanged?: (modelIndex: number, expressionIndex: any, changes: IExpressionChangeHistory[][]) => void;
|
|
19
|
+
onSelectionChanged?: (modelIndex: number, expressionIndex: number, selectedChangeSetIndex: number, items: IExpressionChangeHistory[], replay: boolean) => void;
|
|
20
|
+
}
|
|
21
|
+
declare const ChangeHistoryPanel: React$1.FC<IChangeHistoryPanel>;
|
|
22
|
+
|
|
23
|
+
interface ICodeViewerProps {
|
|
24
|
+
code: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
containerClassName?: string;
|
|
28
|
+
codeClassName?: string;
|
|
29
|
+
actionsClassName?: string;
|
|
30
|
+
toggleButtonClassName?: string;
|
|
31
|
+
collapsedLineCount?: number;
|
|
32
|
+
expandable?: boolean;
|
|
33
|
+
expandLabel?: string;
|
|
34
|
+
collapseLabel?: string;
|
|
35
|
+
}
|
|
36
|
+
declare const CodeViewer: React$1.FC<ICodeViewerProps>;
|
|
37
|
+
|
|
38
|
+
type SortDirection = 'asc' | 'desc';
|
|
39
|
+
type Accessor<TData> = keyof TData | ((row: TData) => unknown);
|
|
40
|
+
interface IDataTableColumn<TData> {
|
|
41
|
+
id: string;
|
|
42
|
+
header: React$1.ReactNode;
|
|
43
|
+
accessor?: Accessor<TData>;
|
|
44
|
+
renderCell?: (row: TData) => React$1.ReactNode;
|
|
45
|
+
sortAccessor?: (row: TData) => unknown;
|
|
46
|
+
filterAccessor?: (row: TData) => unknown;
|
|
47
|
+
sortable?: boolean;
|
|
48
|
+
searchable?: boolean;
|
|
49
|
+
headerClassName?: string;
|
|
50
|
+
cellClassName?: string;
|
|
51
|
+
}
|
|
52
|
+
interface IDataTableProps<TData> {
|
|
53
|
+
rows: readonly TData[];
|
|
54
|
+
columns: readonly IDataTableColumn<TData>[];
|
|
55
|
+
getRowKey: (row: TData, index: number) => React$1.Key;
|
|
56
|
+
initialSortColumnId?: string;
|
|
57
|
+
initialSortDirection?: SortDirection;
|
|
58
|
+
enableFilter?: boolean;
|
|
59
|
+
filterLabel?: string;
|
|
60
|
+
filterPlaceholder?: string;
|
|
61
|
+
hideFilterLabel?: boolean;
|
|
62
|
+
emptyMessage?: React$1.ReactNode;
|
|
63
|
+
className?: string;
|
|
64
|
+
controlsClassName?: string;
|
|
65
|
+
filterLabelClassName?: string;
|
|
66
|
+
filterInputClassName?: string;
|
|
67
|
+
tableWrapClassName?: string;
|
|
68
|
+
tableClassName?: string;
|
|
69
|
+
sortButtonClassName?: string;
|
|
70
|
+
sortMarkerClassName?: string;
|
|
71
|
+
showInactiveSortMarker?: boolean;
|
|
72
|
+
}
|
|
73
|
+
declare const DataTable: <TData>({ rows, columns, getRowKey, initialSortColumnId, initialSortDirection, enableFilter, filterLabel, filterPlaceholder, hideFilterLabel, emptyMessage, className, controlsClassName, filterLabelClassName, filterInputClassName, tableWrapClassName, tableClassName, sortButtonClassName, sortMarkerClassName, showInactiveSortMarker, }: IDataTableProps<TData>) => React$1.ReactElement;
|
|
74
|
+
|
|
75
|
+
interface IErrorPanel {
|
|
76
|
+
errors: string[];
|
|
77
|
+
}
|
|
78
|
+
declare const ErrorPanel: React$1.FC<IErrorPanel>;
|
|
79
|
+
|
|
80
|
+
interface IExpressionChangeHistoryViewProps {
|
|
81
|
+
version: number;
|
|
82
|
+
modelIndex: number;
|
|
83
|
+
expressionIndex: number;
|
|
84
|
+
expression: IExpression;
|
|
85
|
+
changeHistory: IExpressionChangeHistory[][];
|
|
86
|
+
changeHistoryIndex: number;
|
|
87
|
+
onHistoryChange?: (modelIndex: number, expressionIndex: number, changes: IExpressionChangeHistory[][]) => void;
|
|
88
|
+
onSelectionChanged?: (modelIndex: number, expressionIndex: number, selectedChangeSetIndex: number, items: IExpressionChangeHistory[], replay: boolean) => void;
|
|
89
|
+
}
|
|
90
|
+
declare const ExpressionChangeHistoryView: React$1.FC<IExpressionChangeHistoryViewProps>;
|
|
91
|
+
|
|
92
|
+
declare function useExpressionChangeHistoryTracker(args: {
|
|
93
|
+
changeHistory: IExpressionChangeHistory[][];
|
|
94
|
+
expression: IExpression | null | undefined;
|
|
95
|
+
version: number | string;
|
|
96
|
+
modelIndex: number;
|
|
97
|
+
expressionIndex: number;
|
|
98
|
+
onHistoryChange: (modelIndex: number, expressionIndex: number, nextHistory: IExpressionChangeHistory[][]) => void;
|
|
99
|
+
onSelectionChanged: (modelIndex: number, expressionIndex: number, newestPersistedIndex: number, stack: IExpressionChangeHistory[], replay: boolean) => void;
|
|
100
|
+
}): {
|
|
101
|
+
tracker: _rs_x_expression_parser.IExpressionChangeTracker | null;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
declare function stackKey(stack: readonly IExpressionChangeHistory[]): string;
|
|
105
|
+
type TrackerSubscriptionResult = {
|
|
106
|
+
tracker: IExpressionChangeTracker | null;
|
|
107
|
+
latestStack: IExpressionChangeHistory[] | null;
|
|
108
|
+
latestStackKey: string | null;
|
|
109
|
+
};
|
|
110
|
+
declare function useExpressionChangeTrackerSubscription(args: {
|
|
111
|
+
expression: IExpression | null | undefined;
|
|
112
|
+
}): TrackerSubscriptionResult;
|
|
113
|
+
|
|
114
|
+
declare function useLatestChangeSetFromTracker(args: {
|
|
115
|
+
expression: IExpression | null | undefined;
|
|
116
|
+
useTracker: (expr: IExpression) => IExpressionChangeTracker | null;
|
|
117
|
+
}): IExpressionChangeHistory[];
|
|
118
|
+
|
|
119
|
+
declare function usePersistChangeHistoryFromStack(args: {
|
|
120
|
+
latestStack: IExpressionChangeHistory[] | null;
|
|
121
|
+
latestStackKey: string | null;
|
|
122
|
+
changeHistory: IExpressionChangeHistory[][];
|
|
123
|
+
modelIndex: number;
|
|
124
|
+
expressionIndex: number;
|
|
125
|
+
onHistoryChange: (modelIndex: number, expressionIndex: number, nextHistory: IExpressionChangeHistory[][]) => void;
|
|
126
|
+
onSelectionChanged: (modelIndex: number, expressionIndex: number, newestPersistedIndex: number, stack: IExpressionChangeHistory[], replay: boolean) => void;
|
|
127
|
+
}): void;
|
|
128
|
+
|
|
129
|
+
interface IExpressionTreePanelProps {
|
|
130
|
+
selectedExpressionString: string | undefined;
|
|
131
|
+
treeZoomPercent: number;
|
|
132
|
+
expression: IExpression;
|
|
133
|
+
version: number;
|
|
134
|
+
highlightVersion: number;
|
|
135
|
+
treeHighlight: IExpressionChangeHistory[];
|
|
136
|
+
onTreeZoomPercentChange: (value: number) => void;
|
|
137
|
+
onClose?: () => void;
|
|
138
|
+
isVisible: boolean;
|
|
139
|
+
}
|
|
140
|
+
declare const ExpressionTreePanel: React$1.FC<IExpressionTreePanelProps>;
|
|
141
|
+
|
|
142
|
+
type NodeId = string;
|
|
143
|
+
interface TNode {
|
|
144
|
+
id: NodeId;
|
|
145
|
+
expr: IExpression;
|
|
146
|
+
children: TNode[];
|
|
147
|
+
parent?: TNode;
|
|
148
|
+
depth: number;
|
|
149
|
+
x: number;
|
|
150
|
+
y: number;
|
|
151
|
+
prelim: number;
|
|
152
|
+
mod: number;
|
|
153
|
+
change: number;
|
|
154
|
+
shift: number;
|
|
155
|
+
ancestor: TNode;
|
|
156
|
+
thread?: TNode;
|
|
157
|
+
number: number;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
interface LayoutEdge$1 {
|
|
161
|
+
from: NodeId;
|
|
162
|
+
to: NodeId;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
interface LayoutNode$2 {
|
|
166
|
+
id: NodeId;
|
|
167
|
+
expression: IExpression;
|
|
168
|
+
depth: number;
|
|
169
|
+
x: number;
|
|
170
|
+
y: number;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
interface LayoutResult {
|
|
174
|
+
nodes: LayoutNode$2[];
|
|
175
|
+
edges: LayoutEdge$1[];
|
|
176
|
+
maxX: number;
|
|
177
|
+
maxDepth: number;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
declare class ExpressionIndex {
|
|
181
|
+
readonly idByExprRef: Map<IExpression<unknown, unknown>, string>;
|
|
182
|
+
readonly idByExprKey: Map<string, string>;
|
|
183
|
+
readonly parentById: Map<string, string | null>;
|
|
184
|
+
constructor(layout: LayoutResult);
|
|
185
|
+
edgeKey(from: NodeId, to: NodeId): string;
|
|
186
|
+
exprKey(expression: IExpression): string;
|
|
187
|
+
resolveNodeId(expr: IExpression): NodeId | null;
|
|
188
|
+
/**
|
|
189
|
+
* ✅ IMPORTANT:
|
|
190
|
+
* For single-node updates, expr.id is constant, so a key like "id|id|id"
|
|
191
|
+
* never changes and animation effects won't re-run.
|
|
192
|
+
*
|
|
193
|
+
* So include the old->new values in the signature.
|
|
194
|
+
*/
|
|
195
|
+
buildHighlightKey(highlightChanges: readonly IExpressionChangeHistory[]): string;
|
|
196
|
+
private _buildChainToRoot;
|
|
197
|
+
/** ✅ public helper for animators: [start, parent, ..., root] */
|
|
198
|
+
chainToRoot(start: NodeId): NodeId[];
|
|
199
|
+
pathNodesBetween(a: NodeId, b: NodeId): NodeId[];
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
interface IExpressionTreeProps {
|
|
203
|
+
version: number;
|
|
204
|
+
root: IExpression;
|
|
205
|
+
nodeWidth?: number;
|
|
206
|
+
nodeHeight?: number;
|
|
207
|
+
horizontalGap?: number;
|
|
208
|
+
verticalGap?: number;
|
|
209
|
+
formatValue?: (value: unknown) => string;
|
|
210
|
+
valueMaxDepth?: number;
|
|
211
|
+
valueMaxChars?: number;
|
|
212
|
+
className?: string;
|
|
213
|
+
style?: React$1.CSSProperties;
|
|
214
|
+
highlightChanges?: IExpressionChangeHistory[];
|
|
215
|
+
highlightVersion?: number;
|
|
216
|
+
zoomPercent?: number;
|
|
217
|
+
isVisible?: boolean;
|
|
218
|
+
playNonce?: number;
|
|
219
|
+
fitRequestNonce?: number;
|
|
220
|
+
centerRequestNonce?: number;
|
|
221
|
+
onFitZoomComputed?: (zoomPercent: number) => void;
|
|
222
|
+
}
|
|
223
|
+
declare const ExpressionTree: React$1.FC<IExpressionTreeProps>;
|
|
224
|
+
|
|
225
|
+
declare function useExpressionChangedRerender(expression: IExpression | null | undefined): number;
|
|
226
|
+
|
|
227
|
+
type LayoutEdge = {
|
|
228
|
+
from: NodeId;
|
|
229
|
+
to: NodeId;
|
|
230
|
+
};
|
|
231
|
+
type LayoutNode$1 = {
|
|
232
|
+
id: NodeId;
|
|
233
|
+
expression: IExpression;
|
|
234
|
+
};
|
|
235
|
+
type NodePos$2 = {
|
|
236
|
+
cx: number;
|
|
237
|
+
topY: number;
|
|
238
|
+
bottomY: number;
|
|
239
|
+
};
|
|
240
|
+
type EdgePathVm = {
|
|
241
|
+
key: string;
|
|
242
|
+
d: string;
|
|
243
|
+
className: string;
|
|
244
|
+
};
|
|
245
|
+
declare function useExpressionTreeEdgePaths(args: {
|
|
246
|
+
edges: readonly LayoutEdge[];
|
|
247
|
+
nodes: readonly LayoutNode$1[];
|
|
248
|
+
nodePos: Map<NodeId, NodePos$2>;
|
|
249
|
+
edgeKey: (from: NodeId, to: NodeId) => string;
|
|
250
|
+
selectedEdgeKeys: Set<string>;
|
|
251
|
+
activeEdgeKeys: ReadonlySet<string>;
|
|
252
|
+
}): EdgePathVm[];
|
|
253
|
+
|
|
254
|
+
type LayoutNode = {
|
|
255
|
+
id: NodeId;
|
|
256
|
+
expression: IExpression;
|
|
257
|
+
};
|
|
258
|
+
type NodePos$1 = {
|
|
259
|
+
left: number;
|
|
260
|
+
top: number;
|
|
261
|
+
};
|
|
262
|
+
type NodeVm = {
|
|
263
|
+
id: NodeId;
|
|
264
|
+
className: string;
|
|
265
|
+
style: React.CSSProperties;
|
|
266
|
+
expressionText: string;
|
|
267
|
+
typeText: string;
|
|
268
|
+
valueText: string;
|
|
269
|
+
hasValue: boolean;
|
|
270
|
+
isAsync: boolean;
|
|
271
|
+
};
|
|
272
|
+
declare function useExpressionTreeNodeVms(args: {
|
|
273
|
+
nodes: readonly LayoutNode[];
|
|
274
|
+
nodePos: Map<NodeId, NodePos$1>;
|
|
275
|
+
nodeWidth: number;
|
|
276
|
+
nodeHeight: number;
|
|
277
|
+
selectedNodeIds: Set<NodeId>;
|
|
278
|
+
activeNodeIds: ReadonlySet<NodeId>;
|
|
279
|
+
formatValue: (v: unknown) => string;
|
|
280
|
+
}): NodeVm[];
|
|
281
|
+
|
|
282
|
+
type NodePos = {
|
|
283
|
+
left: number;
|
|
284
|
+
top: number;
|
|
285
|
+
cx: number;
|
|
286
|
+
topY: number;
|
|
287
|
+
bottomY: number;
|
|
288
|
+
};
|
|
289
|
+
type ExpressionTreeViewport = {
|
|
290
|
+
zoomScale: number;
|
|
291
|
+
paddedW: number;
|
|
292
|
+
paddedH: number;
|
|
293
|
+
scaledW: number;
|
|
294
|
+
scaledH: number;
|
|
295
|
+
nodePos: Map<NodeId, NodePos>;
|
|
296
|
+
};
|
|
297
|
+
declare function useExpressionTreeViewport(args: {
|
|
298
|
+
layout: LayoutResult;
|
|
299
|
+
nodeWidth: number;
|
|
300
|
+
nodeHeight: number;
|
|
301
|
+
horizontalGap: number;
|
|
302
|
+
verticalGap: number;
|
|
303
|
+
panelW: number;
|
|
304
|
+
panelH: number;
|
|
305
|
+
zoomPercent: number;
|
|
306
|
+
}): ExpressionTreeViewport;
|
|
307
|
+
|
|
308
|
+
declare function useHighlightAnimation(args: {
|
|
309
|
+
highlightChanges: readonly IExpressionChangeHistory[];
|
|
310
|
+
highlightVersion: number;
|
|
311
|
+
highlightKey: string;
|
|
312
|
+
expressionIndex: ExpressionIndex;
|
|
313
|
+
isVisible: boolean;
|
|
314
|
+
playNonce: number;
|
|
315
|
+
}): {
|
|
316
|
+
selectedNodeIds: Set<NodeId>;
|
|
317
|
+
selectedEdgeKeys: Set<string>;
|
|
318
|
+
activeNodeIds: Set<NodeId>;
|
|
319
|
+
activeEdgeKeys: Set<string>;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
declare function useResizeObserverSize<T extends HTMLElement>(): [
|
|
323
|
+
React.RefObject<T | null>,
|
|
324
|
+
{
|
|
325
|
+
width: number;
|
|
326
|
+
height: number;
|
|
327
|
+
}
|
|
328
|
+
];
|
|
329
|
+
|
|
330
|
+
declare class TreeLayoutEngine {
|
|
331
|
+
private _seq;
|
|
332
|
+
computeLayout(expression: IExpression): LayoutResult;
|
|
333
|
+
private makeId;
|
|
334
|
+
/**
|
|
335
|
+
* Build a visible-only tree:
|
|
336
|
+
* - Hidden nodes are NOT added to the layout
|
|
337
|
+
* - Children of hidden nodes are "lifted" to the nearest visible parent
|
|
338
|
+
*/
|
|
339
|
+
private buildVisibleTNodeTree;
|
|
340
|
+
private leftSibling;
|
|
341
|
+
private leftMostSibling;
|
|
342
|
+
private nextLeft;
|
|
343
|
+
private nextRight;
|
|
344
|
+
private moveSubtree;
|
|
345
|
+
private ancestorNode;
|
|
346
|
+
private executeShifts;
|
|
347
|
+
private apportion;
|
|
348
|
+
private firstWalk;
|
|
349
|
+
private secondWalk;
|
|
350
|
+
private tidyLayout;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
interface IExpressionTreeViewWithModel {
|
|
354
|
+
version?: number;
|
|
355
|
+
treeHighlightVersion?: number;
|
|
356
|
+
modelIndex?: number;
|
|
357
|
+
expressionIndex?: number;
|
|
358
|
+
hideTrackChange?: boolean;
|
|
359
|
+
hideHeader?: boolean;
|
|
360
|
+
changeHistoryIndex?: number;
|
|
361
|
+
expression?: IExpression;
|
|
362
|
+
changeHistory?: IExpressionChangeHistory[][];
|
|
363
|
+
treeHighlight: IExpressionChangeHistory[];
|
|
364
|
+
treeZoomPercent: number;
|
|
365
|
+
modelEditor: JSX.Element;
|
|
366
|
+
onHistoryChanged?: (modelIndex: number, expressionIndex: number, history: IExpressionChangeHistory[][]) => void;
|
|
367
|
+
onSelectHistoryBatch?: (modelIndex: number, expressionIndex: number, selectedIndex: number, items: IExpressionChangeHistory[], replay: boolean) => void;
|
|
368
|
+
onClearSelectedHistory?: () => void;
|
|
369
|
+
setTreeZoomPercent: (zoom: number) => void;
|
|
370
|
+
onClose?: () => void;
|
|
371
|
+
}
|
|
372
|
+
declare const ExpressionTreeViewWithModel: React$1.FC<IExpressionTreeViewWithModel>;
|
|
373
|
+
|
|
374
|
+
declare function useSyncScriptToUrl(args: {
|
|
375
|
+
script: string;
|
|
376
|
+
buildQuery: (script: string) => string | Promise<string>;
|
|
377
|
+
debounceMs?: number;
|
|
378
|
+
enabled?: boolean;
|
|
379
|
+
}): void;
|
|
380
|
+
|
|
381
|
+
interface IItemLinkCardContentProps {
|
|
382
|
+
title: ReactNode;
|
|
383
|
+
meta?: ReactNode;
|
|
384
|
+
description?: ReactNode;
|
|
385
|
+
arrow?: ReactNode;
|
|
386
|
+
titleClassName?: string;
|
|
387
|
+
metaClassName?: string;
|
|
388
|
+
descriptionClassName?: string;
|
|
389
|
+
arrowClassName?: string;
|
|
390
|
+
}
|
|
391
|
+
declare const ItemLinkCardContent: React$1.FC<IItemLinkCardContentProps>;
|
|
392
|
+
|
|
393
|
+
type LeftAccentCardTone = 'brand' | 'active' | 'done' | 'mostly' | 'planned';
|
|
394
|
+
type LeftAccentCardTag = 'article' | 'div' | 'li' | 'section';
|
|
395
|
+
interface ILeftAccentCardProps extends React$1.HTMLAttributes<HTMLElement> {
|
|
396
|
+
as?: LeftAccentCardTag;
|
|
397
|
+
tone?: LeftAccentCardTone;
|
|
398
|
+
}
|
|
399
|
+
declare const LeftAccentCard: React$1.FC<ILeftAccentCardProps>;
|
|
400
|
+
|
|
401
|
+
type NotificationToastVariant = 'success' | 'error' | 'info';
|
|
402
|
+
interface INotificationToastProps {
|
|
403
|
+
open: boolean;
|
|
404
|
+
title?: string;
|
|
405
|
+
message: string;
|
|
406
|
+
variant?: NotificationToastVariant;
|
|
407
|
+
durationMs?: number;
|
|
408
|
+
onClose: () => void;
|
|
409
|
+
}
|
|
410
|
+
declare const NotificationToast: React$1.FC<INotificationToastProps>;
|
|
411
|
+
|
|
412
|
+
declare const Playground: React$1.FC;
|
|
413
|
+
|
|
414
|
+
type TabValue = string;
|
|
415
|
+
interface ITabItem<T extends TabValue = string> {
|
|
416
|
+
value: T;
|
|
417
|
+
label: React$1.ReactNode;
|
|
418
|
+
title?: string;
|
|
419
|
+
disabled?: boolean;
|
|
420
|
+
}
|
|
421
|
+
interface ITabsProps<T extends TabValue = string> {
|
|
422
|
+
ariaLabel: string;
|
|
423
|
+
items: readonly ITabItem<T>[];
|
|
424
|
+
value: T;
|
|
425
|
+
onValueChange: (value: T) => void;
|
|
426
|
+
persistKey?: string;
|
|
427
|
+
className?: string;
|
|
428
|
+
listClassName?: string;
|
|
429
|
+
tabClassName?: string;
|
|
430
|
+
activeTabClassName?: string;
|
|
431
|
+
labelClassName?: string;
|
|
432
|
+
unstyled?: boolean;
|
|
433
|
+
}
|
|
434
|
+
declare const Tabs: <T extends TabValue = string>({ ariaLabel, items, value, onValueChange, persistKey, className, listClassName, tabClassName, activeTabClassName, labelClassName, unstyled, }: ITabsProps<T>) => React$1.ReactElement;
|
|
435
|
+
|
|
436
|
+
declare function installMonacoPlaceholder(editor: Monaco.editor.IStandaloneCodeEditor, monaco: typeof Monaco, text: string): () => void;
|
|
437
|
+
interface TSEditorProps {
|
|
438
|
+
saveButtonName?: string;
|
|
439
|
+
header: string;
|
|
440
|
+
name?: string;
|
|
441
|
+
hideName?: boolean;
|
|
442
|
+
hideCancelButton?: boolean;
|
|
443
|
+
namePlaceholder?: string;
|
|
444
|
+
value?: string;
|
|
445
|
+
options?: Monaco.editor.IStandaloneEditorConstructionOptions;
|
|
446
|
+
onMount?: OnMount;
|
|
447
|
+
onChange?: (value: string) => void;
|
|
448
|
+
save: (value: string, name: string) => void;
|
|
449
|
+
cancel?: () => void;
|
|
450
|
+
secondaryActionName?: string;
|
|
451
|
+
secondaryAction?: (value: string, name: string) => void;
|
|
452
|
+
secondaryActionDisabled?: boolean;
|
|
453
|
+
}
|
|
454
|
+
declare const TSEditor: React$1.FC<TSEditorProps>;
|
|
455
|
+
|
|
456
|
+
interface ITsEditorWithErrorPanelProp {
|
|
457
|
+
script?: string;
|
|
458
|
+
header: string;
|
|
459
|
+
name?: string;
|
|
460
|
+
namePlaceholder?: string;
|
|
461
|
+
errors: string[];
|
|
462
|
+
saveButtonName?: string;
|
|
463
|
+
hideName?: boolean;
|
|
464
|
+
options?: Monaco.editor.IStandaloneEditorConstructionOptions;
|
|
465
|
+
onChange?: (value: string) => void;
|
|
466
|
+
save: (value: string, ame: string) => void;
|
|
467
|
+
cancel?: () => void;
|
|
468
|
+
onMount?: OnMount;
|
|
469
|
+
isEditorLoading?: boolean;
|
|
470
|
+
secondaryActionName?: string;
|
|
471
|
+
secondaryAction?: (value: string, name: string) => void;
|
|
472
|
+
secondaryActionDisabled?: boolean;
|
|
473
|
+
}
|
|
474
|
+
declare const TsEditorWithErrorPanel: React$1.FC<ITsEditorWithErrorPanelProp>;
|
|
475
|
+
|
|
476
|
+
interface IZoomDropdown {
|
|
477
|
+
value: number;
|
|
478
|
+
onChange: (value: number) => void;
|
|
479
|
+
}
|
|
480
|
+
declare const ZoomDropdown: React$1.FC<IZoomDropdown>;
|
|
481
|
+
|
|
482
|
+
declare const ZOOM_PRESETS: number[];
|
|
483
|
+
declare function snapZoomPercentToPreset(value: number): number;
|
|
484
|
+
|
|
485
|
+
declare class ExpressionChangeTrackerFactory {
|
|
486
|
+
private static _expressionChangeTrackerManager;
|
|
487
|
+
private constructor();
|
|
488
|
+
static create(expression: IExpression): IExpressionChangeTracker;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
declare function ensureExpressionParserBootstrapped(): Promise<void>;
|
|
492
|
+
|
|
493
|
+
interface IExpressionFactoryResult {
|
|
494
|
+
expression: IExpression | undefined;
|
|
495
|
+
expressionString: string;
|
|
496
|
+
error: string;
|
|
497
|
+
}
|
|
498
|
+
declare class ModelExpressionsFactory {
|
|
499
|
+
private static _instance;
|
|
500
|
+
private readonly _expressionManager;
|
|
501
|
+
private constructor();
|
|
502
|
+
static getInstance(): ModelExpressionsFactory;
|
|
503
|
+
create(model: object, expressionStrings: string[]): IExpressionFactoryResult[];
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
declare class ModelIntellisenseService {
|
|
507
|
+
private static _instance;
|
|
508
|
+
model: object;
|
|
509
|
+
monaco?: Monaco$1;
|
|
510
|
+
private readonly scopes;
|
|
511
|
+
private constructor();
|
|
512
|
+
static getInstance(): ModelIntellisenseService;
|
|
513
|
+
setModel(model: object): void;
|
|
514
|
+
register(monacoInstance: Monaco$1): void;
|
|
515
|
+
private getRootScope;
|
|
516
|
+
private getCurrentMemberExpression;
|
|
517
|
+
private getWordRangeAtPosition;
|
|
518
|
+
private getSuggestions;
|
|
519
|
+
private resolveMemberExpression;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
declare function downloadProjectZip(script: string): void;
|
|
523
|
+
|
|
524
|
+
declare class RxjsMonacoTypesLoader {
|
|
525
|
+
private static _instance;
|
|
526
|
+
private _installed;
|
|
527
|
+
private static readonly GLOBAL_LIB_URI;
|
|
528
|
+
private constructor();
|
|
529
|
+
static getInstance(): RxjsMonacoTypesLoader;
|
|
530
|
+
install(monaco: Monaco$1): Promise<void>;
|
|
531
|
+
private installGlobalApiTypes;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
type RxjsCore = typeof rxjs;
|
|
535
|
+
type RxjsOps = typeof operators;
|
|
536
|
+
type CollidingKeys = keyof RxjsCore & keyof RxjsOps;
|
|
537
|
+
type NonCollidingOps = Omit<RxjsOps, CollidingKeys>;
|
|
538
|
+
/**
|
|
539
|
+
* Final scope:
|
|
540
|
+
* - All core RxJS exports (interval, combineLatest, Observable, ...)
|
|
541
|
+
* - All NON-colliding operators directly on the scope (map, pairwise, bufferCount, ...)
|
|
542
|
+
* - ALL operators available under $.op.* (including colliding names)
|
|
543
|
+
*/
|
|
544
|
+
type RxJsScope = RxjsCore & NonCollidingOps & {
|
|
545
|
+
op: RxjsOps;
|
|
546
|
+
};
|
|
547
|
+
declare const rxjsScope: RxJsScope;
|
|
548
|
+
|
|
549
|
+
type EvaluateModelResult<T> = {
|
|
550
|
+
success: true;
|
|
551
|
+
returnValue: T;
|
|
552
|
+
} | {
|
|
553
|
+
success: false;
|
|
554
|
+
error: string;
|
|
555
|
+
};
|
|
556
|
+
declare class ScriptEvaluator {
|
|
557
|
+
private static _instance;
|
|
558
|
+
private constructor();
|
|
559
|
+
static getInstance(): ScriptEvaluator;
|
|
560
|
+
evaluateScript<T>(editorModelString: string): Promise<EvaluateModelResult<T>>;
|
|
561
|
+
/**
|
|
562
|
+
* Extracts "file:line:col" where file is SOURCE_NAME.
|
|
563
|
+
*/
|
|
564
|
+
private _extractLocationFromText;
|
|
565
|
+
/**
|
|
566
|
+
* Fallback: extract "<anonymous>:line:col" (some browsers do this for eval).
|
|
567
|
+
*/
|
|
568
|
+
private _extractAnonymousLocationFromText;
|
|
569
|
+
private _escapeRegExp;
|
|
570
|
+
evaluateModel<T>(editorModelString: string): EvaluateModelResult<T>;
|
|
571
|
+
private buildApi;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
type ScriptWrapperModels = {
|
|
575
|
+
userModel: Monaco.editor.ITextModel;
|
|
576
|
+
wrapperModel: Monaco.editor.ITextModel;
|
|
577
|
+
dispose: () => void;
|
|
578
|
+
};
|
|
579
|
+
declare function setupScriptModels(args: {
|
|
580
|
+
monaco: typeof Monaco;
|
|
581
|
+
initialUserCode: string;
|
|
582
|
+
}): ScriptWrapperModels;
|
|
583
|
+
|
|
584
|
+
declare function buildZipFromTextFiles(files: Record<string, string>): Blob;
|
|
585
|
+
|
|
586
|
+
export { ChangeHistoryPanel, CodeViewer, DataTable, type EdgePathVm, ErrorPanel, type EvaluateModelResult, ExpressionChangeHistoryView, ExpressionChangeTrackerFactory, ExpressionIndex, ExpressionTree, ExpressionTreePanel, ExpressionTreeViewWithModel, type ExpressionTreeViewport, type IChangeHistoryPanel, type ICodeViewerProps, type IDataTableColumn, type IDataTableProps, type IErrorPanel, type IExpressionChangeHistoryViewProps, type IExpressionFactoryResult, type IExpressionTreePanelProps, type IExpressionTreeProps, type IExpressionTreeViewWithModel, type IItemLinkCardContentProps, type ILeftAccentCardProps, type INotificationToastProps, type ITabItem, type ITabsProps, type ITsEditorWithErrorPanelProp, type IZoomDropdown, ItemLinkCardContent, type LayoutEdge$1 as LayoutEdge, type LayoutNode$2 as LayoutNode, type LayoutResult, LeftAccentCard, type LeftAccentCardTone, ModelExpressionsFactory, ModelIntellisenseService, type NodeId, type NodePos, type NodeVm, NotificationToast, type NotificationToastVariant, Playground, type RxJsScope, RxjsMonacoTypesLoader, ScriptEvaluator, type ScriptWrapperModels, type TNode, TSEditor, type TSEditorProps, Tabs, type TrackerSubscriptionResult, TreeLayoutEngine, TsEditorWithErrorPanel, ZOOM_PRESETS, ZoomDropdown, buildZipFromTextFiles, downloadProjectZip, ensureExpressionParserBootstrapped, installMonacoPlaceholder, rxjsScope, setupScriptModels, snapZoomPercentToPreset, stackKey, useExpressionChangeHistoryTracker, useExpressionChangeTrackerSubscription, useExpressionChangedRerender, useExpressionTreeEdgePaths, useExpressionTreeNodeVms, useExpressionTreeViewport, useHighlightAnimation, useLatestChangeSetFromTracker, usePersistChangeHistoryFromStack, useResizeObserverSize, useSyncScriptToUrl };
|