@parallelworks/ui 0.5.1 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{CodePreviewEditor-KwzSyk3-.js → CodePreviewEditor-Uij_Npp4.js} +1 -1
- package/dist/chunks/{CreateModal-CXSi9ELO.js → CreateModal-DEvWkdFl.js} +4 -29
- package/dist/chunks/{Monaco-FlGHL7zR.js → Monaco-H1M5hQbJ.js} +2 -2
- package/dist/chunks/PageHeader-CSo3LVId.js +571 -0
- package/dist/chunks/{Provider-wC9G01Ou.js → Provider-BIL5347a.js} +1 -0
- package/dist/chunks/{SwitchToggle-CkYT1isd.js → SwitchToggle-D_H1iJEe.js} +12 -1
- package/dist/chunks/{editor-DbDUZn8w.js → editor-4ZuZruLz.js} +2 -2
- package/dist/chunks/{list-CGbR-ueU.js → list-CgzqVlao.js} +314 -8
- package/dist/components/PageHeader.d.ts +1 -1
- package/dist/components/Provider.d.ts +1 -0
- package/dist/components/Table.d.ts +1 -1
- package/dist/editor/index.js +1 -1
- package/dist/file-explorer/FileExplorer.d.ts +1 -3
- package/dist/file-explorer/helpers.d.ts +1 -3
- package/dist/file-explorer/index.js +15 -23
- package/dist/form/index.js +2 -2
- package/dist/index.js +6 -231
- package/dist/list/ActionToolbar.d.ts +38 -0
- package/dist/list/ListPage.d.ts +63 -0
- package/dist/list/RowContextMenu.d.ts +1 -1
- package/dist/list/index.d.ts +2 -0
- package/dist/list/index.js +3 -3
- package/dist/logviewer/index.js +1 -1
- package/dist/styles/theme.css +1 -0
- package/dist/styles.css +1 -1
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.js +3 -0
- package/dist/workflow/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/RowContextMenu-D3G3DPQk.js +0 -319
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CheckIcon, CopyIcon, EyeIcon, EyeOffIcon } from "../icons.js";
|
|
2
|
-
import { c as useStrings, i as useNotify } from "./Provider-
|
|
2
|
+
import { c as useStrings, i as useNotify } from "./Provider-BIL5347a.js";
|
|
3
3
|
import { t as Loader } from "./Loader-BXoXTZGc.js";
|
|
4
4
|
import { t as SwitchToggleSmall } from "./SwitchToggleSmall-FcsaYSTs.js";
|
|
5
5
|
import { c as FieldWrapper, n as flattenGroups, r as impureSetValueFromPath } from "./lib-DTgL8klR.js";
|
|
@@ -9,7 +9,7 @@ import { Suspense, lazy, useMemo, useRef, useState } from "react";
|
|
|
9
9
|
import { convertToDynamicForm, parseStringsOfObj, parseStringsOfObjReady } from "@parallelworks/workflow-parser";
|
|
10
10
|
import { useField, useFormikContext } from "formik";
|
|
11
11
|
//#region src/editor/Editor.tsx
|
|
12
|
-
var MonacoEditor = lazy(() => import("./Monaco-
|
|
12
|
+
var MonacoEditor = lazy(() => import("./Monaco-H1M5hQbJ.js"));
|
|
13
13
|
function Editor({ ...props }) {
|
|
14
14
|
return /* @__PURE__ */ jsx(Suspense, {
|
|
15
15
|
fallback: /* @__PURE__ */ jsx(Loader, { text: "Loading editor..." }),
|
|
@@ -1,12 +1,189 @@
|
|
|
1
|
-
import { CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, DisplayIcon, ErrorIcon, FilterIcon, SearchIcon, XIcon } from "../icons.js";
|
|
2
|
-
import { c as useStrings, n as useLink } from "./Provider-
|
|
1
|
+
import { CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, DisplayIcon, ErrorIcon, FilterIcon, MenuIcon, SearchIcon, XIcon } from "../icons.js";
|
|
2
|
+
import { c as useStrings, n as useLink, r as useNavigation } from "./Provider-BIL5347a.js";
|
|
3
3
|
import { n as TOOLTIP_ID, r as TooltipInfo } from "./Tooltip-WgbiC_nd.js";
|
|
4
|
+
import { c as PageHeader, f as rowContextMenuProps, g as useRowMenuActive, l as MoreButton } from "./PageHeader-CSo3LVId.js";
|
|
4
5
|
import { n as Table } from "./Table-ByziK93x.js";
|
|
5
6
|
import cx from "classnames";
|
|
6
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
8
|
+
import { Children, Fragment as Fragment$1, cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
8
9
|
import { createPortal } from "react-dom";
|
|
10
|
+
import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/react";
|
|
9
11
|
import { useLocalStorage } from "usehooks-ts";
|
|
12
|
+
//#region src/list/ActionToolbar.tsx
|
|
13
|
+
var OverflowMenuContext = createContext(false);
|
|
14
|
+
/** Omits data-tooltip-content when absent — react-tooltip treats an explicit undefined as an empty tooltip anchor. */
|
|
15
|
+
function tipProps(content, place) {
|
|
16
|
+
return {
|
|
17
|
+
"data-tooltip-id": TOOLTIP_ID,
|
|
18
|
+
"data-tooltip-place": place,
|
|
19
|
+
...content !== void 0 && { "data-tooltip-content": content }
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function ToolbarItemView({ item }) {
|
|
23
|
+
if ("element" in item) return /* @__PURE__ */ jsx(Fragment, { children: item.element });
|
|
24
|
+
return /* @__PURE__ */ jsx(ToolbarButton, { action: item });
|
|
25
|
+
}
|
|
26
|
+
function ToolbarButton({ action }) {
|
|
27
|
+
const inOverflowMenu = useContext(OverflowMenuContext);
|
|
28
|
+
const Link = useLink();
|
|
29
|
+
if (inOverflowMenu) return /* @__PURE__ */ jsx(OverflowRow, { item: action });
|
|
30
|
+
const className = cx("inline-flex items-center gap-x-0.5 h-9 px-2 rounded-md text-[13.5px] uppercase font-semibold transition-colors whitespace-nowrap", "bg-(--theme-element) text-(--theme-element-text)", action.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:bg-(--theme-element-hover)");
|
|
31
|
+
const tooltipProps = tipProps(action.disabled ? action.disabledTooltip : action.enabledTooltip, "bottom");
|
|
32
|
+
const Icon = action.icon;
|
|
33
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
34
|
+
className: "h-6 flex items-center",
|
|
35
|
+
children: /* @__PURE__ */ jsx(Icon, { className: cx("w-auto", action.iconClassName) })
|
|
36
|
+
}), action.label] });
|
|
37
|
+
if (action.href && !action.disabled) return /* @__PURE__ */ jsx(Link, {
|
|
38
|
+
to: action.href,
|
|
39
|
+
className,
|
|
40
|
+
...tooltipProps,
|
|
41
|
+
children: content
|
|
42
|
+
});
|
|
43
|
+
if (action.disabled) return /* @__PURE__ */ jsx("span", {
|
|
44
|
+
className: "inline-flex",
|
|
45
|
+
...tooltipProps,
|
|
46
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
47
|
+
type: "button",
|
|
48
|
+
disabled: true,
|
|
49
|
+
className,
|
|
50
|
+
children: content
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
return /* @__PURE__ */ jsx("button", {
|
|
54
|
+
type: "button",
|
|
55
|
+
onClick: action.onClick,
|
|
56
|
+
className,
|
|
57
|
+
...tooltipProps,
|
|
58
|
+
children: content
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** A single overflowed item rendered as a full-width row inside the `…` menu. */
|
|
62
|
+
function OverflowRow({ item }) {
|
|
63
|
+
const Link = useLink();
|
|
64
|
+
const Icon = item.icon;
|
|
65
|
+
const className = cx("flex w-full items-center gap-x-1 px-4 py-2 text-[13px] uppercase font-semibold link hover:theme-hover", item.disabled && "opacity-50 cursor-not-allowed");
|
|
66
|
+
const tooltipProps = tipProps(item.disabled ? item.disabledTooltip : item.enabledTooltip, "left");
|
|
67
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
68
|
+
className: "w-5 h-6 flex items-center",
|
|
69
|
+
children: /* @__PURE__ */ jsx(Icon, { className: cx(item.iconClassName) })
|
|
70
|
+
}), item.label] });
|
|
71
|
+
if (item.href && !item.disabled) return /* @__PURE__ */ jsx(MenuItem, {
|
|
72
|
+
as: Link,
|
|
73
|
+
to: item.href,
|
|
74
|
+
className,
|
|
75
|
+
...tooltipProps,
|
|
76
|
+
children: content
|
|
77
|
+
});
|
|
78
|
+
return /* @__PURE__ */ jsx(MenuItem, {
|
|
79
|
+
as: "button",
|
|
80
|
+
type: "button",
|
|
81
|
+
onClick: item.onClick,
|
|
82
|
+
disabled: item.disabled ?? false,
|
|
83
|
+
className,
|
|
84
|
+
...tooltipProps,
|
|
85
|
+
children: content
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function OverflowMenu({ items }) {
|
|
89
|
+
const { list: t } = useStrings();
|
|
90
|
+
return /* @__PURE__ */ jsxs(Menu, {
|
|
91
|
+
as: "div",
|
|
92
|
+
className: "relative inline-block text-left",
|
|
93
|
+
children: [/* @__PURE__ */ jsx(MenuButton, {
|
|
94
|
+
className: "inline-flex items-center justify-center h-9 w-9 rounded-md border theme-border link hover:theme-hover transition-colors",
|
|
95
|
+
"data-tooltip-id": TOOLTIP_ID,
|
|
96
|
+
"data-tooltip-content": t.moreActions,
|
|
97
|
+
"data-testid": "action-toolbar-menu-button",
|
|
98
|
+
children: /* @__PURE__ */ jsx(MenuIcon, {})
|
|
99
|
+
}), /* @__PURE__ */ jsx(MenuItems, {
|
|
100
|
+
unmount: false,
|
|
101
|
+
anchor: {
|
|
102
|
+
to: "bottom end",
|
|
103
|
+
gap: 4
|
|
104
|
+
},
|
|
105
|
+
className: "z-50 min-w-56 rounded-md border theme-border bg-(--theme-app-bg) shadow-lg py-1 focus:outline-none",
|
|
106
|
+
children: /* @__PURE__ */ jsx(OverflowMenuContext.Provider, {
|
|
107
|
+
value: true,
|
|
108
|
+
children: items.map((item) => "element" in item ? /* @__PURE__ */ jsx(Fragment$1, { children: item.element }, item.key) : /* @__PURE__ */ jsx(OverflowRow, { item }, item.key))
|
|
109
|
+
})
|
|
110
|
+
})]
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
var MENU_BUTTON_WIDTH = 44;
|
|
114
|
+
var ITEM_GAP = 4;
|
|
115
|
+
function fitCount(widths, available, gap, menuWidth) {
|
|
116
|
+
if (widths.length === 0) return 0;
|
|
117
|
+
if (widths.reduce((sum, w) => sum + w, 0) + gap * (widths.length - 1) <= available) return widths.length;
|
|
118
|
+
let used = menuWidth;
|
|
119
|
+
let count = 0;
|
|
120
|
+
for (const w of widths) {
|
|
121
|
+
if (used + gap + w > available) break;
|
|
122
|
+
used += gap + w;
|
|
123
|
+
count++;
|
|
124
|
+
}
|
|
125
|
+
return count;
|
|
126
|
+
}
|
|
127
|
+
/** Measures in a layout effect (before paint) so the inline/overflow split never flashes. */
|
|
128
|
+
function CollapsibleRight({ items }) {
|
|
129
|
+
const wrapRef = useRef(null);
|
|
130
|
+
const itemRefs = useRef({});
|
|
131
|
+
const widthCache = useRef({});
|
|
132
|
+
const [available, setAvailable] = useState(Number.POSITIVE_INFINITY);
|
|
133
|
+
const [count, setCount] = useState(items.length);
|
|
134
|
+
useLayoutEffect(() => {
|
|
135
|
+
const el = wrapRef.current;
|
|
136
|
+
if (!el) return;
|
|
137
|
+
const update = () => setAvailable(el.clientWidth);
|
|
138
|
+
update();
|
|
139
|
+
const observer = new ResizeObserver(update);
|
|
140
|
+
observer.observe(el);
|
|
141
|
+
return () => observer.disconnect();
|
|
142
|
+
}, []);
|
|
143
|
+
useLayoutEffect(() => {
|
|
144
|
+
for (const key in itemRefs.current) {
|
|
145
|
+
const el = itemRefs.current[key];
|
|
146
|
+
if (el) widthCache.current[key] = el.offsetWidth;
|
|
147
|
+
}
|
|
148
|
+
const next = fitCount(items.map((item) => widthCache.current[item.key] ?? 0), available, ITEM_GAP, MENU_BUTTON_WIDTH);
|
|
149
|
+
setCount((prev) => prev === next ? prev : next);
|
|
150
|
+
});
|
|
151
|
+
const visible = items.slice(0, count);
|
|
152
|
+
const overflow = items.slice(count);
|
|
153
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
154
|
+
ref: wrapRef,
|
|
155
|
+
className: "flex-1 min-w-0 flex items-center justify-end gap-1",
|
|
156
|
+
children: [visible.map((item) => /* @__PURE__ */ jsx("span", {
|
|
157
|
+
ref: (el) => {
|
|
158
|
+
itemRefs.current[item.key] = el;
|
|
159
|
+
},
|
|
160
|
+
className: "inline-flex shrink-0",
|
|
161
|
+
children: /* @__PURE__ */ jsx(ToolbarItemView, { item })
|
|
162
|
+
}, item.key)), overflow.length > 0 && /* @__PURE__ */ jsx(OverflowMenu, { items: overflow })]
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/** Pins a detail-page toolbar just below the sticky breadcrumb strip (top-10 matches the strip's 40px height). */
|
|
166
|
+
var stickyToolbarClasses = "sticky top-10 z-10 bg-(--theme-app-bg)";
|
|
167
|
+
/** Pins a detail-page tabs row under the pinned toolbar (top-22 = 40px strip + 48px toolbar block). */
|
|
168
|
+
var stickyTabsClasses = "sticky top-22 z-10 bg-(--theme-app-bg)";
|
|
169
|
+
/** Pins a detail-page tabs row directly under the breadcrumb strip when the page has no pinned toolbar (top-10 = the strip's height). */
|
|
170
|
+
var stickyTabsUnderHeaderClasses = "sticky top-10 z-10 bg-(--theme-app-bg)";
|
|
171
|
+
/** Action groups left, secondary actions right (collapsing into a `…` menu). */
|
|
172
|
+
function ActionToolbar({ groups, right = [], sticky = false }) {
|
|
173
|
+
const visibleGroups = groups.map((group) => group.filter((a) => !a.hidden)).filter((group) => group.length > 0);
|
|
174
|
+
const visibleRight = right.filter((a) => !a.hidden);
|
|
175
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
176
|
+
className: cx("flex items-center gap-2.5", sticky && cx("sticky top-10 z-10 bg-(--theme-app-bg)", "py-1.5")),
|
|
177
|
+
children: [visibleGroups.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
178
|
+
className: "flex items-center gap-2.5 shrink-0",
|
|
179
|
+
children: visibleGroups.map((group, i) => /* @__PURE__ */ jsxs(Fragment$1, { children: [i > 0 && /* @__PURE__ */ jsx("div", { className: "w-px h-5 bg-(--theme-border)" }), /* @__PURE__ */ jsx("div", {
|
|
180
|
+
className: "flex items-center gap-1",
|
|
181
|
+
children: group.map((item) => /* @__PURE__ */ jsx(ToolbarItemView, { item }, item.key))
|
|
182
|
+
})] }, group[0]?.key ?? i))
|
|
183
|
+
}), visibleRight.length > 0 && /* @__PURE__ */ jsx(CollapsibleRight, { items: visibleRight })]
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
//#endregion
|
|
10
187
|
//#region src/list/ListTable.tsx
|
|
11
188
|
var NAME_TEXT = "font-medium text-[13px] leading-tight text-(--theme-app) truncate";
|
|
12
189
|
var SUBTITLE_TEXT = "text-xs leading-tight text-(--theme-muted-text-color) truncate";
|
|
@@ -152,6 +329,135 @@ function ListActionsHeader({ view, actionCount = 0, className }) {
|
|
|
152
329
|
}
|
|
153
330
|
ListActionsHeader.isTableHeader = true;
|
|
154
331
|
//#endregion
|
|
332
|
+
//#region src/list/ListPage.tsx
|
|
333
|
+
/** Negative offsets (admin/org) cancel the shell's pt-4 so rows don't peek through the gap above the pinned header. */
|
|
334
|
+
var SECTION_STICKY_TOP = {
|
|
335
|
+
main: "top-0",
|
|
336
|
+
kubernetes: "top-0",
|
|
337
|
+
admin: "-top-4",
|
|
338
|
+
org: "-top-4"
|
|
339
|
+
};
|
|
340
|
+
/** Whether the shell adds pt-4 padding that the edge-to-edge list must cancel with a negative margin. */
|
|
341
|
+
var SECTION_SHELL_PADDED = {
|
|
342
|
+
main: false,
|
|
343
|
+
kubernetes: false,
|
|
344
|
+
admin: true,
|
|
345
|
+
org: true
|
|
346
|
+
};
|
|
347
|
+
/** Defaults mean rows outside a ListView fully show actions (no view = show everything). */
|
|
348
|
+
var RowActionsContext = createContext({
|
|
349
|
+
show: true,
|
|
350
|
+
always: false,
|
|
351
|
+
columnClasses: []
|
|
352
|
+
});
|
|
353
|
+
function useRowActions(view) {
|
|
354
|
+
return useMemo(() => ({
|
|
355
|
+
show: view?.showActions ?? true,
|
|
356
|
+
always: view?.alwaysShowActions ?? false,
|
|
357
|
+
columnClasses: view?.columnClasses ?? []
|
|
358
|
+
}), [
|
|
359
|
+
view?.showActions,
|
|
360
|
+
view?.alwaysShowActions,
|
|
361
|
+
view?.columnClasses
|
|
362
|
+
]);
|
|
363
|
+
}
|
|
364
|
+
function ListRowActionsProvider({ view, children }) {
|
|
365
|
+
const rowActions = useRowActions(view);
|
|
366
|
+
return /* @__PURE__ */ jsx(RowActionsContext.Provider, {
|
|
367
|
+
value: rowActions,
|
|
368
|
+
children
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
function ListPage({ section = "main", shellPadded, breadcrumbs, title, titleAction, actions, toolbar, view, children }) {
|
|
372
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
373
|
+
className: cx("flex h-full min-h-0 flex-col", (shellPadded ?? SECTION_SHELL_PADDED[section]) && "-m-4"),
|
|
374
|
+
children: [/* @__PURE__ */ jsx(PageHeader, {
|
|
375
|
+
stickyTopClassName: SECTION_STICKY_TOP[section],
|
|
376
|
+
breadcrumbs,
|
|
377
|
+
title,
|
|
378
|
+
titleAction,
|
|
379
|
+
actions,
|
|
380
|
+
toolbar
|
|
381
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
382
|
+
className: "@container min-h-0 flex-1 overflow-auto",
|
|
383
|
+
children: /* @__PURE__ */ jsx(ListRowActionsProvider, {
|
|
384
|
+
view,
|
|
385
|
+
children
|
|
386
|
+
})
|
|
387
|
+
})]
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
function ListRow({ href, items, goTo, openMenu, pinnedActions, selected, selectionActive, onRowSelect, leading, className, children }) {
|
|
391
|
+
const { active: menuActive, openMenu: openRowMenu } = useRowMenuActive(openMenu);
|
|
392
|
+
const { show: showActions, always: alwaysShowActions, columnClasses } = useContext(RowActionsContext);
|
|
393
|
+
const styledCells = Children.toArray(children).map((child, i) => {
|
|
394
|
+
const cls = columnClasses[i];
|
|
395
|
+
if (!cls || !isValidElement(child)) return child;
|
|
396
|
+
const el = child;
|
|
397
|
+
return cloneElement(el, { className: cx(el.props.className, cls) });
|
|
398
|
+
});
|
|
399
|
+
const handleRowClick = (e) => {
|
|
400
|
+
if (e.target.closest("a,button,input,label")) return;
|
|
401
|
+
if (selectionActive && onRowSelect) {
|
|
402
|
+
onRowSelect(e);
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
if (href) goTo(href);
|
|
406
|
+
};
|
|
407
|
+
const pinnedLabels = new Set((pinnedActions ?? []).map((a) => a.label));
|
|
408
|
+
const hasOverflowItems = items.some((item) => item.kind !== "divider" && (item.kind === "submenu" || !pinnedLabels.has(item.label)));
|
|
409
|
+
return /* @__PURE__ */ jsxs("tr", {
|
|
410
|
+
className: cx("group", selected ? "bg-blue-500/5" : menuActive ? "theme-hover" : "hover:theme-hover", (href || selectionActive) && "cursor-pointer", className),
|
|
411
|
+
onClick: handleRowClick,
|
|
412
|
+
...rowContextMenuProps(openRowMenu, items),
|
|
413
|
+
children: [
|
|
414
|
+
leading,
|
|
415
|
+
styledCells,
|
|
416
|
+
showActions && /* @__PURE__ */ jsx(Table.Item, {
|
|
417
|
+
className: "relative py-2.5",
|
|
418
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
419
|
+
className: "absolute inset-y-0 right-0 flex items-center gap-0.5 pr-4",
|
|
420
|
+
children: [pinnedActions && pinnedActions.length > 0 && /* @__PURE__ */ jsx("span", {
|
|
421
|
+
className: "hidden items-center gap-0.5 @[44rem]:flex",
|
|
422
|
+
children: pinnedActions.map((action) => /* @__PURE__ */ jsx("button", {
|
|
423
|
+
type: "button",
|
|
424
|
+
"aria-label": action.label,
|
|
425
|
+
"data-tooltip-id": "global-tooltip",
|
|
426
|
+
"data-tooltip-content": action.label,
|
|
427
|
+
"data-tooltip-place": "bottom",
|
|
428
|
+
disabled: action.disabled,
|
|
429
|
+
onClick: (e) => {
|
|
430
|
+
e.stopPropagation();
|
|
431
|
+
action.onSelect();
|
|
432
|
+
},
|
|
433
|
+
className: cx("rounded p-1 cursor-pointer text-(--theme-muted-text-color) transition-colors hover:bg-(--theme-muted-panel-bg) hover:text-(--theme-app) disabled:cursor-not-allowed disabled:opacity-20 [&>svg]:h-4 [&>svg]:w-4", alwaysShowActions || menuActive ? "opacity-100" : "opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),
|
|
434
|
+
children: action.icon
|
|
435
|
+
}, action.key))
|
|
436
|
+
}), /* @__PURE__ */ jsx(MoreButton, {
|
|
437
|
+
active: menuActive || alwaysShowActions,
|
|
438
|
+
onOpen: (x, y) => openRowMenu(x, y, items),
|
|
439
|
+
className: hasOverflowItems ? void 0 : "@[44rem]:hidden"
|
|
440
|
+
})]
|
|
441
|
+
})
|
|
442
|
+
})
|
|
443
|
+
]
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
/** Name column min-width is by role, not position, so a leading checkbox doesn't shift it. */
|
|
447
|
+
function ListColumns({ view }) {
|
|
448
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [view.visibleColumns.map((col, i) => /* @__PURE__ */ jsx(Table.Header, {
|
|
449
|
+
caps: false,
|
|
450
|
+
className: cx(col.headerClassName, view.columnClasses[i]),
|
|
451
|
+
style: col.alwaysVisible ? { minWidth: 200 } : void 0,
|
|
452
|
+
children: col.label
|
|
453
|
+
}, col.key)), /* @__PURE__ */ jsx(ListActionsHeader, { view })] });
|
|
454
|
+
}
|
|
455
|
+
ListColumns.isTableHeader = true;
|
|
456
|
+
/** Stable `goTo` for whole-row navigation (`rowNavProps`, `ListRow`). */
|
|
457
|
+
function useListNavigate() {
|
|
458
|
+
return useNavigation().goTo;
|
|
459
|
+
}
|
|
460
|
+
//#endregion
|
|
155
461
|
//#region src/list/listView.tsx
|
|
156
462
|
var PRIORITY_SHOW_CLASS = {
|
|
157
463
|
low: "hidden @[52rem]:table-cell",
|
|
@@ -451,7 +757,7 @@ function AnchoredPopover({ icon, label, active, shortcut, panelClassName, childr
|
|
|
451
757
|
}), document.querySelector(".ds-root") ?? document.body)] });
|
|
452
758
|
}
|
|
453
759
|
/** Small on/off switch for the Display menu's boolean options. */
|
|
454
|
-
function Switch({ checked, onChange, label }) {
|
|
760
|
+
function Switch$1({ checked, onChange, label }) {
|
|
455
761
|
return /* @__PURE__ */ jsx("button", {
|
|
456
762
|
type: "button",
|
|
457
763
|
role: "switch",
|
|
@@ -501,7 +807,7 @@ function ListDisplayMenu({ view, label }) {
|
|
|
501
807
|
children: [/* @__PURE__ */ jsx("span", {
|
|
502
808
|
className: "text-[13px] text-(--theme-app)",
|
|
503
809
|
children: t.columnHeaders
|
|
504
|
-
}), /* @__PURE__ */ jsx(Switch, {
|
|
810
|
+
}), /* @__PURE__ */ jsx(Switch$1, {
|
|
505
811
|
checked: view.showColumnHeaders,
|
|
506
812
|
onChange: view.toggleColumnHeaders,
|
|
507
813
|
label: t.showColumnHeaders
|
|
@@ -512,7 +818,7 @@ function ListDisplayMenu({ view, label }) {
|
|
|
512
818
|
children: [/* @__PURE__ */ jsx("span", {
|
|
513
819
|
className: "text-[13px] text-(--theme-app)",
|
|
514
820
|
children: t.showActions
|
|
515
|
-
}), /* @__PURE__ */ jsx(Switch, {
|
|
821
|
+
}), /* @__PURE__ */ jsx(Switch$1, {
|
|
516
822
|
checked: view.showActions,
|
|
517
823
|
onChange: view.toggleShowActions,
|
|
518
824
|
label: t.showRowActions
|
|
@@ -523,7 +829,7 @@ function ListDisplayMenu({ view, label }) {
|
|
|
523
829
|
children: [/* @__PURE__ */ jsx("span", {
|
|
524
830
|
className: "text-[13px] text-(--theme-muted-text-color)",
|
|
525
831
|
children: t.alwaysShowActions
|
|
526
|
-
}), /* @__PURE__ */ jsx(Switch, {
|
|
832
|
+
}), /* @__PURE__ */ jsx(Switch$1, {
|
|
527
833
|
checked: view.alwaysShowActions,
|
|
528
834
|
onChange: view.toggleAlwaysShowActions,
|
|
529
835
|
label: t.alwaysShowRowActions
|
|
@@ -944,4 +1250,4 @@ function HoverCardSurface({ x, y, widthClassName, relayoutKey, onKeepOpen, onLea
|
|
|
944
1250
|
}), document.querySelector(".ds-root") ?? document.body);
|
|
945
1251
|
}
|
|
946
1252
|
//#endregion
|
|
947
|
-
export {
|
|
1253
|
+
export { ToolbarButton as A, NAME_MIN_WIDTH_PX as C, listTableFixedProps as D, actionsColumnWidth as E, stickyTabsUnderHeaderClasses as M, stickyToolbarClasses as N, listTableProps as O, ListSkeleton as S, RowSelectCheckbox as T, ListRowActionsProvider as _, ListSearchControl as a, ListActionsHeader as b, ListFilterMenu as c, DEFAULT_ORDER as d, FAVORITE_ORDER as f, ListRow as g, ListPage as h, ListCount as i, stickyTabsClasses as j, ActionToolbar as k, listControlButtonClasses as l, ListColumns as m, useHoverCard as n, useListSearch as o, useListView as p, ListPager as r, ListDisplayMenu as s, HoverCardSurface as t, isTextEntryContext as u, useListNavigate as v, NameCell as w, ListError as x, GroupRow as y };
|
|
@@ -55,7 +55,7 @@ export declare function BreadcrumbsActionButton({ icon: Icon, label, to, onClick
|
|
|
55
55
|
tooltip?: string;
|
|
56
56
|
}): import("react").JSX.Element;
|
|
57
57
|
interface PageHeaderProps {
|
|
58
|
-
breadcrumbs?: PageHeaderBreadcrumb[];
|
|
58
|
+
breadcrumbs?: PageHeaderBreadcrumb[] | undefined;
|
|
59
59
|
title?: ReactNode;
|
|
60
60
|
titleAction?: ReactNode;
|
|
61
61
|
actions?: ReactNode;
|
|
@@ -8,7 +8,7 @@ declare function CompactItem({ wrap, children, className, colspan, ...tdProps }:
|
|
|
8
8
|
interface ITableHeaderProps {
|
|
9
9
|
children?: React.ReactNode;
|
|
10
10
|
className?: string;
|
|
11
|
-
style?: React.CSSProperties;
|
|
11
|
+
style?: React.CSSProperties | undefined;
|
|
12
12
|
colspan?: number;
|
|
13
13
|
onClick?: () => void;
|
|
14
14
|
/** When false, drops uppercase + tracking-wider for a sentence-case header. */
|
package/dist/editor/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as EditorField, i as FormCodePanel, n as defineEditorThemes, o as Editor, r as getThemeName, t as setupMonacoWorkers } from "../chunks/editor-
|
|
1
|
+
import { a as EditorField, i as FormCodePanel, n as defineEditorThemes, o as Editor, r as getThemeName, t as setupMonacoWorkers } from "../chunks/editor-4ZuZruLz.js";
|
|
2
2
|
export { Editor, EditorField, FormCodePanel, defineEditorThemes, getThemeName, setupMonacoWorkers };
|
|
@@ -16,8 +16,6 @@ interface IFileExplorerProps {
|
|
|
16
16
|
groupsLoading?: boolean;
|
|
17
17
|
selectedPath: string;
|
|
18
18
|
onPathChange: (path: string) => void;
|
|
19
|
-
/** The modern layout drops the sidebar heading and adds the toolbar row. */
|
|
20
|
-
variant?: 'classic' | 'modern';
|
|
21
19
|
}
|
|
22
|
-
export default function FileExplorer({ storages, onRefresh, showUserHierarchy, groups, groupsLoading, selectedPath, onPathChange, getProviderAndClient,
|
|
20
|
+
export default function FileExplorer({ storages, onRefresh, showUserHierarchy, groups, groupsLoading, selectedPath, onPathChange, getProviderAndClient, }: IFileExplorerProps): import("react").JSX.Element;
|
|
23
21
|
export {};
|
|
@@ -30,9 +30,7 @@ declare function NoDataAvailablePreview({ selectedStorage, error, onRefresh, con
|
|
|
30
30
|
className?: string;
|
|
31
31
|
canWrite?: boolean;
|
|
32
32
|
}): JSX.Element;
|
|
33
|
-
declare function SkeletonPreview(
|
|
34
|
-
variant?: 'classic' | 'modern';
|
|
35
|
-
}): JSX.Element;
|
|
33
|
+
declare function SkeletonPreview(): JSX.Element;
|
|
36
34
|
interface IDragDropZoneProps {
|
|
37
35
|
onDropFiles?: ((files: FileList | DataTransferItemList) => void) | undefined;
|
|
38
36
|
children: React.ReactNode;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AccessIcon, AlertIcon, AngleDownIcon, AngleRightIcon, AngleUpIcon, ChevronLeftIcon, ChevronRightIcon, ClipboardIcon, CloseIcon, CloudUploadIcon, CollapseIcon, CustomizeIcon, DiskIcon, DocumentIcon, DownloadFileIcon, ExpandIcon, ExpandVerticalIcon, EyeIcon, FileIcon, FileTextIcon, FolderIcon, FolderOpenIcon, ImageIcon, LinkIcon, LockIcon, MinimizeIcon, MusicIcon, PdfIcon, RefreshIcon, ShareIcon, SpreadsheetIcon, SuccessIcon, TrashIcon, UploadIcon, UserIcon, VideoIcon, ZipIcon, ZoomInIcon, ZoomOutIcon } from "../icons.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as useProvisionCorsRules, c as useStrings, i as useNotify, s as useSlots } from "../chunks/Provider-
|
|
2
|
+
import { d as Markdown, f as CopyCodeBlock, m as Callout, p as CopyToClipboard, s as ConfirmModal, t as CreateModal } from "../chunks/CreateModal-DEvWkdFl.js";
|
|
3
|
+
import { a as useProvisionCorsRules, c as useStrings, i as useNotify, s as useSlots } from "../chunks/Provider-BIL5347a.js";
|
|
4
4
|
import { n as TOOLTIP_ID, r as TooltipInfo } from "../chunks/Tooltip-WgbiC_nd.js";
|
|
5
5
|
import { t as Loader } from "../chunks/Loader-BXoXTZGc.js";
|
|
6
|
+
import { d as copySubmenu, g as useRowMenuActive, h as useRowMenu, l as MoreButton, u as assembleRowMenu } from "../chunks/PageHeader-CSo3LVId.js";
|
|
6
7
|
import { t as StatusBadge } from "../chunks/StatusBadge-DXp4zkSd.js";
|
|
7
8
|
import { n as Table } from "../chunks/Table-ByziK93x.js";
|
|
8
|
-
import {
|
|
9
|
-
import { C as listTableProps, S as listTableFixedProps, _ as ListSkeleton, b as RowSelectCheckbox, h as ListActionsHeader } from "../chunks/list-CGbR-ueU.js";
|
|
9
|
+
import { D as listTableFixedProps, O as listTableProps, S as ListSkeleton, T as RowSelectCheckbox, b as ListActionsHeader } from "../chunks/list-CgzqVlao.js";
|
|
10
10
|
import cx from "classnames";
|
|
11
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { Suspense, createContext, lazy, memo, use, useCallback, useEffect, useEffectEvent, useId, useLayoutEffect, useMemo, useRef, useState, useTransition } from "react";
|
|
@@ -1537,9 +1537,8 @@ function NoDataAvailablePreview({ selectedStorage, error, onRefresh, connectionI
|
|
|
1537
1537
|
})
|
|
1538
1538
|
});
|
|
1539
1539
|
}
|
|
1540
|
-
function SkeletonPreview(
|
|
1540
|
+
function SkeletonPreview() {
|
|
1541
1541
|
const [sidebarWidth] = useLocalStorage(SIDEBAR_WIDTH_STORAGE_KEY, 300);
|
|
1542
|
-
const newNavigation = variant === "modern";
|
|
1543
1542
|
return /* @__PURE__ */ jsxs("div", {
|
|
1544
1543
|
className: "w-full h-full flex",
|
|
1545
1544
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -1547,15 +1546,12 @@ function SkeletonPreview({ variant = "classic" } = {}) {
|
|
|
1547
1546
|
style: { width: `${sidebarWidth}px` },
|
|
1548
1547
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1549
1548
|
className: "h-full flex flex-col border-r theme-border bg-(--theme-panel-bg)/60",
|
|
1550
|
-
children: [/* @__PURE__ */
|
|
1551
|
-
className:
|
|
1552
|
-
children:
|
|
1553
|
-
className: "text-[11px] font-semibold uppercase tracking-widest theme-muted-text",
|
|
1554
|
-
children: "Explorer"
|
|
1555
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
1549
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1550
|
+
className: "flex items-center justify-end h-10 px-3 shrink-0 border-b theme-border",
|
|
1551
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1556
1552
|
className: "flex gap-x-0.5",
|
|
1557
1553
|
children: [/* @__PURE__ */ jsx("div", { className: "h-7 w-7" }), /* @__PURE__ */ jsx("div", { className: "h-7 w-7" })]
|
|
1558
|
-
})
|
|
1554
|
+
})
|
|
1559
1555
|
}), /* @__PURE__ */ jsx("div", {
|
|
1560
1556
|
className: "overflow-auto flex-1 px-2 py-2 space-y-1.5",
|
|
1561
1557
|
children: [...Array(6)].map((_, i) => /* @__PURE__ */ jsx(Skeleton, { height: 14 }, i))
|
|
@@ -2519,7 +2515,7 @@ function useObjectText(url, { enabled, maxBytes, maxLines, knownSize, cacheKey,
|
|
|
2519
2515
|
}
|
|
2520
2516
|
//#endregion
|
|
2521
2517
|
//#region src/file-explorer/FilePreview/Viewer.tsx
|
|
2522
|
-
var CodePreviewEditor = lazy(() => import("../chunks/CodePreviewEditor-
|
|
2518
|
+
var CodePreviewEditor = lazy(() => import("../chunks/CodePreviewEditor-Uij_Npp4.js"));
|
|
2523
2519
|
var PREVIEW_MARKDOWN_CONTROLS = {
|
|
2524
2520
|
table: { fullscreen: false },
|
|
2525
2521
|
mermaid: { fullscreen: false }
|
|
@@ -4293,11 +4289,10 @@ function getAncestorDirPaths(path) {
|
|
|
4293
4289
|
for (let i = 1; i <= dirSegmentCount; i++) ancestors.push(segments.slice(0, i).join("/") + "/");
|
|
4294
4290
|
return ancestors;
|
|
4295
4291
|
}
|
|
4296
|
-
function FileExplorer({ storages, onRefresh, showUserHierarchy = false, groups = [], groupsLoading = false, selectedPath, onPathChange, getProviderAndClient
|
|
4292
|
+
function FileExplorer({ storages, onRefresh, showUserHierarchy = false, groups = [], groupsLoading = false, selectedPath, onPathChange, getProviderAndClient }) {
|
|
4297
4293
|
const t = useStrings().fileExplorer;
|
|
4298
4294
|
const notify = useNotify();
|
|
4299
4295
|
const slots = useSlots();
|
|
4300
|
-
const newNavigation = variant === "modern";
|
|
4301
4296
|
const fileExplorerContext = useFileExplorer();
|
|
4302
4297
|
const [localStorages, setLocalStorages] = useState(storages);
|
|
4303
4298
|
const [listings, setListings] = useState(() => /* @__PURE__ */ new Map());
|
|
@@ -5083,12 +5078,9 @@ function FileExplorer({ storages, onRefresh, showUserHierarchy = false, groups =
|
|
|
5083
5078
|
},
|
|
5084
5079
|
children: /* @__PURE__ */ jsxs("div", {
|
|
5085
5080
|
className: "h-full flex flex-col border-r theme-border bg-(--theme-panel-bg)/60",
|
|
5086
|
-
children: [/* @__PURE__ */
|
|
5087
|
-
className:
|
|
5088
|
-
children:
|
|
5089
|
-
className: "text-[11px] font-semibold uppercase tracking-widest theme-muted-text",
|
|
5090
|
-
children: t.chrome.explorer
|
|
5091
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
5081
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
5082
|
+
className: "flex items-center justify-end h-10 px-3 shrink-0 border-b theme-border",
|
|
5083
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
5092
5084
|
className: "flex gap-x-0.5",
|
|
5093
5085
|
children: [/* @__PURE__ */ jsx("button", {
|
|
5094
5086
|
"aria-label": t.chrome.refresh,
|
|
@@ -5107,7 +5099,7 @@ function FileExplorer({ storages, onRefresh, showUserHierarchy = false, groups =
|
|
|
5107
5099
|
onClick: collapseAll,
|
|
5108
5100
|
children: /* @__PURE__ */ jsx(CollapseIcon, { className: "h-3.5 w-3.5" })
|
|
5109
5101
|
})]
|
|
5110
|
-
})
|
|
5102
|
+
})
|
|
5111
5103
|
}), /* @__PURE__ */ jsx(TreeView, {
|
|
5112
5104
|
rootNodes,
|
|
5113
5105
|
parentToChildrenMap,
|
package/dist/form/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AngleRightIcon, EyeIcon, EyeOffIcon, SuccessCheckmark, TrashIcon } from "../icons.js";
|
|
2
|
-
import { c as useStrings, s as useSlots } from "../chunks/Provider-
|
|
2
|
+
import { c as useStrings, s as useSlots } from "../chunks/Provider-BIL5347a.js";
|
|
3
3
|
import { n as TOOLTIP_ID, r as TooltipInfo } from "../chunks/Tooltip-WgbiC_nd.js";
|
|
4
|
-
import { a as UncontrolledCollapsiblePanel, c as Dropdown, f as isCategory, n as SectionHeader, o as MultiSelectDropdown, r as ControlledCollapsiblePanel, s as CustomListbox, t as SwitchToggle } from "../chunks/SwitchToggle-
|
|
4
|
+
import { a as UncontrolledCollapsiblePanel, c as Dropdown, f as isCategory, n as SectionHeader, o as MultiSelectDropdown, r as ControlledCollapsiblePanel, s as CustomListbox, t as SwitchToggle } from "../chunks/SwitchToggle-D_H1iJEe.js";
|
|
5
5
|
import { t as Loader } from "../chunks/Loader-BXoXTZGc.js";
|
|
6
6
|
import { n as StatusDot } from "../chunks/StatusBadge-DXp4zkSd.js";
|
|
7
7
|
import { n as Table } from "../chunks/Table-ByziK93x.js";
|