@nivaro/react 0.3.110 → 0.3.112
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +170 -2
- package/dist/index.js +745 -728
- package/dist/shared/components/CollectionBrowserView.js +3097 -2972
- package/dist/shared/components/CollectionImportBanner.js +135 -0
- package/dist/shared/components/ItemEditForm.js +2235 -2218
- package/dist/shared/components/JobsTray.js +54 -47
- package/dist/shared/components/TipLayer.js +61 -54
- package/dist/shared/components/ViewAsPersonButton.js +109 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +228 -150
- package/dist/shared/components/bulk/BulkFieldUpdateButton.js +35 -41
- package/dist/shared/components/bulk/BulkLinksValue.js +91 -0
- package/dist/shared/components/bulk/bulk-field-options.js +20 -19
- package/dist/shared/components/bulk/bulk-update-preview.js +39 -0
- package/dist/shared/components/cbv/ColumnHeaderMenu.js +113 -0
- package/dist/shared/components/cbv/column-totals.js +66 -0
- package/dist/shared/components/collections-directory/CollectionHoverCard.js +108 -81
- package/dist/shared/components/collections-directory/CollectionRow.js +164 -148
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +167 -166
- package/dist/shared/components/collections-directory/directory-data.js +70 -58
- package/dist/shared/components/imports/CollectionImportPanel.js +120 -118
- package/dist/shared/components/imports/DefinitionsPanel.js +24 -24
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +65 -0
- package/dist/shared/components/item-edit/CatalogPickerField.js +631 -639
- package/dist/shared/components/item-edit/DuplicateNotice.js +168 -0
- package/dist/shared/components/item-edit/FieldRow.js +248 -246
- package/dist/shared/components/item-edit/InlineGridField.js +34 -33
- package/dist/shared/components/item-edit/InlineTableField.js +3064 -2882
- package/dist/shared/components/item-edit/MembershipSetField.js +165 -169
- package/dist/shared/components/item-edit/NestedRelationEditor.js +184 -189
- package/dist/shared/components/item-edit/PlanGrid.js +2 -1
- package/dist/shared/components/item-edit/QuickPickerDialog.js +35 -34
- package/dist/shared/components/item-edit/RecordLiveSync.js +32 -30
- package/dist/shared/components/item-edit/RelationCombobox.js +101 -100
- package/dist/shared/components/item-edit/RowHistorySheet.js +28 -27
- package/dist/shared/components/item-edit/SummaryPanel.js +133 -135
- package/dist/shared/components/item-edit/ViewAsRole.js +129 -52
- package/dist/shared/components/item-edit/grid-search.js +345 -0
- package/dist/shared/components/item-edit/render-stability.js +61 -54
- package/dist/shared/components/notifications/NotificationRulesEditor.js +25 -20
- package/dist/shared/components/ops-report/DigestSections.js +163 -144
- package/dist/shared/components/ops-report/drill.js +97 -97
- package/dist/shared/components/panels/AddendumLinesDiff.js +52 -51
- package/dist/shared/components/panels/AddendumPanel.js +92 -91
- package/dist/shared/components/panels/AsyncUserPicker.js +108 -0
- package/dist/shared/components/panels/BlockedMove.js +73 -0
- package/dist/shared/components/panels/CommentPanel.js +265 -252
- package/dist/shared/components/panels/OwnersSlot.js +47 -35
- package/dist/shared/components/panels/PipelineInsight.js +186 -0
- package/dist/shared/components/panels/PipelinePanel.js +1573 -1475
- package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
- package/dist/shared/components/panels/RevisionsPanel.js +261 -260
- package/dist/shared/components/pipeline/FieldPicker.js +41 -40
- package/dist/shared/components/pipeline/OwnerMatrix.js +829 -700
- package/dist/shared/components/pipeline/OwnerRecordTrial.js +362 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -467
- package/dist/shared/components/pipeline/PipelineStateOwners.js +65 -64
- package/dist/shared/components/pipeline/owner-matrix-draft.js +178 -0
- package/dist/shared/components/profile/MyDefaultsCard.js +36 -35
- package/dist/shared/components/profile/PersonHeader.js +29 -29
- package/dist/shared/components/profile/PersonProfile.js +30 -28
- package/dist/shared/components/profile/SlowScreensCard.js +286 -0
- package/dist/shared/components/queue/QueueWorklist.js +1090 -1071
- package/dist/shared/components/quick-filters/useQuickFilterEditing.js +45 -44
- package/dist/shared/components/support/TicketDetailSheet.js +25 -16
- package/dist/shared/components/support/TicketSlowScreens.js +32 -0
- package/dist/shared/lib/activity-sentence.js +224 -178
- package/dist/shared/lib/collection-import-banner.js +27 -0
- package/dist/shared/lib/crash-report.js +112 -0
- package/dist/shared/lib/export-runs.js +99 -0
- package/dist/shared/lib/jobs-tray.js +89 -67
- package/dist/shared/lib/list-link.js +76 -69
- package/dist/shared/lib/nav-trail.js +180 -76
- package/dist/shared/lib/query-keys.js +26 -0
- package/dist/shared/lib/view-as.js +16 -11
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { jsxs as a, jsx as n, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
-
import { useSensors as
|
|
3
|
-
import { sortableKeyboardCoordinates as
|
|
4
|
-
import { useQueryClient as
|
|
5
|
-
import { Star as
|
|
6
|
-
import { useRef as Y, useState as v, useEffect as
|
|
7
|
-
import { toast as
|
|
2
|
+
import { useSensors as nt, useSensor as we, PointerSensor as ot, KeyboardSensor as rt, DndContext as xe, closestCenter as Ce } from "@dnd-kit/core";
|
|
3
|
+
import { sortableKeyboardCoordinates as lt, SortableContext as Ne, verticalListSortingStrategy as Se, arrayMove as it } from "@dnd-kit/sortable";
|
|
4
|
+
import { useQueryClient as at } from "@tanstack/react-query";
|
|
5
|
+
import { Star as ct, Clock as st, Link2 as dt, Database as ht, SearchX as pt } from "lucide-react";
|
|
6
|
+
import { useRef as Y, useState as v, useEffect as _e, useMemo as re } from "react";
|
|
7
|
+
import { toast as le } from "sonner";
|
|
8
8
|
import { ErrorNotice as mt } from "../ErrorNotice.js";
|
|
9
|
-
import { Skeleton as
|
|
10
|
-
import { defaultCollectionPath as
|
|
11
|
-
import { CollectionsToolbar as
|
|
12
|
-
import { readLocal as
|
|
13
|
-
import { PINNED_KEY as q, PinnedSection as
|
|
14
|
-
import { buildPageModel as
|
|
15
|
-
import { SortableRow as Ee, Section as
|
|
16
|
-
import { useSharedPins as
|
|
17
|
-
const
|
|
9
|
+
import { Skeleton as ie } from "../ui/skeleton.js";
|
|
10
|
+
import { defaultCollectionPath as ft, HostLink as Pe, CollectionRow as ut, CollectionAvatar as gt } from "./CollectionRow.js";
|
|
11
|
+
import { CollectionsToolbar as bt } from "./CollectionsToolbar.js";
|
|
12
|
+
import { readLocal as Le, useDirectoryCollections as vt, useOverviewStats as yt, useHeavyListFlags as kt, useCollectionUsage as wt, useNavFavoriteCollections as xt, writeLocal as Me, recordCollectionOpen as Oe, DIRECTORY_KEYS as ae } from "./directory-data.js";
|
|
13
|
+
import { PINNED_KEY as q, PinnedSection as Ct } from "./PinnedSection.js";
|
|
14
|
+
import { buildPageModel as Nt, nearSpellings as St, label as y } from "./page-model.js";
|
|
15
|
+
import { SortableRow as Ee, Section as L, FolderHeader as O } from "./sections.js";
|
|
16
|
+
import { useSharedPins as _t } from "./shared-pins.js";
|
|
17
|
+
const Te = "nivaro_col_collapsed", De = "nvr_collections_prefs", M = "__loose__", N = "__links__", Lt = {
|
|
18
18
|
view: "folders",
|
|
19
19
|
density: "compact",
|
|
20
20
|
showHidden: !1,
|
|
21
21
|
showLinks: !1
|
|
22
|
-
}, w = (
|
|
23
|
-
function
|
|
22
|
+
}, w = (c) => `cl-section-${c.replace(/[^A-Za-z0-9_-]/g, "_")}`;
|
|
23
|
+
function Mt() {
|
|
24
24
|
return /* @__PURE__ */ n(
|
|
25
25
|
"div",
|
|
26
26
|
{
|
|
@@ -28,35 +28,35 @@ function _t() {
|
|
|
28
28
|
role: "status",
|
|
29
29
|
"aria-busy": "true",
|
|
30
30
|
"aria-label": "Loading collections",
|
|
31
|
-
children: ["a", "b", "c", "d", "e", "f", "g", "h"].map((
|
|
31
|
+
children: ["a", "b", "c", "d", "e", "f", "g", "h"].map((c) => /* @__PURE__ */ a(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
34
|
className: "flex items-center gap-2.5 border-b border-slate-100 px-4 py-2 last:border-0 dark:border-white/[0.05]",
|
|
35
35
|
children: [
|
|
36
|
-
/* @__PURE__ */ n(
|
|
37
|
-
/* @__PURE__ */ n(
|
|
38
|
-
/* @__PURE__ */ n(
|
|
36
|
+
/* @__PURE__ */ n(ie, { className: "h-6 w-6 rounded" }),
|
|
37
|
+
/* @__PURE__ */ n(ie, { className: "h-3.5 w-48" }),
|
|
38
|
+
/* @__PURE__ */ n(ie, { className: "ml-auto h-3 w-16" })
|
|
39
39
|
]
|
|
40
40
|
},
|
|
41
|
-
|
|
41
|
+
c
|
|
42
42
|
))
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Et() {
|
|
47
47
|
return /* @__PURE__ */ a("div", { className: "flex flex-col items-center py-24 text-center", children: [
|
|
48
|
-
/* @__PURE__ */ n("div", { className: "mb-4 flex h-12 w-12 items-center justify-center rounded-xl border border-slate-200 bg-slate-50 dark:border-white/[0.08] dark:bg-white/[0.03]", children: /* @__PURE__ */ n(
|
|
48
|
+
/* @__PURE__ */ n("div", { className: "mb-4 flex h-12 w-12 items-center justify-center rounded-xl border border-slate-200 bg-slate-50 dark:border-white/[0.08] dark:bg-white/[0.03]", children: /* @__PURE__ */ n(ht, { className: "h-5 w-5 text-slate-400" }) }),
|
|
49
49
|
/* @__PURE__ */ n("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-300", children: "No collections registered yet" }),
|
|
50
50
|
/* @__PURE__ */ n("p", { className: "mt-1.5 text-[12px] text-slate-500 dark:text-slate-400", children: "Register collections in the Data Model to browse them here." })
|
|
51
51
|
] });
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
filter:
|
|
53
|
+
function Tt({
|
|
54
|
+
filter: c,
|
|
55
55
|
near: x,
|
|
56
|
-
pathFor:
|
|
56
|
+
pathFor: p,
|
|
57
57
|
hiddenMatches: u,
|
|
58
58
|
linkMatches: g,
|
|
59
|
-
chipsOn:
|
|
59
|
+
chipsOn: E,
|
|
60
60
|
onShowHidden: h,
|
|
61
61
|
onShowLinks: U,
|
|
62
62
|
onClearChips: F,
|
|
@@ -64,12 +64,12 @@ function Et({
|
|
|
64
64
|
}) {
|
|
65
65
|
const t = "rounded-md border border-slate-200 px-2.5 py-1 text-[12px] font-medium text-slate-700 hover:border-slate-300 hover:bg-slate-50 dark:border-white/[0.1] dark:text-slate-200 dark:hover:bg-white/[0.05]";
|
|
66
66
|
return /* @__PURE__ */ a("div", { className: "flex flex-col items-center py-16 text-center", "data-collections-empty-search": !0, children: [
|
|
67
|
-
/* @__PURE__ */ n(
|
|
68
|
-
/* @__PURE__ */ n("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children:
|
|
67
|
+
/* @__PURE__ */ n(pt, { className: "mb-3 h-6 w-6 text-slate-400" }),
|
|
68
|
+
/* @__PURE__ */ n("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children: c ? /* @__PURE__ */ a(Q, { children: [
|
|
69
69
|
"No collection matches ",
|
|
70
70
|
/* @__PURE__ */ a("span", { className: "font-mono", children: [
|
|
71
71
|
"“",
|
|
72
|
-
|
|
72
|
+
c,
|
|
73
73
|
"”"
|
|
74
74
|
] })
|
|
75
75
|
] }) : "No collection matches these filters" }),
|
|
@@ -79,10 +79,10 @@ function Et({
|
|
|
79
79
|
x.map((C, S) => /* @__PURE__ */ a("span", { children: [
|
|
80
80
|
S > 0 && (S === x.length - 1 ? " or " : ", "),
|
|
81
81
|
/* @__PURE__ */ n(
|
|
82
|
-
|
|
82
|
+
Pe,
|
|
83
83
|
{
|
|
84
|
-
to:
|
|
85
|
-
onClick: () =>
|
|
84
|
+
to: p(C.collection),
|
|
85
|
+
onClick: () => Oe(C.collection),
|
|
86
86
|
className: "font-medium text-cyan-700 underline-offset-2 hover:underline dark:text-nvr-cyan",
|
|
87
87
|
children: y(C)
|
|
88
88
|
}
|
|
@@ -104,78 +104,78 @@ function Et({
|
|
|
104
104
|
g === 1 ? "table matches" : "tables match",
|
|
105
105
|
" — show link tables"
|
|
106
106
|
] }),
|
|
107
|
-
|
|
107
|
+
E && /* @__PURE__ */ n("button", { type: "button", className: t, onClick: F, children: "Clear filters" }),
|
|
108
108
|
T && /* @__PURE__ */ n("button", { type: "button", className: t, onClick: T, children: "Create a table" })
|
|
109
109
|
] })
|
|
110
110
|
] });
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
title:
|
|
112
|
+
function Re({
|
|
113
|
+
title: c,
|
|
114
114
|
icon: x,
|
|
115
|
-
cols:
|
|
115
|
+
cols: p,
|
|
116
116
|
empty: u,
|
|
117
117
|
pathFor: g,
|
|
118
|
-
...
|
|
118
|
+
...E
|
|
119
119
|
}) {
|
|
120
|
-
return !
|
|
120
|
+
return !p.length && !u ? null : /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", ...E, children: [
|
|
121
121
|
/* @__PURE__ */ a("span", { className: "mr-1 inline-flex items-center gap-1 text-[11px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
122
122
|
x,
|
|
123
|
-
|
|
123
|
+
c
|
|
124
124
|
] }),
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
p.map((h) => /* @__PURE__ */ a(
|
|
126
|
+
Pe,
|
|
127
127
|
{
|
|
128
128
|
to: g(h.collection),
|
|
129
|
-
onClick: () =>
|
|
129
|
+
onClick: () => Oe(h.collection),
|
|
130
130
|
className: "inline-flex max-w-[220px] items-center gap-1.5 rounded-md border border-slate-200 bg-white py-0.5 pl-1 pr-2 text-[12px] font-medium text-slate-700 transition-colors hover:border-nvr-cyan/50 hover:bg-nvr-cyan/[0.05] dark:border-white/[0.08] dark:bg-white/[0.03] dark:text-slate-200 dark:hover:bg-nvr-cyan/[0.08]",
|
|
131
131
|
children: [
|
|
132
|
-
/* @__PURE__ */ n(
|
|
132
|
+
/* @__PURE__ */ n(gt, { color: h.color, name: y(h), icon: h.icon }),
|
|
133
133
|
/* @__PURE__ */ n("span", { className: "truncate", children: y(h) })
|
|
134
134
|
]
|
|
135
135
|
},
|
|
136
136
|
h.collection
|
|
137
137
|
)),
|
|
138
|
-
!
|
|
138
|
+
!p.length && u
|
|
139
139
|
] });
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
isAdmin:
|
|
141
|
+
function Vt({
|
|
142
|
+
isAdmin: c,
|
|
143
143
|
title: x,
|
|
144
|
-
collectionPath:
|
|
144
|
+
collectionPath: p = ft,
|
|
145
145
|
include: u,
|
|
146
146
|
favorites: g,
|
|
147
|
-
admin:
|
|
147
|
+
admin: E
|
|
148
148
|
}) {
|
|
149
|
-
var
|
|
150
|
-
const h =
|
|
151
|
-
...
|
|
152
|
-
...
|
|
153
|
-
})), [H,
|
|
149
|
+
var ve, ye, ke;
|
|
150
|
+
const h = at(), U = Y(null), F = Y(null), T = Y(null), t = c ? E : void 0, C = !!(t != null && t.reorder), S = !!(t != null && t.moveCollections && t.renderMoveDialog), [m, Fe] = v(""), [K, Ke] = v(() => ({
|
|
151
|
+
...Lt,
|
|
152
|
+
...Le(De, {})
|
|
153
|
+
})), [H, ce] = v([]), [He, Ie] = v(!1), [ze, Ye] = v(!1), [j, I] = v(/* @__PURE__ */ new Set()), [qe, se] = v(!1), [$, Qe] = v(() => ({
|
|
154
154
|
[N]: !0,
|
|
155
155
|
__unregistered__: !0,
|
|
156
156
|
__system__: !0,
|
|
157
|
-
...
|
|
158
|
-
})),
|
|
157
|
+
...Le(Te, {})
|
|
158
|
+
})), s = {
|
|
159
159
|
...K,
|
|
160
160
|
// Admin-only views fall back to Folders for everyone else.
|
|
161
|
-
view: !
|
|
161
|
+
view: !c && (K.view === "records" || K.view === "recent") ? "folders" : K.view,
|
|
162
162
|
chips: H,
|
|
163
|
-
arranging: C &&
|
|
164
|
-
selecting: S &&
|
|
165
|
-
}, { data: D, isLoading:
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
const o =
|
|
163
|
+
arranging: C && He,
|
|
164
|
+
selecting: S && ze
|
|
165
|
+
}, { data: D, isLoading: Ue, isError: je, error: $e, refetch: Je } = vt(), de = Y(u);
|
|
166
|
+
de.current = u;
|
|
167
|
+
const he = (e) => {
|
|
168
|
+
const o = de.current;
|
|
169
169
|
return o ? e.filter(o) : e;
|
|
170
|
-
}, [
|
|
171
|
-
|
|
172
|
-
D &&
|
|
170
|
+
}, [J, V] = v([]);
|
|
171
|
+
_e(() => {
|
|
172
|
+
D && V(he(D));
|
|
173
173
|
}, [D]);
|
|
174
|
-
const { data: R } =
|
|
175
|
-
() =>
|
|
176
|
-
[
|
|
177
|
-
),
|
|
178
|
-
|
|
174
|
+
const { data: R } = yt(c), { data: A } = kt(c), B = wt(), Ve = xt(!g), { favorite: G, toggle: Ae } = g ?? Ve, b = _t(), X = re(() => new Set(b.pins), [b.pins]), l = re(
|
|
175
|
+
() => Nt(J, R, s, m, B),
|
|
176
|
+
[J, R, m, B, s.view, s.chips, s.showHidden, s.showLinks]
|
|
177
|
+
), Z = re(() => new Map(l.real.map((e) => [e.collection, e])), [l.real]);
|
|
178
|
+
_e(() => {
|
|
179
179
|
const e = F.current, o = T.current;
|
|
180
180
|
if (!e || !o) return;
|
|
181
181
|
const i = () => o.style.setProperty(
|
|
@@ -188,102 +188,103 @@ function $t({
|
|
|
188
188
|
window.removeEventListener("resize", i), r == null || r.disconnect();
|
|
189
189
|
};
|
|
190
190
|
}, []);
|
|
191
|
-
const
|
|
191
|
+
const W = (e) => {
|
|
192
192
|
const o = {
|
|
193
193
|
view: e.view,
|
|
194
194
|
density: e.density,
|
|
195
195
|
showHidden: e.showHidden,
|
|
196
196
|
showLinks: e.showLinks
|
|
197
197
|
};
|
|
198
|
-
|
|
199
|
-
}, _ = (e) =>
|
|
198
|
+
Ke(o), Me(De, o), ce(e.chips), Ie(e.arranging), Ye(e.selecting), e.selecting || I(/* @__PURE__ */ new Set());
|
|
199
|
+
}, _ = (e) => Qe((o) => {
|
|
200
200
|
const i = { ...o, [e]: !o[e] };
|
|
201
|
-
return Me(
|
|
202
|
-
}),
|
|
203
|
-
h.invalidateQueries({ queryKey:
|
|
204
|
-
},
|
|
201
|
+
return Me(Te, i), i;
|
|
202
|
+
}), ee = () => {
|
|
203
|
+
h.invalidateQueries({ queryKey: ae.collections }), h.invalidateQueries({ queryKey: ae.stats });
|
|
204
|
+
}, pe = t == null ? void 0 : t.moveCollections, me = pe ? async (e, o) => {
|
|
205
205
|
var i;
|
|
206
206
|
try {
|
|
207
|
-
await
|
|
207
|
+
await pe([e.collection], o);
|
|
208
208
|
const r = o ? ((i = l.folders.find((d) => d.key === o)) == null ? void 0 : i.label) ?? o : "no folder";
|
|
209
|
-
|
|
209
|
+
le.success(`Moved ${y(e)} to ${r}`), ee();
|
|
210
210
|
} catch {
|
|
211
|
-
|
|
211
|
+
le.error(`Could not move ${y(e)}`);
|
|
212
212
|
}
|
|
213
|
-
} : void 0,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
),
|
|
213
|
+
} : void 0, fe = nt(
|
|
214
|
+
we(ot, { activationConstraint: { distance: 8 } }),
|
|
215
|
+
we(rt, { coordinateGetter: lt })
|
|
216
|
+
), Be = (e) => {
|
|
217
217
|
const o = t == null ? void 0 : t.reorder;
|
|
218
218
|
if (!o) return;
|
|
219
219
|
const i = new Map(e.map((r) => [r.collection, r.sort]));
|
|
220
|
-
|
|
220
|
+
V(
|
|
221
221
|
(r) => r.map((d) => {
|
|
222
222
|
const f = i.get(d.collection);
|
|
223
223
|
return f === void 0 ? d : { ...d, sort: f };
|
|
224
224
|
})
|
|
225
225
|
), o(e).catch(() => {
|
|
226
|
-
|
|
226
|
+
le.error("Could not save the new order"), D && V(he(D)), h.invalidateQueries({ queryKey: ae.collections });
|
|
227
227
|
});
|
|
228
|
-
},
|
|
228
|
+
}, ue = (e, o) => {
|
|
229
229
|
const { active: i, over: r } = o;
|
|
230
230
|
if (!r || i.id === r.id) return;
|
|
231
231
|
const d = e.indexOf(String(i.id)), f = e.indexOf(String(r.id));
|
|
232
|
-
d === -1 || f === -1 ||
|
|
233
|
-
|
|
232
|
+
d === -1 || f === -1 || Be(
|
|
233
|
+
it(e, d, f).map((et, tt) => ({ collection: et, sort: (tt + 1) * 10 }))
|
|
234
234
|
);
|
|
235
|
-
},
|
|
235
|
+
}, te = (e, o, i) => {
|
|
236
236
|
var r;
|
|
237
237
|
return /* @__PURE__ */ n(
|
|
238
|
-
|
|
238
|
+
ut,
|
|
239
239
|
{
|
|
240
240
|
col: e,
|
|
241
241
|
stat: R == null ? void 0 : R[e.collection],
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
242
|
+
heavyList: c ? A == null ? void 0 : A[e.collection] : void 0,
|
|
243
|
+
density: s.density,
|
|
244
|
+
favorite: G.has(e.collection),
|
|
245
|
+
onToggleFavorite: () => void Ae(e.collection, y(e)),
|
|
246
|
+
pinnedForAll: X.has(e.collection),
|
|
247
|
+
onTogglePinned: c ? () => void (X.has(e.collection) ? b.unpin(e.collection, y(e)) : b.pin(e.collection, y(e))) : void 0,
|
|
247
248
|
onMoveUp: i == null ? void 0 : i.onMoveUp,
|
|
248
249
|
onMoveDown: i == null ? void 0 : i.onMoveDown,
|
|
249
250
|
quietPin: i == null ? void 0 : i.inPinned,
|
|
250
251
|
folders: l.folders,
|
|
251
252
|
onMove: me ? (d) => void me(e, d) : void 0,
|
|
252
|
-
recordsPath:
|
|
253
|
+
recordsPath: p(e.collection),
|
|
253
254
|
editPath: (r = t == null ? void 0 : t.editPath) == null ? void 0 : r.call(t, e.collection),
|
|
254
255
|
menuExtra: t != null && t.rowMenu ? { heading: t.rowMenu.heading, items: t.rowMenu.items(e.collection) } : void 0,
|
|
255
|
-
selecting:
|
|
256
|
+
selecting: s.selecting,
|
|
256
257
|
selected: j.has(e.collection),
|
|
257
258
|
onSelect: () => I((d) => {
|
|
258
259
|
const f = new Set(d);
|
|
259
260
|
return f.has(e.collection) ? f.delete(e.collection) : f.add(e.collection), f;
|
|
260
261
|
}),
|
|
261
262
|
dragHandle: o,
|
|
262
|
-
highlight:
|
|
263
|
-
isAdmin:
|
|
263
|
+
highlight: m,
|
|
264
|
+
isAdmin: c
|
|
264
265
|
}
|
|
265
266
|
);
|
|
266
267
|
}, P = (e, o) => {
|
|
267
268
|
if (!o)
|
|
268
|
-
return /* @__PURE__ */ n("div", { className: "divide-y divide-slate-100 dark:divide-white/[0.05]", children: e.map((r) => /* @__PURE__ */ n("div", { children:
|
|
269
|
+
return /* @__PURE__ */ n("div", { className: "divide-y divide-slate-100 dark:divide-white/[0.05]", children: e.map((r) => /* @__PURE__ */ n("div", { children: te(r) }, r.collection)) });
|
|
269
270
|
const i = e.map((r) => r.collection);
|
|
270
271
|
return /* @__PURE__ */ n(
|
|
271
|
-
|
|
272
|
+
xe,
|
|
272
273
|
{
|
|
273
|
-
sensors:
|
|
274
|
-
collisionDetection:
|
|
275
|
-
onDragEnd: (r) =>
|
|
276
|
-
children: /* @__PURE__ */ n(
|
|
274
|
+
sensors: fe,
|
|
275
|
+
collisionDetection: Ce,
|
|
276
|
+
onDragEnd: (r) => ue(i, r),
|
|
277
|
+
children: /* @__PURE__ */ n(Ne, { items: i, strategy: Se, children: /* @__PURE__ */ n("div", { className: "divide-y divide-slate-100 dark:divide-white/[0.05]", children: e.map((r) => /* @__PURE__ */ n(Ee, { id: r.collection, label: y(r), children: (d) => te(r, d) }, r.collection)) }) })
|
|
277
278
|
}
|
|
278
279
|
);
|
|
279
|
-
},
|
|
280
|
-
...
|
|
280
|
+
}, ge = !!m.trim() || H.length > 0, k = (e) => ge || !$[e], z = s.view === "folders", ne = !ge && !s.arranging && !s.selecting, Ge = z && ne, oe = b.pins.map((e) => Z.get(e)).filter((e) => !!e), Xe = [...G].map((e) => Z.get(e)).filter((e) => !!e), Ze = B.recent.filter((e) => !G.has(e) && !X.has(e)).map((e) => Z.get(e)).filter((e) => !!e).slice(0, 6), We = !!(t != null && t.renderSuggestions) && z && !m && !H.length && !s.arranging, be = z ? [
|
|
281
|
+
...ne && oe.length > 0 ? [{ key: q, label: "Pinned", count: oe.length }] : [],
|
|
281
282
|
...l.sections.map((e) => ({
|
|
282
283
|
key: e.folder.key,
|
|
283
284
|
label: e.folder.label,
|
|
284
285
|
count: e.cols.length
|
|
285
286
|
})),
|
|
286
|
-
...l.loose.length ? [{ key:
|
|
287
|
+
...l.loose.length ? [{ key: M, label: "Not in a folder", count: l.loose.length }] : [],
|
|
287
288
|
...l.linkTables.length ? [{ key: N, label: "Link tables", count: l.linkTables.length }] : []
|
|
288
289
|
] : [];
|
|
289
290
|
return (
|
|
@@ -298,15 +299,15 @@ function $t({
|
|
|
298
299
|
"data-cdr": "",
|
|
299
300
|
className: "z-10 md:[&[data-cdr]]:sticky md:[&[data-cdr]]:top-0",
|
|
300
301
|
children: /* @__PURE__ */ n(
|
|
301
|
-
|
|
302
|
+
bt,
|
|
302
303
|
{
|
|
303
|
-
state:
|
|
304
|
-
onChange:
|
|
305
|
-
filter:
|
|
306
|
-
onFilterChange:
|
|
304
|
+
state: s,
|
|
305
|
+
onChange: W,
|
|
306
|
+
filter: m,
|
|
307
|
+
onFilterChange: Fe,
|
|
307
308
|
filterRef: U,
|
|
308
309
|
counts: l.counts,
|
|
309
|
-
isAdmin:
|
|
310
|
+
isAdmin: c,
|
|
310
311
|
title: x,
|
|
311
312
|
canArrange: C,
|
|
312
313
|
canSelect: S,
|
|
@@ -321,89 +322,89 @@ function $t({
|
|
|
321
322
|
/* @__PURE__ */ a("div", { "data-cdr": "", className: "flex gap-6 px-4 py-6 sm:[&[data-cdr]]:px-8", children: [
|
|
322
323
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1 space-y-4", children: [
|
|
323
324
|
t == null ? void 0 : t.panels,
|
|
324
|
-
|
|
325
|
-
|
|
325
|
+
Ue ? /* @__PURE__ */ n(Mt, {}) : je && J.length === 0 ? /* @__PURE__ */ n(mt, { error: $e, what: "the collections", onRetry: () => void Je() }) : l.real.length === 0 ? /* @__PURE__ */ n(Et, {}) : l.shownCount === 0 && l.linkTables.length === 0 ? /* @__PURE__ */ n(
|
|
326
|
+
Tt,
|
|
326
327
|
{
|
|
327
|
-
filter:
|
|
328
|
-
near:
|
|
329
|
-
pathFor:
|
|
328
|
+
filter: m.trim(),
|
|
329
|
+
near: m.trim() ? St(m, l.real) : [],
|
|
330
|
+
pathFor: p,
|
|
330
331
|
hiddenMatches: l.foldedMatches.hidden.length,
|
|
331
332
|
linkMatches: l.foldedMatches.links.length,
|
|
332
333
|
chipsOn: H.length > 0,
|
|
333
|
-
onShowHidden: () =>
|
|
334
|
-
onShowLinks: () =>
|
|
335
|
-
onClearChips: () =>
|
|
334
|
+
onShowHidden: () => W({ ...s, showHidden: !0 }),
|
|
335
|
+
onShowLinks: () => W({ ...s, showLinks: !0 }),
|
|
336
|
+
onClearChips: () => ce([]),
|
|
336
337
|
onCreate: t == null ? void 0 : t.onCreate
|
|
337
338
|
}
|
|
338
339
|
) : /* @__PURE__ */ a(Q, { children: [
|
|
339
|
-
|
|
340
|
-
|
|
340
|
+
ne && /* @__PURE__ */ n(
|
|
341
|
+
Ct,
|
|
341
342
|
{
|
|
342
343
|
sectionId: w(q),
|
|
343
|
-
cols:
|
|
344
|
-
isAdmin:
|
|
344
|
+
cols: oe,
|
|
345
|
+
isAdmin: c,
|
|
345
346
|
status: b.status,
|
|
346
347
|
error: b.error,
|
|
347
348
|
onRetry: () => void b.refetch(),
|
|
348
349
|
onReorder: (e) => void b.reorder(e),
|
|
349
350
|
collapsed: !!$[q],
|
|
350
351
|
onToggle: () => _(q),
|
|
351
|
-
renderRow: (e, o) =>
|
|
352
|
+
renderRow: (e, o) => te(e, o.handle, {
|
|
352
353
|
onMoveUp: o.onMoveUp,
|
|
353
354
|
onMoveDown: o.onMoveDown,
|
|
354
355
|
inPinned: !0
|
|
355
356
|
})
|
|
356
357
|
}
|
|
357
358
|
),
|
|
358
|
-
|
|
359
|
+
Ge && /* @__PURE__ */ a("div", { className: "space-y-2", "data-collections-quick": !0, children: [
|
|
359
360
|
/* @__PURE__ */ n(
|
|
360
|
-
|
|
361
|
+
Re,
|
|
361
362
|
{
|
|
362
363
|
"data-collections-favorites": !0,
|
|
363
364
|
title: "My favorites",
|
|
364
|
-
icon: /* @__PURE__ */ n(
|
|
365
|
-
cols:
|
|
366
|
-
pathFor:
|
|
365
|
+
icon: /* @__PURE__ */ n(ct, { className: "h-3 w-3 fill-current" }),
|
|
366
|
+
cols: Xe,
|
|
367
|
+
pathFor: p,
|
|
367
368
|
empty: /* @__PURE__ */ n("span", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: g ? "Star a collection to keep it here and in your sidebar." : "Star a collection to keep it here." })
|
|
368
369
|
}
|
|
369
370
|
),
|
|
370
371
|
/* @__PURE__ */ n(
|
|
371
|
-
|
|
372
|
+
Re,
|
|
372
373
|
{
|
|
373
374
|
"data-collections-recent": !0,
|
|
374
375
|
title: "Recent",
|
|
375
376
|
icon: /* @__PURE__ */ n(st, { className: "h-3 w-3" }),
|
|
376
|
-
cols:
|
|
377
|
-
pathFor:
|
|
377
|
+
cols: Ze,
|
|
378
|
+
pathFor: p
|
|
378
379
|
}
|
|
379
380
|
)
|
|
380
381
|
] }),
|
|
381
|
-
|
|
382
|
+
We && ((ve = t == null ? void 0 : t.renderSuggestions) == null ? void 0 : ve.call(t, {
|
|
382
383
|
real: l.real,
|
|
383
384
|
folders: l.folders,
|
|
384
|
-
refresh:
|
|
385
|
+
refresh: ee
|
|
385
386
|
})),
|
|
386
387
|
z ? /* @__PURE__ */ a(Q, { children: [
|
|
387
|
-
|
|
388
|
-
|
|
388
|
+
s.arranging ? /* @__PURE__ */ n(
|
|
389
|
+
xe,
|
|
389
390
|
{
|
|
390
|
-
sensors:
|
|
391
|
-
collisionDetection:
|
|
392
|
-
onDragEnd: (e) =>
|
|
391
|
+
sensors: fe,
|
|
392
|
+
collisionDetection: Ce,
|
|
393
|
+
onDragEnd: (e) => ue(
|
|
393
394
|
l.sections.map((o) => o.folder.key),
|
|
394
395
|
e
|
|
395
396
|
),
|
|
396
397
|
children: /* @__PURE__ */ n(
|
|
397
|
-
|
|
398
|
+
Ne,
|
|
398
399
|
{
|
|
399
400
|
items: l.sections.map((e) => e.folder.key),
|
|
400
|
-
strategy:
|
|
401
|
+
strategy: Se,
|
|
401
402
|
children: /* @__PURE__ */ n("div", { className: "space-y-4", children: l.sections.map((e) => /* @__PURE__ */ n(
|
|
402
403
|
Ee,
|
|
403
404
|
{
|
|
404
405
|
id: e.folder.key,
|
|
405
406
|
label: e.folder.label,
|
|
406
|
-
children: (o) => /* @__PURE__ */ a(
|
|
407
|
+
children: (o) => /* @__PURE__ */ a(L, { id: w(e.folder.key), children: [
|
|
407
408
|
/* @__PURE__ */ n(
|
|
408
409
|
O,
|
|
409
410
|
{
|
|
@@ -423,7 +424,7 @@ function $t({
|
|
|
423
424
|
}
|
|
424
425
|
)
|
|
425
426
|
}
|
|
426
|
-
) : l.sections.map((e) => /* @__PURE__ */ a(
|
|
427
|
+
) : l.sections.map((e) => /* @__PURE__ */ a(L, { id: w(e.folder.key), children: [
|
|
427
428
|
/* @__PURE__ */ n(
|
|
428
429
|
O,
|
|
429
430
|
{
|
|
@@ -436,26 +437,26 @@ function $t({
|
|
|
436
437
|
),
|
|
437
438
|
k(e.folder.key) && P(e.cols, !1)
|
|
438
439
|
] }, e.folder.key)),
|
|
439
|
-
l.loose.length > 0 && /* @__PURE__ */ a(
|
|
440
|
+
l.loose.length > 0 && /* @__PURE__ */ a(L, { id: w(M), children: [
|
|
440
441
|
/* @__PURE__ */ n(
|
|
441
442
|
O,
|
|
442
443
|
{
|
|
443
|
-
folder: { key:
|
|
444
|
+
folder: { key: M, label: "Not in a folder", color: "#94a3b8" },
|
|
444
445
|
count: l.loose.length,
|
|
445
446
|
hiddenCount: 0,
|
|
446
|
-
collapsed: !k(
|
|
447
|
-
onToggle: () => _(
|
|
447
|
+
collapsed: !k(M),
|
|
448
|
+
onToggle: () => _(M)
|
|
448
449
|
}
|
|
449
450
|
),
|
|
450
|
-
k(
|
|
451
|
+
k(M) && P(l.loose, !1)
|
|
451
452
|
] })
|
|
452
|
-
] }) : /* @__PURE__ */ n(
|
|
453
|
-
l.linkTables.length > 0 && /* @__PURE__ */ a(
|
|
453
|
+
] }) : /* @__PURE__ */ n(L, { id: w("flat"), children: P(l.flat, !1) }),
|
|
454
|
+
l.linkTables.length > 0 && /* @__PURE__ */ a(L, { id: w(N), children: [
|
|
454
455
|
/* @__PURE__ */ n(
|
|
455
456
|
O,
|
|
456
457
|
{
|
|
457
458
|
folder: { key: N, label: "Link tables", color: "#64748b" },
|
|
458
|
-
icon: /* @__PURE__ */ n(
|
|
459
|
+
icon: /* @__PURE__ */ n(dt, { className: "h-3 w-3 text-slate-500 dark:text-slate-400" }),
|
|
459
460
|
count: l.linkTables.length,
|
|
460
461
|
hiddenCount: 0,
|
|
461
462
|
collapsed: !k(N),
|
|
@@ -467,11 +468,11 @@ function $t({
|
|
|
467
468
|
P(l.linkTables, !1)
|
|
468
469
|
] })
|
|
469
470
|
] }),
|
|
470
|
-
(
|
|
471
|
-
filter:
|
|
471
|
+
(ye = t == null ? void 0 : t.renderExtraSections) == null ? void 0 : ye.call(t, {
|
|
472
|
+
filter: m,
|
|
472
473
|
collapsed: $,
|
|
473
474
|
onToggle: _,
|
|
474
|
-
renderSection: (e) => /* @__PURE__ */ a(
|
|
475
|
+
renderSection: (e) => /* @__PURE__ */ a(L, { id: w(e.key), children: [
|
|
475
476
|
/* @__PURE__ */ n(
|
|
476
477
|
O,
|
|
477
478
|
{
|
|
@@ -488,7 +489,7 @@ function $t({
|
|
|
488
489
|
})
|
|
489
490
|
] })
|
|
490
491
|
] }),
|
|
491
|
-
|
|
492
|
+
be.length > 2 && /* @__PURE__ */ n(
|
|
492
493
|
"nav",
|
|
493
494
|
{
|
|
494
495
|
"aria-label": "Jump to folder",
|
|
@@ -501,7 +502,7 @@ function $t({
|
|
|
501
502
|
style: { top: "calc(var(--cl-toolbar-h, 0px) + 24px)" },
|
|
502
503
|
children: [
|
|
503
504
|
/* @__PURE__ */ n("p", { className: "px-2 pb-1 text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Jump to" }),
|
|
504
|
-
|
|
505
|
+
be.map((e) => /* @__PURE__ */ a(
|
|
505
506
|
"button",
|
|
506
507
|
{
|
|
507
508
|
type: "button",
|
|
@@ -526,18 +527,18 @@ function $t({
|
|
|
526
527
|
}
|
|
527
528
|
)
|
|
528
529
|
] }),
|
|
529
|
-
S && ((
|
|
530
|
-
open:
|
|
530
|
+
S && ((ke = t == null ? void 0 : t.renderMoveDialog) == null ? void 0 : ke.call(t, {
|
|
531
|
+
open: qe,
|
|
531
532
|
onOpenChange: se,
|
|
532
533
|
names: [...j],
|
|
533
534
|
folders: l.folders,
|
|
534
535
|
onMoved: () => {
|
|
535
|
-
I(/* @__PURE__ */ new Set()),
|
|
536
|
+
I(/* @__PURE__ */ new Set()), ee();
|
|
536
537
|
}
|
|
537
538
|
}))
|
|
538
539
|
] })
|
|
539
540
|
);
|
|
540
541
|
}
|
|
541
542
|
export {
|
|
542
|
-
|
|
543
|
+
Vt as CollectionsDirectory
|
|
543
544
|
};
|