@powerhousedao/design-system 6.2.3-dev.60 → 6.2.3-dev.62

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 (144) hide show
  1. package/dist/PinFilled-cSbUqZCA.js +41 -0
  2. package/dist/PinFilled-cSbUqZCA.js.map +1 -0
  3. package/dist/add-local-drive-form.impl-B5rVul7f.js +75 -0
  4. package/dist/add-local-drive-form.impl-B5rVul7f.js.map +1 -0
  5. package/dist/add-remote-drive-form.impl-D7zuqHJC.js +114 -0
  6. package/dist/add-remote-drive-form.impl-D7zuqHJC.js.map +1 -0
  7. package/dist/address-DsZy0bjk.js +92 -0
  8. package/dist/address-DsZy0bjk.js.map +1 -0
  9. package/dist/{checkbox-BmTXBcCE.d.ts → checkbox-DmRYkN10.d.ts} +2 -2
  10. package/dist/{checkbox-BmTXBcCE.d.ts.map → checkbox-DmRYkN10.d.ts.map} +1 -1
  11. package/dist/combobox.impl-C2oszOl2.js +144 -0
  12. package/dist/combobox.impl-C2oszOl2.js.map +1 -0
  13. package/dist/connect/components/toast/toast.js +2 -2
  14. package/dist/connect/index.d.ts +81 -33
  15. package/dist/connect/index.d.ts.map +1 -1
  16. package/dist/connect/index.js +184 -1608
  17. package/dist/connect/index.js.map +1 -1
  18. package/dist/{content-BMXLcwWY.d.ts → content-L3OINRSY.d.ts} +2 -2
  19. package/dist/{content-BMXLcwWY.d.ts.map → content-L3OINRSY.d.ts.map} +1 -1
  20. package/dist/default-editor.impl-a6EOuEme.js +30 -0
  21. package/dist/default-editor.impl-a6EOuEme.js.map +1 -0
  22. package/dist/document-timeline.impl-DRmIHFaI.js +254 -0
  23. package/dist/document-timeline.impl-DRmIHFaI.js.map +1 -0
  24. package/dist/drive-settings-form.impl-4yBGaTxe.js +171 -0
  25. package/dist/drive-settings-form.impl-4yBGaTxe.js.map +1 -0
  26. package/dist/{enum-field-qgV9wsyI.d.ts → enum-field-CSeQE4Ss.d.ts} +3 -3
  27. package/dist/{enum-field-qgV9wsyI.d.ts.map → enum-field-CSeQE4Ss.d.ts.map} +1 -1
  28. package/dist/formatted-json-viewer.impl-C198BZt5.js +58 -0
  29. package/dist/formatted-json-viewer.impl-C198BZt5.js.map +1 -0
  30. package/dist/icon-CR_tC1gc.js +358 -0
  31. package/dist/icon-CR_tC1gc.js.map +1 -0
  32. package/dist/{icon-01W_S_9A.js → icon-components-BZ_bQZmJ.js} +5 -479
  33. package/dist/icon-components-BZ_bQZmJ.js.map +1 -0
  34. package/dist/{id-autocomplete-CHvGhffo.d.ts → id-autocomplete-0bhU6VQG.d.ts} +2 -2
  35. package/dist/id-autocomplete-0bhU6VQG.d.ts.map +1 -0
  36. package/dist/{id-autocomplete-input-container-BqRQGpcs.d.ts → id-autocomplete-input-container-xg9lrpSK.d.ts} +2 -2
  37. package/dist/{id-autocomplete-input-container-BqRQGpcs.d.ts.map → id-autocomplete-input-container-xg9lrpSK.d.ts.map} +1 -1
  38. package/dist/{id-autocomplete-list-ChQsiJDg.d.ts → id-autocomplete-list-Da3FbpJ1.d.ts} +2 -2
  39. package/dist/{id-autocomplete-list-ChQsiJDg.d.ts.map → id-autocomplete-list-Da3FbpJ1.d.ts.map} +1 -1
  40. package/dist/{id-autocomplete-list-option-MsqKeLXD.d.ts → id-autocomplete-list-option-D7JgEK6E.d.ts} +3 -2
  41. package/dist/id-autocomplete-list-option-D7JgEK6E.d.ts.map +1 -0
  42. package/dist/index-C-Tup7Br.d.ts +4 -0
  43. package/dist/{index-C05uhexJ.d.ts → index-D99twPFI.d.ts} +6 -15
  44. package/dist/index-D99twPFI.d.ts.map +1 -0
  45. package/dist/index-D9nAoDks.d.ts +30 -0
  46. package/dist/index-FfMAMBu7.d.ts +3 -0
  47. package/dist/index-jfVVOU-H.d.ts +2 -0
  48. package/dist/index.d.ts +2 -1
  49. package/dist/index.js +2 -2
  50. package/dist/label-nH2HoKfI.js +15 -0
  51. package/dist/label-nH2HoKfI.js.map +1 -0
  52. package/dist/location-info-C3YbSsV0.js +47 -0
  53. package/dist/location-info-C3YbSsV0.js.map +1 -0
  54. package/dist/{radio-group-field-CjX_Zt0C.d.ts → radio-group-field-Bsf4waat.d.ts} +2 -2
  55. package/dist/{radio-group-field-CjX_Zt0C.d.ts.map → radio-group-field-Bsf4waat.d.ts.map} +1 -1
  56. package/dist/revision-history.impl-uogo6xDI.js +638 -0
  57. package/dist/revision-history.impl-uogo6xDI.js.map +1 -0
  58. package/dist/{select-field-BuXjM43L.d.ts → select-field-DbFd1YiC.d.ts} +2 -2
  59. package/dist/{select-field-BuXjM43L.d.ts.map → select-field-DbFd1YiC.d.ts.map} +1 -1
  60. package/dist/{selected-content-C49jmTLU.d.ts → selected-content-VMVPoru4.d.ts} +2 -2
  61. package/dist/{selected-content-C49jmTLU.d.ts.map → selected-content-VMVPoru4.d.ts.map} +1 -1
  62. package/dist/{sidebar-4juLhREX.d.ts → sidebar-DFqreKf1.d.ts} +2 -2
  63. package/dist/{sidebar-4juLhREX.d.ts.map → sidebar-DFqreKf1.d.ts.map} +1 -1
  64. package/dist/{sidebar-provider-CMG6WQWo.d.ts → sidebar-provider-CZHhqW5n.d.ts} +2 -2
  65. package/dist/{sidebar-provider-CMG6WQWo.d.ts.map → sidebar-provider-CZHhqW5n.d.ts.map} +1 -1
  66. package/dist/{splitted-input-diff-DBkgDh9Q.d.ts → splitted-input-diff-BKRMH7vI.d.ts} +2 -2
  67. package/dist/{splitted-input-diff-DBkgDh9Q.d.ts.map → splitted-input-diff-BKRMH7vI.d.ts.map} +1 -1
  68. package/dist/{src-CrUksCLW.js → src-B2s8MAp7.js} +148 -5
  69. package/dist/src-B2s8MAp7.js.map +1 -0
  70. package/dist/{text-field-3j4fLJ-7.d.ts → text-field-CtatgqNu.d.ts} +3 -3
  71. package/dist/{text-field-3j4fLJ-7.d.ts.map → text-field-CtatgqNu.d.ts.map} +1 -1
  72. package/dist/{text-input-tkqggbWx.d.ts → text-input-BSxhvnyx.d.ts} +2 -2
  73. package/dist/{text-input-tkqggbWx.d.ts.map → text-input-BSxhvnyx.d.ts.map} +1 -1
  74. package/dist/{text-input-diff-B7iFyzTK.d.ts → text-input-diff-CaZoFDjA.d.ts} +2 -2
  75. package/dist/{text-input-diff-B7iFyzTK.d.ts.map → text-input-diff-CaZoFDjA.d.ts.map} +1 -1
  76. package/dist/{types-DDSmPhHp.d.ts → types-FTqFl5du.d.ts} +2 -2
  77. package/dist/{types-DDSmPhHp.d.ts.map → types-FTqFl5du.d.ts.map} +1 -1
  78. package/dist/types-TZijOYrE.d.ts +17 -0
  79. package/dist/types-TZijOYrE.d.ts.map +1 -0
  80. package/dist/ui/components/checkbox/checkbox.d.ts +1 -1
  81. package/dist/ui/components/command/command.js +1 -1
  82. package/dist/ui/components/enum-field/enum-field.d.ts +1 -1
  83. package/dist/ui/components/enum-field/types.d.ts +1 -1
  84. package/dist/ui/components/form-label/form-label.js +1 -1
  85. package/dist/ui/components/id-autocomplete/id-autocomplete-input-container.d.ts +1 -1
  86. package/dist/ui/components/id-autocomplete/id-autocomplete-input-container.js +1 -1
  87. package/dist/ui/components/id-autocomplete/id-autocomplete-list-option.d.ts +1 -1
  88. package/dist/ui/components/id-autocomplete/id-autocomplete-list-option.js +1 -1
  89. package/dist/ui/components/id-autocomplete/id-autocomplete-list.d.ts +1 -1
  90. package/dist/ui/components/id-autocomplete/id-autocomplete.d.ts +1 -1
  91. package/dist/ui/components/id-autocomplete/types.d.ts +1 -1
  92. package/dist/ui/components/id-autocomplete/use-id-autocomplete.d.ts +1 -1
  93. package/dist/ui/components/index.d.ts +20 -20
  94. package/dist/ui/components/input/splitted-input-diff.d.ts +1 -1
  95. package/dist/ui/components/input/splitted-input-diff.js +1 -1
  96. package/dist/ui/components/input/subcomponent/text-diff.d.ts +1 -1
  97. package/dist/ui/components/radio-group-field/radio-group-field.d.ts +1 -1
  98. package/dist/ui/components/select-field/content.d.ts +1 -1
  99. package/dist/ui/components/select-field/content.js +1 -1
  100. package/dist/ui/components/select-field/select-field.d.ts +1 -1
  101. package/dist/ui/components/select-field/selected-content.d.ts +1 -1
  102. package/dist/ui/components/select-field/selected-content.js +1 -1
  103. package/dist/ui/components/select-field/subcomponents/CommandItemList.d.ts +1 -1
  104. package/dist/ui/components/select-field/subcomponents/CommandItemList.js +1 -1
  105. package/dist/ui/components/select-field/use-select-field.d.ts +1 -1
  106. package/dist/ui/components/sidebar/index.d.ts +4 -4
  107. package/dist/ui/components/sidebar/sidebar.d.ts +1 -1
  108. package/dist/ui/components/sidebar/sidebar.js +1 -1
  109. package/dist/ui/components/sidebar/subcomponents/sidebar-content-area.js +1 -1
  110. package/dist/ui/components/sidebar/subcomponents/sidebar-item.d.ts +1 -1
  111. package/dist/ui/components/sidebar/subcomponents/sidebar-item.js +2 -1
  112. package/dist/ui/components/sidebar/subcomponents/sidebar-item.js.map +1 -1
  113. package/dist/ui/components/sidebar/subcomponents/sidebar-provider/index.d.ts +2 -2
  114. package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-provider.d.ts +1 -1
  115. package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-reducer.d.ts +1 -1
  116. package/dist/ui/components/sidebar/subcomponents/sidebar-search/sidebar-search.js +1 -1
  117. package/dist/ui/components/sidebar/subcomponents/status-icon.d.ts +1 -1
  118. package/dist/ui/components/sidebar/subcomponents/status-icon.js +1 -1
  119. package/dist/ui/components/sidebar/types.d.ts +1 -1
  120. package/dist/ui/components/sidebar/utils.d.ts +1 -1
  121. package/dist/ui/components/text-field/text-field.d.ts +1 -1
  122. package/dist/ui/components/text-input/text-input-diff.d.ts +1 -1
  123. package/dist/ui/components/text-input/text-input.d.ts +1 -1
  124. package/dist/ui/components/types.d.ts +1 -1
  125. package/dist/ui/components/value-transformer/value-transformer.d.ts +1 -1
  126. package/dist/ui/components/with-field-validation/with-field-validation.d.ts +1 -1
  127. package/dist/ui/index.d.ts +21 -21
  128. package/dist/ui/types.d.ts +1 -1
  129. package/dist/{use-id-autocomplete-wdw3CfYc.d.ts → use-id-autocomplete-DSRXA4Wt.d.ts} +2 -2
  130. package/dist/{use-id-autocomplete-wdw3CfYc.d.ts.map → use-id-autocomplete-DSRXA4Wt.d.ts.map} +1 -1
  131. package/dist/{value-transformer-BAD6r8Ol.d.ts → value-transformer-Dv-10UyC.d.ts} +2 -2
  132. package/dist/{value-transformer-BAD6r8Ol.d.ts.map → value-transformer-Dv-10UyC.d.ts.map} +1 -1
  133. package/dist/{with-field-validation-Bt02MQn2.d.ts → with-field-validation-WiD_NFDk.d.ts} +2 -2
  134. package/dist/{with-field-validation-Bt02MQn2.d.ts.map → with-field-validation-WiD_NFDk.d.ts.map} +1 -1
  135. package/package.json +4 -4
  136. package/dist/icon-01W_S_9A.js.map +0 -1
  137. package/dist/id-autocomplete-CHvGhffo.d.ts.map +0 -1
  138. package/dist/id-autocomplete-list-option-MsqKeLXD.d.ts.map +0 -1
  139. package/dist/index-C05uhexJ.d.ts.map +0 -1
  140. package/dist/index-CpSqVZKp.d.ts +0 -2
  141. package/dist/index-DSknqh8u.d.ts +0 -30
  142. package/dist/index-DU-WgcAh.d.ts +0 -4
  143. package/dist/index-DaRBrjZI.d.ts +0 -3
  144. package/dist/src-CrUksCLW.js.map +0 -1
@@ -1,31 +1,24 @@
1
- import { _ as DropdownMenuTrigger, c as SidebarHeader, d as PackageAnimation, f as Modal, h as DropdownMenuItem, l as SidebarPanel, m as DropdownMenuContent, n as usePagination, o as Sidebar, p as DropdownMenu, s as SidebarFooter, u as Pagination, v as PowerhouseButton } from "../src-CrUksCLW.js";
2
- import { n as getDimensions, t as Icon } from "../icon-01W_S_9A.js";
1
+ import { _ as DropdownMenuItem, b as PowerhouseButton, c as SidebarHeader, d as PackageAnimation, f as Modal, g as DropdownMenuContent, h as DropdownMenu, l as SidebarPanel, o as Sidebar, s as SidebarFooter, y as DropdownMenuTrigger } from "../src-B2s8MAp7.js";
2
+ import { n as getDimensions, t as Icon } from "../icon-CR_tC1gc.js";
3
3
  import { Popover, PopoverContent, PopoverTrigger } from "../ui/components/popover/popover.js";
4
- import { SelectFieldRaw } from "../ui/components/select-field/select-field.js";
5
4
  import { Input } from "../ui/components/input/input.js";
6
5
  import { JsonViewer } from "../ui/components/json-viewer/json-viewer.js";
7
- import React, { Fragment, createElement, forwardRef, memo, useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
6
+ import { a as lazyComponent, i as ENSAvatar, n as useEns, r as FormattedJsonViewer, t as formatEthAddress } from "../address-DsZy0bjk.js";
7
+ import { t as Label } from "../label-nH2HoKfI.js";
8
+ import React, { Fragment, createElement, forwardRef, useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
8
9
  import { twJoin, twMerge } from "tailwind-merge";
9
10
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
11
  import { Content, Portal, Provider, Root, Trigger } from "@radix-ui/react-tooltip";
11
- import { Controller, useForm } from "react-hook-form";
12
- import { Anchor, Content as Content$1, Portal as Portal$1, Root as Root$1, Trigger as Trigger$1 } from "@radix-ui/react-popover";
13
- import { format, formatDistanceToNow, parseISO } from "date-fns";
14
- import { useCopyToClipboard, useDebounceValue, useEventListener, useOnClickOutside } from "usehooks-ts";
12
+ import { useEventListener, useOnClickOutside } from "usehooks-ts";
15
13
  import { Loader2, Mail, Monitor, Moon, Settings, Smartphone, Sun, Wallet } from "lucide-react";
16
- import { SyncOperationStatus, addFolder, getSyncStatusSync, preloadEditorModule, setSelectedDrive, setSelectedNode, showDeleteNodeModal, showPHModal, showRevisionHistory, useDocumentById, useDocumentVersionStatus, useDownloadDocument, useDownloadFolder, useDragNode, useDropFile, useDropNode, useEditorModulesForDocumentType, useGetSwitchboardLink, useIsDragAndDropEnabled, useNodeActions, useNodeById, useNodeParentFolderById, useOnDropFile, useSelectedDocumentSafe, useSelectedDriveId, useSelectedDriveSafe, useSelectedNodePath, useTheme, useUserPermissions } from "@powerhousedao/reactor-browser";
17
- import Select, { components } from "react-select";
18
- import { Content as Content$2, List, Root as Root$2, Trigger as Trigger$2 } from "@radix-ui/react-tabs";
19
- import { addProp, defaultTo, entries, filter, funnel, hasAtLeast, isArray, isDefined, isIncludedIn, isStrictEqual, isString, isTruthy, keys, map, pipe, prop, values } from "remeda";
20
- import { garbageCollect, redo, sortOperations, undo } from "@powerhousedao/shared/document-model";
14
+ import { SyncOperationStatus, addFolder, getNodeTargetIn, getSyncStatusSync, isPlainClick, makeDriveSlug, preloadEditorModule, showDeleteNodeModal, showPHModal, showRevisionHistory, useCloseNode, useDocumentById, useDocumentVersionStatus, useDownloadDocument, useDownloadFolder, useDragNode, useDropFile, useDropNode, useEditorModulesForDocumentType, useGetSwitchboardLink, useIsDragAndDropEnabled, useLinkProps, useNodeActions, useNodeById, useOnDropFile, usePHNavigation, usePHStore, usePreloadNode, useSelectedDocumentSafe, useSelectedDriveId, useSelectedDriveSafe, useSelectedNodePath, useSetSelectedDrive, useSetSelectedNode, useTheme, useUserPermissions } from "@powerhousedao/reactor-browser";
15
+ import { Content as Content$1, List, Root as Root$1, Trigger as Trigger$1 } from "@radix-ui/react-tabs";
16
+ import { addProp, defaultTo, entries, filter, hasAtLeast, isArray, isDefined, isIncludedIn, isTruthy, keys, map, pipe, prop, values } from "remeda";
17
+ import { redo, undo } from "@powerhousedao/shared/document-model";
21
18
  import { RenownLogo } from "@powerhousedao/reactor-browser/renown";
22
- import { JsonView } from "@uiw/react-json-view";
23
- import { darkTheme } from "@uiw/react-json-view/dark";
24
- import { lightTheme } from "@uiw/react-json-view/light";
25
19
  import { isValidName } from "@powerhousedao/shared/document-drive";
26
20
  import { capitalCase } from "change-case";
27
21
  import { getUpdateTarget, parseInstallSpec } from "@powerhousedao/shared/registry/updates";
28
- import { useVirtualizer } from "@tanstack/react-virtual";
29
22
  //#region src/connect/components/account-popover/account-popover.tsx
30
23
  const AccountPopover = ({ children, content, open, onOpenChange }) => {
31
24
  return /* @__PURE__ */ jsxs(Popover, {
@@ -245,6 +238,9 @@ function Breadcrumbs() {
245
238
  const selectedDriveId = useSelectedDriveId();
246
239
  const selectedNodePath = useSelectedNodePath();
247
240
  const [isCreating, setIsCreating] = useState(false);
241
+ const store = usePHStore();
242
+ const setSelectedDrive = useSetSelectedDrive();
243
+ const setSelectedNode = useSetSelectedNode();
248
244
  function onAddNew() {
249
245
  setIsCreating(true);
250
246
  }
@@ -261,6 +257,7 @@ function Breadcrumbs() {
261
257
  function onCancel() {
262
258
  setIsCreating(false);
263
259
  }
260
+ const driveTarget = selectedDrive ? { driveSlug: makeDriveSlug(selectedDrive) } : void 0;
264
261
  const hasSelectedDrive = !!selectedDrive;
265
262
  const hasNodePath = !!selectedNodePath.length;
266
263
  return /* @__PURE__ */ jsxs("div", {
@@ -282,6 +279,7 @@ function Breadcrumbs() {
282
279
  id: selectedDriveId,
283
280
  parentId: void 0,
284
281
  name: selectedDrive.state.global.name || selectedDrive.header.name,
282
+ target: driveTarget,
285
283
  onClick: () => setSelectedDrive(selectedDrive)
286
284
  }),
287
285
  /* @__PURE__ */ jsx("span", { children: "/" })
@@ -290,6 +288,7 @@ function Breadcrumbs() {
290
288
  id: node.id,
291
289
  parentId: node.parentFolder,
292
290
  name: node.name,
291
+ target: getNodeTargetIn(store, node),
293
292
  onClick: () => setSelectedNode(node)
294
293
  }), /* @__PURE__ */ jsx("span", { children: "/" })] }, node.id)),
295
294
  isAllowedToCreateDocuments && (isCreating ? /* @__PURE__ */ jsx(NodeInput, {
@@ -311,19 +310,45 @@ function Breadcrumbs() {
311
310
  });
312
311
  }
313
312
  function Breadcrumb(props) {
314
- const { name, id, parentId, onClick } = props;
313
+ const { name, id, parentId, target, onClick } = props;
314
+ const navigation = usePHNavigation();
315
+ const isCurrent = navigation.useIsCurrent?.(target) ?? false;
316
+ const href = props.href ?? (target ? navigation.hrefFor?.(target) : void 0);
315
317
  const { isDragging, ...dragProps } = useDragNode({
316
318
  srcId: id,
317
319
  parentId: parentId ?? void 0
318
320
  });
319
321
  const { isDropTarget, ...dropProps } = useDropNode(id);
320
322
  const containerStyles = twMerge("cursor-pointer transition-colors last-of-type:text-foreground hover:hover-effect", isDragging ? "opacity-60" : isDropTarget ? "bg-info/10" : "");
323
+ if (href) {
324
+ const onLinkClick = (event) => {
325
+ if (!isPlainClick(event)) return;
326
+ event.preventDefault();
327
+ onClick();
328
+ };
329
+ return /* @__PURE__ */ jsx("a", {
330
+ ...dragProps,
331
+ ...dropProps,
332
+ href,
333
+ "aria-current": target && isCurrent ? "page" : void 0,
334
+ className: containerStyles,
335
+ onClick: onLinkClick,
336
+ children: name
337
+ });
338
+ }
339
+ const onKeyDown = (event) => {
340
+ if (event.key !== "Enter" && event.key !== " ") return;
341
+ event.preventDefault();
342
+ onClick();
343
+ };
321
344
  return /* @__PURE__ */ jsx("div", {
322
345
  ...dragProps,
323
346
  ...dropProps,
324
347
  className: containerStyles,
325
348
  onClick,
349
+ onKeyDown,
326
350
  role: "button",
351
+ tabIndex: 0,
327
352
  children: name
328
353
  });
329
354
  }
@@ -640,141 +665,7 @@ function CatchUpInspector({ status, onRefresh, onSweepNow }) {
640
665
  }
641
666
  //#endregion
642
667
  //#region src/connect/components/combobox/combobox.tsx
643
- function DropdownIndicator(props) {
644
- return /* @__PURE__ */ jsx(components.DropdownIndicator, {
645
- ...props,
646
- children: /* @__PURE__ */ jsx(Icon, {
647
- name: "ChevronDown",
648
- size: 16
649
- })
650
- });
651
- }
652
- function ClearIndicator(props) {
653
- return /* @__PURE__ */ jsx(components.ClearIndicator, {
654
- ...props,
655
- children: /* @__PURE__ */ jsx(Icon, {
656
- name: "Xmark",
657
- size: 16
658
- })
659
- });
660
- }
661
- function MenuList(props) {
662
- const { label, onClick, ...rest } = props;
663
- const hasAddItemButton = !!label && !!onClick;
664
- return /* @__PURE__ */ jsxs(components.MenuList, {
665
- ...rest,
666
- children: [props.children, hasAddItemButton ? /* @__PURE__ */ jsx("button", {
667
- className: "w-full px-2 py-3 hover:hover-effect",
668
- onClick,
669
- children: label
670
- }) : null]
671
- });
672
- }
673
- function Combobox(props) {
674
- const invalid = props["aria-invalid"] === "true";
675
- const { addItemButtonProps, ...rest } = props;
676
- const { theme } = useTheme();
677
- const dark = theme === "dark";
678
- return /* @__PURE__ */ jsx(Select, {
679
- ...rest,
680
- components: {
681
- DropdownIndicator,
682
- ClearIndicator,
683
- MenuList: (menuListProps) => MenuList({
684
- ...menuListProps,
685
- ...addItemButtonProps
686
- })
687
- },
688
- classNames: { menuList: () => "scrollbar-thin scrollbar-track-transparent scrollbar-thumb-rounded-md scrollbar-thumb-border" },
689
- styles: {
690
- dropdownIndicator: () => {
691
- return {
692
- label: "indicatorContainer",
693
- display: "flex",
694
- transition: "color 150ms",
695
- color: dark ? "var(--color-slate-50)" : "var(--color-gray-900)",
696
- padding: 8,
697
- boxSizing: "border-box"
698
- };
699
- },
700
- clearIndicator: (baseStyles) => {
701
- return {
702
- ...baseStyles,
703
- color: dark ? "var(--color-slate-50)" : "var(--color-gray-900)"
704
- };
705
- },
706
- container: (baseStyles) => {
707
- return {
708
- ...baseStyles,
709
- borderColor: dark ? "var(--color-slate-700)" : "var(--color-gray-200)",
710
- fontSize: 12
711
- };
712
- },
713
- placeholder: (baseStyles) => {
714
- return {
715
- ...baseStyles,
716
- color: invalid ? dark ? "var(--color-red-400)" : "var(--color-red-900)" : dark ? "var(--color-slate-100)" : "var(--color-gray-500)"
717
- };
718
- },
719
- control: () => {
720
- return {
721
- label: "control",
722
- alignItems: "center",
723
- cursor: "default",
724
- display: "flex",
725
- flexWrap: "wrap",
726
- justifyContent: "space-between",
727
- minHeight: 32,
728
- outline: "0 !important",
729
- position: "relative",
730
- transition: "all 100ms",
731
- backgroundColor: dark ? "var(--color-slate-800)" : "var(--color-white)",
732
- borderColor: invalid ? dark ? "var(--color-red-400)" : "var(--color-red-900)" : dark ? "var(--color-slate-600)" : "var(--color-gray-200)",
733
- borderStyle: "solid",
734
- borderWidth: 1,
735
- borderRadius: "6px",
736
- boxSizing: "border-box"
737
- };
738
- },
739
- option: (baseStyles, state) => {
740
- return {
741
- ...baseStyles,
742
- backgroundColor: state.isSelected ? dark ? "var(--color-slate-700)" : "var(--color-slate-50)" : dark ? "var(--color-slate-800)" : "var(--color-white)",
743
- color: dark ? "var(--color-slate-50)" : "var(--color-gray-800)",
744
- ":hover": { backgroundColor: dark ? "var(--color-slate-700)" : "var(--color-slate-50)" }
745
- };
746
- },
747
- menuList: (baseStyles) => ({
748
- ...baseStyles,
749
- padding: 0,
750
- borderRadius: "6px"
751
- })
752
- },
753
- theme: (theme) => ({
754
- ...theme,
755
- colors: {
756
- ...theme.colors,
757
- primary: dark ? "var(--color-slate-700)" : "var(--color-slate-100)",
758
- primary25: dark ? "var(--color-slate-800)" : "var(--color-slate-50)",
759
- primary50: dark ? "var(--color-slate-700)" : "var(--color-slate-100)",
760
- primary75: dark ? "var(--color-slate-700)" : "var(--color-slate-100)",
761
- danger: dark ? "var(--color-red-400)" : "var(--color-red-900)",
762
- dangerLight: dark ? "var(--color-red-900)" : "var(--color-red-100)",
763
- neutral0: dark ? "var(--color-slate-800)" : "var(--color-white)",
764
- neutral5: dark ? "var(--color-slate-800)" : "var(--color-gray-50)",
765
- neutral10: dark ? "var(--color-slate-700)" : "var(--color-gray-100)",
766
- neutral20: dark ? "var(--color-slate-600)" : "var(--color-gray-200)",
767
- neutral30: dark ? "var(--color-slate-600)" : "var(--color-gray-300)",
768
- neutral40: dark ? "var(--color-slate-400)" : "var(--color-gray-400)",
769
- neutral50: dark ? "var(--color-slate-300)" : "var(--color-gray-500)",
770
- neutral60: dark ? "var(--color-slate-200)" : "var(--color-gray-600)",
771
- neutral70: dark ? "var(--color-slate-100)" : "var(--color-gray-700)",
772
- neutral80: dark ? "var(--color-slate-50)" : "var(--color-gray-800)",
773
- neutral90: dark ? "var(--color-slate-50)" : "var(--color-gray-900)"
774
- }
775
- })
776
- });
777
- }
668
+ const Combobox = lazyComponent(() => import("../combobox.impl-C2oszOl2.js").then((m) => m.Combobox));
778
669
  //#endregion
779
670
  //#region src/connect/components/consent-banner/consent-banner.tsx
780
671
  const CookieBanner = (props) => {
@@ -2100,7 +1991,7 @@ function TabContent(props) {
2100
1991
  const toTabValue = (label) => label.trim().replace(/\s+/g, "-");
2101
1992
  const resolveTabValue = (props) => props.value ?? toTabValue(props.label);
2102
1993
  function Tabs({ children, defaultValue, onValueChange, listClassName }) {
2103
- return /* @__PURE__ */ jsxs(Root$2, {
1994
+ return /* @__PURE__ */ jsxs(Root$1, {
2104
1995
  defaultValue: toTabValue(defaultValue),
2105
1996
  onValueChange,
2106
1997
  className: "flex min-h-0 flex-1 flex-col gap-2",
@@ -2112,7 +2003,7 @@ function Tabs({ children, defaultValue, onValueChange, listClassName }) {
2112
2003
  if (!/*#__PURE__*/ React.isValidElement(child)) return;
2113
2004
  const props = child.props;
2114
2005
  const value = resolveTabValue(props);
2115
- return /* @__PURE__ */ jsx(Trigger$2, {
2006
+ return /* @__PURE__ */ jsx(Trigger$1, {
2116
2007
  className: "flex min-h-7 flex-1 items-center justify-center rounded-lg border border-border bg-background py-2 text-foreground transition duration-300 data-disabled:disabled-effect data-[state=active]:bg-accent data-[state=active]:text-foreground",
2117
2008
  value,
2118
2009
  disabled: props.disabled ?? false,
@@ -2125,7 +2016,7 @@ function Tabs({ children, defaultValue, onValueChange, listClassName }) {
2125
2016
  children: React.Children.map(children, (child, i) => {
2126
2017
  if (!/*#__PURE__*/ React.isValidElement(child)) return;
2127
2018
  const value = resolveTabValue(child.props);
2128
- return /* @__PURE__ */ jsx(Content$2, {
2019
+ return /* @__PURE__ */ jsx(Content$1, {
2129
2020
  className: "h-full",
2130
2021
  value,
2131
2022
  children: child
@@ -2160,272 +2051,8 @@ function DocumentStateViewer({ state, ignoredScopes = ["auth", "document"], defa
2160
2051
  });
2161
2052
  }
2162
2053
  //#endregion
2163
- //#region src/connect/components/tooltip/tooltip.tsx
2164
- function ConnectTooltip(props) {
2165
- const { children, content, open, defaultOpen, onOpenChange, className, side = "top", sideOffset = 5, delayDuration, ...rest } = props;
2166
- return /* @__PURE__ */ jsxs(Root, {
2167
- defaultOpen,
2168
- delayDuration,
2169
- onOpenChange,
2170
- open,
2171
- children: [/* @__PURE__ */ jsx(Trigger, {
2172
- asChild: true,
2173
- children
2174
- }), /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content, {
2175
- ...rest,
2176
- side,
2177
- sideOffset,
2178
- className: twMerge("z-50 rounded-lg border border-border bg-popover p-2 text-xs text-popover-foreground shadow-tooltip", className),
2179
- children: content
2180
- }) })]
2181
- });
2182
- }
2183
- const ConnectTooltipProvider = Provider;
2184
- //#endregion
2185
- //#region src/connect/components/document-timeline/components/h-divider.tsx
2186
- const HDivider = (props) => {
2187
- const { className, timestampUtcMs: timestamp, title, subtitle, onClick, isSelected = false } = props;
2188
- const [open, setOpen] = useState(false);
2189
- const hasContent = !!title || !!subtitle || !!timestamp;
2190
- useEffect(() => {
2191
- if (open) {
2192
- setOpen(false);
2193
- setTimeout(() => hasContent && setOpen(true), 50);
2194
- }
2195
- }, [
2196
- title,
2197
- subtitle,
2198
- timestamp,
2199
- hasContent
2200
- ]);
2201
- const formatTimestamp = (isoString) => {
2202
- if (!isoString) return "";
2203
- try {
2204
- return formatDistanceToNow(new Date(isoString), { addSuffix: true });
2205
- } catch {
2206
- return isoString;
2207
- }
2208
- };
2209
- const tooltipContent = /* @__PURE__ */ jsxs("div", {
2210
- className: "flex flex-col text-xs",
2211
- children: [
2212
- !!title && /* @__PURE__ */ jsx("div", { children: title }),
2213
- !!subtitle && /* @__PURE__ */ jsx("div", {
2214
- className: "text-foreground",
2215
- children: subtitle
2216
- }),
2217
- !!timestamp && /* @__PURE__ */ jsx("div", { children: formatTimestamp(timestamp) })
2218
- ]
2219
- });
2220
- const handleMouseEnter = () => {
2221
- if (hasContent) setOpen(true);
2222
- };
2223
- const handleMouseLeave = () => {
2224
- setOpen(false);
2225
- };
2226
- return /* @__PURE__ */ jsxs("div", {
2227
- className: "relative",
2228
- onMouseEnter: handleMouseEnter,
2229
- onMouseLeave: handleMouseLeave,
2230
- children: [isSelected && /* @__PURE__ */ jsx(Icon, {
2231
- name: "TimelineCaret",
2232
- color: "#4EA9FF",
2233
- size: 10,
2234
- className: "absolute top-[-11px] z-40"
2235
- }), /* @__PURE__ */ jsx(ConnectTooltip, {
2236
- className: "rounded-md bg-primary text-primary-foreground",
2237
- content: tooltipContent,
2238
- open: open && hasContent,
2239
- onOpenChange: setOpen,
2240
- delayDuration: 0,
2241
- side: "bottom",
2242
- sideOffset: 5,
2243
- children: /* @__PURE__ */ jsx("div", {
2244
- className: twMerge("mx-0.5 flex h-6.25 w-1.5 cursor-pointer flex-col items-center justify-center rounded-xs hover:hover-effect", isSelected && "bg-info/10", className),
2245
- onClick,
2246
- "data-title": title,
2247
- "data-subtitle": subtitle,
2248
- "data-timestamp": timestamp,
2249
- children: /* @__PURE__ */ jsx("div", { className: "h-0.5 w-1 rounded-full bg-muted" })
2250
- })
2251
- })]
2252
- });
2253
- };
2254
- //#endregion
2255
- //#region src/connect/components/document-timeline/components/timeline-bar.tsx
2256
- const getBarHeight = (size = 0) => {
2257
- switch (true) {
2258
- case size <= 0: return "h-[1px]";
2259
- case size === 1: return "h-[3px]";
2260
- case size === 2: return "h-[6px]";
2261
- case size === 3: return "h-[9px]";
2262
- case size >= 4: return "h-[12px]";
2263
- default: return "h-[1px]";
2264
- }
2265
- };
2266
- const formatTimestamp$1 = (isoString) => {
2267
- if (!isoString) return "";
2268
- try {
2269
- const date = parseISO(isoString);
2270
- return format(date, "HH:mm, dd, MMMM");
2271
- } catch {
2272
- return isoString;
2273
- }
2274
- };
2275
- const TimelineBar = ({ onClick, className, timestampUtcMs: timestamp, additions, deletions, addSize = 0, delSize = 0, isSelected = false }) => {
2276
- const [open, setOpen] = useState(false);
2277
- const noChanges = addSize === 0 && delSize === 0;
2278
- const addBarHeight = getBarHeight(addSize);
2279
- const delBarHeight = getBarHeight(delSize);
2280
- const tooltipContent = /* @__PURE__ */ jsxs("div", {
2281
- className: "flex flex-col text-xs",
2282
- children: [
2283
- /* @__PURE__ */ jsx("div", { children: formatTimestamp$1(timestamp) }),
2284
- /* @__PURE__ */ jsx("div", {
2285
- className: "text-success",
2286
- children: `${additions} additions +`
2287
- }),
2288
- /* @__PURE__ */ jsx("div", {
2289
- className: "text-destructive",
2290
- children: `${deletions} deletions -`
2291
- })
2292
- ]
2293
- });
2294
- const handleMouseEnter = () => {
2295
- if (!noChanges) setOpen(true);
2296
- };
2297
- const handleMouseLeave = () => {
2298
- setOpen(false);
2299
- };
2300
- return /* @__PURE__ */ jsxs("div", {
2301
- className: "relative",
2302
- onMouseEnter: handleMouseEnter,
2303
- onMouseLeave: handleMouseLeave,
2304
- children: [isSelected && /* @__PURE__ */ jsx(Icon, {
2305
- name: "TimelineCaret",
2306
- color: "#4EA9FF",
2307
- size: 10,
2308
- className: "absolute top-[-11px] left-[-2px] z-40"
2309
- }), noChanges ? /* @__PURE__ */ jsx("div", {
2310
- className: twMerge("flex h-[25px] w-1.5 cursor-pointer flex-col items-center justify-center rounded-[2px] hover:hover-effect", className),
2311
- "data-timestamp": timestamp,
2312
- onClick,
2313
- children: /* @__PURE__ */ jsx("div", { className: "size-[3px] rounded-full bg-muted-foreground" })
2314
- }) : /* @__PURE__ */ jsx(ConnectTooltip, {
2315
- className: "rounded-md bg-primary text-primary-foreground",
2316
- content: tooltipContent,
2317
- open,
2318
- onOpenChange: setOpen,
2319
- delayDuration: 0,
2320
- side: "bottom",
2321
- sideOffset: 5,
2322
- children: /* @__PURE__ */ jsxs("div", {
2323
- className: twMerge("flex h-[25px] w-1.5 cursor-pointer flex-col items-center justify-center rounded-[2px] hover:hover-effect", className, isSelected && "bg-info/10"),
2324
- "data-timestamp": timestamp,
2325
- onClick,
2326
- children: [/* @__PURE__ */ jsx("div", {
2327
- className: "flex h-3 w-0.5 items-end",
2328
- children: /* @__PURE__ */ jsx("div", { className: twMerge("h-3 w-0.5 rounded-t-full bg-success", addBarHeight) })
2329
- }), /* @__PURE__ */ jsx("div", {
2330
- className: "flex h-3 w-0.5 items-start",
2331
- children: /* @__PURE__ */ jsx("div", { className: twMerge("h-3 w-0.5 rounded-b-full bg-destructive", delBarHeight) })
2332
- })]
2333
- })
2334
- })]
2335
- });
2336
- };
2337
- //#endregion
2338
2054
  //#region src/connect/components/document-timeline/document-timeline.tsx
2339
- const defaultTimeLineItem = {
2340
- id: "default",
2341
- type: "bar",
2342
- addSize: 0,
2343
- delSize: 0
2344
- };
2345
- const DocumentTimeline = (props) => {
2346
- const { timeline = [], onItemClick } = props;
2347
- const [selectedItem, setSelectedItem] = useState(null);
2348
- const scrollContainerRef = useRef(null);
2349
- const handleClick = (item) => {
2350
- if (item.id === selectedItem || item.id === defaultTimeLineItem.id) {
2351
- onItemClick?.(null);
2352
- setSelectedItem(null);
2353
- } else {
2354
- onItemClick?.(item);
2355
- setSelectedItem(item.id);
2356
- }
2357
- };
2358
- const mergedTimelineItems = [...timeline, defaultTimeLineItem];
2359
- const [unselectedItems, selectedItems] = useMemo(() => {
2360
- const indexSelected = mergedTimelineItems.findIndex((item) => item.id === selectedItem);
2361
- return indexSelected === -1 ? [mergedTimelineItems, []] : [mergedTimelineItems.slice(0, indexSelected), mergedTimelineItems.slice(indexSelected)];
2362
- }, [mergedTimelineItems, selectedItem]);
2363
- const renderTimelineItems = useCallback((items) => {
2364
- return items.map((item) => {
2365
- if (item.type === "divider") {
2366
- const { timestampUtcMs, title, subtitle } = item;
2367
- return /* @__PURE__ */ jsx(HDivider, {
2368
- timestampUtcMs,
2369
- title,
2370
- subtitle,
2371
- onClick: () => handleClick(item),
2372
- isSelected: item.id === selectedItem
2373
- }, item.id);
2374
- }
2375
- return /* @__PURE__ */ jsx(TimelineBar, {
2376
- timestampUtcMs: item.timestampUtcMs,
2377
- addSize: item.addSize,
2378
- delSize: item.delSize,
2379
- additions: item.additions,
2380
- deletions: item.deletions,
2381
- isSelected: item.id === selectedItem,
2382
- onClick: () => handleClick(item)
2383
- }, item.id);
2384
- });
2385
- }, [handleClick, selectedItem]);
2386
- const unselectedContent = useMemo(() => renderTimelineItems(unselectedItems), [unselectedItems, renderTimelineItems]);
2387
- const selectedContent = useMemo(() => renderTimelineItems(selectedItems), [selectedItems, renderTimelineItems]);
2388
- useEffect(() => {
2389
- if (scrollContainerRef.current) scrollContainerRef.current.scrollLeft = scrollContainerRef.current.scrollWidth;
2390
- }, []);
2391
- return /* @__PURE__ */ jsx(ConnectTooltipProvider, {
2392
- delayDuration: 0,
2393
- skipDelayDuration: 0,
2394
- children: /* @__PURE__ */ jsxs("div", {
2395
- className: "relative h-[36px] w-full",
2396
- children: [
2397
- /* @__PURE__ */ jsx("div", {
2398
- className: "absolute left-0 z-20 h-[17px] w-[6px] bg-background",
2399
- children: /* @__PURE__ */ jsx("div", { className: "mt-[11px] h-[6px] w-[6px] rounded-tl-md bg-background" })
2400
- }),
2401
- /* @__PURE__ */ jsx("div", {
2402
- className: "absolute top-[11px] right-0 z-20 h-[6px] w-[6px] bg-background",
2403
- children: /* @__PURE__ */ jsx("div", { className: "h-[6px] w-[6px] rounded-tr-md bg-background" })
2404
- }),
2405
- /* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 bottom-0 h-[25px] rounded-md bg-background" }),
2406
- /* @__PURE__ */ jsx("div", {
2407
- className: "absolute inset-x-0 bottom-0 h-[36px]",
2408
- children: /* @__PURE__ */ jsx("div", {
2409
- ref: scrollContainerRef,
2410
- className: "h-full overflow-x-auto rounded-md",
2411
- children: /* @__PURE__ */ jsxs("div", {
2412
- className: "ml-auto flex h-[36px] w-max items-end px-2 pb-0",
2413
- children: [/* @__PURE__ */ jsx("div", {
2414
- className: "flex",
2415
- children: unselectedContent
2416
- }), /* @__PURE__ */ jsx("div", {
2417
- className: "flex rounded-sm bg-info/10",
2418
- children: selectedContent
2419
- })]
2420
- })
2421
- })
2422
- }),
2423
- /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute bottom-0 left-0 z-10 h-[25px] w-2 rounded-l-md bg-background" }),
2424
- /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute right-0 bottom-0 z-10 h-[25px] w-2 rounded-r-md bg-background" })
2425
- ]
2426
- })
2427
- });
2428
- };
2055
+ const DocumentTimeline = lazyComponent(() => import("../document-timeline.impl-DRmIHFaI.js").then((m) => m.DocumentTimeline));
2429
2056
  //#endregion
2430
2057
  //#region src/connect/components/document-toolbar/containers.tsx
2431
2058
  /**
@@ -2627,7 +2254,8 @@ function ToolbarHistoryButton(props) {
2627
2254
  /**
2628
2255
  * Toolbar control for closing the current document view.
2629
2256
  *
2630
- * By default, this selects the current document's parent folder. Provide
2257
+ * By default, this goes back when the app's history allows, else it selects the
2258
+ * current document's parent folder. Provide
2631
2259
  * `children` to replace the default icon, or `onClick` to override the default
2632
2260
  * close behavior.
2633
2261
  */
@@ -2636,8 +2264,7 @@ function ToolbarCloseButton(props) {
2636
2264
  name: "XmarkLight",
2637
2265
  size: 16
2638
2266
  }) } = props;
2639
- const parentFolder = useNodeParentFolderById(document?.header.id);
2640
- const onClick = makeOnClick(document, onClickOverride, () => setSelectedNode(parentFolder));
2267
+ const onClick = makeOnClick(document, onClickOverride, useCloseNode(document?.header.id));
2641
2268
  return /* @__PURE__ */ jsx(ToolbarButton, {
2642
2269
  "data-testid": "toolbar-close-button",
2643
2270
  "aria-label": "Close document",
@@ -3576,6 +3203,7 @@ function DropZone(props) {
3576
3203
  setConflictUploadId(null);
3577
3204
  };
3578
3205
  const { isDropTarget, ...dropProps } = useDropFile(handleAddFile);
3206
+ const setSelectedNode = useSetSelectedNode();
3579
3207
  return /* @__PURE__ */ jsxs("div", {
3580
3208
  className: twMerge("relative", className),
3581
3209
  ...enable ? dropProps : {},
@@ -3743,23 +3371,6 @@ function EditorUndoRedoButtons(props) {
3743
3371
  });
3744
3372
  }
3745
3373
  //#endregion
3746
- //#region assets/powerhouse-rounded.png
3747
- var powerhouse_rounded_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAA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aD3mwBFliOb1zedgC82Kl/i92MEUOUHuPJ2ZloZVXqB1ebhd7shQiVspJnaIB4D/VD6tMmNcFkB3OJJg4RL2bt0zKIoiqwluY+GshWfcH/IwtdCjmsQ42LJB6yuCQhLe+dnhhV2u2BGKBlstjT8wAMxEyT3XgEOGAg7LwyMXTrIkMQD549tQGwM/mPuh0sEDtUZe4pF54vLsN2fhTvqhmb6YjT3lAVoG6COS4M5CvwIyxoVGyDNxXr4ugPlScFXJMC1v29b25UmnsL//2CqCycadOmiZjx3zpj62+4hgNW+3q0/cv3C5uSTm9YyoUQUG4bYIr0HNlOHB6XR69Q84lzH339ecWoBfWa4DKdHKZL2dVpnpuag5RFaarznTFW81xYyZD302Z+my98BUr7/8UOunKRlw2tKYANJaoUYg5slhEbnwLfJR4tV+XZwYXH9mIMKl42Zl/Mb0ZLrP83C2vr1mCJllTARobe8qkm6WLfJM0SEFcZIE6e+iNCDZltMjVxmGyeuWuMgTKWDdgQaOxrpodFoDKlFt3FVBCokhRDORmi34crKU7ottVnnFl+4cNnLHDBpDbuAlfmIpOeSlI+CbDl6/E7nok9HYvDbNtMNCojIgWbl1XfRalWXZEABorFkutXYP3lRRMeabnikSZeZ2wlKqsO9NMK0JQG7WIcmH3gPLhUlueHVGAoSmgnYMOTJQTASU5YjxOzvkVpXJaVewUwStoClL6dx/UXyOP5AevikjeJTvCwEL7I6IVG2Tw6vcCAAAAAElFTkSuQmCC";
3748
- //#endregion
3749
- //#region src/connect/components/ens-avatar/ens-avatar.tsx
3750
- function ENSAvatar(props) {
3751
- const { avatarUrl = powerhouse_rounded_default, size = "14px" } = props;
3752
- return /* @__PURE__ */ jsx("img", {
3753
- alt: "ENS Avatar",
3754
- className: "flex-none rounded-full object-contain",
3755
- src: avatarUrl,
3756
- style: {
3757
- width: size,
3758
- height: size
3759
- }
3760
- });
3761
- }
3762
- //#endregion
3763
3374
  //#region src/connect/constants/options.tsx
3764
3375
  const defaultDriveOptions = [
3765
3376
  "DOWNLOAD",
@@ -3989,6 +3600,12 @@ function getDriveSharingType$1(drive) {
3989
3600
  }
3990
3601
  function FileItem(props) {
3991
3602
  const { fileNode, className, customDocumentIconSrc } = props;
3603
+ const store = usePHStore();
3604
+ const setSelectedNode = useSetSelectedNode();
3605
+ const preloadNode = usePreloadNode();
3606
+ const target = getNodeTargetIn(store, fileNode);
3607
+ const link = useLinkProps(target, () => setSelectedNode(fileNode));
3608
+ const href = props.href ?? (target ? link.href : void 0);
3992
3609
  const [mode, setMode] = useState("READ");
3993
3610
  const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState(false);
3994
3611
  const [selectedDrive] = useSelectedDriveSafe();
@@ -3999,9 +3616,12 @@ function FileItem(props) {
3999
3616
  });
4000
3617
  const { isAllowedToCreateDocuments } = useUserPermissions();
4001
3618
  const editorModules = useEditorModulesForDocumentType(fileNode.documentType);
4002
- const preloadEditors = () => editorModules?.forEach((editorModule) => {
4003
- preloadEditorModule(editorModule);
4004
- });
3619
+ const preload = () => {
3620
+ editorModules?.forEach((editorModule) => {
3621
+ preloadEditorModule(editorModule);
3622
+ });
3623
+ preloadNode(fileNode);
3624
+ };
4005
3625
  const { onRenameNode, onRenameDriveNodes, onDuplicateNode } = useNodeActions();
4006
3626
  const downloadDocument = useDownloadDocument(fileNode.id);
4007
3627
  const isReadMode = mode === "READ";
@@ -4072,6 +3692,7 @@ function FileItem(props) {
4072
3692
  children: /* @__PURE__ */ jsx("button", {
4073
3693
  className: twMerge("hidden group-hover:block", isDropdownMenuOpen && "block"),
4074
3694
  onClick: (e) => {
3695
+ e.preventDefault();
4075
3696
  e.stopPropagation();
4076
3697
  setIsDropdownMenuOpen(true);
4077
3698
  },
@@ -4087,10 +3708,15 @@ function FileItem(props) {
4087
3708
  onCancel,
4088
3709
  onSubmit
4089
3710
  });
4090
- return /* @__PURE__ */ jsx("div", {
4091
- className: "relative w-64",
4092
- onClick: isReadMode ? () => setSelectedNode(fileNode) : void 0,
4093
- onMouseEnter: preloadEditors,
3711
+ const isLink = isReadMode && !!href;
3712
+ return /* @__PURE__ */ jsx(isLink ? "a" : "div", {
3713
+ href: isLink ? href : void 0,
3714
+ "aria-current": isLink ? link["aria-current"] : void 0,
3715
+ className: "relative block w-64",
3716
+ onClick: isLink ? link.onClick : isReadMode ? () => setSelectedNode(fileNode) : void 0,
3717
+ onMouseEnter: preload,
3718
+ onTouchStart: preload,
3719
+ onFocus: preload,
4094
3720
  ...dragProps,
4095
3721
  children: /* @__PURE__ */ jsx("div", {
4096
3722
  className: containerStyles,
@@ -4216,6 +3842,12 @@ function DefaultFileIcon() {
4216
3842
  //#region src/connect/components/folder-item/folder-item.tsx
4217
3843
  function FolderItem(props) {
4218
3844
  const { folderNode, className } = props;
3845
+ const store = usePHStore();
3846
+ const setSelectedNode = useSetSelectedNode();
3847
+ const preloadNode = usePreloadNode();
3848
+ const target = getNodeTargetIn(store, folderNode);
3849
+ const link = useLinkProps(target, () => setSelectedNode(folderNode));
3850
+ const href = props.href ?? (target ? link.href : void 0);
4219
3851
  const { isAllowedToCreateDocuments } = useUserPermissions();
4220
3852
  const [mode, setMode] = useState("READ");
4221
3853
  const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState(false);
@@ -4263,9 +3895,15 @@ function FolderItem(props) {
4263
3895
  onSubmit
4264
3896
  });
4265
3897
  const containerStyles = twMerge("group flex h-12 cursor-pointer items-center rounded-lg bg-muted px-2 select-none", isDragging ? "opacity-60" : isDropTarget ? "bg-info/10" : "", className);
4266
- return /* @__PURE__ */ jsx("div", {
4267
- className: "relative w-64 hover:hover-effect",
4268
- onClick: isReadMode ? () => setSelectedNode(folderNode) : void 0,
3898
+ const isLink = isReadMode && !!href;
3899
+ return /* @__PURE__ */ jsx(isLink ? "a" : "div", {
3900
+ href: isLink ? href : void 0,
3901
+ "aria-current": isLink ? link["aria-current"] : void 0,
3902
+ className: "relative block w-64 hover:hover-effect",
3903
+ onClick: isLink ? link.onClick : isReadMode ? () => setSelectedNode(folderNode) : void 0,
3904
+ onMouseEnter: () => preloadNode(folderNode),
3905
+ onTouchStart: () => preloadNode(folderNode),
3906
+ onFocus: () => preloadNode(folderNode),
4269
3907
  children: /* @__PURE__ */ jsxs("div", {
4270
3908
  ...dragProps,
4271
3909
  ...dropProps,
@@ -4290,6 +3928,7 @@ function FolderItem(props) {
4290
3928
  children: /* @__PURE__ */ jsx("button", {
4291
3929
  className: twMerge("ml-auto hidden group-hover:block", isDropdownMenuOpen && "block"),
4292
3930
  onClick: (e) => {
3931
+ e.preventDefault();
4293
3932
  e.stopPropagation();
4294
3933
  setIsDropdownMenuOpen(true);
4295
3934
  },
@@ -4343,287 +3982,11 @@ const FormInput = /*#__PURE__*/ forwardRef(function FormInput(props, ref) {
4343
3982
  })] });
4344
3983
  });
4345
3984
  //#endregion
4346
- //#region src/connect/components/form/inputs/app-form-input.tsx
4347
- function appToInputOption(app) {
4348
- return {
4349
- value: app.id,
4350
- displayValue: app.name,
4351
- icon: /* @__PURE__ */ jsx(Icon, { name: "PowerhouseLogoSmall" }),
4352
- description: "Built by Powerhouse"
4353
- };
4354
- }
4355
- function AppFormInput(props) {
4356
- const { control, appOptions, ...delegatedProps } = props;
4357
- const items = appOptions.map(appToInputOption);
4358
- return /* @__PURE__ */ jsx(Controller, {
4359
- control,
4360
- name: "id",
4361
- render: ({ field }) => /* @__PURE__ */ jsx(ConnectSelect, {
4362
- ...delegatedProps,
4363
- ...field,
4364
- id: "id",
4365
- items
4366
- })
4367
- });
4368
- }
4369
- //#endregion
4370
- //#region src/connect/components/form/inputs/label.tsx
4371
- function Label(props) {
4372
- const { children, className, ...labelProps } = props;
4373
- return /* @__PURE__ */ jsx("label", {
4374
- ...labelProps,
4375
- className: twMerge("block font-semibold text-muted-foreground", className),
4376
- children
4377
- });
4378
- }
4379
- //#endregion
4380
3985
  //#region src/connect/components/form/add-local-drive-form.tsx
4381
- function AddLocalDriveForm(props) {
4382
- const { register, handleSubmit, control, formState: { errors } } = useForm({ defaultValues: {
4383
- name: "",
4384
- sharingType: "LOCAL",
4385
- availableOffline: false,
4386
- id: props.appOptions[0].id
4387
- } });
4388
- return /* @__PURE__ */ jsx("form", {
4389
- name: "add-local-drive",
4390
- onSubmit: (e) => void handleSubmit(props.onSubmit)(e),
4391
- className: "flex flex-col gap-4",
4392
- children: /* @__PURE__ */ jsxs("div", {
4393
- className: "flex flex-col gap-4",
4394
- children: [
4395
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Label, {
4396
- htmlFor: "name",
4397
- className: "text-sm font-medium text-foreground",
4398
- children: "Drive Name"
4399
- }), /* @__PURE__ */ jsx(FormInput, {
4400
- ...register("name", { required: "Drive name is required" }),
4401
- errorMessage: errors.name?.message,
4402
- placeholder: "Drive name"
4403
- })] }),
4404
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Label, {
4405
- htmlFor: "driveApp",
4406
- className: "text-sm font-medium text-foreground",
4407
- children: "Drive App"
4408
- }), /* @__PURE__ */ jsx(AppFormInput, {
4409
- control,
4410
- appOptions: props.appOptions
4411
- })] }),
4412
- /* @__PURE__ */ jsx(PowerhouseButton, {
4413
- className: "mt-2 w-full",
4414
- type: "submit",
4415
- children: "Create new drive"
4416
- })
4417
- ]
4418
- })
4419
- });
4420
- }
4421
- //#endregion
4422
- //#region src/connect/components/toggle/toggle.tsx
4423
- const Toggle = /*#__PURE__*/ forwardRef(function Toggle(props, ref) {
4424
- return /* @__PURE__ */ jsxs("label", {
4425
- className: "relative cursor-pointer items-center",
4426
- htmlFor: props.id,
4427
- children: [/* @__PURE__ */ jsx("input", {
4428
- className: "peer sr-only",
4429
- ref,
4430
- type: "checkbox",
4431
- value: "",
4432
- ...props
4433
- }), /* @__PURE__ */ jsx("div", { className: "peer h-6 w-11 rounded-full bg-muted-foreground peer-checked:bg-info peer-focus:outline-none after:absolute after:inset-s-0.5 after:top-0.5 after:size-5 after:rounded-full after:border after:border-none after:bg-background after:transition-all peer-checked:after:translate-x-full" })]
4434
- });
4435
- });
4436
- //#endregion
4437
- //#region src/connect/components/form/inputs/available-offline-toggle.tsx
4438
- const AvailableOfflineToggle = /*#__PURE__*/ forwardRef(function AvailableOfflineToggle(props, ref) {
4439
- return /* @__PURE__ */ jsxs("div", {
4440
- className: "flex items-center rounded-md border border-border bg-background p-3 text-foreground",
4441
- children: [/* @__PURE__ */ jsxs("div", {
4442
- className: "flex-1",
4443
- children: [/* @__PURE__ */ jsx("label", {
4444
- className: "font-medium text-foreground",
4445
- htmlFor: "availableOffline",
4446
- children: "Make available offline"
4447
- }), /* @__PURE__ */ jsxs("p", {
4448
- className: "text-xs text-foreground",
4449
- children: [
4450
- "Check this options if you keep a local backup",
4451
- /* @__PURE__ */ jsx("br", {}),
4452
- "available at all times."
4453
- ]
4454
- })]
4455
- }), /* @__PURE__ */ jsx(Toggle, {
4456
- id: "availableOffline",
4457
- ref,
4458
- ...props
4459
- })]
4460
- });
4461
- });
4462
- //#endregion
4463
- //#region src/connect/components/form/inputs/drive-name.tsx
4464
- function DriveName(props) {
4465
- return /* @__PURE__ */ jsxs("div", {
4466
- className: "flex gap-2 rounded-xl bg-muted p-3 font-semibold text-muted-foreground",
4467
- children: [/* @__PURE__ */ jsx(Icon, {
4468
- className: "text-foreground",
4469
- name: "Drive"
4470
- }), props.driveName]
4471
- });
4472
- }
4473
- //#endregion
4474
- //#region src/connect/components/form/inputs/location-info.tsx
4475
- function LocationInfo(props) {
4476
- const { location, className, ...divProps } = props;
4477
- const locationInfo = locationInfoByLocation[location];
4478
- return /* @__PURE__ */ jsxs("div", {
4479
- ...divProps,
4480
- className: twMerge("my-3 flex items-center gap-2 rounded-xl border border-border bg-background p-3 text-foreground shadow-sm", className),
4481
- children: [locationInfo.icon, /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", { children: locationInfo.title }), /* @__PURE__ */ jsx("p", {
4482
- className: "text-xs text-foreground",
4483
- children: locationInfo.description
4484
- })] })]
4485
- });
4486
- }
3986
+ const AddLocalDriveForm = lazyComponent(() => import("../add-local-drive-form.impl-B5rVul7f.js").then((m) => m.AddLocalDriveForm));
4487
3987
  //#endregion
4488
3988
  //#region src/connect/components/form/add-remote-drive-form.tsx
4489
- function AddRemoteDriveForm(props) {
4490
- const { sharingType = "PUBLIC", requestPublicDrive } = props;
4491
- const [remoteDriveDetails, setPublicDriveDetails] = useState();
4492
- const [showLocationSettings, setShowLocationSettings] = useState(false);
4493
- const [isUrlValid, setIsUrlValid] = useState(true);
4494
- const [hasConfirmedUrl, setHasConfirmedUrl] = useState(false);
4495
- const [errorMessage, setErrorMessage] = useState("");
4496
- const [url, setUrl] = useState("");
4497
- const [debouncedUrl, setDebouncedUrl] = useDebounceValue(url, 500);
4498
- const { register, handleSubmit, setValue } = useForm({
4499
- mode: "onBlur",
4500
- defaultValues: { availableOffline: remoteDriveDetails?.availableOffline ?? false }
4501
- });
4502
- useEffect(() => {
4503
- setDebouncedUrl(url);
4504
- }, [url]);
4505
- useEffect(() => {
4506
- setHasConfirmedUrl(false);
4507
- if (debouncedUrl === "") return;
4508
- fetchPublicDrive().catch(console.error);
4509
- async function fetchPublicDrive() {
4510
- try {
4511
- const { id, name } = await requestPublicDrive(debouncedUrl);
4512
- setPublicDriveDetails({
4513
- id,
4514
- name,
4515
- sharingType,
4516
- location: "SWITCHBOARD",
4517
- availableOffline: true
4518
- });
4519
- setValue("availableOffline", true);
4520
- setIsUrlValid(true);
4521
- setErrorMessage("");
4522
- } catch (error) {
4523
- setPublicDriveDetails(void 0);
4524
- setIsUrlValid(false);
4525
- setErrorMessage(error.message);
4526
- }
4527
- }
4528
- }, [
4529
- debouncedUrl,
4530
- setValue,
4531
- sharingType
4532
- ]);
4533
- function onSubmit({ availableOffline }) {
4534
- if (!remoteDriveDetails) return;
4535
- props.onSubmit({
4536
- ...remoteDriveDetails,
4537
- availableOffline,
4538
- url: debouncedUrl
4539
- });
4540
- }
4541
- return /* @__PURE__ */ jsx("form", {
4542
- onSubmit: (e) => void handleSubmit(onSubmit)(e),
4543
- children: hasConfirmedUrl ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
4544
- /* @__PURE__ */ jsx(DriveName, { driveName: remoteDriveDetails?.name ?? "New drive" }),
4545
- /* @__PURE__ */ jsx(Divider, { className: "my-3" }),
4546
- /* @__PURE__ */ jsxs(Disclosure, {
4547
- isOpen: showLocationSettings,
4548
- onOpenChange: () => setShowLocationSettings(!showLocationSettings),
4549
- title: "Location",
4550
- children: [/* @__PURE__ */ jsx(LocationInfo, { location: "SWITCHBOARD" }), /* @__PURE__ */ jsx(AvailableOfflineToggle, { ...register("availableOffline") })]
4551
- }),
4552
- /* @__PURE__ */ jsx(PowerhouseButton, {
4553
- className: "mt-4 w-full",
4554
- color: "dark",
4555
- type: "submit",
4556
- children: "Add new drive"
4557
- })
4558
- ] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FormInput, {
4559
- errorMessage,
4560
- onChange: (e) => setUrl(e.target.value),
4561
- placeholder: "Drive URL",
4562
- required: true,
4563
- type: "url",
4564
- value: url
4565
- }), /* @__PURE__ */ jsx(PowerhouseButton, {
4566
- className: "mt-4 w-full py-2 text-base",
4567
- color: "dark",
4568
- size: "small",
4569
- disabled: !isUrlValid || url === "",
4570
- onClick: (e) => {
4571
- e.preventDefault();
4572
- setHasConfirmedUrl(true);
4573
- },
4574
- type: "button",
4575
- children: "Add drive"
4576
- })] })
4577
- });
4578
- }
4579
- //#endregion
4580
- //#region src/connect/components/formatted-json-viewer.tsx
4581
- function FormattedJsonViewer(props) {
4582
- const { theme } = useTheme();
4583
- return /* @__PURE__ */ jsxs(JsonView, {
4584
- displayDataTypes: false,
4585
- displayObjectSize: false,
4586
- style: theme === "light" ? lightTheme : darkTheme,
4587
- ...props,
4588
- children: [/* @__PURE__ */ jsx(JsonView.Copied, { render: ({ onClick, ...props }) => {
4589
- if (props["data-copied"]) return /* @__PURE__ */ jsx(Icon, {
4590
- ...props,
4591
- className: "inline-block text-success",
4592
- name: "FilesEarmark",
4593
- size: 16
4594
- });
4595
- return /* @__PURE__ */ jsx(Icon, {
4596
- ...props,
4597
- onClick,
4598
- className: "inline-block cursor-pointer text-foreground",
4599
- name: "FilesEarmark",
4600
- size: 16
4601
- });
4602
- } }), /* @__PURE__ */ jsx(JsonView.String, { render: ({ children, ...rest }, { value, keyName }) => {
4603
- if (isString(children) && isString(value) && isStrictEqual(children, value) && value.length > 30) return /* @__PURE__ */ jsx("span", {
4604
- ...rest,
4605
- className: "inline-grid",
4606
- children: /* @__PURE__ */ jsxs("span", {
4607
- className: "pl-[1ch] indent-[-1ch] wrap-anywhere hyphens-none",
4608
- style: { maxWidth: `${60 - keyName.toString().length}ch` },
4609
- children: [
4610
- "\"",
4611
- children,
4612
- "\""
4613
- ]
4614
- })
4615
- });
4616
- return /* @__PURE__ */ jsxs("span", {
4617
- ...rest,
4618
- children: [
4619
- "\"",
4620
- children,
4621
- "\""
4622
- ]
4623
- });
4624
- } })]
4625
- });
4626
- }
3989
+ const AddRemoteDriveForm = lazyComponent(() => import("../add-remote-drive-form.impl-D7zuqHJC.js").then((m) => m.AddRemoteDriveForm));
4627
3990
  //#endregion
4628
3991
  //#region src/connect/components/home-screen/home-background-image.tsx
4629
3992
  const HomeBackgroundImage = ({ src } = {}) => {
@@ -4721,10 +4084,15 @@ const HomeBackgroundImage = ({ src } = {}) => {
4721
4084
  //#endregion
4722
4085
  //#region src/connect/components/home-screen/home-screen-item.tsx
4723
4086
  const HomeScreenItem = function HomeScreenItem(props) {
4724
- const { icon, title, description, containerClassName, shareable, onClick } = props;
4725
- return /* @__PURE__ */ jsxs("div", {
4087
+ const { icon, title, description, containerClassName, shareable, href, onClick, onPreload } = props;
4088
+ return /* @__PURE__ */ jsxs(href ? "a" : "div", {
4089
+ href,
4090
+ "aria-current": href ? props["aria-current"] : void 0,
4726
4091
  className: twMerge("relative flex h-24 w-40 cursor-pointer flex-col items-center justify-center overflow-hidden rounded-md p-2 text-center text-sm text-foreground hover:hover-effect", containerClassName, onClick && "cursor-pointer"),
4727
4092
  onClick,
4093
+ onMouseEnter: onPreload,
4094
+ onTouchStart: onPreload,
4095
+ onFocus: href ? onPreload : void 0,
4728
4096
  children: [
4729
4097
  /* @__PURE__ */ jsx("div", {
4730
4098
  className: "mx-auto pb-2",
@@ -5419,165 +4787,8 @@ function ConnectDeleteItemModal(props) {
5419
4787
  });
5420
4788
  }
5421
4789
  //#endregion
5422
- //#region src/connect/components/form/inputs/drive-name-input.tsx
5423
- const DriveNameInput = /*#__PURE__*/ forwardRef(function DriveNameInput(props, ref) {
5424
- return /* @__PURE__ */ jsx(FormInput, {
5425
- ...props,
5426
- icon: props.icon ?? /* @__PURE__ */ jsx(Icon, { name: "Drive" }),
5427
- id: "driveName",
5428
- placeholder: "Drive name",
5429
- ref
5430
- });
5431
- });
5432
- //#endregion
5433
- //#region src/connect/components/form/inputs/delete-drive.tsx
5434
- function DeleteDrive(props) {
5435
- const { drive, handleDeleteDrive, onCancel } = props;
5436
- const [driveNameInput, setDriveNameInput] = useState("");
5437
- const isAllowedToDelete = driveNameInput === drive.header.name;
5438
- function deleteDrive() {
5439
- if (isAllowedToDelete) handleDeleteDrive();
5440
- }
5441
- return /* @__PURE__ */ jsxs("div", { children: [
5442
- /* @__PURE__ */ jsx("p", {
5443
- className: "mb-2 rounded-md bg-background p-4 text-center text-foreground",
5444
- children: "Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?"
5445
- }),
5446
- /* @__PURE__ */ jsx(DriveNameInput, {
5447
- icon: /* @__PURE__ */ jsx(Icon, { name: "Lock" }),
5448
- onChange: (event) => setDriveNameInput(event.target.value),
5449
- placeholder: "Enter drive name...",
5450
- value: driveNameInput
5451
- }),
5452
- /* @__PURE__ */ jsxs("div", {
5453
- className: "flex gap-3",
5454
- children: [/* @__PURE__ */ jsx(PowerhouseButton, {
5455
- className: "w-full",
5456
- color: "light",
5457
- onClick: onCancel,
5458
- children: "Cancel"
5459
- }), /* @__PURE__ */ jsx(PowerhouseButton, {
5460
- className: "w-full",
5461
- color: "red",
5462
- disabled: !isAllowedToDelete,
5463
- onClick: deleteDrive,
5464
- children: "Delete"
5465
- })]
5466
- })
5467
- ] });
5468
- }
5469
- //#endregion
5470
- //#region src/connect/components/form/inputs/sharing-type-form-input.tsx
5471
- function SharingTypeFormInput(props) {
5472
- const { control, ...delegatedProps } = props;
5473
- return /* @__PURE__ */ jsx(Controller, {
5474
- control,
5475
- name: "sharingType",
5476
- render: ({ field }) => /* @__PURE__ */ jsx(ConnectSelect, {
5477
- ...delegatedProps,
5478
- ...field,
5479
- id: "sharingType",
5480
- items: sharingTypeOptions
5481
- })
5482
- });
5483
- }
5484
- //#endregion
5485
- //#region src/connect/components/form/drive-settings-form.tsx
5486
- function DriveSettingsForm(props) {
5487
- const { drive, sharingType, availableOffline, systemInfo, onSubmit, handleDeleteDrive } = props;
5488
- const name = drive.header.name;
5489
- const [showLocationSettings, setShowLocationSettings] = useState(false);
5490
- const [showAbout, setShowAbout] = useState(false);
5491
- const [showDangerZone, setShowDangerZone] = useState(false);
5492
- const [showDeleteDrive, setShowDeleteDrive] = useState(false);
5493
- const { register, handleSubmit, control } = useForm({
5494
- mode: "onBlur",
5495
- defaultValues: {
5496
- name,
5497
- sharingType,
5498
- availableOffline
5499
- }
5500
- });
5501
- const location = sharingType === "PUBLIC" ? "SWITCHBOARD" : sharingType;
5502
- return /* @__PURE__ */ jsxs("form", {
5503
- onSubmit: (e) => void handleSubmit(onSubmit)(e),
5504
- children: [
5505
- /* @__PURE__ */ jsx(DriveNameInput, { ...register("name") }),
5506
- /* @__PURE__ */ jsx(Divider, { className: "my-4" }),
5507
- /* @__PURE__ */ jsx(Label, {
5508
- htmlFor: "sharingType",
5509
- children: "Sharing settings"
5510
- }),
5511
- /* @__PURE__ */ jsx(SharingTypeFormInput, { control }),
5512
- /* @__PURE__ */ jsx(Divider, { className: "my-3" }),
5513
- /* @__PURE__ */ jsxs(Disclosure, {
5514
- isOpen: showLocationSettings,
5515
- onOpenChange: () => setShowLocationSettings(!showLocationSettings),
5516
- title: "Location",
5517
- children: [/* @__PURE__ */ jsx(LocationInfo, { location }), /* @__PURE__ */ jsx(AvailableOfflineToggle, { ...register("availableOffline") })]
5518
- }),
5519
- /* @__PURE__ */ jsx(Divider, { className: "my-3" }),
5520
- /* @__PURE__ */ jsxs(Disclosure, {
5521
- isOpen: showAbout,
5522
- onOpenChange: () => setShowAbout(!showAbout),
5523
- title: "About this drive",
5524
- children: [
5525
- systemInfo.status === "local" && /* @__PURE__ */ jsx("p", {
5526
- className: "py-2 text-sm text-muted-foreground",
5527
- children: "Local drive — N/A"
5528
- }),
5529
- systemInfo.status === "loading" && /* @__PURE__ */ jsx("p", {
5530
- className: "py-2 text-sm text-muted-foreground",
5531
- children: "Loading…"
5532
- }),
5533
- systemInfo.status === "error" && /* @__PURE__ */ jsx("p", {
5534
- className: "py-2 text-sm text-destructive",
5535
- children: "Could not load system info"
5536
- }),
5537
- systemInfo.status === "ready" && /* @__PURE__ */ jsxs("div", {
5538
- className: "py-2 text-sm text-foreground",
5539
- children: [/* @__PURE__ */ jsxs("div", { children: [
5540
- /* @__PURE__ */ jsx("span", {
5541
- className: "font-medium",
5542
- children: "Version:"
5543
- }),
5544
- " ",
5545
- systemInfo.version
5546
- ] }), /* @__PURE__ */ jsxs("div", { children: [
5547
- /* @__PURE__ */ jsx("span", {
5548
- className: "font-medium",
5549
- children: "Git hash:"
5550
- }),
5551
- " ",
5552
- systemInfo.gitHash
5553
- ] })]
5554
- })
5555
- ]
5556
- }),
5557
- /* @__PURE__ */ jsx(Divider, { className: "my-3" }),
5558
- /* @__PURE__ */ jsx(Disclosure, {
5559
- isOpen: showDangerZone,
5560
- onOpenChange: () => setShowDangerZone(!showDangerZone),
5561
- title: "Danger zone",
5562
- children: /* @__PURE__ */ jsxs("button", {
5563
- className: "flex gap-2 py-3 font-semibold text-destructive transition hover:hover-effect",
5564
- onClick: () => setShowDeleteDrive(true),
5565
- type: "button",
5566
- children: [/* @__PURE__ */ jsx(Icon, { name: "Trash" }), "Delete drive"]
5567
- })
5568
- }),
5569
- showDeleteDrive && showDangerZone ? /* @__PURE__ */ jsx(DeleteDrive, {
5570
- drive,
5571
- handleDeleteDrive,
5572
- onCancel: () => setShowDeleteDrive(false)
5573
- }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Divider, { className: "my-3" }), /* @__PURE__ */ jsx(PowerhouseButton, {
5574
- className: "mb-4 w-full",
5575
- type: "submit",
5576
- children: "Confirm"
5577
- })] })
5578
- ]
5579
- });
5580
- }
4790
+ //#region src/connect/components/form/drive-settings-form.tsx
4791
+ const DriveSettingsForm = lazyComponent(() => import("../drive-settings-form.impl-4yBGaTxe.js").then((m) => m.DriveSettingsForm));
5581
4792
  //#endregion
5582
4793
  //#region src/connect/components/modal/drive-settings-modal.tsx
5583
4794
  function DriveSettingsModal(props) {
@@ -8204,28 +7415,8 @@ function LocalStorage(props) {
8204
7415
  }
8205
7416
  //#endregion
8206
7417
  //#region src/connect/components/modal/settings-modal-v2/default-editor.tsx
8207
- function DefaultEditor(props) {
8208
- const { className, ...rest } = props;
8209
- return /* @__PURE__ */ jsx("div", {
8210
- className: twMerge("rounded-lg bg-background p-3", className),
8211
- children: /* @__PURE__ */ jsx(DefaultEditorSelect, { ...rest })
8212
- });
8213
- }
8214
- function DefaultEditorSelect(props) {
8215
- const { documentModelEditor, setDocumentModelEditor, documentModelEditorOptions, className } = props;
8216
- return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
8217
- className: "mb-4 font-semibold text-foreground",
8218
- children: "Default Editor Selection"
8219
- }), /* @__PURE__ */ jsx(SelectFieldRaw, {
8220
- className: twMerge("max-w-fit min-w-36", className),
8221
- name: "default-editor",
8222
- required: true,
8223
- value: documentModelEditor,
8224
- options: documentModelEditorOptions,
8225
- multiple: false,
8226
- onChange: (value) => setDocumentModelEditor(value)
8227
- })] });
8228
- }
7418
+ const DefaultEditor = lazyComponent(() => import("../default-editor.impl-a6EOuEme.js").then((m) => m.DefaultEditor));
7419
+ const DefaultEditorSelect = lazyComponent(() => import("../default-editor.impl-a6EOuEme.js").then((m) => m.DefaultEditorSelect));
8229
7420
  //#endregion
8230
7421
  //#region src/connect/components/modal/settings-modal-v2/package-manager/parse-package-spec.ts
8231
7422
  /**
@@ -9163,681 +8354,8 @@ function ConnectUpgradeDriveModal(props) {
9163
8354
  });
9164
8355
  }
9165
8356
  //#endregion
9166
- //#region src/connect/components/revision-history/header/branch.tsx
9167
- function Branch(props) {
9168
- const { branch = "main" } = props;
9169
- return /* @__PURE__ */ jsxs("button", {
9170
- className: "flex h-8 w-fit items-center gap-1 rounded-lg bg-background pr-2 pl-1 text-xs text-foreground",
9171
- children: [
9172
- /* @__PURE__ */ jsx(Icon, { name: "Branch" }),
9173
- /* @__PURE__ */ jsx("span", { children: "BRANCH" }),
9174
- /* @__PURE__ */ jsx("span", {
9175
- className: "text-foreground",
9176
- children: branch
9177
- })
9178
- ]
9179
- });
9180
- }
9181
- //#endregion
9182
- //#region src/connect/components/revision-history/header/doc-id.tsx
9183
- function DocId(props) {
9184
- const { docId, onCopy } = props;
9185
- const [, copy] = useCopyToClipboard();
9186
- function handleCopy(text) {
9187
- return () => {
9188
- copy(text).then(() => {
9189
- onCopy?.();
9190
- }).catch((error) => {
9191
- console.error("Failed to copy!", error);
9192
- });
9193
- };
9194
- }
9195
- return /* @__PURE__ */ jsxs("button", {
9196
- className: "flex h-8 w-fit items-center gap-1 rounded-lg bg-background pr-2 pl-1 text-xs text-foreground",
9197
- onClick: handleCopy(docId),
9198
- children: [
9199
- /* @__PURE__ */ jsx(Icon, { name: "Link" }),
9200
- "DOC ID",
9201
- /* @__PURE__ */ jsx("span", {
9202
- className: "text-foreground",
9203
- children: docId
9204
- })
9205
- ]
9206
- });
9207
- }
9208
- //#endregion
9209
- //#region src/connect/components/revision-history/header/document-state.tsx
9210
- const DocumentState = (props) => {
9211
- const { documentState, onCopyState } = props;
9212
- const [, copy] = useCopyToClipboard();
9213
- function handleCopy() {
9214
- const jsonState = JSON.stringify(documentState, null, 2);
9215
- copy(jsonState).then(() => {
9216
- onCopyState?.();
9217
- }).catch((error) => {
9218
- console.error("Failed to copy document state!", error);
9219
- });
9220
- }
9221
- return /* @__PURE__ */ jsx("button", {
9222
- className: "rounded-lg bg-background p-1 text-foreground",
9223
- onClick: handleCopy,
9224
- children: /* @__PURE__ */ jsx(Icon, { name: "CurlyBrackets" })
9225
- });
9226
- };
9227
- //#endregion
9228
- //#region src/connect/components/revision-history/header/scope.tsx
9229
- function labelFor(scope) {
9230
- return `${scope.charAt(0).toUpperCase()}${scope.slice(1)} scope`;
9231
- }
9232
- function Scope(props) {
9233
- const { scopes, value, onChange } = props;
9234
- const items = scopes.map((scope) => ({
9235
- displayValue: labelFor(scope),
9236
- value: scope
9237
- }));
9238
- return /* @__PURE__ */ jsx(ConnectSelect, {
9239
- absolutePositionMenu: true,
9240
- containerClassName: "z-10 w-fit rounded-lg bg-background text-xs text-muted-foreground",
9241
- id: "scope select",
9242
- itemClassName: "grid grid-cols-[auto,auto] gap-1 py-2 text-muted-foreground",
9243
- items,
9244
- menuClassName: "min-w-0 text-muted-foreground",
9245
- onChange,
9246
- value
9247
- });
9248
- }
9249
- //#endregion
9250
- //#region src/connect/components/revision-history/header/header.tsx
9251
- function Header(props) {
9252
- const { title, docId, scope, scopes, onChangeScope, onClose, className, documentState, onCopyState, onCopyDocId, ...divProps } = props;
9253
- return /* @__PURE__ */ jsxs("header", {
9254
- className: twMerge("flex items-center justify-between bg-transparent", className),
9255
- ...divProps,
9256
- children: [/* @__PURE__ */ jsxs("div", {
9257
- className: "flex items-center gap-3",
9258
- children: [/* @__PURE__ */ jsx("button", {
9259
- name: "close-revision-history",
9260
- className: "rounded-lg bg-background p-1 text-foreground shadow-button",
9261
- onClick: onClose,
9262
- children: /* @__PURE__ */ jsx(Icon, { name: "VariantArrowLeft" })
9263
- }), /* @__PURE__ */ jsx("h1", {
9264
- className: "text-xs text-foreground",
9265
- children: title
9266
- })]
9267
- }), /* @__PURE__ */ jsxs("div", {
9268
- className: "flex items-center gap-2",
9269
- children: [
9270
- /* @__PURE__ */ jsx(DocId, {
9271
- docId,
9272
- onCopy: onCopyDocId
9273
- }),
9274
- documentState && /* @__PURE__ */ jsx(DocumentState, {
9275
- documentState,
9276
- onCopyState
9277
- }),
9278
- /* @__PURE__ */ jsx(Branch, {}),
9279
- /* @__PURE__ */ jsx(Scope, {
9280
- onChange: onChangeScope,
9281
- scopes,
9282
- value: scope
9283
- })
9284
- ]
9285
- })]
9286
- });
9287
- }
9288
- //#endregion
9289
- //#region src/connect/hooks/use-ens.ts
9290
- const ensCache = /* @__PURE__ */ new Map();
9291
- function fetchEns(address) {
9292
- const cached = ensCache.get(address);
9293
- if (cached) return cached;
9294
- const promise = fetch(`https://api.ensdata.net/${address}`).then((res) => {
9295
- if (!res.ok) throw new Error(`ENS lookup failed: ${res.status}`);
9296
- return res.json();
9297
- }).catch((err) => {
9298
- ensCache.delete(address);
9299
- throw err instanceof Error ? err : /* @__PURE__ */ new Error("ENS lookup failed");
9300
- });
9301
- ensCache.set(address, promise);
9302
- return promise;
9303
- }
9304
- function useEns(address) {
9305
- const [data, setData] = useState();
9306
- const [isLoading, setIsLoading] = useState(false);
9307
- const [error, setError] = useState();
9308
- useEffect(() => {
9309
- if (!address) {
9310
- setData(void 0);
9311
- setError(void 0);
9312
- return;
9313
- }
9314
- let cancelled = false;
9315
- setIsLoading(true);
9316
- setError(void 0);
9317
- fetchEns(address).then((json) => {
9318
- if (cancelled) return;
9319
- setData(json);
9320
- }).catch((err) => {
9321
- if (cancelled) return;
9322
- setError(err instanceof Error ? err : /* @__PURE__ */ new Error("ENS lookup failed"));
9323
- }).finally(() => {
9324
- if (cancelled) return;
9325
- setIsLoading(false);
9326
- });
9327
- return () => {
9328
- cancelled = true;
9329
- };
9330
- }, [address]);
9331
- return {
9332
- data,
9333
- isLoading,
9334
- error
9335
- };
9336
- }
9337
- //#endregion
9338
- //#region src/connect/utils/address.ts
9339
- function formatEthAddress(address) {
9340
- return `${address.slice(0, 7)}...${address.slice(-5)}`;
9341
- }
9342
- //#endregion
9343
- //#region src/connect/components/code-popover.tsx
9344
- function CodePopover(props) {
9345
- const { content, trigger, anchor } = props;
9346
- const [isOpen, setIsOpen] = useState(false);
9347
- const opener = funnel(() => setIsOpen(true), {
9348
- triggerAt: "start",
9349
- minQuietPeriodMs: 300
9350
- });
9351
- const closer = funnel(() => setIsOpen(false), {
9352
- triggerAt: "start",
9353
- minQuietPeriodMs: 100
9354
- });
9355
- function open() {
9356
- closer.cancel();
9357
- opener.call();
9358
- }
9359
- function close() {
9360
- opener.cancel();
9361
- closer.call();
9362
- }
9363
- return /* @__PURE__ */ jsxs(Root$1, {
9364
- open: isOpen,
9365
- onOpenChange: (changedIsOpen) => changedIsOpen ? open() : close(),
9366
- children: [
9367
- /* @__PURE__ */ jsx(Trigger$1, {
9368
- onMouseEnter: open,
9369
- children: trigger
9370
- }),
9371
- !!anchor && /* @__PURE__ */ jsx(Anchor, {
9372
- asChild: true,
9373
- children: anchor
9374
- }),
9375
- /* @__PURE__ */ jsx(Portal$1, { children: /* @__PURE__ */ jsx(Content$1, {
9376
- forceMount: true,
9377
- onMouseLeave: close,
9378
- sideOffset: -28,
9379
- onCloseAutoFocus: (e) => e.preventDefault(),
9380
- collisionPadding: {
9381
- top: 24,
9382
- right: 24,
9383
- bottom: -1e4,
9384
- left: 24
9385
- },
9386
- className: "z-50 rounded-lg border border-border bg-popover p-2 text-xs text-popover-foreground shadow-tooltip outline-none",
9387
- children: content
9388
- }) })
9389
- ]
9390
- });
9391
- }
9392
- //#endregion
9393
- //#region src/connect/components/revision-history/revision/address.tsx
9394
- function Address(props) {
9395
- const { address, chainId } = props;
9396
- const { data: ensData } = useEns(address);
9397
- if (!address) return null;
9398
- const shortenedAddress = formatEthAddress(address);
9399
- return /* @__PURE__ */ jsx(CodePopover, {
9400
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, { value: { address } }),
9401
- trigger: /* @__PURE__ */ jsxs("span", {
9402
- className: "flex w-fit cursor-pointer items-center gap-1 rounded-lg bg-muted p-1 text-xs text-muted-foreground",
9403
- children: [/* @__PURE__ */ jsx(ENSAvatar, {
9404
- address,
9405
- chainId,
9406
- avatarUrl: ensData?.avatar_url ?? void 0
9407
- }), shortenedAddress]
9408
- })
9409
- });
9410
- }
9411
- //#endregion
9412
- //#region src/connect/components/revision-history/revision/errors.tsx
9413
- function Errors(props) {
9414
- const { errors } = props;
9415
- const hasErrors = !!errors?.length;
9416
- const color = hasErrors ? "text-destructive" : "text-success";
9417
- const icon = hasErrors ? /* @__PURE__ */ jsx(Icon, {
9418
- name: "Exclamation",
9419
- size: 16
9420
- }) : /* @__PURE__ */ jsx(Icon, {
9421
- name: "Check",
9422
- size: 16
9423
- });
9424
- const text = hasErrors ? `Error: ${errors[0]}` : "No errors";
9425
- const content = /* @__PURE__ */ jsxs("span", {
9426
- className: twMerge("flex w-fit items-center rounded-lg border border-border bg-background px-2 py-1 text-xs", color, hasErrors && "cursor-pointer"),
9427
- children: [icon, /* @__PURE__ */ jsx("span", {
9428
- className: twMerge("inline-block max-w-36 truncate"),
9429
- children: text
9430
- })]
9431
- });
9432
- if (hasErrors) return /* @__PURE__ */ jsx(CodePopover, {
9433
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, { value: errors }),
9434
- trigger: content
9435
- });
9436
- return content;
9437
- }
9438
- //#endregion
9439
- //#region src/connect/components/revision-history/revision/operation.tsx
9440
- function Operation$1(props) {
9441
- const { operationType, operationInput } = props;
9442
- return /* @__PURE__ */ jsx(CodePopover, {
9443
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, { value: operationInput }),
9444
- trigger: /* @__PURE__ */ jsxs("span", {
9445
- className: "flex cursor-pointer items-center gap-2 text-xs text-foreground",
9446
- children: [operationType, /* @__PURE__ */ jsx(Icon, {
9447
- className: "text-foreground",
9448
- name: "Braces",
9449
- size: 16
9450
- })]
9451
- })
9452
- });
9453
- }
9454
- //#endregion
9455
- //#region src/connect/components/revision-history/revision/revision-number.tsx
9456
- function RevisionNumber(props) {
9457
- const { operationIndex, eventId, stateHash } = props;
9458
- const revisionNumber = operationIndex + 1;
9459
- return /* @__PURE__ */ jsx(CodePopover, {
9460
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, { value: {
9461
- revisionNumber,
9462
- eventId,
9463
- stateHash
9464
- } }),
9465
- trigger: /* @__PURE__ */ jsxs("span", {
9466
- className: "flex cursor-pointer items-center gap-2 text-xs text-foreground",
9467
- children: [
9468
- "Revision ",
9469
- revisionNumber,
9470
- ".",
9471
- /* @__PURE__ */ jsx("a", { children: /* @__PURE__ */ jsx(Icon, {
9472
- className: "cursor-pointer text-foreground",
9473
- name: "Ellipsis",
9474
- size: 14
9475
- }) })
9476
- ]
9477
- })
9478
- });
9479
- }
9480
- //#endregion
9481
- //#region src/connect/components/revision-history/revision/signature.tsx
9482
- function Signature(props) {
9483
- const { signatures } = props;
9484
- if (!signatures?.length) return null;
9485
- return /* @__PURE__ */ jsx(CodePopover, {
9486
- trigger: /* @__PURE__ */ jsxs("span", {
9487
- className: "flex w-fit cursor-pointer items-center gap-1 rounded-lg border border-border bg-background px-2 py-1",
9488
- children: [
9489
- /* @__PURE__ */ jsx(VerificationStatus, { signatures }),
9490
- " ",
9491
- /* @__PURE__ */ jsx(Icon, {
9492
- className: "text-foreground",
9493
- name: "InfoSquare",
9494
- size: 16
9495
- })
9496
- ]
9497
- }),
9498
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, {
9499
- value: signatures,
9500
- collapsed: 1
9501
- })
9502
- });
9503
- }
9504
- function VerificationStatus(props) {
9505
- const { signatures } = props;
9506
- if (!signatures?.length) return null;
9507
- const signatureCount = signatures.length;
9508
- const verifiedSignaturesCount = signatures.filter((signature) => signature.isVerified).length;
9509
- const verificationStatusText = `${verifiedSignaturesCount}/${signatureCount} ${signatureCount === 1 ? "signature" : "signatures"} verified`;
9510
- return /* @__PURE__ */ jsx("span", {
9511
- className: twMerge(`text-xs`, verifiedSignaturesCount === 0 ? "text-destructive" : verifiedSignaturesCount === signatureCount ? "text-success" : "text-warning"),
9512
- children: verificationStatusText
9513
- });
9514
- }
9515
- //#endregion
9516
- //#region src/connect/components/revision-history/revision/timestamp.tsx
9517
- function Timestamp(props) {
9518
- const { timestampUtcMs: timestamp } = props;
9519
- const timestampNumber = typeof timestamp === "string" && !timestamp.includes("-") ? parseInt(timestamp) : timestamp;
9520
- const date = new Date(timestampNumber);
9521
- const shortDate = format(date, "HH:mm 'UTC'");
9522
- const longDate = format(date, "eee, dd MMM yyyy HH:mm:ss 'UTC'");
9523
- return /* @__PURE__ */ jsx(CodePopover, {
9524
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, { value: {
9525
- timestampFormatted: longDate,
9526
- timestampUtcMs: timestamp
9527
- } }),
9528
- trigger: /* @__PURE__ */ jsxs("span", {
9529
- className: "cursor-pointer text-xs text-foreground",
9530
- children: ["committed at ", shortDate]
9531
- })
9532
- });
9533
- }
9534
- //#endregion
9535
- //#region src/connect/components/revision-history/revision/revision.tsx
9536
- function _Revision(props) {
9537
- return /* @__PURE__ */ jsxs("article", {
9538
- className: "flex items-center justify-between rounded-xl border border-border bg-background px-4 py-2",
9539
- children: [/* @__PURE__ */ jsxs("div", {
9540
- className: "flex items-center gap-2",
9541
- children: [
9542
- /* @__PURE__ */ jsx(RevisionNumber, { ...props }),
9543
- /* @__PURE__ */ jsx(Operation$1, { ...props }),
9544
- /* @__PURE__ */ jsx(Address, { ...props }),
9545
- /* @__PURE__ */ jsx(Timestamp, { ...props })
9546
- ]
9547
- }), /* @__PURE__ */ jsxs("div", {
9548
- className: "flex items-center gap-1",
9549
- children: [/* @__PURE__ */ jsx(Signature, { ...props }), /* @__PURE__ */ jsx(Errors, { ...props })]
9550
- })]
9551
- });
9552
- }
9553
- const Revision = /*#__PURE__*/ memo(_Revision);
9554
- //#endregion
9555
- //#region src/connect/components/revision-history/skip/skip.tsx
9556
- function Skip(props) {
9557
- const { operationIndex, skipCount } = props;
9558
- const revisionNumber = operationIndex;
9559
- const skippedRevisions = skipCount === 1 ? `${revisionNumber}` : `${revisionNumber} - ${revisionNumber + 1 - skipCount}`;
9560
- return /* @__PURE__ */ jsxs("article", {
9561
- className: "grid grid-cols-[1fr,auto,1fr] items-center py-2",
9562
- children: [
9563
- /* @__PURE__ */ jsx("div", { className: "h-px rounded-full bg-muted" }),
9564
- /* @__PURE__ */ jsxs("div", {
9565
- className: "mx-3 text-xs text-foreground",
9566
- children: [
9567
- "[Skipped Revision ",
9568
- skippedRevisions,
9569
- "]"
9570
- ]
9571
- }),
9572
- /* @__PURE__ */ jsx("div", { className: "h-px rounded-full bg-muted" })
9573
- ]
9574
- });
9575
- }
9576
- //#endregion
9577
- //#region src/connect/components/revision-history/utils.ts
9578
- function makeRows(operations) {
9579
- const revisionsAndSkips = [];
9580
- const seenDays = /* @__PURE__ */ new Set();
9581
- for (const operation of operations) {
9582
- if (!operation.timestampUtcMs) continue;
9583
- const day = operation.timestampUtcMs.split("T")[0];
9584
- if (!seenDays.has(day)) {
9585
- seenDays.add(day);
9586
- revisionsAndSkips.push({
9587
- type: "day",
9588
- height: 32,
9589
- timestampUtcMs: day
9590
- });
9591
- }
9592
- revisionsAndSkips.push({
9593
- type: "revision",
9594
- height: 46,
9595
- operationIndex: operation.index,
9596
- eventId: operation.id ?? "EVENT_ID_NOT_FOUND",
9597
- stateHash: operation.hash,
9598
- operationType: operation.action.type,
9599
- operationInput: operation.action.input ?? {},
9600
- address: operation.action?.context?.signer?.user.address,
9601
- chainId: operation.action?.context?.signer?.user.chainId,
9602
- timestampUtcMs: operation.timestampUtcMs,
9603
- signatures: makeSignatures(operation.action?.context?.signer?.signatures ?? []),
9604
- errors: operation.error ? [operation.error] : void 0
9605
- });
9606
- if (operation.skip > 0) revisionsAndSkips.push({
9607
- type: "skip",
9608
- height: 34,
9609
- operationIndex: operation.index,
9610
- skipCount: operation.skip,
9611
- timestampUtcMs: operation.timestampUtcMs
9612
- });
9613
- }
9614
- return revisionsAndSkips;
9615
- }
9616
- function makeSignatureFromSignatureArray(signatureArray) {
9617
- const [signerAddress, hash, prevStateHash, signatureBytes] = signatureArray;
9618
- return {
9619
- signerAddress,
9620
- hash,
9621
- prevStateHash,
9622
- signatureBytes,
9623
- isVerified: true
9624
- };
9625
- }
9626
- function makeSignatures(signaturesArray) {
9627
- return signaturesArray?.map(makeSignatureFromSignatureArray);
9628
- }
9629
- //#endregion
9630
- //#region src/connect/components/revision-history/timeline/day.tsx
9631
- function Day(props) {
9632
- const { timestampUtcMs: timestamp } = props;
9633
- const formattedDate = format(timestamp, "MMM dd, yyyy");
9634
- return /* @__PURE__ */ jsxs("h2", {
9635
- className: "-ml-6 flex items-center gap-1 bg-background py-2 text-xs text-foreground",
9636
- children: [
9637
- /* @__PURE__ */ jsx(Icon, {
9638
- name: "Ring",
9639
- size: 16
9640
- }),
9641
- " Changes on ",
9642
- formattedDate
9643
- ]
9644
- });
9645
- }
9646
- //#endregion
9647
- //#region src/connect/components/revision-history/timeline/timeline.tsx
9648
- /** How far each row is indented from the timeline's vertical line. */
9649
- const ROW_INSET = 16;
9650
- /**
9651
- * How far the line is inset from the scroll container's clip edge -- exactly
9652
- * the amount the day marker hangs past it (24 pulled back from a 16 inset
9653
- * leaves 8 on the wrong side of zero). Without this the ring is sliced in
9654
- * half, since a scrolling box clips on both axes.
9655
- */
9656
- const DAY_MARKER_OVERHANG = 8;
9657
- /**
9658
- * The revision timeline, windowed by row.
9659
- *
9660
- * The scroll element and the content are deliberately two different
9661
- * elements. A virtualizer decides what is visible by comparing its scroll
9662
- * element's viewport against the total content size, so a scroll element
9663
- * sized to the content is a viewport that shows everything at once: it never
9664
- * scrolls, every row is "visible", and the whole page renders while still
9665
- * paying the virtualizer's bookkeeping. The outer element here is therefore
9666
- * bounded and scrollable, and the inner sizer carries the full height that
9667
- * the absolutely positioned rows are placed within.
9668
- */
9669
- function Timeline(props) {
9670
- const { operations, maxHeight = "70vh" } = props;
9671
- const rows = useMemo(() => makeRows([...operations]), [operations]);
9672
- const parentRef = useRef(null);
9673
- const rowVirtualizer = useVirtualizer({
9674
- count: rows.length,
9675
- getScrollElement: () => parentRef.current,
9676
- estimateSize: (i) => rows[i]?.height ?? 0,
9677
- gap: 8,
9678
- overscan: 8
9679
- });
9680
- return /* @__PURE__ */ jsx("div", {
9681
- "data-testid": "revision-timeline",
9682
- ref: parentRef,
9683
- style: {
9684
- maxHeight,
9685
- overflowY: "auto",
9686
- width: "100%",
9687
- position: "relative"
9688
- },
9689
- children: /* @__PURE__ */ jsx("div", {
9690
- className: "border-l border-border dark:border-none",
9691
- style: {
9692
- height: `${rowVirtualizer.getTotalSize()}px`,
9693
- marginLeft: DAY_MARKER_OVERHANG,
9694
- position: "relative"
9695
- },
9696
- children: rowVirtualizer.getVirtualItems().map((virtualRow) => {
9697
- const row = rows[virtualRow.index];
9698
- if (!row) return null;
9699
- return /* @__PURE__ */ jsxs("div", {
9700
- style: {
9701
- position: "absolute",
9702
- top: 0,
9703
- left: ROW_INSET,
9704
- right: 0,
9705
- height: `${virtualRow.size}px`,
9706
- transform: `translateY(${virtualRow.start}px)`
9707
- },
9708
- children: [
9709
- row.type === "revision" && /* @__PURE__ */ jsx(Revision, { ...row }),
9710
- row.type === "skip" && /* @__PURE__ */ jsx(Skip, { ...row }),
9711
- row.type === "day" && /* @__PURE__ */ jsx(Day, { ...row })
9712
- ]
9713
- }, virtualRow.key);
9714
- })
9715
- })
9716
- });
9717
- }
9718
- //#endregion
9719
8357
  //#region src/connect/components/revision-history/revision-history.tsx
9720
- /** The current, scoped props. */
9721
- /**
9722
- * Legacy props: the whole global and local history, toggled inside the
9723
- * component.
9724
- * @deprecated Pass one scope's `operations` with `scopes`/`scope`/`onScopeChange` and the loading props. Removed in the next major.
9725
- */
9726
- /**
9727
- * The revision history panel. Pages arrive oldest first while the timeline
9728
- * renders newest first, so rendering progressively would show operations in
9729
- * the wrong order until the last page landed and would repaint the whole
9730
- * timeline on every page in between. Instead the component keeps asking for
9731
- * the next page, showing "Loading operations…" and a running count, until
9732
- * the walk completes, then renders the pagination and timeline once.
9733
- */
9734
- function ScopedRevisionHistory(props) {
9735
- const { documentTitle, documentId, operations, isLoading, hasNextPage, onLoadNextPage, scopes, scope, onScopeChange, onClose, itemsPerPage = 100, documentState, onCopyState, onCopyDocId, error } = props;
9736
- useEffect(() => {
9737
- if (!hasNextPage || isLoading || error) return;
9738
- const handle = window.setTimeout(onLoadNextPage, 0);
9739
- return () => window.clearTimeout(handle);
9740
- }, [
9741
- hasNextPage,
9742
- isLoading,
9743
- onLoadNextPage,
9744
- error
9745
- ]);
9746
- const isWalking = !error && (hasNextPage || isLoading && operations.length === 0);
9747
- const visibleOperations = useMemo(() => isWalking ? [] : garbageCollect(sortOperations([...operations])).sort((a, b) => b.index - a.index), [operations, isWalking]);
9748
- const { pageItems, pages, goToPage, goToNextPage, goToPreviousPage, goToFirstPage, goToLastPage, hiddenNextPages, isNextPageAvailable, isPreviousPageAvailable } = usePagination(visibleOperations, { itemsPerPage });
9749
- function onChangeScope(nextScope) {
9750
- goToFirstPage();
9751
- onScopeChange(nextScope);
9752
- }
9753
- const PaginationComponent = visibleOperations.length > itemsPerPage ? /* @__PURE__ */ jsx("div", {
9754
- className: "mt-4 flex w-full justify-end",
9755
- children: /* @__PURE__ */ jsx(Pagination, {
9756
- firstPageLabel: "First Page",
9757
- goToFirstPage,
9758
- goToLastPage,
9759
- goToNextPage,
9760
- goToPage,
9761
- goToPreviousPage,
9762
- hiddenNextPages,
9763
- isNextPageAvailable,
9764
- isPreviousPageAvailable,
9765
- lastPageLabel: "Last Page",
9766
- nextPageLabel: "Next",
9767
- pages,
9768
- previousPageLabel: "Previous"
9769
- })
9770
- }) : /* @__PURE__ */ jsx("hr", { className: "h-12 border-none" });
9771
- const hasOperations = visibleOperations.length > 0;
9772
- return /* @__PURE__ */ jsx(ConnectTooltipProvider, { children: /* @__PURE__ */ jsxs("div", {
9773
- className: "p-6",
9774
- children: [/* @__PURE__ */ jsx(Header, {
9775
- docId: documentId,
9776
- onChangeScope,
9777
- onClose,
9778
- scope,
9779
- scopes,
9780
- title: documentTitle,
9781
- documentState,
9782
- onCopyState,
9783
- onCopyDocId
9784
- }), isWalking ? /* @__PURE__ */ jsxs("div", {
9785
- className: "mt-4 flex flex-col items-center rounded-md bg-background p-4",
9786
- children: [/* @__PURE__ */ jsx("h3", {
9787
- className: "my-40 text-foreground",
9788
- children: "Loading operations…"
9789
- }), operations.length > 0 && /* @__PURE__ */ jsxs("p", {
9790
- className: "text-xs text-muted-foreground",
9791
- children: [operations.length, " loaded so far"]
9792
- })]
9793
- }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
9794
- PaginationComponent,
9795
- /* @__PURE__ */ jsxs("div", {
9796
- className: "mt-4 flex flex-col items-center rounded-md bg-background p-4",
9797
- children: [error && /* @__PURE__ */ jsxs("p", {
9798
- className: "mb-2 text-xs text-destructive",
9799
- children: ["Could not load the rest of the history: ", error.message]
9800
- }), hasOperations ? /* @__PURE__ */ jsx("div", {
9801
- className: "grid grid-cols-[minmax(min-content,1018px)]",
9802
- children: /* @__PURE__ */ jsx(Timeline, { operations: pageItems })
9803
- }) : error ? null : /* @__PURE__ */ jsx("h3", {
9804
- className: "my-40 text-foreground",
9805
- children: "This document has no recorded operations yet."
9806
- })]
9807
- }),
9808
- PaginationComponent
9809
- ] })]
9810
- }) });
9811
- }
9812
- const LEGACY_SCOPES = ["global", "local"];
9813
- const noop = () => {};
9814
- /** Toggles between the whole global and local history loaded up front. */
9815
- function LegacyRevisionHistory(props) {
9816
- const { globalOperations, localOperations, ...common } = props;
9817
- const [scope, setScope] = useState("global");
9818
- return /* @__PURE__ */ jsx(ScopedRevisionHistory, {
9819
- ...common,
9820
- operations: scope === "local" ? localOperations : globalOperations,
9821
- isLoading: false,
9822
- hasNextPage: false,
9823
- onLoadNextPage: noop,
9824
- scopes: LEGACY_SCOPES,
9825
- scope,
9826
- onScopeChange: setScope
9827
- });
9828
- }
9829
- /**
9830
- * The revision history panel. Pages arrive oldest first while the timeline
9831
- * renders newest first, so it waits for the whole history to load before
9832
- * rendering the timeline, showing "Loading operations…" and a running count
9833
- * in the meantime.
9834
- *
9835
- * Also accepts the deprecated `globalOperations`/`localOperations` pair
9836
- * (see `RevisionHistoryLegacyProps`), toggling between them internally.
9837
- */
9838
- function RevisionHistory(props) {
9839
- return "globalOperations" in props ? /* @__PURE__ */ jsx(LegacyRevisionHistory, { ...props }) : /* @__PURE__ */ jsx(ScopedRevisionHistory, { ...props });
9840
- }
8358
+ const RevisionHistory = lazyComponent(() => import("../revision-history.impl-uogo6xDI.js").then((m) => m.RevisionHistory));
9841
8359
  //#endregion
9842
8360
  //#region src/connect/components/search-bar/filter-item.tsx
9843
8361
  const FilterItem = (props) => {
@@ -9903,27 +8421,60 @@ const ConnectSearchBar = (props) => {
9903
8421
  });
9904
8422
  };
9905
8423
  //#endregion
8424
+ //#region src/connect/components/tooltip/tooltip.tsx
8425
+ function ConnectTooltip(props) {
8426
+ const { children, content, open, defaultOpen, onOpenChange, className, side = "top", sideOffset = 5, delayDuration, ...rest } = props;
8427
+ return /* @__PURE__ */ jsxs(Root, {
8428
+ defaultOpen,
8429
+ delayDuration,
8430
+ onOpenChange,
8431
+ open,
8432
+ children: [/* @__PURE__ */ jsx(Trigger, {
8433
+ asChild: true,
8434
+ children
8435
+ }), /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content, {
8436
+ ...rest,
8437
+ side,
8438
+ sideOffset,
8439
+ className: twMerge("z-50 rounded-lg border border-border bg-popover p-2 text-xs text-popover-foreground shadow-tooltip", className),
8440
+ children: content
8441
+ }) })]
8442
+ });
8443
+ }
8444
+ const ConnectTooltipProvider = Provider;
8445
+ //#endregion
9906
8446
  //#region src/connect/components/sidebar/sidebar-item.tsx
9907
8447
  const SidebarItem = function SidebarItem(props) {
9908
- const { icon, title, description: _description, containerClassName, active, onClick } = props;
8448
+ const { icon, title, description: _description, containerClassName, active, href, onClick, onPreload } = props;
8449
+ const Element = href ? "a" : "div";
8450
+ const current = href ? props["aria-current"] : void 0;
9909
8451
  return /* @__PURE__ */ jsx(ConnectTooltip, {
9910
8452
  content: title,
9911
8453
  side: "right",
9912
8454
  sideOffset: 12,
9913
8455
  className: "border-none bg-primary px-3 py-2 text-sm text-primary-foreground",
9914
- children: /* @__PURE__ */ jsxs("div", {
9915
- className: twMerge("group/sidebar-item relative flex cursor-pointer flex-col items-center justify-center text-center text-sm text-foreground", containerClassName, active && "bg-sidebar-accent text-sidebar-accent-foreground", onClick && "cursor-pointer"),
8456
+ children: /* @__PURE__ */ jsxs(Element, {
8457
+ href,
8458
+ "aria-current": current,
8459
+ className: twMerge("group/sidebar-item relative flex cursor-pointer flex-col items-center justify-center text-center text-sm text-foreground", containerClassName, "aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground", active && "bg-sidebar-accent text-sidebar-accent-foreground", onClick && "cursor-pointer"),
9916
8460
  onClick,
9917
- children: [active ? /* @__PURE__ */ jsx("div", { className: "absolute top-1/2 left-0 h-10 w-1 -translate-y-1/2 rounded-r-sm bg-info" }) : /* @__PURE__ */ jsx("div", { className: "absolute top-1/2 left-0 h-6 w-1 -translate-y-1/2 rounded-r-sm bg-secondary opacity-0 transition-opacity group-hover/sidebar-item:opacity-100" }), /* @__PURE__ */ jsx("div", {
9918
- className: "mx-auto py-4",
9919
- children: icon || /* @__PURE__ */ jsx("div", {
9920
- className: "flex size-8 items-center justify-center rounded-lg bg-primary",
9921
- children: /* @__PURE__ */ jsx("span", {
9922
- className: "text-sm font-medium text-primary-foreground",
9923
- children: title.slice(0, 1).toUpperCase()
8461
+ onMouseEnter: onPreload,
8462
+ onTouchStart: onPreload,
8463
+ onFocus: href ? onPreload : void 0,
8464
+ children: [
8465
+ /* @__PURE__ */ jsx("div", { className: twMerge("absolute top-1/2 left-0 hidden h-10 w-1 -translate-y-1/2 rounded-r-sm bg-info group-aria-[current=page]/sidebar-item:block", active && "block") }),
8466
+ /* @__PURE__ */ jsx("div", { className: twMerge("absolute top-1/2 left-0 h-6 w-1 -translate-y-1/2 rounded-r-sm bg-secondary opacity-0 transition-opacity group-hover/sidebar-item:opacity-100 group-aria-[current=page]/sidebar-item:hidden", active && "hidden") }),
8467
+ /* @__PURE__ */ jsx("div", {
8468
+ className: "mx-auto py-4",
8469
+ children: icon || /* @__PURE__ */ jsx("div", {
8470
+ className: "flex size-8 items-center justify-center rounded-lg bg-primary",
8471
+ children: /* @__PURE__ */ jsx("span", {
8472
+ className: "text-sm font-medium text-primary-foreground",
8473
+ children: title.slice(0, 1).toUpperCase()
8474
+ })
9924
8475
  })
9925
8476
  })
9926
- })]
8477
+ ]
9927
8478
  })
9928
8479
  });
9929
8480
  };
@@ -10088,7 +8639,15 @@ const SidebarUser = ({ address, ensName, avatarUrl, etherscanUrl, onDisconnect }
10088
8639
  };
10089
8640
  //#endregion
10090
8641
  //#region src/connect/components/sidebar/sidebar-footer.tsx
10091
- const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin, onClickSettings, onDisconnect, onHomeClick, showDebug, onDebugClick, etherscanUrl = "", ...props }) => {
8642
+ const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin, onClickSettings, settingsHref, settingsCurrent, onDisconnect, onHomeClick, showDebug, onDebugClick, etherscanUrl = "", ...props }) => {
8643
+ const settingsIcon = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Settings, {
8644
+ className: "text-foreground",
8645
+ size: 24,
8646
+ strokeWidth: 2
8647
+ }), /* @__PURE__ */ jsx("span", {
8648
+ className: "hidden text-sm/6 font-semibold text-foreground",
8649
+ children: "Settings"
8650
+ })] });
10092
8651
  return /* @__PURE__ */ jsxs(SidebarFooter, {
10093
8652
  ...props,
10094
8653
  className: twMerge("flex flex-col items-center gap-3 border-t border-sidebar-border px-2 py-4 dark:border-none", className),
@@ -10125,19 +8684,19 @@ const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin,
10125
8684
  etherscanUrl
10126
8685
  }) : /* @__PURE__ */ jsx(SidebarLogin, { onLogin })
10127
8686
  }),
10128
- /* @__PURE__ */ jsxs("button", {
8687
+ settingsHref ? /* @__PURE__ */ jsx("a", {
8688
+ "aria-label": "Settings",
8689
+ href: settingsHref,
8690
+ "aria-current": settingsCurrent,
8691
+ className: "cursor-pointer rounded-md aria-[current=page]:bg-sidebar-accent",
8692
+ onClick: onClickSettings,
8693
+ children: settingsIcon
8694
+ }) : /* @__PURE__ */ jsx("button", {
10129
8695
  "aria-label": "Settings",
10130
8696
  type: "button",
10131
8697
  className: twMerge(onClickSettings ? "cursor-pointer" : "cursor-wait"),
10132
8698
  onClick: onClickSettings,
10133
- children: [/* @__PURE__ */ jsx(Settings, {
10134
- className: "text-foreground",
10135
- size: 24,
10136
- strokeWidth: 2
10137
- }), /* @__PURE__ */ jsx("span", {
10138
- className: "hidden text-sm/6 font-semibold text-foreground",
10139
- children: "Settings"
10140
- })]
8699
+ children: settingsIcon
10141
8700
  })
10142
8701
  ]
10143
8702
  });
@@ -10154,7 +8713,7 @@ const ConnectSidebarHeader = ({ className, children, ...props }) => {
10154
8713
  };
10155
8714
  //#endregion
10156
8715
  //#region src/connect/components/sidebar/sidebar.tsx
10157
- const ConnectSidebar = ({ onClick, address, ensName, avatarUrl, headerContent, onClickSettings, maxWidth = "304px", minWidth = "58px", onLogin, onDisconnect, etherscanUrl, showDebug, onDebugClick, ...props }) => {
8716
+ const ConnectSidebar = ({ onClick, address, ensName, avatarUrl, headerContent, onClickSettings, settingsHref, settingsCurrent, maxWidth = "304px", minWidth = "58px", onLogin, onDisconnect, etherscanUrl, showDebug, onDebugClick, ...props }) => {
10158
8717
  return /* @__PURE__ */ jsxs(Sidebar, {
10159
8718
  ...props,
10160
8719
  maxWidth,
@@ -10167,6 +8726,8 @@ const ConnectSidebar = ({ onClick, address, ensName, avatarUrl, headerContent, o
10167
8726
  ensName,
10168
8727
  avatarUrl,
10169
8728
  onClickSettings,
8729
+ settingsHref,
8730
+ settingsCurrent,
10170
8731
  onLogin,
10171
8732
  onDisconnect,
10172
8733
  etherscanUrl,
@@ -10245,6 +8806,21 @@ function ThemeSwitch({ horizontal = false }) {
10245
8806
  });
10246
8807
  }
10247
8808
  //#endregion
8809
+ //#region src/connect/components/toggle/toggle.tsx
8810
+ const Toggle = /*#__PURE__*/ forwardRef(function Toggle(props, ref) {
8811
+ return /* @__PURE__ */ jsxs("label", {
8812
+ className: "relative cursor-pointer items-center",
8813
+ htmlFor: props.id,
8814
+ children: [/* @__PURE__ */ jsx("input", {
8815
+ className: "peer sr-only",
8816
+ ref,
8817
+ type: "checkbox",
8818
+ value: "",
8819
+ ...props
8820
+ }), /* @__PURE__ */ jsx("div", { className: "peer h-6 w-11 rounded-full bg-muted-foreground peer-checked:bg-info peer-focus:outline-none after:absolute after:inset-s-0.5 after:top-0.5 after:size-5 after:rounded-full after:border after:border-none after:bg-background after:transition-all peer-checked:after:translate-x-full" })]
8821
+ });
8822
+ });
8823
+ //#endregion
10248
8824
  //#region src/connect/utils/get-folder-status.ts
10249
8825
  /**
10250
8826
  * Retrieves the sync status of a folder based on its path and their children files.