@abpjs/ui 0.2.0-next.2 → 0.2.0-next.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/CHANGELOG.md +20 -0
- package/dist/ai.d.ts +109 -22
- package/dist/ai.js +222 -109
- package/dist/ai.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +77 -56
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -339,7 +339,10 @@ declare function HostProvider({ value, children }: {
|
|
|
339
339
|
declare function useHost(): AbpHost;
|
|
340
340
|
/** The host when there is one: for parts that also work without (a slot that draws nothing). */
|
|
341
341
|
declare function useOptionalHost(): AbpHost | null;
|
|
342
|
-
/**
|
|
342
|
+
/**
|
|
343
|
+
* A package's calls on this host: its base path in front of each path. The same function while the area's path stays
|
|
344
|
+
* the same, whatever the host object is; each call goes through the host's current `request`.
|
|
345
|
+
*/
|
|
343
346
|
declare function useAreaRequest(area: string): HostRequest;
|
|
344
347
|
interface ApiQuery<T> {
|
|
345
348
|
data: T | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1560,7 +1560,7 @@ function useTokenVar() {
|
|
|
1560
1560
|
}
|
|
1561
1561
|
|
|
1562
1562
|
// src/version.ts
|
|
1563
|
-
var ABP_UI_VERSION = true ? "0.2.0-next.
|
|
1563
|
+
var ABP_UI_VERSION = true ? "0.2.0-next.3" : "0.0.0-dev";
|
|
1564
1564
|
|
|
1565
1565
|
// src/provider/time-zone.tsx
|
|
1566
1566
|
import { createContext, useContext } from "react";
|
|
@@ -2194,7 +2194,7 @@ function ColorModeToggle({ size = "sm" }) {
|
|
|
2194
2194
|
}
|
|
2195
2195
|
|
|
2196
2196
|
// src/host/HostContext.tsx
|
|
2197
|
-
import { createContext as createContext7, useCallback as useCallback4, useContext as useContext7, useEffect as useEffect3, useMemo as useMemo2, useRef as useRef4, useState as useState5 } from "react";
|
|
2197
|
+
import { createContext as createContext7, useCallback as useCallback4, useContext as useContext7, useEffect as useEffect3, useInsertionEffect, useMemo as useMemo2, useRef as useRef4, useState as useState5 } from "react";
|
|
2198
2198
|
|
|
2199
2199
|
// src/host/errors.ts
|
|
2200
2200
|
var AbpApiError = class extends Error {
|
|
@@ -2223,6 +2223,10 @@ async function readAbpError(res) {
|
|
|
2223
2223
|
if (e) {
|
|
2224
2224
|
return new AbpApiError(res.status, e.code ?? null, e.message || e.details || message, e.details ?? null, e.validationErrors ?? [], e.data ?? null);
|
|
2225
2225
|
}
|
|
2226
|
+
if (body && typeof body === "object" && typeof body.message === "string" && body.message) {
|
|
2227
|
+
const { code, message: text, details, ...rest } = body;
|
|
2228
|
+
return new AbpApiError(res.status, typeof code === "string" ? code : null, text, typeof details === "string" ? details : null, [], Object.keys(rest).length ? rest : null);
|
|
2229
|
+
}
|
|
2226
2230
|
if (typeof body?.title === "string") message = body.title;
|
|
2227
2231
|
} catch {
|
|
2228
2232
|
}
|
|
@@ -2247,11 +2251,19 @@ function useHost() {
|
|
|
2247
2251
|
function useOptionalHost() {
|
|
2248
2252
|
return useContext7(HostContext);
|
|
2249
2253
|
}
|
|
2254
|
+
function useLatest(value) {
|
|
2255
|
+
const ref = useRef4(value);
|
|
2256
|
+
useInsertionEffect(() => {
|
|
2257
|
+
ref.current = value;
|
|
2258
|
+
});
|
|
2259
|
+
return ref;
|
|
2260
|
+
}
|
|
2250
2261
|
function useAreaRequest(area) {
|
|
2251
2262
|
const host = useHost();
|
|
2263
|
+
const latest = useLatest(host);
|
|
2252
2264
|
const base = host.paths[area];
|
|
2253
2265
|
if (base === void 0) throw new Error(`The host gives no path for "${area}" (AbpHost.paths).`);
|
|
2254
|
-
return useCallback4((path, init) =>
|
|
2266
|
+
return useCallback4((path, init) => latest.current.request(`${base.replace(/\/$/, "")}${path}`, init), [latest, base]);
|
|
2255
2267
|
}
|
|
2256
2268
|
function useApiQuery(area, path) {
|
|
2257
2269
|
const request = useAreaRequest(area);
|
|
@@ -2312,12 +2324,13 @@ function useApiDownload(area) {
|
|
|
2312
2324
|
}
|
|
2313
2325
|
function useAreaEvents(area) {
|
|
2314
2326
|
const host = useHost();
|
|
2327
|
+
const latest = useLatest(host);
|
|
2315
2328
|
const base = host.paths[area];
|
|
2316
|
-
const
|
|
2329
|
+
const has = Boolean(host.events);
|
|
2317
2330
|
return useMemo2(() => {
|
|
2318
|
-
if (!
|
|
2319
|
-
return (path, onEvent, options) => events(`${base.replace(/\/$/, "")}${path}`, onEvent, options);
|
|
2320
|
-
}, [
|
|
2331
|
+
if (!has || base === void 0) return null;
|
|
2332
|
+
return (path, onEvent, options) => latest.current.events(`${base.replace(/\/$/, "")}${path}`, onEvent, options);
|
|
2333
|
+
}, [has, latest, base]);
|
|
2321
2334
|
}
|
|
2322
2335
|
function useMe() {
|
|
2323
2336
|
return useOptionalHost()?.me ?? null;
|
|
@@ -2335,18 +2348,21 @@ function useHostLanguages() {
|
|
|
2335
2348
|
}
|
|
2336
2349
|
function useNames(kind, ids) {
|
|
2337
2350
|
const host = useOptionalHost();
|
|
2351
|
+
const latest = useLatest(host);
|
|
2352
|
+
const can = Boolean(kind === "people" ? host?.names : host?.scopes?.name);
|
|
2338
2353
|
const [names, setNames] = useState5({});
|
|
2339
2354
|
const key = useMemo2(() => [...new Set(ids)].sort().join(","), [ids]);
|
|
2340
2355
|
useEffect3(() => {
|
|
2341
2356
|
const wanted = key ? key.split(",") : [];
|
|
2342
|
-
const
|
|
2357
|
+
const h = latest.current;
|
|
2358
|
+
const resolve = kind === "people" ? h?.names : h?.scopes?.name;
|
|
2343
2359
|
if (!resolve || wanted.length === 0) return;
|
|
2344
2360
|
let alive = true;
|
|
2345
2361
|
resolve(wanted).then((found) => alive && setNames(found), () => void 0);
|
|
2346
2362
|
return () => {
|
|
2347
2363
|
alive = false;
|
|
2348
2364
|
};
|
|
2349
|
-
}, [
|
|
2365
|
+
}, [can, latest, kind, key]);
|
|
2350
2366
|
return names;
|
|
2351
2367
|
}
|
|
2352
2368
|
function HostSlot({ name, context }) {
|
|
@@ -2586,7 +2602,7 @@ function requestStepUp() {
|
|
|
2586
2602
|
// src/host/step-up-texts/ar.json
|
|
2587
2603
|
var ar_default = {
|
|
2588
2604
|
title: "\u0623\u0643\u0651\u062F \u0647\u0648\u064A\u062A\u0643",
|
|
2589
|
-
why: "\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \
|
|
2605
|
+
why: "\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0645\u062D\u0645\u064A. \u0623\u062F\u062E\u0644 \u0643\u0644\u0645\u0629 \u0627\u0644\u0645\u0631\u0648\u0631 \u0644\u0644\u0645\u062A\u0627\u0628\u0639\u0629.",
|
|
2590
2606
|
codeWhy: "\u062D\u0633\u0627\u0628\u0643 \u0645\u0641\u0639\u0651\u0644 \u0639\u0644\u064A\u0647 \u0627\u0644\u062A\u062D\u0642\u0642 \u0628\u062E\u0637\u0648\u062A\u064A\u0646: \u0623\u062F\u062E\u0644 \u0631\u0645\u0632\u064B\u0627 \u0623\u064A\u0636\u064B\u0627.",
|
|
2591
2607
|
password: "\u0643\u0644\u0645\u0629 \u0627\u0644\u0645\u0631\u0648\u0631",
|
|
2592
2608
|
confirm: "\u062A\u0623\u0643\u064A\u062F",
|
|
@@ -2613,7 +2629,7 @@ var ar_default = {
|
|
|
2613
2629
|
// src/host/step-up-texts/en.json
|
|
2614
2630
|
var en_default = {
|
|
2615
2631
|
title: "Confirm it's you",
|
|
2616
|
-
why: "This
|
|
2632
|
+
why: "This action is protected. Enter your password to go on.",
|
|
2617
2633
|
codeWhy: "Your account has two-factor sign-in: enter a code too.",
|
|
2618
2634
|
password: "Password",
|
|
2619
2635
|
confirm: "Confirm",
|
|
@@ -3287,7 +3303,7 @@ function Nudge({ on, children }) {
|
|
|
3287
3303
|
}
|
|
3288
3304
|
|
|
3289
3305
|
// src/components/AppShell.tsx
|
|
3290
|
-
import { useCallback as useCallback8, useState as useState8 } from "react";
|
|
3306
|
+
import { Fragment as Fragment3, useCallback as useCallback8, useState as useState8 } from "react";
|
|
3291
3307
|
import { chakra as chakra7, Drawer, Portal as Portal6, SkipNavContent, SkipNavLink, useSlotRecipe } from "@chakra-ui/react";
|
|
3292
3308
|
import { ChevronDown, Menu as MenuIcon, PanelLeftClose, PanelLeftOpen, X } from "lucide-react";
|
|
3293
3309
|
|
|
@@ -3315,7 +3331,7 @@ var Tooltip = forwardRef4(function Tooltip2({ content, children, disabled, inact
|
|
|
3315
3331
|
});
|
|
3316
3332
|
|
|
3317
3333
|
// src/components/AppShell.tsx
|
|
3318
|
-
import { Fragment as
|
|
3334
|
+
import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3319
3335
|
var MAIN_ID = "abp-main";
|
|
3320
3336
|
function AppShell({
|
|
3321
3337
|
brand,
|
|
@@ -3347,7 +3363,7 @@ function AppShell({
|
|
|
3347
3363
|
onCollapsedChange?.(next);
|
|
3348
3364
|
}, [collapsed, onCollapsedChange]);
|
|
3349
3365
|
const mark2 = brand.mark ?? (typeof brand.name === "string" ? brand.name.slice(0, 1) : null);
|
|
3350
|
-
const brandInner = /* @__PURE__ */ jsxs12(
|
|
3366
|
+
const brandInner = /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
3351
3367
|
/* @__PURE__ */ jsx21(chakra7.span, { css: styles.brandMark, "aria-hidden": "true", children: mark2 }),
|
|
3352
3368
|
/* @__PURE__ */ jsx21(chakra7.span, { css: styles.brandText, children: /* @__PURE__ */ jsx21(chakra7.span, { css: styles.brandName, children: brand.name }) })
|
|
3353
3369
|
] });
|
|
@@ -3378,7 +3394,7 @@ function AppShell({
|
|
|
3378
3394
|
] }),
|
|
3379
3395
|
/* @__PURE__ */ jsx21(Drawer.Root, { open: mobileOpen, onOpenChange: (e) => setMobileOpen(e.open), placement: "start", size: "xs", children: /* @__PURE__ */ jsxs12(Portal6, { children: [
|
|
3380
3396
|
/* @__PURE__ */ jsx21(Drawer.Backdrop, {}),
|
|
3381
|
-
/* @__PURE__ */ jsx21(Drawer.Positioner, { children: /* @__PURE__ */ jsx21(Drawer.Content, { children: /* @__PURE__ */ jsxs12(
|
|
3397
|
+
/* @__PURE__ */ jsx21(Drawer.Positioner, { children: /* @__PURE__ */ jsx21(Drawer.Content, { "aria-label": labels.navigation, children: /* @__PURE__ */ jsxs12(
|
|
3382
3398
|
chakra7.div,
|
|
3383
3399
|
{
|
|
3384
3400
|
css: mobileStyles.sidebar,
|
|
@@ -3397,17 +3413,15 @@ function AppShell({
|
|
|
3397
3413
|
styles: mobileStyles,
|
|
3398
3414
|
sidebar: {
|
|
3399
3415
|
id: `drawer-${sidebar?.id ?? "site"}`,
|
|
3416
|
+
place: hasSidebar ? sidebar.place : void 0,
|
|
3400
3417
|
top: hasSidebar ? sidebar.top : void 0,
|
|
3401
3418
|
loading: hasSidebar && sidebar.loading,
|
|
3402
3419
|
skeletonItems: hasSidebar ? sidebar.skeletonItems : void 0,
|
|
3403
|
-
sections: [
|
|
3404
|
-
{ id: "site", items: topNav },
|
|
3405
|
-
...hasSidebar ? sidebar.sections.map((s, i) => i === 0 && !s.title && sidebar.place ? { ...s, title: sidebar.place.name } : s) : []
|
|
3406
|
-
]
|
|
3420
|
+
sections: [{ id: "site", items: topNav }, ...hasSidebar ? sidebar.sections : []]
|
|
3407
3421
|
},
|
|
3422
|
+
placeAfter: hasSidebar ? "site" : void 0,
|
|
3408
3423
|
navFooter,
|
|
3409
|
-
collapsed: false
|
|
3410
|
-
drawer: true
|
|
3424
|
+
collapsed: false
|
|
3411
3425
|
}
|
|
3412
3426
|
)
|
|
3413
3427
|
]
|
|
@@ -3428,7 +3442,7 @@ function SidebarContents({
|
|
|
3428
3442
|
sidebar,
|
|
3429
3443
|
navFooter,
|
|
3430
3444
|
collapsed,
|
|
3431
|
-
|
|
3445
|
+
placeAfter
|
|
3432
3446
|
}) {
|
|
3433
3447
|
const Link = useLinkComponent();
|
|
3434
3448
|
const labels = useAbpLabels();
|
|
@@ -3436,16 +3450,17 @@ function SidebarContents({
|
|
|
3436
3450
|
const loading = !!sidebar.loading;
|
|
3437
3451
|
const arrive = useArriving(loading) ? arriveCss : void 0;
|
|
3438
3452
|
const placeMark = place ? place.mark ?? place.name.slice(0, 1).toUpperCase() : null;
|
|
3439
|
-
const placeInner = place && /* @__PURE__ */ jsxs12(
|
|
3453
|
+
const placeInner = place && /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
3440
3454
|
/* @__PURE__ */ jsx21(chakra7.span, { css: styles.placeMark, "aria-hidden": "true", children: placeMark }),
|
|
3441
3455
|
/* @__PURE__ */ jsxs12(chakra7.span, { css: styles.placeText, children: [
|
|
3442
3456
|
/* @__PURE__ */ jsx21(chakra7.span, { css: styles.placeName, children: place.name }),
|
|
3443
3457
|
place.detail != null && /* @__PURE__ */ jsx21(chakra7.span, { css: styles.placeDetail, children: place.detail })
|
|
3444
3458
|
] })
|
|
3445
3459
|
] });
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
/* @__PURE__ */ jsx21(chakra7.div, { css:
|
|
3460
|
+
const headerCss = placeAfter === void 0 ? styles.placeHeader : { ...styles.placeHeader, px: "0" };
|
|
3461
|
+
const placeBlock = /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
3462
|
+
place ? /* @__PURE__ */ jsx21(chakra7.div, { css: [headerCss, arrive], children: place.href ? /* @__PURE__ */ jsx21(chakra7.span, { asChild: true, css: styles.place, children: /* @__PURE__ */ jsx21(Link, { href: place.href, children: placeInner }) }) : /* @__PURE__ */ jsx21(chakra7.span, { css: styles.place, children: placeInner }) }) : loading && // The place's card, its name and key coming: the same elements, so it's as tall as the real one.
|
|
3463
|
+
/* @__PURE__ */ jsx21(chakra7.div, { css: headerCss, "aria-hidden": "true", children: /* @__PURE__ */ jsxs12(chakra7.span, { css: styles.place, pointerEvents: "none", children: [
|
|
3449
3464
|
/* @__PURE__ */ jsx21(chakra7.span, { css: [styles.placeMark, ghostCss], children: "\xA0" }),
|
|
3450
3465
|
/* @__PURE__ */ jsxs12(chakra7.span, { css: styles.placeText, children: [
|
|
3451
3466
|
/* @__PURE__ */ jsx21(chakra7.span, { css: styles.placeName, children: /* @__PURE__ */ jsx21(TextBone, { width: 14 }) }),
|
|
@@ -3453,9 +3468,15 @@ function SidebarContents({
|
|
|
3453
3468
|
] })
|
|
3454
3469
|
] }) }),
|
|
3455
3470
|
sidebar.top != null && // Folded away in the rail (and out of reach of the keyboard there).
|
|
3456
|
-
/* @__PURE__ */ jsx21(chakra7.div, { css: styles.fold, inert: collapsed || void 0, children: /* @__PURE__ */ jsx21(chakra7.div, { css: styles.foldInner, children: /* @__PURE__ */ jsx21(chakra7.div, { css: styles.sidebarTop, children: sidebar.top }) }) })
|
|
3471
|
+
/* @__PURE__ */ jsx21(chakra7.div, { css: styles.fold, inert: collapsed || void 0, children: /* @__PURE__ */ jsx21(chakra7.div, { css: styles.foldInner, children: /* @__PURE__ */ jsx21(chakra7.div, { css: styles.sidebarTop, children: sidebar.top }) }) })
|
|
3472
|
+
] });
|
|
3473
|
+
return /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
3474
|
+
placeAfter === void 0 && placeBlock,
|
|
3457
3475
|
/* @__PURE__ */ jsxs12(chakra7.nav, { css: [styles.nav, arrive], "aria-label": place?.name ?? labels.navigation, children: [
|
|
3458
|
-
sidebar.sections.filter((section) => section.items.length > 0).map((section) => /* @__PURE__ */
|
|
3476
|
+
sidebar.sections.filter((section) => section.items.length > 0).map((section) => /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
3477
|
+
/* @__PURE__ */ jsx21(NavSection, { section, styles, collapsed, group: sidebar.id }),
|
|
3478
|
+
section.id === placeAfter && placeBlock
|
|
3479
|
+
] }, section.id)),
|
|
3459
3480
|
loading && // The place's pages, coming: rows of the nav's own items, the same in the rail and out of it (ADR 0061).
|
|
3460
3481
|
/* @__PURE__ */ jsx21(Loading, { when: true, children: /* @__PURE__ */ jsx21(chakra7.div, { css: styles.navSection, "aria-hidden": "true", children: /* @__PURE__ */ jsx21(chakra7.div, { css: styles.navSectionItems, children: Array.from({ length: sidebar.skeletonItems ?? 5 }, (_, n) => /* @__PURE__ */ jsxs12(chakra7.span, { css: styles.navItem, pointerEvents: "none", children: [
|
|
3461
3482
|
/* @__PURE__ */ jsx21(chakra7.span, { css: styles.navItemIcon, children: /* @__PURE__ */ jsx21(Bone, { width: "4", height: "4" }) }),
|
|
@@ -3488,7 +3509,7 @@ function NavItem({ item, styles, collapsed, group, nested }) {
|
|
|
3488
3509
|
] }) });
|
|
3489
3510
|
const own = /* @__PURE__ */ jsx21(Tooltip, { content: item.label, inactive: !collapsed, positioning: { placement: isRtl ? "left" : "right" }, children: link });
|
|
3490
3511
|
if (!item.children?.length) return own;
|
|
3491
|
-
return /* @__PURE__ */ jsxs12(
|
|
3512
|
+
return /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
3492
3513
|
own,
|
|
3493
3514
|
/* @__PURE__ */ jsx21(chakra7.div, { css: styles.fold, inert: collapsed || void 0, children: /* @__PURE__ */ jsx21(chakra7.div, { css: styles.foldInner, children: /* @__PURE__ */ jsx21(chakra7.div, { css: styles.navChildren, role: "group", "aria-label": item.label, children: item.children.map((child) => /* @__PURE__ */ jsx21(NavItem, { item: child, styles, collapsed, group, nested: true }, child.id)) }) }) })
|
|
3494
3515
|
] });
|
|
@@ -3561,13 +3582,13 @@ function Pagination({ page, pages, onPage, label, previous, next, pageLabel, dis
|
|
|
3561
3582
|
}
|
|
3562
3583
|
|
|
3563
3584
|
// src/components/CommandPalette.tsx
|
|
3564
|
-
import { Fragment as
|
|
3585
|
+
import { Fragment as Fragment5, useEffect as useEffect7, useId, useMemo as useMemo5, useRef as useRef9, useState as useState9 } from "react";
|
|
3565
3586
|
import { chakra as chakra9, Dialog as Dialog3, HStack as HStack3, Portal as Portal7, Spinner as Spinner2, Stack as Stack3, Text as Text2 } from "@chakra-ui/react";
|
|
3566
3587
|
import { CornerDownLeft, Search } from "lucide-react";
|
|
3567
|
-
import { Fragment as
|
|
3588
|
+
import { Fragment as Fragment6, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3568
3589
|
function HighlightText({ text, query }) {
|
|
3569
3590
|
const q = query.trim().toLowerCase();
|
|
3570
|
-
if (!q) return /* @__PURE__ */ jsx23(
|
|
3591
|
+
if (!q) return /* @__PURE__ */ jsx23(Fragment6, { children: text });
|
|
3571
3592
|
const lower = text.toLowerCase();
|
|
3572
3593
|
const parts = [];
|
|
3573
3594
|
let at = 0;
|
|
@@ -3576,9 +3597,9 @@ function HighlightText({ text, query }) {
|
|
|
3576
3597
|
parts.push(/* @__PURE__ */ jsx23(chakra9.strong, { fontWeight: "bold", children: text.slice(i, i + q.length) }, i));
|
|
3577
3598
|
at = i + q.length;
|
|
3578
3599
|
}
|
|
3579
|
-
if (parts.length === 0) return /* @__PURE__ */ jsx23(
|
|
3600
|
+
if (parts.length === 0) return /* @__PURE__ */ jsx23(Fragment6, { children: text });
|
|
3580
3601
|
parts.push(text.slice(at));
|
|
3581
|
-
return /* @__PURE__ */ jsx23(
|
|
3602
|
+
return /* @__PURE__ */ jsx23(Fragment6, { children: parts.map((p, i) => /* @__PURE__ */ jsx23(Fragment5, { children: p }, i)) });
|
|
3582
3603
|
}
|
|
3583
3604
|
function CommandPalette({ open, onOpenChange, search, labels }) {
|
|
3584
3605
|
const listId = useId();
|
|
@@ -3707,7 +3728,7 @@ function CommandPalette({ open, onOpenChange, search, labels }) {
|
|
|
3707
3728
|
// src/components/AvatarStack.tsx
|
|
3708
3729
|
import { Avatar, Box, HStack as HStack4, Popover, Portal as Portal8, Stack as Stack4, Text as Text3 } from "@chakra-ui/react";
|
|
3709
3730
|
import { Check } from "lucide-react";
|
|
3710
|
-
import { Fragment as
|
|
3731
|
+
import { Fragment as Fragment7, jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3711
3732
|
var PALETTES = ["blue", "teal", "purple", "orange", "pink", "cyan", "green", "red"];
|
|
3712
3733
|
function avatarPalette(id) {
|
|
3713
3734
|
let hash = 0;
|
|
@@ -3746,7 +3767,7 @@ function AvatarStack({ "aria-label": ariaLabel, people, max = 3, moreLabel, more
|
|
|
3746
3767
|
const picked = (p) => selected.includes(p.id);
|
|
3747
3768
|
const restPicked = rest.some(picked);
|
|
3748
3769
|
return /* @__PURE__ */ jsxs15(HStack4, { gap: "1", role: "group", "aria-label": ariaLabel, children: [
|
|
3749
|
-
shown.map((p) => /* @__PURE__ */ jsx24(Tooltip, { content: p.detail ? /* @__PURE__ */ jsxs15(
|
|
3770
|
+
shown.map((p) => /* @__PURE__ */ jsx24(Tooltip, { content: p.detail ? /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
3750
3771
|
p.name,
|
|
3751
3772
|
" \xB7 ",
|
|
3752
3773
|
p.detail
|
|
@@ -3803,7 +3824,7 @@ function AvatarStack({ "aria-label": ariaLabel, people, max = 3, moreLabel, more
|
|
|
3803
3824
|
/* @__PURE__ */ jsx24(Portal8, { children: /* @__PURE__ */ jsx24(Popover.Positioner, { children: /* @__PURE__ */ jsx24(Popover.Content, { w: "64", maxW: "calc(100vw - 32px)", children: /* @__PURE__ */ jsx24(Popover.Body, { children: /* @__PURE__ */ jsxs15(Stack4, { gap: "3", children: [
|
|
3804
3825
|
/* @__PURE__ */ jsx24(Popover.Title, { textStyle: "label", children: moreTitle }),
|
|
3805
3826
|
/* @__PURE__ */ jsx24(Stack4, { as: "ul", gap: onToggle ? "0.5" : "2", maxH: "64", overflowY: "auto", listStyleType: "none", mx: onToggle ? "-2" : void 0, children: rest.map((p) => {
|
|
3806
|
-
const row = /* @__PURE__ */ jsxs15(
|
|
3827
|
+
const row = /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
3807
3828
|
/* @__PURE__ */ jsx24(PersonAvatar, { person: p, selected: onToggle && picked(p), inButton: !!onToggle }),
|
|
3808
3829
|
/* @__PURE__ */ jsxs15(Stack4, { gap: "0", minW: "0", flex: "1", textAlign: "start", children: [
|
|
3809
3830
|
/* @__PURE__ */ jsx24(Text3, { textStyle: "body", truncate: true, children: p.name }),
|
|
@@ -3836,7 +3857,7 @@ function AvatarStack({ "aria-label": ariaLabel, people, max = 3, moreLabel, more
|
|
|
3836
3857
|
}
|
|
3837
3858
|
|
|
3838
3859
|
// src/components/DataTable.tsx
|
|
3839
|
-
import { Fragment as
|
|
3860
|
+
import { Fragment as Fragment8, useMemo as useMemo6, useRef as useRef10, useState as useState10 } from "react";
|
|
3840
3861
|
import { chakra as chakra13, Menu, Portal as Portal9, Table, useSlotRecipe as useSlotRecipe3 } from "@chakra-ui/react";
|
|
3841
3862
|
import { ArrowDown, ArrowUp, ChevronDown as ChevronDown2, ChevronRight as ChevronRight2, ChevronsUpDown, GripVertical } from "lucide-react";
|
|
3842
3863
|
|
|
@@ -4246,7 +4267,7 @@ function DataTable({
|
|
|
4246
4267
|
const sub = renderSubRow?.(row);
|
|
4247
4268
|
const own2 = renderRow?.(row, index);
|
|
4248
4269
|
const selected = selection ? selection.selectedId === id : void 0;
|
|
4249
|
-
return /* @__PURE__ */ jsxs18(
|
|
4270
|
+
return /* @__PURE__ */ jsxs18(Fragment8, { children: [
|
|
4250
4271
|
/* @__PURE__ */ jsx28(
|
|
4251
4272
|
Table.Row,
|
|
4252
4273
|
{
|
|
@@ -4356,12 +4377,12 @@ function DataTable({
|
|
|
4356
4377
|
),
|
|
4357
4378
|
parents.header(parent, groups.filter((x) => parents.of(x.key) === parent))
|
|
4358
4379
|
] }) }) }) : null;
|
|
4359
|
-
if (parentFolded) return /* @__PURE__ */ jsx28(
|
|
4380
|
+
if (parentFolded) return /* @__PURE__ */ jsx28(Fragment8, { children: parentRow }, `group-${g.key}`);
|
|
4360
4381
|
const folded = grouping.folded.has(g.key);
|
|
4361
4382
|
const footer = folded ? null : grouping.footer?.(g.key, g.rows);
|
|
4362
4383
|
const start = at;
|
|
4363
4384
|
if (!folded) at += g.rows.length;
|
|
4364
|
-
return /* @__PURE__ */ jsxs18(
|
|
4385
|
+
return /* @__PURE__ */ jsxs18(Fragment8, { children: [
|
|
4365
4386
|
parentRow,
|
|
4366
4387
|
/* @__PURE__ */ jsx28(
|
|
4367
4388
|
Table.Row,
|
|
@@ -4841,7 +4862,7 @@ function Chart({ kind, stacked, data, x, series, "aria-label": ariaLabel, height
|
|
|
4841
4862
|
import { useRef as useRef12, useState as useState12 } from "react";
|
|
4842
4863
|
import { Box as Box4, chakra as chakra15 } from "@chakra-ui/react";
|
|
4843
4864
|
import { GripVertical as GripVertical2, MoveDiagonal2 } from "lucide-react";
|
|
4844
|
-
import { Fragment as
|
|
4865
|
+
import { Fragment as Fragment9, jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4845
4866
|
var GAP = 16;
|
|
4846
4867
|
var PLACEHOLDER_TILES = [
|
|
4847
4868
|
{ id: "skeleton-1", x: 0, y: 0, w: 6, h: 3 },
|
|
@@ -5009,7 +5030,7 @@ function DashboardGrid({
|
|
|
5009
5030
|
transition: moving ? void 0 : "all 120ms ease",
|
|
5010
5031
|
children: [
|
|
5011
5032
|
renderItem(shown),
|
|
5012
|
-
editing && /* @__PURE__ */ jsxs21(
|
|
5033
|
+
editing && /* @__PURE__ */ jsxs21(Fragment9, { children: [
|
|
5013
5034
|
/* @__PURE__ */ jsx31(
|
|
5014
5035
|
chakra15.button,
|
|
5015
5036
|
{
|
|
@@ -5621,7 +5642,7 @@ function between(cell, from, to) {
|
|
|
5621
5642
|
}
|
|
5622
5643
|
|
|
5623
5644
|
// src/components/KanbanBoard.tsx
|
|
5624
|
-
import { Fragment as
|
|
5645
|
+
import { Fragment as Fragment10, jsx as jsx42, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5625
5646
|
var SKELETON_CARDS = [3, 2, 4, 1, 2];
|
|
5626
5647
|
function PlaceholderCard({ index }) {
|
|
5627
5648
|
return /* @__PURE__ */ jsxs27(Box6, { bg: "bg.panel", borderWidth: "1px", borderColor: "border", rounded: "l2", p: "2.5", children: [
|
|
@@ -5967,7 +5988,7 @@ function KanbanBoard({
|
|
|
5967
5988
|
);
|
|
5968
5989
|
}
|
|
5969
5990
|
function LaneRow({ lane, showTitle, span, children }) {
|
|
5970
|
-
return /* @__PURE__ */ jsxs27(
|
|
5991
|
+
return /* @__PURE__ */ jsxs27(Fragment10, { children: [
|
|
5971
5992
|
showTitle && /* @__PURE__ */ jsxs27(HStack7, { gridColumn: `1 / span ${span}`, gap: "2", pt: "2", borderTopWidth: "1px", borderColor: "border.muted", "data-lane": lane.id, children: [
|
|
5972
5993
|
/* @__PURE__ */ jsx42(Text8, { textStyle: "label", children: lane.title }),
|
|
5973
5994
|
lane.meta && /* @__PURE__ */ jsx42(Text8, { textStyle: "caption", color: "fg.muted", children: lane.meta })
|
|
@@ -6231,7 +6252,7 @@ function LoadingState({ lines = 3, label }) {
|
|
|
6231
6252
|
}
|
|
6232
6253
|
|
|
6233
6254
|
// src/components/PageHeader.tsx
|
|
6234
|
-
import { Fragment as
|
|
6255
|
+
import { Fragment as Fragment11 } from "react";
|
|
6235
6256
|
import { Breadcrumb, chakra as chakra23, Menu as Menu2, Portal as Portal11, useSlotRecipe as useSlotRecipe4 } from "@chakra-ui/react";
|
|
6236
6257
|
import { ChevronRight as ChevronRight3 } from "lucide-react";
|
|
6237
6258
|
import { jsx as jsx44, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
@@ -6265,7 +6286,7 @@ function Breadcrumbs({ items, loading: own }) {
|
|
|
6265
6286
|
const label = (item, i) => loading && item.label == null ? /* @__PURE__ */ jsx44(TextBone, { width: 8 + i % 3 * 3 }) : item.label;
|
|
6266
6287
|
const Link = useLinkComponent();
|
|
6267
6288
|
const { shown, hidden } = foldBreadcrumbs(items);
|
|
6268
|
-
return /* @__PURE__ */ jsx44(Breadcrumb.Root, { "aria-label": labels.breadcrumb, children: /* @__PURE__ */ jsx44(Breadcrumb.List, { children: shown.map((entry, n) => /* @__PURE__ */ jsxs29(
|
|
6289
|
+
return /* @__PURE__ */ jsx44(Breadcrumb.Root, { "aria-label": labels.breadcrumb, children: /* @__PURE__ */ jsx44(Breadcrumb.List, { children: shown.map((entry, n) => /* @__PURE__ */ jsxs29(Fragment11, { children: [
|
|
6269
6290
|
n > 0 && /* @__PURE__ */ jsx44(Breadcrumb.Separator, { children: /* @__PURE__ */ jsx44(ChevronRight3, {}) }),
|
|
6270
6291
|
entry == null ? /* @__PURE__ */ jsx44(Breadcrumb.Item, { children: /* @__PURE__ */ jsxs29(Menu2.Root, { positioning: { placement: "bottom-start" }, children: [
|
|
6271
6292
|
/* @__PURE__ */ jsx44(Menu2.Trigger, { asChild: true, children: /* @__PURE__ */ jsx44(
|
|
@@ -6458,7 +6479,7 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
6458
6479
|
import { useEffect as useEffect10, useId as useId2, useRef as useRef16, useState as useState16 } from "react";
|
|
6459
6480
|
import { CloseButton as CloseButton3, Dialog as Dialog5, HStack as HStack9, Input as Input3, Portal as Portal13, Stack as Stack9, Text as Text10 } from "@chakra-ui/react";
|
|
6460
6481
|
import { Plus, Trash2 } from "lucide-react";
|
|
6461
|
-
import { Fragment as
|
|
6482
|
+
import { Fragment as Fragment12, jsx as jsx49, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
6462
6483
|
function fill2(template, values) {
|
|
6463
6484
|
return template.replace(/\{(\w+)\}/g, (_, k) => String(values[k] ?? `{${k}}`));
|
|
6464
6485
|
}
|
|
@@ -6524,7 +6545,7 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
6524
6545
|
/* @__PURE__ */ jsx49(Dialog5.Body, { children: /* @__PURE__ */ jsxs34(Stack9, { gap: "3", children: [
|
|
6525
6546
|
/* @__PURE__ */ jsxs34(Text10, { textStyle: "sm", color: "fg.muted", children: [
|
|
6526
6547
|
labels.matchAll,
|
|
6527
|
-
repeats && /* @__PURE__ */ jsxs34(
|
|
6548
|
+
repeats && /* @__PURE__ */ jsxs34(Fragment12, { children: [
|
|
6528
6549
|
" ",
|
|
6529
6550
|
labels.sameFieldAny
|
|
6530
6551
|
] })
|
|
@@ -6555,7 +6576,7 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
6555
6576
|
/* @__PURE__ */ jsx49(Dialog5.Footer, { children: /* @__PURE__ */ jsxs34(HStack9, { justify: "space-between", w: "full", wrap: "wrap", gap: "2", children: [
|
|
6556
6577
|
/* @__PURE__ */ jsxs34(Text10, { textStyle: "sm", color: "fg.muted", "aria-live": "polite", "data-filter-count": "", children: [
|
|
6557
6578
|
count != null && fill2(total != null ? labels.matchCount : labels.matchCountOnly, { count, total: total ?? "" }),
|
|
6558
|
-
incomplete > 0 && /* @__PURE__ */ jsxs34(
|
|
6579
|
+
incomplete > 0 && /* @__PURE__ */ jsxs34(Fragment12, { children: [
|
|
6559
6580
|
" \xB7 ",
|
|
6560
6581
|
labels.incompleteSkipped
|
|
6561
6582
|
] })
|
|
@@ -6625,7 +6646,7 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
6625
6646
|
}
|
|
6626
6647
|
),
|
|
6627
6648
|
own,
|
|
6628
|
-
!NO_VALUE_OPS.has(op) && own == null && /* @__PURE__ */ jsxs34(
|
|
6649
|
+
!NO_VALUE_OPS.has(op) && own == null && /* @__PURE__ */ jsxs34(Fragment12, { children: [
|
|
6629
6650
|
/* @__PURE__ */ jsx49(
|
|
6630
6651
|
Input3,
|
|
6631
6652
|
{
|
|
@@ -6649,7 +6670,7 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
6649
6670
|
}
|
|
6650
6671
|
|
|
6651
6672
|
// src/components/QueryableList.tsx
|
|
6652
|
-
import { Fragment as
|
|
6673
|
+
import { Fragment as Fragment13, jsx as jsx50, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
6653
6674
|
var PAIR = "";
|
|
6654
6675
|
var pairKey = (first, second) => `${first}${PAIR}${second}`;
|
|
6655
6676
|
var condition = (field, value) => value == null ? { field, op: "isEmpty" } : { field, op: "eq", value };
|
|
@@ -6852,7 +6873,7 @@ function QueryableList({
|
|
|
6852
6873
|
]
|
|
6853
6874
|
}
|
|
6854
6875
|
),
|
|
6855
|
-
groupField && groupable.length > 1 && /* @__PURE__ */ jsxs35(
|
|
6876
|
+
groupField && groupable.length > 1 && /* @__PURE__ */ jsxs35(Fragment13, { children: [
|
|
6856
6877
|
/* @__PURE__ */ jsx50(Menu3.Separator, {}),
|
|
6857
6878
|
/* @__PURE__ */ jsxs35(
|
|
6858
6879
|
Menu3.RadioItemGroup,
|
|
@@ -6999,7 +7020,7 @@ function QueryableList({
|
|
|
6999
7020
|
footer: (
|
|
7000
7021
|
// Expand and collapse at the start, the pages in the middle (the canvas's v12, UI round 9 step 67), the range at the end.
|
|
7001
7022
|
/* @__PURE__ */ jsxs35(chakra28.div, { display: "grid", w: "full", gridTemplateColumns: { base: "1fr", md: "1fr auto 1fr" }, alignItems: "center", gap: "3", children: [
|
|
7002
|
-
/* @__PURE__ */ jsx50(HStack10, { gap: "3", children: grouped && /* @__PURE__ */ jsxs35(
|
|
7023
|
+
/* @__PURE__ */ jsx50(HStack10, { gap: "3", children: grouped && /* @__PURE__ */ jsxs35(Fragment13, { children: [
|
|
7003
7024
|
/* @__PURE__ */ jsx50(Button, { size: "xs", variant: "ghost", color: "fg.accent", disabled: folded.size === 0, onClick: () => setFolded(/* @__PURE__ */ new Set()), children: labels.expandAll }),
|
|
7004
7025
|
/* @__PURE__ */ jsx50(Button, { size: "xs", variant: "ghost", color: "fg.accent", disabled: groupKeys.every((k) => folded.has(k)), onClick: () => setFolded(new Set(groupKeys)), children: labels.collapseAll })
|
|
7005
7026
|
] }) }),
|
|
@@ -7917,7 +7938,7 @@ function SortableItem({ id, children }) {
|
|
|
7917
7938
|
}
|
|
7918
7939
|
|
|
7919
7940
|
// src/components/TimelineChart.tsx
|
|
7920
|
-
import { Fragment as
|
|
7941
|
+
import { Fragment as Fragment14, useEffect as useEffect13, useLayoutEffect as useLayoutEffect6, useRef as useRef21, useState as useState20 } from "react";
|
|
7921
7942
|
import { Box as Box12, HStack as HStack13, Popover as Popover3, Portal as Portal16, Stack as Stack13, Text as Text15 } from "@chakra-ui/react";
|
|
7922
7943
|
import { Flag, Trash2 as Trash23 } from "lucide-react";
|
|
7923
7944
|
import { jsx as jsx54, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
@@ -8518,7 +8539,7 @@ function TimelineChart({
|
|
|
8518
8539
|
const thin = tone === "rollup" && !single;
|
|
8519
8540
|
const diamond = single ? { w: `${DIAMOND}px`, h: `${DIAMOND}px`, top: `${i * rowHeight + rowHeight / 2 - DIAMOND / 2}px`, transform: "rotate(45deg)", rounded: "l1" } : null;
|
|
8520
8541
|
const canLink = !!onLink && item.linkable !== false && !drag;
|
|
8521
|
-
return /* @__PURE__ */ jsxs39(
|
|
8542
|
+
return /* @__PURE__ */ jsxs39(Fragment14, { children: [
|
|
8522
8543
|
/* @__PURE__ */ jsxs39(
|
|
8523
8544
|
Box12,
|
|
8524
8545
|
{
|