@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.
Files changed (77) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +170 -2
  4. package/dist/index.js +745 -728
  5. package/dist/shared/components/CollectionBrowserView.js +3097 -2972
  6. package/dist/shared/components/CollectionImportBanner.js +135 -0
  7. package/dist/shared/components/ItemEditForm.js +2235 -2218
  8. package/dist/shared/components/JobsTray.js +54 -47
  9. package/dist/shared/components/TipLayer.js +61 -54
  10. package/dist/shared/components/ViewAsPersonButton.js +109 -0
  11. package/dist/shared/components/bulk/BulkFieldUpdate.js +228 -150
  12. package/dist/shared/components/bulk/BulkFieldUpdateButton.js +35 -41
  13. package/dist/shared/components/bulk/BulkLinksValue.js +91 -0
  14. package/dist/shared/components/bulk/bulk-field-options.js +20 -19
  15. package/dist/shared/components/bulk/bulk-update-preview.js +39 -0
  16. package/dist/shared/components/cbv/ColumnHeaderMenu.js +113 -0
  17. package/dist/shared/components/cbv/column-totals.js +66 -0
  18. package/dist/shared/components/collections-directory/CollectionHoverCard.js +108 -81
  19. package/dist/shared/components/collections-directory/CollectionRow.js +164 -148
  20. package/dist/shared/components/collections-directory/CollectionsDirectory.js +167 -166
  21. package/dist/shared/components/collections-directory/directory-data.js +70 -58
  22. package/dist/shared/components/imports/CollectionImportPanel.js +120 -118
  23. package/dist/shared/components/imports/DefinitionsPanel.js +24 -24
  24. package/dist/shared/components/imports/ImportDuplicatesNotice.js +65 -0
  25. package/dist/shared/components/item-edit/CatalogPickerField.js +631 -639
  26. package/dist/shared/components/item-edit/DuplicateNotice.js +168 -0
  27. package/dist/shared/components/item-edit/FieldRow.js +248 -246
  28. package/dist/shared/components/item-edit/InlineGridField.js +34 -33
  29. package/dist/shared/components/item-edit/InlineTableField.js +3064 -2882
  30. package/dist/shared/components/item-edit/MembershipSetField.js +165 -169
  31. package/dist/shared/components/item-edit/NestedRelationEditor.js +184 -189
  32. package/dist/shared/components/item-edit/PlanGrid.js +2 -1
  33. package/dist/shared/components/item-edit/QuickPickerDialog.js +35 -34
  34. package/dist/shared/components/item-edit/RecordLiveSync.js +32 -30
  35. package/dist/shared/components/item-edit/RelationCombobox.js +101 -100
  36. package/dist/shared/components/item-edit/RowHistorySheet.js +28 -27
  37. package/dist/shared/components/item-edit/SummaryPanel.js +133 -135
  38. package/dist/shared/components/item-edit/ViewAsRole.js +129 -52
  39. package/dist/shared/components/item-edit/grid-search.js +345 -0
  40. package/dist/shared/components/item-edit/render-stability.js +61 -54
  41. package/dist/shared/components/notifications/NotificationRulesEditor.js +25 -20
  42. package/dist/shared/components/ops-report/DigestSections.js +163 -144
  43. package/dist/shared/components/ops-report/drill.js +97 -97
  44. package/dist/shared/components/panels/AddendumLinesDiff.js +52 -51
  45. package/dist/shared/components/panels/AddendumPanel.js +92 -91
  46. package/dist/shared/components/panels/AsyncUserPicker.js +108 -0
  47. package/dist/shared/components/panels/BlockedMove.js +73 -0
  48. package/dist/shared/components/panels/CommentPanel.js +265 -252
  49. package/dist/shared/components/panels/OwnersSlot.js +47 -35
  50. package/dist/shared/components/panels/PipelineInsight.js +186 -0
  51. package/dist/shared/components/panels/PipelinePanel.js +1573 -1475
  52. package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
  53. package/dist/shared/components/panels/RevisionsPanel.js +261 -260
  54. package/dist/shared/components/pipeline/FieldPicker.js +41 -40
  55. package/dist/shared/components/pipeline/OwnerMatrix.js +829 -700
  56. package/dist/shared/components/pipeline/OwnerRecordTrial.js +362 -0
  57. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -467
  58. package/dist/shared/components/pipeline/PipelineStateOwners.js +65 -64
  59. package/dist/shared/components/pipeline/owner-matrix-draft.js +178 -0
  60. package/dist/shared/components/profile/MyDefaultsCard.js +36 -35
  61. package/dist/shared/components/profile/PersonHeader.js +29 -29
  62. package/dist/shared/components/profile/PersonProfile.js +30 -28
  63. package/dist/shared/components/profile/SlowScreensCard.js +286 -0
  64. package/dist/shared/components/queue/QueueWorklist.js +1090 -1071
  65. package/dist/shared/components/quick-filters/useQuickFilterEditing.js +45 -44
  66. package/dist/shared/components/support/TicketDetailSheet.js +25 -16
  67. package/dist/shared/components/support/TicketSlowScreens.js +32 -0
  68. package/dist/shared/lib/activity-sentence.js +224 -178
  69. package/dist/shared/lib/collection-import-banner.js +27 -0
  70. package/dist/shared/lib/crash-report.js +112 -0
  71. package/dist/shared/lib/export-runs.js +99 -0
  72. package/dist/shared/lib/jobs-tray.js +89 -67
  73. package/dist/shared/lib/list-link.js +76 -69
  74. package/dist/shared/lib/nav-trail.js +180 -76
  75. package/dist/shared/lib/query-keys.js +26 -0
  76. package/dist/shared/lib/view-as.js +16 -11
  77. 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 tt, useSensor as ke, PointerSensor as nt, KeyboardSensor as ot, DndContext as we, closestCenter as xe } from "@dnd-kit/core";
3
- import { sortableKeyboardCoordinates as rt, SortableContext as Ce, verticalListSortingStrategy as Ne, arrayMove as lt } from "@dnd-kit/sortable";
4
- import { useQueryClient as it } from "@tanstack/react-query";
5
- import { Star as at, Clock as st, Link2 as ct, Database as dt, SearchX as ht } from "lucide-react";
6
- import { useRef as Y, useState as v, useEffect as Se, useMemo as oe } from "react";
7
- import { toast as re } from "sonner";
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 le } from "../ui/skeleton.js";
10
- import { defaultCollectionPath as pt, HostLink as Re, CollectionRow as ft, CollectionAvatar as ut } from "./CollectionRow.js";
11
- import { CollectionsToolbar as gt } from "./CollectionsToolbar.js";
12
- import { readLocal as _e, useDirectoryCollections as bt, useOverviewStats as vt, useCollectionUsage as yt, useNavFavoriteCollections as kt, writeLocal as Me, recordCollectionOpen as Pe, DIRECTORY_KEYS as ie } from "./directory-data.js";
13
- import { PINNED_KEY as q, PinnedSection as wt } from "./PinnedSection.js";
14
- import { buildPageModel as xt, nearSpellings as Ct, label as y } from "./page-model.js";
15
- import { SortableRow as Ee, Section as M, FolderHeader as O } from "./sections.js";
16
- import { useSharedPins as Nt } from "./shared-pins.js";
17
- const Le = "nivaro_col_collapsed", Te = "nvr_collections_prefs", E = "__loose__", N = "__links__", St = {
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 = (s) => `cl-section-${s.replace(/[^A-Za-z0-9_-]/g, "_")}`;
23
- function _t() {
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((s) => /* @__PURE__ */ a(
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(le, { className: "h-6 w-6 rounded" }),
37
- /* @__PURE__ */ n(le, { className: "h-3.5 w-48" }),
38
- /* @__PURE__ */ n(le, { className: "ml-auto h-3 w-16" })
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
- s
41
+ c
42
42
  ))
43
43
  }
44
44
  );
45
45
  }
46
- function Mt() {
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(dt, { className: "h-5 w-5 text-slate-400" }) }),
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 Et({
54
- filter: s,
53
+ function Tt({
54
+ filter: c,
55
55
  near: x,
56
- pathFor: m,
56
+ pathFor: p,
57
57
  hiddenMatches: u,
58
58
  linkMatches: g,
59
- chipsOn: L,
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(ht, { 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: s ? /* @__PURE__ */ a(Q, { 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
- s,
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
- Re,
82
+ Pe,
83
83
  {
84
- to: m(C.collection),
85
- onClick: () => Pe(C.collection),
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
- L && /* @__PURE__ */ n("button", { type: "button", className: t, onClick: F, children: "Clear filters" }),
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 De({
113
- title: s,
112
+ function Re({
113
+ title: c,
114
114
  icon: x,
115
- cols: m,
115
+ cols: p,
116
116
  empty: u,
117
117
  pathFor: g,
118
- ...L
118
+ ...E
119
119
  }) {
120
- return !m.length && !u ? null : /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", ...L, children: [
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
- s
123
+ c
124
124
  ] }),
125
- m.map((h) => /* @__PURE__ */ a(
126
- Re,
125
+ p.map((h) => /* @__PURE__ */ a(
126
+ Pe,
127
127
  {
128
128
  to: g(h.collection),
129
- onClick: () => Pe(h.collection),
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(ut, { color: h.color, name: y(h), icon: h.icon }),
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
- !m.length && u
138
+ !p.length && u
139
139
  ] });
140
140
  }
141
- function $t({
142
- isAdmin: s,
141
+ function Vt({
142
+ isAdmin: c,
143
143
  title: x,
144
- collectionPath: m = pt,
144
+ collectionPath: p = ft,
145
145
  include: u,
146
146
  favorites: g,
147
- admin: L
147
+ admin: E
148
148
  }) {
149
- var be, ve, ye;
150
- const h = it(), U = Y(null), F = Y(null), T = Y(null), t = s ? L : void 0, C = !!(t != null && t.reorder), S = !!(t != null && t.moveCollections && t.renderMoveDialog), [p, Oe] = v(""), [K, Fe] = v(() => ({
151
- ...St,
152
- ..._e(Te, {})
153
- })), [H, ae] = v([]), [Ke, He] = v(!1), [Ie, ze] = v(!1), [j, I] = v(/* @__PURE__ */ new Set()), [Ye, se] = v(!1), [$, qe] = v(() => ({
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
- ..._e(Le, {})
158
- })), c = {
157
+ ...Le(Te, {})
158
+ })), s = {
159
159
  ...K,
160
160
  // Admin-only views fall back to Folders for everyone else.
161
- view: !s && (K.view === "records" || K.view === "recent") ? "folders" : K.view,
161
+ view: !c && (K.view === "records" || K.view === "recent") ? "folders" : K.view,
162
162
  chips: H,
163
- arranging: C && Ke,
164
- selecting: S && Ie
165
- }, { data: D, isLoading: Qe, isError: Ue, error: je, refetch: $e } = bt(), ce = Y(u);
166
- ce.current = u;
167
- const de = (e) => {
168
- const o = ce.current;
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
- }, [A, J] = v([]);
171
- Se(() => {
172
- D && J(de(D));
170
+ }, [J, V] = v([]);
171
+ _e(() => {
172
+ D && V(he(D));
173
173
  }, [D]);
174
- const { data: R } = vt(s), V = yt(), Ae = kt(!g), { favorite: B, toggle: Je } = g ?? Ae, b = Nt(), G = oe(() => new Set(b.pins), [b.pins]), l = oe(
175
- () => xt(A, R, c, p, V),
176
- [A, R, p, V, c.view, c.chips, c.showHidden, c.showLinks]
177
- ), X = oe(() => new Map(l.real.map((e) => [e.collection, e])), [l.real]);
178
- Se(() => {
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 Z = (e) => {
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
- Fe(o), Me(Te, o), ae(e.chips), He(e.arranging), ze(e.selecting), e.selecting || I(/* @__PURE__ */ new Set());
199
- }, _ = (e) => qe((o) => {
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(Le, i), i;
202
- }), W = () => {
203
- h.invalidateQueries({ queryKey: ie.collections }), h.invalidateQueries({ queryKey: ie.stats });
204
- }, he = t == null ? void 0 : t.moveCollections, me = he ? async (e, o) => {
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 he([e.collection], o);
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
- re.success(`Moved ${y(e)} to ${r}`), W();
209
+ le.success(`Moved ${y(e)} to ${r}`), ee();
210
210
  } catch {
211
- re.error(`Could not move ${y(e)}`);
211
+ le.error(`Could not move ${y(e)}`);
212
212
  }
213
- } : void 0, pe = tt(
214
- ke(nt, { activationConstraint: { distance: 8 } }),
215
- ke(ot, { coordinateGetter: rt })
216
- ), Ve = (e) => {
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
- J(
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
- re.error("Could not save the new order"), D && J(de(D)), h.invalidateQueries({ queryKey: ie.collections });
226
+ le.error("Could not save the new order"), D && V(he(D)), h.invalidateQueries({ queryKey: ae.collections });
227
227
  });
228
- }, fe = (e, o) => {
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 || Ve(
233
- lt(e, d, f).map((We, et) => ({ collection: We, sort: (et + 1) * 10 }))
232
+ d === -1 || f === -1 || Be(
233
+ it(e, d, f).map((et, tt) => ({ collection: et, sort: (tt + 1) * 10 }))
234
234
  );
235
- }, ee = (e, o, i) => {
235
+ }, te = (e, o, i) => {
236
236
  var r;
237
237
  return /* @__PURE__ */ n(
238
- ft,
238
+ ut,
239
239
  {
240
240
  col: e,
241
241
  stat: R == null ? void 0 : R[e.collection],
242
- density: c.density,
243
- favorite: B.has(e.collection),
244
- onToggleFavorite: () => void Je(e.collection, y(e)),
245
- pinnedForAll: G.has(e.collection),
246
- onTogglePinned: s ? () => void (G.has(e.collection) ? b.unpin(e.collection, y(e)) : b.pin(e.collection, y(e))) : void 0,
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: m(e.collection),
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: c.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: p,
263
- isAdmin: s
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: ee(r) }, r.collection)) });
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
- we,
272
+ xe,
272
273
  {
273
- sensors: pe,
274
- collisionDetection: xe,
275
- onDragEnd: (r) => fe(i, r),
276
- children: /* @__PURE__ */ n(Ce, { items: i, strategy: Ne, 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) => ee(r, d) }, r.collection)) }) })
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
- }, ue = !!p.trim() || H.length > 0, k = (e) => ue || !$[e], z = c.view === "folders", te = !ue && !c.arranging && !c.selecting, Be = z && te, ne = b.pins.map((e) => X.get(e)).filter((e) => !!e), Ge = [...B].map((e) => X.get(e)).filter((e) => !!e), Xe = V.recent.filter((e) => !B.has(e) && !G.has(e)).map((e) => X.get(e)).filter((e) => !!e).slice(0, 6), Ze = !!(t != null && t.renderSuggestions) && z && !p && !H.length && !c.arranging, ge = z ? [
280
- ...te && ne.length > 0 ? [{ key: q, label: "Pinned", count: ne.length }] : [],
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: E, label: "Not in a folder", count: l.loose.length }] : [],
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
- gt,
302
+ bt,
302
303
  {
303
- state: c,
304
- onChange: Z,
305
- filter: p,
306
- onFilterChange: Oe,
304
+ state: s,
305
+ onChange: W,
306
+ filter: m,
307
+ onFilterChange: Fe,
307
308
  filterRef: U,
308
309
  counts: l.counts,
309
- isAdmin: s,
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
- Qe ? /* @__PURE__ */ n(_t, {}) : Ue && A.length === 0 ? /* @__PURE__ */ n(mt, { error: je, what: "the collections", onRetry: () => void $e() }) : l.real.length === 0 ? /* @__PURE__ */ n(Mt, {}) : l.shownCount === 0 && l.linkTables.length === 0 ? /* @__PURE__ */ n(
325
- Et,
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: p.trim(),
328
- near: p.trim() ? Ct(p, l.real) : [],
329
- pathFor: m,
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: () => Z({ ...c, showHidden: !0 }),
334
- onShowLinks: () => Z({ ...c, showLinks: !0 }),
335
- onClearChips: () => ae([]),
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
- te && /* @__PURE__ */ n(
340
- wt,
340
+ ne && /* @__PURE__ */ n(
341
+ Ct,
341
342
  {
342
343
  sectionId: w(q),
343
- cols: ne,
344
- isAdmin: s,
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) => ee(e, o.handle, {
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
- Be && /* @__PURE__ */ a("div", { className: "space-y-2", "data-collections-quick": !0, children: [
359
+ Ge && /* @__PURE__ */ a("div", { className: "space-y-2", "data-collections-quick": !0, children: [
359
360
  /* @__PURE__ */ n(
360
- De,
361
+ Re,
361
362
  {
362
363
  "data-collections-favorites": !0,
363
364
  title: "My favorites",
364
- icon: /* @__PURE__ */ n(at, { className: "h-3 w-3 fill-current" }),
365
- cols: Ge,
366
- pathFor: m,
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
- De,
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: Xe,
377
- pathFor: m
377
+ cols: Ze,
378
+ pathFor: p
378
379
  }
379
380
  )
380
381
  ] }),
381
- Ze && ((be = t == null ? void 0 : t.renderSuggestions) == null ? void 0 : be.call(t, {
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: W
385
+ refresh: ee
385
386
  })),
386
387
  z ? /* @__PURE__ */ a(Q, { children: [
387
- c.arranging ? /* @__PURE__ */ n(
388
- we,
388
+ s.arranging ? /* @__PURE__ */ n(
389
+ xe,
389
390
  {
390
- sensors: pe,
391
- collisionDetection: xe,
392
- onDragEnd: (e) => fe(
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
- Ce,
398
+ Ne,
398
399
  {
399
400
  items: l.sections.map((e) => e.folder.key),
400
- strategy: Ne,
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(M, { id: w(e.folder.key), children: [
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(M, { id: w(e.folder.key), children: [
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(M, { id: w(E), children: [
440
+ l.loose.length > 0 && /* @__PURE__ */ a(L, { id: w(M), children: [
440
441
  /* @__PURE__ */ n(
441
442
  O,
442
443
  {
443
- folder: { key: E, label: "Not in a folder", color: "#94a3b8" },
444
+ folder: { key: M, label: "Not in a folder", color: "#94a3b8" },
444
445
  count: l.loose.length,
445
446
  hiddenCount: 0,
446
- collapsed: !k(E),
447
- onToggle: () => _(E)
447
+ collapsed: !k(M),
448
+ onToggle: () => _(M)
448
449
  }
449
450
  ),
450
- k(E) && P(l.loose, !1)
451
+ k(M) && P(l.loose, !1)
451
452
  ] })
452
- ] }) : /* @__PURE__ */ n(M, { id: w("flat"), children: P(l.flat, !1) }),
453
- l.linkTables.length > 0 && /* @__PURE__ */ a(M, { id: w(N), children: [
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(ct, { className: "h-3 w-3 text-slate-500 dark:text-slate-400" }),
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
- (ve = t == null ? void 0 : t.renderExtraSections) == null ? void 0 : ve.call(t, {
471
- filter: p,
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(M, { id: w(e.key), children: [
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
- ge.length > 2 && /* @__PURE__ */ n(
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
- ge.map((e) => /* @__PURE__ */ a(
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 && ((ye = t == null ? void 0 : t.renderMoveDialog) == null ? void 0 : ye.call(t, {
530
- open: Ye,
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()), W();
536
+ I(/* @__PURE__ */ new Set()), ee();
536
537
  }
537
538
  }))
538
539
  ] })
539
540
  );
540
541
  }
541
542
  export {
542
- $t as CollectionsDirectory
543
+ Vt as CollectionsDirectory
543
544
  };