@powerhousedao/design-system 6.2.3-dev.7 → 6.2.3-dev.71

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-xsC6R634.js +75 -0
  8. package/dist/add-local-drive-form.impl-xsC6R634.js.map +1 -0
  9. package/dist/add-remote-drive-form.impl-B2DxdWGF.js +114 -0
  10. package/dist/add-remote-drive-form.impl-B2DxdWGF.js.map +1 -0
  11. package/dist/address-DfZqD6IM.js +92 -0
  12. package/dist/address-DfZqD6IM.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-BIhO-KB2.d.ts} +4 -4
  18. package/dist/checkbox-BIhO-KB2.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-EqgAawKJ.js +144 -0
  22. package/dist/combobox.impl-EqgAawKJ.js.map +1 -0
  23. package/dist/{command-tFzjgzge.d.ts → command-DHHTsHfH.d.ts} +5 -5
  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 +514 -364
  30. package/dist/connect/index.d.ts.map +1 -1
  31. package/dist/connect/index.js +963 -1605
  32. package/dist/connect/index.js.map +1 -1
  33. package/dist/{content-BHWIqmio.d.ts → content-Ch3oDYCL.d.ts} +3 -3
  34. package/dist/content-Ch3oDYCL.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-CCkyXpt5.js +254 -0
  38. package/dist/document-timeline.impl-CCkyXpt5.js.map +1 -0
  39. package/dist/drive-settings-form.impl-Bwam9-CG.js +171 -0
  40. package/dist/drive-settings-form.impl-Bwam9-CG.js.map +1 -0
  41. package/dist/{enum-field-CwZVs3Ux.d.ts → enum-field-DsyC0ml7.d.ts} +4 -4
  42. package/dist/enum-field-DsyC0ml7.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-DadZ5uvb.js +58 -0
  56. package/dist/formatted-json-viewer.impl-DadZ5uvb.js.map +1 -0
  57. package/dist/icon-CHR45tj_.js +358 -0
  58. package/dist/icon-CHR45tj_.js.map +1 -0
  59. package/dist/{icon-C4QOpsdI.js → icon-components-CJ4I3Y6Y.js} +7 -481
  60. package/dist/icon-components-CJ4I3Y6Y.js.map +1 -0
  61. package/dist/{id-autocomplete-C-hwriS5.d.ts → id-autocomplete-Cr7p129s.d.ts} +3 -3
  62. package/dist/id-autocomplete-Cr7p129s.d.ts.map +1 -0
  63. package/dist/{id-autocomplete-input-container-DFEyPh5p.d.ts → id-autocomplete-input-container-iTw9wYZn.d.ts} +3 -3
  64. package/dist/id-autocomplete-input-container-iTw9wYZn.d.ts.map +1 -0
  65. package/dist/{id-autocomplete-list-EzLpF23C.d.ts → id-autocomplete-list-BIC3RxOp.d.ts} +3 -3
  66. package/dist/id-autocomplete-list-BIC3RxOp.d.ts.map +1 -0
  67. package/dist/{id-autocomplete-list-option-CB5B07Hi.d.ts → id-autocomplete-list-option-DlpZer-2.d.ts} +4 -3
  68. package/dist/id-autocomplete-list-option-DlpZer-2.d.ts.map +1 -0
  69. package/dist/index-C-Tup7Br.d.ts +4 -0
  70. package/dist/{index--hDSfvJT.d.ts → index-Ck34z7kD.d.ts} +23 -59
  71. package/dist/index-Ck34z7kD.d.ts.map +1 -0
  72. package/dist/index-D6Zk5OLV.d.ts +4 -0
  73. package/dist/index-Ds9-qjjC.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-0-cC_e65.d.ts} +5 -6
  94. package/dist/radio-group-field-0-cC_e65.d.ts.map +1 -0
  95. package/dist/revision-history.impl-CrtSnhXQ.js +642 -0
  96. package/dist/revision-history.impl-CrtSnhXQ.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-VZPf666l.d.ts} +5 -5
  100. package/dist/select-field-VZPf666l.d.ts.map +1 -0
  101. package/dist/{selected-content-CGsK5PR4.d.ts → selected-content-D6NWiceG.d.ts} +3 -3
  102. package/dist/selected-content-D6NWiceG.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-Bkoi0Odc.d.ts +11 -0
  108. package/dist/splitted-input-diff-Bkoi0Odc.d.ts.map +1 -0
  109. package/dist/{src-CVV6HzQZ.js → src-CohvVFnR.js} +178 -22
  110. package/dist/src-CohvVFnR.js.map +1 -0
  111. package/dist/style.css +3 -6
  112. package/dist/text-field-CDYSwanK.d.ts +9 -0
  113. package/dist/text-field-CDYSwanK.d.ts.map +1 -0
  114. package/dist/{text-input-8zXIWHLi.d.ts → text-input-CFRCPYq6.d.ts} +5 -6
  115. package/dist/text-input-CFRCPYq6.d.ts.map +1 -0
  116. package/dist/text-input-diff-BgJAxPQV.d.ts +12 -0
  117. package/dist/text-input-diff-BgJAxPQV.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-WH2ROfQn.d.ts} +5 -16
  339. package/dist/use-id-autocomplete-WH2ROfQn.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-Cg5TEYP2.d.ts} +5 -7
  343. package/dist/value-transformer-Cg5TEYP2.d.ts.map +1 -0
  344. package/dist/{with-field-validation-Di5D8vU-.d.ts → with-field-validation-CObZoT4r.d.ts} +3 -3
  345. package/dist/with-field-validation-CObZoT4r.d.ts.map +1 -0
  346. package/package.json +17 -12
  347. package/plugins.css +6 -0
  348. package/tailwind.css +175 -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-tFzjgzge.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-CohvVFnR.js";
2
+ import { n as getDimensions, t as Icon } from "../icon-CHR45tj_.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-DfZqD6IM.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, 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 } 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-EqgAawKJ.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
  })
@@ -1835,284 +2097,21 @@ function DocumentStateViewer({ state, ignoredScopes = ["auth", "document"], defa
1835
2097
  className: "text-sm text-muted-foreground",
1836
2098
  children: "No state data"
1837
2099
  });
1838
- return /* @__PURE__ */ jsx(Tabs, {
1839
- defaultValue: formatScopeLabel(initialScope),
1840
- children: scopes.map((scope) => /* @__PURE__ */ jsx(TabContent, {
1841
- label: formatScopeLabel(scope),
1842
- description: scope,
1843
- children: /* @__PURE__ */ jsx("div", {
1844
- className: twMerge("-mt-2 rounded-md border border-border bg-background p-3 font-mono text-sm", className),
1845
- children: /* @__PURE__ */ jsx(JsonViewer, { data: state[scope] })
1846
- })
1847
- }, scope))
1848
- });
1849
- }
1850
- //#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
- //#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
- };
2100
+ return /* @__PURE__ */ jsx(Tabs, {
2101
+ defaultValue: formatScopeLabel(initialScope),
2102
+ children: scopes.map((scope) => /* @__PURE__ */ jsx(TabContent, {
2103
+ label: formatScopeLabel(scope),
2104
+ description: scope,
2105
+ children: /* @__PURE__ */ jsx("div", {
2106
+ className: twMerge("-mt-2 rounded-md border border-border bg-background p-3 font-mono text-sm", className),
2107
+ children: /* @__PURE__ */ jsx(JsonViewer, { data: state[scope] })
2108
+ })
2109
+ }, scope))
2110
+ });
2111
+ }
2112
+ //#endregion
2113
+ //#region src/connect/components/document-timeline/document-timeline.tsx
2114
+ const DocumentTimeline = lazyComponent(() => import("../document-timeline.impl-CCkyXpt5.js").then((m) => m.DocumentTimeline));
2116
2115
  //#endregion
2117
2116
  //#region src/connect/components/document-toolbar/containers.tsx
2118
2117
  /**
@@ -2239,12 +2238,11 @@ function ToolbarRedoButton(props) {
2239
2238
  }) } = props;
2240
2239
  const { redo, canRedo } = useRedo(document?.header.id);
2241
2240
  const onClick = makeOnClick(document, onClickOverride, redo);
2242
- const disabled = !canRedo;
2243
2241
  return /* @__PURE__ */ jsx(ToolbarButton, {
2244
2242
  "data-testid": "toolbar-redo-button",
2245
2243
  "aria-label": "Redo",
2246
2244
  className,
2247
- disabled,
2245
+ disabled: !canRedo,
2248
2246
  onClick,
2249
2247
  children
2250
2248
  });
@@ -2315,7 +2313,8 @@ function ToolbarHistoryButton(props) {
2315
2313
  /**
2316
2314
  * Toolbar control for closing the current document view.
2317
2315
  *
2318
- * By default, this selects the current document's parent folder. Provide
2316
+ * By default, this goes back when the app's history allows, else it selects the
2317
+ * current document's parent folder. Provide
2319
2318
  * `children` to replace the default icon, or `onClick` to override the default
2320
2319
  * close behavior.
2321
2320
  */
@@ -2324,8 +2323,7 @@ function ToolbarCloseButton(props) {
2324
2323
  name: "XmarkLight",
2325
2324
  size: 16
2326
2325
  }) } = props;
2327
- const parentFolder = useNodeParentFolderById(document?.header.id);
2328
- const onClick = makeOnClick(document, onClickOverride, () => setSelectedNode(parentFolder));
2326
+ const onClick = makeOnClick(document, onClickOverride, useCloseNode(document?.header.id));
2329
2327
  return /* @__PURE__ */ jsx(ToolbarButton, {
2330
2328
  "data-testid": "toolbar-close-button",
2331
2329
  "aria-label": "Close document",
@@ -2860,7 +2858,7 @@ function UploadFileItemStatusRow(props) {
2860
2858
  }
2861
2859
  //#endregion
2862
2860
  //#region src/connect/components/upload-file-item/upload-file-item.tsx
2863
- const UploadFileItem = /* @__PURE__ */ forwardRef(function UploadFileItem(props, ref) {
2861
+ const UploadFileItem = /*#__PURE__*/ forwardRef(function UploadFileItem(props, ref) {
2864
2862
  const { fileName, fileSize, status, documentType, progress = 0, errorDetails, onClose, onOpenDocument, onFindResolution, className, ...delegatedProps } = props;
2865
2863
  return /* @__PURE__ */ jsxs("div", {
2866
2864
  ref,
@@ -3100,7 +3098,7 @@ function uploadsReducer(state, action) {
3100
3098
  }
3101
3099
  }
3102
3100
  function useUploadTracker(useLocalStorage = false, driveId) {
3103
- const [uploads, dispatch] = useReducer(uploadsReducer, useCallback(() => {
3101
+ const getInitialState = useCallback(() => {
3104
3102
  if (useLocalStorage && driveId) try {
3105
3103
  const stored = localStorage.getItem(`uploadTracker_${driveId}`);
3106
3104
  if (stored) return JSON.parse(stored);
@@ -3110,7 +3108,8 @@ function useUploadTracker(useLocalStorage = false, driveId) {
3110
3108
  return {};
3111
3109
  }
3112
3110
  return {};
3113
- }, [useLocalStorage, driveId])());
3111
+ }, [useLocalStorage, driveId]);
3112
+ const [uploads, dispatch] = useReducer(uploadsReducer, getInitialState());
3114
3113
  useEffect(() => {
3115
3114
  if (useLocalStorage && driveId) try {
3116
3115
  localStorage.setItem(`uploadTracker_${driveId}`, JSON.stringify(uploads));
@@ -3152,11 +3151,12 @@ function useUploadTracker(useLocalStorage = false, driveId) {
3152
3151
  });
3153
3152
  };
3154
3153
  try {
3154
+ const fileNode = await onAddFile(file, parent, progressCallback);
3155
3155
  dispatch({
3156
3156
  type: "SET_FILE_NODE",
3157
3157
  payload: {
3158
3158
  id: fileId,
3159
- fileNode: await onAddFile(file, parent, progressCallback) || void 0
3159
+ fileNode: fileNode || void 0
3160
3160
  }
3161
3161
  });
3162
3162
  } catch (error) {
@@ -3262,6 +3262,7 @@ function DropZone(props) {
3262
3262
  setConflictUploadId(null);
3263
3263
  };
3264
3264
  const { isDropTarget, ...dropProps } = useDropFile(handleAddFile);
3265
+ const setSelectedNode = useSetSelectedNode();
3265
3266
  return /* @__PURE__ */ jsxs("div", {
3266
3267
  className: twMerge("relative", className),
3267
3268
  ...enable ? dropProps : {},
@@ -3429,22 +3430,32 @@ function EditorUndoRedoButtons(props) {
3429
3430
  });
3430
3431
  }
3431
3432
  //#endregion
3432
- //#region assets/powerhouse-rounded.png
3433
- 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";
3434
- //#endregion
3435
- //#region src/connect/components/ens-avatar/ens-avatar.tsx
3436
- function ENSAvatar(props) {
3437
- const { avatarUrl = powerhouse_rounded_default, size = "14px" } = props;
3438
- return /* @__PURE__ */ jsx("img", {
3439
- alt: "ENS Avatar",
3440
- className: "flex-none rounded-full object-contain",
3441
- src: avatarUrl,
3442
- style: {
3443
- width: size,
3444
- height: size
3445
- }
3433
+ //#region src/connect/components/branding/connect-branding.tsx
3434
+ /**
3435
+ * Connect's branding as the components see it: the host app provides it once
3436
+ * at its root (images already resolved to data URIs) and the components read
3437
+ * it from here instead of reaching into configuration. `icons` are the drive
3438
+ * explorer's, which the generic plugin owns; `appName`, `icon` and
3439
+ * `homeBackground` are Connect's identity (`connect.branding`). Without a
3440
+ * provider every built-in icon renders.
3441
+ */
3442
+ const ConnectBrandingContext = /*#__PURE__*/ createContext({});
3443
+ function ConnectBrandingProvider(props) {
3444
+ return /* @__PURE__ */ jsx(ConnectBrandingContext.Provider, {
3445
+ value: props.branding ?? {},
3446
+ children: props.children
3446
3447
  });
3447
3448
  }
3449
+ /** The provided branding; `{}` (built-in look) without a provider. */
3450
+ function useConnectBranding() {
3451
+ return useContext(ConnectBrandingContext);
3452
+ }
3453
+ /** The icon for a document of `documentType`: the explorer's icon for that
3454
+ * type, else its default document icon, else undefined (the icon the package
3455
+ * ships, or the built-in one). */
3456
+ function brandedDocumentIcon(branding, documentType) {
3457
+ return branding.icons?.documents?.[documentType] ?? branding.icons?.document ?? void 0;
3458
+ }
3448
3459
  //#endregion
3449
3460
  //#region src/connect/constants/options.tsx
3450
3461
  const defaultDriveOptions = [
@@ -3675,6 +3686,11 @@ function getDriveSharingType$1(drive) {
3675
3686
  }
3676
3687
  function FileItem(props) {
3677
3688
  const { fileNode, className, customDocumentIconSrc } = props;
3689
+ const setSelectedNode = useSetSelectedNode();
3690
+ const preloadNode = usePreloadNode();
3691
+ const target = useNodeTarget(fileNode);
3692
+ const link = useLinkProps(target, () => setSelectedNode(fileNode));
3693
+ const href = props.href ?? (target ? link.href : void 0);
3678
3694
  const [mode, setMode] = useState("READ");
3679
3695
  const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState(false);
3680
3696
  const [selectedDrive] = useSelectedDriveSafe();
@@ -3685,9 +3701,12 @@ function FileItem(props) {
3685
3701
  });
3686
3702
  const { isAllowedToCreateDocuments } = useUserPermissions();
3687
3703
  const editorModules = useEditorModulesForDocumentType(fileNode.documentType);
3688
- const preloadEditors = () => editorModules?.forEach((editorModule) => {
3689
- preloadEditorModule(editorModule);
3690
- });
3704
+ const preload = () => {
3705
+ editorModules?.forEach((editorModule) => {
3706
+ preloadEditorModule(editorModule);
3707
+ });
3708
+ preloadNode(fileNode);
3709
+ };
3691
3710
  const { onRenameNode, onRenameDriveNodes, onDuplicateNode } = useNodeActions();
3692
3711
  const downloadDocument = useDownloadDocument(fileNode.id);
3693
3712
  const isReadMode = mode === "READ";
@@ -3718,13 +3737,15 @@ function FileItem(props) {
3718
3737
  handler();
3719
3738
  setIsDropdownMenuOpen(false);
3720
3739
  }
3740
+ const branding = useConnectBranding();
3741
+ const documentIconSrc = customDocumentIconSrc ?? brandedDocumentIcon(branding, fileNode.documentType);
3721
3742
  const iconNode = /* @__PURE__ */ jsxs("div", {
3722
3743
  className: "relative",
3723
- children: [customDocumentIconSrc ? /* @__PURE__ */ jsx("img", {
3744
+ children: [documentIconSrc ? /* @__PURE__ */ jsx("img", {
3724
3745
  alt: "file icon",
3725
- className: "max-w-none",
3746
+ className: "max-w-none object-contain",
3726
3747
  height: 34,
3727
- src: customDocumentIconSrc,
3748
+ src: documentIconSrc,
3728
3749
  width: 32,
3729
3750
  draggable: false
3730
3751
  }) : /* @__PURE__ */ jsx(DefaultFileIcon, {}), isReadMode && syncStatus && /* @__PURE__ */ jsx("div", {
@@ -3758,6 +3779,7 @@ function FileItem(props) {
3758
3779
  children: /* @__PURE__ */ jsx("button", {
3759
3780
  className: twMerge("hidden group-hover:block", isDropdownMenuOpen && "block"),
3760
3781
  onClick: (e) => {
3782
+ e.preventDefault();
3761
3783
  e.stopPropagation();
3762
3784
  setIsDropdownMenuOpen(true);
3763
3785
  },
@@ -3773,10 +3795,15 @@ function FileItem(props) {
3773
3795
  onCancel,
3774
3796
  onSubmit
3775
3797
  });
3776
- return /* @__PURE__ */ jsx("div", {
3777
- className: "relative w-64",
3778
- onClick: isReadMode ? () => setSelectedNode(fileNode) : void 0,
3779
- onMouseEnter: preloadEditors,
3798
+ const isLink = isReadMode && !!href;
3799
+ return /* @__PURE__ */ jsx(isLink ? "a" : "div", {
3800
+ href: isLink ? href : void 0,
3801
+ "aria-current": isLink ? link["aria-current"] : void 0,
3802
+ className: "relative block w-64",
3803
+ onClick: isLink ? link.onClick : isReadMode ? () => setSelectedNode(fileNode) : void 0,
3804
+ onMouseEnter: preload,
3805
+ onTouchStart: preload,
3806
+ onFocus: preload,
3780
3807
  ...dragProps,
3781
3808
  children: /* @__PURE__ */ jsx("div", {
3782
3809
  className: containerStyles,
@@ -3902,6 +3929,12 @@ function DefaultFileIcon() {
3902
3929
  //#region src/connect/components/folder-item/folder-item.tsx
3903
3930
  function FolderItem(props) {
3904
3931
  const { folderNode, className } = props;
3932
+ const folderIconSrc = useConnectBranding().icons?.folder;
3933
+ const setSelectedNode = useSetSelectedNode();
3934
+ const preloadNode = usePreloadNode();
3935
+ const target = useNodeTarget(folderNode);
3936
+ const link = useLinkProps(target, () => setSelectedNode(folderNode));
3937
+ const href = props.href ?? (target ? link.href : void 0);
3905
3938
  const { isAllowedToCreateDocuments } = useUserPermissions();
3906
3939
  const [mode, setMode] = useState("READ");
3907
3940
  const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState(false);
@@ -3949,9 +3982,15 @@ function FolderItem(props) {
3949
3982
  onSubmit
3950
3983
  });
3951
3984
  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);
3952
- return /* @__PURE__ */ jsx("div", {
3953
- className: "relative w-64 hover:hover-effect",
3954
- onClick: isReadMode ? () => setSelectedNode(folderNode) : void 0,
3985
+ const isLink = isReadMode && !!href;
3986
+ return /* @__PURE__ */ jsx(isLink ? "a" : "div", {
3987
+ href: isLink ? href : void 0,
3988
+ "aria-current": isLink ? link["aria-current"] : void 0,
3989
+ className: "relative block w-64 hover:hover-effect",
3990
+ onClick: isLink ? link.onClick : isReadMode ? () => setSelectedNode(folderNode) : void 0,
3991
+ onMouseEnter: () => preloadNode(folderNode),
3992
+ onTouchStart: () => preloadNode(folderNode),
3993
+ onFocus: () => preloadNode(folderNode),
3955
3994
  children: /* @__PURE__ */ jsxs("div", {
3956
3995
  ...dragProps,
3957
3996
  ...dropProps,
@@ -3962,7 +4001,14 @@ function FolderItem(props) {
3962
4001
  className: "p-1",
3963
4002
  children: /* @__PURE__ */ jsx("div", {
3964
4003
  className: "relative text-foreground",
3965
- children: /* @__PURE__ */ jsx(Icon, {
4004
+ children: folderIconSrc ? /* @__PURE__ */ jsx("img", {
4005
+ alt: "folder icon",
4006
+ className: "object-contain",
4007
+ src: folderIconSrc,
4008
+ width: 24,
4009
+ height: 24,
4010
+ draggable: false
4011
+ }) : /* @__PURE__ */ jsx(Icon, {
3966
4012
  name: "FolderClose",
3967
4013
  size: 24
3968
4014
  })
@@ -3976,6 +4022,7 @@ function FolderItem(props) {
3976
4022
  children: /* @__PURE__ */ jsx("button", {
3977
4023
  className: twMerge("ml-auto hidden group-hover:block", isDropdownMenuOpen && "block"),
3978
4024
  onClick: (e) => {
4025
+ e.preventDefault();
3979
4026
  e.stopPropagation();
3980
4027
  setIsDropdownMenuOpen(true);
3981
4028
  },
@@ -4008,7 +4055,7 @@ const Footer = ({ children, className, ...props }) => {
4008
4055
  };
4009
4056
  //#endregion
4010
4057
  //#region src/connect/components/form-input/form-input.tsx
4011
- const FormInput = /* @__PURE__ */ forwardRef(function FormInput(props, ref) {
4058
+ const FormInput = /*#__PURE__*/ forwardRef(function FormInput(props, ref) {
4012
4059
  const { icon, errorMessage, isDirty, containerClassName, inputClassName, errorMessageClassName, hideErrors = false, ...delegatedProps } = props;
4013
4060
  const type = props.type ?? "text";
4014
4061
  const isError = !!errorMessage;
@@ -4029,296 +4076,67 @@ const FormInput = /* @__PURE__ */ forwardRef(function FormInput(props, ref) {
4029
4076
  })] });
4030
4077
  });
4031
4078
  //#endregion
4032
- //#region src/connect/components/form/inputs/app-form-input.tsx
4033
- function appToInputOption(app) {
4034
- return {
4035
- value: app.id,
4036
- displayValue: app.name,
4037
- icon: /* @__PURE__ */ jsx(Icon, { name: "PowerhouseLogoSmall" }),
4038
- description: "Built by Powerhouse"
4039
- };
4040
- }
4041
- function AppFormInput(props) {
4042
- const { control, appOptions, ...delegatedProps } = props;
4043
- const items = appOptions.map(appToInputOption);
4044
- return /* @__PURE__ */ jsx(Controller, {
4045
- control,
4046
- name: "id",
4047
- render: ({ field }) => /* @__PURE__ */ jsx(ConnectSelect, {
4048
- ...delegatedProps,
4049
- ...field,
4050
- id: "id",
4051
- items
4052
- })
4053
- });
4054
- }
4055
- //#endregion
4056
- //#region src/connect/components/form/inputs/label.tsx
4057
- function Label(props) {
4058
- const { children, className, ...labelProps } = props;
4059
- return /* @__PURE__ */ jsx("label", {
4060
- ...labelProps,
4061
- className: twMerge("block font-semibold text-muted-foreground", className),
4062
- children
4063
- });
4064
- }
4065
- //#endregion
4066
4079
  //#region src/connect/components/form/add-local-drive-form.tsx
4067
- function AddLocalDriveForm(props) {
4068
- const { register, handleSubmit, control, formState: { errors } } = useForm({ defaultValues: {
4069
- name: "",
4070
- sharingType: "LOCAL",
4071
- availableOffline: false,
4072
- id: props.appOptions[0].id
4073
- } });
4074
- return /* @__PURE__ */ jsx("form", {
4075
- name: "add-local-drive",
4076
- onSubmit: (e) => void handleSubmit(props.onSubmit)(e),
4077
- className: "flex flex-col gap-4",
4078
- children: /* @__PURE__ */ jsxs("div", {
4079
- className: "flex flex-col gap-4",
4080
- children: [
4081
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Label, {
4082
- htmlFor: "name",
4083
- className: "text-sm font-medium text-foreground",
4084
- children: "Drive Name"
4085
- }), /* @__PURE__ */ jsx(FormInput, {
4086
- ...register("name", { required: "Drive name is required" }),
4087
- errorMessage: errors.name?.message,
4088
- placeholder: "Drive name"
4089
- })] }),
4090
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Label, {
4091
- htmlFor: "driveApp",
4092
- className: "text-sm font-medium text-foreground",
4093
- children: "Drive App"
4094
- }), /* @__PURE__ */ jsx(AppFormInput, {
4095
- control,
4096
- appOptions: props.appOptions
4097
- })] }),
4098
- /* @__PURE__ */ jsx(PowerhouseButton, {
4099
- className: "mt-2 w-full",
4100
- type: "submit",
4101
- children: "Create new drive"
4102
- })
4103
- ]
4104
- })
4105
- });
4106
- }
4107
- //#endregion
4108
- //#region src/connect/components/toggle/toggle.tsx
4109
- const Toggle = /* @__PURE__ */ forwardRef(function Toggle(props, ref) {
4110
- return /* @__PURE__ */ jsxs("label", {
4111
- className: "relative cursor-pointer items-center",
4112
- htmlFor: props.id,
4113
- children: [/* @__PURE__ */ jsx("input", {
4114
- className: "peer sr-only",
4115
- ref,
4116
- type: "checkbox",
4117
- value: "",
4118
- ...props
4119
- }), /* @__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" })]
4120
- });
4121
- });
4122
- //#endregion
4123
- //#region src/connect/components/form/inputs/available-offline-toggle.tsx
4124
- const AvailableOfflineToggle = /* @__PURE__ */ forwardRef(function AvailableOfflineToggle(props, ref) {
4125
- return /* @__PURE__ */ jsxs("div", {
4126
- className: "flex items-center rounded-md border border-border bg-background p-3 text-foreground",
4127
- children: [/* @__PURE__ */ jsxs("div", {
4128
- className: "flex-1",
4129
- children: [/* @__PURE__ */ jsx("label", {
4130
- className: "font-medium text-foreground",
4131
- htmlFor: "availableOffline",
4132
- children: "Make available offline"
4133
- }), /* @__PURE__ */ jsxs("p", {
4134
- className: "text-xs text-foreground",
4135
- children: [
4136
- "Check this options if you keep a local backup",
4137
- /* @__PURE__ */ jsx("br", {}),
4138
- "available at all times."
4139
- ]
4140
- })]
4141
- }), /* @__PURE__ */ jsx(Toggle, {
4142
- id: "availableOffline",
4143
- ref,
4144
- ...props
4145
- })]
4146
- });
4147
- });
4148
- //#endregion
4149
- //#region src/connect/components/form/inputs/drive-name.tsx
4150
- function DriveName(props) {
4151
- return /* @__PURE__ */ jsxs("div", {
4152
- className: "flex gap-2 rounded-xl bg-muted p-3 font-semibold text-muted-foreground",
4153
- children: [/* @__PURE__ */ jsx(Icon, {
4154
- className: "text-foreground",
4155
- name: "Drive"
4156
- }), props.driveName]
4157
- });
4158
- }
4159
- //#endregion
4160
- //#region src/connect/components/form/inputs/location-info.tsx
4161
- function LocationInfo(props) {
4162
- const { location, className, ...divProps } = props;
4163
- const locationInfo = locationInfoByLocation[location];
4164
- return /* @__PURE__ */ jsxs("div", {
4165
- ...divProps,
4166
- className: twMerge("my-3 flex items-center gap-2 rounded-xl border border-border bg-background p-3 text-foreground shadow-sm", className),
4167
- children: [locationInfo.icon, /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", { children: locationInfo.title }), /* @__PURE__ */ jsx("p", {
4168
- className: "text-xs text-foreground",
4169
- children: locationInfo.description
4170
- })] })]
4171
- });
4172
- }
4080
+ const AddLocalDriveForm = lazyComponent(() => import("../add-local-drive-form.impl-xsC6R634.js").then((m) => m.AddLocalDriveForm));
4173
4081
  //#endregion
4174
4082
  //#region src/connect/components/form/add-remote-drive-form.tsx
4175
- function AddRemoteDriveForm(props) {
4176
- const { sharingType = "PUBLIC", requestPublicDrive } = props;
4177
- const [remoteDriveDetails, setPublicDriveDetails] = useState();
4178
- const [showLocationSettings, setShowLocationSettings] = useState(false);
4179
- const [isUrlValid, setIsUrlValid] = useState(true);
4180
- const [hasConfirmedUrl, setHasConfirmedUrl] = useState(false);
4181
- const [errorMessage, setErrorMessage] = useState("");
4182
- const [url, setUrl] = useState("");
4183
- const [debouncedUrl, setDebouncedUrl] = useDebounceValue(url, 500);
4184
- const { register, handleSubmit, setValue } = useForm({
4185
- mode: "onBlur",
4186
- defaultValues: { availableOffline: remoteDriveDetails?.availableOffline ?? false }
4187
- });
4188
- useEffect(() => {
4189
- setDebouncedUrl(url);
4190
- }, [url]);
4191
- useEffect(() => {
4192
- setHasConfirmedUrl(false);
4193
- if (debouncedUrl === "") return;
4194
- fetchPublicDrive().catch(console.error);
4195
- async function fetchPublicDrive() {
4196
- try {
4197
- const { id, name } = await requestPublicDrive(debouncedUrl);
4198
- setPublicDriveDetails({
4199
- id,
4200
- name,
4201
- sharingType,
4202
- location: "SWITCHBOARD",
4203
- availableOffline: true
4204
- });
4205
- setValue("availableOffline", true);
4206
- setIsUrlValid(true);
4207
- setErrorMessage("");
4208
- } catch (error) {
4209
- setPublicDriveDetails(void 0);
4210
- setIsUrlValid(false);
4211
- setErrorMessage(error.message);
4212
- }
4213
- }
4214
- }, [
4215
- debouncedUrl,
4216
- setValue,
4217
- sharingType
4218
- ]);
4219
- function onSubmit({ availableOffline }) {
4220
- if (!remoteDriveDetails) return;
4221
- props.onSubmit({
4222
- ...remoteDriveDetails,
4223
- availableOffline,
4224
- url: debouncedUrl
4225
- });
4226
- }
4227
- return /* @__PURE__ */ jsx("form", {
4228
- onSubmit: (e) => void handleSubmit(onSubmit)(e),
4229
- children: hasConfirmedUrl ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
4230
- /* @__PURE__ */ jsx(DriveName, { driveName: remoteDriveDetails?.name ?? "New drive" }),
4231
- /* @__PURE__ */ jsx(Divider, { className: "my-3" }),
4232
- /* @__PURE__ */ jsxs(Disclosure, {
4233
- isOpen: showLocationSettings,
4234
- onOpenChange: () => setShowLocationSettings(!showLocationSettings),
4235
- title: "Location",
4236
- children: [/* @__PURE__ */ jsx(LocationInfo, { location: "SWITCHBOARD" }), /* @__PURE__ */ jsx(AvailableOfflineToggle, { ...register("availableOffline") })]
4237
- }),
4238
- /* @__PURE__ */ jsx(PowerhouseButton, {
4239
- className: "mt-4 w-full",
4240
- color: "dark",
4241
- type: "submit",
4242
- children: "Add new drive"
4243
- })
4244
- ] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FormInput, {
4245
- errorMessage,
4246
- onChange: (e) => setUrl(e.target.value),
4247
- placeholder: "Drive URL",
4248
- required: true,
4249
- type: "url",
4250
- value: url
4251
- }), /* @__PURE__ */ jsx(PowerhouseButton, {
4252
- className: "mt-4 w-full py-2 text-base",
4253
- color: "dark",
4254
- size: "small",
4255
- disabled: !isUrlValid || url === "",
4256
- onClick: (e) => {
4257
- e.preventDefault();
4258
- setHasConfirmedUrl(true);
4259
- },
4260
- type: "button",
4261
- children: "Add drive"
4262
- })] })
4263
- });
4264
- }
4083
+ const AddRemoteDriveForm = lazyComponent(() => import("../add-remote-drive-form.impl-B2DxdWGF.js").then((m) => m.AddRemoteDriveForm));
4265
4084
  //#endregion
4266
- //#region src/connect/components/formatted-json-viewer.tsx
4267
- function FormattedJsonViewer(props) {
4268
- const { theme } = useTheme();
4269
- return /* @__PURE__ */ jsxs(JsonView, {
4270
- displayDataTypes: false,
4271
- displayObjectSize: false,
4272
- style: theme === "light" ? lightTheme : darkTheme,
4273
- ...props,
4274
- children: [/* @__PURE__ */ jsx(JsonView.Copied, { render: ({ onClick, ...props }) => {
4275
- if (props["data-copied"]) return /* @__PURE__ */ jsx(Icon, {
4276
- ...props,
4277
- className: "inline-block text-success",
4278
- name: "FilesEarmark",
4279
- size: 16
4280
- });
4281
- return /* @__PURE__ */ jsx(Icon, {
4282
- ...props,
4283
- onClick,
4284
- className: "inline-block cursor-pointer text-foreground",
4285
- name: "FilesEarmark",
4286
- size: 16
4287
- });
4288
- } }), /* @__PURE__ */ jsx(JsonView.String, { render: ({ children, ...rest }, { value, keyName }) => {
4289
- if (isString(children) && isString(value) && isStrictEqual(children, value) && value.length > 30) return /* @__PURE__ */ jsx("span", {
4290
- ...rest,
4291
- className: "inline-grid",
4292
- children: /* @__PURE__ */ jsxs("span", {
4293
- className: "pl-[1ch] indent-[-1ch] wrap-anywhere hyphens-none",
4294
- style: { maxWidth: `${60 - keyName.toString().length}ch` },
4295
- children: [
4296
- "\"",
4297
- children,
4298
- "\""
4299
- ]
4300
- })
4301
- });
4302
- return /* @__PURE__ */ jsxs("span", {
4303
- ...rest,
4304
- children: [
4305
- "\"",
4306
- children,
4307
- "\""
4308
- ]
4309
- });
4310
- } })]
4311
- });
4085
+ //#region src/connect/components/branding/background-layers.tsx
4086
+ /**
4087
+ * A decorated pane: the configured page colour with the background's layers
4088
+ * painted over it, in order, and the children above them all. Each layer is
4089
+ * placed by the shared `layerStyle`, the same declarations the desktop
4090
+ * loading page emits as static CSS, so a background configured once looks
4091
+ * the same in both hosts. Images come resolved (data URIs or URLs); a
4092
+ * light/dark pair follows the `.dark` theme class, not the OS scheme.
4093
+ * Without a background the pane is the theme's page colour and nothing more.
4094
+ */
4095
+ function BackgroundLayers(props) {
4096
+ const background = normalizeBackground(props.background);
4097
+ const color = colorVariants(background?.color);
4098
+ const style = color ? {
4099
+ "--ph-pane-bg": color.light,
4100
+ "--ph-pane-bg-dark": color.dark ?? color.light
4101
+ } : void 0;
4102
+ return /* @__PURE__ */ jsxs("div", {
4103
+ className: twMerge("relative size-full overflow-hidden", color ? "bg-(--ph-pane-bg) dark:bg-(--ph-pane-bg-dark)" : "bg-background", props.className),
4104
+ style,
4105
+ children: [background?.layers.map((layer, index) => /* @__PURE__ */ jsx(BackgroundLayer, { layer }, index)), props.children]
4106
+ });
4107
+ }
4108
+ function BackgroundLayer({ layer }) {
4109
+ const { light, dark } = imageVariants(layer.src);
4110
+ const style = layerStyle(layer);
4111
+ if (!dark) return /* @__PURE__ */ jsx("img", {
4112
+ src: light,
4113
+ alt: "",
4114
+ style
4115
+ });
4116
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("img", {
4117
+ src: light,
4118
+ alt: "",
4119
+ style,
4120
+ className: "dark:hidden"
4121
+ }), /* @__PURE__ */ jsx("img", {
4122
+ src: dark,
4123
+ alt: "",
4124
+ style,
4125
+ className: "hidden dark:block"
4126
+ })] });
4312
4127
  }
4313
4128
  //#endregion
4314
4129
  //#region src/connect/components/home-screen/home-background-image.tsx
4130
+ /** The default home-screen gradient. A custom `src` is kept for callers that
4131
+ * still pass one, sized to its box; HomeScreen itself renders custom images
4132
+ * as a hero below the drive tiles instead. */
4315
4133
  const HomeBackgroundImage = ({ src } = {}) => {
4316
4134
  if (src) return /* @__PURE__ */ jsx("picture", {
4317
- className: "pointer-events-none absolute inset-8 z-0 size-[calc(100%-32px)] object-contain",
4135
+ className: "pointer-events-none absolute inset-8 z-0",
4318
4136
  children: /* @__PURE__ */ jsx("img", {
4319
4137
  src,
4320
- alt: "background",
4321
- className: "object-contain"
4138
+ alt: "",
4139
+ className: "size-full object-contain"
4322
4140
  })
4323
4141
  });
4324
4142
  return /* @__PURE__ */ jsx("div", {
@@ -4407,10 +4225,15 @@ const HomeBackgroundImage = ({ src } = {}) => {
4407
4225
  //#endregion
4408
4226
  //#region src/connect/components/home-screen/home-screen-item.tsx
4409
4227
  const HomeScreenItem = function HomeScreenItem(props) {
4410
- const { icon, title, description, containerClassName, shareable, onClick } = props;
4411
- return /* @__PURE__ */ jsxs("div", {
4228
+ const { icon, title, description, containerClassName, shareable, href, onClick, onPreload } = props;
4229
+ return /* @__PURE__ */ jsxs(href ? "a" : "div", {
4230
+ href,
4231
+ "aria-current": href ? props["aria-current"] : void 0,
4412
4232
  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"),
4413
4233
  onClick,
4234
+ onMouseEnter: onPreload,
4235
+ onTouchStart: onPreload,
4236
+ onFocus: href ? onPreload : void 0,
4414
4237
  children: [
4415
4238
  /* @__PURE__ */ jsx("div", {
4416
4239
  className: "mx-auto pb-2",
@@ -4460,14 +4283,20 @@ const HomeScreenAddDriveItem = function HomeScreenAddDriveItem(props) {
4460
4283
  //#endregion
4461
4284
  //#region src/connect/components/home-screen/home-screen.tsx
4462
4285
  const HomeScreen = function HomeScreen(props) {
4463
- const { children, containerClassName, homeBackground } = props;
4464
- return /* @__PURE__ */ jsx("div", {
4286
+ const { children, containerClassName } = props;
4287
+ const background = normalizeBackground(props.homeBackground);
4288
+ const content = /* @__PURE__ */ jsx("div", {
4465
4289
  className: twMerge("relative container mx-auto flex h-full flex-col", containerClassName),
4466
4290
  children: /* @__PURE__ */ jsxs("div", {
4467
- className: "m-8 flex flex-wrap justify-center gap-4 bg-background pt-12",
4468
- children: [/* @__PURE__ */ jsx(HomeBackgroundImage, { src: homeBackground ?? void 0 }), children]
4291
+ className: twMerge("m-8 flex flex-wrap justify-center gap-4 pt-12", background ? "rounded-2xl bg-background/75 px-6 pb-6 backdrop-blur-sm" : "bg-background"),
4292
+ children: [!background && /* @__PURE__ */ jsx(HomeBackgroundImage, {}), children]
4469
4293
  })
4470
4294
  });
4295
+ if (!background) return content;
4296
+ return /* @__PURE__ */ jsx(BackgroundLayers, {
4297
+ background,
4298
+ children: content
4299
+ });
4471
4300
  };
4472
4301
  //#endregion
4473
4302
  //#region src/connect/components/integrity-inspector/integrity-inspector.tsx
@@ -4490,7 +4319,8 @@ function IntegrityInspector({ onValidate, onRebuildKeyframes, onRebuildSnapshots
4490
4319
  clearResults();
4491
4320
  setStatus("running");
4492
4321
  try {
4493
- setValidationResult(await onValidate(documentId.trim(), branch.trim() || void 0));
4322
+ const result = await onValidate(documentId.trim(), branch.trim() || void 0);
4323
+ setValidationResult(result);
4494
4324
  setStatus("done");
4495
4325
  } catch (err) {
4496
4326
  setError(err instanceof Error ? err.message : String(err));
@@ -4507,7 +4337,8 @@ function IntegrityInspector({ onValidate, onRebuildKeyframes, onRebuildSnapshots
4507
4337
  clearResults();
4508
4338
  setStatus("running");
4509
4339
  try {
4510
- setRebuildResult(await onRebuildKeyframes(documentId.trim(), branch.trim() || void 0));
4340
+ const result = await onRebuildKeyframes(documentId.trim(), branch.trim() || void 0);
4341
+ setRebuildResult(result);
4511
4342
  setStatus("done");
4512
4343
  } catch (err) {
4513
4344
  setError(err instanceof Error ? err.message : String(err));
@@ -4524,7 +4355,8 @@ function IntegrityInspector({ onValidate, onRebuildKeyframes, onRebuildSnapshots
4524
4355
  clearResults();
4525
4356
  setStatus("running");
4526
4357
  try {
4527
- setRebuildResult(await onRebuildSnapshots(documentId.trim(), branch.trim() || void 0));
4358
+ const result = await onRebuildSnapshots(documentId.trim(), branch.trim() || void 0);
4359
+ setRebuildResult(result);
4528
4360
  setStatus("done");
4529
4361
  } catch (err) {
4530
4362
  setError(err instanceof Error ? err.message : String(err));
@@ -5102,165 +4934,8 @@ function ConnectDeleteItemModal(props) {
5102
4934
  });
5103
4935
  }
5104
4936
  //#endregion
5105
- //#region src/connect/components/form/inputs/drive-name-input.tsx
5106
- const DriveNameInput = /* @__PURE__ */ forwardRef(function DriveNameInput(props, ref) {
5107
- return /* @__PURE__ */ jsx(FormInput, {
5108
- ...props,
5109
- icon: props.icon ?? /* @__PURE__ */ jsx(Icon, { name: "Drive" }),
5110
- id: "driveName",
5111
- placeholder: "Drive name",
5112
- ref
5113
- });
5114
- });
5115
- //#endregion
5116
- //#region src/connect/components/form/inputs/delete-drive.tsx
5117
- function DeleteDrive(props) {
5118
- const { drive, handleDeleteDrive, onCancel } = props;
5119
- const [driveNameInput, setDriveNameInput] = useState("");
5120
- const isAllowedToDelete = driveNameInput === drive.header.name;
5121
- function deleteDrive() {
5122
- if (isAllowedToDelete) handleDeleteDrive();
5123
- }
5124
- return /* @__PURE__ */ jsxs("div", { children: [
5125
- /* @__PURE__ */ jsx("p", {
5126
- className: "mb-2 rounded-md bg-background p-4 text-center text-foreground",
5127
- children: "Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?"
5128
- }),
5129
- /* @__PURE__ */ jsx(DriveNameInput, {
5130
- icon: /* @__PURE__ */ jsx(Icon, { name: "Lock" }),
5131
- onChange: (event) => setDriveNameInput(event.target.value),
5132
- placeholder: "Enter drive name...",
5133
- value: driveNameInput
5134
- }),
5135
- /* @__PURE__ */ jsxs("div", {
5136
- className: "flex gap-3",
5137
- children: [/* @__PURE__ */ jsx(PowerhouseButton, {
5138
- className: "w-full",
5139
- color: "light",
5140
- onClick: onCancel,
5141
- children: "Cancel"
5142
- }), /* @__PURE__ */ jsx(PowerhouseButton, {
5143
- className: "w-full",
5144
- color: "red",
5145
- disabled: !isAllowedToDelete,
5146
- onClick: deleteDrive,
5147
- children: "Delete"
5148
- })]
5149
- })
5150
- ] });
5151
- }
5152
- //#endregion
5153
- //#region src/connect/components/form/inputs/sharing-type-form-input.tsx
5154
- function SharingTypeFormInput(props) {
5155
- const { control, ...delegatedProps } = props;
5156
- return /* @__PURE__ */ jsx(Controller, {
5157
- control,
5158
- name: "sharingType",
5159
- render: ({ field }) => /* @__PURE__ */ jsx(ConnectSelect, {
5160
- ...delegatedProps,
5161
- ...field,
5162
- id: "sharingType",
5163
- items: sharingTypeOptions
5164
- })
5165
- });
5166
- }
5167
- //#endregion
5168
4937
  //#region src/connect/components/form/drive-settings-form.tsx
5169
- function DriveSettingsForm(props) {
5170
- const { drive, sharingType, availableOffline, systemInfo, onSubmit, handleDeleteDrive } = props;
5171
- const name = drive.header.name;
5172
- const [showLocationSettings, setShowLocationSettings] = useState(false);
5173
- const [showAbout, setShowAbout] = useState(false);
5174
- const [showDangerZone, setShowDangerZone] = useState(false);
5175
- const [showDeleteDrive, setShowDeleteDrive] = useState(false);
5176
- const { register, handleSubmit, control } = useForm({
5177
- mode: "onBlur",
5178
- defaultValues: {
5179
- name,
5180
- sharingType,
5181
- availableOffline
5182
- }
5183
- });
5184
- const location = sharingType === "PUBLIC" ? "SWITCHBOARD" : sharingType;
5185
- return /* @__PURE__ */ jsxs("form", {
5186
- onSubmit: (e) => void handleSubmit(onSubmit)(e),
5187
- children: [
5188
- /* @__PURE__ */ jsx(DriveNameInput, { ...register("name") }),
5189
- /* @__PURE__ */ jsx(Divider, { className: "my-4" }),
5190
- /* @__PURE__ */ jsx(Label, {
5191
- htmlFor: "sharingType",
5192
- children: "Sharing settings"
5193
- }),
5194
- /* @__PURE__ */ jsx(SharingTypeFormInput, { control }),
5195
- /* @__PURE__ */ jsx(Divider, { className: "my-3" }),
5196
- /* @__PURE__ */ jsxs(Disclosure, {
5197
- isOpen: showLocationSettings,
5198
- onOpenChange: () => setShowLocationSettings(!showLocationSettings),
5199
- title: "Location",
5200
- children: [/* @__PURE__ */ jsx(LocationInfo, { location }), /* @__PURE__ */ jsx(AvailableOfflineToggle, { ...register("availableOffline") })]
5201
- }),
5202
- /* @__PURE__ */ jsx(Divider, { className: "my-3" }),
5203
- /* @__PURE__ */ jsxs(Disclosure, {
5204
- isOpen: showAbout,
5205
- onOpenChange: () => setShowAbout(!showAbout),
5206
- title: "About this drive",
5207
- children: [
5208
- systemInfo.status === "local" && /* @__PURE__ */ jsx("p", {
5209
- className: "py-2 text-sm text-muted-foreground",
5210
- children: "Local drive — N/A"
5211
- }),
5212
- systemInfo.status === "loading" && /* @__PURE__ */ jsx("p", {
5213
- className: "py-2 text-sm text-muted-foreground",
5214
- children: "Loading…"
5215
- }),
5216
- systemInfo.status === "error" && /* @__PURE__ */ jsx("p", {
5217
- className: "py-2 text-sm text-destructive",
5218
- children: "Could not load system info"
5219
- }),
5220
- systemInfo.status === "ready" && /* @__PURE__ */ jsxs("div", {
5221
- className: "py-2 text-sm text-foreground",
5222
- children: [/* @__PURE__ */ jsxs("div", { children: [
5223
- /* @__PURE__ */ jsx("span", {
5224
- className: "font-medium",
5225
- children: "Version:"
5226
- }),
5227
- " ",
5228
- systemInfo.version
5229
- ] }), /* @__PURE__ */ jsxs("div", { children: [
5230
- /* @__PURE__ */ jsx("span", {
5231
- className: "font-medium",
5232
- children: "Git hash:"
5233
- }),
5234
- " ",
5235
- systemInfo.gitHash
5236
- ] })]
5237
- })
5238
- ]
5239
- }),
5240
- /* @__PURE__ */ jsx(Divider, { className: "my-3" }),
5241
- /* @__PURE__ */ jsx(Disclosure, {
5242
- isOpen: showDangerZone,
5243
- onOpenChange: () => setShowDangerZone(!showDangerZone),
5244
- title: "Danger zone",
5245
- children: /* @__PURE__ */ jsxs("button", {
5246
- className: "flex gap-2 py-3 font-semibold text-destructive transition hover:hover-effect",
5247
- onClick: () => setShowDeleteDrive(true),
5248
- type: "button",
5249
- children: [/* @__PURE__ */ jsx(Icon, { name: "Trash" }), "Delete drive"]
5250
- })
5251
- }),
5252
- showDeleteDrive && showDangerZone ? /* @__PURE__ */ jsx(DeleteDrive, {
5253
- drive,
5254
- handleDeleteDrive,
5255
- onCancel: () => setShowDeleteDrive(false)
5256
- }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Divider, { className: "my-3" }), /* @__PURE__ */ jsx(PowerhouseButton, {
5257
- className: "mb-4 w-full",
5258
- type: "submit",
5259
- children: "Confirm"
5260
- })] })
5261
- ]
5262
- });
5263
- }
4938
+ const DriveSettingsForm = lazyComponent(() => import("../drive-settings-form.impl-Bwam9-CG.js").then((m) => m.DriveSettingsForm));
5264
4939
  //#endregion
5265
4940
  //#region src/connect/components/modal/drive-settings-modal.tsx
5266
4941
  function DriveSettingsModal(props) {
@@ -5487,7 +5162,8 @@ function ProcessorsInspector({ getProcessors, onRetry }) {
5487
5162
  const [error, setError] = useState(null);
5488
5163
  const loadProcessors = useCallback(async () => {
5489
5164
  try {
5490
- setProcessors(await getProcessors());
5165
+ const result = await getProcessors();
5166
+ setProcessors(result);
5491
5167
  setError(null);
5492
5168
  } catch (e) {
5493
5169
  setError(e instanceof Error ? e.message : String(e));
@@ -5517,9 +5193,10 @@ function ProcessorsInspector({ getProcessors, onRetry }) {
5517
5193
  }
5518
5194
  }, [onRetry, loadProcessors]);
5519
5195
  const handleSort = (columnKey) => {
5196
+ const newDirection = sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc";
5520
5197
  setSort({
5521
5198
  column: columnKey,
5522
- direction: sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc"
5199
+ direction: newDirection
5523
5200
  });
5524
5201
  };
5525
5202
  const sortedProcessors = sortProcessors(processors, sort);
@@ -5841,7 +5518,8 @@ function QueueInspector({ getQueueState, onPause, onResume }) {
5841
5518
  const [actionInProgress, setActionInProgress] = useState(false);
5842
5519
  const [selectedJob, setSelectedJob] = useState(null);
5843
5520
  const loadState = useCallback(async () => {
5844
- setState(await getQueueState());
5521
+ const newState = await getQueueState();
5522
+ setState(newState);
5845
5523
  setLoading(false);
5846
5524
  }, [getQueueState]);
5847
5525
  useEffect(() => {
@@ -5868,9 +5546,10 @@ function QueueInspector({ getQueueState, onPause, onResume }) {
5868
5546
  loadState
5869
5547
  ]);
5870
5548
  const handleSort = (columnKey) => {
5549
+ const newDirection = sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc";
5871
5550
  setSort({
5872
5551
  column: columnKey,
5873
- direction: sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc"
5552
+ direction: newDirection
5874
5553
  });
5875
5554
  };
5876
5555
  const sortedJobs = sortJobs([...state.executingJobs.map((job) => ({
@@ -6071,8 +5750,9 @@ const stateStyles = {
6071
5750
  disconnected: "bg-muted text-foreground"
6072
5751
  };
6073
5752
  function ConnectionStateBadge({ state, failureCount }) {
5753
+ const style = stateStyles[state] ?? "bg-muted text-foreground";
6074
5754
  return /* @__PURE__ */ jsxs("span", {
6075
- 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"),
5755
+ className: twMerge("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium", style),
6076
5756
  children: [state, failureCount > 0 && /* @__PURE__ */ jsxs("span", {
6077
5757
  className: "text-xs opacity-75",
6078
5758
  children: [
@@ -6722,6 +6402,175 @@ function ChannelInspector({ remoteName, channel, onBack, onRefresh, connectionSt
6722
6402
  });
6723
6403
  }
6724
6404
  //#endregion
6405
+ //#region src/connect/components/remotes-inspector/components/peer-agreement-panel.tsx
6406
+ const cell = "px-3 py-1.5 text-xs text-foreground";
6407
+ const head = "px-3 py-1.5 text-left text-xs font-medium text-foreground";
6408
+ function versions(list) {
6409
+ return list && list.length > 0 ? list.join(", ") : "none";
6410
+ }
6411
+ /** How a remote's peer announced itself. */
6412
+ function peerManifestLabel(peer) {
6413
+ if (peer === void 0) return "Not yet heard (baseline)";
6414
+ if (peer.manifest === null) return "Silent (baseline)";
6415
+ return `Announced, revision ${peer.manifest.revision.slice(0, 8)}`;
6416
+ }
6417
+ function PeerAgreementPanel({ remoteName, collectionId, peer, agreement, holds }) {
6418
+ const local = agreement.local();
6419
+ const theirs = agreement.peer(remoteName);
6420
+ const protocols = Object.keys(local.protocols).sort();
6421
+ const features = Object.keys(local.features).sort();
6422
+ return /* @__PURE__ */ jsxs("section", {
6423
+ "aria-label": "Peer agreement",
6424
+ className: "flex flex-col gap-2 rounded-lg border border-border p-3",
6425
+ children: [
6426
+ /* @__PURE__ */ jsxs("div", {
6427
+ className: "flex items-center justify-between",
6428
+ children: [/* @__PURE__ */ jsx("h3", {
6429
+ className: "text-sm font-semibold text-foreground",
6430
+ children: "Peer agreement"
6431
+ }), /* @__PURE__ */ jsx("span", {
6432
+ className: "text-xs text-muted-foreground",
6433
+ children: peerManifestLabel(peer)
6434
+ })]
6435
+ }),
6436
+ /* @__PURE__ */ jsxs("table", {
6437
+ className: "w-full border-collapse",
6438
+ children: [/* @__PURE__ */ jsx("thead", {
6439
+ className: "bg-muted",
6440
+ children: /* @__PURE__ */ jsxs("tr", { children: [
6441
+ /* @__PURE__ */ jsx("th", {
6442
+ className: head,
6443
+ children: "Protocol"
6444
+ }),
6445
+ /* @__PURE__ */ jsx("th", {
6446
+ className: head,
6447
+ children: "Local"
6448
+ }),
6449
+ /* @__PURE__ */ jsx("th", {
6450
+ className: head,
6451
+ children: "Peer"
6452
+ }),
6453
+ /* @__PURE__ */ jsx("th", {
6454
+ className: head,
6455
+ children: "Limits new documents"
6456
+ })
6457
+ ] })
6458
+ }), /* @__PURE__ */ jsxs("tbody", { children: [protocols.map((protocol) => {
6459
+ const limits = agreement.limitedBy(collectionId, protocol).includes(remoteName);
6460
+ return /* @__PURE__ */ jsxs("tr", {
6461
+ className: "odd:bg-card even:bg-background",
6462
+ children: [
6463
+ /* @__PURE__ */ jsx("td", {
6464
+ className: cell,
6465
+ children: protocol
6466
+ }),
6467
+ /* @__PURE__ */ jsx("td", {
6468
+ className: cell,
6469
+ children: versions(local.protocols[protocol])
6470
+ }),
6471
+ /* @__PURE__ */ jsx("td", {
6472
+ className: cell,
6473
+ children: versions(theirs.protocols[protocol])
6474
+ }),
6475
+ /* @__PURE__ */ jsx("td", {
6476
+ className: twMerge(cell, limits && "text-warning"),
6477
+ children: limits ? "Yes" : "No"
6478
+ })
6479
+ ]
6480
+ }, protocol);
6481
+ }), features.map((feature) => /* @__PURE__ */ jsxs("tr", {
6482
+ className: "odd:bg-card even:bg-background",
6483
+ children: [
6484
+ /* @__PURE__ */ jsxs("td", {
6485
+ className: cell,
6486
+ children: [feature, " (feature)"]
6487
+ }),
6488
+ /* @__PURE__ */ jsx("td", {
6489
+ className: cell,
6490
+ children: versions(local.features[feature])
6491
+ }),
6492
+ /* @__PURE__ */ jsx("td", {
6493
+ className: cell,
6494
+ children: versions(theirs.features[feature])
6495
+ }),
6496
+ /* @__PURE__ */ jsx("td", {
6497
+ className: cell,
6498
+ children: "-"
6499
+ })
6500
+ ]
6501
+ }, feature))] })]
6502
+ }),
6503
+ /* @__PURE__ */ jsxs("h4", {
6504
+ className: "text-xs font-semibold text-foreground",
6505
+ children: [
6506
+ "Held documents (",
6507
+ holds.length,
6508
+ ")"
6509
+ ]
6510
+ }),
6511
+ holds.length === 0 ? /* @__PURE__ */ jsx("p", {
6512
+ className: "text-xs text-muted-foreground",
6513
+ children: "No documents held"
6514
+ }) : /* @__PURE__ */ jsxs("table", {
6515
+ className: "w-full border-collapse",
6516
+ children: [/* @__PURE__ */ jsx("thead", {
6517
+ className: "bg-muted",
6518
+ children: /* @__PURE__ */ jsxs("tr", { children: [
6519
+ /* @__PURE__ */ jsx("th", {
6520
+ className: head,
6521
+ children: "Document"
6522
+ }),
6523
+ /* @__PURE__ */ jsx("th", {
6524
+ className: head,
6525
+ children: "Branch"
6526
+ }),
6527
+ /* @__PURE__ */ jsx("th", {
6528
+ className: head,
6529
+ children: "Requires"
6530
+ }),
6531
+ /* @__PURE__ */ jsx("th", {
6532
+ className: head,
6533
+ children: "Peer runs"
6534
+ }),
6535
+ /* @__PURE__ */ jsx("th", {
6536
+ className: head,
6537
+ children: "Held since"
6538
+ })
6539
+ ] })
6540
+ }), /* @__PURE__ */ jsx("tbody", { children: holds.map((hold) => /* @__PURE__ */ jsxs("tr", {
6541
+ className: "odd:bg-card even:bg-background",
6542
+ children: [
6543
+ /* @__PURE__ */ jsx("td", {
6544
+ className: cell,
6545
+ children: hold.documentId
6546
+ }),
6547
+ /* @__PURE__ */ jsx("td", {
6548
+ className: cell,
6549
+ children: hold.branch
6550
+ }),
6551
+ /* @__PURE__ */ jsxs("td", {
6552
+ className: cell,
6553
+ children: [
6554
+ hold.reason.protocol,
6555
+ " ",
6556
+ hold.reason.version
6557
+ ]
6558
+ }),
6559
+ /* @__PURE__ */ jsx("td", {
6560
+ className: cell,
6561
+ children: versions(hold.reason.peerSupports)
6562
+ }),
6563
+ /* @__PURE__ */ jsx("td", {
6564
+ className: cell,
6565
+ children: new Date(hold.heldAtUtcMs).toLocaleString()
6566
+ })
6567
+ ]
6568
+ }, `${hold.documentId}:${hold.branch}`)) })]
6569
+ })
6570
+ ]
6571
+ });
6572
+ }
6573
+ //#endregion
6725
6574
  //#region src/connect/components/remotes-inspector/remotes-inspector.tsx
6726
6575
  const BASE_COLUMNS = [
6727
6576
  {
@@ -6749,6 +6598,11 @@ const BASE_COLUMNS = [
6749
6598
  label: "Filter",
6750
6599
  width: "200px"
6751
6600
  },
6601
+ {
6602
+ key: "peer",
6603
+ label: "Peer",
6604
+ width: "160px"
6605
+ },
6752
6606
  {
6753
6607
  key: "channel",
6754
6608
  label: "Channel",
@@ -6795,7 +6649,7 @@ function sortRemotes(remotes, sort) {
6795
6649
  return sort.direction === "asc" ? comparison : -comparison;
6796
6650
  });
6797
6651
  }
6798
- function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPull, connectionStates }) {
6652
+ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPull, connectionStates, getAgreement, getHolds }) {
6799
6653
  const [remotes, setRemotes] = useState([]);
6800
6654
  const [loading, setLoading] = useState(true);
6801
6655
  const [sort, setSort] = useState();
@@ -6803,29 +6657,47 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
6803
6657
  const [manualUrl, setManualUrl] = useState("");
6804
6658
  const [adding, setAdding] = useState(false);
6805
6659
  const [addError, setAddError] = useState();
6660
+ const [holds, setHolds] = useState([]);
6806
6661
  const hasRowActions = !!removeRemote || !!triggerPull;
6807
6662
  const columns = useMemo(() => hasRowActions ? [...BASE_COLUMNS, ACTIONS_COLUMN] : BASE_COLUMNS, [hasRowActions]);
6808
6663
  const loadRemotes = useCallback(async () => {
6809
6664
  setLoading(true);
6810
- setRemotes(await getRemotes());
6665
+ const data = await getRemotes();
6666
+ setRemotes(data);
6811
6667
  setLoading(false);
6812
6668
  }, [getRemotes]);
6813
6669
  useEffect(() => {
6814
6670
  loadRemotes();
6815
6671
  }, [loadRemotes]);
6672
+ useEffect(() => {
6673
+ if (!selectedRemote || !getHolds) return;
6674
+ let current = true;
6675
+ getHolds(selectedRemote.meta.name).then((loaded) => {
6676
+ if (current) setHolds(loaded);
6677
+ }).catch(() => {
6678
+ if (current) setHolds([]);
6679
+ });
6680
+ return () => {
6681
+ current = false;
6682
+ };
6683
+ }, [selectedRemote, getHolds]);
6816
6684
  const handleRefresh = useCallback(async () => {
6817
6685
  await loadRemotes();
6818
- if (selectedRemote) setSelectedRemote(remotes.find((r) => r.meta.id === selectedRemote.meta.id));
6686
+ if (selectedRemote) {
6687
+ const updated = remotes.find((r) => r.meta.id === selectedRemote.meta.id);
6688
+ setSelectedRemote(updated);
6689
+ }
6819
6690
  }, [
6820
6691
  loadRemotes,
6821
6692
  selectedRemote,
6822
6693
  remotes
6823
6694
  ]);
6824
6695
  const handleSort = (columnKey) => {
6825
- if (columnKey === "channel" || columnKey === "actions" || columnKey === "status") return;
6696
+ if (columnKey === "channel" || columnKey === "actions" || columnKey === "status" || columnKey === "peer") return;
6697
+ const newDirection = sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc";
6826
6698
  setSort({
6827
6699
  column: columnKey,
6828
- direction: sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc"
6700
+ direction: newDirection
6829
6701
  });
6830
6702
  };
6831
6703
  const handleViewChannel = (remote) => {
@@ -6867,13 +6739,30 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
6867
6739
  const handlePull = useCallback((remote) => {
6868
6740
  triggerPull?.(remote.meta.name);
6869
6741
  }, [triggerPull]);
6870
- if (selectedRemote) return /* @__PURE__ */ jsx(ChannelInspector, {
6871
- channel: selectedRemote.channel,
6872
- connectionState: connectionStates?.get(selectedRemote.meta.name),
6873
- onBack: handleBack,
6874
- onRefresh: () => void handleRefresh(),
6875
- remoteName: selectedRemote.meta.name
6876
- });
6742
+ if (selectedRemote) {
6743
+ let agreement;
6744
+ try {
6745
+ agreement = getAgreement?.();
6746
+ } catch {
6747
+ agreement = void 0;
6748
+ }
6749
+ return /* @__PURE__ */ jsxs("div", {
6750
+ className: "flex h-full flex-col gap-2 overflow-auto",
6751
+ children: [agreement && /* @__PURE__ */ jsx(PeerAgreementPanel, {
6752
+ agreement,
6753
+ collectionId: selectedRemote.meta.collectionId.key,
6754
+ holds,
6755
+ peer: selectedRemote.meta.peer,
6756
+ remoteName: selectedRemote.meta.name
6757
+ }), /* @__PURE__ */ jsx(ChannelInspector, {
6758
+ channel: selectedRemote.channel,
6759
+ connectionState: connectionStates?.get(selectedRemote.meta.name),
6760
+ onBack: handleBack,
6761
+ onRefresh: () => void handleRefresh(),
6762
+ remoteName: selectedRemote.meta.name
6763
+ })]
6764
+ });
6765
+ }
6877
6766
  const sortedRemotes = sortRemotes(remotes, sort);
6878
6767
  return /* @__PURE__ */ jsxs("div", {
6879
6768
  className: "flex h-full flex-col gap-2",
@@ -6930,7 +6819,7 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
6930
6819
  children: /* @__PURE__ */ jsx("tr", { children: columns.map((column, index) => {
6931
6820
  const isActive = sort?.column === column.key;
6932
6821
  const sortDirection = isActive ? sort.direction : "asc";
6933
- const isSortable = column.key !== "channel" && column.key !== "actions" && column.key !== "status";
6822
+ const isSortable = column.key !== "channel" && column.key !== "actions" && column.key !== "status" && column.key !== "peer";
6934
6823
  return /* @__PURE__ */ jsx("th", {
6935
6824
  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"),
6936
6825
  onClick: () => isSortable && handleSort(column.key),
@@ -7000,6 +6889,13 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
7000
6889
  children: formatFilter(remote.meta.filter)
7001
6890
  })
7002
6891
  }),
6892
+ /* @__PURE__ */ jsx("td", {
6893
+ className: "border-l border-border px-3 py-2 text-xs text-foreground",
6894
+ children: /* @__PURE__ */ jsx("span", {
6895
+ className: "block truncate",
6896
+ children: peerManifestLabel(remote.meta.peer)
6897
+ })
6898
+ }),
7003
6899
  /* @__PURE__ */ jsx("td", {
7004
6900
  className: "border-l border-border px-3 py-2",
7005
6901
  children: /* @__PURE__ */ jsxs("button", {
@@ -7077,7 +6973,8 @@ function WorkerInspector({ getInfo, onRestart }) {
7077
6973
  const [restarting, setRestarting] = useState(false);
7078
6974
  const loadInfo = useCallback(async () => {
7079
6975
  try {
7080
- setInfo(await getInfo());
6976
+ const next = await getInfo();
6977
+ setInfo(next);
7081
6978
  setError(null);
7082
6979
  } catch (e) {
7083
6980
  setError(e instanceof Error ? e.message : String(e));
@@ -7172,7 +7069,7 @@ function InspectorUnavailable({ message }) {
7172
7069
  })]
7173
7070
  });
7174
7071
  }
7175
- function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExplorerProps, remotesInspectorProps, queueInspectorProps, processorsInspectorProps, integrityInspectorProps, workerInspectorProps, unavailableTabs, defaultTab = "Database" }) {
7072
+ function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExplorerProps, remotesInspectorProps, queueInspectorProps, processorsInspectorProps, integrityInspectorProps, catchUpInspectorProps, workerInspectorProps, unavailableTabs, defaultTab = "Database" }) {
7176
7073
  return /* @__PURE__ */ jsx(Modal, {
7177
7074
  ...modalProps,
7178
7075
  contentProps: {
@@ -7257,6 +7154,20 @@ function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExpl
7257
7154
  label: "Integrity",
7258
7155
  children: /* @__PURE__ */ jsx(InspectorUnavailable, { message: unavailableTabs.Integrity })
7259
7156
  }) : null,
7157
+ catchUpInspectorProps ? /* @__PURE__ */ jsx(TabContent, {
7158
+ description: "Catch-up inspector",
7159
+ label: "Catch-up",
7160
+ value: "CatchUp",
7161
+ children: /* @__PURE__ */ jsx("div", {
7162
+ className: "h-full",
7163
+ children: /* @__PURE__ */ jsx(CatchUpInspector, { ...catchUpInspectorProps })
7164
+ })
7165
+ }) : unavailableTabs?.CatchUp ? /* @__PURE__ */ jsx(TabContent, {
7166
+ description: "Catch-up inspector",
7167
+ label: "Catch-up",
7168
+ value: "CatchUp",
7169
+ children: /* @__PURE__ */ jsx(InspectorUnavailable, { message: unavailableTabs.CatchUp })
7170
+ }) : null,
7260
7171
  workerInspectorProps && /* @__PURE__ */ jsx(TabContent, {
7261
7172
  description: "Worker inspector",
7262
7173
  label: "Worker",
@@ -7380,10 +7291,12 @@ function ReadRequiredModal(props) {
7380
7291
  useEffect(() => {
7381
7292
  const checkScroll = () => {
7382
7293
  const element = contentRef.current;
7383
- if (element) if (element.scrollHeight > element.clientHeight) {
7384
- setDisableClose(true);
7385
- element.addEventListener("scroll", handleScroll);
7386
- } else setDisableClose(false);
7294
+ if (element) {
7295
+ if (element.scrollHeight > element.clientHeight) {
7296
+ setDisableClose(true);
7297
+ element.addEventListener("scroll", handleScroll);
7298
+ } else setDisableClose(false);
7299
+ }
7387
7300
  };
7388
7301
  const handleScroll = () => {
7389
7302
  const element = contentRef.current;
@@ -7649,28 +7562,8 @@ function LocalStorage(props) {
7649
7562
  }
7650
7563
  //#endregion
7651
7564
  //#region src/connect/components/modal/settings-modal-v2/default-editor.tsx
7652
- function DefaultEditor(props) {
7653
- const { className, ...rest } = props;
7654
- return /* @__PURE__ */ jsx("div", {
7655
- className: twMerge("rounded-lg bg-background p-3", className),
7656
- children: /* @__PURE__ */ jsx(DefaultEditorSelect, { ...rest })
7657
- });
7658
- }
7659
- function DefaultEditorSelect(props) {
7660
- const { documentModelEditor, setDocumentModelEditor, documentModelEditorOptions, className } = props;
7661
- return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
7662
- className: "mb-4 font-semibold text-foreground",
7663
- children: "Default Editor Selection"
7664
- }), /* @__PURE__ */ jsx(SelectFieldRaw, {
7665
- className: twMerge("max-w-fit min-w-36", className),
7666
- name: "default-editor",
7667
- required: true,
7668
- value: documentModelEditor,
7669
- options: documentModelEditorOptions,
7670
- multiple: false,
7671
- onChange: (value) => setDocumentModelEditor(value)
7672
- })] });
7673
- }
7565
+ const DefaultEditor = lazyComponent(() => import("../default-editor.impl-a6EOuEme.js").then((m) => m.DefaultEditor));
7566
+ const DefaultEditorSelect = lazyComponent(() => import("../default-editor.impl-a6EOuEme.js").then((m) => m.DefaultEditorSelect));
7674
7567
  //#endregion
7675
7568
  //#region src/connect/components/modal/settings-modal-v2/package-manager/parse-package-spec.ts
7676
7569
  /**
@@ -7896,6 +7789,7 @@ const VersionPicker = (props) => {
7896
7789
  className: "px-3 py-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase",
7897
7790
  children: "Tags"
7898
7791
  }), filteredTags.map(([tag, ver]) => {
7792
+ const isSelected = selected.kind === "tag" && selected.value === tag;
7899
7793
  return /* @__PURE__ */ jsxs("button", {
7900
7794
  type: "button",
7901
7795
  onClick: () => {
@@ -7906,7 +7800,7 @@ const VersionPicker = (props) => {
7906
7800
  setOpen(false);
7907
7801
  setQuery("");
7908
7802
  },
7909
- 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"),
7803
+ 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"),
7910
7804
  children: [/* @__PURE__ */ jsx("span", {
7911
7805
  className: "truncate text-foreground",
7912
7806
  children: tag
@@ -7927,6 +7821,7 @@ const VersionPicker = (props) => {
7927
7821
  className: "px-3 py-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase",
7928
7822
  children: "Versions"
7929
7823
  }), filteredVersions.map((ver) => {
7824
+ const isSelected = selected.kind === "version" && selected.value === ver;
7930
7825
  return /* @__PURE__ */ jsx("button", {
7931
7826
  type: "button",
7932
7827
  onClick: () => {
@@ -7937,7 +7832,7 @@ const VersionPicker = (props) => {
7937
7832
  setOpen(false);
7938
7833
  setQuery("");
7939
7834
  },
7940
- 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"),
7835
+ 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"),
7941
7836
  children: /* @__PURE__ */ jsxs("span", {
7942
7837
  className: "flex min-w-0 items-center gap-1.5 text-foreground",
7943
7838
  children: [/* @__PURE__ */ jsx("span", {
@@ -8086,6 +7981,14 @@ const PackageManagerListItem = (props) => {
8086
7981
  updateTarget
8087
7982
  ]
8088
7983
  }),
7984
+ registryPackage.sharedDepWarnings && registryPackage.sharedDepWarnings.length > 0 && /* @__PURE__ */ jsxs("span", {
7985
+ 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",
7986
+ title: registryPackage.sharedDepWarnings.join("\n"),
7987
+ children: [/* @__PURE__ */ jsx(Icon, {
7988
+ name: "Exclamation",
7989
+ size: 10
7990
+ }), "Shared deps out of date"]
7991
+ }),
8089
7992
  !(canPickVersion && hasVersionMetadata) && registryPackage.version && /* @__PURE__ */ jsxs("span", {
8090
7993
  className: "text-xs font-normal text-muted-foreground",
8091
7994
  children: ["v", registryPackage.version]
@@ -8129,7 +8032,8 @@ const PackageManagerListItem = (props) => {
8129
8032
  items: dropdownItems,
8130
8033
  onItemClick: (id) => {
8131
8034
  if (id === "install") {
8132
- onInstall(canPickVersion && hasVersionMetadata ? buildPackageSpec(registryPackage.name, selected.value) : registryPackage.name).catch(console.error);
8035
+ const spec = canPickVersion && hasVersionMetadata ? buildPackageSpec(registryPackage.name, selected.value) : registryPackage.name;
8036
+ onInstall(spec).catch(console.error);
8133
8037
  return;
8134
8038
  }
8135
8039
  if (id === "update") {
@@ -8597,619 +8501,8 @@ function ConnectUpgradeDriveModal(props) {
8597
8501
  });
8598
8502
  }
8599
8503
  //#endregion
8600
- //#region src/connect/components/revision-history/header/branch.tsx
8601
- function Branch(props) {
8602
- const { branch = "main" } = props;
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
- children: [
8606
- /* @__PURE__ */ jsx(Icon, { name: "Branch" }),
8607
- /* @__PURE__ */ jsx("span", { children: "BRANCH" }),
8608
- /* @__PURE__ */ jsx("span", {
8609
- className: "text-foreground",
8610
- children: branch
8611
- })
8612
- ]
8613
- });
8614
- }
8615
- //#endregion
8616
- //#region src/connect/components/revision-history/header/doc-id.tsx
8617
- function DocId(props) {
8618
- const { docId, onCopy } = props;
8619
- const [, copy] = useCopyToClipboard();
8620
- function handleCopy(text) {
8621
- return () => {
8622
- copy(text).then(() => {
8623
- onCopy?.();
8624
- }).catch((error) => {
8625
- console.error("Failed to copy!", error);
8626
- });
8627
- };
8628
- }
8629
- return /* @__PURE__ */ jsxs("button", {
8630
- className: "flex h-8 w-fit items-center gap-1 rounded-lg bg-background pr-2 pl-1 text-xs text-foreground",
8631
- onClick: handleCopy(docId),
8632
- children: [
8633
- /* @__PURE__ */ jsx(Icon, { name: "Link" }),
8634
- "DOC ID",
8635
- /* @__PURE__ */ jsx("span", {
8636
- className: "text-foreground",
8637
- children: docId
8638
- })
8639
- ]
8640
- });
8641
- }
8642
- //#endregion
8643
- //#region src/connect/components/revision-history/header/document-state.tsx
8644
- const DocumentState = (props) => {
8645
- const { documentState, onCopyState } = props;
8646
- const [, copy] = useCopyToClipboard();
8647
- function handleCopy() {
8648
- copy(JSON.stringify(documentState, null, 2)).then(() => {
8649
- onCopyState?.();
8650
- }).catch((error) => {
8651
- console.error("Failed to copy document state!", error);
8652
- });
8653
- }
8654
- return /* @__PURE__ */ jsx("button", {
8655
- className: "rounded-lg bg-background p-1 text-foreground",
8656
- onClick: handleCopy,
8657
- children: /* @__PURE__ */ jsx(Icon, { name: "CurlyBrackets" })
8658
- });
8659
- };
8660
- //#endregion
8661
- //#region src/connect/components/revision-history/header/scope.tsx
8662
- function Scope(props) {
8663
- const { value, onChange } = props;
8664
- return /* @__PURE__ */ jsx(ConnectSelect, {
8665
- absolutePositionMenu: true,
8666
- containerClassName: "z-10 w-fit rounded-lg bg-background text-xs text-muted-foreground",
8667
- id: "scope select",
8668
- itemClassName: "grid grid-cols-[auto,auto] gap-1 py-2 text-muted-foreground",
8669
- items: [{
8670
- displayValue: "Global scope",
8671
- value: "global"
8672
- }, {
8673
- displayValue: "Local scope",
8674
- value: "local"
8675
- }],
8676
- menuClassName: "min-w-0 text-muted-foreground",
8677
- onChange,
8678
- value
8679
- });
8680
- }
8681
- //#endregion
8682
- //#region src/connect/components/revision-history/header/header.tsx
8683
- function Header(props) {
8684
- const { title, docId, scope, onChangeScope, onClose, className, documentState, onCopyState, onCopyDocId, ...divProps } = props;
8685
- return /* @__PURE__ */ jsxs("header", {
8686
- className: twMerge("flex items-center justify-between bg-transparent", className),
8687
- ...divProps,
8688
- children: [/* @__PURE__ */ jsxs("div", {
8689
- className: "flex items-center gap-3",
8690
- children: [/* @__PURE__ */ jsx("button", {
8691
- name: "close-revision-history",
8692
- className: "rounded-lg bg-background p-1 text-foreground shadow-button",
8693
- onClick: onClose,
8694
- children: /* @__PURE__ */ jsx(Icon, { name: "VariantArrowLeft" })
8695
- }), /* @__PURE__ */ jsx("h1", {
8696
- className: "text-xs text-foreground",
8697
- children: title
8698
- })]
8699
- }), /* @__PURE__ */ jsxs("div", {
8700
- className: "flex items-center gap-2",
8701
- children: [
8702
- /* @__PURE__ */ jsx(DocId, {
8703
- docId,
8704
- onCopy: onCopyDocId
8705
- }),
8706
- documentState && /* @__PURE__ */ jsx(DocumentState, {
8707
- documentState,
8708
- onCopyState
8709
- }),
8710
- /* @__PURE__ */ jsx(Branch, {}),
8711
- /* @__PURE__ */ jsx(Scope, {
8712
- onChange: onChangeScope,
8713
- value: scope
8714
- })
8715
- ]
8716
- })]
8717
- });
8718
- }
8719
- //#endregion
8720
- //#region src/connect/hooks/use-ens.ts
8721
- const ensCache = /* @__PURE__ */ new Map();
8722
- function fetchEns(address) {
8723
- const cached = ensCache.get(address);
8724
- if (cached) return cached;
8725
- const promise = fetch(`https://api.ensdata.net/${address}`).then((res) => {
8726
- if (!res.ok) throw new Error(`ENS lookup failed: ${res.status}`);
8727
- return res.json();
8728
- }).catch((err) => {
8729
- ensCache.delete(address);
8730
- throw err instanceof Error ? err : /* @__PURE__ */ new Error("ENS lookup failed");
8731
- });
8732
- ensCache.set(address, promise);
8733
- return promise;
8734
- }
8735
- function useEns(address) {
8736
- const [data, setData] = useState();
8737
- const [isLoading, setIsLoading] = useState(false);
8738
- const [error, setError] = useState();
8739
- useEffect(() => {
8740
- if (!address) {
8741
- setData(void 0);
8742
- setError(void 0);
8743
- return;
8744
- }
8745
- let cancelled = false;
8746
- setIsLoading(true);
8747
- setError(void 0);
8748
- fetchEns(address).then((json) => {
8749
- if (cancelled) return;
8750
- setData(json);
8751
- }).catch((err) => {
8752
- if (cancelled) return;
8753
- setError(err instanceof Error ? err : /* @__PURE__ */ new Error("ENS lookup failed"));
8754
- }).finally(() => {
8755
- if (cancelled) return;
8756
- setIsLoading(false);
8757
- });
8758
- return () => {
8759
- cancelled = true;
8760
- };
8761
- }, [address]);
8762
- return {
8763
- data,
8764
- isLoading,
8765
- error
8766
- };
8767
- }
8768
- //#endregion
8769
- //#region src/connect/utils/address.ts
8770
- function formatEthAddress(address) {
8771
- return `${address.slice(0, 7)}...${address.slice(-5)}`;
8772
- }
8773
- //#endregion
8774
- //#region src/connect/components/code-popover.tsx
8775
- function CodePopover(props) {
8776
- const { content, trigger, anchor } = props;
8777
- const [isOpen, setIsOpen] = useState(false);
8778
- const opener = funnel(() => setIsOpen(true), {
8779
- triggerAt: "start",
8780
- minQuietPeriodMs: 300
8781
- });
8782
- const closer = funnel(() => setIsOpen(false), {
8783
- triggerAt: "start",
8784
- minQuietPeriodMs: 100
8785
- });
8786
- function open() {
8787
- closer.cancel();
8788
- opener.call();
8789
- }
8790
- function close() {
8791
- opener.cancel();
8792
- closer.call();
8793
- }
8794
- return /* @__PURE__ */ jsxs(Root$1, {
8795
- open: isOpen,
8796
- onOpenChange: (changedIsOpen) => changedIsOpen ? open() : close(),
8797
- children: [
8798
- /* @__PURE__ */ jsx(Trigger$1, {
8799
- onMouseEnter: open,
8800
- children: trigger
8801
- }),
8802
- !!anchor && /* @__PURE__ */ jsx(Anchor, {
8803
- asChild: true,
8804
- children: anchor
8805
- }),
8806
- /* @__PURE__ */ jsx(Portal$1, { children: /* @__PURE__ */ jsx(Content$1, {
8807
- forceMount: true,
8808
- onMouseLeave: close,
8809
- sideOffset: -28,
8810
- onCloseAutoFocus: (e) => e.preventDefault(),
8811
- collisionPadding: {
8812
- top: 24,
8813
- right: 24,
8814
- bottom: -1e4,
8815
- left: 24
8816
- },
8817
- className: "z-50 rounded-lg border border-border bg-popover p-2 text-xs text-popover-foreground shadow-tooltip outline-none",
8818
- children: content
8819
- }) })
8820
- ]
8821
- });
8822
- }
8823
- //#endregion
8824
- //#region src/connect/components/revision-history/revision/address.tsx
8825
- function Address(props) {
8826
- const { address, chainId } = props;
8827
- const { data: ensData } = useEns(address);
8828
- if (!address) return null;
8829
- const shortenedAddress = formatEthAddress(address);
8830
- return /* @__PURE__ */ jsx(CodePopover, {
8831
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, { value: { address } }),
8832
- trigger: /* @__PURE__ */ jsxs("span", {
8833
- className: "flex w-fit cursor-pointer items-center gap-1 rounded-lg bg-muted p-1 text-xs text-muted-foreground",
8834
- children: [/* @__PURE__ */ jsx(ENSAvatar, {
8835
- address,
8836
- chainId,
8837
- avatarUrl: ensData?.avatar_url ?? void 0
8838
- }), shortenedAddress]
8839
- })
8840
- });
8841
- }
8842
- //#endregion
8843
- //#region src/connect/components/revision-history/revision/errors.tsx
8844
- function Errors(props) {
8845
- const { errors } = props;
8846
- const hasErrors = !!errors?.length;
8847
- const color = hasErrors ? "text-destructive" : "text-success";
8848
- const icon = hasErrors ? /* @__PURE__ */ jsx(Icon, {
8849
- name: "Exclamation",
8850
- size: 16
8851
- }) : /* @__PURE__ */ jsx(Icon, {
8852
- name: "Check",
8853
- size: 16
8854
- });
8855
- const text = hasErrors ? `Error: ${errors[0]}` : "No errors";
8856
- const content = /* @__PURE__ */ jsxs("span", {
8857
- className: twMerge("flex w-fit items-center rounded-lg border border-border bg-background px-2 py-1 text-xs", color, hasErrors && "cursor-pointer"),
8858
- children: [icon, /* @__PURE__ */ jsx("span", {
8859
- className: twMerge("inline-block max-w-36 truncate"),
8860
- children: text
8861
- })]
8862
- });
8863
- if (hasErrors) return /* @__PURE__ */ jsx(CodePopover, {
8864
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, { value: errors }),
8865
- trigger: content
8866
- });
8867
- return content;
8868
- }
8869
- //#endregion
8870
- //#region src/connect/components/revision-history/revision/operation.tsx
8871
- function Operation$1(props) {
8872
- const { operationType, operationInput } = props;
8873
- return /* @__PURE__ */ jsx(CodePopover, {
8874
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, { value: operationInput }),
8875
- trigger: /* @__PURE__ */ jsxs("span", {
8876
- className: "flex cursor-pointer items-center gap-2 text-xs text-foreground",
8877
- children: [operationType, /* @__PURE__ */ jsx(Icon, {
8878
- className: "text-foreground",
8879
- name: "Braces",
8880
- size: 16
8881
- })]
8882
- })
8883
- });
8884
- }
8885
- //#endregion
8886
- //#region src/connect/components/revision-history/revision/revision-number.tsx
8887
- function RevisionNumber(props) {
8888
- const { operationIndex, eventId, stateHash } = props;
8889
- const revisionNumber = operationIndex + 1;
8890
- return /* @__PURE__ */ jsx(CodePopover, {
8891
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, { value: {
8892
- revisionNumber,
8893
- eventId,
8894
- stateHash
8895
- } }),
8896
- trigger: /* @__PURE__ */ jsxs("span", {
8897
- className: "flex cursor-pointer items-center gap-2 text-xs text-foreground",
8898
- children: [
8899
- "Revision ",
8900
- revisionNumber,
8901
- ".",
8902
- /* @__PURE__ */ jsx("a", { children: /* @__PURE__ */ jsx(Icon, {
8903
- className: "cursor-pointer text-foreground",
8904
- name: "Ellipsis",
8905
- size: 14
8906
- }) })
8907
- ]
8908
- })
8909
- });
8910
- }
8911
- //#endregion
8912
- //#region src/connect/components/revision-history/revision/signature.tsx
8913
- function Signature(props) {
8914
- const { signatures } = props;
8915
- if (!signatures?.length) return null;
8916
- return /* @__PURE__ */ jsx(CodePopover, {
8917
- trigger: /* @__PURE__ */ jsxs("span", {
8918
- className: "flex w-fit cursor-pointer items-center gap-1 rounded-lg border border-border bg-background px-2 py-1",
8919
- children: [
8920
- /* @__PURE__ */ jsx(VerificationStatus, { signatures }),
8921
- " ",
8922
- /* @__PURE__ */ jsx(Icon, {
8923
- className: "text-foreground",
8924
- name: "InfoSquare",
8925
- size: 16
8926
- })
8927
- ]
8928
- }),
8929
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, {
8930
- value: signatures,
8931
- collapsed: 1
8932
- })
8933
- });
8934
- }
8935
- function VerificationStatus(props) {
8936
- const { signatures } = props;
8937
- if (!signatures?.length) return null;
8938
- const signatureCount = signatures.length;
8939
- const verifiedSignaturesCount = signatures.filter((signature) => signature.isVerified).length;
8940
- const verificationStatusText = `${verifiedSignaturesCount}/${signatureCount} ${signatureCount === 1 ? "signature" : "signatures"} verified`;
8941
- return /* @__PURE__ */ jsx("span", {
8942
- className: twMerge(`text-xs`, verifiedSignaturesCount === 0 ? "text-destructive" : verifiedSignaturesCount === signatureCount ? "text-success" : "text-warning"),
8943
- children: verificationStatusText
8944
- });
8945
- }
8946
- //#endregion
8947
- //#region src/connect/components/revision-history/revision/timestamp.tsx
8948
- function Timestamp(props) {
8949
- const { timestampUtcMs: timestamp } = props;
8950
- const timestampNumber = typeof timestamp === "string" && !timestamp.includes("-") ? parseInt(timestamp) : timestamp;
8951
- const date = new Date(timestampNumber);
8952
- const shortDate = format(date, "HH:mm 'UTC'");
8953
- return /* @__PURE__ */ jsx(CodePopover, {
8954
- content: /* @__PURE__ */ jsx(FormattedJsonViewer, { value: {
8955
- timestampFormatted: format(date, "eee, dd MMM yyyy HH:mm:ss 'UTC'"),
8956
- timestampUtcMs: timestamp
8957
- } }),
8958
- trigger: /* @__PURE__ */ jsxs("span", {
8959
- className: "cursor-pointer text-xs text-foreground",
8960
- children: ["committed at ", shortDate]
8961
- })
8962
- });
8963
- }
8964
- //#endregion
8965
- //#region src/connect/components/revision-history/revision/revision.tsx
8966
- function _Revision(props) {
8967
- return /* @__PURE__ */ jsxs("article", {
8968
- className: "flex items-center justify-between rounded-xl border border-border bg-background px-4 py-2",
8969
- children: [/* @__PURE__ */ jsxs("div", {
8970
- className: "flex items-center gap-2",
8971
- children: [
8972
- /* @__PURE__ */ jsx(RevisionNumber, { ...props }),
8973
- /* @__PURE__ */ jsx(Operation$1, { ...props }),
8974
- /* @__PURE__ */ jsx(Address, { ...props }),
8975
- /* @__PURE__ */ jsx(Timestamp, { ...props })
8976
- ]
8977
- }), /* @__PURE__ */ jsxs("div", {
8978
- className: "flex items-center gap-1",
8979
- children: [/* @__PURE__ */ jsx(Signature, { ...props }), /* @__PURE__ */ jsx(Errors, { ...props })]
8980
- })]
8981
- });
8982
- }
8983
- const Revision = /* @__PURE__ */ memo(_Revision);
8984
- //#endregion
8985
- //#region src/connect/components/revision-history/skip/skip.tsx
8986
- function Skip(props) {
8987
- const { operationIndex, skipCount } = props;
8988
- const revisionNumber = operationIndex;
8989
- const skippedRevisions = skipCount === 1 ? `${revisionNumber}` : `${revisionNumber} - ${revisionNumber + 1 - skipCount}`;
8990
- return /* @__PURE__ */ jsxs("article", {
8991
- className: "grid grid-cols-[1fr,auto,1fr] items-center py-2",
8992
- children: [
8993
- /* @__PURE__ */ jsx("div", { className: "h-px rounded-full bg-muted" }),
8994
- /* @__PURE__ */ jsxs("div", {
8995
- className: "mx-3 text-xs text-foreground",
8996
- children: [
8997
- "[Skipped Revision ",
8998
- skippedRevisions,
8999
- "]"
9000
- ]
9001
- }),
9002
- /* @__PURE__ */ jsx("div", { className: "h-px rounded-full bg-muted" })
9003
- ]
9004
- });
9005
- }
9006
- //#endregion
9007
- //#region src/connect/components/revision-history/utils.ts
9008
- function makeRows(operations) {
9009
- const revisionsAndSkips = [];
9010
- const seenDays = /* @__PURE__ */ new Set();
9011
- for (const operation of operations) {
9012
- if (!operation.timestampUtcMs) continue;
9013
- const day = operation.timestampUtcMs.split("T")[0];
9014
- if (!seenDays.has(day)) {
9015
- seenDays.add(day);
9016
- revisionsAndSkips.push({
9017
- type: "day",
9018
- height: 32,
9019
- timestampUtcMs: day
9020
- });
9021
- }
9022
- revisionsAndSkips.push({
9023
- type: "revision",
9024
- height: 46,
9025
- operationIndex: operation.index,
9026
- eventId: operation.id ?? "EVENT_ID_NOT_FOUND",
9027
- stateHash: operation.hash,
9028
- operationType: operation.action.type,
9029
- operationInput: operation.action.input ?? {},
9030
- address: operation.action?.context?.signer?.user.address,
9031
- chainId: operation.action?.context?.signer?.user.chainId,
9032
- timestampUtcMs: operation.timestampUtcMs,
9033
- signatures: makeSignatures(operation.action?.context?.signer?.signatures ?? []),
9034
- errors: operation.error ? [operation.error] : void 0
9035
- });
9036
- if (operation.skip > 0) revisionsAndSkips.push({
9037
- type: "skip",
9038
- height: 34,
9039
- operationIndex: operation.index,
9040
- skipCount: operation.skip,
9041
- timestampUtcMs: operation.timestampUtcMs
9042
- });
9043
- }
9044
- return revisionsAndSkips;
9045
- }
9046
- function makeSignatureFromSignatureArray(signatureArray) {
9047
- const [signerAddress, hash, prevStateHash, signatureBytes] = signatureArray;
9048
- return {
9049
- signerAddress,
9050
- hash,
9051
- prevStateHash,
9052
- signatureBytes,
9053
- isVerified: true
9054
- };
9055
- }
9056
- function makeSignatures(signaturesArray) {
9057
- return signaturesArray?.map(makeSignatureFromSignatureArray);
9058
- }
9059
- //#endregion
9060
- //#region src/connect/components/revision-history/timeline/day.tsx
9061
- function Day(props) {
9062
- const { timestampUtcMs: timestamp } = props;
9063
- const formattedDate = format(timestamp, "MMM dd, yyyy");
9064
- return /* @__PURE__ */ jsxs("h2", {
9065
- className: "-ml-6 flex items-center gap-1 bg-background py-2 text-xs text-foreground",
9066
- children: [
9067
- /* @__PURE__ */ jsx(Icon, {
9068
- name: "Ring",
9069
- size: 16
9070
- }),
9071
- " Changes on ",
9072
- formattedDate
9073
- ]
9074
- });
9075
- }
9076
- //#endregion
9077
- //#region src/connect/components/revision-history/timeline/timeline.tsx
9078
- function Timeline(props) {
9079
- const { localOperations, globalOperations, scope } = props;
9080
- const operations = scope === "local" ? localOperations : globalOperations;
9081
- const initialNumRowsToShow = 100;
9082
- const allRows = useMemo(() => makeRows(operations), [operations]);
9083
- const [scrollAmount, setScrollAmount] = useState(0);
9084
- const [numRowsToShow, setNumRowsToShow] = useState(initialNumRowsToShow);
9085
- const [rows, setRows] = useState(() => allRows.slice(0, numRowsToShow));
9086
- const parentRef = useRef(null);
9087
- const hasNextPage = rows.length < allRows.length;
9088
- const rowVirtualizer = useVirtualizer({
9089
- count: rows.length,
9090
- getScrollElement: () => parentRef.current,
9091
- estimateSize: (i) => allRows[i].height,
9092
- gap: 8
9093
- });
9094
- useEffect(() => {
9095
- if (!hasNextPage) return;
9096
- const newNumRevisions = initialNumRowsToShow + Math.floor(scrollAmount / 46);
9097
- setNumRowsToShow((prev) => newNumRevisions > prev ? newNumRevisions : prev);
9098
- }, [scrollAmount, hasNextPage]);
9099
- useEffect(() => {
9100
- setRows(allRows.slice(0, numRowsToShow));
9101
- }, [allRows, numRowsToShow]);
9102
- const handleScroll = (e) => {
9103
- setScrollAmount((prev) => {
9104
- const n = prev + e.deltaY;
9105
- if (n < 0) return 0;
9106
- return n;
9107
- });
9108
- };
9109
- useEffect(() => {
9110
- window.addEventListener("wheel", handleScroll);
9111
- return () => {
9112
- window.removeEventListener("wheel", handleScroll);
9113
- };
9114
- }, []);
9115
- return /* @__PURE__ */ jsx("div", {
9116
- className: "border-l border-border dark:border-none",
9117
- ref: parentRef,
9118
- style: {
9119
- height: `${rowVirtualizer.getTotalSize()}px`,
9120
- width: "100%",
9121
- position: "relative"
9122
- },
9123
- children: rowVirtualizer.getVirtualItems().map((virtualRow) => {
9124
- const row = rows[virtualRow.index];
9125
- return /* @__PURE__ */ jsxs("div", {
9126
- style: {
9127
- position: "absolute",
9128
- top: 0,
9129
- left: 16,
9130
- width: "100%",
9131
- height: `${virtualRow.size}px`,
9132
- transform: `translateY(${virtualRow.start}px)`
9133
- },
9134
- children: [
9135
- row.type === "revision" && /* @__PURE__ */ createElement(Revision, {
9136
- ...row,
9137
- key: virtualRow.key
9138
- }),
9139
- row.type === "skip" && /* @__PURE__ */ jsx(Skip, { ...row }, virtualRow.key),
9140
- row.type === "day" && /* @__PURE__ */ jsx(Day, { ...row }, virtualRow.key)
9141
- ]
9142
- }, virtualRow.index);
9143
- })
9144
- });
9145
- }
9146
- //#endregion
9147
8504
  //#region src/connect/components/revision-history/revision-history.tsx
9148
- function RevisionHistory(props) {
9149
- const { documentTitle, documentId, globalOperations, localOperations, onClose, itemsPerPage = 100, documentState, onCopyState, onCopyDocId } = props;
9150
- const [scope, setScope] = useState("global");
9151
- const visibleOperations = useMemo(() => {
9152
- return garbageCollect(sortOperations(scope === "global" ? globalOperations : localOperations)).sort((a, b) => b.index - a.index);
9153
- }, [
9154
- globalOperations,
9155
- localOperations,
9156
- scope
9157
- ]);
9158
- const { pageItems, pages, goToPage, goToNextPage, goToPreviousPage, goToFirstPage, goToLastPage, hiddenNextPages, isNextPageAvailable, isPreviousPageAvailable } = usePagination(visibleOperations, { itemsPerPage });
9159
- function onChangeScope(scope) {
9160
- goToFirstPage();
9161
- setScope(scope);
9162
- }
9163
- const PaginationComponent = visibleOperations.length > itemsPerPage ? /* @__PURE__ */ jsx("div", {
9164
- className: "mt-4 flex w-full justify-end",
9165
- children: /* @__PURE__ */ jsx(Pagination, {
9166
- firstPageLabel: "First Page",
9167
- goToFirstPage,
9168
- goToLastPage,
9169
- goToNextPage,
9170
- goToPage,
9171
- goToPreviousPage,
9172
- hiddenNextPages,
9173
- isNextPageAvailable,
9174
- isPreviousPageAvailable,
9175
- lastPageLabel: "Last Page",
9176
- nextPageLabel: "Next",
9177
- pages,
9178
- previousPageLabel: "Previous"
9179
- })
9180
- }) : /* @__PURE__ */ jsx("hr", { className: "h-12 border-none" });
9181
- return /* @__PURE__ */ jsx(ConnectTooltipProvider, { children: /* @__PURE__ */ jsxs("div", {
9182
- className: "p-6",
9183
- children: [
9184
- /* @__PURE__ */ jsx(Header, {
9185
- docId: documentId,
9186
- onChangeScope,
9187
- onClose,
9188
- scope,
9189
- title: documentTitle,
9190
- documentState,
9191
- onCopyState,
9192
- onCopyDocId
9193
- }),
9194
- PaginationComponent,
9195
- /* @__PURE__ */ jsx("div", {
9196
- className: "mt-4 flex justify-center rounded-md bg-background p-4",
9197
- children: visibleOperations.length > 0 ? /* @__PURE__ */ jsx("div", {
9198
- className: "grid grid-cols-[minmax(min-content,1018px)]",
9199
- children: /* @__PURE__ */ jsx(Timeline, {
9200
- globalOperations: scope === "global" ? pageItems : [],
9201
- localOperations: scope === "local" ? pageItems : [],
9202
- scope
9203
- })
9204
- }) : /* @__PURE__ */ jsx("h3", {
9205
- className: "my-40 text-foreground",
9206
- children: "This document has no recorded operations yet."
9207
- })
9208
- }),
9209
- PaginationComponent
9210
- ]
9211
- }) });
9212
- }
8505
+ const RevisionHistory = lazyComponent(() => import("../revision-history.impl-CrtSnhXQ.js").then((m) => m.RevisionHistory));
9213
8506
  //#endregion
9214
8507
  //#region src/connect/components/search-bar/filter-item.tsx
9215
8508
  const FilterItem = (props) => {
@@ -9275,27 +8568,60 @@ const ConnectSearchBar = (props) => {
9275
8568
  });
9276
8569
  };
9277
8570
  //#endregion
8571
+ //#region src/connect/components/tooltip/tooltip.tsx
8572
+ function ConnectTooltip(props) {
8573
+ const { children, content, open, defaultOpen, onOpenChange, className, side = "top", sideOffset = 5, delayDuration, ...rest } = props;
8574
+ return /* @__PURE__ */ jsxs(Root, {
8575
+ defaultOpen,
8576
+ delayDuration,
8577
+ onOpenChange,
8578
+ open,
8579
+ children: [/* @__PURE__ */ jsx(Trigger, {
8580
+ asChild: true,
8581
+ children
8582
+ }), /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content, {
8583
+ ...rest,
8584
+ side,
8585
+ sideOffset,
8586
+ className: twMerge("z-50 rounded-lg border border-border bg-popover p-2 text-xs text-popover-foreground shadow-tooltip", className),
8587
+ children: content
8588
+ }) })]
8589
+ });
8590
+ }
8591
+ const ConnectTooltipProvider = Provider;
8592
+ //#endregion
9278
8593
  //#region src/connect/components/sidebar/sidebar-item.tsx
9279
8594
  const SidebarItem = function SidebarItem(props) {
9280
- const { icon, title, description: _description, containerClassName, active, onClick } = props;
8595
+ const { icon, title, description: _description, containerClassName, active, href, onClick, onPreload } = props;
8596
+ const Element = href ? "a" : "div";
8597
+ const current = href ? props["aria-current"] : void 0;
9281
8598
  return /* @__PURE__ */ jsx(ConnectTooltip, {
9282
8599
  content: title,
9283
8600
  side: "right",
9284
8601
  sideOffset: 12,
9285
8602
  className: "border-none bg-primary px-3 py-2 text-sm text-primary-foreground",
9286
- children: /* @__PURE__ */ jsxs("div", {
9287
- 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"),
8603
+ children: /* @__PURE__ */ jsxs(Element, {
8604
+ href,
8605
+ "aria-current": current,
8606
+ 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"),
9288
8607
  onClick,
9289
- 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", {
9290
- className: "mx-auto py-4",
9291
- children: icon || /* @__PURE__ */ jsx("div", {
9292
- className: "flex size-8 items-center justify-center rounded-lg bg-primary",
9293
- children: /* @__PURE__ */ jsx("span", {
9294
- className: "text-sm font-medium text-primary-foreground",
9295
- children: title.slice(0, 1).toUpperCase()
8608
+ onMouseEnter: onPreload,
8609
+ onTouchStart: onPreload,
8610
+ onFocus: href ? onPreload : void 0,
8611
+ children: [
8612
+ /* @__PURE__ */ jsx("div", { className: twMerge("absolute top-1/2 left-0 hidden h-10 w-1 -translate-y-1/2 rounded-r-sm bg-info group-aria-[current=page]/sidebar-item:block", active && "block") }),
8613
+ /* @__PURE__ */ jsx("div", { className: twMerge("absolute top-1/2 left-0 h-6 w-1 -translate-y-1/2 rounded-r-sm bg-secondary opacity-0 transition-opacity group-hover/sidebar-item:opacity-100 group-aria-[current=page]/sidebar-item:hidden", active && "hidden") }),
8614
+ /* @__PURE__ */ jsx("div", {
8615
+ className: "mx-auto py-4",
8616
+ children: icon || /* @__PURE__ */ jsx("div", {
8617
+ className: "flex size-8 items-center justify-center rounded-lg bg-primary",
8618
+ children: /* @__PURE__ */ jsx("span", {
8619
+ className: "text-sm font-medium text-primary-foreground",
8620
+ children: title.slice(0, 1).toUpperCase()
8621
+ })
9296
8622
  })
9297
8623
  })
9298
- })]
8624
+ ]
9299
8625
  })
9300
8626
  });
9301
8627
  };
@@ -9460,7 +8786,16 @@ const SidebarUser = ({ address, ensName, avatarUrl, etherscanUrl, onDisconnect }
9460
8786
  };
9461
8787
  //#endregion
9462
8788
  //#region src/connect/components/sidebar/sidebar-footer.tsx
9463
- const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin, onClickSettings, onDisconnect, onHomeClick, showDebug, onDebugClick, etherscanUrl = "", ...props }) => {
8789
+ const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin, onClickSettings, settingsHref, settingsCurrent, onDisconnect, onHomeClick, showDebug, onDebugClick, etherscanUrl = "", ...props }) => {
8790
+ const appLogoSrc = useConnectBranding().icon;
8791
+ const settingsIcon = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Settings, {
8792
+ className: "text-foreground",
8793
+ size: 24,
8794
+ strokeWidth: 2
8795
+ }), /* @__PURE__ */ jsx("span", {
8796
+ className: "hidden text-sm/6 font-semibold text-foreground",
8797
+ children: "Settings"
8798
+ })] });
9464
8799
  return /* @__PURE__ */ jsxs(SidebarFooter, {
9465
8800
  ...props,
9466
8801
  className: twMerge("flex flex-col items-center gap-3 border-t border-sidebar-border px-2 py-4 dark:border-none", className),
@@ -9470,7 +8805,13 @@ const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin,
9470
8805
  type: "button",
9471
8806
  className: "cursor-pointer",
9472
8807
  onClick: onHomeClick,
9473
- children: /* @__PURE__ */ jsx(Icon, {
8808
+ children: appLogoSrc ? /* @__PURE__ */ jsx("img", {
8809
+ alt: "",
8810
+ className: "object-contain",
8811
+ src: appLogoSrc,
8812
+ width: 24,
8813
+ height: 24
8814
+ }) : /* @__PURE__ */ jsx(Icon, {
9474
8815
  className: "text-muted-foreground",
9475
8816
  name: "ConnectSmall",
9476
8817
  size: 24
@@ -9497,19 +8838,19 @@ const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin,
9497
8838
  etherscanUrl
9498
8839
  }) : /* @__PURE__ */ jsx(SidebarLogin, { onLogin })
9499
8840
  }),
9500
- /* @__PURE__ */ jsxs("button", {
8841
+ settingsHref ? /* @__PURE__ */ jsx("a", {
8842
+ "aria-label": "Settings",
8843
+ href: settingsHref,
8844
+ "aria-current": settingsCurrent,
8845
+ className: "cursor-pointer rounded-md aria-[current=page]:bg-sidebar-accent",
8846
+ onClick: onClickSettings,
8847
+ children: settingsIcon
8848
+ }) : /* @__PURE__ */ jsx("button", {
9501
8849
  "aria-label": "Settings",
9502
8850
  type: "button",
9503
8851
  className: twMerge(onClickSettings ? "cursor-pointer" : "cursor-wait"),
9504
8852
  onClick: onClickSettings,
9505
- children: [/* @__PURE__ */ jsx(Settings, {
9506
- className: "text-foreground",
9507
- size: 24,
9508
- strokeWidth: 2
9509
- }), /* @__PURE__ */ jsx("span", {
9510
- className: "hidden text-sm/6 font-semibold text-foreground",
9511
- children: "Settings"
9512
- })]
8853
+ children: settingsIcon
9513
8854
  })
9514
8855
  ]
9515
8856
  });
@@ -9526,7 +8867,7 @@ const ConnectSidebarHeader = ({ className, children, ...props }) => {
9526
8867
  };
9527
8868
  //#endregion
9528
8869
  //#region src/connect/components/sidebar/sidebar.tsx
9529
- const ConnectSidebar = ({ onClick, address, ensName, avatarUrl, headerContent, onClickSettings, maxWidth = "304px", minWidth = "58px", onLogin, onDisconnect, etherscanUrl, showDebug, onDebugClick, ...props }) => {
8870
+ const ConnectSidebar = ({ onClick, address, ensName, avatarUrl, headerContent, onClickSettings, settingsHref, settingsCurrent, maxWidth = "304px", minWidth = "58px", onLogin, onDisconnect, etherscanUrl, showDebug, onDebugClick, ...props }) => {
9530
8871
  return /* @__PURE__ */ jsxs(Sidebar, {
9531
8872
  ...props,
9532
8873
  maxWidth,
@@ -9539,6 +8880,8 @@ const ConnectSidebar = ({ onClick, address, ensName, avatarUrl, headerContent, o
9539
8880
  ensName,
9540
8881
  avatarUrl,
9541
8882
  onClickSettings,
8883
+ settingsHref,
8884
+ settingsCurrent,
9542
8885
  onLogin,
9543
8886
  onDisconnect,
9544
8887
  etherscanUrl,
@@ -9617,6 +8960,21 @@ function ThemeSwitch({ horizontal = false }) {
9617
8960
  });
9618
8961
  }
9619
8962
  //#endregion
8963
+ //#region src/connect/components/toggle/toggle.tsx
8964
+ const Toggle = /*#__PURE__*/ forwardRef(function Toggle(props, ref) {
8965
+ return /* @__PURE__ */ jsxs("label", {
8966
+ className: "relative cursor-pointer items-center",
8967
+ htmlFor: props.id,
8968
+ children: [/* @__PURE__ */ jsx("input", {
8969
+ className: "peer sr-only",
8970
+ ref,
8971
+ type: "checkbox",
8972
+ value: "",
8973
+ ...props
8974
+ }), /* @__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" })]
8975
+ });
8976
+ });
8977
+ //#endregion
9620
8978
  //#region src/connect/utils/get-folder-status.ts
9621
8979
  /**
9622
8980
  * Retrieves the sync status of a folder based on its path and their children files.
@@ -9663,6 +9021,6 @@ const removeSuccessFiles = (files) => {
9663
9021
  return files.filter((file) => file.status !== "SUCCESS");
9664
9022
  };
9665
9023
  //#endregion
9666
- 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 };
9024
+ 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, useConnectBranding, useEns, useWindowSize, verifyPackageJsonFields };
9667
9025
 
9668
9026
  //# sourceMappingURL=index.js.map