@parallelworks/ui 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -6
- package/dist/chunks/{CodePreviewEditor-CBtYRZi6.js → CodePreviewEditor-KwzSyk3-.js} +1 -1
- package/dist/chunks/{CreateModal-6zZZHxCI.js → CreateModal-CXSi9ELO.js} +1 -1
- package/dist/chunks/{Monaco-CvFXoW3r.js → Monaco-FlGHL7zR.js} +2 -2
- package/dist/chunks/{Provider-jQCAN3NN.js → Provider-wC9G01Ou.js} +4 -1
- package/dist/chunks/RowContextMenu-D3G3DPQk.js +319 -0
- package/dist/chunks/{SwitchToggle-D0ud8cd5.js → SwitchToggle-CkYT1isd.js} +1 -1
- package/dist/chunks/{editor-CEXg6C8X.js → editor-DbDUZn8w.js} +2 -2
- package/dist/chunks/{list-CvDWt0TC.js → list-CGbR-ueU.js} +3 -315
- package/dist/components/Breadcrumbs.d.ts +28 -0
- package/dist/components/PageHeader.d.ts +69 -0
- package/dist/components/Provider.d.ts +12 -1
- package/dist/editor/index.js +1 -1
- package/dist/file-explorer/index.js +5 -4
- package/dist/form/index.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +233 -7
- package/dist/list/index.js +2 -1
- 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 +6 -0
- package/dist/workflow/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon,
|
|
2
|
-
import { c as useStrings,
|
|
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-wC9G01Ou.js";
|
|
3
3
|
import { n as TOOLTIP_ID, r as TooltipInfo } from "./Tooltip-WgbiC_nd.js";
|
|
4
4
|
import { n as Table } from "./Table-ByziK93x.js";
|
|
5
5
|
import cx from "classnames";
|
|
@@ -7,318 +7,6 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
8
8
|
import { createPortal } from "react-dom";
|
|
9
9
|
import { useLocalStorage } from "usehooks-ts";
|
|
10
|
-
//#region src/list/RowContextMenu.tsx
|
|
11
|
-
/** Converts a single row action to a menu item: a `to` makes it a link, otherwise an action. */
|
|
12
|
-
function toRowMenuItem(action) {
|
|
13
|
-
if (action.to) return {
|
|
14
|
-
kind: "link",
|
|
15
|
-
label: action.label,
|
|
16
|
-
icon: action.icon,
|
|
17
|
-
to: action.to,
|
|
18
|
-
destructive: action.destructive
|
|
19
|
-
};
|
|
20
|
-
return {
|
|
21
|
-
kind: "action",
|
|
22
|
-
label: action.label,
|
|
23
|
-
icon: action.icon,
|
|
24
|
-
onSelect: action.onSelect ?? (() => {}),
|
|
25
|
-
disabled: action.disabled,
|
|
26
|
-
destructive: action.destructive
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
/** Bridges a toolbar action (icon component, `onClick`/`href`) onto the shared
|
|
30
|
-
* `RowAction` shape. Typed structurally so any toolbar action shape matching
|
|
31
|
-
* these fields is assignable. */
|
|
32
|
-
function toolbarActionToRowAction(action) {
|
|
33
|
-
const Icon = action.icon;
|
|
34
|
-
return {
|
|
35
|
-
key: action.key,
|
|
36
|
-
label: action.label,
|
|
37
|
-
icon: /* @__PURE__ */ jsx(Icon, {}),
|
|
38
|
-
onSelect: action.onClick,
|
|
39
|
-
to: action.href,
|
|
40
|
-
disabled: action.disabled,
|
|
41
|
-
destructive: action.key === "delete" || action.key === "destroy"
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/** Assembles a row's context menu in the shared order: leading link(s) → middle
|
|
45
|
-
* actions → extra items → Copy submenu → trailing (destructive) actions last. */
|
|
46
|
-
function assembleRowMenu({ lead = [], actions, exclude, order, trailing = ["delete"], extra = [], copy }) {
|
|
47
|
-
const trailingSet = new Set(trailing);
|
|
48
|
-
const excludeSet = new Set(exclude);
|
|
49
|
-
let middle = actions.filter((a) => !trailingSet.has(a.key) && !excludeSet.has(a.key));
|
|
50
|
-
if (order) {
|
|
51
|
-
const byKey = new Map(middle.map((a) => [a.key, a]));
|
|
52
|
-
middle = order.map((key) => byKey.get(key)).filter((a) => a !== void 0);
|
|
53
|
-
}
|
|
54
|
-
const trailingItems = trailing.map((key) => actions.find((a) => a.key === key)).filter((a) => a !== void 0);
|
|
55
|
-
return [
|
|
56
|
-
...lead,
|
|
57
|
-
...middle.map(toRowMenuItem),
|
|
58
|
-
...extra,
|
|
59
|
-
...copy ? [copy] : [],
|
|
60
|
-
...trailingItems.map(toRowMenuItem)
|
|
61
|
-
];
|
|
62
|
-
}
|
|
63
|
-
function useRowMenu() {
|
|
64
|
-
const [menu, setMenu] = useState(null);
|
|
65
|
-
const onCloseRef = useRef(void 0);
|
|
66
|
-
return {
|
|
67
|
-
openMenu: useCallback((x, y, items, onClose) => {
|
|
68
|
-
if (items.length > 0) {
|
|
69
|
-
onCloseRef.current?.();
|
|
70
|
-
onCloseRef.current = onClose;
|
|
71
|
-
setMenu({
|
|
72
|
-
x,
|
|
73
|
-
y,
|
|
74
|
-
items
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}, []),
|
|
78
|
-
contextMenu: /* @__PURE__ */ jsx(RowContextMenu, {
|
|
79
|
-
state: menu,
|
|
80
|
-
onClose: useCallback(() => {
|
|
81
|
-
onCloseRef.current?.();
|
|
82
|
-
onCloseRef.current = void 0;
|
|
83
|
-
setMenu(null);
|
|
84
|
-
}, [])
|
|
85
|
-
})
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
/** The full-screen menu overlay drops CSS :hover on the triggering row; wrap openMenu here to substitute a JS-driven `active` highlight. */
|
|
89
|
-
function useRowMenuActive(openMenu) {
|
|
90
|
-
const [active, setActive] = useState(false);
|
|
91
|
-
return {
|
|
92
|
-
active,
|
|
93
|
-
openMenu: useCallback((x, y, items) => {
|
|
94
|
-
setActive(true);
|
|
95
|
-
openMenu(x, y, items, () => setActive(false));
|
|
96
|
-
}, [openMenu])
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function rowContextMenuProps(openMenu, items) {
|
|
100
|
-
return { onContextMenu: (e) => {
|
|
101
|
-
e.preventDefault();
|
|
102
|
-
if (items.length > 0) e.stopPropagation();
|
|
103
|
-
openMenu(e.clientX, e.clientY, items);
|
|
104
|
-
} };
|
|
105
|
-
}
|
|
106
|
-
function RowContextMenu({ state, onClose }) {
|
|
107
|
-
const ref = useRef(null);
|
|
108
|
-
const [pos, setPos] = useState(null);
|
|
109
|
-
useLayoutEffect(() => {
|
|
110
|
-
if (!state || !ref.current) {
|
|
111
|
-
setPos(null);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const { width, height } = ref.current.getBoundingClientRect();
|
|
115
|
-
const pad = 8;
|
|
116
|
-
const top = height > window.innerHeight - pad - state.y && state.y - height - pad >= 0 ? state.y - height : Math.min(state.y, window.innerHeight - height - pad);
|
|
117
|
-
setPos({
|
|
118
|
-
left: Math.max(pad, Math.min(state.x, window.innerWidth - width - pad)),
|
|
119
|
-
top: Math.max(pad, top)
|
|
120
|
-
});
|
|
121
|
-
}, [state]);
|
|
122
|
-
useEffect(() => {
|
|
123
|
-
if (!state) return;
|
|
124
|
-
const close = () => onClose();
|
|
125
|
-
const onKey = (e) => {
|
|
126
|
-
if (e.key === "Escape") onClose();
|
|
127
|
-
};
|
|
128
|
-
window.addEventListener("scroll", close, true);
|
|
129
|
-
window.addEventListener("resize", close);
|
|
130
|
-
window.addEventListener("keydown", onKey);
|
|
131
|
-
return () => {
|
|
132
|
-
window.removeEventListener("scroll", close, true);
|
|
133
|
-
window.removeEventListener("resize", close);
|
|
134
|
-
window.removeEventListener("keydown", onKey);
|
|
135
|
-
};
|
|
136
|
-
}, [state, onClose]);
|
|
137
|
-
if (!state) return null;
|
|
138
|
-
const side = (pos?.left ?? state.x) > window.innerWidth * .6 ? "left" : "right";
|
|
139
|
-
return createPortal(/* @__PURE__ */ jsx("div", {
|
|
140
|
-
className: "fixed inset-0 z-50",
|
|
141
|
-
onClick: onClose,
|
|
142
|
-
onContextMenu: (e) => {
|
|
143
|
-
e.preventDefault();
|
|
144
|
-
if (ref.current?.contains(e.target)) {
|
|
145
|
-
onClose();
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
const { clientX, clientY } = e;
|
|
149
|
-
const overlay = e.currentTarget;
|
|
150
|
-
overlay.style.pointerEvents = "none";
|
|
151
|
-
const under = document.elementFromPoint(clientX, clientY);
|
|
152
|
-
overlay.style.pointerEvents = "";
|
|
153
|
-
onClose();
|
|
154
|
-
under?.dispatchEvent(new MouseEvent("contextmenu", {
|
|
155
|
-
bubbles: true,
|
|
156
|
-
cancelable: true,
|
|
157
|
-
clientX,
|
|
158
|
-
clientY
|
|
159
|
-
}));
|
|
160
|
-
},
|
|
161
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
162
|
-
ref,
|
|
163
|
-
role: "menu",
|
|
164
|
-
className: "absolute min-w-44 rounded-lg border border-(--theme-border) bg-(--theme-panel-bg) py-1 shadow-lg backdrop-blur-xl",
|
|
165
|
-
style: {
|
|
166
|
-
left: pos?.left ?? state.x,
|
|
167
|
-
top: pos?.top ?? state.y,
|
|
168
|
-
visibility: pos ? "visible" : "hidden"
|
|
169
|
-
},
|
|
170
|
-
onClick: (e) => e.stopPropagation(),
|
|
171
|
-
children: /* @__PURE__ */ jsx(MenuItemList, {
|
|
172
|
-
items: state.items,
|
|
173
|
-
onClose,
|
|
174
|
-
side
|
|
175
|
-
})
|
|
176
|
-
})
|
|
177
|
-
}), document.body);
|
|
178
|
-
}
|
|
179
|
-
var MENU_ITEM_CLASSES = "flex w-full items-center gap-2.5 px-3 py-1.5 text-left text-[13px] hover:bg-(--theme-muted-panel-bg) transition-colors cursor-pointer [&>svg]:h-4 [&>svg]:w-4 [&>svg]:shrink-0";
|
|
180
|
-
function MenuItemList({ items, onClose, side }) {
|
|
181
|
-
return items.map((item, i) => item.kind === "divider" ? /* @__PURE__ */ jsx("div", {
|
|
182
|
-
"aria-hidden": "true",
|
|
183
|
-
className: "my-1 h-px bg-(--theme-border)"
|
|
184
|
-
}, `divider-${i}`) : /* @__PURE__ */ jsx(MenuRow, {
|
|
185
|
-
item,
|
|
186
|
-
onClose,
|
|
187
|
-
side
|
|
188
|
-
}, `${item.label}-${i}`));
|
|
189
|
-
}
|
|
190
|
-
function MenuRow({ item, onClose, side }) {
|
|
191
|
-
const Link = useLink();
|
|
192
|
-
const notify = useNotify();
|
|
193
|
-
const { list: t } = useStrings();
|
|
194
|
-
const [openSub, setOpenSub] = useState(false);
|
|
195
|
-
const closeTimer = useRef(void 0);
|
|
196
|
-
if (item.kind === "submenu") {
|
|
197
|
-
const open = () => {
|
|
198
|
-
clearTimeout(closeTimer.current);
|
|
199
|
-
setOpenSub(true);
|
|
200
|
-
};
|
|
201
|
-
const close = () => {
|
|
202
|
-
closeTimer.current = setTimeout(() => setOpenSub(false), 160);
|
|
203
|
-
};
|
|
204
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
205
|
-
className: "relative",
|
|
206
|
-
onMouseEnter: open,
|
|
207
|
-
onMouseLeave: close,
|
|
208
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
209
|
-
className: cx(MENU_ITEM_CLASSES, "justify-between text-(--theme-app)"),
|
|
210
|
-
children: [/* @__PURE__ */ jsxs("span", {
|
|
211
|
-
className: "flex items-center gap-2.5",
|
|
212
|
-
children: [item.icon, item.label]
|
|
213
|
-
}), /* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-3 w-3 shrink-0 opacity-60" })]
|
|
214
|
-
}), openSub && /* @__PURE__ */ jsx("div", {
|
|
215
|
-
className: cx("absolute -top-1 z-10 min-w-44 rounded-lg border border-(--theme-border) bg-(--theme-panel-bg) py-1 shadow-lg", side === "left" ? "right-full" : "left-full"),
|
|
216
|
-
children: /* @__PURE__ */ jsx(MenuItemList, {
|
|
217
|
-
items: item.items,
|
|
218
|
-
onClose,
|
|
219
|
-
side
|
|
220
|
-
})
|
|
221
|
-
})]
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
if (item.kind === "link") return /* @__PURE__ */ jsxs(Link, {
|
|
225
|
-
to: item.to,
|
|
226
|
-
onClick: onClose,
|
|
227
|
-
className: cx(MENU_ITEM_CLASSES, item.destructive ? "text-red-500" : "text-(--theme-app)"),
|
|
228
|
-
children: [item.icon, item.label]
|
|
229
|
-
});
|
|
230
|
-
return /* @__PURE__ */ jsxs("button", {
|
|
231
|
-
type: "button",
|
|
232
|
-
disabled: item.disabled,
|
|
233
|
-
onClick: () => {
|
|
234
|
-
if (item.copy) {
|
|
235
|
-
const { text, label } = item.copy;
|
|
236
|
-
navigator.clipboard?.writeText(text).then(() => notify.success(t.copied(label)), () => notify.error(t.couldntCopy(label)));
|
|
237
|
-
}
|
|
238
|
-
item.onSelect?.();
|
|
239
|
-
onClose();
|
|
240
|
-
},
|
|
241
|
-
className: cx(MENU_ITEM_CLASSES, item.destructive ? "text-red-500" : "text-(--theme-app)", item.disabled && "opacity-40 cursor-not-allowed hover:bg-transparent"),
|
|
242
|
-
children: [
|
|
243
|
-
item.icon,
|
|
244
|
-
item.label,
|
|
245
|
-
item.selected && /* @__PURE__ */ jsx(CheckIcon, { className: "ml-auto opacity-80" })
|
|
246
|
-
]
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
/** Builds the Copy submenu entries for whichever fields a row has, in stable
|
|
250
|
-
* order. The menu itself performs the copy and notifies; `t` is an optional
|
|
251
|
-
* host translator for the field labels (falls back to the provider defaults'
|
|
252
|
-
* English). */
|
|
253
|
-
function copySubmenu({ name, nameLabel, email, username, uid, id, url, extra, t }) {
|
|
254
|
-
const items = [
|
|
255
|
-
{
|
|
256
|
-
label: nameLabel ?? (t ? t("rowContextMenu.labelName") : "name"),
|
|
257
|
-
value: name,
|
|
258
|
-
icon: /* @__PURE__ */ jsx(CopyIcon, {})
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
label: t ? t("rowContextMenu.labelEmail") : "email",
|
|
262
|
-
value: email,
|
|
263
|
-
icon: /* @__PURE__ */ jsx(MailIcon, {})
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
label: t ? t("rowContextMenu.labelUsername") : "username",
|
|
267
|
-
value: username,
|
|
268
|
-
icon: /* @__PURE__ */ jsx(UserIcon, {})
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
label: t ? t("rowContextMenu.labelUid") : "UID",
|
|
272
|
-
value: uid === null || uid === void 0 ? null : String(uid),
|
|
273
|
-
icon: /* @__PURE__ */ jsx(KeyIcon, {})
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
label: t ? t("rowContextMenu.labelId") : "ID",
|
|
277
|
-
value: id,
|
|
278
|
-
icon: /* @__PURE__ */ jsx(IdCardIcon, {})
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
label: t ? t("rowContextMenu.labelUrl") : "URL",
|
|
282
|
-
value: url,
|
|
283
|
-
icon: /* @__PURE__ */ jsx(LinkIcon, {})
|
|
284
|
-
},
|
|
285
|
-
...(extra ?? []).map((e) => ({
|
|
286
|
-
label: e.label,
|
|
287
|
-
value: e.value,
|
|
288
|
-
icon: e.icon ?? /* @__PURE__ */ jsx(CopyIcon, {})
|
|
289
|
-
}))
|
|
290
|
-
].filter((f) => f.value).map((f) => ({
|
|
291
|
-
kind: "action",
|
|
292
|
-
label: t ? t("rowContextMenu.copy", { label: f.label }) : `Copy ${f.label}`,
|
|
293
|
-
icon: f.icon,
|
|
294
|
-
copy: {
|
|
295
|
-
text: f.value,
|
|
296
|
-
label: f.label
|
|
297
|
-
}
|
|
298
|
-
}));
|
|
299
|
-
return {
|
|
300
|
-
kind: "submenu",
|
|
301
|
-
label: t ? t("common.copy") : "Copy",
|
|
302
|
-
icon: /* @__PURE__ */ jsx(ClipboardIcon, {}),
|
|
303
|
-
items
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
/** Stays visible while active (menu open) so it doesn't vanish behind the overlay. */
|
|
307
|
-
function MoreButton({ onOpen, active, className }) {
|
|
308
|
-
const { list: t } = useStrings();
|
|
309
|
-
return /* @__PURE__ */ jsx("button", {
|
|
310
|
-
type: "button",
|
|
311
|
-
"aria-label": t.moreActions,
|
|
312
|
-
onClick: (e) => {
|
|
313
|
-
e.stopPropagation();
|
|
314
|
-
const r = e.currentTarget.getBoundingClientRect();
|
|
315
|
-
onOpen(r.right, r.bottom);
|
|
316
|
-
},
|
|
317
|
-
className: cx("rounded p-1 cursor-pointer text-(--theme-muted-text-color) transition-colors hover:bg-(--theme-muted-panel-bg) hover:text-(--theme-app) focus-visible:opacity-100", active ? "opacity-100" : "opacity-0 group-hover:opacity-100", className),
|
|
318
|
-
children: /* @__PURE__ */ jsx(MoreIcon, { className: "h-4 w-4" })
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
//#endregion
|
|
322
10
|
//#region src/list/ListTable.tsx
|
|
323
11
|
var NAME_TEXT = "font-medium text-[13px] leading-tight text-(--theme-app) truncate";
|
|
324
12
|
var SUBTITLE_TEXT = "text-xs leading-tight text-(--theme-muted-text-color) truncate";
|
|
@@ -1256,4 +944,4 @@ function HoverCardSurface({ x, y, widthClassName, relayoutKey, onKeepOpen, onLea
|
|
|
1256
944
|
}), document.querySelector(".ds-root") ?? document.body);
|
|
1257
945
|
}
|
|
1258
946
|
//#endregion
|
|
1259
|
-
export {
|
|
947
|
+
export { listTableProps as C, listTableFixedProps as S, ListSkeleton as _, ListSearchControl as a, RowSelectCheckbox as b, ListFilterMenu as c, DEFAULT_ORDER as d, FAVORITE_ORDER as f, ListError as g, ListActionsHeader as h, ListCount as i, listControlButtonClasses as l, GroupRow as m, useHoverCard as n, useListSearch as o, useListView as p, ListPager as r, ListDisplayMenu as s, HoverCardSurface as t, isTextEntryContext as u, NAME_MIN_WIDTH_PX as v, actionsColumnWidth as x, NameCell as y };
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
}
|
|
20
|
+
export declare const useBreadcrumb: () => BreadcrumbContextType;
|
|
21
|
+
export declare function BreadcrumbProvider({ children, }: {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
}): React.JSX.Element;
|
|
24
|
+
export declare function useSetBreadcrumbs(getBreadcrumbs: (() => IBreadcrumbItem[]) | IBreadcrumbItem[]): void;
|
|
25
|
+
/** For pages that render their own header instead of the breadcrumb strip. */
|
|
26
|
+
export declare function useClearBreadcrumbs(): void;
|
|
27
|
+
export declare function useHideBreadcrumbs(hidden: boolean): void;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { type RowMenuItem } from '../list/RowContextMenu.js';
|
|
3
|
+
import { type HeaderAddMenuItem } from './AddMenu.js';
|
|
4
|
+
export interface PageHeaderBreadcrumb {
|
|
5
|
+
label: string;
|
|
6
|
+
href?: string;
|
|
7
|
+
}
|
|
8
|
+
/** A rendered crumb row entry, as handed to the breadcrumbPin slot. */
|
|
9
|
+
export interface PageHeaderCrumb {
|
|
10
|
+
label: ReactNode;
|
|
11
|
+
href?: string;
|
|
12
|
+
}
|
|
13
|
+
/** With menu, the plus opens a chooser; otherwise navigates to or calls the
|
|
14
|
+
* single action. `word` is the visible verb; `label` stays the full action for
|
|
15
|
+
* the tooltip and screen readers. */
|
|
16
|
+
export declare function HeaderAddButton({ to, onClick, label, word, menu, }: {
|
|
17
|
+
to?: string;
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
label: string;
|
|
20
|
+
word?: 'add' | 'create';
|
|
21
|
+
menu?: HeaderAddMenuItem[];
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
export declare function HeaderActionMenu({ items, label, }: {
|
|
24
|
+
items: HeaderAddMenuItem[];
|
|
25
|
+
label?: string;
|
|
26
|
+
}): import("react").JSX.Element | null;
|
|
27
|
+
/** The header "…" trigger for a RowMenuItem menu — same rendering (submenus,
|
|
28
|
+
* destructive styling) as the list pages' right-click context menus. */
|
|
29
|
+
export declare function HeaderRowMenu({ items, label, }: {
|
|
30
|
+
items: RowMenuItem[];
|
|
31
|
+
label?: string;
|
|
32
|
+
}): import("react").JSX.Element | null;
|
|
33
|
+
export declare function HeaderEditButton({ to, onClick, label, disabled, tooltip, }: {
|
|
34
|
+
to?: string;
|
|
35
|
+
onClick?: () => void;
|
|
36
|
+
label?: string;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
tooltip?: string;
|
|
39
|
+
}): import("react").JSX.Element;
|
|
40
|
+
/** Renders nothing when the modern breadcrumb strip isn't mounted (classic chrome or self-headered pages). */
|
|
41
|
+
export declare function BreadcrumbsTitleAction({ children }: {
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
}): import("react").ReactPortal | null;
|
|
44
|
+
export declare function BreadcrumbsRightAction({ children }: {
|
|
45
|
+
children: ReactNode;
|
|
46
|
+
}): import("react").ReactPortal | null;
|
|
47
|
+
export declare function BreadcrumbsActionButton({ icon: Icon, label, to, onClick, disabled, tooltip, }: {
|
|
48
|
+
icon: ComponentType<{
|
|
49
|
+
className?: string;
|
|
50
|
+
}>;
|
|
51
|
+
label: string;
|
|
52
|
+
to?: string;
|
|
53
|
+
onClick?: () => void;
|
|
54
|
+
disabled?: boolean;
|
|
55
|
+
tooltip?: string;
|
|
56
|
+
}): import("react").JSX.Element;
|
|
57
|
+
interface PageHeaderProps {
|
|
58
|
+
breadcrumbs?: PageHeaderBreadcrumb[];
|
|
59
|
+
title?: ReactNode;
|
|
60
|
+
titleAction?: ReactNode;
|
|
61
|
+
actions?: ReactNode;
|
|
62
|
+
toolbar?: ReactNode;
|
|
63
|
+
className?: string;
|
|
64
|
+
sticky?: boolean;
|
|
65
|
+
/** Negative offset (e.g. -top-4) prevents rows peeking above the header when the container has top padding. */
|
|
66
|
+
stickyTopClassName?: string;
|
|
67
|
+
}
|
|
68
|
+
export declare function PageHeader({ breadcrumbs, title, titleAction, actions, toolbar, className, sticky, stickyTopClassName, }: PageHeaderProps): import("react").JSX.Element;
|
|
69
|
+
export {};
|
|
@@ -50,6 +50,8 @@ export interface UIStrings {
|
|
|
50
50
|
showHiddenFields: string;
|
|
51
51
|
showHiddenFieldsHint: string;
|
|
52
52
|
jsonHasErrors: string;
|
|
53
|
+
add: string;
|
|
54
|
+
create: string;
|
|
53
55
|
};
|
|
54
56
|
dropdown: {
|
|
55
57
|
select: (type: string) => string;
|
|
@@ -382,12 +384,17 @@ export interface UIData {
|
|
|
382
384
|
}>;
|
|
383
385
|
}
|
|
384
386
|
import type { FieldComponent } from '../form/fieldRegistry.js';
|
|
385
|
-
|
|
387
|
+
import type { PageHeaderCrumb } from './PageHeader.js';
|
|
388
|
+
/** Renders internal navigation; hosts bind their router's Link. Accessibility
|
|
389
|
+
* and tooltip data attributes pass through so header links keep their labels. */
|
|
386
390
|
export type UILinkComponent = React.ComponentType<{
|
|
387
391
|
to: string;
|
|
388
392
|
onClick?: () => void;
|
|
389
393
|
className?: string;
|
|
390
394
|
children: ReactNode;
|
|
395
|
+
title?: string;
|
|
396
|
+
'aria-label'?: string;
|
|
397
|
+
[dataAttr: `data-${string}`]: string | undefined;
|
|
391
398
|
}>;
|
|
392
399
|
/** The provider's link slot, with a plain anchor fallback. */
|
|
393
400
|
export declare function useLink(): UILinkComponent;
|
|
@@ -436,6 +443,10 @@ export interface UISlots {
|
|
|
436
443
|
storage: unknown;
|
|
437
444
|
groups?: unknown;
|
|
438
445
|
}) => ReactNode;
|
|
446
|
+
/** Pin affordance rendered after the page header's crumb trail; absent hides it. */
|
|
447
|
+
breadcrumbPin?: (args: {
|
|
448
|
+
crumbs: readonly PageHeaderCrumb[];
|
|
449
|
+
}) => ReactNode;
|
|
439
450
|
}
|
|
440
451
|
export interface UIProviderValue {
|
|
441
452
|
notify: UINotify;
|
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-DbDUZn8w.js";
|
|
2
2
|
export { Editor, EditorField, FormCodePanel, defineEditorThemes, getThemeName, setupMonacoWorkers };
|
|
@@ -1,11 +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 { c as ConfirmModal, f as Markdown, h as Callout, m as CopyToClipboard, p as CopyCodeBlock, t as CreateModal } from "../chunks/CreateModal-
|
|
3
|
-
import { a as useProvisionCorsRules, c as useStrings, i as useNotify, s as useSlots } from "../chunks/Provider-
|
|
2
|
+
import { c as ConfirmModal, f as Markdown, h as Callout, m as CopyToClipboard, p as CopyCodeBlock, t as CreateModal } from "../chunks/CreateModal-CXSi9ELO.js";
|
|
3
|
+
import { a as useProvisionCorsRules, c as useStrings, i as useNotify, s as useSlots } from "../chunks/Provider-wC9G01Ou.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
6
|
import { t as StatusBadge } from "../chunks/StatusBadge-DXp4zkSd.js";
|
|
7
7
|
import { n as Table } from "../chunks/Table-ByziK93x.js";
|
|
8
|
-
import {
|
|
8
|
+
import { c as useRowMenuActive, n as assembleRowMenu, r as copySubmenu, s as useRowMenu, t as MoreButton } from "../chunks/RowContextMenu-D3G3DPQk.js";
|
|
9
|
+
import { C as listTableProps, S as listTableFixedProps, _ as ListSkeleton, b as RowSelectCheckbox, h as ListActionsHeader } from "../chunks/list-CGbR-ueU.js";
|
|
9
10
|
import cx from "classnames";
|
|
10
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
12
|
import { Suspense, createContext, lazy, memo, use, useCallback, useEffect, useEffectEvent, useId, useLayoutEffect, useMemo, useRef, useState, useTransition } from "react";
|
|
@@ -2518,7 +2519,7 @@ function useObjectText(url, { enabled, maxBytes, maxLines, knownSize, cacheKey,
|
|
|
2518
2519
|
}
|
|
2519
2520
|
//#endregion
|
|
2520
2521
|
//#region src/file-explorer/FilePreview/Viewer.tsx
|
|
2521
|
-
var CodePreviewEditor = lazy(() => import("../chunks/CodePreviewEditor-
|
|
2522
|
+
var CodePreviewEditor = lazy(() => import("../chunks/CodePreviewEditor-KwzSyk3-.js"));
|
|
2522
2523
|
var PREVIEW_MARKDOWN_CONTROLS = {
|
|
2523
2524
|
table: { fullscreen: false },
|
|
2524
2525
|
mermaid: { fullscreen: false }
|
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-wC9G01Ou.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-CkYT1isd.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";
|
package/dist/index.d.ts
CHANGED
|
@@ -45,3 +45,5 @@ export { default as SettingsCard } from './components/SettingsCard.js';
|
|
|
45
45
|
export { default as SettingsGroup } from './components/SettingsGroup.js';
|
|
46
46
|
export { SettingRow, SettingSection } from './components/SettingRow.js';
|
|
47
47
|
export { SettingModeOption } from './components/SettingModeOption.js';
|
|
48
|
+
export { BreadcrumbProvider, useBreadcrumb, useClearBreadcrumbs, useHideBreadcrumbs, useSetBreadcrumbs, type IBreadcrumbItem, } from './components/Breadcrumbs.js';
|
|
49
|
+
export { BreadcrumbsActionButton, BreadcrumbsRightAction, BreadcrumbsTitleAction, HeaderActionMenu, HeaderAddButton, HeaderEditButton, HeaderRowMenu, PageHeader, type PageHeaderBreadcrumb, type PageHeaderCrumb, } from './components/PageHeader.js';
|