@powerhousedao/design-system 6.2.3-dev.1 → 6.2.3-dev.100

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 (405) hide show
  1. package/dist/PinFilled-cSbUqZCA.js +41 -0
  2. package/dist/PinFilled-cSbUqZCA.js.map +1 -0
  3. package/dist/{Removed-CO_5C1ce.js → Removed-OP4eTrAN.js} +1 -1
  4. package/dist/{Removed-CO_5C1ce.js.map → Removed-OP4eTrAN.js.map} +1 -1
  5. package/dist/{Tabler-FjvVqX5a.js → Tabler-rjLxlzUV.js} +1 -1
  6. package/dist/{Tabler-FjvVqX5a.js.map → Tabler-rjLxlzUV.js.map} +1 -1
  7. package/dist/add-local-drive-form.impl-COIpcmgW.js +76 -0
  8. package/dist/add-local-drive-form.impl-COIpcmgW.js.map +1 -0
  9. package/dist/add-remote-drive-form.impl-_SqOzbSt.js +123 -0
  10. package/dist/add-remote-drive-form.impl-_SqOzbSt.js.map +1 -0
  11. package/dist/address-DVC3zalI.js +92 -0
  12. package/dist/address-DVC3zalI.js.map +1 -0
  13. package/dist/button-BYcXvZXr.d.ts +13 -0
  14. package/dist/button-BYcXvZXr.d.ts.map +1 -0
  15. package/dist/{character-counter-BWoglM2P.d.ts → character-counter-BZmZZCHN.d.ts} +2 -1
  16. package/dist/character-counter-BZmZZCHN.d.ts.map +1 -0
  17. package/dist/{checkbox-CGBtXQnI.d.ts → checkbox-BIAGwP7d.d.ts} +4 -4
  18. package/dist/checkbox-BIAGwP7d.d.ts.map +1 -0
  19. package/dist/{checkbox-base-CZo-4eL0.d.ts → checkbox-base-Bm0GPWgm.d.ts} +2 -2
  20. package/dist/checkbox-base-Bm0GPWgm.d.ts.map +1 -0
  21. package/dist/combobox.impl-CQHG0NgO.js +144 -0
  22. package/dist/combobox.impl-CQHG0NgO.js.map +1 -0
  23. package/dist/{command--QCHwqST.d.ts → command-DHHTsHfH.d.ts} +9 -9
  24. package/dist/command-DHHTsHfH.d.ts.map +1 -0
  25. package/dist/connect/components/toast/toast.d.ts +8 -10
  26. package/dist/connect/components/toast/toast.d.ts.map +1 -1
  27. package/dist/connect/components/toast/toast.js +4 -4
  28. package/dist/connect/components/toast/toast.js.map +1 -1
  29. package/dist/connect/index.d.ts +541 -364
  30. package/dist/connect/index.d.ts.map +1 -1
  31. package/dist/connect/index.js +1205 -1657
  32. package/dist/connect/index.js.map +1 -1
  33. package/dist/{content-BHWIqmio.d.ts → content-Cv0kRppo.d.ts} +3 -3
  34. package/dist/content-Cv0kRppo.d.ts.map +1 -0
  35. package/dist/default-editor.impl-a6EOuEme.js +30 -0
  36. package/dist/default-editor.impl-a6EOuEme.js.map +1 -0
  37. package/dist/document-timeline.impl-zx6f7k2d.js +254 -0
  38. package/dist/document-timeline.impl-zx6f7k2d.js.map +1 -0
  39. package/dist/drive-settings-form.impl-yV9u4h5c.js +172 -0
  40. package/dist/drive-settings-form.impl-yV9u4h5c.js.map +1 -0
  41. package/dist/{enum-field-CwZVs3Ux.d.ts → enum-field-Cub1rt3e.d.ts} +4 -4
  42. package/dist/enum-field-Cub1rt3e.d.ts.map +1 -0
  43. package/dist/{form-CKRKn0TQ.d.ts → form-Brj5AQNr.d.ts} +3 -4
  44. package/dist/form-Brj5AQNr.d.ts.map +1 -0
  45. package/dist/{form-description-CYkcMEzm.d.ts → form-description-DJrDJzJi.d.ts} +2 -1
  46. package/dist/form-description-DJrDJzJi.d.ts.map +1 -0
  47. package/dist/{form-group-C8kL6pdZ.d.ts → form-group-Ckd28lpW.d.ts} +2 -1
  48. package/dist/form-group-Ckd28lpW.d.ts.map +1 -0
  49. package/dist/{form-label-b6nQi0XO.d.ts → form-label-C8ghd_lR.d.ts} +2 -1
  50. package/dist/form-label-C8ghd_lR.d.ts.map +1 -0
  51. package/dist/{form-message-Dq72nBXz.d.ts → form-message-CnKUkvlj.d.ts} +2 -1
  52. package/dist/form-message-CnKUkvlj.d.ts.map +1 -0
  53. package/dist/form-server-error-message-D2tFtDZ0.d.ts +6 -0
  54. package/dist/form-server-error-message-D2tFtDZ0.d.ts.map +1 -0
  55. package/dist/formatted-json-viewer.impl-COERJCiE.js +58 -0
  56. package/dist/formatted-json-viewer.impl-COERJCiE.js.map +1 -0
  57. package/dist/icon-DQ2yrWYv.js +358 -0
  58. package/dist/icon-DQ2yrWYv.js.map +1 -0
  59. package/dist/{icon-C4QOpsdI.js → icon-components-NK-y5dkv.js} +7 -481
  60. package/dist/icon-components-NK-y5dkv.js.map +1 -0
  61. package/dist/{id-autocomplete-C-hwriS5.d.ts → id-autocomplete-8LcmtjSR.d.ts} +3 -3
  62. package/dist/id-autocomplete-8LcmtjSR.d.ts.map +1 -0
  63. package/dist/{id-autocomplete-input-container-DFEyPh5p.d.ts → id-autocomplete-input-container-D2L7p-Yh.d.ts} +3 -3
  64. package/dist/id-autocomplete-input-container-D2L7p-Yh.d.ts.map +1 -0
  65. package/dist/{id-autocomplete-list-EzLpF23C.d.ts → id-autocomplete-list-BXvN07Hr.d.ts} +3 -3
  66. package/dist/id-autocomplete-list-BXvN07Hr.d.ts.map +1 -0
  67. package/dist/{id-autocomplete-list-option-CB5B07Hi.d.ts → id-autocomplete-list-option-D_1BOv50.d.ts} +4 -3
  68. package/dist/id-autocomplete-list-option-D_1BOv50.d.ts.map +1 -0
  69. package/dist/{index--hDSfvJT.d.ts → index-5FEr1tXH.d.ts} +25 -59
  70. package/dist/index-5FEr1tXH.d.ts.map +1 -0
  71. package/dist/index-C-Tup7Br.d.ts +4 -0
  72. package/dist/index-D6Zk5OLV.d.ts +4 -0
  73. package/dist/index-i-xHUsLr.d.ts +30 -0
  74. package/dist/index-jfVVOU-H.d.ts +2 -0
  75. package/dist/index.d.ts +5 -3
  76. package/dist/index.js +2 -2
  77. package/dist/{input-BpEQjaWV.d.ts → input-WDvjJFqf.d.ts} +2 -2
  78. package/dist/input-WDvjJFqf.d.ts.map +1 -0
  79. package/dist/json-viewer-Kg0IBIt-.d.ts +7 -0
  80. package/dist/json-viewer-Kg0IBIt-.d.ts.map +1 -0
  81. package/dist/label-nH2HoKfI.js +15 -0
  82. package/dist/label-nH2HoKfI.js.map +1 -0
  83. package/dist/location-info-C3YbSsV0.js +47 -0
  84. package/dist/location-info-C3YbSsV0.js.map +1 -0
  85. package/dist/{message-list-C4mPpBBa.d.ts → message-list-D8d2ltLd.d.ts} +3 -3
  86. package/dist/message-list-D8d2ltLd.d.ts.map +1 -0
  87. package/dist/{popover-XSBOuSih.d.ts → popover-TvQxa0RU.d.ts} +2 -2
  88. package/dist/popover-TvQxa0RU.d.ts.map +1 -0
  89. package/dist/{radio-eL0Oy86J.d.ts → radio-CTS4WsNy.d.ts} +2 -2
  90. package/dist/radio-CTS4WsNy.d.ts.map +1 -0
  91. package/dist/{radio-group-Bkli6nUz.d.ts → radio-group-CROIwgYz.d.ts} +2 -2
  92. package/dist/radio-group-CROIwgYz.d.ts.map +1 -0
  93. package/dist/{radio-group-field-wlqeiLN3.d.ts → radio-group-field-X18o287K.d.ts} +5 -6
  94. package/dist/radio-group-field-X18o287K.d.ts.map +1 -0
  95. package/dist/revision-history.impl-DRbeai2m.js +642 -0
  96. package/dist/revision-history.impl-DRbeai2m.js.map +1 -0
  97. package/dist/{search-autocomplete-BJJkrZ1i.d.ts → search-autocomplete-COvFRZIb.d.ts} +3 -3
  98. package/dist/search-autocomplete-COvFRZIb.d.ts.map +1 -0
  99. package/dist/{select-field-C97QIhUL.d.ts → select-field-DHaCiAso.d.ts} +5 -5
  100. package/dist/select-field-DHaCiAso.d.ts.map +1 -0
  101. package/dist/{selected-content-CGsK5PR4.d.ts → selected-content-CSTFkQr9.d.ts} +3 -3
  102. package/dist/selected-content-CSTFkQr9.d.ts.map +1 -0
  103. package/dist/{sidebar-DOoE4krt.d.ts → sidebar-DFqreKf1.d.ts} +3 -3
  104. package/dist/sidebar-DFqreKf1.d.ts.map +1 -0
  105. package/dist/{sidebar-provider-C2eyz9TL.d.ts → sidebar-provider-CZHhqW5n.d.ts} +4 -8
  106. package/dist/sidebar-provider-CZHhqW5n.d.ts.map +1 -0
  107. package/dist/splitted-input-diff-DNKcSOAB.d.ts +11 -0
  108. package/dist/splitted-input-diff-DNKcSOAB.d.ts.map +1 -0
  109. package/dist/{src-CVV6HzQZ.js → src-DhSJCeu5.js} +180 -24
  110. package/dist/src-DhSJCeu5.js.map +1 -0
  111. package/dist/style.css +144 -62
  112. package/dist/text-field-Dq1DTC_t.d.ts +9 -0
  113. package/dist/text-field-Dq1DTC_t.d.ts.map +1 -0
  114. package/dist/{text-input-8zXIWHLi.d.ts → text-input-CRjOT54_.d.ts} +5 -6
  115. package/dist/text-input-CRjOT54_.d.ts.map +1 -0
  116. package/dist/text-input-diff-CcF0QblL.d.ts +12 -0
  117. package/dist/text-input-diff-CcF0QblL.d.ts.map +1 -0
  118. package/dist/{tooltip-BxS9HpML.d.ts → tooltip-B4uQJPUm.d.ts} +3 -4
  119. package/dist/tooltip-B4uQJPUm.d.ts.map +1 -0
  120. package/dist/{types-Bsn62tJB.d.ts → types-BNTIrhb5.d.ts} +2 -1
  121. package/dist/types-BNTIrhb5.d.ts.map +1 -0
  122. package/dist/{types-BTq-St7H.d.ts → types-CpFPFB1a.d.ts} +2 -1
  123. package/dist/types-CpFPFB1a.d.ts.map +1 -0
  124. package/dist/{types-C04Q_Fan.d.ts → types-D4CirgNk.d.ts} +2 -2
  125. package/dist/types-D4CirgNk.d.ts.map +1 -0
  126. package/dist/{types-CNbvfWjh.d.ts → types-FTqFl5du.d.ts} +3 -3
  127. package/dist/types-FTqFl5du.d.ts.map +1 -0
  128. package/dist/types-TZijOYrE.d.ts +17 -0
  129. package/dist/types-TZijOYrE.d.ts.map +1 -0
  130. package/dist/ui/components/button/button.d.ts +3 -2
  131. package/dist/ui/components/button/button.js +1 -1
  132. package/dist/ui/components/button/button.js.map +1 -1
  133. package/dist/ui/components/character-counter/character-counter.d.ts +3 -2
  134. package/dist/ui/components/character-counter/character-counter.js.map +1 -1
  135. package/dist/ui/components/checkbox/checkbox-base.d.ts +3 -2
  136. package/dist/ui/components/checkbox/checkbox-base.js +1 -1
  137. package/dist/ui/components/checkbox/checkbox-base.js.map +1 -1
  138. package/dist/ui/components/checkbox/checkbox.d.ts +3 -2
  139. package/dist/ui/components/checkbox/checkbox.js +1 -1
  140. package/dist/ui/components/checkbox/checkbox.js.map +1 -1
  141. package/dist/ui/components/command/command.d.ts +3 -2
  142. package/dist/ui/components/command/command.js +8 -8
  143. package/dist/ui/components/command/command.js.map +1 -1
  144. package/dist/ui/components/enum-field/enum-field.d.ts +3 -2
  145. package/dist/ui/components/enum-field/enum-field.js +1 -1
  146. package/dist/ui/components/enum-field/enum-field.js.map +1 -1
  147. package/dist/ui/components/enum-field/types.d.ts +3 -2
  148. package/dist/ui/components/form/form.d.ts +3 -2
  149. package/dist/ui/components/form/form.js +1 -1
  150. package/dist/ui/components/form/form.js.map +1 -1
  151. package/dist/ui/components/form/utils.d.ts +4 -4
  152. package/dist/ui/components/form/utils.d.ts.map +1 -1
  153. package/dist/ui/components/form/utils.js.map +1 -1
  154. package/dist/ui/components/form-description/form-description.d.ts +3 -2
  155. package/dist/ui/components/form-description/form-description.js.map +1 -1
  156. package/dist/ui/components/form-group/form-group.d.ts +3 -2
  157. package/dist/ui/components/form-group/form-group.js.map +1 -1
  158. package/dist/ui/components/form-label/form-label.d.ts +3 -2
  159. package/dist/ui/components/form-label/form-label.js +3 -2
  160. package/dist/ui/components/form-label/form-label.js.map +1 -1
  161. package/dist/ui/components/form-message/form-message.d.ts +3 -2
  162. package/dist/ui/components/form-message/form-message.js.map +1 -1
  163. package/dist/ui/components/form-message/form-server-error-message.d.ts +3 -2
  164. package/dist/ui/components/form-message/form-server-error-message.js.map +1 -1
  165. package/dist/ui/components/form-message/message-list.d.ts +3 -2
  166. package/dist/ui/components/form-message/message-list.js.map +1 -1
  167. package/dist/ui/components/id-autocomplete/id-autocomplete-context.d.ts +3 -5
  168. package/dist/ui/components/id-autocomplete/id-autocomplete-context.d.ts.map +1 -1
  169. package/dist/ui/components/id-autocomplete/id-autocomplete-context.js +1 -1
  170. package/dist/ui/components/id-autocomplete/id-autocomplete-context.js.map +1 -1
  171. package/dist/ui/components/id-autocomplete/id-autocomplete-input-container.d.ts +3 -2
  172. package/dist/ui/components/id-autocomplete/id-autocomplete-input-container.js +2 -2
  173. package/dist/ui/components/id-autocomplete/id-autocomplete-input-container.js.map +1 -1
  174. package/dist/ui/components/id-autocomplete/id-autocomplete-list-option.d.ts +3 -2
  175. package/dist/ui/components/id-autocomplete/id-autocomplete-list-option.js +2 -2
  176. package/dist/ui/components/id-autocomplete/id-autocomplete-list-option.js.map +1 -1
  177. package/dist/ui/components/id-autocomplete/id-autocomplete-list.d.ts +3 -2
  178. package/dist/ui/components/id-autocomplete/id-autocomplete-list.js.map +1 -1
  179. package/dist/ui/components/id-autocomplete/id-autocomplete.d.ts +3 -2
  180. package/dist/ui/components/id-autocomplete/id-autocomplete.js +1 -1
  181. package/dist/ui/components/id-autocomplete/id-autocomplete.js.map +1 -1
  182. package/dist/ui/components/id-autocomplete/types.d.ts +3 -2
  183. package/dist/ui/components/id-autocomplete/use-id-autocomplete.d.ts +3 -2
  184. package/dist/ui/components/id-autocomplete/use-id-autocomplete.js.map +1 -1
  185. package/dist/ui/components/index.d.ts +42 -40
  186. package/dist/ui/components/input/input.d.ts +3 -2
  187. package/dist/ui/components/input/input.js +1 -1
  188. package/dist/ui/components/input/input.js.map +1 -1
  189. package/dist/ui/components/input/splitted-input-diff.d.ts +3 -2
  190. package/dist/ui/components/input/splitted-input-diff.js +10 -9
  191. package/dist/ui/components/input/splitted-input-diff.js.map +1 -1
  192. package/dist/ui/components/input/subcomponent/input-diff.d.ts +2 -11
  193. package/dist/ui/components/input/subcomponent/input-diff.d.ts.map +1 -1
  194. package/dist/ui/components/input/subcomponent/input-diff.js.map +1 -1
  195. package/dist/ui/components/input/subcomponent/text-diff.d.ts +3 -12
  196. package/dist/ui/components/input/subcomponent/text-diff.d.ts.map +1 -1
  197. package/dist/ui/components/input/subcomponent/text-diff.js.map +1 -1
  198. package/dist/ui/components/json-viewer/json-viewer.d.ts +3 -2
  199. package/dist/ui/components/json-viewer/json-viewer.js +1 -1
  200. package/dist/ui/components/json-viewer/json-viewer.js.map +1 -1
  201. package/dist/ui/components/popover/popover.d.ts +3 -2
  202. package/dist/ui/components/popover/popover.js +1 -1
  203. package/dist/ui/components/popover/popover.js.map +1 -1
  204. package/dist/ui/components/radio-group-field/radio-group-field.d.ts +3 -2
  205. package/dist/ui/components/radio-group-field/radio-group-field.js +4 -3
  206. package/dist/ui/components/radio-group-field/radio-group-field.js.map +1 -1
  207. package/dist/ui/components/radio-group-field/radio-group.d.ts +3 -2
  208. package/dist/ui/components/radio-group-field/radio-group.js +1 -1
  209. package/dist/ui/components/radio-group-field/radio-group.js.map +1 -1
  210. package/dist/ui/components/radio-group-field/radio.d.ts +3 -2
  211. package/dist/ui/components/radio-group-field/radio.js +1 -1
  212. package/dist/ui/components/radio-group-field/radio.js.map +1 -1
  213. package/dist/ui/components/search-autocomplete/index.d.ts +6 -4
  214. package/dist/ui/components/search-autocomplete/search-autocomplete.d.ts +3 -2
  215. package/dist/ui/components/search-autocomplete/search-autocomplete.js.map +1 -1
  216. package/dist/ui/components/search-autocomplete/types.d.ts +3 -2
  217. package/dist/ui/components/search-autocomplete/use-search-autocomplete.d.ts +3 -2
  218. package/dist/ui/components/search-autocomplete/use-search-autocomplete.js.map +1 -1
  219. package/dist/ui/components/select-field/content.d.ts +3 -2
  220. package/dist/ui/components/select-field/content.js +1 -1
  221. package/dist/ui/components/select-field/content.js.map +1 -1
  222. package/dist/ui/components/select-field/select-field.d.ts +3 -2
  223. package/dist/ui/components/select-field/select-field.js +1 -1
  224. package/dist/ui/components/select-field/select-field.js.map +1 -1
  225. package/dist/ui/components/select-field/selected-content.d.ts +3 -2
  226. package/dist/ui/components/select-field/selected-content.js +1 -1
  227. package/dist/ui/components/select-field/selected-content.js.map +1 -1
  228. package/dist/ui/components/select-field/subcomponents/CommandItemList.d.ts +3 -4
  229. package/dist/ui/components/select-field/subcomponents/CommandItemList.d.ts.map +1 -1
  230. package/dist/ui/components/select-field/subcomponents/CommandItemList.js +1 -1
  231. package/dist/ui/components/select-field/subcomponents/CommandItemList.js.map +1 -1
  232. package/dist/ui/components/select-field/use-select-field.d.ts +4 -12
  233. package/dist/ui/components/select-field/use-select-field.d.ts.map +1 -1
  234. package/dist/ui/components/select-field/use-select-field.js.map +1 -1
  235. package/dist/ui/components/sidebar/index.d.ts +6 -4
  236. package/dist/ui/components/sidebar/sidebar.d.ts +3 -2
  237. package/dist/ui/components/sidebar/sidebar.js +1 -1
  238. package/dist/ui/components/sidebar/sidebar.js.map +1 -1
  239. package/dist/ui/components/sidebar/subcomponents/sidebar-content-area.d.ts +2 -7
  240. package/dist/ui/components/sidebar/subcomponents/sidebar-content-area.d.ts.map +1 -1
  241. package/dist/ui/components/sidebar/subcomponents/sidebar-content-area.js +1 -1
  242. package/dist/ui/components/sidebar/subcomponents/sidebar-content-area.js.map +1 -1
  243. package/dist/ui/components/sidebar/subcomponents/sidebar-header.d.ts +2 -2
  244. package/dist/ui/components/sidebar/subcomponents/sidebar-header.d.ts.map +1 -1
  245. package/dist/ui/components/sidebar/subcomponents/sidebar-header.js.map +1 -1
  246. package/dist/ui/components/sidebar/subcomponents/sidebar-item.d.ts +3 -18
  247. package/dist/ui/components/sidebar/subcomponents/sidebar-item.d.ts.map +1 -1
  248. package/dist/ui/components/sidebar/subcomponents/sidebar-item.js +4 -3
  249. package/dist/ui/components/sidebar/subcomponents/sidebar-item.js.map +1 -1
  250. package/dist/ui/components/sidebar/subcomponents/sidebar-pinning-area.d.ts +2 -4
  251. package/dist/ui/components/sidebar/subcomponents/sidebar-pinning-area.d.ts.map +1 -1
  252. package/dist/ui/components/sidebar/subcomponents/sidebar-pinning-area.js.map +1 -1
  253. package/dist/ui/components/sidebar/subcomponents/sidebar-provider/index.d.ts +4 -2
  254. package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-provider.d.ts +3 -2
  255. package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-provider.js +2 -2
  256. package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-provider.js.map +1 -1
  257. package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-reducer.d.ts +7 -8
  258. package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-reducer.d.ts.map +1 -1
  259. package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-reducer.js +1 -1
  260. package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-reducer.js.map +1 -1
  261. package/dist/ui/components/sidebar/subcomponents/sidebar-search/index.d.ts +2 -1
  262. package/dist/ui/components/sidebar/subcomponents/sidebar-search/search-navigation-arrow.d.ts +2 -2
  263. package/dist/ui/components/sidebar/subcomponents/sidebar-search/search-navigation-arrow.d.ts.map +1 -1
  264. package/dist/ui/components/sidebar/subcomponents/sidebar-search/search-navigation-arrow.js.map +1 -1
  265. package/dist/ui/components/sidebar/subcomponents/sidebar-search/search-result-counter.d.ts +2 -2
  266. package/dist/ui/components/sidebar/subcomponents/sidebar-search/search-result-counter.d.ts.map +1 -1
  267. package/dist/ui/components/sidebar/subcomponents/sidebar-search/search-result-counter.js.map +1 -1
  268. package/dist/ui/components/sidebar/subcomponents/sidebar-search/sidebar-search.d.ts +2 -2
  269. package/dist/ui/components/sidebar/subcomponents/sidebar-search/sidebar-search.d.ts.map +1 -1
  270. package/dist/ui/components/sidebar/subcomponents/sidebar-search/sidebar-search.js +1 -1
  271. package/dist/ui/components/sidebar/subcomponents/sidebar-search/sidebar-search.js.map +1 -1
  272. package/dist/ui/components/sidebar/subcomponents/sidebar-skeleton-item.d.ts +2 -8
  273. package/dist/ui/components/sidebar/subcomponents/sidebar-skeleton-item.d.ts.map +1 -1
  274. package/dist/ui/components/sidebar/subcomponents/sidebar-skeleton-item.js +2 -1
  275. package/dist/ui/components/sidebar/subcomponents/sidebar-skeleton-item.js.map +1 -1
  276. package/dist/ui/components/sidebar/subcomponents/sidebar-skeleton.d.ts +2 -4
  277. package/dist/ui/components/sidebar/subcomponents/sidebar-skeleton.d.ts.map +1 -1
  278. package/dist/ui/components/sidebar/subcomponents/sidebar-skeleton.js.map +1 -1
  279. package/dist/ui/components/sidebar/subcomponents/status-icon.d.ts +3 -9
  280. package/dist/ui/components/sidebar/subcomponents/status-icon.d.ts.map +1 -1
  281. package/dist/ui/components/sidebar/subcomponents/status-icon.js +1 -1
  282. package/dist/ui/components/sidebar/subcomponents/status-icon.js.map +1 -1
  283. package/dist/ui/components/sidebar/types.d.ts +3 -2
  284. package/dist/ui/components/sidebar/types.js +1 -1
  285. package/dist/ui/components/sidebar/types.js.map +1 -1
  286. package/dist/ui/components/sidebar/use-ellipsis.d.ts +2 -2
  287. package/dist/ui/components/sidebar/use-ellipsis.d.ts.map +1 -1
  288. package/dist/ui/components/sidebar/use-ellipsis.js.map +1 -1
  289. package/dist/ui/components/sidebar/use-sidebar-resize.d.ts +3 -9
  290. package/dist/ui/components/sidebar/use-sidebar-resize.d.ts.map +1 -1
  291. package/dist/ui/components/sidebar/use-sidebar-resize.js.map +1 -1
  292. package/dist/ui/components/sidebar/utils.d.ts +10 -11
  293. package/dist/ui/components/sidebar/utils.d.ts.map +1 -1
  294. package/dist/ui/components/sidebar/utils.js.map +1 -1
  295. package/dist/ui/components/text-field/text-field.d.ts +3 -2
  296. package/dist/ui/components/text-field/text-field.js +3 -2
  297. package/dist/ui/components/text-field/text-field.js.map +1 -1
  298. package/dist/ui/components/text-input/text-input-diff.d.ts +3 -2
  299. package/dist/ui/components/text-input/text-input-diff.js.map +1 -1
  300. package/dist/ui/components/text-input/text-input.d.ts +3 -2
  301. package/dist/ui/components/text-input/text-input.js +1 -1
  302. package/dist/ui/components/text-input/text-input.js.map +1 -1
  303. package/dist/ui/components/text-input/types.d.ts +3 -2
  304. package/dist/ui/components/tooltip/tooltip.d.ts +3 -2
  305. package/dist/ui/components/tooltip/tooltip.js +1 -1
  306. package/dist/ui/components/tooltip/tooltip.js.map +1 -1
  307. package/dist/ui/components/types.d.ts +3 -2
  308. package/dist/ui/components/value-transformer/value-transformer.d.ts +3 -2
  309. package/dist/ui/components/value-transformer/value-transformer.js +5 -3
  310. package/dist/ui/components/value-transformer/value-transformer.js.map +1 -1
  311. package/dist/ui/components/with-field-validation/with-field-validation.d.ts +3 -2
  312. package/dist/ui/components/with-field-validation/with-field-validation.js +1 -1
  313. package/dist/ui/components/with-field-validation/with-field-validation.js.map +1 -1
  314. package/dist/ui/index.d.ts +44 -42
  315. package/dist/ui/lib/date-picker.d.ts +4 -5
  316. package/dist/ui/lib/date-picker.d.ts.map +1 -1
  317. package/dist/ui/lib/date-picker.js +2 -1
  318. package/dist/ui/lib/date-picker.js.map +1 -1
  319. package/dist/ui/lib/date-time-picker.d.ts +6 -6
  320. package/dist/ui/lib/date-time-picker.d.ts.map +1 -1
  321. package/dist/ui/lib/date-time-picker.js.map +1 -1
  322. package/dist/ui/lib/deep-equal.d.ts +2 -2
  323. package/dist/ui/lib/deep-equal.d.ts.map +1 -1
  324. package/dist/ui/lib/deep-equal.js.map +1 -1
  325. package/dist/ui/lib/index.d.ts +2 -1
  326. package/dist/ui/lib/is-empty.d.ts +2 -2
  327. package/dist/ui/lib/is-empty.d.ts.map +1 -1
  328. package/dist/ui/lib/is-empty.js.map +1 -1
  329. package/dist/ui/lib/shared-value-transformers.d.ts +3 -4
  330. package/dist/ui/lib/shared-value-transformers.d.ts.map +1 -1
  331. package/dist/ui/lib/shared-value-transformers.js.map +1 -1
  332. package/dist/ui/lib/types.d.ts +3 -2
  333. package/dist/ui/lib/value-cast.d.ts +4 -4
  334. package/dist/ui/lib/value-cast.d.ts.map +1 -1
  335. package/dist/ui/lib/value-cast.js +10 -4
  336. package/dist/ui/lib/value-cast.js.map +1 -1
  337. package/dist/ui/types.d.ts +4 -3
  338. package/dist/{use-id-autocomplete-By7YSChC.d.ts → use-id-autocomplete-m9Bf0qCy.d.ts} +5 -16
  339. package/dist/use-id-autocomplete-m9Bf0qCy.d.ts.map +1 -0
  340. package/dist/{use-search-autocomplete-IfcQ_gKh.d.ts → use-search-autocomplete-vSvcsvcB.d.ts} +5 -6
  341. package/dist/use-search-autocomplete-vSvcsvcB.d.ts.map +1 -0
  342. package/dist/{value-transformer-DQjqtNih.d.ts → value-transformer-BtUh3-UP.d.ts} +5 -7
  343. package/dist/value-transformer-BtUh3-UP.d.ts.map +1 -0
  344. package/dist/{with-field-validation-Di5D8vU-.d.ts → with-field-validation-Bh26a6fr.d.ts} +3 -3
  345. package/dist/with-field-validation-Bh26a6fr.d.ts.map +1 -0
  346. package/package.json +17 -12
  347. package/plugins.css +6 -0
  348. package/tailwind.css +213 -0
  349. package/vendor.css +3 -0
  350. package/dist/button-C8doazjv.d.ts +0 -15
  351. package/dist/button-C8doazjv.d.ts.map +0 -1
  352. package/dist/character-counter-BWoglM2P.d.ts.map +0 -1
  353. package/dist/checkbox-CGBtXQnI.d.ts.map +0 -1
  354. package/dist/checkbox-base-CZo-4eL0.d.ts.map +0 -1
  355. package/dist/command--QCHwqST.d.ts.map +0 -1
  356. package/dist/content-BHWIqmio.d.ts.map +0 -1
  357. package/dist/enum-field-CwZVs3Ux.d.ts.map +0 -1
  358. package/dist/form-CKRKn0TQ.d.ts.map +0 -1
  359. package/dist/form-description-CYkcMEzm.d.ts.map +0 -1
  360. package/dist/form-group-C8kL6pdZ.d.ts.map +0 -1
  361. package/dist/form-label-b6nQi0XO.d.ts.map +0 -1
  362. package/dist/form-message-Dq72nBXz.d.ts.map +0 -1
  363. package/dist/form-server-error-message-DXbaiTfF.d.ts +0 -7
  364. package/dist/form-server-error-message-DXbaiTfF.d.ts.map +0 -1
  365. package/dist/icon-C4QOpsdI.js.map +0 -1
  366. package/dist/id-autocomplete-C-hwriS5.d.ts.map +0 -1
  367. package/dist/id-autocomplete-input-container-DFEyPh5p.d.ts.map +0 -1
  368. package/dist/id-autocomplete-list-EzLpF23C.d.ts.map +0 -1
  369. package/dist/id-autocomplete-list-option-CB5B07Hi.d.ts.map +0 -1
  370. package/dist/index--hDSfvJT.d.ts.map +0 -1
  371. package/dist/index--okzibnx.d.ts +0 -1
  372. package/dist/index-BLwMeReG.d.ts +0 -1
  373. package/dist/index-Cw3C7_1f.d.ts +0 -1
  374. package/dist/index-E7Wvm5uX.d.ts +0 -1
  375. package/dist/index-J3R2mDFQ.d.ts +0 -1
  376. package/dist/input-BpEQjaWV.d.ts.map +0 -1
  377. package/dist/json-viewer-DaTgmzkS.d.ts +0 -8
  378. package/dist/json-viewer-DaTgmzkS.d.ts.map +0 -1
  379. package/dist/message-list-C4mPpBBa.d.ts.map +0 -1
  380. package/dist/popover-XSBOuSih.d.ts.map +0 -1
  381. package/dist/radio-eL0Oy86J.d.ts.map +0 -1
  382. package/dist/radio-group-Bkli6nUz.d.ts.map +0 -1
  383. package/dist/radio-group-field-wlqeiLN3.d.ts.map +0 -1
  384. package/dist/search-autocomplete-BJJkrZ1i.d.ts.map +0 -1
  385. package/dist/select-field-C97QIhUL.d.ts.map +0 -1
  386. package/dist/selected-content-CGsK5PR4.d.ts.map +0 -1
  387. package/dist/sidebar-DOoE4krt.d.ts.map +0 -1
  388. package/dist/sidebar-provider-C2eyz9TL.d.ts.map +0 -1
  389. package/dist/splitted-input-diff-CwPedpov.d.ts +0 -18
  390. package/dist/splitted-input-diff-CwPedpov.d.ts.map +0 -1
  391. package/dist/src-CVV6HzQZ.js.map +0 -1
  392. package/dist/text-field-DSInH67J.d.ts +0 -10
  393. package/dist/text-field-DSInH67J.d.ts.map +0 -1
  394. package/dist/text-input-8zXIWHLi.d.ts.map +0 -1
  395. package/dist/text-input-diff-B0vLSKQm.d.ts +0 -20
  396. package/dist/text-input-diff-B0vLSKQm.d.ts.map +0 -1
  397. package/dist/tooltip-BxS9HpML.d.ts.map +0 -1
  398. package/dist/types-BTq-St7H.d.ts.map +0 -1
  399. package/dist/types-Bsn62tJB.d.ts.map +0 -1
  400. package/dist/types-C04Q_Fan.d.ts.map +0 -1
  401. package/dist/types-CNbvfWjh.d.ts.map +0 -1
  402. package/dist/use-id-autocomplete-By7YSChC.d.ts.map +0 -1
  403. package/dist/use-search-autocomplete-IfcQ_gKh.d.ts.map +0 -1
  404. package/dist/value-transformer-DQjqtNih.d.ts.map +0 -1
  405. package/dist/with-field-validation-Di5D8vU-.d.ts.map +0 -1
@@ -1,31 +1,27 @@
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-CVV6HzQZ.js";
2
- import { n as getDimensions, t as Icon } from "../icon-C4QOpsdI.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, t as useWindowSize, y as DropdownMenuTrigger } from "../src-DhSJCeu5.js";
2
+ import { n as getDimensions, t as Icon } from "../icon-DQ2yrWYv.js";
3
+ import { Checkbox } from "../ui/components/checkbox/checkbox.js";
3
4
  import { Popover, PopoverContent, PopoverTrigger } from "../ui/components/popover/popover.js";
4
- import { SelectFieldRaw } from "../ui/components/select-field/select-field.js";
5
5
  import { Input } from "../ui/components/input/input.js";
6
6
  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";
7
+ import "../ui/index.js";
8
+ import { a as lazyComponent, i as ENSAvatar, n as useEns, r as FormattedJsonViewer, t as formatEthAddress } from "../address-DVC3zalI.js";
9
+ import { t as Label } from "../label-nH2HoKfI.js";
10
+ import React, { Fragment, createContext, createElement, forwardRef, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
8
11
  import { twJoin, twMerge } from "tailwind-merge";
9
12
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
13
  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";
14
+ import { useEventListener, useOnClickOutside } from "usehooks-ts";
15
15
  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";
16
+ import { SyncOperationStatus, addFolder, getNodeTarget, getSyncStatusSync, isPlainClick, makeDriveSlug, preloadEditorModule, showDeleteNodeModal, showPHModal, showRevisionHistory, useCloseNode, useDocumentById, useDocumentVersionStatus, useDownloadDocument, useDownloadFolder, useDragNode, useDriveContext, useDropFile, useDropNode, useEditorModulesForDocumentType, useGetSwitchboardLink, useIsDragAndDropEnabled, useLinkProps, useNodeActions, useNodeById, useNodeTarget, useOnDropFile, usePHNavigation, usePreloadNode, useReactorClient, useSelectedDocumentSafe, useSelectedDriveId, useSelectedDriveSafe, useSelectedNodePath, useSetSelectedDrive, useSetSelectedNode, useTheme, useUserPermissions } from "@powerhousedao/reactor-browser";
17
+ import { Content as Content$1, List, Root as Root$1, Trigger as Trigger$1 } from "@radix-ui/react-tabs";
18
+ import { addProp, defaultTo, entries, filter, hasAtLeast, isArray, isDefined, isIncludedIn, isTruthy, keys, map, pipe, prop, values } from "remeda";
19
+ import { redo, undo, undoCapabilitiesOf } from "@powerhousedao/shared/document-model";
21
20
  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";
21
+ import { colorVariants, imageVariants, layerStyle, normalizeBackground } from "@powerhousedao/shared/connect";
25
22
  import { isValidName } from "@powerhousedao/shared/document-drive";
26
23
  import { capitalCase } from "change-case";
27
24
  import { getUpdateTarget, parseInstallSpec } from "@powerhousedao/shared/registry/updates";
28
- import { useVirtualizer } from "@tanstack/react-virtual";
29
25
  //#region src/connect/components/account-popover/account-popover.tsx
30
26
  const AccountPopover = ({ children, content, open, onOpenChange }) => {
31
27
  return /* @__PURE__ */ jsxs(Popover, {
@@ -245,6 +241,9 @@ function Breadcrumbs() {
245
241
  const selectedDriveId = useSelectedDriveId();
246
242
  const selectedNodePath = useSelectedNodePath();
247
243
  const [isCreating, setIsCreating] = useState(false);
244
+ const driveContext = useDriveContext();
245
+ const setSelectedDrive = useSetSelectedDrive();
246
+ const setSelectedNode = useSetSelectedNode();
248
247
  function onAddNew() {
249
248
  setIsCreating(true);
250
249
  }
@@ -261,6 +260,7 @@ function Breadcrumbs() {
261
260
  function onCancel() {
262
261
  setIsCreating(false);
263
262
  }
263
+ const driveTarget = selectedDrive ? { driveSlug: makeDriveSlug(selectedDrive) } : void 0;
264
264
  const hasSelectedDrive = !!selectedDrive;
265
265
  const hasNodePath = !!selectedNodePath.length;
266
266
  return /* @__PURE__ */ jsxs("div", {
@@ -282,6 +282,7 @@ function Breadcrumbs() {
282
282
  id: selectedDriveId,
283
283
  parentId: void 0,
284
284
  name: selectedDrive.state.global.name || selectedDrive.header.name,
285
+ target: driveTarget,
285
286
  onClick: () => setSelectedDrive(selectedDrive)
286
287
  }),
287
288
  /* @__PURE__ */ jsx("span", { children: "/" })
@@ -290,6 +291,7 @@ function Breadcrumbs() {
290
291
  id: node.id,
291
292
  parentId: node.parentFolder,
292
293
  name: node.name,
294
+ target: getNodeTarget(node, driveContext?.drive),
293
295
  onClick: () => setSelectedNode(node)
294
296
  }), /* @__PURE__ */ jsx("span", { children: "/" })] }, node.id)),
295
297
  isAllowedToCreateDocuments && (isCreating ? /* @__PURE__ */ jsx(NodeInput, {
@@ -311,160 +313,363 @@ function Breadcrumbs() {
311
313
  });
312
314
  }
313
315
  function Breadcrumb(props) {
314
- const { name, id, parentId, onClick } = props;
316
+ const { name, id, parentId, target, onClick } = props;
317
+ const navigation = usePHNavigation();
318
+ const isCurrent = navigation.useIsCurrent?.(target) ?? false;
319
+ const href = props.href ?? (target ? navigation.hrefFor?.(target) : void 0);
315
320
  const { isDragging, ...dragProps } = useDragNode({
316
321
  srcId: id,
317
322
  parentId: parentId ?? void 0
318
323
  });
319
324
  const { isDropTarget, ...dropProps } = useDropNode(id);
320
325
  const containerStyles = twMerge("cursor-pointer transition-colors last-of-type:text-foreground hover:hover-effect", isDragging ? "opacity-60" : isDropTarget ? "bg-info/10" : "");
326
+ if (href) {
327
+ const onLinkClick = (event) => {
328
+ if (!isPlainClick(event)) return;
329
+ event.preventDefault();
330
+ onClick();
331
+ };
332
+ return /* @__PURE__ */ jsx("a", {
333
+ ...dragProps,
334
+ ...dropProps,
335
+ href,
336
+ "aria-current": target && isCurrent ? "page" : void 0,
337
+ className: containerStyles,
338
+ onClick: onLinkClick,
339
+ children: name
340
+ });
341
+ }
342
+ const onKeyDown = (event) => {
343
+ if (event.key !== "Enter" && event.key !== " ") return;
344
+ event.preventDefault();
345
+ onClick();
346
+ };
321
347
  return /* @__PURE__ */ jsx("div", {
322
348
  ...dragProps,
323
349
  ...dropProps,
324
350
  className: containerStyles,
325
351
  onClick,
352
+ onKeyDown,
326
353
  role: "button",
354
+ tabIndex: 0,
327
355
  children: name
328
356
  });
329
357
  }
330
358
  //#endregion
331
- //#region src/connect/components/combobox/combobox.tsx
332
- function DropdownIndicator(props) {
333
- return /* @__PURE__ */ jsx(components.DropdownIndicator, {
334
- ...props,
335
- children: /* @__PURE__ */ jsx(Icon, {
336
- name: "ChevronDown",
337
- size: 16
338
- })
359
+ //#region src/connect/components/catch-up-inspector/catch-up-inspector.tsx
360
+ const COLUMNS$3 = [
361
+ {
362
+ key: "consumerId",
363
+ label: "Consumer",
364
+ width: "180px"
365
+ },
366
+ {
367
+ key: "thread",
368
+ label: "Thread",
369
+ width: "90px"
370
+ },
371
+ {
372
+ key: "appliedThrough",
373
+ label: "Applied Through",
374
+ width: "110px"
375
+ },
376
+ {
377
+ key: "lag",
378
+ label: "Lag",
379
+ width: "70px"
380
+ },
381
+ {
382
+ key: "trackedAbove",
383
+ label: "Tracked Above",
384
+ width: "100px"
385
+ },
386
+ {
387
+ key: "lastAdvance",
388
+ label: "Last Advance",
389
+ width: "160px"
390
+ },
391
+ {
392
+ key: "blockedOrdinal",
393
+ label: "Blocked At",
394
+ width: "90px"
395
+ },
396
+ {
397
+ key: "blockedDocument",
398
+ label: "Document",
399
+ width: "150px"
400
+ },
401
+ {
402
+ key: "blockedScope",
403
+ label: "Scope",
404
+ width: "80px"
405
+ },
406
+ {
407
+ key: "blockedBranch",
408
+ label: "Branch",
409
+ width: "80px"
410
+ },
411
+ {
412
+ key: "blockedType",
413
+ label: "Type",
414
+ width: "140px"
415
+ },
416
+ {
417
+ key: "blockedError",
418
+ label: "Error",
419
+ width: "180px"
420
+ }
421
+ ];
422
+ const POLL_INTERVAL_MS = 2e3;
423
+ function truncateId$3(id, maxLength = 12) {
424
+ if (id.length <= maxLength) return id;
425
+ return id.slice(0, maxLength) + "...";
426
+ }
427
+ function formatDuration(ms) {
428
+ const totalSeconds = Math.max(0, Math.floor(ms / 1e3));
429
+ const hours = Math.floor(totalSeconds / 3600);
430
+ const minutes = Math.floor(totalSeconds % 3600 / 60);
431
+ const seconds = totalSeconds % 60;
432
+ if (hours > 0) return `${hours}h ${minutes}m ${seconds}s`;
433
+ if (minutes > 0) return `${minutes}m ${seconds}s`;
434
+ return `${seconds}s`;
435
+ }
436
+ function Empty() {
437
+ return /* @__PURE__ */ jsx("span", {
438
+ className: "text-muted-foreground",
439
+ children: "-"
339
440
  });
340
441
  }
341
- function ClearIndicator(props) {
342
- return /* @__PURE__ */ jsx(components.ClearIndicator, {
343
- ...props,
344
- children: /* @__PURE__ */ jsx(Icon, {
345
- name: "Xmark",
346
- size: 16
347
- })
442
+ function Cell({ children }) {
443
+ return /* @__PURE__ */ jsx("td", {
444
+ className: "border-l border-border px-3 py-2 text-xs text-foreground",
445
+ children
348
446
  });
349
447
  }
350
- function MenuList(props) {
351
- const { label, onClick, ...rest } = props;
352
- const hasAddItemButton = !!label && !!onClick;
353
- return /* @__PURE__ */ jsxs(components.MenuList, {
354
- ...rest,
355
- children: [props.children, hasAddItemButton ? /* @__PURE__ */ jsx("button", {
356
- className: "w-full px-2 py-3 hover:hover-effect",
357
- onClick,
358
- children: label
359
- }) : null]
448
+ function TruncatedText({ text, className }) {
449
+ return /* @__PURE__ */ jsx("span", {
450
+ className: twMerge("block truncate", className),
451
+ title: text,
452
+ children: text
360
453
  });
361
454
  }
362
- function Combobox(props) {
363
- const invalid = props["aria-invalid"] === "true";
364
- const { addItemButtonProps, ...rest } = props;
365
- const { theme } = useTheme();
366
- const dark = theme === "dark";
367
- return /* @__PURE__ */ jsx(Select, {
368
- ...rest,
369
- components: {
370
- DropdownIndicator,
371
- ClearIndicator,
372
- MenuList: (menuListProps) => MenuList({
373
- ...menuListProps,
374
- ...addItemButtonProps
375
- })
376
- },
377
- classNames: { menuList: () => "scrollbar-thin scrollbar-track-transparent scrollbar-thumb-rounded-md scrollbar-thumb-border" },
378
- styles: {
379
- dropdownIndicator: () => {
380
- return {
381
- label: "indicatorContainer",
382
- display: "flex",
383
- transition: "color 150ms",
384
- color: dark ? "var(--color-slate-50)" : "var(--color-gray-900)",
385
- padding: 8,
386
- boxSizing: "border-box"
387
- };
388
- },
389
- clearIndicator: (baseStyles) => {
390
- return {
391
- ...baseStyles,
392
- color: dark ? "var(--color-slate-50)" : "var(--color-gray-900)"
393
- };
394
- },
395
- container: (baseStyles) => {
396
- return {
397
- ...baseStyles,
398
- borderColor: dark ? "var(--color-slate-700)" : "var(--color-gray-200)",
399
- fontSize: 12
400
- };
401
- },
402
- placeholder: (baseStyles) => {
403
- return {
404
- ...baseStyles,
405
- color: invalid ? dark ? "var(--color-red-400)" : "var(--color-red-900)" : dark ? "var(--color-slate-100)" : "var(--color-gray-500)"
406
- };
407
- },
408
- control: () => {
409
- return {
410
- label: "control",
411
- alignItems: "center",
412
- cursor: "default",
413
- display: "flex",
414
- flexWrap: "wrap",
415
- justifyContent: "space-between",
416
- minHeight: 32,
417
- outline: "0 !important",
418
- position: "relative",
419
- transition: "all 100ms",
420
- backgroundColor: dark ? "var(--color-slate-800)" : "var(--color-white)",
421
- borderColor: invalid ? dark ? "var(--color-red-400)" : "var(--color-red-900)" : dark ? "var(--color-slate-600)" : "var(--color-gray-200)",
422
- borderStyle: "solid",
423
- borderWidth: 1,
424
- borderRadius: "6px",
425
- boxSizing: "border-box"
426
- };
427
- },
428
- option: (baseStyles, state) => {
429
- return {
430
- ...baseStyles,
431
- backgroundColor: state.isSelected ? dark ? "var(--color-slate-700)" : "var(--color-slate-50)" : dark ? "var(--color-slate-800)" : "var(--color-white)",
432
- color: dark ? "var(--color-slate-50)" : "var(--color-gray-800)",
433
- ":hover": { backgroundColor: dark ? "var(--color-slate-700)" : "var(--color-slate-50)" }
434
- };
435
- },
436
- menuList: (baseStyles) => ({
437
- ...baseStyles,
438
- padding: 0,
439
- borderRadius: "6px"
455
+ function CatchUpInspector({ status, onRefresh, onSweepNow }) {
456
+ const [loading, setLoading] = useState(true);
457
+ const [sweeping, setSweeping] = useState(false);
458
+ const [error, setError] = useState(null);
459
+ const [now, setNow] = useState();
460
+ const loadStatus = useCallback(async () => {
461
+ try {
462
+ await onRefresh();
463
+ setError(null);
464
+ setNow(Date.now());
465
+ } catch (e) {
466
+ setError(e instanceof Error ? e.message : String(e));
467
+ } finally {
468
+ setLoading(false);
469
+ }
470
+ }, [onRefresh]);
471
+ useEffect(() => {
472
+ loadStatus();
473
+ const interval = setInterval(() => {
474
+ loadStatus();
475
+ }, POLL_INTERVAL_MS);
476
+ return () => clearInterval(interval);
477
+ }, [loadStatus]);
478
+ const handleRefresh = useCallback(async () => {
479
+ setLoading(true);
480
+ await loadStatus();
481
+ }, [loadStatus]);
482
+ const handleSweepNow = useCallback(async () => {
483
+ setSweeping(true);
484
+ try {
485
+ await onSweepNow();
486
+ setError(null);
487
+ } catch (e) {
488
+ setError(e instanceof Error ? e.message : String(e));
489
+ } finally {
490
+ setSweeping(false);
491
+ }
492
+ await loadStatus();
493
+ }, [onSweepNow, loadStatus]);
494
+ const watermark = status?.watermark;
495
+ const consumers = status?.consumers ?? [];
496
+ const settledThrough = watermark?.settledThrough ?? 0;
497
+ const blockedCount = consumers.filter((c) => c.blockedAt).length;
498
+ return /* @__PURE__ */ jsxs("div", {
499
+ className: "flex h-full flex-col gap-2",
500
+ children: [
501
+ /* @__PURE__ */ jsxs("div", {
502
+ className: "flex shrink-0 items-center justify-between",
503
+ children: [/* @__PURE__ */ jsx("h2", {
504
+ className: "text-lg font-semibold text-foreground",
505
+ children: "Catch-up Inspector"
506
+ }), /* @__PURE__ */ jsxs("div", {
507
+ className: "flex items-center gap-2",
508
+ children: [/* @__PURE__ */ jsx("button", {
509
+ className: "flex items-center gap-1 rounded-sm border border-border bg-background px-3 py-1.5 text-sm text-foreground hover:hover-effect disabled:disabled-effect",
510
+ disabled: sweeping,
511
+ onClick: () => void handleSweepNow(),
512
+ type: "button",
513
+ children: "Sweep now"
514
+ }), /* @__PURE__ */ jsxs("button", {
515
+ className: "flex items-center gap-1 rounded-sm border border-border bg-background px-3 py-1.5 text-sm text-foreground hover:hover-effect disabled:disabled-effect",
516
+ disabled: loading,
517
+ onClick: () => void handleRefresh(),
518
+ type: "button",
519
+ children: [/* @__PURE__ */ jsx(Icon, {
520
+ name: "Reload",
521
+ size: 14
522
+ }), "Refresh"]
523
+ })]
524
+ })]
525
+ }),
526
+ watermark && /* @__PURE__ */ jsxs("div", {
527
+ className: "flex shrink-0 flex-wrap items-center gap-4 rounded-lg bg-muted px-4 py-2 text-sm",
528
+ children: [
529
+ /* @__PURE__ */ jsxs("div", {
530
+ className: "text-foreground",
531
+ children: ["Head: ", /* @__PURE__ */ jsx("span", {
532
+ className: "font-medium",
533
+ children: watermark.head
534
+ })]
535
+ }),
536
+ /* @__PURE__ */ jsxs("div", {
537
+ className: "text-foreground",
538
+ children: [
539
+ "Settled through:",
540
+ " ",
541
+ /* @__PURE__ */ jsx("span", {
542
+ className: "font-medium",
543
+ children: watermark.settledThrough
544
+ })
545
+ ]
546
+ }),
547
+ /* @__PURE__ */ jsxs("div", {
548
+ className: "text-foreground",
549
+ children: [
550
+ "Lag:",
551
+ " ",
552
+ /* @__PURE__ */ jsx("span", {
553
+ className: "font-medium",
554
+ children: watermark.head - watermark.settledThrough
555
+ })
556
+ ]
557
+ }),
558
+ /* @__PURE__ */ jsxs("div", {
559
+ className: "text-foreground",
560
+ children: [
561
+ "Waiting on:",
562
+ " ",
563
+ /* @__PURE__ */ jsx("span", {
564
+ className: "font-medium",
565
+ children: watermark.waitingOn.length > 0 ? watermark.waitingOn.join(", ") : "none"
566
+ })
567
+ ]
568
+ }),
569
+ watermark.stalledSinceUtcMs !== void 0 && now !== void 0 && /* @__PURE__ */ jsxs("div", {
570
+ className: "flex items-center gap-2 text-destructive",
571
+ children: [
572
+ /* @__PURE__ */ jsx("span", { className: "size-2 rounded-full bg-destructive" }),
573
+ "Stalled for:",
574
+ " ",
575
+ /* @__PURE__ */ jsx("span", {
576
+ className: "font-medium",
577
+ title: new Date(watermark.stalledSinceUtcMs).toISOString(),
578
+ children: formatDuration(now - watermark.stalledSinceUtcMs)
579
+ })
580
+ ]
581
+ }),
582
+ /* @__PURE__ */ jsxs("div", {
583
+ className: "flex items-center gap-2 text-foreground",
584
+ children: [
585
+ /* @__PURE__ */ jsx("span", { className: "size-2 rounded-full bg-destructive" }),
586
+ "Blocked: ",
587
+ /* @__PURE__ */ jsx("span", {
588
+ className: "font-medium",
589
+ children: blockedCount
590
+ })
591
+ ]
592
+ })
593
+ ]
594
+ }),
595
+ error && /* @__PURE__ */ jsxs("div", {
596
+ className: "shrink-0 rounded-lg border border-destructive bg-destructive/10 px-4 py-2 text-sm text-destructive",
597
+ children: ["Catch-up request failed: ", error]
598
+ }),
599
+ /* @__PURE__ */ jsx("div", {
600
+ className: "max-h-full overflow-auto rounded-lg border border-border",
601
+ children: /* @__PURE__ */ jsxs("table", {
602
+ className: "w-full border-collapse",
603
+ children: [/* @__PURE__ */ jsx("thead", {
604
+ className: "sticky top-0 bg-muted",
605
+ children: /* @__PURE__ */ jsx("tr", { children: COLUMNS$3.map((column, index) => /* @__PURE__ */ jsx("th", {
606
+ className: twMerge("px-3 py-2 text-left text-xs font-medium text-foreground", index > 0 && "border-l border-border"),
607
+ style: { width: column.width },
608
+ children: /* @__PURE__ */ jsx("span", {
609
+ className: "truncate",
610
+ children: column.label
611
+ })
612
+ }, column.key)) })
613
+ }), /* @__PURE__ */ jsx("tbody", { children: loading && !status ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
614
+ className: "px-3 py-8 text-center text-sm text-muted-foreground",
615
+ colSpan: COLUMNS$3.length,
616
+ children: "Loading..."
617
+ }) }) : consumers.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
618
+ className: "px-3 py-8 text-center text-sm text-muted-foreground",
619
+ colSpan: COLUMNS$3.length,
620
+ children: "No catch-up consumers"
621
+ }) }) : consumers.map((consumer) => {
622
+ const blocked = consumer.blockedAt;
623
+ const lastAdvance = new Date(consumer.lastAdvanceUtcMs);
624
+ return /* @__PURE__ */ jsxs("tr", {
625
+ className: twMerge("hover:hover-effect", blocked ? "bg-destructive/10" : "odd:bg-card even:bg-background"),
626
+ children: [
627
+ /* @__PURE__ */ jsx("td", {
628
+ className: "px-3 py-2 text-xs text-foreground",
629
+ children: /* @__PURE__ */ jsx(TruncatedText, { text: consumer.consumerId })
630
+ }),
631
+ /* @__PURE__ */ jsx(Cell, { children: consumer.thread }),
632
+ /* @__PURE__ */ jsx(Cell, { children: consumer.appliedThrough }),
633
+ /* @__PURE__ */ jsx(Cell, { children: settledThrough - consumer.appliedThrough }),
634
+ /* @__PURE__ */ jsx(Cell, { children: consumer.trackedAbove }),
635
+ /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx("span", {
636
+ className: "block truncate",
637
+ title: lastAdvance.toISOString(),
638
+ children: lastAdvance.toLocaleString()
639
+ }) }),
640
+ /* @__PURE__ */ jsx(Cell, { children: blocked ? blocked.ordinal : /* @__PURE__ */ jsx(Empty, {}) }),
641
+ /* @__PURE__ */ jsx(Cell, { children: blocked ? /* @__PURE__ */ jsx("span", {
642
+ className: "block truncate",
643
+ title: blocked.documentId,
644
+ children: truncateId$3(blocked.documentId)
645
+ }) : /* @__PURE__ */ jsx(Empty, {}) }),
646
+ /* @__PURE__ */ jsx(Cell, { children: blocked ? blocked.scope : /* @__PURE__ */ jsx(Empty, {}) }),
647
+ /* @__PURE__ */ jsx(Cell, { children: blocked ? blocked.branch : /* @__PURE__ */ jsx(Empty, {}) }),
648
+ /* @__PURE__ */ jsx(Cell, { children: blocked ? /* @__PURE__ */ jsx(TruncatedText, { text: blocked.type }) : /* @__PURE__ */ jsx(Empty, {}) }),
649
+ /* @__PURE__ */ jsx(Cell, { children: blocked ? /* @__PURE__ */ jsx(TruncatedText, {
650
+ className: "text-destructive",
651
+ text: blocked.error
652
+ }) : /* @__PURE__ */ jsx(Empty, {}) })
653
+ ]
654
+ }, consumer.consumerId);
655
+ }) })]
656
+ })
657
+ }),
658
+ /* @__PURE__ */ jsxs("div", {
659
+ className: "shrink-0 text-sm text-foreground",
660
+ children: [
661
+ "Showing ",
662
+ consumers.length,
663
+ " consumer(s)"
664
+ ]
440
665
  })
441
- },
442
- theme: (theme) => ({
443
- ...theme,
444
- colors: {
445
- ...theme.colors,
446
- primary: dark ? "var(--color-slate-700)" : "var(--color-slate-100)",
447
- primary25: dark ? "var(--color-slate-800)" : "var(--color-slate-50)",
448
- primary50: dark ? "var(--color-slate-700)" : "var(--color-slate-100)",
449
- primary75: dark ? "var(--color-slate-700)" : "var(--color-slate-100)",
450
- danger: dark ? "var(--color-red-400)" : "var(--color-red-900)",
451
- dangerLight: dark ? "var(--color-red-900)" : "var(--color-red-100)",
452
- neutral0: dark ? "var(--color-slate-800)" : "var(--color-white)",
453
- neutral5: dark ? "var(--color-slate-800)" : "var(--color-gray-50)",
454
- neutral10: dark ? "var(--color-slate-700)" : "var(--color-gray-100)",
455
- neutral20: dark ? "var(--color-slate-600)" : "var(--color-gray-200)",
456
- neutral30: dark ? "var(--color-slate-600)" : "var(--color-gray-300)",
457
- neutral40: dark ? "var(--color-slate-400)" : "var(--color-gray-400)",
458
- neutral50: dark ? "var(--color-slate-300)" : "var(--color-gray-500)",
459
- neutral60: dark ? "var(--color-slate-200)" : "var(--color-gray-600)",
460
- neutral70: dark ? "var(--color-slate-100)" : "var(--color-gray-700)",
461
- neutral80: dark ? "var(--color-slate-50)" : "var(--color-gray-800)",
462
- neutral90: dark ? "var(--color-slate-50)" : "var(--color-gray-900)"
463
- }
464
- })
666
+ ]
465
667
  });
466
668
  }
467
669
  //#endregion
670
+ //#region src/connect/components/combobox/combobox.tsx
671
+ const Combobox = lazyComponent(() => import("../combobox.impl-CQHG0NgO.js").then((m) => m.Combobox));
672
+ //#endregion
468
673
  //#region src/connect/components/consent-banner/consent-banner.tsx
469
674
  const CookieBanner = (props) => {
470
675
  const { children, cookies, submitLabel, rejectLabel, onSubmit = () => {}, onReject = () => {}, className, ...divProps } = props;
@@ -527,8 +732,9 @@ function ModalButton(props) {
527
732
  const { variant, className, ...rest } = props;
528
733
  const confirmStyle = twMerge(defaultStyle, "bg-primary text-primary-foreground");
529
734
  const cancelStyle = twMerge(defaultStyle, "bg-muted text-muted-foreground");
735
+ const variantStyle = twMerge(variant === "confirm" ? confirmStyle : cancelStyle, className);
530
736
  return /* @__PURE__ */ jsx("button", {
531
- className: twMerge(variant === "confirm" ? confirmStyle : cancelStyle, className),
737
+ className: variantStyle,
532
738
  ...rest
533
739
  });
534
740
  }
@@ -702,7 +908,7 @@ function SchemaTreeSidebar({ schema, tables, selectedTable, onSelectTable, onRef
702
908
  //#endregion
703
909
  //#region src/connect/components/select/select.tsx
704
910
  function fixedForwardRef(render) {
705
- return /* @__PURE__ */ forwardRef(render);
911
+ return /*#__PURE__*/ forwardRef(render);
706
912
  }
707
913
  const ConnectSelect = /* @__PURE__ */ fixedForwardRef(function Select(props, ref) {
708
914
  const { items, value, id, onChange, containerClassName, menuClassName, itemClassName, absolutePositionMenu = false, borderRadius = "6px", listClassName } = props;
@@ -1279,9 +1485,10 @@ function DBExplorer({ schema, getTables, getTableRows, getDefaultSort, pageSize
1279
1485
  ]);
1280
1486
  const handleCopyAll = useCallback(async () => {
1281
1487
  if (!selectedTable) return "";
1488
+ const limit = pagination.total ?? 1e6;
1282
1489
  return rowsToCsv((await getTableRows(selectedTable, {
1283
1490
  schema,
1284
- limit: pagination.total ?? 1e6,
1491
+ limit,
1285
1492
  offset: 0,
1286
1493
  sort,
1287
1494
  filters
@@ -1638,9 +1845,7 @@ const SEQUENCE = [
1638
1845
  }
1639
1846
  ];
1640
1847
  const ANIM_DUR = 460;
1641
- const HOLD = 800;
1642
- const LAST_DROP = 1220;
1643
- const LOOP_TOTAL = LAST_DROP + ANIM_DUR + HOLD + 1040 + ANIM_DUR + 400;
1848
+ const LOOP_TOTAL = 4380;
1644
1849
  const DROP_STYLE = `brickDrop ${ANIM_DUR}ms cubic-bezier(0.28, 1.08, 0.58, 1) forwards`;
1645
1850
  const FALL_STYLE = `brickFall ${ANIM_DUR}ms cubic-bezier(0.28, 1.08, 0.58, 1) forwards`;
1646
1851
  const PATHS = {
@@ -1655,7 +1860,63 @@ const PATHS = {
1655
1860
  b9: "M18.0156 9.8918C18.0156 9.61566 18.2394 9.39181 18.5155 9.39181L43.0627 9.39138C44.9475 11.8519 46.3659 14.6855 47.1892 17.7635L18.5154 17.7641C18.2392 17.7641 18.0154 17.5402 18.0154 17.2641L18.0156 9.8918Z",
1656
1861
  b10: "M25.0158 -2.51999e-05C31.418 0.265176 37.1737 3.03916 41.3227 7.36511L25.5156 7.36547C25.2395 7.36547 25.0156 7.14161 25.0156 6.86546L25.0158 -2.51999e-05Z"
1657
1862
  };
1863
+ /** A project's loading image, declared by the build as
1864
+ * `<meta name="ph-loader" content="<file>" data-animation data-size>`
1865
+ * (powerhouse.config.json `icons.loader`). */
1866
+ const LOADER_MOTION = {
1867
+ pulse: "ph-loader-pulse 1.6s ease-in-out infinite",
1868
+ spin: "ph-loader-spin 1.4s linear infinite",
1869
+ none: "none"
1870
+ };
1871
+ const LOADER_KEYFRAMES = "@keyframes ph-loader-pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.6;transform:scale(.94)}}@keyframes ph-loader-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){[data-ph-loader-img]{animation:none!important}}";
1872
+ let projectLoader;
1873
+ /** The page's project loader, or null when Connect's logo stays. Read once:
1874
+ * the meta tag is static in index.html. */
1875
+ function getProjectLoader() {
1876
+ if (projectLoader !== void 0) return projectLoader;
1877
+ if (typeof document === "undefined") return null;
1878
+ const meta = document.querySelector("meta[name=\"ph-loader\"]");
1879
+ const file = meta?.content;
1880
+ if (!meta || !file) return projectLoader = null;
1881
+ const animation = meta.dataset.animation;
1882
+ const size = Number(meta.dataset.size);
1883
+ projectLoader = {
1884
+ src: new URL(file, document.baseURI).toString(),
1885
+ animation: animation === "spin" || animation === "none" ? animation : "pulse",
1886
+ size: Number.isFinite(size) && size > 0 ? size : 96
1887
+ };
1888
+ return projectLoader;
1889
+ }
1890
+ /** The project's loading image with its motion. */
1891
+ function ProjectLoaderImage({ loader, className = "" }) {
1892
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("style", { children: LOADER_KEYFRAMES }), /* @__PURE__ */ jsx("img", {
1893
+ "data-ph-loader-img": "",
1894
+ src: loader.src,
1895
+ alt: "",
1896
+ "aria-label": "Loading",
1897
+ width: loader.size,
1898
+ className,
1899
+ style: {
1900
+ width: loader.size,
1901
+ height: "auto",
1902
+ animation: LOADER_MOTION[loader.animation]
1903
+ }
1904
+ })] });
1905
+ }
1906
+ /** Connect's loading animation: the project's loader when one is
1907
+ * configured, else the animated Powerhouse logo. */
1658
1908
  function LogoAnimation({ size = 48, className = "" }) {
1909
+ const loader = getProjectLoader();
1910
+ if (loader) return /* @__PURE__ */ jsx(ProjectLoaderImage, {
1911
+ loader,
1912
+ className
1913
+ });
1914
+ return /* @__PURE__ */ jsx(PowerhouseLogoAnimation, {
1915
+ size,
1916
+ className
1917
+ });
1918
+ }
1919
+ function PowerhouseLogoAnimation({ size = 48, className = "" }) {
1659
1920
  const refsMap = useRef({});
1660
1921
  const timers = useRef([]);
1661
1922
  function getEls(id) {
@@ -1699,7 +1960,7 @@ function LogoAnimation({ size = 48, className = "" }) {
1699
1960
  clearTimers();
1700
1961
  resetAll();
1701
1962
  SEQUENCE.forEach(({ id, dropDelay }) => runDrop(id, dropDelay));
1702
- const fallStart = LAST_DROP + ANIM_DUR + HOLD;
1963
+ const fallStart = 2480;
1703
1964
  SEQUENCE.forEach(({ id, fallDelay }) => runFall(id, fallStart + fallDelay));
1704
1965
  schedule(startLoop, LOOP_TOTAL);
1705
1966
  }
@@ -1789,7 +2050,7 @@ function TabContent(props) {
1789
2050
  const toTabValue = (label) => label.trim().replace(/\s+/g, "-");
1790
2051
  const resolveTabValue = (props) => props.value ?? toTabValue(props.label);
1791
2052
  function Tabs({ children, defaultValue, onValueChange, listClassName }) {
1792
- return /* @__PURE__ */ jsxs(Root$2, {
2053
+ return /* @__PURE__ */ jsxs(Root$1, {
1793
2054
  defaultValue: toTabValue(defaultValue),
1794
2055
  onValueChange,
1795
2056
  className: "flex min-h-0 flex-1 flex-col gap-2",
@@ -1798,10 +2059,10 @@ function Tabs({ children, defaultValue, onValueChange, listClassName }) {
1798
2059
  children: /* @__PURE__ */ jsx(List, {
1799
2060
  className: "flex w-full gap-x-2 rounded-xl p-1 text-sm font-semibold text-foreground outline-none",
1800
2061
  children: React.Children.map(children, (child, _i) => {
1801
- if (!/* @__PURE__ */ React.isValidElement(child)) return;
2062
+ if (!/*#__PURE__*/ React.isValidElement(child)) return;
1802
2063
  const props = child.props;
1803
2064
  const value = resolveTabValue(props);
1804
- return /* @__PURE__ */ jsx(Trigger$2, {
2065
+ return /* @__PURE__ */ jsx(Trigger$1, {
1805
2066
  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",
1806
2067
  value,
1807
2068
  disabled: props.disabled ?? false,
@@ -1812,10 +2073,11 @@ function Tabs({ children, defaultValue, onValueChange, listClassName }) {
1812
2073
  }), /* @__PURE__ */ jsx("div", {
1813
2074
  className: "mt-3 min-h-0 flex-1 rounded-md bg-background",
1814
2075
  children: React.Children.map(children, (child, i) => {
1815
- if (!/* @__PURE__ */ React.isValidElement(child)) return;
1816
- return /* @__PURE__ */ jsx(Content$2, {
2076
+ if (!/*#__PURE__*/ React.isValidElement(child)) return;
2077
+ const value = resolveTabValue(child.props);
2078
+ return /* @__PURE__ */ jsx(Content$1, {
1817
2079
  className: "h-full",
1818
- value: resolveTabValue(child.props),
2080
+ value,
1819
2081
  children: child
1820
2082
  }, i);
1821
2083
  })
@@ -1848,271 +2110,8 @@ function DocumentStateViewer({ state, ignoredScopes = ["auth", "document"], defa
1848
2110
  });
1849
2111
  }
1850
2112
  //#endregion
1851
- //#region src/connect/components/tooltip/tooltip.tsx
1852
- function ConnectTooltip(props) {
1853
- const { children, content, open, defaultOpen, onOpenChange, className, side = "top", sideOffset = 5, delayDuration, ...rest } = props;
1854
- return /* @__PURE__ */ jsxs(Root, {
1855
- defaultOpen,
1856
- delayDuration,
1857
- onOpenChange,
1858
- open,
1859
- children: [/* @__PURE__ */ jsx(Trigger, {
1860
- asChild: true,
1861
- children
1862
- }), /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content, {
1863
- ...rest,
1864
- side,
1865
- sideOffset,
1866
- className: twMerge("z-50 rounded-lg border border-border bg-popover p-2 text-xs text-popover-foreground shadow-tooltip", className),
1867
- children: content
1868
- }) })]
1869
- });
1870
- }
1871
- const ConnectTooltipProvider = Provider;
1872
- //#endregion
1873
- //#region src/connect/components/document-timeline/components/h-divider.tsx
1874
- const HDivider = (props) => {
1875
- const { className, timestampUtcMs: timestamp, title, subtitle, onClick, isSelected = false } = props;
1876
- const [open, setOpen] = useState(false);
1877
- const hasContent = !!title || !!subtitle || !!timestamp;
1878
- useEffect(() => {
1879
- if (open) {
1880
- setOpen(false);
1881
- setTimeout(() => hasContent && setOpen(true), 50);
1882
- }
1883
- }, [
1884
- title,
1885
- subtitle,
1886
- timestamp,
1887
- hasContent
1888
- ]);
1889
- const formatTimestamp = (isoString) => {
1890
- if (!isoString) return "";
1891
- try {
1892
- return formatDistanceToNow(new Date(isoString), { addSuffix: true });
1893
- } catch {
1894
- return isoString;
1895
- }
1896
- };
1897
- const tooltipContent = /* @__PURE__ */ jsxs("div", {
1898
- className: "flex flex-col text-xs",
1899
- children: [
1900
- !!title && /* @__PURE__ */ jsx("div", { children: title }),
1901
- !!subtitle && /* @__PURE__ */ jsx("div", {
1902
- className: "text-foreground",
1903
- children: subtitle
1904
- }),
1905
- !!timestamp && /* @__PURE__ */ jsx("div", { children: formatTimestamp(timestamp) })
1906
- ]
1907
- });
1908
- const handleMouseEnter = () => {
1909
- if (hasContent) setOpen(true);
1910
- };
1911
- const handleMouseLeave = () => {
1912
- setOpen(false);
1913
- };
1914
- return /* @__PURE__ */ jsxs("div", {
1915
- className: "relative",
1916
- onMouseEnter: handleMouseEnter,
1917
- onMouseLeave: handleMouseLeave,
1918
- children: [isSelected && /* @__PURE__ */ jsx(Icon, {
1919
- name: "TimelineCaret",
1920
- color: "#4EA9FF",
1921
- size: 10,
1922
- className: "absolute top-[-11px] z-40"
1923
- }), /* @__PURE__ */ jsx(ConnectTooltip, {
1924
- className: "rounded-md bg-primary text-primary-foreground",
1925
- content: tooltipContent,
1926
- open: open && hasContent,
1927
- onOpenChange: setOpen,
1928
- delayDuration: 0,
1929
- side: "bottom",
1930
- sideOffset: 5,
1931
- children: /* @__PURE__ */ jsx("div", {
1932
- 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),
1933
- onClick,
1934
- "data-title": title,
1935
- "data-subtitle": subtitle,
1936
- "data-timestamp": timestamp,
1937
- children: /* @__PURE__ */ jsx("div", { className: "h-0.5 w-1 rounded-full bg-muted" })
1938
- })
1939
- })]
1940
- });
1941
- };
1942
- //#endregion
1943
- //#region src/connect/components/document-timeline/components/timeline-bar.tsx
1944
- const getBarHeight = (size = 0) => {
1945
- switch (true) {
1946
- case size <= 0: return "h-[1px]";
1947
- case size === 1: return "h-[3px]";
1948
- case size === 2: return "h-[6px]";
1949
- case size === 3: return "h-[9px]";
1950
- case size >= 4: return "h-[12px]";
1951
- default: return "h-[1px]";
1952
- }
1953
- };
1954
- const formatTimestamp$1 = (isoString) => {
1955
- if (!isoString) return "";
1956
- try {
1957
- return format(parseISO(isoString), "HH:mm, dd, MMMM");
1958
- } catch {
1959
- return isoString;
1960
- }
1961
- };
1962
- const TimelineBar = ({ onClick, className, timestampUtcMs: timestamp, additions, deletions, addSize = 0, delSize = 0, isSelected = false }) => {
1963
- const [open, setOpen] = useState(false);
1964
- const noChanges = addSize === 0 && delSize === 0;
1965
- const addBarHeight = getBarHeight(addSize);
1966
- const delBarHeight = getBarHeight(delSize);
1967
- const tooltipContent = /* @__PURE__ */ jsxs("div", {
1968
- className: "flex flex-col text-xs",
1969
- children: [
1970
- /* @__PURE__ */ jsx("div", { children: formatTimestamp$1(timestamp) }),
1971
- /* @__PURE__ */ jsx("div", {
1972
- className: "text-success",
1973
- children: `${additions} additions +`
1974
- }),
1975
- /* @__PURE__ */ jsx("div", {
1976
- className: "text-destructive",
1977
- children: `${deletions} deletions -`
1978
- })
1979
- ]
1980
- });
1981
- const handleMouseEnter = () => {
1982
- if (!noChanges) setOpen(true);
1983
- };
1984
- const handleMouseLeave = () => {
1985
- setOpen(false);
1986
- };
1987
- return /* @__PURE__ */ jsxs("div", {
1988
- className: "relative",
1989
- onMouseEnter: handleMouseEnter,
1990
- onMouseLeave: handleMouseLeave,
1991
- children: [isSelected && /* @__PURE__ */ jsx(Icon, {
1992
- name: "TimelineCaret",
1993
- color: "#4EA9FF",
1994
- size: 10,
1995
- className: "absolute top-[-11px] left-[-2px] z-40"
1996
- }), noChanges ? /* @__PURE__ */ jsx("div", {
1997
- className: twMerge("flex h-[25px] w-1.5 cursor-pointer flex-col items-center justify-center rounded-[2px] hover:hover-effect", className),
1998
- "data-timestamp": timestamp,
1999
- onClick,
2000
- children: /* @__PURE__ */ jsx("div", { className: "size-[3px] rounded-full bg-muted-foreground" })
2001
- }) : /* @__PURE__ */ jsx(ConnectTooltip, {
2002
- className: "rounded-md bg-primary text-primary-foreground",
2003
- content: tooltipContent,
2004
- open,
2005
- onOpenChange: setOpen,
2006
- delayDuration: 0,
2007
- side: "bottom",
2008
- sideOffset: 5,
2009
- children: /* @__PURE__ */ jsxs("div", {
2010
- 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"),
2011
- "data-timestamp": timestamp,
2012
- onClick,
2013
- children: [/* @__PURE__ */ jsx("div", {
2014
- className: "flex h-3 w-0.5 items-end",
2015
- children: /* @__PURE__ */ jsx("div", { className: twMerge("h-3 w-0.5 rounded-t-full bg-success", addBarHeight) })
2016
- }), /* @__PURE__ */ jsx("div", {
2017
- className: "flex h-3 w-0.5 items-start",
2018
- children: /* @__PURE__ */ jsx("div", { className: twMerge("h-3 w-0.5 rounded-b-full bg-destructive", delBarHeight) })
2019
- })]
2020
- })
2021
- })]
2022
- });
2023
- };
2024
- //#endregion
2025
2113
  //#region src/connect/components/document-timeline/document-timeline.tsx
2026
- const defaultTimeLineItem = {
2027
- id: "default",
2028
- type: "bar",
2029
- addSize: 0,
2030
- delSize: 0
2031
- };
2032
- const DocumentTimeline = (props) => {
2033
- const { timeline = [], onItemClick } = props;
2034
- const [selectedItem, setSelectedItem] = useState(null);
2035
- const scrollContainerRef = useRef(null);
2036
- const handleClick = (item) => {
2037
- if (item.id === selectedItem || item.id === defaultTimeLineItem.id) {
2038
- onItemClick?.(null);
2039
- setSelectedItem(null);
2040
- } else {
2041
- onItemClick?.(item);
2042
- setSelectedItem(item.id);
2043
- }
2044
- };
2045
- const mergedTimelineItems = [...timeline, defaultTimeLineItem];
2046
- const [unselectedItems, selectedItems] = useMemo(() => {
2047
- const indexSelected = mergedTimelineItems.findIndex((item) => item.id === selectedItem);
2048
- return indexSelected === -1 ? [mergedTimelineItems, []] : [mergedTimelineItems.slice(0, indexSelected), mergedTimelineItems.slice(indexSelected)];
2049
- }, [mergedTimelineItems, selectedItem]);
2050
- const renderTimelineItems = useCallback((items) => {
2051
- return items.map((item) => {
2052
- if (item.type === "divider") {
2053
- const { timestampUtcMs, title, subtitle } = item;
2054
- return /* @__PURE__ */ jsx(HDivider, {
2055
- timestampUtcMs,
2056
- title,
2057
- subtitle,
2058
- onClick: () => handleClick(item),
2059
- isSelected: item.id === selectedItem
2060
- }, item.id);
2061
- }
2062
- return /* @__PURE__ */ jsx(TimelineBar, {
2063
- timestampUtcMs: item.timestampUtcMs,
2064
- addSize: item.addSize,
2065
- delSize: item.delSize,
2066
- additions: item.additions,
2067
- deletions: item.deletions,
2068
- isSelected: item.id === selectedItem,
2069
- onClick: () => handleClick(item)
2070
- }, item.id);
2071
- });
2072
- }, [handleClick, selectedItem]);
2073
- const unselectedContent = useMemo(() => renderTimelineItems(unselectedItems), [unselectedItems, renderTimelineItems]);
2074
- const selectedContent = useMemo(() => renderTimelineItems(selectedItems), [selectedItems, renderTimelineItems]);
2075
- useEffect(() => {
2076
- if (scrollContainerRef.current) scrollContainerRef.current.scrollLeft = scrollContainerRef.current.scrollWidth;
2077
- }, []);
2078
- return /* @__PURE__ */ jsx(ConnectTooltipProvider, {
2079
- delayDuration: 0,
2080
- skipDelayDuration: 0,
2081
- children: /* @__PURE__ */ jsxs("div", {
2082
- className: "relative h-[36px] w-full",
2083
- children: [
2084
- /* @__PURE__ */ jsx("div", {
2085
- className: "absolute left-0 z-20 h-[17px] w-[6px] bg-background",
2086
- children: /* @__PURE__ */ jsx("div", { className: "mt-[11px] h-[6px] w-[6px] rounded-tl-md bg-background" })
2087
- }),
2088
- /* @__PURE__ */ jsx("div", {
2089
- className: "absolute top-[11px] right-0 z-20 h-[6px] w-[6px] bg-background",
2090
- children: /* @__PURE__ */ jsx("div", { className: "h-[6px] w-[6px] rounded-tr-md bg-background" })
2091
- }),
2092
- /* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 bottom-0 h-[25px] rounded-md bg-background" }),
2093
- /* @__PURE__ */ jsx("div", {
2094
- className: "absolute inset-x-0 bottom-0 h-[36px]",
2095
- children: /* @__PURE__ */ jsx("div", {
2096
- ref: scrollContainerRef,
2097
- className: "h-full overflow-x-auto rounded-md",
2098
- children: /* @__PURE__ */ jsxs("div", {
2099
- className: "ml-auto flex h-[36px] w-max items-end px-2 pb-0",
2100
- children: [/* @__PURE__ */ jsx("div", {
2101
- className: "flex",
2102
- children: unselectedContent
2103
- }), /* @__PURE__ */ jsx("div", {
2104
- className: "flex rounded-sm bg-info/10",
2105
- children: selectedContent
2106
- })]
2107
- })
2108
- })
2109
- }),
2110
- /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute bottom-0 left-0 z-10 h-[25px] w-2 rounded-l-md bg-background" }),
2111
- /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute right-0 bottom-0 z-10 h-[25px] w-2 rounded-r-md bg-background" })
2112
- ]
2113
- })
2114
- });
2115
- };
2114
+ const DocumentTimeline = lazyComponent(() => import("../document-timeline.impl-zx6f7k2d.js").then((m) => m.DocumentTimeline));
2116
2115
  //#endregion
2117
2116
  //#region src/connect/components/document-toolbar/containers.tsx
2118
2117
  /**
@@ -2147,6 +2146,105 @@ function ToolbarControlsContainer(props) {
2147
2146
  }
2148
2147
  //#endregion
2149
2148
  //#region src/connect/components/document-toolbar/use-document-undo-redo.ts
2149
+ const UNAVAILABLE = {
2150
+ canUndo: false,
2151
+ canRedo: false
2152
+ };
2153
+ /** The scope `undo()` and `redo()` target by default. */
2154
+ const UNDO_SCOPE = "global";
2155
+ function isRetractionDocument(document) {
2156
+ const create = document.operations?.document?.[0]?.action;
2157
+ const input = create?.type === "CREATE_DOCUMENT" ? create.input : void 0;
2158
+ return undoCapabilitiesOf(document.header, input)?.undo === "retraction";
2159
+ }
2160
+ function undoRoute(client, document) {
2161
+ if (!document || !isRetractionDocument(document)) return "dispatch";
2162
+ return client ? "client" : "none";
2163
+ }
2164
+ const DISABLED = {
2165
+ canUndo: false,
2166
+ canRedo: false,
2167
+ undo: () => void 0,
2168
+ redo: () => void 0
2169
+ };
2170
+ const availabilityReads = /* @__PURE__ */ new WeakMap();
2171
+ function readAvailability(client, documentId, revision) {
2172
+ let reads = availabilityReads.get(client);
2173
+ if (!reads) {
2174
+ reads = /* @__PURE__ */ new Map();
2175
+ availabilityReads.set(client, reads);
2176
+ }
2177
+ const cached = reads.get(documentId);
2178
+ if (cached?.revision === revision) return cached.read;
2179
+ const entry = {
2180
+ revision,
2181
+ read: Promise.resolve(UNAVAILABLE)
2182
+ };
2183
+ entry.read = client.undoRedoAvailability(documentId, UNDO_SCOPE).catch((error) => {
2184
+ console.error("Failed to read undo and redo availability:", error);
2185
+ if (reads.get(documentId) === entry) reads.delete(documentId);
2186
+ return UNAVAILABLE;
2187
+ });
2188
+ reads.set(documentId, entry);
2189
+ return entry.read;
2190
+ }
2191
+ const pendingPresses = /* @__PURE__ */ new WeakMap();
2192
+ function queuePress(client, documentId, press, failure) {
2193
+ let presses = pendingPresses.get(client);
2194
+ if (!presses) {
2195
+ presses = /* @__PURE__ */ new Map();
2196
+ pendingPresses.set(client, presses);
2197
+ }
2198
+ const queue = presses;
2199
+ const prior = queue.get(documentId);
2200
+ const run = (prior ? prior.then(press) : new Promise((resolve) => resolve(press()))).catch((error) => {
2201
+ console.error(failure, error);
2202
+ });
2203
+ queue.set(documentId, run);
2204
+ run.finally(() => {
2205
+ if (queue.get(documentId) === run) queue.delete(documentId);
2206
+ });
2207
+ }
2208
+ /**
2209
+ * Undo and redo of a base-reducer 3 document through the reactor client, so
2210
+ * the author signs the RETRACT it submits. Availability is read when the
2211
+ * global or document revision changes, and presses run one at a time.
2212
+ * Without a client the controls are disabled. Returns undefined below
2213
+ * base-reducer 3, where the caller dispatches UNDO and REDO itself.
2214
+ */
2215
+ function useBaseReducer3UndoRedo(document) {
2216
+ const client = useReactorClient();
2217
+ const route = undoRoute(client, document);
2218
+ const documentId = route === "client" ? document?.header.id : void 0;
2219
+ const revision = `${document?.header.revision[UNDO_SCOPE] ?? 0}:${document?.header.revision.document ?? 0}`;
2220
+ const [availability, setAvailability] = useState({ value: UNAVAILABLE });
2221
+ useEffect(() => {
2222
+ if (!client || !documentId) return;
2223
+ let cancelled = false;
2224
+ readAvailability(client, documentId, revision).then((value) => {
2225
+ if (!cancelled) setAvailability({
2226
+ documentId,
2227
+ value
2228
+ });
2229
+ });
2230
+ return () => {
2231
+ cancelled = true;
2232
+ };
2233
+ }, [
2234
+ client,
2235
+ documentId,
2236
+ revision
2237
+ ]);
2238
+ if (route === "none") return DISABLED;
2239
+ if (!client || !documentId) return void 0;
2240
+ const { canUndo, canRedo } = availability.documentId === documentId ? availability.value : UNAVAILABLE;
2241
+ return {
2242
+ canUndo,
2243
+ canRedo,
2244
+ undo: () => queuePress(client, documentId, () => client.undo(documentId, UNDO_SCOPE), "Failed to undo:"),
2245
+ redo: () => queuePress(client, documentId, () => client.redo(documentId, UNDO_SCOPE), "Failed to redo:")
2246
+ };
2247
+ }
2150
2248
  /**
2151
2249
  * Checks whether a document has at least one non-zero revision count.
2152
2250
  *
@@ -2160,11 +2258,17 @@ function hasRevisions(document) {
2160
2258
  /**
2161
2259
  * Returns undo state and an undo dispatcher for a document.
2162
2260
  *
2163
- * `canUndo` is true when the document has at least one non-zero revision count
2164
- * across any revision scope.
2261
+ * On base-reducer 3 both come from the reactor client, and without one undo
2262
+ * is disabled. Otherwise `canUndo` is true when the document has at least one
2263
+ * non-zero revision count across any revision scope, and undo dispatches UNDO.
2165
2264
  */
2166
2265
  function useUndo(documentId) {
2167
2266
  const [document, dispatch] = useDocumentById(documentId);
2267
+ const client = useBaseReducer3UndoRedo(document);
2268
+ if (client) return {
2269
+ canUndo: client.canUndo,
2270
+ undo: client.undo
2271
+ };
2168
2272
  return {
2169
2273
  canUndo: hasRevisions(document),
2170
2274
  undo: () => dispatch(undo())
@@ -2173,11 +2277,18 @@ function useUndo(documentId) {
2173
2277
  /**
2174
2278
  * Returns redo state and a redo dispatcher for a document.
2175
2279
  *
2176
- * `canRedo` is true when the document clipboard contains at least one operation
2177
- * that can be reapplied.
2280
+ * On base-reducer 3 both come from the reactor client, and without one redo
2281
+ * is disabled. Otherwise `canRedo` is true when the document clipboard
2282
+ * contains at least one operation that can be reapplied, and redo dispatches
2283
+ * REDO.
2178
2284
  */
2179
2285
  function useRedo(documentId) {
2180
2286
  const [document, dispatch] = useDocumentById(documentId);
2287
+ const client = useBaseReducer3UndoRedo(document);
2288
+ if (client) return {
2289
+ canRedo: client.canRedo,
2290
+ redo: client.redo
2291
+ };
2181
2292
  return {
2182
2293
  canRedo: hasAtLeast(document?.clipboard ?? [], 1),
2183
2294
  redo: () => dispatch(redo())
@@ -2239,12 +2350,11 @@ function ToolbarRedoButton(props) {
2239
2350
  }) } = props;
2240
2351
  const { redo, canRedo } = useRedo(document?.header.id);
2241
2352
  const onClick = makeOnClick(document, onClickOverride, redo);
2242
- const disabled = !canRedo;
2243
2353
  return /* @__PURE__ */ jsx(ToolbarButton, {
2244
2354
  "data-testid": "toolbar-redo-button",
2245
2355
  "aria-label": "Redo",
2246
2356
  className,
2247
- disabled,
2357
+ disabled: !canRedo,
2248
2358
  onClick,
2249
2359
  children
2250
2360
  });
@@ -2315,7 +2425,8 @@ function ToolbarHistoryButton(props) {
2315
2425
  /**
2316
2426
  * Toolbar control for closing the current document view.
2317
2427
  *
2318
- * By default, this selects the current document's parent folder. Provide
2428
+ * By default, this goes back when the app's history allows, else it selects the
2429
+ * current document's parent folder. Provide
2319
2430
  * `children` to replace the default icon, or `onClick` to override the default
2320
2431
  * close behavior.
2321
2432
  */
@@ -2324,8 +2435,7 @@ function ToolbarCloseButton(props) {
2324
2435
  name: "XmarkLight",
2325
2436
  size: 16
2326
2437
  }) } = props;
2327
- const parentFolder = useNodeParentFolderById(document?.header.id);
2328
- const onClick = makeOnClick(document, onClickOverride, () => setSelectedNode(parentFolder));
2438
+ const onClick = makeOnClick(document, onClickOverride, useCloseNode(document?.header.id));
2329
2439
  return /* @__PURE__ */ jsx(ToolbarButton, {
2330
2440
  "data-testid": "toolbar-close-button",
2331
2441
  "aria-label": "Close document",
@@ -2617,10 +2727,16 @@ function ControlsContainerSlot(props) {
2617
2727
  //#endregion
2618
2728
  //#region src/connect/components/drive-auth-gate/drive-auth-gate.tsx
2619
2729
  function DriveAuthGate(props) {
2620
- const { mode = "login", onLogin, onLogout, className } = props;
2621
- return /* @__PURE__ */ jsx("div", {
2622
- className: twMerge("flex w-[28rem] max-w-[calc(100%-2rem)] flex-col items-center gap-4 rounded-3xl bg-background p-8 text-center shadow-2xl ring-1 ring-black/5 dark:ring-white/10", className),
2623
- children: mode === "login" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
2730
+ const { mode = "login", onLogin, onLogout, onClose, className } = props;
2731
+ return /* @__PURE__ */ jsxs("div", {
2732
+ className: twMerge("relative flex w-[28rem] max-w-[calc(100%-2rem)] flex-col items-center gap-4 rounded-3xl bg-background p-8 text-center shadow-2xl ring-1 ring-black/5 dark:ring-white/10", className),
2733
+ children: [onClose ? /* @__PURE__ */ jsx("button", {
2734
+ type: "button",
2735
+ "aria-label": "Close",
2736
+ onClick: onClose,
2737
+ className: "absolute top-4 right-4 flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
2738
+ children: /* @__PURE__ */ jsx(CloseGlyph, {})
2739
+ }) : null, mode === "login" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
2624
2740
  /* @__PURE__ */ jsx("h2", {
2625
2741
  className: "text-xl font-semibold text-foreground",
2626
2742
  children: "Log in to access this drive"
@@ -2654,7 +2770,21 @@ function DriveAuthGate(props) {
2654
2770
  className: "mt-2 flex items-center gap-2 rounded-lg border border-border bg-card px-6 py-2.5 text-sm font-semibold text-foreground shadow-sm transition-colors hover:bg-muted focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
2655
2771
  children: "Log out"
2656
2772
  })
2657
- ] })
2773
+ ] })]
2774
+ });
2775
+ }
2776
+ function CloseGlyph() {
2777
+ return /* @__PURE__ */ jsx("svg", {
2778
+ "aria-hidden": "true",
2779
+ focusable: "false",
2780
+ width: 14,
2781
+ height: 14,
2782
+ viewBox: "0 0 14 14",
2783
+ fill: "none",
2784
+ stroke: "currentColor",
2785
+ strokeWidth: 1.5,
2786
+ strokeLinecap: "round",
2787
+ children: /* @__PURE__ */ jsx("path", { d: "M2 2 L12 12 M12 2 L2 12" })
2658
2788
  });
2659
2789
  }
2660
2790
  //#endregion
@@ -2840,7 +2970,7 @@ function UploadFileItemStatusRow(props) {
2840
2970
  }
2841
2971
  //#endregion
2842
2972
  //#region src/connect/components/upload-file-item/upload-file-item.tsx
2843
- const UploadFileItem = /* @__PURE__ */ forwardRef(function UploadFileItem(props, ref) {
2973
+ const UploadFileItem = /*#__PURE__*/ forwardRef(function UploadFileItem(props, ref) {
2844
2974
  const { fileName, fileSize, status, documentType, progress = 0, errorDetails, onClose, onOpenDocument, onFindResolution, className, ...delegatedProps } = props;
2845
2975
  return /* @__PURE__ */ jsxs("div", {
2846
2976
  ref,
@@ -3080,7 +3210,7 @@ function uploadsReducer(state, action) {
3080
3210
  }
3081
3211
  }
3082
3212
  function useUploadTracker(useLocalStorage = false, driveId) {
3083
- const [uploads, dispatch] = useReducer(uploadsReducer, useCallback(() => {
3213
+ const getInitialState = useCallback(() => {
3084
3214
  if (useLocalStorage && driveId) try {
3085
3215
  const stored = localStorage.getItem(`uploadTracker_${driveId}`);
3086
3216
  if (stored) return JSON.parse(stored);
@@ -3090,7 +3220,8 @@ function useUploadTracker(useLocalStorage = false, driveId) {
3090
3220
  return {};
3091
3221
  }
3092
3222
  return {};
3093
- }, [useLocalStorage, driveId])());
3223
+ }, [useLocalStorage, driveId]);
3224
+ const [uploads, dispatch] = useReducer(uploadsReducer, getInitialState());
3094
3225
  useEffect(() => {
3095
3226
  if (useLocalStorage && driveId) try {
3096
3227
  localStorage.setItem(`uploadTracker_${driveId}`, JSON.stringify(uploads));
@@ -3132,11 +3263,12 @@ function useUploadTracker(useLocalStorage = false, driveId) {
3132
3263
  });
3133
3264
  };
3134
3265
  try {
3266
+ const fileNode = await onAddFile(file, parent, progressCallback);
3135
3267
  dispatch({
3136
3268
  type: "SET_FILE_NODE",
3137
3269
  payload: {
3138
3270
  id: fileId,
3139
- fileNode: await onAddFile(file, parent, progressCallback) || void 0
3271
+ fileNode: fileNode || void 0
3140
3272
  }
3141
3273
  });
3142
3274
  } catch (error) {
@@ -3242,6 +3374,7 @@ function DropZone(props) {
3242
3374
  setConflictUploadId(null);
3243
3375
  };
3244
3376
  const { isDropTarget, ...dropProps } = useDropFile(handleAddFile);
3377
+ const setSelectedNode = useSetSelectedNode();
3245
3378
  return /* @__PURE__ */ jsxs("div", {
3246
3379
  className: twMerge("relative", className),
3247
3380
  ...enable ? dropProps : {},
@@ -3409,22 +3542,32 @@ function EditorUndoRedoButtons(props) {
3409
3542
  });
3410
3543
  }
3411
3544
  //#endregion
3412
- //#region assets/powerhouse-rounded.png
3413
- var powerhouse_rounded_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABUHSURBVHgBxZwLsBTVmcf/X8+VN+EiT+XhuGo2aojomhQxqIMpS+NuIrqP6K6bYGk2tSYG0FR2XUHErCVruQKL+EiZCDFiJXEX7pYmbtzIGETxfUW0QKIODwHFxyW85d4+Oaf7PL5zuufembkD+aihT5/uOX36N//v+06f7r6EP6EVJ5ZaC0BJyKJcPY0IRSGSMiDLEMnSWIf8VEjIZYSKiLEpAsqdQHulvdyBP5ERjqAxYOfK1amqCtRzF/geIrM1qVFgy3LZ1iWhHkmgRwTgiRNLCtp0+SnJQ7b6R6XM/17JFLQaHUBhl4KvyoKEuUQW2t5qL6/AYbbDBlCpTbrYdHlCM4Co1R0tBEa8mvWMk8sx4RdEsNRUlTLnHiVVub69XMFhsKYDdOAgwaE1OYSFYWDJpSB39EBu7n/hll5PHSThARasjitTVOT3l7z9cnkummxNBSjhTZPw5shmi7Z5MjjkPwPSUyLrQjfxMNwiSGi+amnUp//X5ISFaIBLRRLmvvVyeQmaZE0BKMEVZUMPSBgl06yDRRoSX0/3ybq0XwKFHRSBQ4tgS0Z5DmOyKd0u21xxVIyZzXDrXgP8s8+VposIN5NKDiamkYNj4ZFWG/l+a3F66gyVqf4LYemSl0FcJIQFl8KLDWBhFdohm53ZWzU2DDCJdTHmiIhm+BAMJArc1qjQKZCMAikPmKoRVXvrQeQq8yDGDrAsxD7AtBxhwdsvlmeiQWsIYOKyAsvl1yeScVHywVnXTY4Q6YORc2Hr2npLZtwShkSeSATC4YyLeByoXncxkEFk2+VgXHThkkoDLl03QA1vpUoURJE+ySirOk9xzKUpx61ZVyhIJHkQuZuqJBK6rQImAje2S8Fd29XJqorogymVNfVBrAtgCo9WqmIKL3BZVeetq2VkwVCQlREoMq33e0aszHOtiYt+8jBAhWYTe/sk6waiCCCm36ngqPog1gzQwiOpPA+OLEdGaRFz3Xx4PCM7pYKp1HUqPYbwABIx9yXBIp6D5bmyiDMqdBDjQIVyGUuIdSixJoAGnjyholEaX6ZgosB1o3xwFKgvyLpEbI2CXhJLHEaBxNwzqYuzEOOYqVDtGzMVxjrfGKCqKpYQqSaIEWowCW95Fp6BEMG6c7JNlQt6P7MtSrclLi6nE6hgv5fsg4L+jqxXZUSsrUj/OGY/1z5FkV2ioJfJp8DKsq92G+mP/nHVNlWf/N7ak5LDynM9JJarkUZPbAo97SDHefPlQaZaWBZi5OBBA9HwdC9kPwrWlUl/OHBK9nGx1Ko4InuC0OswY0sinbOMgiPdNUoUSHw/YmEiMvXwtqcKIZ2cvBgyGlHcr2Pbpv9DowCLE0rTqEDzDBCrpqRnBasOdyIFu18UGRWRU5RRjIWl2+LuTy6WGqWTBpEqJoAYcUjwIDmYsJA5MBY/0u08P6WlSa2ji7s6tlfWVGNEVeHJuBcJekUetdXGM+ZWVllWQRE7YXcmdpuOfSbj+jHRnJc7IWInZntKJqHoeEc6rhHLwKTSSZxJJN4QJzbZWCeRmNWpZWwSSrLsQAtOrxYPW1DFIhHNR3J5FsY3piymSB4bBw0chLPPOg1nTPhz9O3XhxEwJcr9CanbyhTenj37sXjpf+OTQ4cSiGd9fgK+PPlMuL3MWDGV0/4DB/Haho148vkXsGffXj0KIj3yidIkkp6xLqvziO1oScJsRScekKUpyLFcBRYnnjctEvJLHqCCVk7BuqyLaU6B5517Jq675nKMPXYkmm3b3/sQN9x6L9a/tdmq7ed334LiuGN6/O7Ojz7GLXf/CE+9+JJVoc3CcaDCrtgpUNcBXVdWXli1JGw3NwYOHXX88mRyINKQoDOelziy8M4563QsuG0mPjV4IJptGzZuxoybFmHT1vds/Jp6wdn46vlfqun7A/v3x0XnTMaGyia8s22bn0CY8atvMlNmqU1sHXn80o4dlQN8/8wwRmbdOfKrRZNVfXhhBjbwIgwaNBCzf3AlDof9pvwCrvnX+Xhv58cW3hD5I111+V+hXrt+2j9isOwrvGFNlQ/P3qCiDHgzwvY8gCpxCIqmgY3ziPgVhomDrmxATjn7LzBi2FA02+5/8FHMvX0J9u8/aBOQKvz9JedjZAPHGzd6FM4584wAlh4vGqje0IeVIaaHY8NAgVFJkSZ2bQuqAo/cuFDVTzj5BDTTPt61B9+/6R78ZNmvbGIwbnfMyGHSdSejUTv95M+4gTP5iqNwnUMkGdYCFXoApcvP8WZLzFDEDaRgxm1uKJLW9e/fF82yd7fvxLdm3IHVL6yzihP6o8qXfe08HN06GI1a3759sipzVyG+8uxHb0vv91izAE+Y8OWpiZ+DWKwjO96zv47nzuxXa5K99sY7Et5/JhCV2Ul4HfsGDuyHiy9oXH2pMSB2AK6uZAKX9a5eLMjW4pmlkmnJjgPlkOhinlEtnDxgTJF8iqq31var1bjz7l/ik85O3aZxXT3jIsufPnE8+vXtpdoNPDMzHWuIgtwO6dSP3o+SoWE6kFegY6XCstozUaAKjHLTtFB9/J8HzHNhf4qqEYvlWOu+pY/itgUP4+ChTjfvx5o0sy8D+/dDU0yryruE9JIGsi5slgIlk0wSBRa6CiWhrxPt/xk1umvY1AMI8D6N2e7d+/HDO36K3z2zlimZz/npjwa6sbI1GQD3OmxohQsDxZQjfVBBgeuSVWCSTPqopyywItlduW/QW+ea5sPc2oNGQKMAN23egauuvR1PrV5rE4R3RW/AmXOSi+0ffIjXN1bQNMvGOF9tvMzOU16klNQyBQhR8uIbBSCtm5opH/KP3gC/VWvW4erpd8ori/ft9wXC6RChs6+bPFDLux76H3R2daFhy4XmIJkZIG8aDb4iZSRMRBcpX5arRQNJwEH0lrYM+PdCeK9qs2WPPInvz74Xu3bvzWzz7nCw3ympo7T+pTfexG0/ehC9MUFk2xfEvEm7sCAmjrxYCCoqdjIGtkz0rgCtVIOPV4+AV+3w7rjrl/j58nL6LQ0m05Qncq1L5tpKkW3l1eg/oB+u/8bXexcPlSjs7QDtZZTGWLsMBvK2nzIOtkSISwhuS3o7BSuur9zFe7b9Bz7BTbc9gPLTa+3XzUjB3CziSYTv40HUJ6JO+OHH/z8ZwH/n7y5BvUb6ZJIZGdLnoUES+bNe4OdskomyGHLOFFTMNh1cjZCDJeC1WLPd8+P/lfBeZb1PzesomKsSm9tj8c9OnuoJ0vvbHsWCh3+Bek14xzbK0xXQs+A2HprhDmsg7dNpkfz2cSa25btnaMRKtYHcvuNDtP16dXdN6ZMSCLOw8NZFADWFsOSxx/EfDy5DXRY4WuIFduiia8mf3gobUOJTAFszDQumvibY+o1bsE/OpqTti7Af2eybLHkSEb4izfQ927bsiSew8BePoFajHtZtPUswTKDaRFHNYxe9QatdETnNU889ybGdH+4K9hWZss2I5h+/30FmP7KwXVZ29uPHHsM9y2t7qtdLXpSzkRc1ubzwpZJ2qxeAqrCivJZrFOjggf3zN4QuTH62s9nPYXX76T2ca6d2T9sKPPTEb9CTJfFcoAYTPKeFLl2MuvueV6S89Zp6gM+eUkShELnd7Xf9rGoDu0FFruwlErhEg6A/qrx4+XLs2ru3pr6xg+ZsABOKsEX+u0fezuihMW31RsdxY0bi3LM+h0wjXusBTA0ruSFJzm3tPl6fOAWB3Xv3ofzKy+jWRB0bhL/CH+qMEJ5E0BmzyO1ubQJM7Mbrr0Bx/Ci/X5R1W5ccmAsT/KGN3h6C5N3Z9sEH6M5E6L8ie07eehWlynEgKpnGUY2NSAabRHWQ0/apwQPwX/O+i/HjHESX1fTwxSQFDpXX6f2FFyOF7w5mN6oenTKJkq9zDYnMF7xt8kfoiMiPOtm93N5uK/9pRHXcoR0zahjuvWMGTigem361myTi3FX4617/3KrfA4ETx4xBjyZc/4UQOWDNueuye0jdLCuRPIlKoioDKQSVSVXcZepX4ohhQ7Bo3rUYlyiRfd9zYa0ssEELG9aAcn4yVjF62DCcftJJqNk8NxVGXeDwBNtH2HWpQFnaBPs9d5kE+zwJ4LZ4rfhHrsOtFcT7bp+B8WO1O+e4adIqy7xWjfZ4QaM6U/Y96ih899K/xrAhQ9CtGS8ywrNPq7p6DtSes7BfTp5oVYGi3bmpaZwPV2P4bsyVkVV9raYgLr71Wow9dgQ8ILnjUOEOz6pcMf3XR8K75eqrcfHkWm46ifQRGO51Go4IXNaCM8q022mTupSrcCUJDgw+/VCF6XHjetlZS2LivBnJMMdANLEuEx68ATZYf9O1McOH42ezZ+OiSZNQkwnvF0h1giDe6XoOlBiXKIrLEQooC/agtaPMoPkBAC6YZnRYt40ecTQWzb0WgwYNQHYyIRjSwJegWTv1+OPxkxtuwMnHHYeaLThP71npOAAJf7tNop0t7ZF6tzZJJFZ5bimCpc1Y8JfInFx9NvaYEbjsq1P8QTTC6SuwowqbwadOPhtLZ92YKLAu85TGFZcDlG83SpSeq9iZe1BtFopwH/fF2GalVKUxy1KiN+ysXWIf1WAK5M7KB9vKfeQ471/+4XL88J+uThJHXWbVB60XDSuEF/vwePwT/L4wRFfZ0jWAPPUJ/TRnEB89FfbOhh89xJ8kyJy0+6GOHT4M99/wA1xx4QVozKq4LnvtwT4XaFw65vtJcDHaVEvpkwmFQll0ig65V2t6I8lATGctoOvUP1L16h6xjo/pdFmMppl+cNKeqKdEOUAeOxYLr/sexo3qxQOcRiz8Ud7gI/g+sfE89kFLWTWVKFD5sgRR9lQlhK8+mHcrYg03tkpthgrflDfMvbEku2Qzv2HpjIl4cO6s3sFLLFSUr74MUGGgai8gscT8XQb3jLToWiigXmeI3Y0eQQmoZD1Wjz50yfVCGkRJKzRpP/LHaA3YiidWpQUb55z6lBdc9bWL8O1LL0bfPnXGu2oWumeiEe66sQ+ZxcNIRG2mGXvFXVn3dFlu7bBS1cozH6NAq77YV2dvFLhl+/to++3TqZaZqtXxBg3oj1u/8y1877K/aSI8MKXFDlwc1jl47LUwmX1X2Wlv//lAiIWerIOEwl03hksqqu7gwU/QqC1+aDkOdh4Cj3XKjj92FJbOvRF/OfmLaKbt239AOhwDZSAxcBaaVV7aLVk7l7flz/m0tCxIVGhUZ1/Uk7iY8ixEk5nlAV5+bQMasVfX/x6Pr3rOtmPi6Rknfxo//ffZOHFcDbMqddraDW+CP52PrtgNWUKIPBtL9RXQp8zb8gAmyUSp0LqQVpiBmUDsSg7iQ+zC7555CVu2vYd67fb7lmWGEn97fgl3/dtMDBnU/Kf93//oI/x2zXPMbWMNKU5AuriXgiPfI5eGL2VnZx2VCtX1sVWfeojHh5i4s4GIFOLu3Xtw5+KfoR57bOWzWPf7tyDMeFMmjeu+8XXM+vY0DOzXpOcAA5tz193Ys2dPCq+LuW1X8L6IXrIEUtnc/szNYXuZ90TUexBDR47dJdPsVHMrL505TtOjvZlO7k6deQ7nnU3v4o0Nb+PzZ5yKgQP6d3sihzo7cf2ti/CHPXuT744eMQyLZs3EV85ubrwztnn7DsxauAhPPvu8dV8LJ/aVp9yZ2PWwfvxj5h92bGkP26VqBzzus19aieTPmLD35PhrXeTXE7mnVtXEwJRzvoAJp5yE/v36InMDVi7Wrt+IR3690o73rrniUhwzcrjL5d7sM7LTW6EJXtQnL/9Tye2l19/AU8+/KG827XGZlg9VgqSRujRSj0tGG1ix5dVnch/AqQqw+JlJRdFSeAXe+3LuRRvz/hwxeHZ78Ois/wyeLrOHX/mNo+w0vgMogixtl0JvMdesZqAMlkFj9vpW5hLNJJHY254oUTplRPHplfY1lTxOVV937fhga8fQEeMPypO6kDuvvRFkzf30ZEbW5lQVB70e7u+mrvI/3mQFvHEYcy0wQMJC8IYe2kVF7IPMXGH42dbtL+J/3rx2TRlVrNv3hTt2blkzZPi4oRLYJDYRksIKtOs9+GCuX8mBhAfSLUU1gBYehwUfYsyXImd77C7LkFUdV6SnPKtkLNz62rPz0I31+Mb60DEnrEFX14VSiaMztyF4nMpVmwZLsDCI8qDpNhDnKM+dmHNJXzHeNLvNpExlQazjFwsu3jGQSFy3fcvaZ3t88LBHgElWHjZGvfY+VajnaIhlYmEgpSsOB5v6TsxNg7nt5jsBTAYqMwNitpnZktgHKgJImVgXM3B6jEdMsQ6eqEQRvtKxY2uPf8iRUKMlSSWilYKoGD6M7t5SB0sU5o/y8IQCbyl4UNW7JID5zfJEvSls+7vpdbNklQjjpKdScAUiV8HSQxS8KdWSRsMAsxAZHA4JDpzLzAygGUDaD3mwBFliOb1zedgC82Kl/i92MEUOUHuPJ2ZloZVXqB1ebhd7shQiVspJnaIB4D/VD6tMmNcFkB3OJJg4RL2bt0zKIoiqwluY+GshWfcH/IwtdCjmsQ42LJB6yuCQhLe+dnhhV2u2BGKBlstjT8wAMxEyT3XgEOGAg7LwyMXTrIkMQD549tQGwM/mPuh0sEDtUZe4pF54vLsN2fhTvqhmb6YjT3lAVoG6COS4M5CvwIyxoVGyDNxXr4ugPlScFXJMC1v29b25UmnsL//2CqCycadOmiZjx3zpj62+4hgNW+3q0/cv3C5uSTm9YyoUQUG4bYIr0HNlOHB6XR69Q84lzH339ecWoBfWa4DKdHKZL2dVpnpuag5RFaarznTFW81xYyZD302Z+my98BUr7/8UOunKRlw2tKYANJaoUYg5slhEbnwLfJR4tV+XZwYXH9mIMKl42Zl/Mb0ZLrP83C2vr1mCJllTARobe8qkm6WLfJM0SEFcZIE6e+iNCDZltMjVxmGyeuWuMgTKWDdgQaOxrpodFoDKlFt3FVBCokhRDORmi34crKU7ottVnnFl+4cNnLHDBpDbuAlfmIpOeSlI+CbDl6/E7nok9HYvDbNtMNCojIgWbl1XfRalWXZEABorFkutXYP3lRRMeabnikSZeZ2wlKqsO9NMK0JQG7WIcmH3gPLhUlueHVGAoSmgnYMOTJQTASU5YjxOzvkVpXJaVewUwStoClL6dx/UXyOP5AevikjeJTvCwEL7I6IVG2Tw6vcCAAAAAElFTkSuQmCC";
3414
- //#endregion
3415
- //#region src/connect/components/ens-avatar/ens-avatar.tsx
3416
- function ENSAvatar(props) {
3417
- const { avatarUrl = powerhouse_rounded_default, size = "14px" } = props;
3418
- return /* @__PURE__ */ jsx("img", {
3419
- alt: "ENS Avatar",
3420
- className: "flex-none rounded-full object-contain",
3421
- src: avatarUrl,
3422
- style: {
3423
- width: size,
3424
- height: size
3425
- }
3545
+ //#region src/connect/components/branding/connect-branding.tsx
3546
+ /**
3547
+ * Connect's branding as the components see it: the host app provides it once
3548
+ * at its root (images already resolved to data URIs) and the components read
3549
+ * it from here instead of reaching into configuration. `icons` are the drive
3550
+ * explorer's, which the generic plugin owns; `appName`, `icon` and
3551
+ * `homeBackground` are Connect's identity (`connect.branding`). Without a
3552
+ * provider every built-in icon renders.
3553
+ */
3554
+ const ConnectBrandingContext = /*#__PURE__*/ createContext({});
3555
+ function ConnectBrandingProvider(props) {
3556
+ return /* @__PURE__ */ jsx(ConnectBrandingContext.Provider, {
3557
+ value: props.branding ?? {},
3558
+ children: props.children
3426
3559
  });
3427
3560
  }
3561
+ /** The provided branding; `{}` (built-in look) without a provider. */
3562
+ function useConnectBranding() {
3563
+ return useContext(ConnectBrandingContext);
3564
+ }
3565
+ /** The icon for a document of `documentType`: the explorer's icon for that
3566
+ * type, else its default document icon, else undefined (the icon the package
3567
+ * ships, or the built-in one). */
3568
+ function brandedDocumentIcon(branding, documentType) {
3569
+ return branding.icons?.documents?.[documentType] ?? branding.icons?.document ?? void 0;
3570
+ }
3428
3571
  //#endregion
3429
3572
  //#region src/connect/constants/options.tsx
3430
3573
  const defaultDriveOptions = [
@@ -3655,6 +3798,11 @@ function getDriveSharingType$1(drive) {
3655
3798
  }
3656
3799
  function FileItem(props) {
3657
3800
  const { fileNode, className, customDocumentIconSrc } = props;
3801
+ const setSelectedNode = useSetSelectedNode();
3802
+ const preloadNode = usePreloadNode();
3803
+ const target = useNodeTarget(fileNode);
3804
+ const link = useLinkProps(target, () => setSelectedNode(fileNode));
3805
+ const href = props.href ?? (target ? link.href : void 0);
3658
3806
  const [mode, setMode] = useState("READ");
3659
3807
  const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState(false);
3660
3808
  const [selectedDrive] = useSelectedDriveSafe();
@@ -3665,9 +3813,12 @@ function FileItem(props) {
3665
3813
  });
3666
3814
  const { isAllowedToCreateDocuments } = useUserPermissions();
3667
3815
  const editorModules = useEditorModulesForDocumentType(fileNode.documentType);
3668
- const preloadEditors = () => editorModules?.forEach((editorModule) => {
3669
- preloadEditorModule(editorModule);
3670
- });
3816
+ const preload = () => {
3817
+ editorModules?.forEach((editorModule) => {
3818
+ preloadEditorModule(editorModule);
3819
+ });
3820
+ preloadNode(fileNode);
3821
+ };
3671
3822
  const { onRenameNode, onRenameDriveNodes, onDuplicateNode } = useNodeActions();
3672
3823
  const downloadDocument = useDownloadDocument(fileNode.id);
3673
3824
  const isReadMode = mode === "READ";
@@ -3698,13 +3849,15 @@ function FileItem(props) {
3698
3849
  handler();
3699
3850
  setIsDropdownMenuOpen(false);
3700
3851
  }
3852
+ const branding = useConnectBranding();
3853
+ const documentIconSrc = customDocumentIconSrc ?? brandedDocumentIcon(branding, fileNode.documentType);
3701
3854
  const iconNode = /* @__PURE__ */ jsxs("div", {
3702
3855
  className: "relative",
3703
- children: [customDocumentIconSrc ? /* @__PURE__ */ jsx("img", {
3856
+ children: [documentIconSrc ? /* @__PURE__ */ jsx("img", {
3704
3857
  alt: "file icon",
3705
- className: "max-w-none",
3858
+ className: "max-w-none object-contain",
3706
3859
  height: 34,
3707
- src: customDocumentIconSrc,
3860
+ src: documentIconSrc,
3708
3861
  width: 32,
3709
3862
  draggable: false
3710
3863
  }) : /* @__PURE__ */ jsx(DefaultFileIcon, {}), isReadMode && syncStatus && /* @__PURE__ */ jsx("div", {
@@ -3738,6 +3891,7 @@ function FileItem(props) {
3738
3891
  children: /* @__PURE__ */ jsx("button", {
3739
3892
  className: twMerge("hidden group-hover:block", isDropdownMenuOpen && "block"),
3740
3893
  onClick: (e) => {
3894
+ e.preventDefault();
3741
3895
  e.stopPropagation();
3742
3896
  setIsDropdownMenuOpen(true);
3743
3897
  },
@@ -3753,10 +3907,15 @@ function FileItem(props) {
3753
3907
  onCancel,
3754
3908
  onSubmit
3755
3909
  });
3756
- return /* @__PURE__ */ jsx("div", {
3757
- className: "relative w-64",
3758
- onClick: isReadMode ? () => setSelectedNode(fileNode) : void 0,
3759
- onMouseEnter: preloadEditors,
3910
+ const isLink = isReadMode && !!href;
3911
+ return /* @__PURE__ */ jsx(isLink ? "a" : "div", {
3912
+ href: isLink ? href : void 0,
3913
+ "aria-current": isLink ? link["aria-current"] : void 0,
3914
+ className: "relative block w-64",
3915
+ onClick: isLink ? link.onClick : isReadMode ? () => setSelectedNode(fileNode) : void 0,
3916
+ onMouseEnter: preload,
3917
+ onTouchStart: preload,
3918
+ onFocus: preload,
3760
3919
  ...dragProps,
3761
3920
  children: /* @__PURE__ */ jsx("div", {
3762
3921
  className: containerStyles,
@@ -3882,6 +4041,12 @@ function DefaultFileIcon() {
3882
4041
  //#region src/connect/components/folder-item/folder-item.tsx
3883
4042
  function FolderItem(props) {
3884
4043
  const { folderNode, className } = props;
4044
+ const folderIconSrc = useConnectBranding().icons?.folder;
4045
+ const setSelectedNode = useSetSelectedNode();
4046
+ const preloadNode = usePreloadNode();
4047
+ const target = useNodeTarget(folderNode);
4048
+ const link = useLinkProps(target, () => setSelectedNode(folderNode));
4049
+ const href = props.href ?? (target ? link.href : void 0);
3885
4050
  const { isAllowedToCreateDocuments } = useUserPermissions();
3886
4051
  const [mode, setMode] = useState("READ");
3887
4052
  const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState(false);
@@ -3929,9 +4094,15 @@ function FolderItem(props) {
3929
4094
  onSubmit
3930
4095
  });
3931
4096
  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);
3932
- return /* @__PURE__ */ jsx("div", {
3933
- className: "relative w-64 hover:hover-effect",
3934
- onClick: isReadMode ? () => setSelectedNode(folderNode) : void 0,
4097
+ const isLink = isReadMode && !!href;
4098
+ return /* @__PURE__ */ jsx(isLink ? "a" : "div", {
4099
+ href: isLink ? href : void 0,
4100
+ "aria-current": isLink ? link["aria-current"] : void 0,
4101
+ className: "relative block w-64 hover:hover-effect",
4102
+ onClick: isLink ? link.onClick : isReadMode ? () => setSelectedNode(folderNode) : void 0,
4103
+ onMouseEnter: () => preloadNode(folderNode),
4104
+ onTouchStart: () => preloadNode(folderNode),
4105
+ onFocus: () => preloadNode(folderNode),
3935
4106
  children: /* @__PURE__ */ jsxs("div", {
3936
4107
  ...dragProps,
3937
4108
  ...dropProps,
@@ -3942,7 +4113,14 @@ function FolderItem(props) {
3942
4113
  className: "p-1",
3943
4114
  children: /* @__PURE__ */ jsx("div", {
3944
4115
  className: "relative text-foreground",
3945
- children: /* @__PURE__ */ jsx(Icon, {
4116
+ children: folderIconSrc ? /* @__PURE__ */ jsx("img", {
4117
+ alt: "folder icon",
4118
+ className: "object-contain",
4119
+ src: folderIconSrc,
4120
+ width: 24,
4121
+ height: 24,
4122
+ draggable: false
4123
+ }) : /* @__PURE__ */ jsx(Icon, {
3946
4124
  name: "FolderClose",
3947
4125
  size: 24
3948
4126
  })
@@ -3956,6 +4134,7 @@ function FolderItem(props) {
3956
4134
  children: /* @__PURE__ */ jsx("button", {
3957
4135
  className: twMerge("ml-auto hidden group-hover:block", isDropdownMenuOpen && "block"),
3958
4136
  onClick: (e) => {
4137
+ e.preventDefault();
3959
4138
  e.stopPropagation();
3960
4139
  setIsDropdownMenuOpen(true);
3961
4140
  },
@@ -3973,332 +4152,103 @@ function FolderItem(props) {
3973
4152
  function FooterLink(props) {
3974
4153
  const { as: Component = "a", className, ...restProps } = props;
3975
4154
  return /* @__PURE__ */ jsx(Component, {
3976
- className: twMerge("flex cursor-pointer items-center hover:underline", typeof className === "string" && className),
3977
- ...restProps
3978
- });
3979
- }
3980
- //#endregion
3981
- //#region src/connect/components/footer/footer.tsx
3982
- const Footer = ({ children, className, ...props }) => {
3983
- return /* @__PURE__ */ jsx("footer", {
3984
- className: twMerge("flex items-center gap-x-6 text-xs font-medium text-foreground", typeof className === "string" && className),
3985
- ...props,
3986
- children
3987
- });
3988
- };
3989
- //#endregion
3990
- //#region src/connect/components/form-input/form-input.tsx
3991
- const FormInput = /* @__PURE__ */ forwardRef(function FormInput(props, ref) {
3992
- const { icon, errorMessage, isDirty, containerClassName, inputClassName, errorMessageClassName, hideErrors = false, ...delegatedProps } = props;
3993
- const type = props.type ?? "text";
3994
- const isError = !!errorMessage;
3995
- return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
3996
- className: twMerge("mb-1 flex gap-2 rounded-md border border-border bg-background p-3 text-foreground placeholder:text-muted-foreground disabled:disabled-effect", isError && "border-destructive", containerClassName),
3997
- children: [icon && /* @__PURE__ */ jsx("span", {
3998
- className: twJoin((!isDirty || isError) && "text-foreground"),
3999
- children: icon
4000
- }), /* @__PURE__ */ jsx("input", {
4001
- ...delegatedProps,
4002
- className: twMerge("w-full bg-transparent font-semibold outline-none", inputClassName),
4003
- ref,
4004
- type
4005
- })]
4006
- }), /* @__PURE__ */ jsx("p", {
4007
- className: twMerge("hidden min-h-4 text-xs text-destructive", isError && "block", hideErrors && "hidden", errorMessageClassName),
4008
- children: errorMessage
4009
- })] });
4010
- });
4011
- //#endregion
4012
- //#region src/connect/components/form/inputs/app-form-input.tsx
4013
- function appToInputOption(app) {
4014
- return {
4015
- value: app.id,
4016
- displayValue: app.name,
4017
- icon: /* @__PURE__ */ jsx(Icon, { name: "PowerhouseLogoSmall" }),
4018
- description: "Built by Powerhouse"
4019
- };
4020
- }
4021
- function AppFormInput(props) {
4022
- const { control, appOptions, ...delegatedProps } = props;
4023
- const items = appOptions.map(appToInputOption);
4024
- return /* @__PURE__ */ jsx(Controller, {
4025
- control,
4026
- name: "id",
4027
- render: ({ field }) => /* @__PURE__ */ jsx(ConnectSelect, {
4028
- ...delegatedProps,
4029
- ...field,
4030
- id: "id",
4031
- items
4032
- })
4033
- });
4034
- }
4035
- //#endregion
4036
- //#region src/connect/components/form/inputs/label.tsx
4037
- function Label(props) {
4038
- const { children, className, ...labelProps } = props;
4039
- return /* @__PURE__ */ jsx("label", {
4040
- ...labelProps,
4041
- className: twMerge("block font-semibold text-muted-foreground", className),
4042
- children
4043
- });
4044
- }
4045
- //#endregion
4046
- //#region src/connect/components/form/add-local-drive-form.tsx
4047
- function AddLocalDriveForm(props) {
4048
- const { register, handleSubmit, control, formState: { errors } } = useForm({ defaultValues: {
4049
- name: "",
4050
- sharingType: "LOCAL",
4051
- availableOffline: false,
4052
- id: props.appOptions[0].id
4053
- } });
4054
- return /* @__PURE__ */ jsx("form", {
4055
- name: "add-local-drive",
4056
- onSubmit: (e) => void handleSubmit(props.onSubmit)(e),
4057
- className: "flex flex-col gap-4",
4058
- children: /* @__PURE__ */ jsxs("div", {
4059
- className: "flex flex-col gap-4",
4060
- children: [
4061
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Label, {
4062
- htmlFor: "name",
4063
- className: "text-sm font-medium text-foreground",
4064
- children: "Drive Name"
4065
- }), /* @__PURE__ */ jsx(FormInput, {
4066
- ...register("name", { required: "Drive name is required" }),
4067
- errorMessage: errors.name?.message,
4068
- placeholder: "Drive name"
4069
- })] }),
4070
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Label, {
4071
- htmlFor: "driveApp",
4072
- className: "text-sm font-medium text-foreground",
4073
- children: "Drive App"
4074
- }), /* @__PURE__ */ jsx(AppFormInput, {
4075
- control,
4076
- appOptions: props.appOptions
4077
- })] }),
4078
- /* @__PURE__ */ jsx(PowerhouseButton, {
4079
- className: "mt-2 w-full",
4080
- type: "submit",
4081
- children: "Create new drive"
4082
- })
4083
- ]
4084
- })
4155
+ className: twMerge("flex cursor-pointer items-center hover:underline", typeof className === "string" && className),
4156
+ ...restProps
4085
4157
  });
4086
4158
  }
4087
4159
  //#endregion
4088
- //#region src/connect/components/toggle/toggle.tsx
4089
- const Toggle = /* @__PURE__ */ forwardRef(function Toggle(props, ref) {
4090
- return /* @__PURE__ */ jsxs("label", {
4091
- className: "relative cursor-pointer items-center",
4092
- htmlFor: props.id,
4093
- children: [/* @__PURE__ */ jsx("input", {
4094
- className: "peer sr-only",
4095
- ref,
4096
- type: "checkbox",
4097
- value: "",
4098
- ...props
4099
- }), /* @__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" })]
4160
+ //#region src/connect/components/footer/footer.tsx
4161
+ const Footer = ({ children, className, ...props }) => {
4162
+ return /* @__PURE__ */ jsx("footer", {
4163
+ className: twMerge("flex items-center gap-x-6 text-xs font-medium text-foreground", typeof className === "string" && className),
4164
+ ...props,
4165
+ children
4100
4166
  });
4101
- });
4167
+ };
4102
4168
  //#endregion
4103
- //#region src/connect/components/form/inputs/available-offline-toggle.tsx
4104
- const AvailableOfflineToggle = /* @__PURE__ */ forwardRef(function AvailableOfflineToggle(props, ref) {
4105
- return /* @__PURE__ */ jsxs("div", {
4106
- className: "flex items-center rounded-md border border-border bg-background p-3 text-foreground",
4107
- children: [/* @__PURE__ */ jsxs("div", {
4108
- className: "flex-1",
4109
- children: [/* @__PURE__ */ jsx("label", {
4110
- className: "font-medium text-foreground",
4111
- htmlFor: "availableOffline",
4112
- children: "Make available offline"
4113
- }), /* @__PURE__ */ jsxs("p", {
4114
- className: "text-xs text-foreground",
4115
- children: [
4116
- "Check this options if you keep a local backup",
4117
- /* @__PURE__ */ jsx("br", {}),
4118
- "available at all times."
4119
- ]
4120
- })]
4121
- }), /* @__PURE__ */ jsx(Toggle, {
4122
- id: "availableOffline",
4169
+ //#region src/connect/components/form-input/form-input.tsx
4170
+ const FormInput = /*#__PURE__*/ forwardRef(function FormInput(props, ref) {
4171
+ const { icon, errorMessage, isDirty, containerClassName, inputClassName, errorMessageClassName, hideErrors = false, ...delegatedProps } = props;
4172
+ const type = props.type ?? "text";
4173
+ const isError = !!errorMessage;
4174
+ return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
4175
+ className: twMerge("mb-1 flex gap-2 rounded-md border border-border bg-background p-3 text-foreground placeholder:text-muted-foreground disabled:disabled-effect", isError && "border-destructive", containerClassName),
4176
+ children: [icon && /* @__PURE__ */ jsx("span", {
4177
+ className: twJoin((!isDirty || isError) && "text-foreground"),
4178
+ children: icon
4179
+ }), /* @__PURE__ */ jsx("input", {
4180
+ ...delegatedProps,
4181
+ className: twMerge("w-full bg-transparent font-semibold outline-none", inputClassName),
4123
4182
  ref,
4124
- ...props
4183
+ type
4125
4184
  })]
4126
- });
4185
+ }), /* @__PURE__ */ jsx("p", {
4186
+ className: twMerge("hidden min-h-4 text-xs text-destructive", isError && "block", hideErrors && "hidden", errorMessageClassName),
4187
+ children: errorMessage
4188
+ })] });
4127
4189
  });
4128
4190
  //#endregion
4129
- //#region src/connect/components/form/inputs/drive-name.tsx
4130
- function DriveName(props) {
4131
- return /* @__PURE__ */ jsxs("div", {
4132
- className: "flex gap-2 rounded-xl bg-muted p-3 font-semibold text-muted-foreground",
4133
- children: [/* @__PURE__ */ jsx(Icon, {
4134
- className: "text-foreground",
4135
- name: "Drive"
4136
- }), props.driveName]
4137
- });
4138
- }
4139
- //#endregion
4140
- //#region src/connect/components/form/inputs/location-info.tsx
4141
- function LocationInfo(props) {
4142
- const { location, className, ...divProps } = props;
4143
- const locationInfo = locationInfoByLocation[location];
4144
- return /* @__PURE__ */ jsxs("div", {
4145
- ...divProps,
4146
- className: twMerge("my-3 flex items-center gap-2 rounded-xl border border-border bg-background p-3 text-foreground shadow-sm", className),
4147
- children: [locationInfo.icon, /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", { children: locationInfo.title }), /* @__PURE__ */ jsx("p", {
4148
- className: "text-xs text-foreground",
4149
- children: locationInfo.description
4150
- })] })]
4151
- });
4152
- }
4191
+ //#region src/connect/components/form/add-local-drive-form.tsx
4192
+ const AddLocalDriveForm = lazyComponent(() => import("../add-local-drive-form.impl-COIpcmgW.js").then((m) => m.AddLocalDriveForm));
4153
4193
  //#endregion
4154
4194
  //#region src/connect/components/form/add-remote-drive-form.tsx
4155
- function AddRemoteDriveForm(props) {
4156
- const { sharingType = "PUBLIC", requestPublicDrive } = props;
4157
- const [remoteDriveDetails, setPublicDriveDetails] = useState();
4158
- const [showLocationSettings, setShowLocationSettings] = useState(false);
4159
- const [isUrlValid, setIsUrlValid] = useState(true);
4160
- const [hasConfirmedUrl, setHasConfirmedUrl] = useState(false);
4161
- const [errorMessage, setErrorMessage] = useState("");
4162
- const [url, setUrl] = useState("");
4163
- const [debouncedUrl, setDebouncedUrl] = useDebounceValue(url, 500);
4164
- const { register, handleSubmit, setValue } = useForm({
4165
- mode: "onBlur",
4166
- defaultValues: { availableOffline: remoteDriveDetails?.availableOffline ?? false }
4167
- });
4168
- useEffect(() => {
4169
- setDebouncedUrl(url);
4170
- }, [url]);
4171
- useEffect(() => {
4172
- setHasConfirmedUrl(false);
4173
- if (debouncedUrl === "") return;
4174
- fetchPublicDrive().catch(console.error);
4175
- async function fetchPublicDrive() {
4176
- try {
4177
- const { id, name } = await requestPublicDrive(debouncedUrl);
4178
- setPublicDriveDetails({
4179
- id,
4180
- name,
4181
- sharingType,
4182
- location: "SWITCHBOARD",
4183
- availableOffline: true
4184
- });
4185
- setValue("availableOffline", true);
4186
- setIsUrlValid(true);
4187
- setErrorMessage("");
4188
- } catch (error) {
4189
- setPublicDriveDetails(void 0);
4190
- setIsUrlValid(false);
4191
- setErrorMessage(error.message);
4192
- }
4193
- }
4194
- }, [
4195
- debouncedUrl,
4196
- setValue,
4197
- sharingType
4198
- ]);
4199
- function onSubmit({ availableOffline }) {
4200
- if (!remoteDriveDetails) return;
4201
- props.onSubmit({
4202
- ...remoteDriveDetails,
4203
- availableOffline,
4204
- url: debouncedUrl
4205
- });
4206
- }
4207
- return /* @__PURE__ */ jsx("form", {
4208
- onSubmit: (e) => void handleSubmit(onSubmit)(e),
4209
- children: hasConfirmedUrl ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
4210
- /* @__PURE__ */ jsx(DriveName, { driveName: remoteDriveDetails?.name ?? "New drive" }),
4211
- /* @__PURE__ */ jsx(Divider, { className: "my-3" }),
4212
- /* @__PURE__ */ jsxs(Disclosure, {
4213
- isOpen: showLocationSettings,
4214
- onOpenChange: () => setShowLocationSettings(!showLocationSettings),
4215
- title: "Location",
4216
- children: [/* @__PURE__ */ jsx(LocationInfo, { location: "SWITCHBOARD" }), /* @__PURE__ */ jsx(AvailableOfflineToggle, { ...register("availableOffline") })]
4217
- }),
4218
- /* @__PURE__ */ jsx(PowerhouseButton, {
4219
- className: "mt-4 w-full",
4220
- color: "dark",
4221
- type: "submit",
4222
- children: "Add new drive"
4223
- })
4224
- ] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FormInput, {
4225
- errorMessage,
4226
- onChange: (e) => setUrl(e.target.value),
4227
- placeholder: "Drive URL",
4228
- required: true,
4229
- type: "url",
4230
- value: url
4231
- }), /* @__PURE__ */ jsx(PowerhouseButton, {
4232
- className: "mt-4 w-full py-2 text-base",
4233
- color: "dark",
4234
- size: "small",
4235
- disabled: !isUrlValid || url === "",
4236
- onClick: (e) => {
4237
- e.preventDefault();
4238
- setHasConfirmedUrl(true);
4239
- },
4240
- type: "button",
4241
- children: "Add drive"
4242
- })] })
4243
- });
4244
- }
4195
+ const AddRemoteDriveForm = lazyComponent(() => import("../add-remote-drive-form.impl-_SqOzbSt.js").then((m) => m.AddRemoteDriveForm));
4245
4196
  //#endregion
4246
- //#region src/connect/components/formatted-json-viewer.tsx
4247
- function FormattedJsonViewer(props) {
4248
- const { theme } = useTheme();
4249
- return /* @__PURE__ */ jsxs(JsonView, {
4250
- displayDataTypes: false,
4251
- displayObjectSize: false,
4252
- style: theme === "light" ? lightTheme : darkTheme,
4253
- ...props,
4254
- children: [/* @__PURE__ */ jsx(JsonView.Copied, { render: ({ onClick, ...props }) => {
4255
- if (props["data-copied"]) return /* @__PURE__ */ jsx(Icon, {
4256
- ...props,
4257
- className: "inline-block text-success",
4258
- name: "FilesEarmark",
4259
- size: 16
4260
- });
4261
- return /* @__PURE__ */ jsx(Icon, {
4262
- ...props,
4263
- onClick,
4264
- className: "inline-block cursor-pointer text-foreground",
4265
- name: "FilesEarmark",
4266
- size: 16
4267
- });
4268
- } }), /* @__PURE__ */ jsx(JsonView.String, { render: ({ children, ...rest }, { value, keyName }) => {
4269
- if (isString(children) && isString(value) && isStrictEqual(children, value) && value.length > 30) return /* @__PURE__ */ jsx("span", {
4270
- ...rest,
4271
- className: "inline-grid",
4272
- children: /* @__PURE__ */ jsxs("span", {
4273
- className: "pl-[1ch] indent-[-1ch] wrap-anywhere hyphens-none",
4274
- style: { maxWidth: `${60 - keyName.toString().length}ch` },
4275
- children: [
4276
- "\"",
4277
- children,
4278
- "\""
4279
- ]
4280
- })
4281
- });
4282
- return /* @__PURE__ */ jsxs("span", {
4283
- ...rest,
4284
- children: [
4285
- "\"",
4286
- children,
4287
- "\""
4288
- ]
4289
- });
4290
- } })]
4291
- });
4197
+ //#region src/connect/components/branding/background-layers.tsx
4198
+ /**
4199
+ * A decorated pane: the configured page colour with the background's layers
4200
+ * painted over it, in order, and the children above them all. Each layer is
4201
+ * placed by the shared `layerStyle`, the same declarations the desktop
4202
+ * loading page emits as static CSS, so a background configured once looks
4203
+ * the same in both hosts. Images come resolved (data URIs or URLs); a
4204
+ * light/dark pair follows the `.dark` theme class, not the OS scheme.
4205
+ * Without a background the pane is the theme's page colour and nothing more.
4206
+ */
4207
+ function BackgroundLayers(props) {
4208
+ const background = normalizeBackground(props.background);
4209
+ const color = colorVariants(background?.color);
4210
+ const style = color ? {
4211
+ "--ph-pane-bg": color.light,
4212
+ "--ph-pane-bg-dark": color.dark ?? color.light
4213
+ } : void 0;
4214
+ return /* @__PURE__ */ jsxs("div", {
4215
+ className: twMerge("relative size-full overflow-hidden", color ? "bg-(--ph-pane-bg) dark:bg-(--ph-pane-bg-dark)" : "bg-background", props.className),
4216
+ style,
4217
+ children: [background?.layers.map((layer, index) => /* @__PURE__ */ jsx(BackgroundLayer, { layer }, index)), props.children]
4218
+ });
4219
+ }
4220
+ function BackgroundLayer({ layer }) {
4221
+ const { light, dark } = imageVariants(layer.src);
4222
+ const style = layerStyle(layer);
4223
+ if (!dark) return /* @__PURE__ */ jsx("img", {
4224
+ src: light,
4225
+ alt: "",
4226
+ style
4227
+ });
4228
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("img", {
4229
+ src: light,
4230
+ alt: "",
4231
+ style,
4232
+ className: "dark:hidden"
4233
+ }), /* @__PURE__ */ jsx("img", {
4234
+ src: dark,
4235
+ alt: "",
4236
+ style,
4237
+ className: "hidden dark:block"
4238
+ })] });
4292
4239
  }
4293
4240
  //#endregion
4294
4241
  //#region src/connect/components/home-screen/home-background-image.tsx
4242
+ /** The default home-screen gradient. A custom `src` is kept for callers that
4243
+ * still pass one, sized to its box; HomeScreen itself renders custom images
4244
+ * as a hero below the drive tiles instead. */
4295
4245
  const HomeBackgroundImage = ({ src } = {}) => {
4296
4246
  if (src) return /* @__PURE__ */ jsx("picture", {
4297
- className: "pointer-events-none absolute inset-8 z-0 size-[calc(100%-32px)] object-contain",
4247
+ className: "pointer-events-none absolute inset-8 z-0",
4298
4248
  children: /* @__PURE__ */ jsx("img", {
4299
4249
  src,
4300
- alt: "background",
4301
- className: "object-contain"
4250
+ alt: "",
4251
+ className: "size-full object-contain"
4302
4252
  })
4303
4253
  });
4304
4254
  return /* @__PURE__ */ jsx("div", {
@@ -4387,10 +4337,15 @@ const HomeBackgroundImage = ({ src } = {}) => {
4387
4337
  //#endregion
4388
4338
  //#region src/connect/components/home-screen/home-screen-item.tsx
4389
4339
  const HomeScreenItem = function HomeScreenItem(props) {
4390
- const { icon, title, description, containerClassName, shareable, onClick } = props;
4391
- return /* @__PURE__ */ jsxs("div", {
4340
+ const { icon, title, description, containerClassName, shareable, href, onClick, onPreload } = props;
4341
+ return /* @__PURE__ */ jsxs(href ? "a" : "div", {
4342
+ href,
4343
+ "aria-current": href ? props["aria-current"] : void 0,
4392
4344
  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"),
4393
4345
  onClick,
4346
+ onMouseEnter: onPreload,
4347
+ onTouchStart: onPreload,
4348
+ onFocus: href ? onPreload : void 0,
4394
4349
  children: [
4395
4350
  /* @__PURE__ */ jsx("div", {
4396
4351
  className: "mx-auto pb-2",
@@ -4440,13 +4395,19 @@ const HomeScreenAddDriveItem = function HomeScreenAddDriveItem(props) {
4440
4395
  //#endregion
4441
4396
  //#region src/connect/components/home-screen/home-screen.tsx
4442
4397
  const HomeScreen = function HomeScreen(props) {
4443
- const { children, containerClassName, homeBackground } = props;
4444
- return /* @__PURE__ */ jsx("div", {
4445
- className: twMerge("relative container mx-auto flex h-full flex-col", containerClassName),
4446
- children: /* @__PURE__ */ jsxs("div", {
4447
- className: "m-8 flex flex-wrap justify-center gap-4 bg-background pt-12",
4448
- children: [/* @__PURE__ */ jsx(HomeBackgroundImage, { src: homeBackground ?? void 0 }), children]
4449
- })
4398
+ const { children, containerClassName } = props;
4399
+ const background = normalizeBackground(props.homeBackground);
4400
+ const content = /* @__PURE__ */ jsxs("div", {
4401
+ className: twMerge("relative isolate container mx-auto flex h-full flex-col", containerClassName),
4402
+ children: [!background && /* @__PURE__ */ jsx(HomeBackgroundImage, {}), /* @__PURE__ */ jsx("div", {
4403
+ className: twMerge("relative z-10 m-8 flex flex-wrap justify-center gap-4 pt-12", background && "rounded-2xl bg-background/75 px-6 pb-6 backdrop-blur-sm"),
4404
+ children
4405
+ })]
4406
+ });
4407
+ if (!background) return content;
4408
+ return /* @__PURE__ */ jsx(BackgroundLayers, {
4409
+ background,
4410
+ children: content
4450
4411
  });
4451
4412
  };
4452
4413
  //#endregion
@@ -4470,7 +4431,8 @@ function IntegrityInspector({ onValidate, onRebuildKeyframes, onRebuildSnapshots
4470
4431
  clearResults();
4471
4432
  setStatus("running");
4472
4433
  try {
4473
- setValidationResult(await onValidate(documentId.trim(), branch.trim() || void 0));
4434
+ const result = await onValidate(documentId.trim(), branch.trim() || void 0);
4435
+ setValidationResult(result);
4474
4436
  setStatus("done");
4475
4437
  } catch (err) {
4476
4438
  setError(err instanceof Error ? err.message : String(err));
@@ -4487,7 +4449,8 @@ function IntegrityInspector({ onValidate, onRebuildKeyframes, onRebuildSnapshots
4487
4449
  clearResults();
4488
4450
  setStatus("running");
4489
4451
  try {
4490
- setRebuildResult(await onRebuildKeyframes(documentId.trim(), branch.trim() || void 0));
4452
+ const result = await onRebuildKeyframes(documentId.trim(), branch.trim() || void 0);
4453
+ setRebuildResult(result);
4491
4454
  setStatus("done");
4492
4455
  } catch (err) {
4493
4456
  setError(err instanceof Error ? err.message : String(err));
@@ -4504,7 +4467,8 @@ function IntegrityInspector({ onValidate, onRebuildKeyframes, onRebuildSnapshots
4504
4467
  clearResults();
4505
4468
  setStatus("running");
4506
4469
  try {
4507
- setRebuildResult(await onRebuildSnapshots(documentId.trim(), branch.trim() || void 0));
4470
+ const result = await onRebuildSnapshots(documentId.trim(), branch.trim() || void 0);
4471
+ setRebuildResult(result);
4508
4472
  setStatus("done");
4509
4473
  } catch (err) {
4510
4474
  setError(err instanceof Error ? err.message : String(err));
@@ -4844,7 +4808,8 @@ function AddDriveModal(props) {
4844
4808
  //#region src/connect/components/modal/create-document-modal.tsx
4845
4809
  const CLOSE_ANIMATION_DURATION$1 = 300;
4846
4810
  function CreateDocumentModal(props) {
4847
- const { onOpenChange, onContinue, overlayProps, contentProps, ...restProps } = props;
4811
+ const { onOpenChange, onContinue, overlayProps, contentProps, drives, driveId, onDriveChange, onAddDrive, ...restProps } = props;
4812
+ const needsDrive = !!drives && !driveId;
4848
4813
  const [nodeName, setNodeName] = useState("");
4849
4814
  const [isValid, setIsValid] = useState(false);
4850
4815
  const handleCancel = () => {
@@ -4852,11 +4817,12 @@ function CreateDocumentModal(props) {
4852
4817
  setTimeout(() => setNodeName(""), CLOSE_ANIMATION_DURATION$1);
4853
4818
  };
4854
4819
  const handleCreate = useCallback(() => {
4855
- if (!isValid) return;
4820
+ if (!isValid || needsDrive) return;
4856
4821
  onContinue(nodeName);
4857
4822
  setTimeout(() => setNodeName(""), CLOSE_ANIMATION_DURATION$1);
4858
4823
  }, [
4859
4824
  isValid,
4825
+ needsDrive,
4860
4826
  nodeName,
4861
4827
  onContinue
4862
4828
  ]);
@@ -4883,20 +4849,51 @@ function CreateDocumentModal(props) {
4883
4849
  }),
4884
4850
  /* @__PURE__ */ jsxs("div", {
4885
4851
  className: "my-6",
4886
- children: [!isValid && nodeName && /* @__PURE__ */ jsx("div", {
4887
- className: "mb-2 text-destructive",
4888
- children: "Document name must not be empty or contain control characters."
4889
- }), /* @__PURE__ */ jsx(FormInput, {
4890
- icon: /* @__PURE__ */ jsx(Icon, { name: "BrickGlobe" }),
4891
- onChange: (e) => {
4892
- const name = e.target.value;
4893
- setNodeName(name);
4894
- setIsValid(isValidName(name));
4895
- },
4896
- placeholder: "Document name",
4897
- required: true,
4898
- value: nodeName
4899
- })]
4852
+ children: [
4853
+ !isValid && nodeName && /* @__PURE__ */ jsx("div", {
4854
+ className: "mb-2 text-destructive",
4855
+ children: "Document name must not be empty or contain control characters."
4856
+ }),
4857
+ /* @__PURE__ */ jsx(FormInput, {
4858
+ icon: /* @__PURE__ */ jsx(Icon, { name: "BrickGlobe" }),
4859
+ onChange: (e) => {
4860
+ const name = e.target.value;
4861
+ setNodeName(name);
4862
+ setIsValid(isValidName(name));
4863
+ },
4864
+ placeholder: "Document name",
4865
+ required: true,
4866
+ value: nodeName
4867
+ }),
4868
+ !!drives?.length && /* @__PURE__ */ jsxs("label", {
4869
+ className: "mt-4 flex flex-col gap-1 text-sm text-muted-foreground",
4870
+ children: ["Drive", /* @__PURE__ */ jsxs("select", {
4871
+ className: "rounded-md border border-border bg-background px-3 py-2 text-foreground",
4872
+ value: driveId ?? "",
4873
+ onChange: (e) => onDriveChange?.(e.target.value),
4874
+ children: [!driveId && /* @__PURE__ */ jsx("option", {
4875
+ value: "",
4876
+ children: "Choose a drive"
4877
+ }), drives.map((drive) => /* @__PURE__ */ jsx("option", {
4878
+ value: drive.id,
4879
+ children: drive.name
4880
+ }, drive.id))]
4881
+ })]
4882
+ }),
4883
+ drives?.length === 0 && /* @__PURE__ */ jsxs("p", {
4884
+ className: "mt-4 text-sm text-muted-foreground",
4885
+ children: [
4886
+ "There's no drive to create it in.",
4887
+ " ",
4888
+ onAddDrive && /* @__PURE__ */ jsx("button", {
4889
+ type: "button",
4890
+ className: "cursor-pointer text-foreground underline",
4891
+ onClick: onAddDrive,
4892
+ children: "Add a drive"
4893
+ })
4894
+ ]
4895
+ })
4896
+ ]
4900
4897
  }),
4901
4898
  /* @__PURE__ */ jsxs("div", {
4902
4899
  className: "mt-8 flex justify-between gap-3",
@@ -4908,7 +4905,7 @@ function CreateDocumentModal(props) {
4908
4905
  }), /* @__PURE__ */ jsx(ModalButton, {
4909
4906
  variant: "confirm",
4910
4907
  type: "submit",
4911
- disabled: !isValid,
4908
+ disabled: !isValid || needsDrive,
4912
4909
  children: "Create"
4913
4910
  })]
4914
4911
  })
@@ -4941,8 +4938,14 @@ function CreateDocumentWithTypeModal(props) {
4941
4938
  value: PLACEHOLDER_KEY,
4942
4939
  displayValue: "Select document type…"
4943
4940
  }, ...typeItems] : typeItems;
4941
+ const resetTimer = useRef(void 0);
4942
+ useEffect(() => () => {
4943
+ if (resetTimer.current !== void 0) clearTimeout(resetTimer.current);
4944
+ }, []);
4944
4945
  const resetAfterClose = useCallback(() => {
4945
- setTimeout(() => {
4946
+ if (resetTimer.current !== void 0) clearTimeout(resetTimer.current);
4947
+ resetTimer.current = setTimeout(() => {
4948
+ resetTimer.current = void 0;
4946
4949
  setDocumentName("");
4947
4950
  setIsNameValid(false);
4948
4951
  setSelectedKey(PLACEHOLDER_KEY);
@@ -5076,169 +5079,12 @@ function ConnectDeleteItemModal(props) {
5076
5079
  });
5077
5080
  }
5078
5081
  //#endregion
5079
- //#region src/connect/components/form/inputs/drive-name-input.tsx
5080
- const DriveNameInput = /* @__PURE__ */ forwardRef(function DriveNameInput(props, ref) {
5081
- return /* @__PURE__ */ jsx(FormInput, {
5082
- ...props,
5083
- icon: props.icon ?? /* @__PURE__ */ jsx(Icon, { name: "Drive" }),
5084
- id: "driveName",
5085
- placeholder: "Drive name",
5086
- ref
5087
- });
5088
- });
5089
- //#endregion
5090
- //#region src/connect/components/form/inputs/delete-drive.tsx
5091
- function DeleteDrive(props) {
5092
- const { drive, handleDeleteDrive, onCancel } = props;
5093
- const [driveNameInput, setDriveNameInput] = useState("");
5094
- const isAllowedToDelete = driveNameInput === drive.header.name;
5095
- function deleteDrive() {
5096
- if (isAllowedToDelete) handleDeleteDrive();
5097
- }
5098
- return /* @__PURE__ */ jsxs("div", { children: [
5099
- /* @__PURE__ */ jsx("p", {
5100
- className: "mb-2 rounded-md bg-background p-4 text-center text-foreground",
5101
- children: "Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?"
5102
- }),
5103
- /* @__PURE__ */ jsx(DriveNameInput, {
5104
- icon: /* @__PURE__ */ jsx(Icon, { name: "Lock" }),
5105
- onChange: (event) => setDriveNameInput(event.target.value),
5106
- placeholder: "Enter drive name...",
5107
- value: driveNameInput
5108
- }),
5109
- /* @__PURE__ */ jsxs("div", {
5110
- className: "flex gap-3",
5111
- children: [/* @__PURE__ */ jsx(PowerhouseButton, {
5112
- className: "w-full",
5113
- color: "light",
5114
- onClick: onCancel,
5115
- children: "Cancel"
5116
- }), /* @__PURE__ */ jsx(PowerhouseButton, {
5117
- className: "w-full",
5118
- color: "red",
5119
- disabled: !isAllowedToDelete,
5120
- onClick: deleteDrive,
5121
- children: "Delete"
5122
- })]
5123
- })
5124
- ] });
5125
- }
5126
- //#endregion
5127
- //#region src/connect/components/form/inputs/sharing-type-form-input.tsx
5128
- function SharingTypeFormInput(props) {
5129
- const { control, ...delegatedProps } = props;
5130
- return /* @__PURE__ */ jsx(Controller, {
5131
- control,
5132
- name: "sharingType",
5133
- render: ({ field }) => /* @__PURE__ */ jsx(ConnectSelect, {
5134
- ...delegatedProps,
5135
- ...field,
5136
- id: "sharingType",
5137
- items: sharingTypeOptions
5138
- })
5139
- });
5140
- }
5141
- //#endregion
5142
5082
  //#region src/connect/components/form/drive-settings-form.tsx
5143
- function DriveSettingsForm(props) {
5144
- const { drive, sharingType, availableOffline, systemInfo, onSubmit, handleDeleteDrive } = props;
5145
- const name = drive.header.name;
5146
- const [showLocationSettings, setShowLocationSettings] = useState(false);
5147
- const [showAbout, setShowAbout] = useState(false);
5148
- const [showDangerZone, setShowDangerZone] = useState(false);
5149
- const [showDeleteDrive, setShowDeleteDrive] = useState(false);
5150
- const { register, handleSubmit, control } = useForm({
5151
- mode: "onBlur",
5152
- defaultValues: {
5153
- name,
5154
- sharingType,
5155
- availableOffline
5156
- }
5157
- });
5158
- const location = sharingType === "PUBLIC" ? "SWITCHBOARD" : sharingType;
5159
- return /* @__PURE__ */ jsxs("form", {
5160
- onSubmit: (e) => void handleSubmit(onSubmit)(e),
5161
- children: [
5162
- /* @__PURE__ */ jsx(DriveNameInput, { ...register("name") }),
5163
- /* @__PURE__ */ jsx(Divider, { className: "my-4" }),
5164
- /* @__PURE__ */ jsx(Label, {
5165
- htmlFor: "sharingType",
5166
- children: "Sharing settings"
5167
- }),
5168
- /* @__PURE__ */ jsx(SharingTypeFormInput, { control }),
5169
- /* @__PURE__ */ jsx(Divider, { className: "my-3" }),
5170
- /* @__PURE__ */ jsxs(Disclosure, {
5171
- isOpen: showLocationSettings,
5172
- onOpenChange: () => setShowLocationSettings(!showLocationSettings),
5173
- title: "Location",
5174
- children: [/* @__PURE__ */ jsx(LocationInfo, { location }), /* @__PURE__ */ jsx(AvailableOfflineToggle, { ...register("availableOffline") })]
5175
- }),
5176
- /* @__PURE__ */ jsx(Divider, { className: "my-3" }),
5177
- /* @__PURE__ */ jsxs(Disclosure, {
5178
- isOpen: showAbout,
5179
- onOpenChange: () => setShowAbout(!showAbout),
5180
- title: "About this drive",
5181
- children: [
5182
- systemInfo.status === "local" && /* @__PURE__ */ jsx("p", {
5183
- className: "py-2 text-sm text-muted-foreground",
5184
- children: "Local drive — N/A"
5185
- }),
5186
- systemInfo.status === "loading" && /* @__PURE__ */ jsx("p", {
5187
- className: "py-2 text-sm text-muted-foreground",
5188
- children: "Loading…"
5189
- }),
5190
- systemInfo.status === "error" && /* @__PURE__ */ jsx("p", {
5191
- className: "py-2 text-sm text-destructive",
5192
- children: "Could not load system info"
5193
- }),
5194
- systemInfo.status === "ready" && /* @__PURE__ */ jsxs("div", {
5195
- className: "py-2 text-sm text-foreground",
5196
- children: [/* @__PURE__ */ jsxs("div", { children: [
5197
- /* @__PURE__ */ jsx("span", {
5198
- className: "font-medium",
5199
- children: "Version:"
5200
- }),
5201
- " ",
5202
- systemInfo.version
5203
- ] }), /* @__PURE__ */ jsxs("div", { children: [
5204
- /* @__PURE__ */ jsx("span", {
5205
- className: "font-medium",
5206
- children: "Git hash:"
5207
- }),
5208
- " ",
5209
- systemInfo.gitHash
5210
- ] })]
5211
- })
5212
- ]
5213
- }),
5214
- /* @__PURE__ */ jsx(Divider, { className: "my-3" }),
5215
- /* @__PURE__ */ jsx(Disclosure, {
5216
- isOpen: showDangerZone,
5217
- onOpenChange: () => setShowDangerZone(!showDangerZone),
5218
- title: "Danger zone",
5219
- children: /* @__PURE__ */ jsxs("button", {
5220
- className: "flex gap-2 py-3 font-semibold text-destructive transition hover:hover-effect",
5221
- onClick: () => setShowDeleteDrive(true),
5222
- type: "button",
5223
- children: [/* @__PURE__ */ jsx(Icon, { name: "Trash" }), "Delete drive"]
5224
- })
5225
- }),
5226
- showDeleteDrive && showDangerZone ? /* @__PURE__ */ jsx(DeleteDrive, {
5227
- drive,
5228
- handleDeleteDrive,
5229
- onCancel: () => setShowDeleteDrive(false)
5230
- }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Divider, { className: "my-3" }), /* @__PURE__ */ jsx(PowerhouseButton, {
5231
- className: "mb-4 w-full",
5232
- type: "submit",
5233
- children: "Confirm"
5234
- })] })
5235
- ]
5236
- });
5237
- }
5083
+ const DriveSettingsForm = lazyComponent(() => import("../drive-settings-form.impl-yV9u4h5c.js").then((m) => m.DriveSettingsForm));
5238
5084
  //#endregion
5239
5085
  //#region src/connect/components/modal/drive-settings-modal.tsx
5240
5086
  function DriveSettingsModal(props) {
5241
- const { drive, open, sharingType, availableOffline, systemInfo, onOpenChange, onDeleteDrive, onRenameDrive, onChangeSharingType, onChangeAvailableOffline, modalProps, containerProps } = props;
5087
+ const { drive, open, sharingType, availableOffline, systemInfo, onOpenChange, onDeleteDrive, onRenameDrive, onChangeSharingType, onChangeAvailableOffline, modalProps, containerProps, children } = props;
5242
5088
  const onSubmit = (data) => {
5243
5089
  if (data.name !== drive.header.name) onRenameDrive(drive, data.name);
5244
5090
  if (data.sharingType !== sharingType) onChangeSharingType(drive, data.sharingType);
@@ -5285,7 +5131,8 @@ function DriveSettingsModal(props) {
5285
5131
  drive,
5286
5132
  sharingType,
5287
5133
  availableOffline,
5288
- systemInfo
5134
+ systemInfo,
5135
+ children
5289
5136
  })
5290
5137
  ]
5291
5138
  })
@@ -5461,7 +5308,8 @@ function ProcessorsInspector({ getProcessors, onRetry }) {
5461
5308
  const [error, setError] = useState(null);
5462
5309
  const loadProcessors = useCallback(async () => {
5463
5310
  try {
5464
- setProcessors(await getProcessors());
5311
+ const result = await getProcessors();
5312
+ setProcessors(result);
5465
5313
  setError(null);
5466
5314
  } catch (e) {
5467
5315
  setError(e instanceof Error ? e.message : String(e));
@@ -5491,9 +5339,10 @@ function ProcessorsInspector({ getProcessors, onRetry }) {
5491
5339
  }
5492
5340
  }, [onRetry, loadProcessors]);
5493
5341
  const handleSort = (columnKey) => {
5342
+ const newDirection = sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc";
5494
5343
  setSort({
5495
5344
  column: columnKey,
5496
- direction: sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc"
5345
+ direction: newDirection
5497
5346
  });
5498
5347
  };
5499
5348
  const sortedProcessors = sortProcessors(processors, sort);
@@ -5815,7 +5664,8 @@ function QueueInspector({ getQueueState, onPause, onResume }) {
5815
5664
  const [actionInProgress, setActionInProgress] = useState(false);
5816
5665
  const [selectedJob, setSelectedJob] = useState(null);
5817
5666
  const loadState = useCallback(async () => {
5818
- setState(await getQueueState());
5667
+ const newState = await getQueueState();
5668
+ setState(newState);
5819
5669
  setLoading(false);
5820
5670
  }, [getQueueState]);
5821
5671
  useEffect(() => {
@@ -5842,9 +5692,10 @@ function QueueInspector({ getQueueState, onPause, onResume }) {
5842
5692
  loadState
5843
5693
  ]);
5844
5694
  const handleSort = (columnKey) => {
5695
+ const newDirection = sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc";
5845
5696
  setSort({
5846
5697
  column: columnKey,
5847
- direction: sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc"
5698
+ direction: newDirection
5848
5699
  });
5849
5700
  };
5850
5701
  const sortedJobs = sortJobs([...state.executingJobs.map((job) => ({
@@ -6045,8 +5896,9 @@ const stateStyles = {
6045
5896
  disconnected: "bg-muted text-foreground"
6046
5897
  };
6047
5898
  function ConnectionStateBadge({ state, failureCount }) {
5899
+ const style = stateStyles[state] ?? "bg-muted text-foreground";
6048
5900
  return /* @__PURE__ */ jsxs("span", {
6049
- className: twMerge("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium", stateStyles[state] ?? "bg-muted text-foreground"),
5901
+ className: twMerge("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium", style),
6050
5902
  children: [state, failureCount > 0 && /* @__PURE__ */ jsxs("span", {
6051
5903
  className: "text-xs opacity-75",
6052
5904
  children: [
@@ -6696,6 +6548,175 @@ function ChannelInspector({ remoteName, channel, onBack, onRefresh, connectionSt
6696
6548
  });
6697
6549
  }
6698
6550
  //#endregion
6551
+ //#region src/connect/components/remotes-inspector/components/peer-agreement-panel.tsx
6552
+ const cell = "px-3 py-1.5 text-xs text-foreground";
6553
+ const head = "px-3 py-1.5 text-left text-xs font-medium text-foreground";
6554
+ function versions(list) {
6555
+ return list && list.length > 0 ? list.join(", ") : "none";
6556
+ }
6557
+ /** How a remote's peer announced itself. */
6558
+ function peerManifestLabel(peer) {
6559
+ if (peer === void 0) return "Not yet heard (baseline)";
6560
+ if (peer.manifest === null) return "Silent (baseline)";
6561
+ return `Announced, revision ${peer.manifest.revision.slice(0, 8)}`;
6562
+ }
6563
+ function PeerAgreementPanel({ remoteName, collectionId, peer, agreement, holds }) {
6564
+ const local = agreement.local();
6565
+ const theirs = agreement.peer(remoteName);
6566
+ const protocols = Object.keys(local.protocols).sort();
6567
+ const features = Object.keys(local.features).sort();
6568
+ return /* @__PURE__ */ jsxs("section", {
6569
+ "aria-label": "Peer agreement",
6570
+ className: "flex flex-col gap-2 rounded-lg border border-border p-3",
6571
+ children: [
6572
+ /* @__PURE__ */ jsxs("div", {
6573
+ className: "flex items-center justify-between",
6574
+ children: [/* @__PURE__ */ jsx("h3", {
6575
+ className: "text-sm font-semibold text-foreground",
6576
+ children: "Peer agreement"
6577
+ }), /* @__PURE__ */ jsx("span", {
6578
+ className: "text-xs text-muted-foreground",
6579
+ children: peerManifestLabel(peer)
6580
+ })]
6581
+ }),
6582
+ /* @__PURE__ */ jsxs("table", {
6583
+ className: "w-full border-collapse",
6584
+ children: [/* @__PURE__ */ jsx("thead", {
6585
+ className: "bg-muted",
6586
+ children: /* @__PURE__ */ jsxs("tr", { children: [
6587
+ /* @__PURE__ */ jsx("th", {
6588
+ className: head,
6589
+ children: "Protocol"
6590
+ }),
6591
+ /* @__PURE__ */ jsx("th", {
6592
+ className: head,
6593
+ children: "Local"
6594
+ }),
6595
+ /* @__PURE__ */ jsx("th", {
6596
+ className: head,
6597
+ children: "Peer"
6598
+ }),
6599
+ /* @__PURE__ */ jsx("th", {
6600
+ className: head,
6601
+ children: "Limits new documents"
6602
+ })
6603
+ ] })
6604
+ }), /* @__PURE__ */ jsxs("tbody", { children: [protocols.map((protocol) => {
6605
+ const limits = agreement.limitedBy(collectionId, protocol).includes(remoteName);
6606
+ return /* @__PURE__ */ jsxs("tr", {
6607
+ className: "odd:bg-card even:bg-background",
6608
+ children: [
6609
+ /* @__PURE__ */ jsx("td", {
6610
+ className: cell,
6611
+ children: protocol
6612
+ }),
6613
+ /* @__PURE__ */ jsx("td", {
6614
+ className: cell,
6615
+ children: versions(local.protocols[protocol])
6616
+ }),
6617
+ /* @__PURE__ */ jsx("td", {
6618
+ className: cell,
6619
+ children: versions(theirs.protocols[protocol])
6620
+ }),
6621
+ /* @__PURE__ */ jsx("td", {
6622
+ className: twMerge(cell, limits && "text-warning"),
6623
+ children: limits ? "Yes" : "No"
6624
+ })
6625
+ ]
6626
+ }, protocol);
6627
+ }), features.map((feature) => /* @__PURE__ */ jsxs("tr", {
6628
+ className: "odd:bg-card even:bg-background",
6629
+ children: [
6630
+ /* @__PURE__ */ jsxs("td", {
6631
+ className: cell,
6632
+ children: [feature, " (feature)"]
6633
+ }),
6634
+ /* @__PURE__ */ jsx("td", {
6635
+ className: cell,
6636
+ children: versions(local.features[feature])
6637
+ }),
6638
+ /* @__PURE__ */ jsx("td", {
6639
+ className: cell,
6640
+ children: versions(theirs.features[feature])
6641
+ }),
6642
+ /* @__PURE__ */ jsx("td", {
6643
+ className: cell,
6644
+ children: "-"
6645
+ })
6646
+ ]
6647
+ }, feature))] })]
6648
+ }),
6649
+ /* @__PURE__ */ jsxs("h4", {
6650
+ className: "text-xs font-semibold text-foreground",
6651
+ children: [
6652
+ "Held documents (",
6653
+ holds.length,
6654
+ ")"
6655
+ ]
6656
+ }),
6657
+ holds.length === 0 ? /* @__PURE__ */ jsx("p", {
6658
+ className: "text-xs text-muted-foreground",
6659
+ children: "No documents held"
6660
+ }) : /* @__PURE__ */ jsxs("table", {
6661
+ className: "w-full border-collapse",
6662
+ children: [/* @__PURE__ */ jsx("thead", {
6663
+ className: "bg-muted",
6664
+ children: /* @__PURE__ */ jsxs("tr", { children: [
6665
+ /* @__PURE__ */ jsx("th", {
6666
+ className: head,
6667
+ children: "Document"
6668
+ }),
6669
+ /* @__PURE__ */ jsx("th", {
6670
+ className: head,
6671
+ children: "Branch"
6672
+ }),
6673
+ /* @__PURE__ */ jsx("th", {
6674
+ className: head,
6675
+ children: "Requires"
6676
+ }),
6677
+ /* @__PURE__ */ jsx("th", {
6678
+ className: head,
6679
+ children: "Peer runs"
6680
+ }),
6681
+ /* @__PURE__ */ jsx("th", {
6682
+ className: head,
6683
+ children: "Held since"
6684
+ })
6685
+ ] })
6686
+ }), /* @__PURE__ */ jsx("tbody", { children: holds.map((hold) => /* @__PURE__ */ jsxs("tr", {
6687
+ className: "odd:bg-card even:bg-background",
6688
+ children: [
6689
+ /* @__PURE__ */ jsx("td", {
6690
+ className: cell,
6691
+ children: hold.documentId
6692
+ }),
6693
+ /* @__PURE__ */ jsx("td", {
6694
+ className: cell,
6695
+ children: hold.branch
6696
+ }),
6697
+ /* @__PURE__ */ jsxs("td", {
6698
+ className: cell,
6699
+ children: [
6700
+ hold.reason.protocol,
6701
+ " ",
6702
+ hold.reason.version
6703
+ ]
6704
+ }),
6705
+ /* @__PURE__ */ jsx("td", {
6706
+ className: cell,
6707
+ children: versions(hold.reason.peerSupports)
6708
+ }),
6709
+ /* @__PURE__ */ jsx("td", {
6710
+ className: cell,
6711
+ children: new Date(hold.heldAtUtcMs).toLocaleString()
6712
+ })
6713
+ ]
6714
+ }, `${hold.documentId}:${hold.branch}`)) })]
6715
+ })
6716
+ ]
6717
+ });
6718
+ }
6719
+ //#endregion
6699
6720
  //#region src/connect/components/remotes-inspector/remotes-inspector.tsx
6700
6721
  const BASE_COLUMNS = [
6701
6722
  {
@@ -6723,6 +6744,11 @@ const BASE_COLUMNS = [
6723
6744
  label: "Filter",
6724
6745
  width: "200px"
6725
6746
  },
6747
+ {
6748
+ key: "peer",
6749
+ label: "Peer",
6750
+ width: "160px"
6751
+ },
6726
6752
  {
6727
6753
  key: "channel",
6728
6754
  label: "Channel",
@@ -6769,7 +6795,7 @@ function sortRemotes(remotes, sort) {
6769
6795
  return sort.direction === "asc" ? comparison : -comparison;
6770
6796
  });
6771
6797
  }
6772
- function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPull, connectionStates }) {
6798
+ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPull, connectionStates, getAgreement, getHolds }) {
6773
6799
  const [remotes, setRemotes] = useState([]);
6774
6800
  const [loading, setLoading] = useState(true);
6775
6801
  const [sort, setSort] = useState();
@@ -6777,29 +6803,47 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
6777
6803
  const [manualUrl, setManualUrl] = useState("");
6778
6804
  const [adding, setAdding] = useState(false);
6779
6805
  const [addError, setAddError] = useState();
6806
+ const [holds, setHolds] = useState([]);
6780
6807
  const hasRowActions = !!removeRemote || !!triggerPull;
6781
6808
  const columns = useMemo(() => hasRowActions ? [...BASE_COLUMNS, ACTIONS_COLUMN] : BASE_COLUMNS, [hasRowActions]);
6782
6809
  const loadRemotes = useCallback(async () => {
6783
6810
  setLoading(true);
6784
- setRemotes(await getRemotes());
6811
+ const data = await getRemotes();
6812
+ setRemotes(data);
6785
6813
  setLoading(false);
6786
6814
  }, [getRemotes]);
6787
6815
  useEffect(() => {
6788
6816
  loadRemotes();
6789
6817
  }, [loadRemotes]);
6818
+ useEffect(() => {
6819
+ if (!selectedRemote || !getHolds) return;
6820
+ let current = true;
6821
+ getHolds(selectedRemote.meta.name).then((loaded) => {
6822
+ if (current) setHolds(loaded);
6823
+ }).catch(() => {
6824
+ if (current) setHolds([]);
6825
+ });
6826
+ return () => {
6827
+ current = false;
6828
+ };
6829
+ }, [selectedRemote, getHolds]);
6790
6830
  const handleRefresh = useCallback(async () => {
6791
6831
  await loadRemotes();
6792
- if (selectedRemote) setSelectedRemote(remotes.find((r) => r.meta.id === selectedRemote.meta.id));
6832
+ if (selectedRemote) {
6833
+ const updated = remotes.find((r) => r.meta.id === selectedRemote.meta.id);
6834
+ setSelectedRemote(updated);
6835
+ }
6793
6836
  }, [
6794
6837
  loadRemotes,
6795
6838
  selectedRemote,
6796
6839
  remotes
6797
6840
  ]);
6798
6841
  const handleSort = (columnKey) => {
6799
- if (columnKey === "channel" || columnKey === "actions" || columnKey === "status") return;
6842
+ if (columnKey === "channel" || columnKey === "actions" || columnKey === "status" || columnKey === "peer") return;
6843
+ const newDirection = sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc";
6800
6844
  setSort({
6801
6845
  column: columnKey,
6802
- direction: sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc"
6846
+ direction: newDirection
6803
6847
  });
6804
6848
  };
6805
6849
  const handleViewChannel = (remote) => {
@@ -6841,13 +6885,30 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
6841
6885
  const handlePull = useCallback((remote) => {
6842
6886
  triggerPull?.(remote.meta.name);
6843
6887
  }, [triggerPull]);
6844
- if (selectedRemote) return /* @__PURE__ */ jsx(ChannelInspector, {
6845
- channel: selectedRemote.channel,
6846
- connectionState: connectionStates?.get(selectedRemote.meta.name),
6847
- onBack: handleBack,
6848
- onRefresh: () => void handleRefresh(),
6849
- remoteName: selectedRemote.meta.name
6850
- });
6888
+ if (selectedRemote) {
6889
+ let agreement;
6890
+ try {
6891
+ agreement = getAgreement?.();
6892
+ } catch {
6893
+ agreement = void 0;
6894
+ }
6895
+ return /* @__PURE__ */ jsxs("div", {
6896
+ className: "flex h-full flex-col gap-2 overflow-auto",
6897
+ children: [agreement && /* @__PURE__ */ jsx(PeerAgreementPanel, {
6898
+ agreement,
6899
+ collectionId: selectedRemote.meta.collectionId.key,
6900
+ holds,
6901
+ peer: selectedRemote.meta.peer,
6902
+ remoteName: selectedRemote.meta.name
6903
+ }), /* @__PURE__ */ jsx(ChannelInspector, {
6904
+ channel: selectedRemote.channel,
6905
+ connectionState: connectionStates?.get(selectedRemote.meta.name),
6906
+ onBack: handleBack,
6907
+ onRefresh: () => void handleRefresh(),
6908
+ remoteName: selectedRemote.meta.name
6909
+ })]
6910
+ });
6911
+ }
6851
6912
  const sortedRemotes = sortRemotes(remotes, sort);
6852
6913
  return /* @__PURE__ */ jsxs("div", {
6853
6914
  className: "flex h-full flex-col gap-2",
@@ -6904,7 +6965,7 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
6904
6965
  children: /* @__PURE__ */ jsx("tr", { children: columns.map((column, index) => {
6905
6966
  const isActive = sort?.column === column.key;
6906
6967
  const sortDirection = isActive ? sort.direction : "asc";
6907
- const isSortable = column.key !== "channel" && column.key !== "actions" && column.key !== "status";
6968
+ const isSortable = column.key !== "channel" && column.key !== "actions" && column.key !== "status" && column.key !== "peer";
6908
6969
  return /* @__PURE__ */ jsx("th", {
6909
6970
  className: twMerge("group px-3 py-2 text-left text-xs font-medium text-foreground", index > 0 && "border-l border-border", isSortable && "cursor-pointer hover:hover-effect"),
6910
6971
  onClick: () => isSortable && handleSort(column.key),
@@ -6974,6 +7035,13 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
6974
7035
  children: formatFilter(remote.meta.filter)
6975
7036
  })
6976
7037
  }),
7038
+ /* @__PURE__ */ jsx("td", {
7039
+ className: "border-l border-border px-3 py-2 text-xs text-foreground",
7040
+ children: /* @__PURE__ */ jsx("span", {
7041
+ className: "block truncate",
7042
+ children: peerManifestLabel(remote.meta.peer)
7043
+ })
7044
+ }),
6977
7045
  /* @__PURE__ */ jsx("td", {
6978
7046
  className: "border-l border-border px-3 py-2",
6979
7047
  children: /* @__PURE__ */ jsxs("button", {
@@ -7051,7 +7119,8 @@ function WorkerInspector({ getInfo, onRestart }) {
7051
7119
  const [restarting, setRestarting] = useState(false);
7052
7120
  const loadInfo = useCallback(async () => {
7053
7121
  try {
7054
- setInfo(await getInfo());
7122
+ const next = await getInfo();
7123
+ setInfo(next);
7055
7124
  setError(null);
7056
7125
  } catch (e) {
7057
7126
  setError(e instanceof Error ? e.message : String(e));
@@ -7146,7 +7215,7 @@ function InspectorUnavailable({ message }) {
7146
7215
  })]
7147
7216
  });
7148
7217
  }
7149
- function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExplorerProps, remotesInspectorProps, queueInspectorProps, processorsInspectorProps, integrityInspectorProps, workerInspectorProps, unavailableTabs, defaultTab = "Database" }) {
7218
+ function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExplorerProps, remotesInspectorProps, queueInspectorProps, processorsInspectorProps, integrityInspectorProps, catchUpInspectorProps, workerInspectorProps, unavailableTabs, defaultTab = "Database" }) {
7150
7219
  return /* @__PURE__ */ jsx(Modal, {
7151
7220
  ...modalProps,
7152
7221
  contentProps: {
@@ -7231,6 +7300,20 @@ function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExpl
7231
7300
  label: "Integrity",
7232
7301
  children: /* @__PURE__ */ jsx(InspectorUnavailable, { message: unavailableTabs.Integrity })
7233
7302
  }) : null,
7303
+ catchUpInspectorProps ? /* @__PURE__ */ jsx(TabContent, {
7304
+ description: "Catch-up inspector",
7305
+ label: "Catch-up",
7306
+ value: "CatchUp",
7307
+ children: /* @__PURE__ */ jsx("div", {
7308
+ className: "h-full",
7309
+ children: /* @__PURE__ */ jsx(CatchUpInspector, { ...catchUpInspectorProps })
7310
+ })
7311
+ }) : unavailableTabs?.CatchUp ? /* @__PURE__ */ jsx(TabContent, {
7312
+ description: "Catch-up inspector",
7313
+ label: "Catch-up",
7314
+ value: "CatchUp",
7315
+ children: /* @__PURE__ */ jsx(InspectorUnavailable, { message: unavailableTabs.CatchUp })
7316
+ }) : null,
7234
7317
  workerInspectorProps && /* @__PURE__ */ jsx(TabContent, {
7235
7318
  description: "Worker inspector",
7236
7319
  label: "Worker",
@@ -7354,10 +7437,12 @@ function ReadRequiredModal(props) {
7354
7437
  useEffect(() => {
7355
7438
  const checkScroll = () => {
7356
7439
  const element = contentRef.current;
7357
- if (element) if (element.scrollHeight > element.clientHeight) {
7358
- setDisableClose(true);
7359
- element.addEventListener("scroll", handleScroll);
7360
- } else setDisableClose(false);
7440
+ if (element) {
7441
+ if (element.scrollHeight > element.clientHeight) {
7442
+ setDisableClose(true);
7443
+ element.addEventListener("scroll", handleScroll);
7444
+ } else setDisableClose(false);
7445
+ }
7361
7446
  };
7362
7447
  const handleScroll = () => {
7363
7448
  const element = contentRef.current;
@@ -7623,28 +7708,8 @@ function LocalStorage(props) {
7623
7708
  }
7624
7709
  //#endregion
7625
7710
  //#region src/connect/components/modal/settings-modal-v2/default-editor.tsx
7626
- function DefaultEditor(props) {
7627
- const { className, ...rest } = props;
7628
- return /* @__PURE__ */ jsx("div", {
7629
- className: twMerge("rounded-lg bg-background p-3", className),
7630
- children: /* @__PURE__ */ jsx(DefaultEditorSelect, { ...rest })
7631
- });
7632
- }
7633
- function DefaultEditorSelect(props) {
7634
- const { documentModelEditor, setDocumentModelEditor, documentModelEditorOptions, className } = props;
7635
- return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
7636
- className: "mb-4 font-semibold text-foreground",
7637
- children: "Default Editor Selection"
7638
- }), /* @__PURE__ */ jsx(SelectFieldRaw, {
7639
- className: twMerge("max-w-fit min-w-36", className),
7640
- name: "default-editor",
7641
- required: true,
7642
- value: documentModelEditor,
7643
- options: documentModelEditorOptions,
7644
- multiple: false,
7645
- onChange: (value) => setDocumentModelEditor(value)
7646
- })] });
7647
- }
7711
+ const DefaultEditor = lazyComponent(() => import("../default-editor.impl-a6EOuEme.js").then((m) => m.DefaultEditor));
7712
+ const DefaultEditorSelect = lazyComponent(() => import("../default-editor.impl-a6EOuEme.js").then((m) => m.DefaultEditorSelect));
7648
7713
  //#endregion
7649
7714
  //#region src/connect/components/modal/settings-modal-v2/package-manager/parse-package-spec.ts
7650
7715
  /**
@@ -7870,6 +7935,7 @@ const VersionPicker = (props) => {
7870
7935
  className: "px-3 py-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase",
7871
7936
  children: "Tags"
7872
7937
  }), filteredTags.map(([tag, ver]) => {
7938
+ const isSelected = selected.kind === "tag" && selected.value === tag;
7873
7939
  return /* @__PURE__ */ jsxs("button", {
7874
7940
  type: "button",
7875
7941
  onClick: () => {
@@ -7880,7 +7946,7 @@ const VersionPicker = (props) => {
7880
7946
  setOpen(false);
7881
7947
  setQuery("");
7882
7948
  },
7883
- className: twMerge("flex w-full items-center justify-between gap-2 px-3 py-1.5 text-left text-xs transition-colors", "hover:hover-effect", selected.kind === "tag" && selected.value === tag && "bg-muted font-semibold"),
7949
+ className: twMerge("flex w-full items-center justify-between gap-2 px-3 py-1.5 text-left text-xs transition-colors", "hover:hover-effect", isSelected && "bg-muted font-semibold"),
7884
7950
  children: [/* @__PURE__ */ jsx("span", {
7885
7951
  className: "truncate text-foreground",
7886
7952
  children: tag
@@ -7901,6 +7967,7 @@ const VersionPicker = (props) => {
7901
7967
  className: "px-3 py-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase",
7902
7968
  children: "Versions"
7903
7969
  }), filteredVersions.map((ver) => {
7970
+ const isSelected = selected.kind === "version" && selected.value === ver;
7904
7971
  return /* @__PURE__ */ jsx("button", {
7905
7972
  type: "button",
7906
7973
  onClick: () => {
@@ -7911,7 +7978,7 @@ const VersionPicker = (props) => {
7911
7978
  setOpen(false);
7912
7979
  setQuery("");
7913
7980
  },
7914
- className: twMerge("flex w-full items-center px-3 py-1.5 text-left text-xs transition-colors", "hover:hover-effect", selected.kind === "version" && selected.value === ver && "bg-muted font-semibold"),
7981
+ className: twMerge("flex w-full items-center px-3 py-1.5 text-left text-xs transition-colors", "hover:hover-effect", isSelected && "bg-muted font-semibold"),
7915
7982
  children: /* @__PURE__ */ jsxs("span", {
7916
7983
  className: "flex min-w-0 items-center gap-1.5 text-foreground",
7917
7984
  children: [/* @__PURE__ */ jsx("span", {
@@ -8060,6 +8127,14 @@ const PackageManagerListItem = (props) => {
8060
8127
  updateTarget
8061
8128
  ]
8062
8129
  }),
8130
+ registryPackage.sharedDepWarnings && registryPackage.sharedDepWarnings.length > 0 && /* @__PURE__ */ jsxs("span", {
8131
+ className: "inline-flex items-center gap-1 rounded-full border border-warning/40 bg-warning/10 px-2 py-0.5 text-[11px] font-medium text-warning",
8132
+ title: registryPackage.sharedDepWarnings.join("\n"),
8133
+ children: [/* @__PURE__ */ jsx(Icon, {
8134
+ name: "Exclamation",
8135
+ size: 10
8136
+ }), "Shared deps out of date"]
8137
+ }),
8063
8138
  !(canPickVersion && hasVersionMetadata) && registryPackage.version && /* @__PURE__ */ jsxs("span", {
8064
8139
  className: "text-xs font-normal text-muted-foreground",
8065
8140
  children: ["v", registryPackage.version]
@@ -8103,7 +8178,8 @@ const PackageManagerListItem = (props) => {
8103
8178
  items: dropdownItems,
8104
8179
  onItemClick: (id) => {
8105
8180
  if (id === "install") {
8106
- onInstall(canPickVersion && hasVersionMetadata ? buildPackageSpec(registryPackage.name, selected.value) : registryPackage.name).catch(console.error);
8181
+ const spec = canPickVersion && hasVersionMetadata ? buildPackageSpec(registryPackage.name, selected.value) : registryPackage.name;
8182
+ onInstall(spec).catch(console.error);
8107
8183
  return;
8108
8184
  }
8109
8185
  if (id === "update") {
@@ -8571,619 +8647,8 @@ function ConnectUpgradeDriveModal(props) {
8571
8647
  });
8572
8648
  }
8573
8649
  //#endregion
8574
- //#region src/connect/components/revision-history/header/branch.tsx
8575
- function Branch(props) {
8576
- const { branch = "main" } = props;
8577
- return /* @__PURE__ */ jsxs("button", {
8578
- className: "flex h-8 w-fit items-center gap-1 rounded-lg bg-background pr-2 pl-1 text-xs text-foreground",
8579
- children: [
8580
- /* @__PURE__ */ jsx(Icon, { name: "Branch" }),
8581
- /* @__PURE__ */ jsx("span", { children: "BRANCH" }),
8582
- /* @__PURE__ */ jsx("span", {
8583
- className: "text-foreground",
8584
- children: branch
8585
- })
8586
- ]
8587
- });
8588
- }
8589
- //#endregion
8590
- //#region src/connect/components/revision-history/header/doc-id.tsx
8591
- function DocId(props) {
8592
- const { docId, onCopy } = props;
8593
- const [, copy] = useCopyToClipboard();
8594
- function handleCopy(text) {
8595
- return () => {
8596
- copy(text).then(() => {
8597
- onCopy?.();
8598
- }).catch((error) => {
8599
- console.error("Failed to copy!", error);
8600
- });
8601
- };
8602
- }
8603
- return /* @__PURE__ */ jsxs("button", {
8604
- className: "flex h-8 w-fit items-center gap-1 rounded-lg bg-background pr-2 pl-1 text-xs text-foreground",
8605
- onClick: handleCopy(docId),
8606
- children: [
8607
- /* @__PURE__ */ jsx(Icon, { name: "Link" }),
8608
- "DOC ID",
8609
- /* @__PURE__ */ jsx("span", {
8610
- className: "text-foreground",
8611
- children: docId
8612
- })
8613
- ]
8614
- });
8615
- }
8616
- //#endregion
8617
- //#region src/connect/components/revision-history/header/document-state.tsx
8618
- const DocumentState = (props) => {
8619
- const { documentState, onCopyState } = props;
8620
- const [, copy] = useCopyToClipboard();
8621
- function handleCopy() {
8622
- copy(JSON.stringify(documentState, null, 2)).then(() => {
8623
- onCopyState?.();
8624
- }).catch((error) => {
8625
- console.error("Failed to copy document state!", error);
8626
- });
8627
- }
8628
- return /* @__PURE__ */ jsx("button", {
8629
- className: "rounded-lg bg-background p-1 text-foreground",
8630
- onClick: handleCopy,
8631
- children: /* @__PURE__ */ jsx(Icon, { name: "CurlyBrackets" })
8632
- });
8633
- };
8634
- //#endregion
8635
- //#region src/connect/components/revision-history/header/scope.tsx
8636
- function Scope(props) {
8637
- const { value, onChange } = props;
8638
- return /* @__PURE__ */ jsx(ConnectSelect, {
8639
- absolutePositionMenu: true,
8640
- containerClassName: "z-10 w-fit rounded-lg bg-background text-xs text-muted-foreground",
8641
- id: "scope select",
8642
- itemClassName: "grid grid-cols-[auto,auto] gap-1 py-2 text-muted-foreground",
8643
- items: [{
8644
- displayValue: "Global scope",
8645
- value: "global"
8646
- }, {
8647
- displayValue: "Local scope",
8648
- value: "local"
8649
- }],
8650
- menuClassName: "min-w-0 text-muted-foreground",
8651
- onChange,
8652
- value
8653
- });
8654
- }
8655
- //#endregion
8656
- //#region src/connect/components/revision-history/header/header.tsx
8657
- function Header(props) {
8658
- const { title, docId, scope, onChangeScope, onClose, className, documentState, onCopyState, onCopyDocId, ...divProps } = props;
8659
- return /* @__PURE__ */ jsxs("header", {
8660
- className: twMerge("flex items-center justify-between bg-transparent", className),
8661
- ...divProps,
8662
- children: [/* @__PURE__ */ jsxs("div", {
8663
- className: "flex items-center gap-3",
8664
- children: [/* @__PURE__ */ jsx("button", {
8665
- name: "close-revision-history",
8666
- className: "rounded-lg bg-background p-1 text-foreground shadow-button",
8667
- onClick: onClose,
8668
- children: /* @__PURE__ */ jsx(Icon, { name: "VariantArrowLeft" })
8669
- }), /* @__PURE__ */ jsx("h1", {
8670
- className: "text-xs text-foreground",
8671
- children: title
8672
- })]
8673
- }), /* @__PURE__ */ jsxs("div", {
8674
- className: "flex items-center gap-2",
8675
- children: [
8676
- /* @__PURE__ */ jsx(DocId, {
8677
- docId,
8678
- onCopy: onCopyDocId
8679
- }),
8680
- documentState && /* @__PURE__ */ jsx(DocumentState, {
8681
- documentState,
8682
- onCopyState
8683
- }),
8684
- /* @__PURE__ */ jsx(Branch, {}),
8685
- /* @__PURE__ */ jsx(Scope, {
8686
- onChange: onChangeScope,
8687
- value: scope
8688
- })
8689
- ]
8690
- })]
8691
- });
8692
- }
8693
- //#endregion
8694
- //#region src/connect/hooks/use-ens.ts
8695
- const ensCache = /* @__PURE__ */ new Map();
8696
- function fetchEns(address) {
8697
- const cached = ensCache.get(address);
8698
- if (cached) return cached;
8699
- const promise = fetch(`https://api.ensdata.net/${address}`).then((res) => {
8700
- if (!res.ok) throw new Error(`ENS lookup failed: ${res.status}`);
8701
- return res.json();
8702
- }).catch((err) => {
8703
- ensCache.delete(address);
8704
- throw err instanceof Error ? err : /* @__PURE__ */ new Error("ENS lookup failed");
8705
- });
8706
- ensCache.set(address, promise);
8707
- return promise;
8708
- }
8709
- function useEns(address) {
8710
- const [data, setData] = useState();
8711
- const [isLoading, setIsLoading] = useState(false);
8712
- const [error, setError] = useState();
8713
- useEffect(() => {
8714
- if (!address) {
8715
- setData(void 0);
8716
- setError(void 0);
8717
- return;
8718
- }
8719
- let cancelled = false;
8720
- setIsLoading(true);
8721
- setError(void 0);
8722
- fetchEns(address).then((json) => {
8723
- if (cancelled) return;
8724
- setData(json);
8725
- }).catch((err) => {
8726
- if (cancelled) return;
8727
- setError(err instanceof Error ? err : /* @__PURE__ */ new Error("ENS lookup failed"));
8728
- }).finally(() => {
8729
- if (cancelled) return;
8730
- setIsLoading(false);
8731
- });
8732
- return () => {
8733
- cancelled = true;
8734
- };
8735
- }, [address]);
8736
- return {
8737
- data,
8738
- isLoading,
8739
- error
8740
- };
8741
- }
8742
- //#endregion
8743
- //#region src/connect/utils/address.ts
8744
- function formatEthAddress(address) {
8745
- return `${address.slice(0, 7)}...${address.slice(-5)}`;
8746
- }
8747
- //#endregion
8748
- //#region src/connect/components/code-popover.tsx
8749
- function CodePopover(props) {
8750
- const { content, trigger, anchor } = props;
8751
- const [isOpen, setIsOpen] = useState(false);
8752
- const opener = funnel(() => setIsOpen(true), {
8753
- triggerAt: "start",
8754
- minQuietPeriodMs: 300
8755
- });
8756
- const closer = funnel(() => setIsOpen(false), {
8757
- triggerAt: "start",
8758
- minQuietPeriodMs: 100
8759
- });
8760
- function open() {
8761
- closer.cancel();
8762
- opener.call();
8763
- }
8764
- function close() {
8765
- opener.cancel();
8766
- closer.call();
8767
- }
8768
- return /* @__PURE__ */ jsxs(Root$1, {
8769
- open: isOpen,
8770
- onOpenChange: (changedIsOpen) => changedIsOpen ? open() : close(),
8771
- children: [
8772
- /* @__PURE__ */ jsx(Trigger$1, {
8773
- onMouseEnter: open,
8774
- children: trigger
8775
- }),
8776
- !!anchor && /* @__PURE__ */ jsx(Anchor, {
8777
- asChild: true,
8778
- children: anchor
8779
- }),
8780
- /* @__PURE__ */ jsx(Portal$1, { children: /* @__PURE__ */ jsx(Content$1, {
8781
- forceMount: true,
8782
- onMouseLeave: close,
8783
- sideOffset: -28,
8784
- onCloseAutoFocus: (e) => e.preventDefault(),
8785
- collisionPadding: {
8786
- top: 24,
8787
- right: 24,
8788
- bottom: -1e4,
8789
- left: 24
8790
- },
8791
- className: "z-50 rounded-lg border border-border bg-popover p-2 text-xs text-popover-foreground shadow-tooltip outline-none",
8792
- children: content
8793
- }) })
8794
- ]
8795
- });
8796
- }
8797
- //#endregion
8798
- //#region src/connect/components/revision-history/revision/address.tsx
8799
- function Address(props) {
8800
- const { address, chainId } = props;
8801
- const { data: ensData } = useEns(address);
8802
- if (!address) return null;
8803
- const shortenedAddress = formatEthAddress(address);
8804
- return /* @__PURE__ */ jsx(CodePopover, {
8805
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, { value: { address } }),
8806
- trigger: /* @__PURE__ */ jsxs("span", {
8807
- className: "flex w-fit cursor-pointer items-center gap-1 rounded-lg bg-muted p-1 text-xs text-muted-foreground",
8808
- children: [/* @__PURE__ */ jsx(ENSAvatar, {
8809
- address,
8810
- chainId,
8811
- avatarUrl: ensData?.avatar_url ?? void 0
8812
- }), shortenedAddress]
8813
- })
8814
- });
8815
- }
8816
- //#endregion
8817
- //#region src/connect/components/revision-history/revision/errors.tsx
8818
- function Errors(props) {
8819
- const { errors } = props;
8820
- const hasErrors = !!errors?.length;
8821
- const color = hasErrors ? "text-destructive" : "text-success";
8822
- const icon = hasErrors ? /* @__PURE__ */ jsx(Icon, {
8823
- name: "Exclamation",
8824
- size: 16
8825
- }) : /* @__PURE__ */ jsx(Icon, {
8826
- name: "Check",
8827
- size: 16
8828
- });
8829
- const text = hasErrors ? `Error: ${errors[0]}` : "No errors";
8830
- const content = /* @__PURE__ */ jsxs("span", {
8831
- className: twMerge("flex w-fit items-center rounded-lg border border-border bg-background px-2 py-1 text-xs", color, hasErrors && "cursor-pointer"),
8832
- children: [icon, /* @__PURE__ */ jsx("span", {
8833
- className: twMerge("inline-block max-w-36 truncate"),
8834
- children: text
8835
- })]
8836
- });
8837
- if (hasErrors) return /* @__PURE__ */ jsx(CodePopover, {
8838
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, { value: errors }),
8839
- trigger: content
8840
- });
8841
- return content;
8842
- }
8843
- //#endregion
8844
- //#region src/connect/components/revision-history/revision/operation.tsx
8845
- function Operation$1(props) {
8846
- const { operationType, operationInput } = props;
8847
- return /* @__PURE__ */ jsx(CodePopover, {
8848
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, { value: operationInput }),
8849
- trigger: /* @__PURE__ */ jsxs("span", {
8850
- className: "flex cursor-pointer items-center gap-2 text-xs text-foreground",
8851
- children: [operationType, /* @__PURE__ */ jsx(Icon, {
8852
- className: "text-foreground",
8853
- name: "Braces",
8854
- size: 16
8855
- })]
8856
- })
8857
- });
8858
- }
8859
- //#endregion
8860
- //#region src/connect/components/revision-history/revision/revision-number.tsx
8861
- function RevisionNumber(props) {
8862
- const { operationIndex, eventId, stateHash } = props;
8863
- const revisionNumber = operationIndex + 1;
8864
- return /* @__PURE__ */ jsx(CodePopover, {
8865
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, { value: {
8866
- revisionNumber,
8867
- eventId,
8868
- stateHash
8869
- } }),
8870
- trigger: /* @__PURE__ */ jsxs("span", {
8871
- className: "flex cursor-pointer items-center gap-2 text-xs text-foreground",
8872
- children: [
8873
- "Revision ",
8874
- revisionNumber,
8875
- ".",
8876
- /* @__PURE__ */ jsx("a", { children: /* @__PURE__ */ jsx(Icon, {
8877
- className: "cursor-pointer text-foreground",
8878
- name: "Ellipsis",
8879
- size: 14
8880
- }) })
8881
- ]
8882
- })
8883
- });
8884
- }
8885
- //#endregion
8886
- //#region src/connect/components/revision-history/revision/signature.tsx
8887
- function Signature(props) {
8888
- const { signatures } = props;
8889
- if (!signatures?.length) return null;
8890
- return /* @__PURE__ */ jsx(CodePopover, {
8891
- trigger: /* @__PURE__ */ jsxs("span", {
8892
- className: "flex w-fit cursor-pointer items-center gap-1 rounded-lg border border-border bg-background px-2 py-1",
8893
- children: [
8894
- /* @__PURE__ */ jsx(VerificationStatus, { signatures }),
8895
- " ",
8896
- /* @__PURE__ */ jsx(Icon, {
8897
- className: "text-foreground",
8898
- name: "InfoSquare",
8899
- size: 16
8900
- })
8901
- ]
8902
- }),
8903
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, {
8904
- value: signatures,
8905
- collapsed: 1
8906
- })
8907
- });
8908
- }
8909
- function VerificationStatus(props) {
8910
- const { signatures } = props;
8911
- if (!signatures?.length) return null;
8912
- const signatureCount = signatures.length;
8913
- const verifiedSignaturesCount = signatures.filter((signature) => signature.isVerified).length;
8914
- const verificationStatusText = `${verifiedSignaturesCount}/${signatureCount} ${signatureCount === 1 ? "signature" : "signatures"} verified`;
8915
- return /* @__PURE__ */ jsx("span", {
8916
- className: twMerge(`text-xs`, verifiedSignaturesCount === 0 ? "text-destructive" : verifiedSignaturesCount === signatureCount ? "text-success" : "text-warning"),
8917
- children: verificationStatusText
8918
- });
8919
- }
8920
- //#endregion
8921
- //#region src/connect/components/revision-history/revision/timestamp.tsx
8922
- function Timestamp(props) {
8923
- const { timestampUtcMs: timestamp } = props;
8924
- const timestampNumber = typeof timestamp === "string" && !timestamp.includes("-") ? parseInt(timestamp) : timestamp;
8925
- const date = new Date(timestampNumber);
8926
- const shortDate = format(date, "HH:mm 'UTC'");
8927
- return /* @__PURE__ */ jsx(CodePopover, {
8928
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, { value: {
8929
- timestampFormatted: format(date, "eee, dd MMM yyyy HH:mm:ss 'UTC'"),
8930
- timestampUtcMs: timestamp
8931
- } }),
8932
- trigger: /* @__PURE__ */ jsxs("span", {
8933
- className: "cursor-pointer text-xs text-foreground",
8934
- children: ["committed at ", shortDate]
8935
- })
8936
- });
8937
- }
8938
- //#endregion
8939
- //#region src/connect/components/revision-history/revision/revision.tsx
8940
- function _Revision(props) {
8941
- return /* @__PURE__ */ jsxs("article", {
8942
- className: "flex items-center justify-between rounded-xl border border-border bg-background px-4 py-2",
8943
- children: [/* @__PURE__ */ jsxs("div", {
8944
- className: "flex items-center gap-2",
8945
- children: [
8946
- /* @__PURE__ */ jsx(RevisionNumber, { ...props }),
8947
- /* @__PURE__ */ jsx(Operation$1, { ...props }),
8948
- /* @__PURE__ */ jsx(Address, { ...props }),
8949
- /* @__PURE__ */ jsx(Timestamp, { ...props })
8950
- ]
8951
- }), /* @__PURE__ */ jsxs("div", {
8952
- className: "flex items-center gap-1",
8953
- children: [/* @__PURE__ */ jsx(Signature, { ...props }), /* @__PURE__ */ jsx(Errors, { ...props })]
8954
- })]
8955
- });
8956
- }
8957
- const Revision = /* @__PURE__ */ memo(_Revision);
8958
- //#endregion
8959
- //#region src/connect/components/revision-history/skip/skip.tsx
8960
- function Skip(props) {
8961
- const { operationIndex, skipCount } = props;
8962
- const revisionNumber = operationIndex;
8963
- const skippedRevisions = skipCount === 1 ? `${revisionNumber}` : `${revisionNumber} - ${revisionNumber + 1 - skipCount}`;
8964
- return /* @__PURE__ */ jsxs("article", {
8965
- className: "grid grid-cols-[1fr,auto,1fr] items-center py-2",
8966
- children: [
8967
- /* @__PURE__ */ jsx("div", { className: "h-px rounded-full bg-muted" }),
8968
- /* @__PURE__ */ jsxs("div", {
8969
- className: "mx-3 text-xs text-foreground",
8970
- children: [
8971
- "[Skipped Revision ",
8972
- skippedRevisions,
8973
- "]"
8974
- ]
8975
- }),
8976
- /* @__PURE__ */ jsx("div", { className: "h-px rounded-full bg-muted" })
8977
- ]
8978
- });
8979
- }
8980
- //#endregion
8981
- //#region src/connect/components/revision-history/utils.ts
8982
- function makeRows(operations) {
8983
- const revisionsAndSkips = [];
8984
- const seenDays = /* @__PURE__ */ new Set();
8985
- for (const operation of operations) {
8986
- if (!operation.timestampUtcMs) continue;
8987
- const day = operation.timestampUtcMs.split("T")[0];
8988
- if (!seenDays.has(day)) {
8989
- seenDays.add(day);
8990
- revisionsAndSkips.push({
8991
- type: "day",
8992
- height: 32,
8993
- timestampUtcMs: day
8994
- });
8995
- }
8996
- revisionsAndSkips.push({
8997
- type: "revision",
8998
- height: 46,
8999
- operationIndex: operation.index,
9000
- eventId: operation.id ?? "EVENT_ID_NOT_FOUND",
9001
- stateHash: operation.hash,
9002
- operationType: operation.action.type,
9003
- operationInput: operation.action.input ?? {},
9004
- address: operation.action?.context?.signer?.user.address,
9005
- chainId: operation.action?.context?.signer?.user.chainId,
9006
- timestampUtcMs: operation.timestampUtcMs,
9007
- signatures: makeSignatures(operation.action?.context?.signer?.signatures ?? []),
9008
- errors: operation.error ? [operation.error] : void 0
9009
- });
9010
- if (operation.skip > 0) revisionsAndSkips.push({
9011
- type: "skip",
9012
- height: 34,
9013
- operationIndex: operation.index,
9014
- skipCount: operation.skip,
9015
- timestampUtcMs: operation.timestampUtcMs
9016
- });
9017
- }
9018
- return revisionsAndSkips;
9019
- }
9020
- function makeSignatureFromSignatureArray(signatureArray) {
9021
- const [signerAddress, hash, prevStateHash, signatureBytes] = signatureArray;
9022
- return {
9023
- signerAddress,
9024
- hash,
9025
- prevStateHash,
9026
- signatureBytes,
9027
- isVerified: true
9028
- };
9029
- }
9030
- function makeSignatures(signaturesArray) {
9031
- return signaturesArray?.map(makeSignatureFromSignatureArray);
9032
- }
9033
- //#endregion
9034
- //#region src/connect/components/revision-history/timeline/day.tsx
9035
- function Day(props) {
9036
- const { timestampUtcMs: timestamp } = props;
9037
- const formattedDate = format(timestamp, "MMM dd, yyyy");
9038
- return /* @__PURE__ */ jsxs("h2", {
9039
- className: "-ml-6 flex items-center gap-1 bg-background py-2 text-xs text-foreground",
9040
- children: [
9041
- /* @__PURE__ */ jsx(Icon, {
9042
- name: "Ring",
9043
- size: 16
9044
- }),
9045
- " Changes on ",
9046
- formattedDate
9047
- ]
9048
- });
9049
- }
9050
- //#endregion
9051
- //#region src/connect/components/revision-history/timeline/timeline.tsx
9052
- function Timeline(props) {
9053
- const { localOperations, globalOperations, scope } = props;
9054
- const operations = scope === "local" ? localOperations : globalOperations;
9055
- const initialNumRowsToShow = 100;
9056
- const allRows = useMemo(() => makeRows(operations), [operations]);
9057
- const [scrollAmount, setScrollAmount] = useState(0);
9058
- const [numRowsToShow, setNumRowsToShow] = useState(initialNumRowsToShow);
9059
- const [rows, setRows] = useState(() => allRows.slice(0, numRowsToShow));
9060
- const parentRef = useRef(null);
9061
- const hasNextPage = rows.length < allRows.length;
9062
- const rowVirtualizer = useVirtualizer({
9063
- count: rows.length,
9064
- getScrollElement: () => parentRef.current,
9065
- estimateSize: (i) => allRows[i].height,
9066
- gap: 8
9067
- });
9068
- useEffect(() => {
9069
- if (!hasNextPage) return;
9070
- const newNumRevisions = initialNumRowsToShow + Math.floor(scrollAmount / 46);
9071
- setNumRowsToShow((prev) => newNumRevisions > prev ? newNumRevisions : prev);
9072
- }, [scrollAmount, hasNextPage]);
9073
- useEffect(() => {
9074
- setRows(allRows.slice(0, numRowsToShow));
9075
- }, [allRows, numRowsToShow]);
9076
- const handleScroll = (e) => {
9077
- setScrollAmount((prev) => {
9078
- const n = prev + e.deltaY;
9079
- if (n < 0) return 0;
9080
- return n;
9081
- });
9082
- };
9083
- useEffect(() => {
9084
- window.addEventListener("wheel", handleScroll);
9085
- return () => {
9086
- window.removeEventListener("wheel", handleScroll);
9087
- };
9088
- }, []);
9089
- return /* @__PURE__ */ jsx("div", {
9090
- className: "border-l border-border dark:border-none",
9091
- ref: parentRef,
9092
- style: {
9093
- height: `${rowVirtualizer.getTotalSize()}px`,
9094
- width: "100%",
9095
- position: "relative"
9096
- },
9097
- children: rowVirtualizer.getVirtualItems().map((virtualRow) => {
9098
- const row = rows[virtualRow.index];
9099
- return /* @__PURE__ */ jsxs("div", {
9100
- style: {
9101
- position: "absolute",
9102
- top: 0,
9103
- left: 16,
9104
- width: "100%",
9105
- height: `${virtualRow.size}px`,
9106
- transform: `translateY(${virtualRow.start}px)`
9107
- },
9108
- children: [
9109
- row.type === "revision" && /* @__PURE__ */ createElement(Revision, {
9110
- ...row,
9111
- key: virtualRow.key
9112
- }),
9113
- row.type === "skip" && /* @__PURE__ */ jsx(Skip, { ...row }, virtualRow.key),
9114
- row.type === "day" && /* @__PURE__ */ jsx(Day, { ...row }, virtualRow.key)
9115
- ]
9116
- }, virtualRow.index);
9117
- })
9118
- });
9119
- }
9120
- //#endregion
9121
8650
  //#region src/connect/components/revision-history/revision-history.tsx
9122
- function RevisionHistory(props) {
9123
- const { documentTitle, documentId, globalOperations, localOperations, onClose, itemsPerPage = 100, documentState, onCopyState, onCopyDocId } = props;
9124
- const [scope, setScope] = useState("global");
9125
- const visibleOperations = useMemo(() => {
9126
- return garbageCollect(sortOperations(scope === "global" ? globalOperations : localOperations)).sort((a, b) => b.index - a.index);
9127
- }, [
9128
- globalOperations,
9129
- localOperations,
9130
- scope
9131
- ]);
9132
- const { pageItems, pages, goToPage, goToNextPage, goToPreviousPage, goToFirstPage, goToLastPage, hiddenNextPages, isNextPageAvailable, isPreviousPageAvailable } = usePagination(visibleOperations, { itemsPerPage });
9133
- function onChangeScope(scope) {
9134
- goToFirstPage();
9135
- setScope(scope);
9136
- }
9137
- const PaginationComponent = visibleOperations.length > itemsPerPage ? /* @__PURE__ */ jsx("div", {
9138
- className: "mt-4 flex w-full justify-end",
9139
- children: /* @__PURE__ */ jsx(Pagination, {
9140
- firstPageLabel: "First Page",
9141
- goToFirstPage,
9142
- goToLastPage,
9143
- goToNextPage,
9144
- goToPage,
9145
- goToPreviousPage,
9146
- hiddenNextPages,
9147
- isNextPageAvailable,
9148
- isPreviousPageAvailable,
9149
- lastPageLabel: "Last Page",
9150
- nextPageLabel: "Next",
9151
- pages,
9152
- previousPageLabel: "Previous"
9153
- })
9154
- }) : /* @__PURE__ */ jsx("hr", { className: "h-12 border-none" });
9155
- return /* @__PURE__ */ jsx(ConnectTooltipProvider, { children: /* @__PURE__ */ jsxs("div", {
9156
- className: "p-6",
9157
- children: [
9158
- /* @__PURE__ */ jsx(Header, {
9159
- docId: documentId,
9160
- onChangeScope,
9161
- onClose,
9162
- scope,
9163
- title: documentTitle,
9164
- documentState,
9165
- onCopyState,
9166
- onCopyDocId
9167
- }),
9168
- PaginationComponent,
9169
- /* @__PURE__ */ jsx("div", {
9170
- className: "mt-4 flex justify-center rounded-md bg-background p-4",
9171
- children: visibleOperations.length > 0 ? /* @__PURE__ */ jsx("div", {
9172
- className: "grid grid-cols-[minmax(min-content,1018px)]",
9173
- children: /* @__PURE__ */ jsx(Timeline, {
9174
- globalOperations: scope === "global" ? pageItems : [],
9175
- localOperations: scope === "local" ? pageItems : [],
9176
- scope
9177
- })
9178
- }) : /* @__PURE__ */ jsx("h3", {
9179
- className: "my-40 text-foreground",
9180
- children: "This document has no recorded operations yet."
9181
- })
9182
- }),
9183
- PaginationComponent
9184
- ]
9185
- }) });
9186
- }
8651
+ const RevisionHistory = lazyComponent(() => import("../revision-history.impl-DRbeai2m.js").then((m) => m.RevisionHistory));
9187
8652
  //#endregion
9188
8653
  //#region src/connect/components/search-bar/filter-item.tsx
9189
8654
  const FilterItem = (props) => {
@@ -9249,27 +8714,70 @@ const ConnectSearchBar = (props) => {
9249
8714
  });
9250
8715
  };
9251
8716
  //#endregion
8717
+ //#region src/connect/components/tooltip/tooltip.tsx
8718
+ function ConnectTooltip(props) {
8719
+ const { children, content, open, defaultOpen, onOpenChange, className, side = "top", sideOffset = 5, delayDuration, ...rest } = props;
8720
+ return /* @__PURE__ */ jsxs(Root, {
8721
+ defaultOpen,
8722
+ delayDuration,
8723
+ onOpenChange,
8724
+ open,
8725
+ children: [/* @__PURE__ */ jsx(Trigger, {
8726
+ asChild: true,
8727
+ children
8728
+ }), /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content, {
8729
+ ...rest,
8730
+ side,
8731
+ sideOffset,
8732
+ className: twMerge("z-50 rounded-lg border border-border bg-popover p-2 text-xs text-popover-foreground shadow-tooltip", className),
8733
+ children: content
8734
+ }) })]
8735
+ });
8736
+ }
8737
+ const ConnectTooltipProvider = Provider;
8738
+ //#endregion
9252
8739
  //#region src/connect/components/sidebar/sidebar-item.tsx
9253
8740
  const SidebarItem = function SidebarItem(props) {
9254
- const { icon, title, description: _description, containerClassName, active, onClick } = props;
8741
+ const { icon, title, description, containerClassName, active, href, onClick, onPreload } = props;
8742
+ const Element = href ? "a" : onClick ? "button" : "div";
8743
+ const current = href ? props["aria-current"] : void 0;
9255
8744
  return /* @__PURE__ */ jsx(ConnectTooltip, {
9256
- content: title,
8745
+ content: description ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
8746
+ className: "block font-medium",
8747
+ children: title
8748
+ }), /* @__PURE__ */ jsx("span", {
8749
+ className: "block opacity-80",
8750
+ children: description
8751
+ })] }) : title,
9257
8752
  side: "right",
9258
8753
  sideOffset: 12,
9259
8754
  className: "border-none bg-primary px-3 py-2 text-sm text-primary-foreground",
9260
- children: /* @__PURE__ */ jsxs("div", {
9261
- 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"),
8755
+ children: /* @__PURE__ */ jsxs(Element, {
8756
+ href,
8757
+ type: Element === "button" ? "button" : void 0,
8758
+ "aria-label": title,
8759
+ "aria-description": description,
8760
+ "aria-current": current,
8761
+ 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"),
9262
8762
  onClick,
9263
- 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", {
9264
- className: "mx-auto py-4",
9265
- children: icon || /* @__PURE__ */ jsx("div", {
9266
- className: "flex size-8 items-center justify-center rounded-lg bg-primary",
9267
- children: /* @__PURE__ */ jsx("span", {
9268
- className: "text-sm font-medium text-primary-foreground",
9269
- children: title.slice(0, 1).toUpperCase()
8763
+ onMouseEnter: onPreload,
8764
+ onTouchStart: onPreload,
8765
+ onFocus: href ? onPreload : void 0,
8766
+ children: [
8767
+ /* @__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 max-sm:hidden!", active && "block") }),
8768
+ /* @__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 max-sm:hidden", active && "hidden") }),
8769
+ /* @__PURE__ */ jsx("div", {
8770
+ className: "mx-auto py-4 max-sm:px-3 max-sm:py-2",
8771
+ children: icon || /* @__PURE__ */ jsx("div", {
8772
+ "aria-hidden": true,
8773
+ className: "flex size-8 items-center justify-center rounded-lg bg-primary",
8774
+ children: /* @__PURE__ */ jsx("span", {
8775
+ className: "text-sm font-medium text-primary-foreground",
8776
+ children: title.slice(0, 1).toUpperCase()
8777
+ })
9270
8778
  })
9271
8779
  })
9272
- })]
8780
+ ]
9273
8781
  })
9274
8782
  });
9275
8783
  };
@@ -9434,17 +8942,32 @@ const SidebarUser = ({ address, ensName, avatarUrl, etherscanUrl, onDisconnect }
9434
8942
  };
9435
8943
  //#endregion
9436
8944
  //#region src/connect/components/sidebar/sidebar-footer.tsx
9437
- const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin, onClickSettings, onDisconnect, onHomeClick, showDebug, onDebugClick, etherscanUrl = "", ...props }) => {
8945
+ const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin, onClickSettings, settingsHref, settingsCurrent, onDisconnect, onHomeClick, showDebug, onDebugClick, etherscanUrl = "", ...props }) => {
8946
+ const appLogoSrc = useConnectBranding().icon;
8947
+ const settingsIcon = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Settings, {
8948
+ className: "text-foreground",
8949
+ size: 24,
8950
+ strokeWidth: 2
8951
+ }), /* @__PURE__ */ jsx("span", {
8952
+ className: "hidden text-sm/6 font-semibold text-foreground",
8953
+ children: "Settings"
8954
+ })] });
9438
8955
  return /* @__PURE__ */ jsxs(SidebarFooter, {
9439
8956
  ...props,
9440
- className: twMerge("flex flex-col items-center gap-3 border-t border-sidebar-border px-2 py-4 dark:border-none", className),
8957
+ className: twMerge("flex flex-col items-center gap-3 border-t border-sidebar-border px-2 py-4 max-sm:flex-row max-sm:border-t-0 max-sm:border-l max-sm:py-2 dark:border-none", className),
9441
8958
  children: [
9442
8959
  onHomeClick && /* @__PURE__ */ jsx("button", {
9443
8960
  "aria-label": "Home",
9444
8961
  type: "button",
9445
8962
  className: "cursor-pointer",
9446
8963
  onClick: onHomeClick,
9447
- children: /* @__PURE__ */ jsx(Icon, {
8964
+ children: appLogoSrc ? /* @__PURE__ */ jsx("img", {
8965
+ alt: "",
8966
+ className: "object-contain",
8967
+ src: appLogoSrc,
8968
+ width: 24,
8969
+ height: 24
8970
+ }) : /* @__PURE__ */ jsx(Icon, {
9448
8971
  className: "text-muted-foreground",
9449
8972
  name: "ConnectSmall",
9450
8973
  size: 24
@@ -9462,7 +8985,7 @@ const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin,
9462
8985
  })
9463
8986
  }),
9464
8987
  /* @__PURE__ */ jsx("div", {
9465
- className: onHomeClick ? "mt-3" : "",
8988
+ className: onHomeClick ? "mt-3 max-sm:mt-0" : "",
9466
8989
  children: address ? /* @__PURE__ */ jsx(SidebarUser, {
9467
8990
  address,
9468
8991
  ensName,
@@ -9471,19 +8994,19 @@ const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin,
9471
8994
  etherscanUrl
9472
8995
  }) : /* @__PURE__ */ jsx(SidebarLogin, { onLogin })
9473
8996
  }),
9474
- /* @__PURE__ */ jsxs("button", {
8997
+ settingsHref ? /* @__PURE__ */ jsx("a", {
8998
+ "aria-label": "Settings",
8999
+ href: settingsHref,
9000
+ "aria-current": settingsCurrent,
9001
+ className: "cursor-pointer rounded-md aria-[current=page]:bg-sidebar-accent",
9002
+ onClick: onClickSettings,
9003
+ children: settingsIcon
9004
+ }) : /* @__PURE__ */ jsx("button", {
9475
9005
  "aria-label": "Settings",
9476
9006
  type: "button",
9477
9007
  className: twMerge(onClickSettings ? "cursor-pointer" : "cursor-wait"),
9478
9008
  onClick: onClickSettings,
9479
- children: [/* @__PURE__ */ jsx(Settings, {
9480
- className: "text-foreground",
9481
- size: 24,
9482
- strokeWidth: 2
9483
- }), /* @__PURE__ */ jsx("span", {
9484
- className: "hidden text-sm/6 font-semibold text-foreground",
9485
- children: "Settings"
9486
- })]
9009
+ children: settingsIcon
9487
9010
  })
9488
9011
  ]
9489
9012
  });
@@ -9500,19 +9023,29 @@ const ConnectSidebarHeader = ({ className, children, ...props }) => {
9500
9023
  };
9501
9024
  //#endregion
9502
9025
  //#region src/connect/components/sidebar/sidebar.tsx
9503
- const ConnectSidebar = ({ onClick, address, ensName, avatarUrl, headerContent, onClickSettings, maxWidth = "304px", minWidth = "58px", onLogin, onDisconnect, etherscanUrl, showDebug, onDebugClick, ...props }) => {
9026
+ const ConnectSidebar = ({ onClick, address, ensName, avatarUrl, headerContent, onClickSettings, settingsHref, settingsCurrent, maxWidth = "304px", minWidth = "58px", onLogin, onDisconnect, etherscanUrl, showDebug, onDebugClick, ...props }) => {
9504
9027
  return /* @__PURE__ */ jsxs(Sidebar, {
9505
9028
  ...props,
9029
+ "data-connect-sidebar": "",
9506
9030
  maxWidth,
9507
9031
  minWidth,
9508
- children: [/* @__PURE__ */ jsxs(SidebarPanel, { children: [/* @__PURE__ */ jsx(ConnectSidebarHeader, { children: headerContent }), /* @__PURE__ */ jsx("div", {
9509
- className: "flex flex-col",
9510
- children: props.children
9511
- })] }), /* @__PURE__ */ jsx(ConnectSidebarFooter, {
9032
+ children: [/* @__PURE__ */ jsxs(SidebarPanel, {
9033
+ className: "max-sm:flex max-sm:overflow-x-auto max-sm:overflow-y-hidden",
9034
+ children: [/* @__PURE__ */ jsx(ConnectSidebarHeader, {
9035
+ className: "max-sm:hidden",
9036
+ children: headerContent
9037
+ }), /* @__PURE__ */ jsx("nav", {
9038
+ "aria-label": "Drives and pages",
9039
+ className: "flex flex-col max-sm:flex-row",
9040
+ children: props.children
9041
+ })]
9042
+ }), /* @__PURE__ */ jsx(ConnectSidebarFooter, {
9512
9043
  address,
9513
9044
  ensName,
9514
9045
  avatarUrl,
9515
9046
  onClickSettings,
9047
+ settingsHref,
9048
+ settingsCurrent,
9516
9049
  onLogin,
9517
9050
  onDisconnect,
9518
9051
  etherscanUrl,
@@ -9591,6 +9124,21 @@ function ThemeSwitch({ horizontal = false }) {
9591
9124
  });
9592
9125
  }
9593
9126
  //#endregion
9127
+ //#region src/connect/components/toggle/toggle.tsx
9128
+ const Toggle = /*#__PURE__*/ forwardRef(function Toggle(props, ref) {
9129
+ return /* @__PURE__ */ jsxs("label", {
9130
+ className: "relative cursor-pointer items-center",
9131
+ htmlFor: props.id,
9132
+ children: [/* @__PURE__ */ jsx("input", {
9133
+ className: "peer sr-only",
9134
+ ref,
9135
+ type: "checkbox",
9136
+ value: "",
9137
+ ...props
9138
+ }), /* @__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" })]
9139
+ });
9140
+ });
9141
+ //#endregion
9594
9142
  //#region src/connect/utils/get-folder-status.ts
9595
9143
  /**
9596
9144
  * Retrieves the sync status of a folder based on its path and their children files.
@@ -9637,6 +9185,6 @@ const removeSuccessFiles = (files) => {
9637
9185
  return files.filter((file) => file.status !== "SUCCESS");
9638
9186
  };
9639
9187
  //#endregion
9640
- export { About, AccountPopover, AccountPopoverLogin, AddDriveModal, AddLocalDriveForm, AddRemoteDriveForm, AnimatedLoader, AvailablePackagesPanel, Breadcrumb, Breadcrumbs, CONFLICT, ChannelInspector, Combobox, ConnectConfirmationModal, ConnectDeleteDriveModal, ConnectDeleteItemModal, ConnectDropdownMenu, ConnectReplaceDuplicateModal, ConnectSearchBar, ConnectSelect, ConnectSidebar, ConnectSidebarFooter, ConnectSidebarHeader, ConnectTooltip, ConnectTooltipProvider, ConnectUpgradeDriveModal, ConnectionStateBadge, CookieBanner, CreateDocumentModal, CreateDocumentWithTypeModal, DBExplorer, DangerZone, DebugInspector, DefaultEditor, DefaultEditorLoader, DefaultEditorSelect, DependencyVersions, Disclosure, Divider, DocumentStateViewer, DocumentTimeline, DocumentToolbar, DriveAuthGate, DriveSettingsModal, DropZone, DropZoneWrapper, ENSAvatar, ERROR, EditorActionButtons, EditorUndoRedoButtons, FileItem, FolderItem, Footer, FooterLink, FormInput, FormattedJsonViewer, HomeBackgroundImage, HomeScreen, HomeScreenAddDriveItem, HomeScreenItem, INITIAL_SYNC, InspectorModal, InstalledPackagesPanel, IntegrityInspector, LoadingScreen, LogoAnimation, MISSING, ModalButton, NodeInput, ObjectInspectorModal, PackageInstallModal, PackageList, PackageManager, PackageManagerListItem, PackagePanelScrollArea, PackageRegistryError, PackageSubSection, ProcessorsInspector, QueueInspector, ReadRequiredModal, RemotesInspector, RenownLoginMethods, RevisionHistory, SUCCESS, SYNCING, SettingsModal, SidebarAddDriveItem, SidebarItem, SidebarLogin, SidebarUser, SyncStatusIcon, TabContent, Tabs, ThemeSwitch, Toggle, ToolbarButton, ToolbarCloseButton, ToolbarContainer, ToolbarControlsContainer, ToolbarDownloadButton, ToolbarHistoryButton, ToolbarInput, ToolbarName, ToolbarRedoButton, ToolbarSwitchboardButton, ToolbarUndoButton, UploadFileItem, UploadFileList, UploadFileListContainer, WorkerInspector, debugNodeOptions, debugNodeOptionsMap, defaultDriveOptions, defaultNodeOptions, fileNodeDropdownOptions, folderNodeDropdownOptions, formatEthAddress, formatFileSize, generateId, getFolderStatus, locationInfoByLocation, mapProgressStageToStatus, mapUploadsToFileItems, nodeOptions, normalNodeOptions, removeSuccessFiles, sharingTypeOptions, sortFilesByStatus, syncStatuses, useEns, verifyPackageJsonFields };
9188
+ export { About, AccountPopover, AccountPopoverLogin, AddDriveModal, AddLocalDriveForm, AddRemoteDriveForm, AnimatedLoader, AvailablePackagesPanel, BackgroundLayers, Breadcrumb, Breadcrumbs, CONFLICT, CatchUpInspector, ChannelInspector, Checkbox, Combobox, ConnectBrandingProvider, ConnectConfirmationModal, ConnectDeleteDriveModal, ConnectDeleteItemModal, ConnectDropdownMenu, ConnectReplaceDuplicateModal, ConnectSearchBar, ConnectSelect, ConnectSidebar, ConnectSidebarFooter, ConnectSidebarHeader, ConnectTooltip, ConnectTooltipProvider, ConnectUpgradeDriveModal, ConnectionStateBadge, CookieBanner, CreateDocumentModal, CreateDocumentWithTypeModal, DBExplorer, DangerZone, DebugInspector, DefaultEditor, DefaultEditorLoader, DefaultEditorSelect, DependencyVersions, Disclosure, Divider, DocumentStateViewer, DocumentTimeline, DocumentToolbar, DriveAuthGate, DriveSettingsModal, DropZone, DropZoneWrapper, ENSAvatar, ERROR, EditorActionButtons, EditorUndoRedoButtons, FileItem, FolderItem, Footer, FooterLink, FormInput, FormattedJsonViewer, HomeBackgroundImage, HomeScreen, HomeScreenAddDriveItem, HomeScreenItem, INITIAL_SYNC, Icon, InspectorModal, InstalledPackagesPanel, IntegrityInspector, LoadingScreen, LogoAnimation, MISSING, Modal, ModalButton, NodeInput, ObjectInspectorModal, PackageInstallModal, PackageList, PackageManager, PackageManagerListItem, PackagePanelScrollArea, PackageRegistryError, PackageSubSection, PeerAgreementPanel, PowerhouseButton, ProcessorsInspector, ProjectLoaderImage, QueueInspector, ReadRequiredModal, RemotesInspector, RenownLoginMethods, RevisionHistory, SUCCESS, SYNCING, SettingsModal, SidebarAddDriveItem, SidebarItem, SidebarLogin, SidebarUser, SyncStatusIcon, TabContent, Tabs, ThemeSwitch, Toggle, ToolbarButton, ToolbarCloseButton, ToolbarContainer, ToolbarControlsContainer, ToolbarDownloadButton, ToolbarHistoryButton, ToolbarInput, ToolbarName, ToolbarRedoButton, ToolbarSwitchboardButton, ToolbarUndoButton, UploadFileItem, UploadFileList, UploadFileListContainer, WorkerInspector, brandedDocumentIcon, debugNodeOptions, debugNodeOptionsMap, defaultDriveOptions, defaultNodeOptions, fileNodeDropdownOptions, folderNodeDropdownOptions, formatEthAddress, formatFileSize, generateId, getFolderStatus, getProjectLoader, locationInfoByLocation, mapProgressStageToStatus, mapUploadsToFileItems, nodeOptions, normalNodeOptions, peerManifestLabel, removeSuccessFiles, sharingTypeOptions, sortFilesByStatus, syncStatuses, useBaseReducer3UndoRedo, useConnectBranding, useEns, useWindowSize, verifyPackageJsonFields };
9641
9189
 
9642
9190
  //# sourceMappingURL=index.js.map