@parallelworks/ui 0.50.0 → 0.52.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 +204 -18
- package/dist/ai/agent/toolStrings.d.ts +2 -0
- package/dist/ai/agent/toolStrings.js +20 -18
- package/dist/ai/ai.css +12 -0
- package/dist/ai/components/AllocationSelector.js +5 -1
- package/dist/ai/components/AttachmentManager.js +51 -42
- package/dist/ai/components/AttachmentUpload.d.ts +4 -2
- package/dist/ai/components/AttachmentUpload.js +9 -9
- package/dist/ai/components/BlockedGroupBanner.js +8 -14
- package/dist/ai/components/BranchNavigator.js +11 -12
- package/dist/ai/components/ChatEmptyState.js +12 -19
- package/dist/ai/components/ChatInput.d.ts +4 -3
- package/dist/ai/components/ChatInput.js +27 -13
- package/dist/ai/components/ChatMessage.js +45 -121
- package/dist/ai/components/ChatMessageList.d.ts +5 -2
- package/dist/ai/components/ChatMessageList.js +89 -51
- package/dist/ai/components/ChatSidebar.js +11 -7
- package/dist/ai/components/ChatThread.js +1 -13
- package/dist/ai/components/DragOverlay.js +3 -3
- package/dist/ai/components/MessageAttachments.d.ts +10 -0
- package/dist/ai/components/MessageAttachments.js +78 -0
- package/dist/ai/components/ModelSelector.js +4 -4
- package/dist/ai/components/PastedText.js +2 -2
- package/dist/ai/components/ProviderIssueBanner.js +19 -23
- package/dist/ai/components/ShareDialog.js +2 -2
- package/dist/ai/components/agent/ActivityLine.d.ts +0 -2
- package/dist/ai/components/agent/ActivityLine.js +8 -51
- package/dist/ai/components/agent/AgentMessageParts.js +117 -56
- package/dist/ai/core/ChatProvider.d.ts +16 -5
- package/dist/ai/core/ChatProvider.js +41 -8
- package/dist/ai/core/config.js +4 -3
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.js +3 -3
- package/dist/ai/strings.d.ts +29 -3
- package/dist/ai/strings.js +81 -26
- package/dist/ai/types.d.ts +4 -0
- package/dist/ai/ui/Notice.d.ts +2 -2
- package/dist/ai/ui/Notice.js +29 -62
- package/dist/ai/ui/sidebar.d.ts +5 -3
- package/dist/ai/ui/sidebar.js +21 -9
- package/dist/components/ActionMenu.d.ts +1 -0
- package/dist/components/ActionMenu.js +6 -1
- package/dist/components/AppLink.d.ts +26 -0
- package/dist/components/AppLink.js +51 -0
- package/dist/components/Avatar.d.ts +2 -1
- package/dist/components/Avatar.js +4 -2
- package/dist/components/Button.d.ts +15 -5
- package/dist/components/Button.js +47 -40
- package/dist/components/Callout.d.ts +31 -7
- package/dist/components/Callout.js +51 -24
- package/dist/components/Card.d.ts +11 -6
- package/dist/components/Card.js +14 -8
- package/dist/components/Checkbox.js +2 -1
- package/dist/components/ColorInput.js +5 -3
- package/dist/components/Combobox.js +49 -19
- package/dist/components/ConfirmModal.d.ts +19 -8
- package/dist/components/ConfirmModal.js +31 -53
- package/dist/components/CopyButton.d.ts +38 -0
- package/dist/components/CopyButton.js +68 -0
- package/dist/components/CreateModal.js +118 -111
- package/dist/components/DatePicker.js +12 -8
- package/dist/components/DescriptionList.d.ts +51 -17
- package/dist/components/DescriptionList.js +117 -31
- package/dist/components/Disclosure.js +1 -1
- package/dist/components/Drawer.js +10 -16
- package/dist/components/Field.d.ts +15 -5
- package/dist/components/Field.js +41 -9
- package/dist/components/IconButton.d.ts +14 -5
- package/dist/components/IconButton.js +25 -14
- package/dist/components/InfoTip.d.ts +4 -1
- package/dist/components/InfoTip.js +2 -1
- package/dist/components/Input.d.ts +14 -8
- package/dist/components/Input.js +46 -31
- package/dist/components/Loader.js +1 -1
- package/dist/components/MenuEntries.d.ts +43 -12
- package/dist/components/MenuEntries.js +34 -19
- package/dist/components/Meter.js +5 -4
- package/dist/components/Modal.d.ts +28 -4
- package/dist/components/Modal.js +37 -14
- package/dist/components/Overview.d.ts +20 -12
- package/dist/components/Overview.js +14 -9
- package/dist/components/PageHeader.d.ts +47 -65
- package/dist/components/PageHeader.js +275 -153
- package/dist/components/PageHeaderAction.d.ts +67 -0
- package/dist/components/PageHeaderAction.js +107 -0
- package/dist/components/Pagination.js +6 -16
- package/dist/components/Popover.js +3 -2
- package/dist/components/Provider.d.ts +79 -19
- package/dist/components/Provider.js +140 -130
- package/dist/components/Radio.js +2 -1
- package/dist/components/RefreshButton.js +7 -8
- package/dist/components/RequiredMark.js +1 -1
- package/dist/components/RunStatusIcon.js +2 -2
- package/dist/components/Section.js +1 -1
- package/dist/components/Select.d.ts +4 -9
- package/dist/components/Select.js +24 -11
- package/dist/components/SettingModeOption.d.ts +1 -1
- package/dist/components/SettingModeOption.js +7 -1
- package/dist/components/SettingsCard.d.ts +5 -3
- package/dist/components/SettingsCard.js +27 -20
- package/dist/components/Slider.js +1 -1
- package/dist/components/StatusBadge.js +2 -2
- package/dist/components/StatusIcons.js +2 -2
- package/dist/components/Switch.js +5 -4
- package/dist/components/Table.d.ts +30 -20
- package/dist/components/Table.js +50 -73
- package/dist/components/Tabs.d.ts +3 -7
- package/dist/components/Tabs.js +6 -10
- package/dist/components/ThemeEditor.js +24 -14
- package/dist/components/Toast.d.ts +11 -3
- package/dist/components/Toast.js +47 -22
- package/dist/components/buttonClasses.js +2 -2
- package/dist/components/comboboxItems.d.ts +4 -0
- package/dist/components/comboboxItems.js +6 -1
- package/dist/components/dismiss.d.ts +12 -0
- package/dist/components/dismiss.js +19 -0
- package/dist/components/fieldBox.d.ts +4 -0
- package/dist/components/fieldBox.js +7 -3
- package/dist/components/floating.d.ts +3 -3
- package/dist/components/floating.js +1 -1
- package/dist/components/markdownCodeBreaks.js +3 -4
- package/dist/components/pageHeaderStore.d.ts +41 -0
- package/dist/components/pageHeaderStore.js +67 -0
- package/dist/components/pathBreaks.d.ts +8 -0
- package/dist/components/pathBreaks.js +28 -0
- package/dist/components/segmented.js +1 -1
- package/dist/components/shortcutKey.d.ts +2 -1
- package/dist/components/shortcutKey.js +19 -2
- package/dist/components/splitter.js +1 -1
- package/dist/components/tone.d.ts +5 -2
- package/dist/components/tone.js +15 -6
- package/dist/components/useCssIsDark.js +40 -18
- package/dist/components/useTheme.js +9 -10
- package/dist/dev.d.ts +9 -0
- package/dist/dev.js +14 -0
- package/dist/editor/Editor.d.ts +3 -2
- package/dist/editor/Editor.js +11 -2
- package/dist/editor/EditorField.d.ts +2 -1
- package/dist/editor/EditorField.js +11 -29
- package/dist/editor/FormCodePanel.d.ts +7 -3
- package/dist/editor/FormCodePanel.js +14 -7
- package/dist/editor/Monaco.d.ts +14 -5
- package/dist/editor/Monaco.js +163 -112
- package/dist/editor/index.d.ts +5 -5
- package/dist/editor/index.js +3 -3
- package/dist/editor/themes.d.ts +8 -5
- package/dist/editor/themes.js +58 -30
- package/dist/editor/yaml.d.ts +6 -2
- package/dist/editor/yaml.js +11 -2
- package/dist/file-explorer/FileExplorer.js +143 -124
- package/dist/file-explorer/FileExplorerContext.js +1 -1
- package/dist/file-explorer/FilePreview/StreamedBadge.js +3 -1
- package/dist/file-explorer/FilePreview/Viewer.js +2 -2
- package/dist/file-explorer/FilePreview/index.js +4 -4
- package/dist/file-explorer/FileRow.js +1 -1
- package/dist/file-explorer/FileRowsWindow.js +34 -3
- package/dist/file-explorer/FileTable.js +3 -1
- package/dist/file-explorer/TreeView.js +37 -14
- package/dist/file-explorer/helpers.d.ts +2 -1
- package/dist/file-explorer/helpers.js +21 -20
- package/dist/file-explorer/toasts.js +27 -19
- package/dist/file-explorer/treeRows.d.ts +6 -0
- package/dist/file-explorer/treeRows.js +19 -1
- package/dist/file-explorer/useNearEnd.js +3 -6
- package/dist/form/Fields/CheckboxGroupField.js +12 -5
- package/dist/form/Fields/DurationField.js +1 -1
- package/dist/form/Fields/LabelField.js +1 -1
- package/dist/form/Fields/ObjectField.d.ts +1 -1
- package/dist/form/Fields/ObjectField.js +3 -2
- package/dist/form/Fields/StringField.js +16 -29
- package/dist/form/Fields/TextAreaField.js +3 -4
- package/dist/form/Form.js +3 -8
- package/dist/form/Wizard/WizardNavigation.js +1 -4
- package/dist/form/Wizard/WizardStepIndicator.js +1 -1
- package/dist/form/Wizard/utils.js +1 -1
- package/dist/form/fieldFrame.d.ts +1 -1
- package/dist/form/fieldFrame.js +2 -2
- package/dist/form/types/fieldComponentTypes.d.ts +2 -1
- package/dist/graph/AnnotationBanner.d.ts +1 -2
- package/dist/graph/AnnotationBanner.js +30 -32
- package/dist/graph/Connectors.js +4 -1
- package/dist/graph/DependencyGraph.js +2 -2
- package/dist/graph/GraphEditor.js +12 -10
- package/dist/graph/GraphEditorDialogs.js +2 -2
- package/dist/graph/GraphNode.js +7 -4
- package/dist/graph/InputDialog.js +1 -1
- package/dist/graph/InputsEditor.js +14 -11
- package/dist/graph/MatrixGroup.js +9 -3
- package/dist/graph/ProblemsButton.js +2 -2
- package/dist/graph/Reveal.js +18 -10
- package/dist/graph/ShortcutsButton.d.ts +11 -2
- package/dist/graph/ShortcutsButton.js +15 -4
- package/dist/graph/TreeView.js +35 -18
- package/dist/graph/WorkflowSettingsDialog.js +1 -1
- package/dist/graph/editorChrome.js +1 -1
- package/dist/graph/editorFields.js +1 -1
- package/dist/graph/editorRows.js +16 -10
- package/dist/graph/editorStrings.d.ts +7 -0
- package/dist/graph/editorStrings.js +8 -1
- package/dist/graph/fieldProblems.js +1 -1
- package/dist/graph/inputRefs.js +1 -1
- package/dist/graph/settingsViews.js +11 -18
- package/dist/graph/stepWith.js +2 -2
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +4 -2
- package/dist/index.d.ts +12 -12
- package/dist/index.js +16 -16
- package/dist/list/ActionToolbar.d.ts +44 -8
- package/dist/list/ActionToolbar.js +301 -102
- package/dist/list/ListPage.d.ts +15 -23
- package/dist/list/ListPage.js +46 -45
- package/dist/list/ListTable.d.ts +32 -7
- package/dist/list/ListTable.js +48 -12
- package/dist/list/ListViewControls.js +2 -2
- package/dist/list/UserHoverCard.js +7 -15
- package/dist/list/index.d.ts +2 -2
- package/dist/list/index.js +2 -2
- package/dist/list/listSearch.js +12 -10
- package/dist/list/listView.d.ts +10 -1
- package/dist/list/listView.js +15 -1
- package/dist/list/rowMenu.d.ts +2 -2
- package/dist/logviewer/LogViewer.d.ts +4 -2
- package/dist/logviewer/LogViewer.js +88 -70
- package/dist/logviewer/logviewer.css +3 -2
- package/dist/reducedMotion.d.ts +5 -0
- package/dist/reducedMotion.js +20 -0
- package/dist/safeUrl.d.ts +1 -1
- package/dist/safeUrl.js +4 -2
- package/dist/styles/theme.css +24 -10
- package/dist/styles.css +1 -1
- package/dist/theme/derive.d.ts +1 -1
- package/dist/theme/derive.js +46 -21
- package/dist/theme/fit.js +10 -4
- package/package.json +1 -1
- package/dist/components/Breadcrumbs.d.ts +0 -37
- package/dist/components/Breadcrumbs.js +0 -90
- package/dist/components/CopyToClipboard.d.ts +0 -17
- package/dist/components/CopyToClipboard.js +0 -66
- package/dist/components/Sort.d.ts +0 -9
- package/dist/components/Sort.js +0 -42
package/dist/theme/derive.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CodeStyle, type Scheme } from './model.js';
|
|
2
|
-
export declare const THEME_TOKENS: readonly ['--theme-app-bg', '--theme-panel-bg', '--theme-panel-hover', '--theme-muted-panel-bg', '--theme-hover', '--theme-input-bg', '--theme-input-disabled-bg', '--theme-app', '--theme-muted-text-color', '--theme-placeholder', '--theme-link', '--theme-border', '--theme-border-strong', '--theme-accent', '--theme-accent-text', '--theme-accent-hover', '--theme-accent-subtle', '--theme-focus', '--theme-focus-ring', '--theme-success', '--theme-success-muted', '--theme-error', '--theme-error-muted', '--theme-warning', '--theme-warning-muted', '--theme-info', '--theme-info-muted', '--theme-favorite', '--theme-favorite-muted', '--theme-shadow-sm', '--theme-shadow', '--theme-shadow-lg', '--theme-shadow-xl', '--theme-sidebar-bg', '--theme-sidebar-text', '--theme-sidebar-hover', '--theme-sidebar-active-bg', '--theme-sidebar-active-text', '--theme-code-bg', '--theme-code-text', '--theme-code-comment', '--theme-code-keyword', '--theme-code-string', '--theme-code-number', '--theme-code-function', '--theme-code-type', '--theme-code-property', '--theme-ansi-black', '--theme-ansi-red', '--theme-ansi-green', '--theme-ansi-yellow', '--theme-ansi-blue', '--theme-ansi-magenta', '--theme-ansi-cyan', '--theme-ansi-white'];
|
|
2
|
+
export declare const THEME_TOKENS: readonly ['--theme-app-bg', '--theme-panel-bg', '--theme-panel-hover', '--theme-muted-panel-bg', '--theme-hover', '--theme-input-bg', '--theme-input-disabled-bg', '--theme-app', '--theme-muted-text-color', '--theme-placeholder', '--theme-link', '--theme-border', '--theme-border-strong', '--theme-accent', '--theme-accent-text', '--theme-accent-hover', '--theme-accent-subtle', '--theme-focus', '--theme-focus-ring', '--theme-success', '--theme-success-text', '--theme-success-solid', '--theme-success-muted', '--theme-error', '--theme-error-text', '--theme-error-solid', '--theme-error-muted', '--theme-warning', '--theme-warning-text', '--theme-warning-solid', '--theme-warning-muted', '--theme-info', '--theme-info-text', '--theme-info-solid', '--theme-info-muted', '--theme-favorite', '--theme-favorite-text', '--theme-favorite-solid', '--theme-favorite-muted', '--theme-shadow-sm', '--theme-shadow', '--theme-shadow-lg', '--theme-shadow-xl', '--theme-sidebar-bg', '--theme-sidebar-text', '--theme-sidebar-hover', '--theme-sidebar-active-bg', '--theme-sidebar-active-text', '--theme-code-bg', '--theme-code-text', '--theme-code-comment', '--theme-code-keyword', '--theme-code-string', '--theme-code-number', '--theme-code-function', '--theme-code-type', '--theme-code-property', '--theme-ansi-black', '--theme-ansi-red', '--theme-ansi-green', '--theme-ansi-yellow', '--theme-ansi-blue', '--theme-ansi-magenta', '--theme-ansi-cyan', '--theme-ansi-white'];
|
|
3
3
|
export type ThemeToken = (typeof THEME_TOKENS)[number];
|
|
4
4
|
export type ThemeVariables = Record<ThemeToken, string>;
|
|
5
5
|
/** The tokens the sidebar owns. A host's chrome may supply its own fallbacks, so the stylesheet gives them no defaults. */
|
package/dist/theme/derive.js
CHANGED
|
@@ -23,14 +23,24 @@ var THEME_TOKENS = [
|
|
|
23
23
|
"--theme-focus",
|
|
24
24
|
"--theme-focus-ring",
|
|
25
25
|
"--theme-success",
|
|
26
|
+
"--theme-success-text",
|
|
27
|
+
"--theme-success-solid",
|
|
26
28
|
"--theme-success-muted",
|
|
27
29
|
"--theme-error",
|
|
30
|
+
"--theme-error-text",
|
|
31
|
+
"--theme-error-solid",
|
|
28
32
|
"--theme-error-muted",
|
|
29
33
|
"--theme-warning",
|
|
34
|
+
"--theme-warning-text",
|
|
35
|
+
"--theme-warning-solid",
|
|
30
36
|
"--theme-warning-muted",
|
|
31
37
|
"--theme-info",
|
|
38
|
+
"--theme-info-text",
|
|
39
|
+
"--theme-info-solid",
|
|
32
40
|
"--theme-info-muted",
|
|
33
41
|
"--theme-favorite",
|
|
42
|
+
"--theme-favorite-text",
|
|
43
|
+
"--theme-favorite-solid",
|
|
34
44
|
"--theme-favorite-muted",
|
|
35
45
|
"--theme-shadow-sm",
|
|
36
46
|
"--theme-shadow",
|
|
@@ -131,7 +141,7 @@ function targets(k) {
|
|
|
131
141
|
50,
|
|
132
142
|
65
|
|
133
143
|
]),
|
|
134
|
-
|
|
144
|
+
graphic: { wcag: byContrast(k, [
|
|
135
145
|
3,
|
|
136
146
|
3,
|
|
137
147
|
4.5
|
|
@@ -141,9 +151,14 @@ function targets(k) {
|
|
|
141
151
|
2.2,
|
|
142
152
|
3
|
|
143
153
|
]) },
|
|
144
|
-
|
|
154
|
+
label: { wcag: 4.5 }
|
|
145
155
|
};
|
|
146
156
|
}
|
|
157
|
+
var WHITE = {
|
|
158
|
+
l: 1,
|
|
159
|
+
c: 0,
|
|
160
|
+
h: 0
|
|
161
|
+
};
|
|
147
162
|
var STATUS = {
|
|
148
163
|
success: 150,
|
|
149
164
|
error: 27,
|
|
@@ -217,7 +232,7 @@ function build(scheme, options) {
|
|
|
217
232
|
const t = targets(k);
|
|
218
233
|
const paints = {};
|
|
219
234
|
const checks = [];
|
|
220
|
-
const hexOf = (d) => typeof d === "string" ? toHex(paints[d].color) : compositeHex(paints[d.fill], paints[d.over]);
|
|
235
|
+
const hexOf = (d) => typeof d === "string" ? toHex(paints[d].color) : "fixed" in d ? toHex(d.fixed) : compositeHex(paints[d.fill], paints[d.over]);
|
|
221
236
|
const set = (token, color, alpha) => {
|
|
222
237
|
paints[token] = alpha === void 0 ? { color } : {
|
|
223
238
|
color,
|
|
@@ -287,7 +302,7 @@ function build(scheme, options) {
|
|
|
287
302
|
"--theme-app-bg",
|
|
288
303
|
"--theme-panel-bg",
|
|
289
304
|
"--theme-input-bg"
|
|
290
|
-
], t.
|
|
305
|
+
], t.graphic), dark ? .35 : .25);
|
|
291
306
|
solved("--theme-border-strong", border, [
|
|
292
307
|
"--theme-app-bg",
|
|
293
308
|
"--theme-panel-bg",
|
|
@@ -303,18 +318,21 @@ function build(scheme, options) {
|
|
|
303
318
|
l: white ? 1 : 0,
|
|
304
319
|
c: 0,
|
|
305
320
|
h: 0
|
|
306
|
-
}, ["--theme-accent", "--theme-accent-hover"], t.
|
|
321
|
+
}, ["--theme-accent", "--theme-accent-hover"], t.label);
|
|
307
322
|
const mutedAlpha = dark ? .15 : .1;
|
|
323
|
+
const statusOn = [
|
|
324
|
+
"--theme-app-bg",
|
|
325
|
+
"--theme-panel-bg",
|
|
326
|
+
"--theme-panel-hover",
|
|
327
|
+
"--theme-muted-panel-bg",
|
|
328
|
+
"--theme-hover",
|
|
329
|
+
"--theme-input-bg"
|
|
330
|
+
];
|
|
308
331
|
for (const [name, hue] of Object.entries(STATUS)) {
|
|
309
332
|
const token = `--theme-${name}`;
|
|
310
333
|
const muted = `--theme-${name}-muted`;
|
|
311
|
-
const plain = [
|
|
312
|
-
"--theme-app-bg",
|
|
313
|
-
"--theme-panel-bg",
|
|
314
|
-
"--theme-muted-panel-bg"
|
|
315
|
-
];
|
|
316
334
|
const on = [
|
|
317
|
-
...
|
|
335
|
+
...statusOn,
|
|
318
336
|
{
|
|
319
337
|
fill: muted,
|
|
320
338
|
over: "--theme-app-bg"
|
|
@@ -324,18 +342,24 @@ function build(scheme, options) {
|
|
|
324
342
|
over: "--theme-panel-bg"
|
|
325
343
|
}
|
|
326
344
|
];
|
|
327
|
-
let
|
|
328
|
-
l: dark ? .
|
|
329
|
-
c: .
|
|
345
|
+
let vivid = solve({
|
|
346
|
+
l: dark ? .7 : .66,
|
|
347
|
+
c: .2,
|
|
330
348
|
h: hue
|
|
331
|
-
},
|
|
349
|
+
}, statusOn.map(hexOf), t.graphic);
|
|
332
350
|
for (let round = 0; round < 6; round++) {
|
|
333
|
-
set(muted,
|
|
334
|
-
const next = solve(
|
|
335
|
-
if (next ===
|
|
336
|
-
|
|
351
|
+
set(muted, vivid, mutedAlpha);
|
|
352
|
+
const next = solve(vivid, on.map(hexOf), t.graphic);
|
|
353
|
+
if (next === vivid) break;
|
|
354
|
+
vivid = next;
|
|
337
355
|
}
|
|
338
|
-
keep(token,
|
|
356
|
+
keep(token, vivid, on, t.graphic);
|
|
357
|
+
solved(`--theme-${name}-text`, {
|
|
358
|
+
l: dark ? .75 : .55,
|
|
359
|
+
c: .17,
|
|
360
|
+
h: hue
|
|
361
|
+
}, on, t.secondary);
|
|
362
|
+
solved(`--theme-${name}-solid`, vivid, [{ fixed: WHITE }], t.label);
|
|
339
363
|
}
|
|
340
364
|
const sidebarBase = scheme.sidebar?.base ? oklch(scheme.sidebar.base) : neutral(dark ? Math.max(.08, base.l - .035 * s) : base.l - .035 * s);
|
|
341
365
|
const sidebarAccent = scheme.sidebar?.accent ? oklch(scheme.sidebar.accent) : accent;
|
|
@@ -431,6 +455,7 @@ function p3Overrides(paints, checks) {
|
|
|
431
455
|
const show = (token) => shown(paints[token].color, gamutOf(token));
|
|
432
456
|
const backdrop = (d) => {
|
|
433
457
|
if (typeof d === "string") return show(d);
|
|
458
|
+
if ("fixed" in d) return shown(d.fixed, "srgb");
|
|
434
459
|
const fill = paints[d.fill];
|
|
435
460
|
return over(show(d.fill), fill.alpha ?? 1, rendered(paints[d.over].color, gamutOf(d.over)));
|
|
436
461
|
};
|
|
@@ -443,7 +468,7 @@ function p3Overrides(paints, checks) {
|
|
|
443
468
|
changed = true;
|
|
444
469
|
if (passes(check)) continue;
|
|
445
470
|
}
|
|
446
|
-
for (const d of check.on) for (const token of typeof d === "string" ? [d] : [d.fill, d.over]) changed = wide.delete(token) || changed;
|
|
471
|
+
for (const d of check.on) for (const token of typeof d === "string" ? [d] : "fixed" in d ? [] : [d.fill, d.over]) changed = wide.delete(token) || changed;
|
|
447
472
|
}
|
|
448
473
|
if (!changed) break;
|
|
449
474
|
}
|
package/dist/theme/fit.js
CHANGED
|
@@ -19,10 +19,16 @@ var FLOORS = {
|
|
|
19
19
|
"--theme-placeholder": ["--theme-input-bg", 3],
|
|
20
20
|
"--theme-focus": ["--theme-app-bg", 3],
|
|
21
21
|
"--theme-accent-text": ["--theme-accent", 4.5],
|
|
22
|
-
"--theme-success": ["--theme-app-bg",
|
|
23
|
-
"--theme-
|
|
24
|
-
"--theme-
|
|
25
|
-
"--theme-
|
|
22
|
+
"--theme-success": ["--theme-app-bg", 3],
|
|
23
|
+
"--theme-success-text": ["--theme-app-bg", 4.5],
|
|
24
|
+
"--theme-error": ["--theme-app-bg", 3],
|
|
25
|
+
"--theme-error-text": ["--theme-app-bg", 4.5],
|
|
26
|
+
"--theme-warning": ["--theme-app-bg", 3],
|
|
27
|
+
"--theme-warning-text": ["--theme-app-bg", 4.5],
|
|
28
|
+
"--theme-info": ["--theme-app-bg", 3],
|
|
29
|
+
"--theme-info-text": ["--theme-app-bg", 4.5],
|
|
30
|
+
"--theme-favorite": ["--theme-app-bg", 3],
|
|
31
|
+
"--theme-favorite-text": ["--theme-app-bg", 4.5],
|
|
26
32
|
"--theme-sidebar-text": ["--theme-sidebar-bg", 4.5],
|
|
27
33
|
"--theme-sidebar-active-text": ["--theme-sidebar-active-bg", 4.5],
|
|
28
34
|
"--theme-code-text": ["--theme-code-bg", 4.5],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parallelworks/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"description": "React UI components: a theme contract, icons, brand logos, primitives, lists, forms, a job graph, a code editor, a log viewer, a file explorer and an AI chat, each on its own subpath",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface IBreadcrumbItem {
|
|
3
|
-
label: string;
|
|
4
|
-
href?: string;
|
|
5
|
-
newWindow?: boolean;
|
|
6
|
-
}
|
|
7
|
-
interface BreadcrumbContextType {
|
|
8
|
-
breadcrumbs: IBreadcrumbItem[];
|
|
9
|
-
setBreadcrumbs: (breadcrumbs: IBreadcrumbItem[]) => void;
|
|
10
|
-
rightsideBreadcrumb?: IBreadcrumbItem | null;
|
|
11
|
-
setRightsideBreadcrumb: (breadcrumb: IBreadcrumbItem | null) => void;
|
|
12
|
-
hidden: boolean;
|
|
13
|
-
setHidden: (hidden: boolean) => void;
|
|
14
|
-
/** Null whenever the breadcrumb strip isn't rendered (classic chrome). */
|
|
15
|
-
titleActionSlot: HTMLElement | null;
|
|
16
|
-
setTitleActionSlot: (el: HTMLElement | null) => void;
|
|
17
|
-
rightActionSlot: HTMLElement | null;
|
|
18
|
-
setRightActionSlot: (el: HTMLElement | null) => void;
|
|
19
|
-
/** Pathname whose breadcrumbs a page set itself, so layouts leave it alone. */
|
|
20
|
-
claimedPath: React.MutableRefObject<string | null>;
|
|
21
|
-
}
|
|
22
|
-
export declare const useBreadcrumb: () => BreadcrumbContextType;
|
|
23
|
-
export declare function BreadcrumbProvider({ children }: {
|
|
24
|
-
children: React.ReactNode;
|
|
25
|
-
}): React.JSX.Element;
|
|
26
|
-
export declare function useSetBreadcrumbs(getBreadcrumbs: (() => IBreadcrumbItem[]) | IBreadcrumbItem[]): void;
|
|
27
|
-
/**
|
|
28
|
-
* For layout routes that derive breadcrumbs from the URL: applies them only
|
|
29
|
-
* while no page under the layout has set its own for the current path.
|
|
30
|
-
* Without this, a layout re-running its effect (for example when the
|
|
31
|
-
* organization's display name loads) overwrote the page's breadcrumbs.
|
|
32
|
-
*/
|
|
33
|
-
export declare function useSetDefaultBreadcrumbs(getBreadcrumbs: (() => IBreadcrumbItem[]) | IBreadcrumbItem[]): void;
|
|
34
|
-
/** For pages that render their own header instead of the breadcrumb strip. */
|
|
35
|
-
export declare function useClearBreadcrumbs(): void;
|
|
36
|
-
export declare function useHideBreadcrumbs(hidden: boolean): void;
|
|
37
|
-
export {};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import React, { createContext, useContext, useEffect, useLayoutEffect, useMemo } from "react";
|
|
3
|
-
//#region src/components/Breadcrumbs.tsx
|
|
4
|
-
var BreadcrumbContext = createContext({
|
|
5
|
-
breadcrumbs: [],
|
|
6
|
-
setBreadcrumbs: () => {},
|
|
7
|
-
rightsideBreadcrumb: null,
|
|
8
|
-
setRightsideBreadcrumb: () => {},
|
|
9
|
-
hidden: false,
|
|
10
|
-
setHidden: () => {},
|
|
11
|
-
titleActionSlot: null,
|
|
12
|
-
setTitleActionSlot: () => {},
|
|
13
|
-
rightActionSlot: null,
|
|
14
|
-
setRightActionSlot: () => {},
|
|
15
|
-
claimedPath: { current: null }
|
|
16
|
-
});
|
|
17
|
-
var useBreadcrumb = () => useContext(BreadcrumbContext);
|
|
18
|
-
function BreadcrumbProvider({ children }) {
|
|
19
|
-
const [breadcrumbs, setBreadcrumbs] = React.useState([]);
|
|
20
|
-
const [rightsideBreadcrumb, setRightsideBreadcrumb] = React.useState(null);
|
|
21
|
-
const [hidden, setHidden] = React.useState(false);
|
|
22
|
-
const [titleActionSlot, setTitleActionSlot] = React.useState(null);
|
|
23
|
-
const [rightActionSlot, setRightActionSlot] = React.useState(null);
|
|
24
|
-
const claimedPath = React.useRef(null);
|
|
25
|
-
const value = useMemo(() => ({
|
|
26
|
-
breadcrumbs,
|
|
27
|
-
setBreadcrumbs,
|
|
28
|
-
rightsideBreadcrumb,
|
|
29
|
-
setRightsideBreadcrumb,
|
|
30
|
-
hidden,
|
|
31
|
-
setHidden,
|
|
32
|
-
titleActionSlot,
|
|
33
|
-
setTitleActionSlot,
|
|
34
|
-
rightActionSlot,
|
|
35
|
-
setRightActionSlot,
|
|
36
|
-
claimedPath
|
|
37
|
-
}), [
|
|
38
|
-
breadcrumbs,
|
|
39
|
-
rightsideBreadcrumb,
|
|
40
|
-
hidden,
|
|
41
|
-
titleActionSlot,
|
|
42
|
-
rightActionSlot
|
|
43
|
-
]);
|
|
44
|
-
return /* @__PURE__ */ jsx(BreadcrumbContext.Provider, {
|
|
45
|
-
value,
|
|
46
|
-
children
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
function useSetBreadcrumbs(getBreadcrumbs) {
|
|
50
|
-
const { setBreadcrumbs, claimedPath } = useBreadcrumb();
|
|
51
|
-
useLayoutEffect(() => {
|
|
52
|
-
claimedPath.current = window.location.pathname;
|
|
53
|
-
setBreadcrumbs(typeof getBreadcrumbs === "function" ? getBreadcrumbs() : getBreadcrumbs);
|
|
54
|
-
}, [
|
|
55
|
-
getBreadcrumbs,
|
|
56
|
-
setBreadcrumbs,
|
|
57
|
-
claimedPath
|
|
58
|
-
]);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* For layout routes that derive breadcrumbs from the URL: applies them only
|
|
62
|
-
* while no page under the layout has set its own for the current path.
|
|
63
|
-
* Without this, a layout re-running its effect (for example when the
|
|
64
|
-
* organization's display name loads) overwrote the page's breadcrumbs.
|
|
65
|
-
*/
|
|
66
|
-
function useSetDefaultBreadcrumbs(getBreadcrumbs) {
|
|
67
|
-
const { setBreadcrumbs, claimedPath } = useBreadcrumb();
|
|
68
|
-
useLayoutEffect(() => {
|
|
69
|
-
if (claimedPath.current === window.location.pathname) return;
|
|
70
|
-
setBreadcrumbs(typeof getBreadcrumbs === "function" ? getBreadcrumbs() : getBreadcrumbs);
|
|
71
|
-
}, [
|
|
72
|
-
getBreadcrumbs,
|
|
73
|
-
setBreadcrumbs,
|
|
74
|
-
claimedPath
|
|
75
|
-
]);
|
|
76
|
-
}
|
|
77
|
-
var EMPTY_BREADCRUMBS = [];
|
|
78
|
-
/** For pages that render their own header instead of the breadcrumb strip. */
|
|
79
|
-
function useClearBreadcrumbs() {
|
|
80
|
-
useSetBreadcrumbs(EMPTY_BREADCRUMBS);
|
|
81
|
-
}
|
|
82
|
-
function useHideBreadcrumbs(hidden) {
|
|
83
|
-
const { setHidden } = useBreadcrumb();
|
|
84
|
-
useEffect(() => {
|
|
85
|
-
setHidden(hidden);
|
|
86
|
-
return () => setHidden(false);
|
|
87
|
-
}, [hidden, setHidden]);
|
|
88
|
-
}
|
|
89
|
-
//#endregion
|
|
90
|
-
export { BreadcrumbProvider, useBreadcrumb, useClearBreadcrumbs, useHideBreadcrumbs, useSetBreadcrumbs, useSetDefaultBreadcrumbs };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
interface ICopyToClipboardProps {
|
|
2
|
-
as?: 'div' | 'button';
|
|
3
|
-
text: string;
|
|
4
|
-
className?: string;
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
showIcon?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export default function CopyToClipboard({ as, text, className, children, showIcon, }: ICopyToClipboardProps): import("react").JSX.Element;
|
|
9
|
-
interface CopyCodeBlockProps {
|
|
10
|
-
textToCopy: string;
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
secret?: boolean;
|
|
13
|
-
isRevealed?: boolean;
|
|
14
|
-
onRevealToggle?: () => void;
|
|
15
|
-
}
|
|
16
|
-
export declare function CopyCodeBlock({ textToCopy, children, secret, isRevealed, onRevealToggle, }: CopyCodeBlockProps): import("react").JSX.Element;
|
|
17
|
-
export {};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { CheckIcon, CopyIcon, EyeIcon, EyeOffIcon } from "../icons.js";
|
|
2
|
-
import { useStrings } from "./Provider.js";
|
|
3
|
-
import { useCopy } from "./useCopy.js";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
//#region src/components/CopyToClipboard.tsx
|
|
6
|
-
function CopyToClipboard({ as = "div", text, className, children, showIcon = true }) {
|
|
7
|
-
const { common } = useStrings();
|
|
8
|
-
const { copy } = useCopy();
|
|
9
|
-
const handleCopy = () => void copy(text);
|
|
10
|
-
return /* @__PURE__ */ jsxs(as, {
|
|
11
|
-
className,
|
|
12
|
-
onClick: handleCopy,
|
|
13
|
-
...as === "button" ? { type: "button" } : {
|
|
14
|
-
role: "button",
|
|
15
|
-
"aria-label": common.copy,
|
|
16
|
-
tabIndex: 0,
|
|
17
|
-
onKeyDown: (e) => {
|
|
18
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
19
|
-
e.preventDefault();
|
|
20
|
-
handleCopy();
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
children: [showIcon && /* @__PURE__ */ jsx(CopyIcon, {}), children]
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
function CopyCodeBlock({ textToCopy, children, secret = false, isRevealed = false, onRevealToggle }) {
|
|
28
|
-
const { common } = useStrings();
|
|
29
|
-
const { copy, copied } = useCopy();
|
|
30
|
-
const handleCopy = () => {
|
|
31
|
-
if (!copied) copy(textToCopy);
|
|
32
|
-
};
|
|
33
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
34
|
-
className: "group relative",
|
|
35
|
-
role: "none",
|
|
36
|
-
onClick: handleCopy,
|
|
37
|
-
children: [/* @__PURE__ */ jsx("pre", {
|
|
38
|
-
className: `p-4 theme-hover border rounded-lg text-left font-mono text-sm overflow-x-auto ${secret ? "pr-24" : "pr-12"}`,
|
|
39
|
-
children
|
|
40
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
41
|
-
className: "absolute top-0 right-0 bottom-0 flex items-center gap-1 pl-8 pr-2 bg-gradient-to-l from-[var(--color-panel)] from-70% to-transparent rounded-r-lg",
|
|
42
|
-
children: [secret && /* @__PURE__ */ jsx("button", {
|
|
43
|
-
type: "button",
|
|
44
|
-
onClick: (e) => {
|
|
45
|
-
e.stopPropagation();
|
|
46
|
-
onRevealToggle?.();
|
|
47
|
-
},
|
|
48
|
-
className: "p-2 rounded-md opacity-0 group-hover:opacity-100 transition-all duration-150",
|
|
49
|
-
"aria-label": isRevealed ? common.hideValue : common.showValue,
|
|
50
|
-
title: isRevealed ? common.hideValue : common.showValue,
|
|
51
|
-
children: isRevealed ? /* @__PURE__ */ jsx(EyeIcon, {}) : /* @__PURE__ */ jsx(EyeOffIcon, {})
|
|
52
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
53
|
-
type: "button",
|
|
54
|
-
onClick: (e) => {
|
|
55
|
-
e.stopPropagation();
|
|
56
|
-
handleCopy();
|
|
57
|
-
},
|
|
58
|
-
className: "p-2 rounded-md opacity-0 group-hover:opacity-100 transition-all duration-150",
|
|
59
|
-
"aria-label": copied ? common.copied : common.copyToClipboard,
|
|
60
|
-
children: copied ? /* @__PURE__ */ jsx(CheckIcon, { className: "text-green-400" }) : /* @__PURE__ */ jsx(CopyIcon, {})
|
|
61
|
-
})]
|
|
62
|
-
})]
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
|
-
export { CopyCodeBlock, CopyToClipboard as default };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type TDirection = 'ascending' | 'descending' | 'unsorted';
|
|
2
|
-
declare function Sort<T extends string>({ currentlySorted, name, setCurrentDirection, setCurrentlySorted, currentDirection, }: {
|
|
3
|
-
currentlySorted: T | null;
|
|
4
|
-
name: NoInfer<T>;
|
|
5
|
-
setCurrentDirection: (direction: TDirection) => void;
|
|
6
|
-
setCurrentlySorted: (value: NoInfer<T> | '') => void;
|
|
7
|
-
currentDirection: TDirection;
|
|
8
|
-
}): import("react").JSX.Element;
|
|
9
|
-
export default Sort;
|
package/dist/components/Sort.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { SortDownIcon, SortUnsortedIcon, SortUpIcon } from "../icons.js";
|
|
2
|
-
import { useStrings } from "./Provider.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/Sort.tsx
|
|
5
|
-
var SortIcon = ({ currentlySorted, currentDirection, name }) => {
|
|
6
|
-
const style = { transform: "translateY(2px)" };
|
|
7
|
-
if (currentlySorted === name) {
|
|
8
|
-
if (currentDirection === "ascending") return /* @__PURE__ */ jsx(SortDownIcon, { style });
|
|
9
|
-
else if (currentDirection === "descending") return /* @__PURE__ */ jsx(SortUpIcon, { style });
|
|
10
|
-
} else return /* @__PURE__ */ jsx(SortUnsortedIcon, { style });
|
|
11
|
-
return null;
|
|
12
|
-
};
|
|
13
|
-
function Sort({ currentlySorted, name, setCurrentDirection, setCurrentlySorted, currentDirection }) {
|
|
14
|
-
const t = useStrings().common;
|
|
15
|
-
const sort = (sorted, direction) => {
|
|
16
|
-
if (sorted === name) {
|
|
17
|
-
if (direction === "ascending") setCurrentDirection("descending");
|
|
18
|
-
else if (direction === "descending") {
|
|
19
|
-
setCurrentDirection("unsorted");
|
|
20
|
-
setCurrentlySorted("");
|
|
21
|
-
}
|
|
22
|
-
} else {
|
|
23
|
-
setCurrentDirection("ascending");
|
|
24
|
-
setCurrentlySorted(name);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
return /* @__PURE__ */ jsx("div", {
|
|
28
|
-
className: "inline",
|
|
29
|
-
children: /* @__PURE__ */ jsx("button", {
|
|
30
|
-
type: "button",
|
|
31
|
-
"aria-label": t.sort,
|
|
32
|
-
onClick: () => sort(currentlySorted, currentDirection),
|
|
33
|
-
children: /* @__PURE__ */ jsx(SortIcon, {
|
|
34
|
-
currentDirection,
|
|
35
|
-
currentlySorted,
|
|
36
|
-
name
|
|
37
|
-
})
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
export { Sort as default };
|