@nivaro/react 0.3.114 → 0.3.116

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 (293) hide show
  1. package/dist/components/ScreenShareHost.js +24 -0
  2. package/dist/full.css +50 -2
  3. package/dist/hooks/useSessionRecorder.js +61 -60
  4. package/dist/index.d.ts +1728 -22
  5. package/dist/index.js +1091 -950
  6. package/dist/shared/components/ActivityEntry.js +209 -97
  7. package/dist/shared/components/AgentPresenceChip.js +51 -0
  8. package/dist/shared/components/AnnouncementBanner.js +56 -41
  9. package/dist/shared/components/AutolinkedText.js +98 -85
  10. package/dist/shared/components/BroadcastView.js +149 -141
  11. package/dist/shared/components/CacheStamp.js +78 -30
  12. package/dist/shared/components/CollectionBrowserView.js +4909 -4182
  13. package/dist/shared/components/ConfigChangeStrip.js +63 -0
  14. package/dist/shared/components/ConfigReachNote.js +107 -0
  15. package/dist/shared/components/ConformanceView.js +389 -319
  16. package/dist/shared/components/DataTable.js +612 -551
  17. package/dist/shared/components/DelegateCoverLine.js +164 -0
  18. package/dist/shared/components/EnvironmentNotice.js +56 -65
  19. package/dist/shared/components/FilePreviewLightbox.js +89 -43
  20. package/dist/shared/components/FindingFixedMark.js +23 -0
  21. package/dist/shared/components/GridPresenceLine.js +100 -0
  22. package/dist/shared/components/IdleReloadWatcher.js +82 -43
  23. package/dist/shared/components/InStep.js +46 -0
  24. package/dist/shared/components/ItemEditForm.js +5504 -4889
  25. package/dist/shared/components/LiveAnnouncer.js +62 -0
  26. package/dist/shared/components/LiveCount.js +54 -0
  27. package/dist/shared/components/LiveFigure.js +28 -0
  28. package/dist/shared/components/LiveListControls.js +114 -0
  29. package/dist/shared/components/LiveNewMatchesPill.js +25 -0
  30. package/dist/shared/components/LiveOffNote.js +44 -0
  31. package/dist/shared/components/LivePreferenceHost.js +42 -0
  32. package/dist/shared/components/LiveRowMark.js +25 -20
  33. package/dist/shared/components/LiveTraceView.js +257 -0
  34. package/dist/shared/components/MapView.js +30 -29
  35. package/dist/shared/components/MatrixEditor.js +497 -462
  36. package/dist/shared/components/MyWorkView.js +346 -272
  37. package/dist/shared/components/NotificationBell.js +215 -201
  38. package/dist/shared/components/OverflowRail.js +326 -0
  39. package/dist/shared/components/PageRenderer.js +636 -599
  40. package/dist/shared/components/PresenceDot.js +21 -0
  41. package/dist/shared/components/ProfileView.js +656 -536
  42. package/dist/shared/components/RealtimeStatusBanner.js +25 -25
  43. package/dist/shared/components/RecentRecordsRail.js +51 -48
  44. package/dist/shared/components/RecordCompare.js +241 -150
  45. package/dist/shared/components/RecordDrilldownSheet.js +66 -64
  46. package/dist/shared/components/RecordGridEditor.js +350 -311
  47. package/dist/shared/components/RecordHoverCard.js +147 -0
  48. package/dist/shared/components/RecordPeekHost.js +111 -0
  49. package/dist/shared/components/RecordReadView.js +414 -412
  50. package/dist/shared/components/RelativeTime.js +16 -0
  51. package/dist/shared/components/ReportView.js +1396 -1304
  52. package/dist/shared/components/ScreenRefreshButton.js +77 -0
  53. package/dist/shared/components/TabCountHost.js +10 -0
  54. package/dist/shared/components/TickerNumber.js +19 -18
  55. package/dist/shared/components/TipLayer.js +70 -58
  56. package/dist/shared/components/WidgetImageMenu.js +59 -0
  57. package/dist/shared/components/WidgetSlot.js +571 -524
  58. package/dist/shared/components/activity/RecordActivityStream.js +317 -0
  59. package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
  60. package/dist/shared/components/cbv/approval-changed.js +20 -0
  61. package/dist/shared/components/cbv/changed-by-others.js +251 -0
  62. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
  63. package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
  64. package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
  65. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
  66. package/dist/shared/components/change-proposals/types.js +4 -0
  67. package/dist/shared/components/chat/ChatPanel.js +1571 -1528
  68. package/dist/shared/components/chat/Composer.js +276 -298
  69. package/dist/shared/components/chat/room-due.js +13 -0
  70. package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
  71. package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
  72. package/dist/shared/components/collections-directory/directory-data.js +75 -63
  73. package/dist/shared/components/imports/ImportConsole.js +159 -155
  74. package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
  75. package/dist/shared/components/integrations/SendStatus.js +202 -0
  76. package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
  77. package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
  78. package/dist/shared/components/integrations/console/SignalCard.js +84 -77
  79. package/dist/shared/components/integrations/console/api.js +161 -117
  80. package/dist/shared/components/integrations/console/tone.js +15 -12
  81. package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
  82. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
  83. package/dist/shared/components/item-edit/CloneDialog.js +208 -206
  84. package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
  85. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
  86. package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
  87. package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
  88. package/dist/shared/components/item-edit/FieldComments.js +159 -116
  89. package/dist/shared/components/item-edit/FieldPointer.js +132 -0
  90. package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
  91. package/dist/shared/components/item-edit/FieldRow.js +519 -439
  92. package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
  93. package/dist/shared/components/item-edit/FilePickerField.js +454 -369
  94. package/dist/shared/components/item-edit/GroupSection.js +618 -567
  95. package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
  96. package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
  97. package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
  98. package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
  99. package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
  100. package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
  101. package/dist/shared/components/item-edit/PickerBadges.js +52 -0
  102. package/dist/shared/components/item-edit/PlanGrid.js +434 -439
  103. package/dist/shared/components/item-edit/RecalcValue.js +55 -0
  104. package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
  105. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
  106. package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
  107. package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
  108. package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
  109. package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
  110. package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
  111. package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
  112. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
  113. package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
  114. package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
  115. package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
  116. package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
  117. package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
  118. package/dist/shared/components/item-edit/SectionPresence.js +78 -0
  119. package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
  120. package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
  121. package/dist/shared/components/item-edit/coedit/collab.js +84 -0
  122. package/dist/shared/components/item-edit/coedit/context.js +24 -0
  123. package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
  124. package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
  125. package/dist/shared/components/item-edit/coedit/session.js +382 -0
  126. package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
  127. package/dist/shared/components/item-edit/file-live.js +77 -0
  128. package/dist/shared/components/item-edit/file-processing.js +87 -0
  129. package/dist/shared/components/item-edit/layout-switch.js +148 -0
  130. package/dist/shared/components/item-edit/live-related.js +23 -0
  131. package/dist/shared/components/item-edit/live-title.js +66 -0
  132. package/dist/shared/components/item-edit/partner-needs.js +142 -0
  133. package/dist/shared/components/item-edit/removed-line.js +58 -0
  134. package/dist/shared/components/item-edit/render-stability.js +70 -59
  135. package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
  136. package/dist/shared/components/layout-editor/CollabParts.js +72 -70
  137. package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
  138. package/dist/shared/components/list/InlineEdit.js +504 -208
  139. package/dist/shared/components/list/ListViewers.js +81 -0
  140. package/dist/shared/components/list/PhonePager.js +50 -0
  141. package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
  142. package/dist/shared/components/merge/MergeWithFlow.js +290 -0
  143. package/dist/shared/components/merge/merge-values.js +110 -0
  144. package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
  145. package/dist/shared/components/notifications/NotificationCenterView.js +389 -323
  146. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
  147. package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
  148. package/dist/shared/components/notifications/bundles.js +21 -19
  149. package/dist/shared/components/notifications/resolved-line.js +25 -0
  150. package/dist/shared/components/ops/OpsTasksView.js +45 -44
  151. package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
  152. package/dist/shared/components/panels/AlertBanners.js +132 -0
  153. package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
  154. package/dist/shared/components/panels/BranchLanes.js +82 -54
  155. package/dist/shared/components/panels/CommentAwareness.js +332 -0
  156. package/dist/shared/components/panels/CommentImages.js +219 -0
  157. package/dist/shared/components/panels/CommentPanel.js +649 -530
  158. package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
  159. package/dist/shared/components/panels/NewSinceChip.js +16 -0
  160. package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
  161. package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
  162. package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
  163. package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
  164. package/dist/shared/components/panels/SlaClock.js +130 -99
  165. package/dist/shared/components/panels/TaskPanel.js +308 -287
  166. package/dist/shared/components/panels/unseen-move-check.js +101 -0
  167. package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
  168. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
  169. package/dist/shared/components/pipeline/PipelineEditorView.js +2050 -1942
  170. package/dist/shared/components/profile/AgentNameField.js +141 -0
  171. package/dist/shared/components/profile/AgentsPanel.js +55 -46
  172. package/dist/shared/components/profile/PersonAccess.js +398 -330
  173. package/dist/shared/components/profile/PersonAdminTools.js +127 -113
  174. package/dist/shared/components/profile/PersonProfile.js +81 -73
  175. package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
  176. package/dist/shared/components/queue/OwnerAvatars.js +9 -9
  177. package/dist/shared/components/queue/QueueBulkBar.js +101 -84
  178. package/dist/shared/components/queue/QueueItemSheet.js +66 -66
  179. package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
  180. package/dist/shared/components/queue/QueueWorklist.js +2407 -1950
  181. package/dist/shared/components/queue/worklist-helpers.js +10 -6
  182. package/dist/shared/components/send-view/SendViewButton.js +136 -0
  183. package/dist/shared/components/send-view/SentViewCards.js +147 -0
  184. package/dist/shared/components/support/ReportProblem.js +1 -0
  185. package/dist/shared/components/support/ScreenShare.js +554 -0
  186. package/dist/shared/components/support/SupportView.js +160 -129
  187. package/dist/shared/components/support/TicketDetailSheet.js +101 -89
  188. package/dist/shared/components/ui/popover.js +53 -29
  189. package/dist/shared/components/watch-list/WatchDock.js +1044 -0
  190. package/dist/shared/components/watch-list/WatchExtras.js +723 -0
  191. package/dist/shared/components/watch-list/WatchListButton.js +46 -0
  192. package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
  193. package/dist/shared/components/watch-list/WatchRows.js +348 -0
  194. package/dist/shared/lib/activity-sentence.js +87 -75
  195. package/dist/shared/lib/agent-presence.js +46 -0
  196. package/dist/shared/lib/approval-progress.js +49 -0
  197. package/dist/shared/lib/attention-prefs.js +27 -0
  198. package/dist/shared/lib/cell-locks.js +56 -0
  199. package/dist/shared/lib/co-edit.js +166 -0
  200. package/dist/shared/lib/coedit-registry.js +44 -0
  201. package/dist/shared/lib/comment-awareness.js +124 -0
  202. package/dist/shared/lib/comment-images.js +45 -0
  203. package/dist/shared/lib/config-watch.js +94 -0
  204. package/dist/shared/lib/copy-rules.js +65 -0
  205. package/dist/shared/lib/count-step.js +30 -0
  206. package/dist/shared/lib/deadline-ticker.js +68 -0
  207. package/dist/shared/lib/derived-causes.js +115 -0
  208. package/dist/shared/lib/draft-store.js +114 -85
  209. package/dist/shared/lib/error-hints.js +1 -0
  210. package/dist/shared/lib/field-merge.js +126 -0
  211. package/dist/shared/lib/filter-sentence.js +10 -10
  212. package/dist/shared/lib/focus-mode.js +16 -12
  213. package/dist/shared/lib/grid-cursors.js +77 -0
  214. package/dist/shared/lib/grid-presence.js +182 -0
  215. package/dist/shared/lib/idle-reload.js +100 -73
  216. package/dist/shared/lib/in-step.js +45 -0
  217. package/dist/shared/lib/integration-chip.js +19 -18
  218. package/dist/shared/lib/keep-row-focus.js +43 -0
  219. package/dist/shared/lib/line-locks.js +141 -0
  220. package/dist/shared/lib/line-split.js +41 -0
  221. package/dist/shared/lib/linked-changes.js +150 -0
  222. package/dist/shared/lib/list-return.js +231 -0
  223. package/dist/shared/lib/list-viewers.js +52 -0
  224. package/dist/shared/lib/live-announcer.js +86 -0
  225. package/dist/shared/lib/live-counts.js +85 -0
  226. package/dist/shared/lib/live-data-changed.js +108 -0
  227. package/dist/shared/lib/live-deltas.js +81 -0
  228. package/dist/shared/lib/live-findings.js +113 -0
  229. package/dist/shared/lib/live-groups.js +122 -0
  230. package/dist/shared/lib/live-link-labels.js +162 -0
  231. package/dist/shared/lib/live-list-flow.js +334 -0
  232. package/dist/shared/lib/live-list.js +143 -129
  233. package/dist/shared/lib/live-moves.js +51 -0
  234. package/dist/shared/lib/live-ops.js +26 -26
  235. package/dist/shared/lib/live-pickers.js +7 -0
  236. package/dist/shared/lib/live-preference.js +184 -0
  237. package/dist/shared/lib/live-queries.js +226 -181
  238. package/dist/shared/lib/live-screen.js +333 -0
  239. package/dist/shared/lib/live-search.js +108 -0
  240. package/dist/shared/lib/live-seen.js +35 -0
  241. package/dist/shared/lib/live-views.js +100 -0
  242. package/dist/shared/lib/live.js +159 -133
  243. package/dist/shared/lib/missed-updates.js +198 -0
  244. package/dist/shared/lib/newer-file.js +56 -0
  245. package/dist/shared/lib/notification-sound.js +42 -20
  246. package/dist/shared/lib/obligation-banner.js +17 -17
  247. package/dist/shared/lib/own-writes.js +59 -41
  248. package/dist/shared/lib/picker-badges.js +94 -0
  249. package/dist/shared/lib/presence-signals.js +131 -84
  250. package/dist/shared/lib/rail-menu-context.js +9 -0
  251. package/dist/shared/lib/realtime.js +49 -24
  252. package/dist/shared/lib/record-gaps.js +85 -0
  253. package/dist/shared/lib/record-outbox.js +369 -222
  254. package/dist/shared/lib/record-peek.js +75 -0
  255. package/dist/shared/lib/record-tabs.js +92 -72
  256. package/dist/shared/lib/relative-ticker.js +42 -0
  257. package/dist/shared/lib/request-gate.js +119 -119
  258. package/dist/shared/lib/rollup-recalc.js +107 -0
  259. package/dist/shared/lib/room-gaps.js +40 -36
  260. package/dist/shared/lib/row-surface.js +7 -0
  261. package/dist/shared/lib/rum.js +137 -87
  262. package/dist/shared/lib/save-progress.js +20 -0
  263. package/dist/shared/lib/scheduled-countdown.js +67 -0
  264. package/dist/shared/lib/screen-refresh.js +160 -0
  265. package/dist/shared/lib/screen-share.js +234 -0
  266. package/dist/shared/lib/seen-since.js +74 -0
  267. package/dist/shared/lib/selection-watch.js +205 -0
  268. package/dist/shared/lib/send-status.js +132 -0
  269. package/dist/shared/lib/send-view.js +23 -0
  270. package/dist/shared/lib/socket-liveness.js +155 -0
  271. package/dist/shared/lib/socket-realtime.js +168 -140
  272. package/dist/shared/lib/state-census.js +53 -0
  273. package/dist/shared/lib/summary-mode.js +61 -39
  274. package/dist/shared/lib/tab-attention.js +143 -32
  275. package/dist/shared/lib/table-density.js +64 -0
  276. package/dist/shared/lib/table-pins.js +20 -18
  277. package/dist/shared/lib/track-travel.js +40 -0
  278. package/dist/shared/lib/unseen-changes.js +68 -0
  279. package/dist/shared/lib/upload-file.js +62 -0
  280. package/dist/shared/lib/upload-presence.js +127 -0
  281. package/dist/shared/lib/urgent-chime.js +65 -0
  282. package/dist/shared/lib/use-below-md.js +29 -0
  283. package/dist/shared/lib/use-online-users.js +32 -11
  284. package/dist/shared/lib/user-sync.js +155 -39
  285. package/dist/shared/lib/waiting-count.js +44 -0
  286. package/dist/shared/lib/watch-desktop.js +83 -0
  287. package/dist/shared/lib/watch-list.js +447 -0
  288. package/dist/shared/lib/widget-image-render.js +64 -0
  289. package/dist/shared/lib/widget-image.js +111 -0
  290. package/dist/shared/lib/worker-socket.js +130 -104
  291. package/dist/shared/lib/write-to-screen.js +133 -0
  292. package/package.json +1 -1
  293. package/styles.css +49 -1
@@ -1,26 +1,26 @@
1
- import { jsxs as a, jsx as n, Fragment as Q } from "react/jsx-runtime";
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
- import { ErrorNotice as mt } from "../ErrorNotice.js";
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 = {
1
+ import { jsxs as i, jsx as n, Fragment as Q } from "react/jsx-runtime";
2
+ import { useSensors as at, useSensor as _e, PointerSensor as it, KeyboardSensor as st, DndContext as Le, closestCenter as Ee } from "@dnd-kit/core";
3
+ import { sortableKeyboardCoordinates as ct, SortableContext as Me, verticalListSortingStrategy as Te, arrayMove as dt } from "@dnd-kit/sortable";
4
+ import { useQueryClient as ht } from "@tanstack/react-query";
5
+ import { Star as pt, Clock as ft, Link2 as mt, Database as ut, SearchX as gt } from "lucide-react";
6
+ import { useRef as E, useState as u, useEffect as le, useMemo as ae } from "react";
7
+ import { toast as ie } from "sonner";
8
+ import { ErrorNotice as bt } from "../ErrorNotice.js";
9
+ import { Skeleton as se } from "../ui/skeleton.js";
10
+ import { defaultCollectionPath as vt, HostLink as He, CollectionRow as yt, CollectionAvatar as kt } from "./CollectionRow.js";
11
+ import { CollectionsToolbar as wt } from "./CollectionsToolbar.js";
12
+ import { readLocal as De, useDirectoryCollections as xt, useOverviewStats as St, useLiveDirectory as Ct, useHeavyListFlags as Nt, useCollectionUsage as _t, useNavFavoriteCollections as Lt, writeLocal as Re, recordCollectionOpen as Ie, DIRECTORY_KEYS as ce } from "./directory-data.js";
13
+ import { PINNED_KEY as q, PinnedSection as Et } from "./PinnedSection.js";
14
+ import { buildPageModel as Mt, nearSpellings as Tt, label as y } from "./page-model.js";
15
+ import { SortableRow as Pe, Section as M, FolderHeader as F } from "./sections.js";
16
+ import { useSharedPins as Dt } from "./shared-pins.js";
17
+ const Oe = "nivaro_col_collapsed", Fe = "nvr_collections_prefs", T = "__loose__", N = "__links__", Rt = {
18
18
  view: "folders",
19
19
  density: "compact",
20
20
  showHidden: !1,
21
21
  showLinks: !1
22
- }, w = (c) => `cl-section-${c.replace(/[^A-Za-z0-9_-]/g, "_")}`;
23
- function Mt() {
22
+ }, x = (s) => `cl-section-${s.replace(/[^A-Za-z0-9_-]/g, "_")}`;
23
+ function Pt() {
24
24
  return /* @__PURE__ */ n(
25
25
  "div",
26
26
  {
@@ -28,61 +28,61 @@ function Mt() {
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((c) => /* @__PURE__ */ a(
31
+ children: ["a", "b", "c", "d", "e", "f", "g", "h"].map((s) => /* @__PURE__ */ i(
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(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" })
36
+ /* @__PURE__ */ n(se, { className: "h-6 w-6 rounded" }),
37
+ /* @__PURE__ */ n(se, { className: "h-3.5 w-48" }),
38
+ /* @__PURE__ */ n(se, { className: "ml-auto h-3 w-16" })
39
39
  ]
40
40
  },
41
- c
41
+ s
42
42
  ))
43
43
  }
44
44
  );
45
45
  }
46
- function Et() {
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(ht, { className: "h-5 w-5 text-slate-400" }) }),
46
+ function Ot() {
47
+ return /* @__PURE__ */ i("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(ut, { 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 Tt({
54
- filter: c,
55
- near: x,
53
+ function Ft({
54
+ filter: s,
55
+ near: S,
56
56
  pathFor: p,
57
- hiddenMatches: u,
58
- linkMatches: g,
59
- chipsOn: E,
57
+ hiddenMatches: g,
58
+ linkMatches: b,
59
+ chipsOn: D,
60
60
  onShowHidden: h,
61
61
  onShowLinks: U,
62
- onClearChips: F,
63
- onCreate: T
62
+ onClearChips: K,
63
+ onCreate: R
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
- return /* @__PURE__ */ a("div", { className: "flex flex-col items-center py-16 text-center", "data-collections-empty-search": !0, 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: [
66
+ return /* @__PURE__ */ i("div", { className: "flex flex-col items-center py-16 text-center", "data-collections-empty-search": !0, children: [
67
+ /* @__PURE__ */ n(gt, { 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__ */ i(Q, { children: [
69
69
  "No collection matches ",
70
- /* @__PURE__ */ a("span", { className: "font-mono", children: [
70
+ /* @__PURE__ */ i("span", { className: "font-mono", children: [
71
71
  "“",
72
- c,
72
+ s,
73
73
  "”"
74
74
  ] })
75
75
  ] }) : "No collection matches these filters" }),
76
- x.length > 0 && /* @__PURE__ */ a("p", { className: "mt-3 text-[12px] text-slate-600 dark:text-slate-300", children: [
76
+ S.length > 0 && /* @__PURE__ */ i("p", { className: "mt-3 text-[12px] text-slate-600 dark:text-slate-300", children: [
77
77
  "Did you mean",
78
78
  " ",
79
- x.map((C, S) => /* @__PURE__ */ a("span", { children: [
80
- S > 0 && (S === x.length - 1 ? " or " : ", "),
79
+ S.map((C, _) => /* @__PURE__ */ i("span", { children: [
80
+ _ > 0 && (_ === S.length - 1 ? " or " : ", "),
81
81
  /* @__PURE__ */ n(
82
- Pe,
82
+ He,
83
83
  {
84
84
  to: p(C.collection),
85
- onClick: () => Oe(C.collection),
85
+ onClick: () => Ie(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
  }
@@ -90,455 +90,475 @@ function Tt({
90
90
  ] }, C.collection)),
91
91
  "?"
92
92
  ] }),
93
- /* @__PURE__ */ a("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: [
94
- u > 0 && /* @__PURE__ */ a("button", { type: "button", className: t, onClick: h, children: [
95
- u,
93
+ /* @__PURE__ */ i("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: [
94
+ g > 0 && /* @__PURE__ */ i("button", { type: "button", className: t, onClick: h, children: [
95
+ g,
96
96
  " hidden",
97
97
  " ",
98
- u === 1 ? "collection matches" : "collections match",
98
+ g === 1 ? "collection matches" : "collections match",
99
99
  " — show hidden"
100
100
  ] }),
101
- g > 0 && /* @__PURE__ */ a("button", { type: "button", className: t, onClick: U, children: [
102
- g,
101
+ b > 0 && /* @__PURE__ */ i("button", { type: "button", className: t, onClick: U, children: [
102
+ b,
103
103
  " link ",
104
- g === 1 ? "table matches" : "tables match",
104
+ b === 1 ? "table matches" : "tables match",
105
105
  " — show link tables"
106
106
  ] }),
107
- E && /* @__PURE__ */ n("button", { type: "button", className: t, onClick: F, children: "Clear filters" }),
108
- T && /* @__PURE__ */ n("button", { type: "button", className: t, onClick: T, children: "Create a table" })
107
+ D && /* @__PURE__ */ n("button", { type: "button", className: t, onClick: K, children: "Clear filters" }),
108
+ R && /* @__PURE__ */ n("button", { type: "button", className: t, onClick: R, children: "Create a table" })
109
109
  ] })
110
110
  ] });
111
111
  }
112
- function Re({
113
- title: c,
114
- icon: x,
112
+ function Ke({
113
+ title: s,
114
+ icon: S,
115
115
  cols: p,
116
- empty: u,
117
- pathFor: g,
118
- ...E
116
+ empty: g,
117
+ pathFor: b,
118
+ ...D
119
119
  }) {
120
- return !p.length && !u ? null : /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", ...E, children: [
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
- x,
123
- c
120
+ return !p.length && !g ? null : /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", ...D, children: [
121
+ /* @__PURE__ */ i("span", { className: "mr-1 inline-flex items-center gap-1 text-[11px] font-medium text-slate-500 dark:text-slate-400", children: [
122
+ S,
123
+ s
124
124
  ] }),
125
- p.map((h) => /* @__PURE__ */ a(
126
- Pe,
125
+ p.map((h) => /* @__PURE__ */ i(
126
+ He,
127
127
  {
128
- to: g(h.collection),
129
- onClick: () => Oe(h.collection),
128
+ to: b(h.collection),
129
+ onClick: () => Ie(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(gt, { color: h.color, name: y(h), icon: h.icon }),
132
+ /* @__PURE__ */ n(kt, { 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
- !p.length && u
138
+ !p.length && g
139
139
  ] });
140
140
  }
141
- function Vt({
142
- isAdmin: c,
143
- title: x,
144
- collectionPath: p = ft,
145
- include: u,
146
- favorites: g,
147
- admin: E
141
+ function At({
142
+ isAdmin: s,
143
+ title: S,
144
+ collectionPath: p = vt,
145
+ include: g,
146
+ favorites: b,
147
+ admin: D
148
148
  }) {
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(() => ({
149
+ var Se, Ce, Ne;
150
+ const h = ht(), U = E(null), K = E(null), R = E(null), t = s ? D : void 0, C = !!(t != null && t.reorder), _ = !!(t != null && t.moveCollections && t.renderMoveDialog), [f, ze] = u(""), [H, Ye] = u(() => ({
151
+ ...Rt,
152
+ ...De(Fe, {})
153
+ })), [I, de] = u([]), [qe, Qe] = u(!1), [Ue, je] = u(!1), [j, z] = u(/* @__PURE__ */ new Set()), [$e, he] = u(!1), [$, Je] = u(() => ({
154
154
  [N]: !0,
155
155
  __unregistered__: !0,
156
156
  __system__: !0,
157
- ...Le(Te, {})
158
- })), s = {
159
- ...K,
157
+ ...De(Oe, {})
158
+ })), c = {
159
+ ...H,
160
160
  // Admin-only views fall back to Folders for everyone else.
161
- view: !c && (K.view === "records" || K.view === "recent") ? "folders" : K.view,
162
- chips: H,
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;
161
+ view: !s && (H.view === "records" || H.view === "recent") ? "folders" : H.view,
162
+ chips: I,
163
+ arranging: C && qe,
164
+ selecting: _ && Ue
165
+ }, { data: P, isLoading: Ve, isError: Be, error: Ge, refetch: Xe } = xt(), pe = E(g);
166
+ pe.current = g;
167
+ const fe = (e) => {
168
+ const o = pe.current;
169
169
  return o ? e.filter(o) : e;
170
- }, [J, V] = v([]);
171
- _e(() => {
172
- D && V(he(D));
173
- }, [D]);
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
- const e = F.current, o = T.current;
170
+ }, [J, V] = u([]);
171
+ le(() => {
172
+ P && V(fe(P));
173
+ }, [P]);
174
+ const { data: k } = St(s);
175
+ Ct(s);
176
+ const [me, ue] = u(k), B = E(!1), ge = E(k);
177
+ ge.current = k, le(() => {
178
+ B.current || ue(k);
179
+ }, [k]);
180
+ const { data: G } = Nt(s), X = _t(), Ze = Lt(!b), { favorite: Z, toggle: Ae } = b ?? Ze, v = Dt(), A = ae(() => new Set(v.pins), [v.pins]), l = ae(
181
+ () => Mt(J, me, c, f, X),
182
+ [J, me, f, X, c.view, c.chips, c.showHidden, c.showLinks]
183
+ ), W = ae(() => new Map(l.real.map((e) => [e.collection, e])), [l.real]);
184
+ le(() => {
185
+ const e = K.current, o = R.current;
180
186
  if (!e || !o) return;
181
- const i = () => o.style.setProperty(
187
+ const a = () => o.style.setProperty(
182
188
  "--cl-toolbar-h",
183
189
  `${getComputedStyle(e).position === "sticky" ? e.offsetHeight : 0}px`
184
190
  );
185
- i(), window.addEventListener("resize", i);
186
- const r = typeof ResizeObserver > "u" ? null : new ResizeObserver(i);
191
+ a(), window.addEventListener("resize", a);
192
+ const r = typeof ResizeObserver > "u" ? null : new ResizeObserver(a);
187
193
  return r == null || r.observe(e), () => {
188
- window.removeEventListener("resize", i), r == null || r.disconnect();
194
+ window.removeEventListener("resize", a), r == null || r.disconnect();
189
195
  };
190
196
  }, []);
191
- const W = (e) => {
197
+ const ee = (e) => {
192
198
  const o = {
193
199
  view: e.view,
194
200
  density: e.density,
195
201
  showHidden: e.showHidden,
196
202
  showLinks: e.showLinks
197
203
  };
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
- const i = { ...o, [e]: !o[e] };
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
- var i;
204
+ Ye(o), Re(Fe, o), de(e.chips), Qe(e.arranging), je(e.selecting), e.selecting || z(/* @__PURE__ */ new Set());
205
+ }, L = (e) => Je((o) => {
206
+ const a = { ...o, [e]: !o[e] };
207
+ return Re(Oe, a), a;
208
+ }), te = () => {
209
+ h.invalidateQueries({ queryKey: ce.collections }), h.invalidateQueries({ queryKey: ce.stats });
210
+ }, be = t == null ? void 0 : t.moveCollections, ve = be ? async (e, o) => {
211
+ var a;
206
212
  try {
207
- await pe([e.collection], o);
208
- const r = o ? ((i = l.folders.find((d) => d.key === o)) == null ? void 0 : i.label) ?? o : "no folder";
209
- le.success(`Moved ${y(e)} to ${r}`), ee();
213
+ await be([e.collection], o);
214
+ const r = o ? ((a = l.folders.find((d) => d.key === o)) == null ? void 0 : a.label) ?? o : "no folder";
215
+ ie.success(`Moved ${y(e)} to ${r}`), te();
210
216
  } catch {
211
- le.error(`Could not move ${y(e)}`);
217
+ ie.error(`Could not move ${y(e)}`);
212
218
  }
213
- } : void 0, fe = nt(
214
- we(ot, { activationConstraint: { distance: 8 } }),
215
- we(rt, { coordinateGetter: lt })
216
- ), Be = (e) => {
219
+ } : void 0, ye = at(
220
+ _e(it, { activationConstraint: { distance: 8 } }),
221
+ _e(st, { coordinateGetter: ct })
222
+ ), We = (e) => {
217
223
  const o = t == null ? void 0 : t.reorder;
218
224
  if (!o) return;
219
- const i = new Map(e.map((r) => [r.collection, r.sort]));
225
+ const a = new Map(e.map((r) => [r.collection, r.sort]));
220
226
  V(
221
227
  (r) => r.map((d) => {
222
- const f = i.get(d.collection);
223
- return f === void 0 ? d : { ...d, sort: f };
228
+ const m = a.get(d.collection);
229
+ return m === void 0 ? d : { ...d, sort: m };
224
230
  })
225
231
  ), o(e).catch(() => {
226
- le.error("Could not save the new order"), D && V(he(D)), h.invalidateQueries({ queryKey: ae.collections });
232
+ ie.error("Could not save the new order"), P && V(fe(P)), h.invalidateQueries({ queryKey: ce.collections });
227
233
  });
228
- }, ue = (e, o) => {
229
- const { active: i, over: r } = o;
230
- if (!r || i.id === r.id) return;
231
- const d = e.indexOf(String(i.id)), f = e.indexOf(String(r.id));
232
- d === -1 || f === -1 || Be(
233
- it(e, d, f).map((et, tt) => ({ collection: et, sort: (tt + 1) * 10 }))
234
+ }, ke = (e, o) => {
235
+ const { active: a, over: r } = o;
236
+ if (!r || a.id === r.id) return;
237
+ const d = e.indexOf(String(a.id)), m = e.indexOf(String(r.id));
238
+ d === -1 || m === -1 || We(
239
+ dt(e, d, m).map((rt, lt) => ({ collection: rt, sort: (lt + 1) * 10 }))
234
240
  );
235
- }, te = (e, o, i) => {
241
+ }, ne = (e, o, a) => {
236
242
  var r;
237
243
  return /* @__PURE__ */ n(
238
- ut,
244
+ yt,
239
245
  {
240
246
  col: e,
241
- stat: R == null ? void 0 : R[e.collection],
242
- heavyList: c ? A == null ? void 0 : A[e.collection] : void 0,
243
- density: s.density,
244
- favorite: G.has(e.collection),
247
+ stat: k == null ? void 0 : k[e.collection],
248
+ heavyList: s ? G == null ? void 0 : G[e.collection] : void 0,
249
+ density: c.density,
250
+ favorite: Z.has(e.collection),
245
251
  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,
248
- onMoveUp: i == null ? void 0 : i.onMoveUp,
249
- onMoveDown: i == null ? void 0 : i.onMoveDown,
250
- quietPin: i == null ? void 0 : i.inPinned,
252
+ pinnedForAll: A.has(e.collection),
253
+ onTogglePinned: s ? () => void (A.has(e.collection) ? v.unpin(e.collection, y(e)) : v.pin(e.collection, y(e))) : void 0,
254
+ onMoveUp: a == null ? void 0 : a.onMoveUp,
255
+ onMoveDown: a == null ? void 0 : a.onMoveDown,
256
+ quietPin: a == null ? void 0 : a.inPinned,
251
257
  folders: l.folders,
252
- onMove: me ? (d) => void me(e, d) : void 0,
258
+ onMove: ve ? (d) => void ve(e, d) : void 0,
253
259
  recordsPath: p(e.collection),
254
260
  editPath: (r = t == null ? void 0 : t.editPath) == null ? void 0 : r.call(t, e.collection),
255
261
  menuExtra: t != null && t.rowMenu ? { heading: t.rowMenu.heading, items: t.rowMenu.items(e.collection) } : void 0,
256
- selecting: s.selecting,
262
+ selecting: c.selecting,
257
263
  selected: j.has(e.collection),
258
- onSelect: () => I((d) => {
259
- const f = new Set(d);
260
- return f.has(e.collection) ? f.delete(e.collection) : f.add(e.collection), f;
264
+ onSelect: () => z((d) => {
265
+ const m = new Set(d);
266
+ return m.has(e.collection) ? m.delete(e.collection) : m.add(e.collection), m;
261
267
  }),
262
268
  dragHandle: o,
263
- highlight: m,
264
- isAdmin: c
269
+ highlight: f,
270
+ isAdmin: s
265
271
  }
266
272
  );
267
- }, P = (e, o) => {
273
+ }, O = (e, o) => {
268
274
  if (!o)
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)) });
270
- const i = e.map((r) => r.collection);
275
+ return /* @__PURE__ */ n("div", { className: "divide-y divide-slate-100 dark:divide-white/[0.05]", children: e.map((r) => /* @__PURE__ */ n("div", { children: ne(r) }, r.collection)) });
276
+ const a = e.map((r) => r.collection);
271
277
  return /* @__PURE__ */ n(
272
- xe,
278
+ Le,
273
279
  {
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)) }) })
280
+ sensors: ye,
281
+ collisionDetection: Ee,
282
+ onDragEnd: (r) => ke(a, r),
283
+ children: /* @__PURE__ */ n(Me, { items: a, strategy: Te, children: /* @__PURE__ */ n("div", { className: "divide-y divide-slate-100 dark:divide-white/[0.05]", children: e.map((r) => /* @__PURE__ */ n(Pe, { id: r.collection, label: y(r), children: (d) => ne(r, d) }, r.collection)) }) })
278
284
  }
279
285
  );
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 }] : [],
286
+ }, we = !!f.trim() || I.length > 0, w = (e) => we || !$[e], Y = c.view === "folders", oe = !we && !c.arranging && !c.selecting, et = Y && oe, re = v.pins.map((e) => W.get(e)).filter((e) => !!e), tt = [...Z].map((e) => W.get(e)).filter((e) => !!e), nt = X.recent.filter((e) => !Z.has(e) && !A.has(e)).map((e) => W.get(e)).filter((e) => !!e).slice(0, 6), ot = !!(t != null && t.renderSuggestions) && Y && !f && !I.length && !c.arranging, xe = Y ? [
287
+ ...oe && re.length > 0 ? [{ key: q, label: "Pinned", count: re.length }] : [],
282
288
  ...l.sections.map((e) => ({
283
289
  key: e.folder.key,
284
290
  label: e.folder.label,
285
291
  count: e.cols.length
286
292
  })),
287
- ...l.loose.length ? [{ key: M, label: "Not in a folder", count: l.loose.length }] : [],
293
+ ...l.loose.length ? [{ key: T, label: "Not in a folder", count: l.loose.length }] : [],
288
294
  ...l.linkTables.length ? [{ key: N, label: "Link tables", count: l.linkTables.length }] : []
289
295
  ] : [];
290
296
  return (
291
297
  // Grows with its content (shrink-0): the sticky toolbar only sticks inside this
292
298
  // box, so a viewport-tall box let it scroll away and left the folder headers
293
299
  // stuck below an empty gap.
294
- /* @__PURE__ */ a("div", { ref: T, className: "flex min-h-full shrink-0 flex-col", "data-collections-directory": !0, children: [
295
- /* @__PURE__ */ n(
296
- "div",
297
- {
298
- ref: F,
299
- "data-cdr": "",
300
- className: "z-10 md:[&[data-cdr]]:sticky md:[&[data-cdr]]:top-0",
301
- children: /* @__PURE__ */ n(
302
- bt,
303
- {
304
- state: s,
305
- onChange: W,
306
- filter: m,
307
- onFilterChange: Fe,
308
- filterRef: U,
309
- counts: l.counts,
310
- isAdmin: c,
311
- title: x,
312
- canArrange: C,
313
- canSelect: S,
314
- selectedCount: j.size,
315
- onMoveSelected: () => se(!0),
316
- onClearSelection: () => I(/* @__PURE__ */ new Set()),
317
- adminActions: (t == null ? void 0 : t.toolbarActions) ?? null
318
- }
319
- )
320
- }
321
- ),
322
- /* @__PURE__ */ a("div", { "data-cdr": "", className: "flex gap-6 px-4 py-6 sm:[&[data-cdr]]:px-8", children: [
323
- /* @__PURE__ */ a("div", { className: "min-w-0 flex-1 space-y-4", children: [
324
- t == null ? void 0 : t.panels,
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,
300
+ /* @__PURE__ */ i(
301
+ "div",
302
+ {
303
+ ref: R,
304
+ className: "flex min-h-full shrink-0 flex-col",
305
+ "data-collections-directory": !0,
306
+ onPointerEnter: () => {
307
+ B.current = !0;
308
+ },
309
+ onPointerLeave: () => {
310
+ B.current = !1, ue(ge.current);
311
+ },
312
+ children: [
313
+ /* @__PURE__ */ n(
314
+ "div",
327
315
  {
328
- filter: m.trim(),
329
- near: m.trim() ? St(m, l.real) : [],
330
- pathFor: p,
331
- hiddenMatches: l.foldedMatches.hidden.length,
332
- linkMatches: l.foldedMatches.links.length,
333
- chipsOn: H.length > 0,
334
- onShowHidden: () => W({ ...s, showHidden: !0 }),
335
- onShowLinks: () => W({ ...s, showLinks: !0 }),
336
- onClearChips: () => ce([]),
337
- onCreate: t == null ? void 0 : t.onCreate
338
- }
339
- ) : /* @__PURE__ */ a(Q, { children: [
340
- ne && /* @__PURE__ */ n(
341
- Ct,
342
- {
343
- sectionId: w(q),
344
- cols: oe,
345
- isAdmin: c,
346
- status: b.status,
347
- error: b.error,
348
- onRetry: () => void b.refetch(),
349
- onReorder: (e) => void b.reorder(e),
350
- collapsed: !!$[q],
351
- onToggle: () => _(q),
352
- renderRow: (e, o) => te(e, o.handle, {
353
- onMoveUp: o.onMoveUp,
354
- onMoveDown: o.onMoveDown,
355
- inPinned: !0
356
- })
357
- }
358
- ),
359
- Ge && /* @__PURE__ */ a("div", { className: "space-y-2", "data-collections-quick": !0, children: [
360
- /* @__PURE__ */ n(
361
- Re,
362
- {
363
- "data-collections-favorites": !0,
364
- title: "My favorites",
365
- icon: /* @__PURE__ */ n(ct, { className: "h-3 w-3 fill-current" }),
366
- cols: Xe,
367
- pathFor: p,
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." })
369
- }
370
- ),
371
- /* @__PURE__ */ n(
372
- Re,
316
+ ref: K,
317
+ "data-cdr": "",
318
+ className: "z-10 md:[&[data-cdr]]:sticky md:[&[data-cdr]]:top-0",
319
+ children: /* @__PURE__ */ n(
320
+ wt,
373
321
  {
374
- "data-collections-recent": !0,
375
- title: "Recent",
376
- icon: /* @__PURE__ */ n(st, { className: "h-3 w-3" }),
377
- cols: Ze,
378
- pathFor: p
322
+ state: c,
323
+ onChange: ee,
324
+ filter: f,
325
+ onFilterChange: ze,
326
+ filterRef: U,
327
+ counts: l.counts,
328
+ isAdmin: s,
329
+ title: S,
330
+ canArrange: C,
331
+ canSelect: _,
332
+ selectedCount: j.size,
333
+ onMoveSelected: () => he(!0),
334
+ onClearSelection: () => z(/* @__PURE__ */ new Set()),
335
+ adminActions: (t == null ? void 0 : t.toolbarActions) ?? null
379
336
  }
380
337
  )
381
- ] }),
382
- We && ((ve = t == null ? void 0 : t.renderSuggestions) == null ? void 0 : ve.call(t, {
383
- real: l.real,
384
- folders: l.folders,
385
- refresh: ee
386
- })),
387
- z ? /* @__PURE__ */ a(Q, { children: [
388
- s.arranging ? /* @__PURE__ */ n(
389
- xe,
338
+ }
339
+ ),
340
+ /* @__PURE__ */ i("div", { "data-cdr": "", className: "flex gap-6 px-4 py-6 sm:[&[data-cdr]]:px-8", children: [
341
+ /* @__PURE__ */ i("div", { className: "min-w-0 flex-1 space-y-4", children: [
342
+ t == null ? void 0 : t.panels,
343
+ Ve ? /* @__PURE__ */ n(Pt, {}) : Be && J.length === 0 ? /* @__PURE__ */ n(bt, { error: Ge, what: "the collections", onRetry: () => void Xe() }) : l.real.length === 0 ? /* @__PURE__ */ n(Ot, {}) : l.shownCount === 0 && l.linkTables.length === 0 ? /* @__PURE__ */ n(
344
+ Ft,
390
345
  {
391
- sensors: fe,
392
- collisionDetection: Ce,
393
- onDragEnd: (e) => ue(
394
- l.sections.map((o) => o.folder.key),
395
- e
396
- ),
397
- children: /* @__PURE__ */ n(
398
- Ne,
399
- {
400
- items: l.sections.map((e) => e.folder.key),
401
- strategy: Se,
402
- children: /* @__PURE__ */ n("div", { className: "space-y-4", children: l.sections.map((e) => /* @__PURE__ */ n(
403
- Ee,
404
- {
405
- id: e.folder.key,
406
- label: e.folder.label,
407
- children: (o) => /* @__PURE__ */ a(L, { id: w(e.folder.key), children: [
408
- /* @__PURE__ */ n(
409
- O,
410
- {
411
- folder: e.folder,
412
- count: e.cols.length,
413
- hiddenCount: e.hiddenCount,
414
- collapsed: !k(e.folder.key),
415
- onToggle: () => _(e.folder.key),
416
- dragHandle: o
417
- }
418
- ),
419
- k(e.folder.key) && P(e.cols, !0)
420
- ] })
421
- },
422
- e.folder.key
423
- )) })
424
- }
425
- )
346
+ filter: f.trim(),
347
+ near: f.trim() ? Tt(f, l.real) : [],
348
+ pathFor: p,
349
+ hiddenMatches: l.foldedMatches.hidden.length,
350
+ linkMatches: l.foldedMatches.links.length,
351
+ chipsOn: I.length > 0,
352
+ onShowHidden: () => ee({ ...c, showHidden: !0 }),
353
+ onShowLinks: () => ee({ ...c, showLinks: !0 }),
354
+ onClearChips: () => de([]),
355
+ onCreate: t == null ? void 0 : t.onCreate
426
356
  }
427
- ) : l.sections.map((e) => /* @__PURE__ */ a(L, { id: w(e.folder.key), children: [
428
- /* @__PURE__ */ n(
429
- O,
357
+ ) : /* @__PURE__ */ i(Q, { children: [
358
+ oe && /* @__PURE__ */ n(
359
+ Et,
430
360
  {
431
- folder: e.folder,
432
- count: e.cols.length,
433
- hiddenCount: e.hiddenCount,
434
- collapsed: !k(e.folder.key),
435
- onToggle: () => _(e.folder.key)
361
+ sectionId: x(q),
362
+ cols: re,
363
+ isAdmin: s,
364
+ status: v.status,
365
+ error: v.error,
366
+ onRetry: () => void v.refetch(),
367
+ onReorder: (e) => void v.reorder(e),
368
+ collapsed: !!$[q],
369
+ onToggle: () => L(q),
370
+ renderRow: (e, o) => ne(e, o.handle, {
371
+ onMoveUp: o.onMoveUp,
372
+ onMoveDown: o.onMoveDown,
373
+ inPinned: !0
374
+ })
436
375
  }
437
376
  ),
438
- k(e.folder.key) && P(e.cols, !1)
439
- ] }, e.folder.key)),
440
- l.loose.length > 0 && /* @__PURE__ */ a(L, { id: w(M), children: [
441
- /* @__PURE__ */ n(
442
- O,
443
- {
444
- folder: { key: M, label: "Not in a folder", color: "#94a3b8" },
445
- count: l.loose.length,
446
- hiddenCount: 0,
447
- collapsed: !k(M),
448
- onToggle: () => _(M)
449
- }
450
- ),
451
- k(M) && P(l.loose, !1)
452
- ] })
453
- ] }) : /* @__PURE__ */ n(L, { id: w("flat"), children: P(l.flat, !1) }),
454
- l.linkTables.length > 0 && /* @__PURE__ */ a(L, { id: w(N), children: [
455
- /* @__PURE__ */ n(
456
- O,
457
- {
458
- folder: { key: N, label: "Link tables", color: "#64748b" },
459
- icon: /* @__PURE__ */ n(dt, { className: "h-3 w-3 text-slate-500 dark:text-slate-400" }),
460
- count: l.linkTables.length,
461
- hiddenCount: 0,
462
- collapsed: !k(N),
463
- onToggle: () => _(N)
464
- }
465
- ),
466
- k(N) && /* @__PURE__ */ a(Q, { children: [
467
- /* @__PURE__ */ n("p", { className: "border-b border-slate-100 px-4 py-1.5 text-[11.5px] text-slate-500 dark:border-white/[0.05] dark:text-slate-400", children: "Tables that only connect two collections (many-to-many). Turn on “Show link tables” to list them in their folders." }),
468
- P(l.linkTables, !1)
377
+ et && /* @__PURE__ */ i("div", { className: "space-y-2", "data-collections-quick": !0, children: [
378
+ /* @__PURE__ */ n(
379
+ Ke,
380
+ {
381
+ "data-collections-favorites": !0,
382
+ title: "My favorites",
383
+ icon: /* @__PURE__ */ n(pt, { className: "h-3 w-3 fill-current" }),
384
+ cols: tt,
385
+ pathFor: p,
386
+ empty: /* @__PURE__ */ n("span", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: b ? "Star a collection to keep it here and in your sidebar." : "Star a collection to keep it here." })
387
+ }
388
+ ),
389
+ /* @__PURE__ */ n(
390
+ Ke,
391
+ {
392
+ "data-collections-recent": !0,
393
+ title: "Recent",
394
+ icon: /* @__PURE__ */ n(ft, { className: "h-3 w-3" }),
395
+ cols: nt,
396
+ pathFor: p
397
+ }
398
+ )
399
+ ] }),
400
+ ot && ((Se = t == null ? void 0 : t.renderSuggestions) == null ? void 0 : Se.call(t, {
401
+ real: l.real,
402
+ folders: l.folders,
403
+ refresh: te
404
+ })),
405
+ Y ? /* @__PURE__ */ i(Q, { children: [
406
+ c.arranging ? /* @__PURE__ */ n(
407
+ Le,
408
+ {
409
+ sensors: ye,
410
+ collisionDetection: Ee,
411
+ onDragEnd: (e) => ke(
412
+ l.sections.map((o) => o.folder.key),
413
+ e
414
+ ),
415
+ children: /* @__PURE__ */ n(
416
+ Me,
417
+ {
418
+ items: l.sections.map((e) => e.folder.key),
419
+ strategy: Te,
420
+ children: /* @__PURE__ */ n("div", { className: "space-y-4", children: l.sections.map((e) => /* @__PURE__ */ n(
421
+ Pe,
422
+ {
423
+ id: e.folder.key,
424
+ label: e.folder.label,
425
+ children: (o) => /* @__PURE__ */ i(M, { id: x(e.folder.key), children: [
426
+ /* @__PURE__ */ n(
427
+ F,
428
+ {
429
+ folder: e.folder,
430
+ count: e.cols.length,
431
+ hiddenCount: e.hiddenCount,
432
+ collapsed: !w(e.folder.key),
433
+ onToggle: () => L(e.folder.key),
434
+ dragHandle: o
435
+ }
436
+ ),
437
+ w(e.folder.key) && O(e.cols, !0)
438
+ ] })
439
+ },
440
+ e.folder.key
441
+ )) })
442
+ }
443
+ )
444
+ }
445
+ ) : l.sections.map((e) => /* @__PURE__ */ i(M, { id: x(e.folder.key), children: [
446
+ /* @__PURE__ */ n(
447
+ F,
448
+ {
449
+ folder: e.folder,
450
+ count: e.cols.length,
451
+ hiddenCount: e.hiddenCount,
452
+ collapsed: !w(e.folder.key),
453
+ onToggle: () => L(e.folder.key)
454
+ }
455
+ ),
456
+ w(e.folder.key) && O(e.cols, !1)
457
+ ] }, e.folder.key)),
458
+ l.loose.length > 0 && /* @__PURE__ */ i(M, { id: x(T), children: [
459
+ /* @__PURE__ */ n(
460
+ F,
461
+ {
462
+ folder: { key: T, label: "Not in a folder", color: "#94a3b8" },
463
+ count: l.loose.length,
464
+ hiddenCount: 0,
465
+ collapsed: !w(T),
466
+ onToggle: () => L(T)
467
+ }
468
+ ),
469
+ w(T) && O(l.loose, !1)
470
+ ] })
471
+ ] }) : /* @__PURE__ */ n(M, { id: x("flat"), children: O(l.flat, !1) }),
472
+ l.linkTables.length > 0 && /* @__PURE__ */ i(M, { id: x(N), children: [
473
+ /* @__PURE__ */ n(
474
+ F,
475
+ {
476
+ folder: { key: N, label: "Link tables", color: "#64748b" },
477
+ icon: /* @__PURE__ */ n(mt, { className: "h-3 w-3 text-slate-500 dark:text-slate-400" }),
478
+ count: l.linkTables.length,
479
+ hiddenCount: 0,
480
+ collapsed: !w(N),
481
+ onToggle: () => L(N)
482
+ }
483
+ ),
484
+ w(N) && /* @__PURE__ */ i(Q, { children: [
485
+ /* @__PURE__ */ n("p", { className: "border-b border-slate-100 px-4 py-1.5 text-[11.5px] text-slate-500 dark:border-white/[0.05] dark:text-slate-400", children: "Tables that only connect two collections (many-to-many). Turn on “Show link tables” to list them in their folders." }),
486
+ O(l.linkTables, !1)
487
+ ] })
488
+ ] }),
489
+ (Ce = t == null ? void 0 : t.renderExtraSections) == null ? void 0 : Ce.call(t, {
490
+ filter: f,
491
+ collapsed: $,
492
+ onToggle: L,
493
+ renderSection: (e) => /* @__PURE__ */ i(M, { id: x(e.key), children: [
494
+ /* @__PURE__ */ n(
495
+ F,
496
+ {
497
+ folder: { key: e.key, label: e.label, color: "#94a3b8" },
498
+ icon: e.icon,
499
+ count: e.count,
500
+ hiddenCount: 0,
501
+ collapsed: !e.open,
502
+ onToggle: e.onToggle
503
+ }
504
+ ),
505
+ e.open && e.body
506
+ ] }, e.key)
507
+ })
469
508
  ] })
470
509
  ] }),
471
- (ye = t == null ? void 0 : t.renderExtraSections) == null ? void 0 : ye.call(t, {
472
- filter: m,
473
- collapsed: $,
474
- onToggle: _,
475
- renderSection: (e) => /* @__PURE__ */ a(L, { id: w(e.key), children: [
476
- /* @__PURE__ */ n(
477
- O,
510
+ xe.length > 2 && /* @__PURE__ */ n(
511
+ "nav",
512
+ {
513
+ "aria-label": "Jump to folder",
514
+ "data-cdr": "",
515
+ className: "hidden w-44 shrink-0 xl:[&[data-cdr]]:block",
516
+ children: /* @__PURE__ */ i(
517
+ "div",
478
518
  {
479
- folder: { key: e.key, label: e.label, color: "#94a3b8" },
480
- icon: e.icon,
481
- count: e.count,
482
- hiddenCount: 0,
483
- collapsed: !e.open,
484
- onToggle: e.onToggle
519
+ className: "sticky space-y-0.5",
520
+ style: { top: "calc(var(--cl-toolbar-h, 0px) + 24px)" },
521
+ children: [
522
+ /* @__PURE__ */ n("p", { className: "px-2 pb-1 text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Jump to" }),
523
+ xe.map((e) => /* @__PURE__ */ i(
524
+ "button",
525
+ {
526
+ type: "button",
527
+ onClick: () => {
528
+ var o;
529
+ return (o = document.getElementById(x(e.key))) == null ? void 0 : o.scrollIntoView({
530
+ behavior: window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth",
531
+ block: "start"
532
+ });
533
+ },
534
+ className: "flex w-full items-center gap-2 rounded px-2 py-1 text-left text-[12px] text-slate-600 transition-colors hover:bg-slate-100 hover:text-slate-900 dark:text-slate-300 dark:hover:bg-white/[0.05] dark:hover:text-slate-100",
535
+ children: [
536
+ /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate", children: e.label }),
537
+ /* @__PURE__ */ n("span", { className: "text-[11px] tabular-nums text-slate-500 dark:text-slate-400", children: e.count })
538
+ ]
539
+ },
540
+ e.key
541
+ ))
542
+ ]
485
543
  }
486
- ),
487
- e.open && e.body
488
- ] }, e.key)
489
- })
490
- ] })
491
- ] }),
492
- be.length > 2 && /* @__PURE__ */ n(
493
- "nav",
494
- {
495
- "aria-label": "Jump to folder",
496
- "data-cdr": "",
497
- className: "hidden w-44 shrink-0 xl:[&[data-cdr]]:block",
498
- children: /* @__PURE__ */ a(
499
- "div",
500
- {
501
- className: "sticky space-y-0.5",
502
- style: { top: "calc(var(--cl-toolbar-h, 0px) + 24px)" },
503
- children: [
504
- /* @__PURE__ */ n("p", { className: "px-2 pb-1 text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Jump to" }),
505
- be.map((e) => /* @__PURE__ */ a(
506
- "button",
507
- {
508
- type: "button",
509
- onClick: () => {
510
- var o;
511
- return (o = document.getElementById(w(e.key))) == null ? void 0 : o.scrollIntoView({
512
- behavior: window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth",
513
- block: "start"
514
- });
515
- },
516
- className: "flex w-full items-center gap-2 rounded px-2 py-1 text-left text-[12px] text-slate-600 transition-colors hover:bg-slate-100 hover:text-slate-900 dark:text-slate-300 dark:hover:bg-white/[0.05] dark:hover:text-slate-100",
517
- children: [
518
- /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate", children: e.label }),
519
- /* @__PURE__ */ n("span", { className: "text-[11px] tabular-nums text-slate-500 dark:text-slate-400", children: e.count })
520
- ]
521
- },
522
- e.key
523
- ))
524
- ]
544
+ )
525
545
  }
526
546
  )
527
- }
528
- )
529
- ] }),
530
- S && ((ke = t == null ? void 0 : t.renderMoveDialog) == null ? void 0 : ke.call(t, {
531
- open: qe,
532
- onOpenChange: se,
533
- names: [...j],
534
- folders: l.folders,
535
- onMoved: () => {
536
- I(/* @__PURE__ */ new Set()), ee();
537
- }
538
- }))
539
- ] })
547
+ ] }),
548
+ _ && ((Ne = t == null ? void 0 : t.renderMoveDialog) == null ? void 0 : Ne.call(t, {
549
+ open: $e,
550
+ onOpenChange: he,
551
+ names: [...j],
552
+ folders: l.folders,
553
+ onMoved: () => {
554
+ z(/* @__PURE__ */ new Set()), te();
555
+ }
556
+ }))
557
+ ]
558
+ }
559
+ )
540
560
  );
541
561
  }
542
562
  export {
543
- Vt as CollectionsDirectory
563
+ At as CollectionsDirectory
544
564
  };