@parallelworks/ui 0.77.0 → 0.79.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/README.md +42 -6
- package/dist/access/AccessDrawer.d.ts +49 -7
- package/dist/access/AccessDrawer.js +243 -38
- package/dist/access/AccessList.d.ts +19 -1
- package/dist/access/AccessList.js +220 -9
- package/dist/access/GrantView.d.ts +3 -1
- package/dist/access/GrantView.js +17 -4
- package/dist/access/PrincipalPicker.js +5 -5
- package/dist/access/focus.js +1 -1
- package/dist/access/index.d.ts +2 -2
- package/dist/access/index.js +2 -2
- package/dist/access/strings.d.ts +25 -1
- package/dist/access/strings.js +27 -3
- package/dist/access/types.d.ts +26 -0
- package/dist/ai/components/AllocationSelector.js +1 -1
- package/dist/ai/components/AttachmentManager.js +5 -5
- package/dist/ai/components/AttachmentUpload.js +2 -2
- package/dist/ai/components/BranchNavigator.js +1 -1
- package/dist/ai/components/ChatActivity.js +1 -1
- package/dist/ai/components/ChatEmptyState.js +3 -3
- package/dist/ai/components/ChatInput.js +3 -5
- package/dist/ai/components/ChatLayout.js +1 -1
- package/dist/ai/components/ChatMessage.js +1 -1
- package/dist/ai/components/ChatMessageList.js +23 -8
- package/dist/ai/components/ChatSidebar.js +3 -3
- package/dist/ai/components/ChatThread.js +4 -4
- package/dist/ai/components/ComposerAddMenu.js +9 -20
- package/dist/ai/components/ModelSelector.js +3 -3
- package/dist/ai/components/PastedText.js +5 -5
- package/dist/ai/components/SessionView.js +1 -1
- package/dist/ai/components/ShareDialog.js +3 -3
- package/dist/ai/components/SlashMenu.d.ts +31 -4
- package/dist/ai/components/SlashMenu.js +36 -63
- package/dist/ai/components/agent/ActivityLine.js +1 -1
- package/dist/ai/components/agent/AgentMessageParts.js +13 -13
- package/dist/ai/components/conversationActions.js +3 -3
- package/dist/ai/core/ChatProvider.js +1 -1
- package/dist/ai/core/config.js +1 -1
- package/dist/ai/ui/ConversationSidebar.js +3 -3
- package/dist/ai/ui/sidebar.js +3 -3
- package/dist/assets/yaml.worker-DOBV2lND.js +884 -0
- package/dist/components/ActionMenu.d.ts +38 -9
- package/dist/components/ActionMenu.js +48 -22
- package/dist/components/Avatar.d.ts +66 -6
- package/dist/components/Avatar.js +130 -18
- package/dist/components/Breadcrumbs.d.ts +4 -0
- package/dist/components/Breadcrumbs.js +26 -10
- package/dist/components/Button.d.ts +3 -2
- package/dist/components/Button.js +11 -1
- package/dist/components/Callout.d.ts +3 -2
- package/dist/components/Callout.js +3 -2
- package/dist/components/Card.d.ts +33 -9
- package/dist/components/Card.js +24 -8
- package/dist/components/Checkbox.d.ts +3 -1
- package/dist/components/Checkbox.js +4 -2
- package/dist/components/ColorInput.js +1 -1
- package/dist/components/Combobox.d.ts +23 -0
- package/dist/components/Combobox.js +252 -86
- package/dist/components/ConfirmModal.d.ts +28 -2
- package/dist/components/ConfirmModal.js +100 -15
- package/dist/components/ContextMenu.d.ts +29 -2
- package/dist/components/ContextMenu.js +60 -8
- package/dist/components/CopyButton.d.ts +21 -8
- package/dist/components/CopyButton.js +29 -9
- package/dist/components/CreateModal.d.ts +20 -4
- package/dist/components/CreateModal.js +28 -17
- package/dist/components/DatePicker.d.ts +31 -1
- package/dist/components/DatePicker.js +178 -47
- package/dist/components/DescriptionList.d.ts +13 -3
- package/dist/components/DescriptionList.js +43 -11
- package/dist/components/Disclosure.d.ts +10 -2
- package/dist/components/Disclosure.js +18 -7
- package/dist/components/Drawer.js +5 -5
- package/dist/components/EmptyState.d.ts +12 -4
- package/dist/components/EmptyState.js +18 -10
- package/dist/components/ErrorPage.d.ts +40 -0
- package/dist/components/ErrorPage.js +101 -0
- package/dist/components/ExternalLink.d.ts +4 -1
- package/dist/components/ExternalLink.js +4 -5
- package/dist/components/Field.d.ts +21 -6
- package/dist/components/Field.js +32 -16
- package/dist/components/FileButton.d.ts +19 -0
- package/dist/components/FileButton.js +32 -0
- package/dist/components/HoverCard.d.ts +26 -6
- package/dist/components/HoverCard.js +11 -5
- package/dist/components/IconButton.js +4 -2
- package/dist/components/InfoTip.js +3 -3
- package/dist/components/Input.d.ts +33 -3
- package/dist/components/Input.js +149 -14
- package/dist/components/Kbd.d.ts +40 -0
- package/dist/components/Kbd.js +168 -0
- package/dist/components/Listbox.d.ts +103 -0
- package/dist/components/Listbox.js +190 -0
- package/dist/components/Loader.d.ts +8 -2
- package/dist/components/Loader.js +16 -1
- package/dist/components/Markdown.js +1 -1
- package/dist/components/MarkdownImpl.js +1 -1
- package/dist/components/Menu.d.ts +20 -2
- package/dist/components/Menu.js +48 -19
- package/dist/components/MenuEntries.d.ts +41 -4
- package/dist/components/MenuEntries.js +266 -39
- package/dist/components/Meter.d.ts +50 -11
- package/dist/components/Meter.js +71 -21
- package/dist/components/Modal.d.ts +9 -3
- package/dist/components/Modal.js +68 -29
- package/dist/components/OneTimeCodeInput.js +1 -1
- package/dist/components/PageHeader.js +111 -7
- package/dist/components/PageHeaderAction.d.ts +8 -3
- package/dist/components/PageHeaderAction.js +122 -34
- package/dist/components/Pagination.d.ts +13 -1
- package/dist/components/Pagination.js +90 -19
- package/dist/components/Popover.d.ts +16 -2
- package/dist/components/Popover.js +20 -21
- package/dist/components/Provider.d.ts +172 -5
- package/dist/components/Provider.js +157 -14
- package/dist/components/RefreshButton.d.ts +13 -6
- package/dist/components/RefreshButton.js +17 -9
- package/dist/components/RunStatusIcon.d.ts +16 -7
- package/dist/components/RunStatusIcon.js +21 -8
- package/dist/components/Section.d.ts +11 -4
- package/dist/components/Section.js +33 -22
- package/dist/components/SegmentedControl.d.ts +16 -3
- package/dist/components/SegmentedControl.js +7 -3
- package/dist/components/Select.d.ts +19 -3
- package/dist/components/Select.js +114 -68
- package/dist/components/SelectionCopy.d.ts +10 -0
- package/dist/components/SelectionCopy.js +105 -0
- package/dist/components/SettingModeOption.js +1 -1
- package/dist/components/SettingsCard.js +1 -1
- package/dist/components/Skeleton.js +1 -1
- package/dist/components/StatusBadge.d.ts +55 -10
- package/dist/components/StatusBadge.js +91 -15
- package/dist/components/StickyBar.js +1 -1
- package/dist/components/Table.d.ts +22 -4
- package/dist/components/Table.js +46 -24
- package/dist/components/Tabs.d.ts +9 -4
- package/dist/components/Tabs.js +9 -4
- package/dist/components/Tag.d.ts +49 -0
- package/dist/components/Tag.js +199 -0
- package/dist/components/ThemeEditor.js +1 -1
- package/dist/components/Toast.js +1 -1
- package/dist/components/ToggleGroup.d.ts +4 -1
- package/dist/components/ToggleGroup.js +30 -13
- package/dist/components/Tooltip.d.ts +9 -3
- package/dist/components/Tooltip.js +55 -39
- package/dist/components/buttonClasses.d.ts +5 -2
- package/dist/components/buttonClasses.js +11 -10
- package/dist/components/chart.d.ts +69 -0
- package/dist/components/chart.js +145 -0
- package/dist/components/comboboxItems.d.ts +7 -1
- package/dist/components/comboboxItems.js +6 -2
- package/dist/components/dismiss.d.ts +5 -1
- package/dist/components/dismiss.js +6 -2
- package/dist/components/floating.d.ts +4 -4
- package/dist/components/floating.js +5 -5
- package/dist/components/headerActionsFit.d.ts +37 -0
- package/dist/components/headerActionsFit.js +81 -0
- package/dist/components/pageHeaderStore.d.ts +3 -0
- package/dist/components/pageHeaderStore.js +3 -0
- package/dist/components/pathBreaks.js +2 -2
- package/dist/components/popupContainer.d.ts +17 -0
- package/dist/components/popupContainer.js +69 -0
- package/dist/components/relativeTime.d.ts +21 -10
- package/dist/components/relativeTime.js +50 -22
- package/dist/components/segmented.d.ts +18 -4
- package/dist/components/segmented.js +48 -6
- package/dist/components/typedDate.d.ts +5 -0
- package/dist/components/typedDate.js +50 -0
- package/dist/components/useClosingValue.d.ts +4 -0
- package/dist/components/useClosingValue.js +12 -0
- package/dist/components/useCopy.d.ts +6 -0
- package/dist/components/useCopy.js +3 -3
- package/dist/components/useNarrow.d.ts +2 -0
- package/dist/components/useNarrow.js +16 -0
- package/dist/editor/Editor.js +1 -1
- package/dist/editor/FormCodePanel.js +1 -1
- package/dist/editor/Monaco.js +1 -1
- package/dist/editor/workers.js +1 -1
- package/dist/file-explorer/FileExplorer.js +16 -15
- package/dist/file-explorer/FileExplorerContext.js +2 -2
- package/dist/file-explorer/FilePreview/Viewer.js +3 -3
- package/dist/file-explorer/FilePreview/index.js +2 -2
- package/dist/file-explorer/FileRowsWindow.js +3 -3
- package/dist/file-explorer/FileTable.js +1 -1
- package/dist/file-explorer/LoadMoreRow.js +1 -1
- package/dist/file-explorer/TreeView.js +5 -5
- package/dist/file-explorer/helpers.js +2 -2
- package/dist/file-explorer/toasts.js +2 -2
- package/dist/form/Fields/CheckboxGroupField.js +1 -1
- package/dist/form/Fields/DropdownField.js +1 -1
- package/dist/form/Fields/DurationField.js +2 -2
- package/dist/form/Fields/MultiDropdownField.js +1 -1
- package/dist/form/Fields/NumberField.js +1 -1
- package/dist/form/Fields/ObjectField.js +1 -1
- package/dist/form/Fields/RangeField.js +1 -1
- package/dist/form/Fields/StringField.js +1 -1
- package/dist/form/Form.js +3 -3
- package/dist/form/FormLayout.js +1 -1
- package/dist/form/Wizard/WizardContainer.js +1 -1
- package/dist/form/Wizard/WizardNavigation.js +1 -1
- package/dist/form/Wizard/WizardStepContent.js +1 -1
- package/dist/form/fieldRegistry.js +1 -1
- package/dist/form/formEditing.js +1 -1
- package/dist/format.d.ts +17 -7
- package/dist/format.js +39 -16
- package/dist/graph/AnnotationBanner.js +2 -2
- package/dist/graph/Connectors.js +5 -5
- package/dist/graph/DependencyGraph.js +10 -9
- package/dist/graph/GraphEditor.js +4 -4
- package/dist/graph/GraphEditorDialogs.js +13 -12
- package/dist/graph/GraphNode.js +1 -1
- package/dist/graph/InputDialog.js +5 -5
- package/dist/graph/InputsEditor.js +10 -9
- package/dist/graph/MatrixGroup.js +2 -2
- package/dist/graph/ProblemPageLink.d.ts +9 -0
- package/dist/graph/ProblemPageLink.js +21 -0
- package/dist/graph/ProblemsButton.js +26 -16
- package/dist/graph/Reveal.js +1 -1
- package/dist/graph/RunWarningsList.js +21 -12
- package/dist/graph/ShortcutsButton.js +25 -8
- package/dist/graph/StepSummaries.js +1 -1
- package/dist/graph/TreeView.js +2 -2
- package/dist/graph/WorkflowSettingsDialog.js +3 -3
- package/dist/graph/editorApi.d.ts +10 -0
- package/dist/graph/editorFields.js +3 -3
- package/dist/graph/editorPrimitives.js +1 -1
- package/dist/graph/editorRows.js +8 -6
- package/dist/graph/editorStrings.d.ts +1 -0
- package/dist/graph/editorStrings.js +1 -0
- package/dist/graph/fieldProblems.js +2 -2
- package/dist/graph/inputRefs.js +7 -6
- package/dist/graph/runWarnings.d.ts +12 -1
- package/dist/graph/stepWith.js +2 -2
- package/dist/index.d.ts +30 -21
- package/dist/index.js +20 -12
- package/dist/list/ActionToolbar.d.ts +4 -0
- package/dist/list/ActionToolbar.js +35 -12
- package/dist/list/ListFilterBar.d.ts +42 -0
- package/dist/list/ListFilterBar.js +789 -0
- package/dist/list/ListPage.d.ts +42 -4
- package/dist/list/ListPage.js +56 -22
- package/dist/list/ListTable.d.ts +27 -3
- package/dist/list/ListTable.js +48 -23
- package/dist/list/ListToolbar.d.ts +31 -0
- package/dist/list/ListToolbar.js +43 -0
- package/dist/list/ListViewControls.d.ts +8 -4
- package/dist/list/ListViewControls.js +22 -14
- package/dist/list/UserHoverCard.d.ts +8 -2
- package/dist/list/UserHoverCard.js +26 -13
- package/dist/list/filterModel.d.ts +122 -0
- package/dist/list/filterModel.js +308 -0
- package/dist/list/index.d.ts +6 -2
- package/dist/list/index.js +6 -2
- package/dist/list/listSearch.d.ts +1 -1
- package/dist/list/listSearch.js +8 -4
- package/dist/list/listView.d.ts +24 -2
- package/dist/list/listView.js +47 -45
- package/dist/list/rowMenu.d.ts +10 -5
- package/dist/list/rowMenu.js +17 -7
- package/dist/list/useListFilters.d.ts +68 -0
- package/dist/list/useListFilters.js +252 -0
- package/dist/logviewer/LogViewer.js +4 -4
- package/dist/styles/theme.css +94 -0
- package/dist/styles.css +1 -1
- package/package.json +11 -11
- package/dist/assets/yaml.worker-k9AdOqzf.js +0 -1441
- package/dist/components/fullscreen.d.ts +0 -4
- package/dist/components/fullscreen.js +0 -18
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { cx } from "../cx.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { buttonClasses } from "./buttonClasses.js";
|
|
3
|
+
import { ChevronLeftIcon, ChevronRightIcon, MoreIcon } from "../icons.js";
|
|
4
|
+
import { useLocale, useStrings } from "./Provider.js";
|
|
5
|
+
import { AppLink } from "./AppLink.js";
|
|
4
6
|
import { IconButton } from "./IconButton.js";
|
|
7
|
+
import { formatInteger } from "../format.js";
|
|
5
8
|
import { Select } from "./Select.js";
|
|
6
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
10
|
//#region src/components/Pagination.tsx
|
|
@@ -11,10 +14,36 @@ var PAGE_SIZES = [
|
|
|
11
14
|
100,
|
|
12
15
|
200
|
|
13
16
|
];
|
|
17
|
+
/** The pages to number, counting from 0, with `null` for a gap: all of them
|
|
18
|
+
* when they fit in `max` steps, and otherwise the first and last around a
|
|
19
|
+
* window on the current one, `max` steps in all. */
|
|
20
|
+
function pageSteps(page, count, max = 7) {
|
|
21
|
+
const steps = Math.max(5, Math.floor(max));
|
|
22
|
+
const range = (from, to) => Array.from({ length: to - from + 1 }, (_, i) => from + i);
|
|
23
|
+
if (count <= steps) return range(0, count - 1);
|
|
24
|
+
if (page < steps - 3) return [
|
|
25
|
+
...range(0, steps - 3),
|
|
26
|
+
null,
|
|
27
|
+
count - 1
|
|
28
|
+
];
|
|
29
|
+
if (page > count - (steps - 2)) return [
|
|
30
|
+
0,
|
|
31
|
+
null,
|
|
32
|
+
...range(count - (steps - 2), count - 1)
|
|
33
|
+
];
|
|
34
|
+
const side = Math.floor((steps - 5) / 2);
|
|
35
|
+
return [
|
|
36
|
+
0,
|
|
37
|
+
null,
|
|
38
|
+
...range(page - side, page + side),
|
|
39
|
+
null,
|
|
40
|
+
count - 1
|
|
41
|
+
];
|
|
42
|
+
}
|
|
14
43
|
/** Steps through a list a page at a time: where the page sits in the list,
|
|
15
44
|
* previous and next, and optionally how many rows a page holds. Renders
|
|
16
45
|
* nothing when everything fits on one page. */
|
|
17
|
-
function Pagination({ page, pageSize, total, hasNext, onPageChange, pageHref, pageSizes = PAGE_SIZES, onPageSizeChange, summary, className }) {
|
|
46
|
+
function Pagination({ page, pageSize, total, hasNext, onPageChange, pageHref, pageSizes = PAGE_SIZES, onPageSizeChange, summary, pageNumbers = false, className }) {
|
|
18
47
|
const t = useStrings().list;
|
|
19
48
|
const start = page * pageSize + 1;
|
|
20
49
|
const pageEnd = (page + 1) * pageSize;
|
|
@@ -49,21 +78,40 @@ function Pagination({ page, pageSize, total, hasNext, onPageChange, pageHref, pa
|
|
|
49
78
|
})]
|
|
50
79
|
}), /* @__PURE__ */ jsxs("div", {
|
|
51
80
|
className: "flex items-center gap-1",
|
|
52
|
-
children: [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ jsx(PageStep, {
|
|
83
|
+
to: page - 1,
|
|
84
|
+
enabled: hasPrevious,
|
|
85
|
+
label: t.paginationPrevious,
|
|
86
|
+
icon: /* @__PURE__ */ jsx(ChevronLeftIcon, {}),
|
|
87
|
+
onPageChange,
|
|
88
|
+
pageHref
|
|
89
|
+
}),
|
|
90
|
+
pageNumbers && pageCount !== void 0 && pageCount > 1 && /* @__PURE__ */ jsx("ol", {
|
|
91
|
+
className: "m-0 hidden list-none items-center gap-1 p-0 sm:flex",
|
|
92
|
+
children: pageSteps(page, pageCount, typeof pageNumbers === "object" ? pageNumbers.max : void 0).map((step, i) => /* @__PURE__ */ jsx("li", {
|
|
93
|
+
className: "flex",
|
|
94
|
+
children: step === null ? /* @__PURE__ */ jsx(MoreIcon, {
|
|
95
|
+
"aria-hidden": "true",
|
|
96
|
+
className: "size-3.5 w-5 text-(--theme-muted-text-color)"
|
|
97
|
+
}) : /* @__PURE__ */ jsx(PageNumber, {
|
|
98
|
+
to: step,
|
|
99
|
+
current: step === page,
|
|
100
|
+
label: t.page(step + 1),
|
|
101
|
+
onPageChange,
|
|
102
|
+
pageHref
|
|
103
|
+
})
|
|
104
|
+
}, step ?? `gap-${i}`))
|
|
105
|
+
}),
|
|
106
|
+
/* @__PURE__ */ jsx(PageStep, {
|
|
107
|
+
to: page + 1,
|
|
108
|
+
enabled: hasMore,
|
|
109
|
+
label: t.paginationNext,
|
|
110
|
+
icon: /* @__PURE__ */ jsx(ChevronRightIcon, {}),
|
|
111
|
+
onPageChange,
|
|
112
|
+
pageHref
|
|
113
|
+
})
|
|
114
|
+
]
|
|
67
115
|
})]
|
|
68
116
|
});
|
|
69
117
|
}
|
|
@@ -82,5 +130,28 @@ function PageStep({ to, enabled, label, icon, onPageChange, pageHref }) {
|
|
|
82
130
|
onClick: () => onPageChange?.(to)
|
|
83
131
|
});
|
|
84
132
|
}
|
|
133
|
+
var numberClassName = cx(buttonClasses({
|
|
134
|
+
variant: "outline",
|
|
135
|
+
size: "sm"
|
|
136
|
+
}), "min-w-7 px-1.5 tabular-nums aria-[current=page]:border-(--theme-link) aria-[current=page]:bg-(--theme-accent-subtle) aria-[current=page]:text-(--theme-app)");
|
|
137
|
+
function PageNumber({ to, current, label, onPageChange, pageHref }) {
|
|
138
|
+
const number = formatInteger(to + 1, useLocale());
|
|
139
|
+
const props = {
|
|
140
|
+
"aria-label": label,
|
|
141
|
+
"aria-current": current ? "page" : void 0,
|
|
142
|
+
className: numberClassName
|
|
143
|
+
};
|
|
144
|
+
if (pageHref) return /* @__PURE__ */ jsx(AppLink, {
|
|
145
|
+
...props,
|
|
146
|
+
href: pageHref(to),
|
|
147
|
+
children: number
|
|
148
|
+
});
|
|
149
|
+
return /* @__PURE__ */ jsx("button", {
|
|
150
|
+
type: "button",
|
|
151
|
+
...props,
|
|
152
|
+
onClick: () => !current && onPageChange?.(to),
|
|
153
|
+
children: number
|
|
154
|
+
});
|
|
155
|
+
}
|
|
85
156
|
//#endregion
|
|
86
|
-
export { PAGE_SIZES, Pagination };
|
|
157
|
+
export { PAGE_SIZES, Pagination, pageSteps };
|
|
@@ -29,6 +29,12 @@ export interface PopoverOptions extends Omit<BasePopover.Popup.Props, 'className
|
|
|
29
29
|
/** Also opens while the pointer rests on the trigger. A click or a tap still
|
|
30
30
|
* opens it, so touch and keyboard users reach it too. */
|
|
31
31
|
openOnHover?: boolean;
|
|
32
|
+
/** With `openOnHover`, how long the pointer rests on the trigger before it opens, in
|
|
33
|
+
* milliseconds. 0 opens it at once, as for a collapsed rail's flyout. */
|
|
34
|
+
hoverDelay?: number | undefined;
|
|
35
|
+
/** With `openOnHover`, how long it stays open after the pointer leaves, in milliseconds,
|
|
36
|
+
* so the pointer can cross the gap to it. */
|
|
37
|
+
hoverCloseDelay?: number | undefined;
|
|
32
38
|
/** Where focus goes on opening: the first control in it, the panel itself for
|
|
33
39
|
* a list read before one item in it is picked, or nowhere, for a popover that
|
|
34
40
|
* offers an action on what the reader is doing, such as copying a selection. */
|
|
@@ -39,8 +45,16 @@ export interface PopoverOptions extends Omit<BasePopover.Popup.Props, 'className
|
|
|
39
45
|
/** Stays on `side` where it doesn't fit rather than flipping to the other, for a popup that
|
|
40
46
|
* must not cover what is there, such as the control a tip describes while it is typed in. */
|
|
41
47
|
keepSide?: boolean | undefined;
|
|
42
|
-
/**
|
|
48
|
+
/** At phone width, under 640px, opens as a sheet along the bottom of the screen, as wide as
|
|
49
|
+
* the screen and scrolling inside, rather than in the strip of page beside its trigger. On
|
|
50
|
+
* by default for a panel with a trigger; off for a tip and for a popover opened `at` a point,
|
|
51
|
+
* which belongs where the reader is. */
|
|
52
|
+
sheet?: boolean | undefined;
|
|
53
|
+
/** `panel` holds controls or a list; `tip` is a tooltip-sized note in the tooltip's look. */
|
|
43
54
|
variant?: 'panel' | 'tip';
|
|
55
|
+
/** A panel's content reaches its edges, such as a list of suggestions whose rows pad
|
|
56
|
+
* themselves and highlight edge to edge. A title keeps its own padding. */
|
|
57
|
+
flush?: boolean | undefined;
|
|
44
58
|
/** On the popup: its width, padding or text size. */
|
|
45
59
|
className?: string;
|
|
46
60
|
children: ReactNode;
|
|
@@ -49,5 +63,5 @@ export interface PopoverOptions extends Omit<BasePopover.Popup.Props, 'className
|
|
|
49
63
|
* flips and shifts to stay on screen, closes on Escape or a press outside, and
|
|
50
64
|
* returns focus to the trigger. Use a Menu for a list of actions, and a
|
|
51
65
|
* HoverCard for a preview a link already leads to. */
|
|
52
|
-
export declare function Popover({ trigger, at, title, open, defaultOpen, onOpenChange, side, align, openOnHover, initialFocus, anchor, keepSide, variant, className, children, ...popupProps }: PopoverProps): import("react").JSX.Element;
|
|
66
|
+
export declare function Popover({ trigger, at, title, open, defaultOpen, onOpenChange, side, align, openOnHover, hoverDelay, hoverCloseDelay, initialFocus, anchor, keepSide, variant, sheet, flush, className, children, ...popupProps }: PopoverProps): import("react").JSX.Element;
|
|
53
67
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { cx } from "../cx.js";
|
|
2
2
|
import { panelClassName, positionerClassName, tipClassName, toPositionerAnchor } from "./floating.js";
|
|
3
|
-
import {
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { usePopupContainer } from "./popupContainer.js";
|
|
5
4
|
import { createContext, use, useCallback, useRef } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Popover } from "@base-ui/react/popover";
|
|
7
7
|
//#region src/components/Popover.tsx
|
|
8
8
|
/** A button that closes the popover it sits in. */
|
|
@@ -13,13 +13,16 @@ var CloseContext = createContext(() => {});
|
|
|
13
13
|
function useClosePopover() {
|
|
14
14
|
return use(CloseContext);
|
|
15
15
|
}
|
|
16
|
+
var sheetPositionerClassName = "max-sm:fixed! max-sm:inset-x-2! max-sm:top-auto! max-sm:bottom-[max(8px,env(safe-area-inset-bottom))]! max-sm:transform-none!";
|
|
17
|
+
var sheetPopupClassName = "max-sm:w-auto! max-sm:max-w-none! max-sm:max-h-[min(75dvh,calc(100dvh-16px))]! max-sm:origin-bottom!";
|
|
16
18
|
/** A panel anchored to its trigger, over the page so no container clips it. It
|
|
17
19
|
* flips and shifts to stay on screen, closes on Escape or a press outside, and
|
|
18
20
|
* returns focus to the trigger. Use a Menu for a list of actions, and a
|
|
19
21
|
* HoverCard for a preview a link already leads to. */
|
|
20
|
-
function Popover$1({ trigger, at, title, open, defaultOpen, onOpenChange, side = "bottom", align = "center", openOnHover = false, initialFocus = "first-control", anchor, keepSide = false, variant = "panel", className, children, ...popupProps }) {
|
|
21
|
-
const
|
|
22
|
+
function Popover$1({ trigger, at, title, open, defaultOpen, onOpenChange, side = "bottom", align = "center", openOnHover = false, hoverDelay = 300, hoverCloseDelay = 150, initialFocus = "first-control", anchor, keepSide = false, variant = "panel", sheet, flush = false, className, children, ...popupProps }) {
|
|
23
|
+
const portal = usePopupContainer();
|
|
22
24
|
const tip = variant === "tip";
|
|
25
|
+
const asSheet = sheet ?? (!tip && !at);
|
|
23
26
|
const popup = useRef(null);
|
|
24
27
|
const actions = useRef(null);
|
|
25
28
|
const close = useCallback(() => actions.current?.close(), []);
|
|
@@ -32,35 +35,31 @@ function Popover$1({ trigger, at, title, open, defaultOpen, onOpenChange, side =
|
|
|
32
35
|
render: trigger,
|
|
33
36
|
openOnHover,
|
|
34
37
|
...openOnHover ? {
|
|
35
|
-
delay:
|
|
36
|
-
closeDelay:
|
|
38
|
+
delay: hoverDelay,
|
|
39
|
+
closeDelay: hoverCloseDelay
|
|
37
40
|
} : {}
|
|
38
41
|
}), /* @__PURE__ */ jsx(Popover.Portal, {
|
|
39
|
-
|
|
42
|
+
...portal,
|
|
40
43
|
children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
41
44
|
side,
|
|
42
45
|
align,
|
|
43
|
-
sideOffset:
|
|
46
|
+
sideOffset: 6,
|
|
44
47
|
collisionPadding: 8,
|
|
45
48
|
...keepSide && { collisionAvoidance: { side: "none" } },
|
|
46
49
|
...at ? { anchor: toPositionerAnchor(at) } : anchor ? { anchor } : {},
|
|
47
|
-
className: positionerClassName,
|
|
50
|
+
className: cx(positionerClassName, asSheet && sheetPositionerClassName),
|
|
48
51
|
children: /* @__PURE__ */ jsxs(Popover.Popup, {
|
|
49
52
|
...popupProps,
|
|
50
53
|
ref: popup,
|
|
51
54
|
initialFocus: initialFocus === "popup" ? popup : initialFocus === "first-control",
|
|
52
|
-
className: cx(tip ? cx("
|
|
53
|
-
children: [
|
|
54
|
-
|
|
55
|
-
title
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
value: close,
|
|
61
|
-
children
|
|
62
|
-
})
|
|
63
|
-
]
|
|
55
|
+
className: cx(tip ? cx("text-left", tipClassName) : cx(panelClassName, "max-h-(--available-height) max-w-[calc(100vw-16px)] overflow-y-auto", !flush && "p-3"), className, asSheet && sheetPopupClassName),
|
|
56
|
+
children: [title && /* @__PURE__ */ jsx(Popover.Title, {
|
|
57
|
+
className: cx("mb-2 text-sm font-semibold", flush && !tip && "px-3 pt-3"),
|
|
58
|
+
children: title
|
|
59
|
+
}), /* @__PURE__ */ jsx(CloseContext, {
|
|
60
|
+
value: close,
|
|
61
|
+
children
|
|
62
|
+
})]
|
|
64
63
|
})
|
|
65
64
|
})
|
|
66
65
|
})]
|
|
@@ -4,6 +4,7 @@ import type { WorkflowAction, WorkflowEditing } from '../editing.js';
|
|
|
4
4
|
import type { WorkflowEngine } from '../engine.js';
|
|
5
5
|
import type { GraphEditorText, InputsEditorText } from '../graph/editorStrings.js';
|
|
6
6
|
import type { RunLink } from '../graph/types.js';
|
|
7
|
+
import type { FilterOperator } from '../list/filterModel.js';
|
|
7
8
|
export interface UIStrings {
|
|
8
9
|
modal: {
|
|
9
10
|
creating: string;
|
|
@@ -59,6 +60,8 @@ export interface UIStrings {
|
|
|
59
60
|
copyThing: (label: string) => string;
|
|
60
61
|
copiedThing: (label: string) => string;
|
|
61
62
|
copyThingFailed: (label: string) => string;
|
|
63
|
+
/** A count past a badge's cap, `max` already formatted, such as "99+". */
|
|
64
|
+
countOverflow: (max: string) => string;
|
|
62
65
|
/** Read out where a value is missing, which shows as a dash. */
|
|
63
66
|
noValue: string;
|
|
64
67
|
/** A name field's rule: the characters a key or identifier allows. */
|
|
@@ -109,6 +112,12 @@ export interface UIStrings {
|
|
|
109
112
|
refreshing: string;
|
|
110
113
|
/** A refresh button's label once it knows when the data was fetched. */
|
|
111
114
|
updated: (ago: string) => string;
|
|
115
|
+
/** Read with a "+3" chip that stands for the items a list leaves out. */
|
|
116
|
+
moreCount: (count: number) => string;
|
|
117
|
+
/** Names the button that copies the text selected in a block. */
|
|
118
|
+
copySelection: string;
|
|
119
|
+
/** Read in place of a masked secret's dots. */
|
|
120
|
+
hiddenValue: string;
|
|
112
121
|
};
|
|
113
122
|
dropdown: {
|
|
114
123
|
select: (type: string) => string;
|
|
@@ -118,6 +127,10 @@ export interface UIStrings {
|
|
|
118
127
|
showOptions: string;
|
|
119
128
|
/** The row that adds typed text as a new value. */
|
|
120
129
|
add: (text: string) => string;
|
|
130
|
+
/** The row that creates the thing typed text names, such as a new label. */
|
|
131
|
+
create: (text: string) => string;
|
|
132
|
+
/** Heads the values offered under a tag field. */
|
|
133
|
+
suggested: string;
|
|
121
134
|
/** In place of the placeholder once a field holds as many values as it takes. */
|
|
122
135
|
limitReached: (max: number) => string;
|
|
123
136
|
/** Names the button on a chosen value's chip that takes it out. */
|
|
@@ -130,6 +143,10 @@ export interface UIStrings {
|
|
|
130
143
|
time: string;
|
|
131
144
|
previousMonth: string;
|
|
132
145
|
nextMonth: string;
|
|
146
|
+
/** Names the box in the calendar's popup that takes a typed date. */
|
|
147
|
+
typeDate: string;
|
|
148
|
+
/** Under the box while what is typed isn't a date that can be chosen. */
|
|
149
|
+
invalidDate: string;
|
|
133
150
|
};
|
|
134
151
|
colorInput: {
|
|
135
152
|
/** Names the picker beside the hex field: the field's name, or none when it has no plain one. */
|
|
@@ -271,6 +288,8 @@ export interface UIStrings {
|
|
|
271
288
|
/** How many warnings: the title of a run's list of warnings, and the name of the mark on a job
|
|
272
289
|
* or step they're about, such as "2 warnings". */
|
|
273
290
|
warningCount: (count: number) => string;
|
|
291
|
+
/** The link from a warning to the page that explains it, when it has one. */
|
|
292
|
+
warningAbout: string;
|
|
274
293
|
};
|
|
275
294
|
jobActions: {
|
|
276
295
|
openSubworkflowLogs: string;
|
|
@@ -535,12 +554,37 @@ export interface UIStrings {
|
|
|
535
554
|
/** A step's name in the list of steps, numbered from 1. */
|
|
536
555
|
stepLabel: (number: number, title: string) => string;
|
|
537
556
|
};
|
|
557
|
+
/** A compact relative time ("5m", "3h"), which reads as a date after a week. */
|
|
538
558
|
time: {
|
|
539
559
|
now: string;
|
|
540
560
|
minutes: (n: number) => string;
|
|
541
561
|
hours: (n: number) => string;
|
|
542
562
|
days: (n: number) => string;
|
|
563
|
+
/** @deprecated A compact time reads as a date once it is a week away, so no longer counts in years. */
|
|
543
564
|
years: (n: number) => string;
|
|
565
|
+
/** A compact time still to come, such as "in 5m"; `label` is one of the counts above. */
|
|
566
|
+
inFuture: (label: string) => string;
|
|
567
|
+
/** A compact time a week or more away, such as "Sep 4"; by default with the year only while
|
|
568
|
+
* it isn't this year. `locale` is UIProvider's, when the host gives one. */
|
|
569
|
+
date: (date: Date, locale?: string) => string;
|
|
570
|
+
};
|
|
571
|
+
/** Key names in a shortcut, as keycaps carry them off an Apple keyboard, such as
|
|
572
|
+
* "Strg" for Control in German. An Apple keyboard shows its symbols: ⌘ ⌥ ⇧ ⌃. */
|
|
573
|
+
keys: {
|
|
574
|
+
ctrl: string;
|
|
575
|
+
alt: string;
|
|
576
|
+
shift: string;
|
|
577
|
+
meta: string;
|
|
578
|
+
enter: string;
|
|
579
|
+
escape: string;
|
|
580
|
+
space: string;
|
|
581
|
+
tab: string;
|
|
582
|
+
backspace: string;
|
|
583
|
+
delete: string;
|
|
584
|
+
};
|
|
585
|
+
chart: {
|
|
586
|
+
/** The row under a chart's tooltip that sums its series. */
|
|
587
|
+
total: string;
|
|
544
588
|
};
|
|
545
589
|
list: {
|
|
546
590
|
moreActions: string;
|
|
@@ -552,6 +596,8 @@ export interface UIStrings {
|
|
|
552
596
|
labelId: string;
|
|
553
597
|
labelUrl: string;
|
|
554
598
|
couldNotLoad: (noun: string) => string;
|
|
599
|
+
/** What `ListError` says under its heading when the host gives no message of its own. */
|
|
600
|
+
couldNotLoadHint: string;
|
|
555
601
|
/** What `ListError` names when the host gives no noun. */
|
|
556
602
|
data: string;
|
|
557
603
|
/** A list's size, as `ListCount` shows it; `count` is formatted and `noun` agrees with it. */
|
|
@@ -584,11 +630,79 @@ export interface UIStrings {
|
|
|
584
630
|
paginationPrevious: string;
|
|
585
631
|
paginationNext: string;
|
|
586
632
|
pagination: string;
|
|
633
|
+
/** A numbered page's name in `Pagination`, counting from 1. */
|
|
634
|
+
page: (page: number) => string;
|
|
587
635
|
removeSearchTerm: (term: string) => string;
|
|
588
636
|
};
|
|
637
|
+
/** The chip row of a list's active filters, its Filter menu and its pickers. Field and option
|
|
638
|
+
* labels come from the host's fields, already translated. */
|
|
639
|
+
filters: {
|
|
640
|
+
/** The button at the end of the chip row that adds one, and the Filter menu's heading. */
|
|
641
|
+
addFilter: string;
|
|
642
|
+
/** Names the Filter menu's search over the fields. */
|
|
643
|
+
searchFields: string;
|
|
644
|
+
/** Names the chip row. */
|
|
645
|
+
activeFilters: string;
|
|
646
|
+
/** The toolbar's Filter button, saying how many filters are on, since its dot is only seen. */
|
|
647
|
+
filterButton: (count: number) => string;
|
|
648
|
+
/** A required or pinned filter's value while it has none. */
|
|
649
|
+
any: string;
|
|
650
|
+
/** The value part of a chip just added, until a value is chosen. */
|
|
651
|
+
pending: string;
|
|
652
|
+
/** A condition, worded for how many values follow it: "is" / "is any of". */
|
|
653
|
+
operator: (op: FilterOperator, count: number) => string;
|
|
654
|
+
/** After the first values shown in a chip: "+3". */
|
|
655
|
+
more: (count: number) => string;
|
|
656
|
+
/** At phone width, the chip that opens every filter in a sheet: "+3 filters". */
|
|
657
|
+
overflow: (count: number) => string;
|
|
658
|
+
/** The sheet's title. */
|
|
659
|
+
sheetTitle: string;
|
|
660
|
+
/** Names a chip's remove button. */
|
|
661
|
+
remove: (field: string) => string;
|
|
662
|
+
/** Names a chip, read as a sentence. */
|
|
663
|
+
chip: (field: string, operator: string, values: string) => string;
|
|
664
|
+
/** Names a chip's field part, which picks another field. */
|
|
665
|
+
changeField: (field: string) => string;
|
|
666
|
+
/** Names a chip's condition part. */
|
|
667
|
+
changeOperator: (operator: string) => string;
|
|
668
|
+
/** Names a chip's value part. */
|
|
669
|
+
changeValue: (values: string) => string;
|
|
670
|
+
/** Joins the values a chip lists. */
|
|
671
|
+
list: (values: string[]) => string;
|
|
672
|
+
/** A relative date preset: `today`, `-7d`, `-30d`, `-90d` or `month`; any `-Nd`. */
|
|
673
|
+
datePreset: (preset: string) => string;
|
|
674
|
+
/** The date picker's entry that picks days on a calendar. */
|
|
675
|
+
customDate: string;
|
|
676
|
+
/** Two days a filter spans. */
|
|
677
|
+
between: (from: string, to: string) => string;
|
|
678
|
+
/** A day in a chip; by default without the year while it is this year. `locale` is
|
|
679
|
+
* UIProvider's, when the host gives one. */
|
|
680
|
+
formatDate: (date: Date, locale?: string) => string;
|
|
681
|
+
/** The text picker's hint. */
|
|
682
|
+
textPlaceholder: string;
|
|
683
|
+
/** A yes-or-no filter's values. */
|
|
684
|
+
yes: string;
|
|
685
|
+
no: string;
|
|
686
|
+
};
|
|
687
|
+
/** `ErrorPage`'s words: the way back, and a title and description for each kind of error. */
|
|
688
|
+
errorPage: {
|
|
689
|
+
/** Back through the browser's history. */
|
|
690
|
+
back: string;
|
|
691
|
+
/** Back to the app's start, when there is no history to go back through. */
|
|
692
|
+
home: string;
|
|
693
|
+
/** The title when nothing more is known about the error. */
|
|
694
|
+
error: string;
|
|
695
|
+
/** The title for a status no kind covers, such as 418. */
|
|
696
|
+
statusTitle: (status: string) => string;
|
|
697
|
+
titles: Record<ErrorPageKind, string>;
|
|
698
|
+
descriptions: Record<ErrorPageKind, string>;
|
|
699
|
+
};
|
|
589
700
|
}
|
|
590
|
-
/** What
|
|
591
|
-
*
|
|
701
|
+
/** What went wrong, which picks an `ErrorPage`'s words: `notFound` (404),
|
|
702
|
+
* `forbidden` (403), `unauthenticated` (401), `unavailable` (502, 503 and
|
|
703
|
+
* 504), `server` (any other 5xx), and `network` for a request that never
|
|
704
|
+
* reached the server. */
|
|
705
|
+
export type ErrorPageKind = 'notFound' | 'forbidden' | 'unauthenticated' | 'unavailable' | 'server' | 'network';
|
|
592
706
|
export type UIStringOverrides = Overrides<UIStrings>;
|
|
593
707
|
type Overrides<T> = {
|
|
594
708
|
[K in keyof T]?: T[K] extends (...args: never[]) => unknown ? T[K] : T[K] extends readonly unknown[] ? T[K] : T[K] extends object ? Overrides<T[K]> : T[K];
|
|
@@ -599,6 +713,13 @@ export interface UINavigation {
|
|
|
599
713
|
* `sourceUrl` is a page the server resolved for it, when there is one. */
|
|
600
714
|
openStepSource: (uses: string, sourceUrl?: string) => void;
|
|
601
715
|
openExternal: (href: string) => void;
|
|
716
|
+
/** Goes back one entry in the history, such as an error page's "Back". Bind it
|
|
717
|
+
* to the router's history; the browser's by default. */
|
|
718
|
+
goBack: () => void;
|
|
719
|
+
/** Whether there is an entry of this app's to go back to; when there isn't, an
|
|
720
|
+
* error page offers the way home instead. Bind it to the router's own
|
|
721
|
+
* answer; by default, whether the tab's history holds more than this page. */
|
|
722
|
+
canGoBack: () => boolean;
|
|
602
723
|
}
|
|
603
724
|
export type WorkflowJsonRef = {
|
|
604
725
|
kind: 'marketplace';
|
|
@@ -614,6 +735,22 @@ export interface RunFileResult {
|
|
|
614
735
|
error: unknown;
|
|
615
736
|
}
|
|
616
737
|
export type PersistedStateHook = <T>(key: string, defaultValue: T) => [T, Dispatch<SetStateAction<T>>];
|
|
738
|
+
/** The values a problem's message shows, by name, as a problem's `params` carries them. */
|
|
739
|
+
export type ProblemParams = Readonly<Record<string, string | number>>;
|
|
740
|
+
/** A problem code's message in the reader's language, with its params; undefined when the host has
|
|
741
|
+
* none for the code. `type` is the problem's type URI: one that names an application, such as
|
|
742
|
+
* `/problems/workflow/undefined_input`, picks that application's message for the code over the
|
|
743
|
+
* host's own. */
|
|
744
|
+
export type ProblemMessage = (code: string, params?: ProblemParams, type?: string) => string | undefined;
|
|
745
|
+
/** A problem that may carry a code: a run's warning, or one the workflow editor marks. */
|
|
746
|
+
export interface CodedProblem {
|
|
747
|
+
/** Its text as the server wrote it, shown when the host has no message for its code. */
|
|
748
|
+
message: string;
|
|
749
|
+
code?: string | null | undefined;
|
|
750
|
+
params?: ProblemParams | null | undefined;
|
|
751
|
+
/** Its type URI, which the host's message for its code is looked up by too. */
|
|
752
|
+
type?: string | null | undefined;
|
|
753
|
+
}
|
|
617
754
|
export interface UIData {
|
|
618
755
|
/**
|
|
619
756
|
* Host-bound hook resolving a file in a run's artifact tree (logs, scripts).
|
|
@@ -644,6 +781,14 @@ export interface UIData {
|
|
|
644
781
|
error?: string;
|
|
645
782
|
}>;
|
|
646
783
|
usePersistedState: PersistedStateHook;
|
|
784
|
+
/**
|
|
785
|
+
* Host-bound hook returning a problem code's message in the reader's language, such as
|
|
786
|
+
* `useCodeMessage` from `@parallelworks/problem/react`. A run's warnings and the editor's
|
|
787
|
+
* problems that carry a `code` show it, given their `params` and `type`, and their own `message`
|
|
788
|
+
* when it gives nothing. Absent, they show their `message`. Must be a stable function reference —
|
|
789
|
+
* components call it as a hook.
|
|
790
|
+
*/
|
|
791
|
+
useProblemMessage: () => ProblemMessage;
|
|
647
792
|
}
|
|
648
793
|
import type { FieldComponent } from '../form/fieldRegistry.js';
|
|
649
794
|
import type { Breadcrumb } from './Breadcrumbs.js';
|
|
@@ -715,7 +860,17 @@ export interface UISlots {
|
|
|
715
860
|
}
|
|
716
861
|
/** An engine, or a loader so the host can keep the engine out of its first-load bundle. */
|
|
717
862
|
export type WorkflowEngineSource = WorkflowEngine | (() => Promise<WorkflowEngine>);
|
|
863
|
+
/** How avatars without a picture are colored. `name` gives each person a color from the theme's
|
|
864
|
+
* categorical palette, picked by name, and one initial for a one-word name. `kind` gives every
|
|
865
|
+
* person one tint and every agent another (and a square), with two initials for a one-word name,
|
|
866
|
+
* for an app that tells people and agents apart at a glance. */
|
|
867
|
+
export type AvatarColoring = 'name' | 'kind';
|
|
718
868
|
export declare function useStrings(): UIStrings;
|
|
869
|
+
/** The host's locale for dates and times, such as `de-DE`. Undefined without one, which leaves
|
|
870
|
+
* each format's own default: the date library's for its times, the browser's for the rest. */
|
|
871
|
+
export declare function useLocale(): string | undefined;
|
|
872
|
+
/** How the host colors avatars, UIProvider's `avatarColoring`. */
|
|
873
|
+
export declare function useAvatarColoring(): AvatarColoring;
|
|
719
874
|
export declare function useNavigation(): UINavigation;
|
|
720
875
|
export declare function useWorkflowJsonResolver(): UIData['resolveWorkflowJson'];
|
|
721
876
|
export declare function useRepoSuggestions(): UIData['repoSuggestions'];
|
|
@@ -735,6 +890,9 @@ export declare function useProvisionCorsRules(): UIData['provisionCorsRules'];
|
|
|
735
890
|
export declare function useRunFile(slug: string, path: string | null, options?: {
|
|
736
891
|
refreshInterval?: number;
|
|
737
892
|
}): RunFileResult;
|
|
893
|
+
/** A coded problem's text in the reader's language: the host's message for its code and type, or
|
|
894
|
+
* else its own `message`. */
|
|
895
|
+
export declare function useProblemText(): (problem: CodedProblem) => string;
|
|
738
896
|
export declare function usePersistedState<T>(key: string, defaultValue: T): [T, Dispatch<SetStateAction<T>>];
|
|
739
897
|
export interface UIProviderProps {
|
|
740
898
|
/** Translations over the English defaults, at any depth. Define them outside a component, or
|
|
@@ -742,8 +900,9 @@ export interface UIProviderProps {
|
|
|
742
900
|
strings?: UIStringOverrides | undefined;
|
|
743
901
|
/** How the package navigates; read at the moment it navigates, so a new one never re-renders. */
|
|
744
902
|
navigation?: Partial<UINavigation> | undefined;
|
|
745
|
-
/** The host's data hooks and resolvers. `useRunFile
|
|
746
|
-
* hooks, so each must stay the same function for the life of
|
|
903
|
+
/** The host's data hooks and resolvers. `useRunFile`, `usePersistedState` and
|
|
904
|
+
* `useProblemMessage` are called as hooks, so each must stay the same function for the life of
|
|
905
|
+
* the app. */
|
|
747
906
|
data?: Partial<UIData> | undefined;
|
|
748
907
|
/** Components the host renders inside the package's; a component made each render would
|
|
749
908
|
* remount everything it renders. */
|
|
@@ -756,7 +915,15 @@ export interface UIProviderProps {
|
|
|
756
915
|
* that places them before hydration. The components render no inline
|
|
757
916
|
* `<style>`, so a policy without 'unsafe-inline' styles needs none. */
|
|
758
917
|
nonce?: string | undefined;
|
|
918
|
+
/** The locale dates and times read in, such as `de-DE`, as a BCP 47 tag: relative times,
|
|
919
|
+
* exact times and the date picker. Pass the app's language, so they read as its own text
|
|
920
|
+
* does. Without one they follow the date library's default locale, or the browser's. */
|
|
921
|
+
locale?: string | undefined;
|
|
922
|
+
/** How avatars without a picture are colored: by name (the default), or by kind, where people
|
|
923
|
+
* share one tint and agents another, set by `--avatar-person` and `--avatar-agent` (see
|
|
924
|
+
* `Avatar`). */
|
|
925
|
+
avatarColoring?: AvatarColoring | undefined;
|
|
759
926
|
children: React.ReactNode;
|
|
760
927
|
}
|
|
761
|
-
export declare function UIProvider({ strings, navigation, data, slots, engine: engineProp, nonce, children, }: UIProviderProps): import("react").JSX.Element;
|
|
928
|
+
export declare function UIProvider({ strings, navigation, data, slots, engine: engineProp, nonce, locale, avatarColoring, children, }: UIProviderProps): import("react").JSX.Element;
|
|
762
929
|
export {};
|