@parallelworks/ui 0.36.0 → 0.37.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.
Files changed (79) hide show
  1. package/README.md +16 -0
  2. package/dist/ai/agent/permissions.d.ts +2 -2
  3. package/dist/ai/agent/permissions.js +3 -1
  4. package/dist/ai/components/agent/PermissionPicker.js +1 -0
  5. package/dist/ai/strings.d.ts +2 -0
  6. package/dist/ai/strings.js +2 -0
  7. package/dist/components/Dropdown.d.ts +2 -0
  8. package/dist/components/Dropdown.js +7 -2
  9. package/dist/components/Input.d.ts +11 -6
  10. package/dist/components/Input.js +93 -74
  11. package/dist/components/Provider.d.ts +31 -0
  12. package/dist/components/Provider.js +50 -2
  13. package/dist/editing.d.ts +404 -0
  14. package/dist/editor/EditorField.js +1 -1
  15. package/dist/editor/Monaco.d.ts +15 -1
  16. package/dist/editor/Monaco.js +117 -13
  17. package/dist/editor/editorModel.d.ts +5 -0
  18. package/dist/editor/editorModel.js +23 -0
  19. package/dist/editor/index.d.ts +4 -0
  20. package/dist/editor/index.js +5 -1
  21. package/dist/editor/lintContext.d.ts +21 -0
  22. package/dist/editor/lintContext.js +136 -0
  23. package/dist/editor/lintOwner.d.ts +2 -0
  24. package/dist/editor/lintOwner.js +5 -0
  25. package/dist/editor/nestedText.d.ts +13 -0
  26. package/dist/editor/nestedText.js +15 -0
  27. package/dist/editor/reveal.d.ts +4 -0
  28. package/dist/editor/reveal.js +15 -0
  29. package/dist/editor/settingsYaml.d.ts +12 -0
  30. package/dist/editor/settingsYaml.js +41 -0
  31. package/dist/form/Fields/DropdownField.js +1 -1
  32. package/dist/form/Fields/DurationField.js +1 -1
  33. package/dist/form/Form.js +1 -1
  34. package/dist/form/fieldRegistry.js +1 -1
  35. package/dist/form/index.js +5 -5
  36. package/dist/graph/InputDialog.d.ts +80 -0
  37. package/dist/graph/InputDialog.js +596 -0
  38. package/dist/graph/ProblemsButton.d.ts +9 -0
  39. package/dist/graph/ProblemsButton.js +61 -0
  40. package/dist/graph/ShortcutsButton.d.ts +15 -0
  41. package/dist/graph/SuggestionInput.d.ts +18 -0
  42. package/dist/graph/ToolbarPopover.d.ts +8 -0
  43. package/dist/graph/ToolbarPopover.js +71 -0
  44. package/dist/graph/editorApi.d.ts +51 -0
  45. package/dist/graph/editorChrome.d.ts +27 -0
  46. package/dist/graph/editorFields.d.ts +180 -0
  47. package/dist/graph/editorPrimitives.d.ts +60 -0
  48. package/dist/graph/editorPrimitives.js +59 -0
  49. package/dist/graph/editorStrings.d.ts +695 -0
  50. package/dist/graph/editorStrings.js +699 -0
  51. package/dist/graph/expressionRefs.d.ts +12 -0
  52. package/dist/graph/fieldProblems.d.ts +32 -0
  53. package/dist/graph/index.d.ts +6 -0
  54. package/dist/graph/index.js +5 -1
  55. package/dist/graph/inputLayout.d.ts +25 -0
  56. package/dist/graph/inputRefs.d.ts +103 -0
  57. package/dist/graph/records.d.ts +3 -0
  58. package/dist/graph/records.js +7 -0
  59. package/dist/graph/refusalText.d.ts +6 -0
  60. package/dist/graph/settingsViews.d.ts +26 -0
  61. package/dist/graph/usesInputs.d.ts +17 -0
  62. package/dist/graph/usesInputs.js +40 -0
  63. package/dist/icons/bi/BiRedo.js +16 -0
  64. package/dist/icons/bi/BiUndo.js +16 -0
  65. package/dist/icons/lu/LuBraces.js +27 -0
  66. package/dist/icons/lu/LuCode.js +27 -0
  67. package/dist/icons/lu/LuKeyboard.js +71 -0
  68. package/dist/icons/lu/LuNetwork.js +63 -0
  69. package/dist/icons/lu/LuTextCursorInput.js +45 -0
  70. package/dist/icons.d.ts +2 -2
  71. package/dist/icons.js +8 -1
  72. package/dist/index.d.ts +2 -1
  73. package/dist/index.js +2 -2
  74. package/dist/list/ActionToolbar.d.ts +2 -0
  75. package/dist/list/ActionToolbar.js +18 -5
  76. package/dist/list/RowContextMenu.d.ts +10 -1
  77. package/dist/list/RowContextMenu.js +185 -30
  78. package/dist/styles.css +1 -1
  79. package/package.json +1 -1
@@ -0,0 +1,596 @@
1
+ import "classnames";
2
+ import "react";
3
+ import "react/jsx-runtime";
4
+ //#region src/graph/InputDialog.tsx
5
+ /** Input types by menu group, in the order the add menu lists them. */
6
+ var INPUT_TYPE_GROUPS = [
7
+ ["basic", [
8
+ "string",
9
+ "number",
10
+ "duration",
11
+ "boolean",
12
+ "password",
13
+ "editor",
14
+ "color-picker"
15
+ ]],
16
+ ["choices", [
17
+ "dropdown",
18
+ "multi-dropdown",
19
+ "radio",
20
+ "checkbox-group"
21
+ ]],
22
+ ["layout", [
23
+ "group",
24
+ "list",
25
+ "header",
26
+ "step"
27
+ ]],
28
+ ["compute", [
29
+ "compute-clusters",
30
+ "compute-resources",
31
+ "compute-target",
32
+ "bucket"
33
+ ]],
34
+ ["schedulers", [
35
+ "slurm-accounts",
36
+ "slurm-partitions",
37
+ "slurm-qos",
38
+ "pbs-queues"
39
+ ]],
40
+ ["cloud", [
41
+ "region",
42
+ "zone",
43
+ "instance-type"
44
+ ]],
45
+ ["kubernetes", [
46
+ "kubernetes-clusters",
47
+ "kubernetes-namespaces",
48
+ "kubernetes-pods",
49
+ "kubernetes-pvc",
50
+ "kubernetes-secrets",
51
+ "kubernetes-configmaps",
52
+ "kubernetes-statefulsets",
53
+ "kubernetes-deployments",
54
+ "kubernetes-services",
55
+ "kubernetes-workloads"
56
+ ]],
57
+ ["platform", [
58
+ "organization-groups",
59
+ "ai-model",
60
+ "allocations"
61
+ ]]
62
+ ];
63
+ var DEFAULT = {
64
+ key: "default",
65
+ kind: "text",
66
+ help: "default"
67
+ };
68
+ var DEFAULT_OBJECT = {
69
+ ...DEFAULT,
70
+ nested: "object"
71
+ };
72
+ var DEFAULT_LIST = {
73
+ key: "default",
74
+ kind: "values",
75
+ help: "defaultList"
76
+ };
77
+ var RESOURCE_DEFAULT = {
78
+ ...DEFAULT,
79
+ help: "defaultResource",
80
+ nested: "any"
81
+ };
82
+ var RESOURCE_DEFAULTS = {
83
+ ...DEFAULT_LIST,
84
+ help: "defaultResources"
85
+ };
86
+ var AUTOSELECT = {
87
+ key: "autoselect",
88
+ kind: "flag",
89
+ help: "autoselect",
90
+ nested: "object",
91
+ conditional: true
92
+ };
93
+ var PLACEHOLDER = {
94
+ key: "placeholder",
95
+ kind: "text",
96
+ help: "placeholder",
97
+ prose: true
98
+ };
99
+ var CLUSTER = {
100
+ key: "clusterName",
101
+ kind: "ref",
102
+ help: "clusterName",
103
+ required: true,
104
+ refTypes: ["kubernetes-clusters"]
105
+ };
106
+ var NAMESPACE = {
107
+ key: "namespace",
108
+ kind: "ref",
109
+ help: "namespace",
110
+ required: true,
111
+ refTypes: ["kubernetes-namespaces"]
112
+ };
113
+ var CSP = {
114
+ key: "csp",
115
+ kind: "ref",
116
+ help: "csp",
117
+ refTypes: ["dropdown", "radio"],
118
+ choices: [
119
+ "aws",
120
+ "azure",
121
+ "google",
122
+ "openstack"
123
+ ]
124
+ };
125
+ var CSP_REQUIRED = {
126
+ ...CSP,
127
+ required: true
128
+ };
129
+ var REGION = {
130
+ key: "region",
131
+ kind: "ref",
132
+ help: "region",
133
+ required: true,
134
+ refTypes: ["region"]
135
+ };
136
+ var RESOURCE = {
137
+ key: "resource",
138
+ kind: "ref",
139
+ help: "resource",
140
+ required: true,
141
+ refTypes: ["compute-clusters", "compute-resources"],
142
+ literal: false
143
+ };
144
+ var ACCOUNT = {
145
+ key: "account",
146
+ kind: "ref",
147
+ help: "account",
148
+ refTypes: ["slurm-accounts"],
149
+ literal: false
150
+ };
151
+ var DEFAULT_FROM_INPUT = {
152
+ key: "default",
153
+ kind: "ref",
154
+ help: "defaultFromInput",
155
+ refTypes: [
156
+ "string",
157
+ "dropdown",
158
+ "radio"
159
+ ],
160
+ literal: false
161
+ };
162
+ var OPTIONS = {
163
+ key: "options",
164
+ kind: "options",
165
+ help: "options",
166
+ required: true
167
+ };
168
+ var MULTI = {
169
+ key: "multi",
170
+ kind: "bool",
171
+ help: "multi"
172
+ };
173
+ var COMPUTE = [
174
+ RESOURCE_DEFAULT,
175
+ RESOURCE_DEFAULTS,
176
+ AUTOSELECT,
177
+ {
178
+ key: "include-workspace",
179
+ kind: "flag",
180
+ help: "includeWorkspace",
181
+ conditional: true
182
+ },
183
+ {
184
+ key: "include-unprovisioned",
185
+ kind: "flag",
186
+ help: "includeUnprovisioned",
187
+ conditional: true
188
+ },
189
+ CSP,
190
+ {
191
+ key: "provider",
192
+ kind: "providers",
193
+ help: "provider"
194
+ },
195
+ MULTI
196
+ ];
197
+ var IN_NAMESPACE = [
198
+ DEFAULT_OBJECT,
199
+ CLUSTER,
200
+ NAMESPACE,
201
+ AUTOSELECT
202
+ ];
203
+ var TYPE_PROPS = {
204
+ string: [
205
+ DEFAULT,
206
+ PLACEHOLDER,
207
+ {
208
+ key: "textarea",
209
+ kind: "bool",
210
+ help: "textarea"
211
+ },
212
+ {
213
+ key: "prefillDefault",
214
+ kind: "flag",
215
+ help: "prefillDefault"
216
+ },
217
+ {
218
+ key: "minLength",
219
+ kind: "number",
220
+ help: "minLength",
221
+ wholeFrom: 0
222
+ },
223
+ {
224
+ key: "maxLength",
225
+ kind: "number",
226
+ help: "maxLength",
227
+ wholeFrom: 1
228
+ },
229
+ {
230
+ key: "lowercase",
231
+ kind: "bool",
232
+ help: "lowercase"
233
+ },
234
+ {
235
+ key: "sanitize",
236
+ kind: "text",
237
+ help: "sanitize",
238
+ pattern: true
239
+ }
240
+ ],
241
+ number: [
242
+ {
243
+ key: "default",
244
+ kind: "number",
245
+ help: "default"
246
+ },
247
+ {
248
+ key: "min",
249
+ kind: "number",
250
+ help: "minNumber"
251
+ },
252
+ {
253
+ key: "max",
254
+ kind: "number",
255
+ help: "maxNumber"
256
+ },
257
+ {
258
+ key: "step",
259
+ kind: "number",
260
+ help: "step"
261
+ },
262
+ {
263
+ key: "slider",
264
+ kind: "flag",
265
+ help: "slider"
266
+ }
267
+ ],
268
+ boolean: [{
269
+ key: "default",
270
+ kind: "flag",
271
+ help: "default"
272
+ }],
273
+ password: [DEFAULT],
274
+ editor: [{
275
+ key: "default",
276
+ kind: "textarea",
277
+ help: "default"
278
+ }, {
279
+ key: "language",
280
+ kind: "language",
281
+ help: "language"
282
+ }],
283
+ "color-picker": [DEFAULT],
284
+ dropdown: [
285
+ OPTIONS,
286
+ {
287
+ key: "option-key",
288
+ kind: "ref",
289
+ help: "optionKey",
290
+ refTypes: [
291
+ "dropdown",
292
+ "radio",
293
+ "string"
294
+ ],
295
+ literal: false
296
+ },
297
+ DEFAULT_OBJECT,
298
+ PLACEHOLDER,
299
+ AUTOSELECT
300
+ ],
301
+ "multi-dropdown": [OPTIONS, DEFAULT_LIST],
302
+ radio: [
303
+ OPTIONS,
304
+ DEFAULT,
305
+ {
306
+ key: "optionLabelPosition",
307
+ kind: "choice",
308
+ help: "optionLabelPosition",
309
+ choices: ["left", "top"]
310
+ }
311
+ ],
312
+ "checkbox-group": [
313
+ OPTIONS,
314
+ DEFAULT_LIST,
315
+ {
316
+ key: "implies",
317
+ kind: "implies",
318
+ help: "implies"
319
+ }
320
+ ],
321
+ duration: [
322
+ {
323
+ key: "default",
324
+ kind: "duration",
325
+ help: "durationDefault"
326
+ },
327
+ PLACEHOLDER,
328
+ {
329
+ key: "min",
330
+ kind: "duration",
331
+ help: "minDuration"
332
+ },
333
+ {
334
+ key: "max",
335
+ kind: "duration",
336
+ help: "maxDuration"
337
+ },
338
+ {
339
+ key: "disableLabel",
340
+ kind: "text",
341
+ help: "disableLabel",
342
+ prose: true
343
+ },
344
+ {
345
+ key: "disableValue",
346
+ kind: "number",
347
+ help: "disableValue"
348
+ }
349
+ ],
350
+ group: [{
351
+ key: "collapsed",
352
+ kind: "flag",
353
+ help: "collapsed",
354
+ conditional: true
355
+ }, {
356
+ key: "flatten",
357
+ kind: "bool",
358
+ help: "flatten"
359
+ }],
360
+ list: [
361
+ {
362
+ key: "template",
363
+ kind: "template",
364
+ help: "template",
365
+ required: true
366
+ },
367
+ {
368
+ key: "default",
369
+ kind: "rows",
370
+ help: "listDefault"
371
+ },
372
+ {
373
+ key: "items-collapsible",
374
+ kind: "flag",
375
+ help: "itemsCollapsible"
376
+ },
377
+ {
378
+ key: "min",
379
+ kind: "number",
380
+ help: "minItems"
381
+ },
382
+ {
383
+ key: "max",
384
+ kind: "number",
385
+ help: "maxItems"
386
+ }
387
+ ],
388
+ header: [
389
+ {
390
+ key: "text",
391
+ kind: "textarea",
392
+ help: "text",
393
+ required: true,
394
+ grow: true,
395
+ prose: true
396
+ },
397
+ {
398
+ key: "size",
399
+ kind: "number",
400
+ help: "size"
401
+ },
402
+ {
403
+ key: "bold",
404
+ kind: "flag",
405
+ help: "bold",
406
+ fallback: true
407
+ }
408
+ ],
409
+ step: [
410
+ {
411
+ key: "title",
412
+ kind: "perCopy",
413
+ help: "title",
414
+ required: true,
415
+ prose: true
416
+ },
417
+ {
418
+ key: "nextLabel",
419
+ kind: "text",
420
+ help: "nextLabel",
421
+ prose: true
422
+ },
423
+ {
424
+ key: "prevLabel",
425
+ kind: "text",
426
+ help: "prevLabel",
427
+ prose: true
428
+ },
429
+ {
430
+ key: "multi",
431
+ kind: "bool",
432
+ help: "multiStep",
433
+ label: "multiStep"
434
+ },
435
+ {
436
+ key: "min",
437
+ kind: "number",
438
+ help: "minCopies"
439
+ },
440
+ {
441
+ key: "max",
442
+ kind: "number",
443
+ help: "maxCopies"
444
+ }
445
+ ],
446
+ "compute-clusters": COMPUTE,
447
+ "compute-resources": COMPUTE,
448
+ bucket: [
449
+ RESOURCE_DEFAULT,
450
+ RESOURCE_DEFAULTS,
451
+ CSP,
452
+ {
453
+ key: "generateCredentials",
454
+ kind: "flag",
455
+ help: "generateCredentials"
456
+ },
457
+ MULTI
458
+ ],
459
+ region: [
460
+ DEFAULT_OBJECT,
461
+ CSP_REQUIRED,
462
+ AUTOSELECT
463
+ ],
464
+ zone: [
465
+ DEFAULT_OBJECT,
466
+ CSP_REQUIRED,
467
+ REGION,
468
+ AUTOSELECT
469
+ ],
470
+ "instance-type": [
471
+ DEFAULT_OBJECT,
472
+ CSP_REQUIRED,
473
+ REGION,
474
+ AUTOSELECT
475
+ ],
476
+ "slurm-accounts": [DEFAULT_FROM_INPUT, RESOURCE],
477
+ "slurm-partitions": [
478
+ DEFAULT_FROM_INPUT,
479
+ RESOURCE,
480
+ ACCOUNT
481
+ ],
482
+ "slurm-qos": [
483
+ DEFAULT_FROM_INPUT,
484
+ RESOURCE,
485
+ ACCOUNT,
486
+ {
487
+ key: "partition",
488
+ kind: "ref",
489
+ help: "partition",
490
+ refTypes: ["slurm-partitions"],
491
+ literal: false
492
+ }
493
+ ],
494
+ "pbs-queues": [DEFAULT_FROM_INPUT, RESOURCE],
495
+ "organization-groups": [DEFAULT_FROM_INPUT],
496
+ "ai-model": [
497
+ DEFAULT,
498
+ PLACEHOLDER,
499
+ AUTOSELECT
500
+ ],
501
+ allocations: [
502
+ DEFAULT,
503
+ PLACEHOLDER,
504
+ AUTOSELECT,
505
+ {
506
+ key: "includeEmpty",
507
+ kind: "bool",
508
+ help: "includeEmpty",
509
+ fallback: true
510
+ }
511
+ ],
512
+ "kubernetes-clusters": [DEFAULT_OBJECT, AUTOSELECT],
513
+ "kubernetes-namespaces": [
514
+ DEFAULT_OBJECT,
515
+ CLUSTER,
516
+ AUTOSELECT
517
+ ],
518
+ "kubernetes-pods": IN_NAMESPACE,
519
+ "kubernetes-pvc": IN_NAMESPACE,
520
+ "kubernetes-secrets": IN_NAMESPACE,
521
+ "kubernetes-configmaps": IN_NAMESPACE,
522
+ "kubernetes-statefulsets": IN_NAMESPACE,
523
+ "kubernetes-deployments": IN_NAMESPACE,
524
+ "kubernetes-services": IN_NAMESPACE,
525
+ "kubernetes-workloads": IN_NAMESPACE
526
+ };
527
+ var TEXT_FIELDS = [
528
+ "label",
529
+ "description",
530
+ "tooltip"
531
+ ];
532
+ var FLAG_FIELDS = [
533
+ "optional",
534
+ "hidden",
535
+ "disabled",
536
+ "ignore"
537
+ ];
538
+ var COMMON_KEYS = {
539
+ group: [
540
+ "label",
541
+ "description",
542
+ "tooltip",
543
+ "hidden",
544
+ "ignore"
545
+ ],
546
+ header: [
547
+ "label",
548
+ "description",
549
+ "tooltip",
550
+ "hidden"
551
+ ],
552
+ step: ["description"]
553
+ };
554
+ var ALL_COMMON = [...TEXT_FIELDS, ...FLAG_FIELDS];
555
+ [...ALL_COMMON, ...Object.values(TYPE_PROPS).flatMap((props) => props.map((prop) => prop.key))];
556
+ function inputTypes() {
557
+ return INPUT_TYPE_GROUPS.flatMap(([, types]) => types);
558
+ }
559
+ function commonKeys(type) {
560
+ return COMMON_KEYS[type] ?? ALL_COMMON;
561
+ }
562
+ /** Every key the dialog can write for an input of `type`. */
563
+ function offeredInputKeys(editing, type) {
564
+ const children = editing.inputChildrenKey(type);
565
+ return [
566
+ "type",
567
+ ...commonKeys(type),
568
+ ...(TYPE_PROPS[type] ?? []).map((prop) => prop.key),
569
+ ...children ? [children] : []
570
+ ];
571
+ }
572
+ function commonProp(key) {
573
+ const flag = FLAG_FIELDS.includes(key);
574
+ return {
575
+ key,
576
+ kind: flag ? "flag" : key === "label" ? "text" : "textarea",
577
+ help: key,
578
+ ...flag ? { conditional: true } : { prose: true },
579
+ ...key === "description" || key === "tooltip" ? { grow: true } : {}
580
+ };
581
+ }
582
+ var COMMON_PROPS = ALL_COMMON.map(commonProp);
583
+ var STEP_DESCRIPTION = {
584
+ ...commonProp("description"),
585
+ kind: "perCopy"
586
+ };
587
+ function draftKey(prop) {
588
+ return `${prop.kind}:${prop.key}`;
589
+ }
590
+ [...new Map([
591
+ ...COMMON_PROPS,
592
+ STEP_DESCRIPTION,
593
+ ...Object.values(TYPE_PROPS).flat()
594
+ ].map((prop) => [draftKey(prop), prop])).values()];
595
+ //#endregion
596
+ export { INPUT_TYPE_GROUPS, commonKeys, inputTypes, offeredInputKeys };
@@ -0,0 +1,9 @@
1
+ import type { EditorProblem } from './editorApi.js';
2
+ /** A problem as a pane lists it; `pick` shows where it is, when an open pane can. */
3
+ export interface ListedProblem extends EditorProblem {
4
+ pick?: (() => void) | undefined;
5
+ }
6
+ /** A toolbar's count of the problems it lists, which opens the list. */
7
+ export declare function ProblemsButton({ problems }: {
8
+ problems: ListedProblem[];
9
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,61 @@
1
+ import { TbAlertTriangle } from "../icons/tb/TbAlertTriangle.js";
2
+ import { keyedByContent } from "../components/keys.js";
3
+ import { TOOLTIP_ID } from "../components/Tooltip.js";
4
+ import { useGraphEditorStrings } from "./editorStrings.js";
5
+ import { ToolbarPopover } from "./ToolbarPopover.js";
6
+ import { useRef, useState } from "react";
7
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/graph/ProblemsButton.tsx
9
+ /** A toolbar's count of the problems it lists, which opens the list. */
10
+ function ProblemsButton({ problems }) {
11
+ const t = useGraphEditorStrings();
12
+ const [open, setOpen] = useState(false);
13
+ const button = useRef(null);
14
+ if (problems.length === 0) return null;
15
+ const label = t.problemCount(problems.length);
16
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("button", {
17
+ ref: button,
18
+ type: "button",
19
+ "aria-label": label,
20
+ "aria-expanded": open,
21
+ ...open ? {} : { "data-tooltip-id": TOOLTIP_ID },
22
+ "data-tooltip-content": label,
23
+ className: "flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-xs font-medium text-(--theme-error) theme-hover",
24
+ onClick: () => setOpen((current) => !current),
25
+ children: [/* @__PURE__ */ jsx(TbAlertTriangle, { className: "h-3.5 w-3.5" }), problems.length]
26
+ }), open && /* @__PURE__ */ jsxs(ToolbarPopover, {
27
+ anchor: button,
28
+ label,
29
+ onClose: () => setOpen(false),
30
+ children: [/* @__PURE__ */ jsx("div", {
31
+ className: "mb-2 text-[0.8125rem] font-semibold",
32
+ children: label
33
+ }), /* @__PURE__ */ jsx("ul", {
34
+ className: "flex flex-col gap-0.5",
35
+ children: keyedByContent(problems, (problem) => `${problem.line}:${problem.message}`).map(({ key, item: problem }) => {
36
+ const { pick } = problem;
37
+ const text = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
38
+ className: "mr-1.5 theme-muted-text",
39
+ children: t.problemLine(problem.line)
40
+ }), /* @__PURE__ */ jsx("span", {
41
+ className: "text-(--theme-error)",
42
+ children: problem.message
43
+ })] });
44
+ return /* @__PURE__ */ jsx("li", { children: pick ? /* @__PURE__ */ jsx("button", {
45
+ type: "button",
46
+ className: "w-full cursor-pointer rounded px-1.5 py-1 text-left theme-hover",
47
+ onClick: () => {
48
+ setOpen(false);
49
+ pick();
50
+ },
51
+ children: text
52
+ }) : /* @__PURE__ */ jsx("div", {
53
+ className: "px-1.5 py-1",
54
+ children: text
55
+ }) }, key);
56
+ })
57
+ })]
58
+ })] });
59
+ }
60
+ //#endregion
61
+ export { ProblemsButton };
@@ -0,0 +1,15 @@
1
+ /** What a gesture or key does; each combo is a set of keys, and a second combo does the same. */
2
+ export interface Shortcut {
3
+ combos: string[][];
4
+ does: string;
5
+ }
6
+ export interface ShortcutGroup {
7
+ title: string;
8
+ shortcuts: Shortcut[];
9
+ }
10
+ export declare const MOD_KEY: string;
11
+ export declare const ALT_KEY: string;
12
+ /** A toolbar button that opens the list of gestures and keys a pane takes. */
13
+ export declare function ShortcutsButton({ groups }: {
14
+ groups: ShortcutGroup[];
15
+ }): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { type IProps as DropdownProps } from '../components/Dropdown.js';
2
+ import type { IOptions } from '../components/dropdownUtils.js';
3
+ /** A value a typed field offers, with what it means. */
4
+ export interface Suggestion {
5
+ value: string;
6
+ label?: string | undefined;
7
+ }
8
+ export declare function suggestionOptions(suggestions: Suggestion[]): (IOptions | string)[];
9
+ export declare const FIELD_TEXT_BOX = "py-3 pl-4 rounded-lg text-sm !bg-[var(--theme-muted-panel-bg)]";
10
+ /**
11
+ * The dropdown for a field that takes any typed value as well as the ones it offers. Any of
12
+ * the dropdown's own props can still be passed, such as `allowCustomValue={false}`.
13
+ */
14
+ export declare function SuggestionInput({ value, onChange, suggestions, allowCustomValue, ...props }: Omit<DropdownProps, 'options' | 'value' | 'onChange'> & {
15
+ value: string;
16
+ onChange: (value: string) => void;
17
+ suggestions: Suggestion[];
18
+ }): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { type ReactNode, type RefObject } from 'react';
2
+ /** A toolbar button's panel, drawn over the page so the pane it sits in can't clip it. */
3
+ export declare function ToolbarPopover({ anchor, label, onClose, children, }: {
4
+ anchor: RefObject<HTMLElement | null>;
5
+ label: string;
6
+ onClose: () => void;
7
+ children: ReactNode;
8
+ }): import("react").ReactPortal;