@powerhousedao/design-system 6.2.3-dev.7 → 6.2.3-dev.70
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.
- package/dist/PinFilled-cSbUqZCA.js +41 -0
- package/dist/PinFilled-cSbUqZCA.js.map +1 -0
- package/dist/{Removed-CO_5C1ce.js → Removed-OP4eTrAN.js} +1 -1
- package/dist/{Removed-CO_5C1ce.js.map → Removed-OP4eTrAN.js.map} +1 -1
- package/dist/{Tabler-FjvVqX5a.js → Tabler-rjLxlzUV.js} +1 -1
- package/dist/{Tabler-FjvVqX5a.js.map → Tabler-rjLxlzUV.js.map} +1 -1
- package/dist/add-local-drive-form.impl-xsC6R634.js +75 -0
- package/dist/add-local-drive-form.impl-xsC6R634.js.map +1 -0
- package/dist/add-remote-drive-form.impl-B2DxdWGF.js +114 -0
- package/dist/add-remote-drive-form.impl-B2DxdWGF.js.map +1 -0
- package/dist/address-DfZqD6IM.js +92 -0
- package/dist/address-DfZqD6IM.js.map +1 -0
- package/dist/button-BYcXvZXr.d.ts +13 -0
- package/dist/button-BYcXvZXr.d.ts.map +1 -0
- package/dist/{character-counter-BWoglM2P.d.ts → character-counter-BZmZZCHN.d.ts} +2 -1
- package/dist/character-counter-BZmZZCHN.d.ts.map +1 -0
- package/dist/{checkbox-CGBtXQnI.d.ts → checkbox-BIhO-KB2.d.ts} +4 -4
- package/dist/checkbox-BIhO-KB2.d.ts.map +1 -0
- package/dist/{checkbox-base-CZo-4eL0.d.ts → checkbox-base-Bm0GPWgm.d.ts} +2 -2
- package/dist/checkbox-base-Bm0GPWgm.d.ts.map +1 -0
- package/dist/combobox.impl-EqgAawKJ.js +144 -0
- package/dist/combobox.impl-EqgAawKJ.js.map +1 -0
- package/dist/{command-tFzjgzge.d.ts → command-DHHTsHfH.d.ts} +5 -5
- package/dist/command-DHHTsHfH.d.ts.map +1 -0
- package/dist/connect/components/toast/toast.d.ts +8 -10
- package/dist/connect/components/toast/toast.d.ts.map +1 -1
- package/dist/connect/components/toast/toast.js +4 -4
- package/dist/connect/components/toast/toast.js.map +1 -1
- package/dist/connect/index.d.ts +435 -362
- package/dist/connect/index.d.ts.map +1 -1
- package/dist/connect/index.js +811 -1607
- package/dist/connect/index.js.map +1 -1
- package/dist/{content-BHWIqmio.d.ts → content-Ch3oDYCL.d.ts} +3 -3
- package/dist/content-Ch3oDYCL.d.ts.map +1 -0
- package/dist/default-editor.impl-a6EOuEme.js +30 -0
- package/dist/default-editor.impl-a6EOuEme.js.map +1 -0
- package/dist/document-timeline.impl-CCkyXpt5.js +254 -0
- package/dist/document-timeline.impl-CCkyXpt5.js.map +1 -0
- package/dist/drive-settings-form.impl-Bwam9-CG.js +171 -0
- package/dist/drive-settings-form.impl-Bwam9-CG.js.map +1 -0
- package/dist/{enum-field-CwZVs3Ux.d.ts → enum-field-DsyC0ml7.d.ts} +4 -4
- package/dist/enum-field-DsyC0ml7.d.ts.map +1 -0
- package/dist/{form-CKRKn0TQ.d.ts → form-Brj5AQNr.d.ts} +3 -4
- package/dist/form-Brj5AQNr.d.ts.map +1 -0
- package/dist/{form-description-CYkcMEzm.d.ts → form-description-DJrDJzJi.d.ts} +2 -1
- package/dist/form-description-DJrDJzJi.d.ts.map +1 -0
- package/dist/{form-group-C8kL6pdZ.d.ts → form-group-Ckd28lpW.d.ts} +2 -1
- package/dist/form-group-Ckd28lpW.d.ts.map +1 -0
- package/dist/{form-label-b6nQi0XO.d.ts → form-label-C8ghd_lR.d.ts} +2 -1
- package/dist/form-label-C8ghd_lR.d.ts.map +1 -0
- package/dist/{form-message-Dq72nBXz.d.ts → form-message-CnKUkvlj.d.ts} +2 -1
- package/dist/form-message-CnKUkvlj.d.ts.map +1 -0
- package/dist/form-server-error-message-D2tFtDZ0.d.ts +6 -0
- package/dist/form-server-error-message-D2tFtDZ0.d.ts.map +1 -0
- package/dist/formatted-json-viewer.impl-DadZ5uvb.js +58 -0
- package/dist/formatted-json-viewer.impl-DadZ5uvb.js.map +1 -0
- package/dist/icon-CHR45tj_.js +358 -0
- package/dist/icon-CHR45tj_.js.map +1 -0
- package/dist/{icon-C4QOpsdI.js → icon-components-CJ4I3Y6Y.js} +7 -481
- package/dist/icon-components-CJ4I3Y6Y.js.map +1 -0
- package/dist/{id-autocomplete-C-hwriS5.d.ts → id-autocomplete-Cr7p129s.d.ts} +3 -3
- package/dist/id-autocomplete-Cr7p129s.d.ts.map +1 -0
- package/dist/{id-autocomplete-input-container-DFEyPh5p.d.ts → id-autocomplete-input-container-iTw9wYZn.d.ts} +3 -3
- package/dist/id-autocomplete-input-container-iTw9wYZn.d.ts.map +1 -0
- package/dist/{id-autocomplete-list-EzLpF23C.d.ts → id-autocomplete-list-BIC3RxOp.d.ts} +3 -3
- package/dist/id-autocomplete-list-BIC3RxOp.d.ts.map +1 -0
- package/dist/{id-autocomplete-list-option-CB5B07Hi.d.ts → id-autocomplete-list-option-DlpZer-2.d.ts} +4 -3
- package/dist/id-autocomplete-list-option-DlpZer-2.d.ts.map +1 -0
- package/dist/index-C-Tup7Br.d.ts +4 -0
- package/dist/{index--hDSfvJT.d.ts → index-Ck34z7kD.d.ts} +23 -59
- package/dist/index-Ck34z7kD.d.ts.map +1 -0
- package/dist/index-D6Zk5OLV.d.ts +4 -0
- package/dist/index-Ds9-qjjC.d.ts +30 -0
- package/dist/index-jfVVOU-H.d.ts +2 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +2 -2
- package/dist/{input-BpEQjaWV.d.ts → input-WDvjJFqf.d.ts} +2 -2
- package/dist/input-WDvjJFqf.d.ts.map +1 -0
- package/dist/json-viewer-Kg0IBIt-.d.ts +7 -0
- package/dist/json-viewer-Kg0IBIt-.d.ts.map +1 -0
- package/dist/label-nH2HoKfI.js +15 -0
- package/dist/label-nH2HoKfI.js.map +1 -0
- package/dist/location-info-C3YbSsV0.js +47 -0
- package/dist/location-info-C3YbSsV0.js.map +1 -0
- package/dist/{message-list-C4mPpBBa.d.ts → message-list-D8d2ltLd.d.ts} +3 -3
- package/dist/message-list-D8d2ltLd.d.ts.map +1 -0
- package/dist/{popover-XSBOuSih.d.ts → popover-TvQxa0RU.d.ts} +2 -2
- package/dist/popover-TvQxa0RU.d.ts.map +1 -0
- package/dist/{radio-eL0Oy86J.d.ts → radio-CTS4WsNy.d.ts} +2 -2
- package/dist/radio-CTS4WsNy.d.ts.map +1 -0
- package/dist/{radio-group-Bkli6nUz.d.ts → radio-group-CROIwgYz.d.ts} +2 -2
- package/dist/radio-group-CROIwgYz.d.ts.map +1 -0
- package/dist/{radio-group-field-wlqeiLN3.d.ts → radio-group-field-0-cC_e65.d.ts} +5 -6
- package/dist/radio-group-field-0-cC_e65.d.ts.map +1 -0
- package/dist/revision-history.impl-CrtSnhXQ.js +642 -0
- package/dist/revision-history.impl-CrtSnhXQ.js.map +1 -0
- package/dist/{search-autocomplete-BJJkrZ1i.d.ts → search-autocomplete-COvFRZIb.d.ts} +3 -3
- package/dist/search-autocomplete-COvFRZIb.d.ts.map +1 -0
- package/dist/{select-field-C97QIhUL.d.ts → select-field-VZPf666l.d.ts} +5 -5
- package/dist/select-field-VZPf666l.d.ts.map +1 -0
- package/dist/{selected-content-CGsK5PR4.d.ts → selected-content-D6NWiceG.d.ts} +3 -3
- package/dist/selected-content-D6NWiceG.d.ts.map +1 -0
- package/dist/{sidebar-DOoE4krt.d.ts → sidebar-DFqreKf1.d.ts} +3 -3
- package/dist/sidebar-DFqreKf1.d.ts.map +1 -0
- package/dist/{sidebar-provider-C2eyz9TL.d.ts → sidebar-provider-CZHhqW5n.d.ts} +4 -8
- package/dist/sidebar-provider-CZHhqW5n.d.ts.map +1 -0
- package/dist/splitted-input-diff-Bkoi0Odc.d.ts +11 -0
- package/dist/splitted-input-diff-Bkoi0Odc.d.ts.map +1 -0
- package/dist/{src-CVV6HzQZ.js → src-CohvVFnR.js} +178 -22
- package/dist/src-CohvVFnR.js.map +1 -0
- package/dist/style.css +3 -6
- package/dist/text-field-CDYSwanK.d.ts +9 -0
- package/dist/text-field-CDYSwanK.d.ts.map +1 -0
- package/dist/{text-input-8zXIWHLi.d.ts → text-input-CFRCPYq6.d.ts} +5 -6
- package/dist/text-input-CFRCPYq6.d.ts.map +1 -0
- package/dist/text-input-diff-BgJAxPQV.d.ts +12 -0
- package/dist/text-input-diff-BgJAxPQV.d.ts.map +1 -0
- package/dist/{tooltip-BxS9HpML.d.ts → tooltip-B4uQJPUm.d.ts} +3 -4
- package/dist/tooltip-B4uQJPUm.d.ts.map +1 -0
- package/dist/{types-Bsn62tJB.d.ts → types-BNTIrhb5.d.ts} +2 -1
- package/dist/types-BNTIrhb5.d.ts.map +1 -0
- package/dist/{types-BTq-St7H.d.ts → types-CpFPFB1a.d.ts} +2 -1
- package/dist/types-CpFPFB1a.d.ts.map +1 -0
- package/dist/{types-C04Q_Fan.d.ts → types-D4CirgNk.d.ts} +2 -2
- package/dist/types-D4CirgNk.d.ts.map +1 -0
- package/dist/{types-CNbvfWjh.d.ts → types-FTqFl5du.d.ts} +3 -3
- package/dist/types-FTqFl5du.d.ts.map +1 -0
- package/dist/types-TZijOYrE.d.ts +17 -0
- package/dist/types-TZijOYrE.d.ts.map +1 -0
- package/dist/ui/components/button/button.d.ts +3 -2
- package/dist/ui/components/button/button.js +1 -1
- package/dist/ui/components/button/button.js.map +1 -1
- package/dist/ui/components/character-counter/character-counter.d.ts +3 -2
- package/dist/ui/components/character-counter/character-counter.js.map +1 -1
- package/dist/ui/components/checkbox/checkbox-base.d.ts +3 -2
- package/dist/ui/components/checkbox/checkbox-base.js +1 -1
- package/dist/ui/components/checkbox/checkbox-base.js.map +1 -1
- package/dist/ui/components/checkbox/checkbox.d.ts +3 -2
- package/dist/ui/components/checkbox/checkbox.js +1 -1
- package/dist/ui/components/checkbox/checkbox.js.map +1 -1
- package/dist/ui/components/command/command.d.ts +3 -2
- package/dist/ui/components/command/command.js +8 -8
- package/dist/ui/components/command/command.js.map +1 -1
- package/dist/ui/components/enum-field/enum-field.d.ts +3 -2
- package/dist/ui/components/enum-field/enum-field.js +1 -1
- package/dist/ui/components/enum-field/enum-field.js.map +1 -1
- package/dist/ui/components/enum-field/types.d.ts +3 -2
- package/dist/ui/components/form/form.d.ts +3 -2
- package/dist/ui/components/form/form.js +1 -1
- package/dist/ui/components/form/form.js.map +1 -1
- package/dist/ui/components/form/utils.d.ts +4 -4
- package/dist/ui/components/form/utils.d.ts.map +1 -1
- package/dist/ui/components/form/utils.js.map +1 -1
- package/dist/ui/components/form-description/form-description.d.ts +3 -2
- package/dist/ui/components/form-description/form-description.js.map +1 -1
- package/dist/ui/components/form-group/form-group.d.ts +3 -2
- package/dist/ui/components/form-group/form-group.js.map +1 -1
- package/dist/ui/components/form-label/form-label.d.ts +3 -2
- package/dist/ui/components/form-label/form-label.js +3 -2
- package/dist/ui/components/form-label/form-label.js.map +1 -1
- package/dist/ui/components/form-message/form-message.d.ts +3 -2
- package/dist/ui/components/form-message/form-message.js.map +1 -1
- package/dist/ui/components/form-message/form-server-error-message.d.ts +3 -2
- package/dist/ui/components/form-message/form-server-error-message.js.map +1 -1
- package/dist/ui/components/form-message/message-list.d.ts +3 -2
- package/dist/ui/components/form-message/message-list.js.map +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-context.d.ts +3 -5
- package/dist/ui/components/id-autocomplete/id-autocomplete-context.d.ts.map +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-context.js +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-context.js.map +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-input-container.d.ts +3 -2
- package/dist/ui/components/id-autocomplete/id-autocomplete-input-container.js +2 -2
- package/dist/ui/components/id-autocomplete/id-autocomplete-input-container.js.map +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-list-option.d.ts +3 -2
- package/dist/ui/components/id-autocomplete/id-autocomplete-list-option.js +2 -2
- package/dist/ui/components/id-autocomplete/id-autocomplete-list-option.js.map +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-list.d.ts +3 -2
- package/dist/ui/components/id-autocomplete/id-autocomplete-list.js.map +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete.d.ts +3 -2
- package/dist/ui/components/id-autocomplete/id-autocomplete.js +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete.js.map +1 -1
- package/dist/ui/components/id-autocomplete/types.d.ts +3 -2
- package/dist/ui/components/id-autocomplete/use-id-autocomplete.d.ts +3 -2
- package/dist/ui/components/id-autocomplete/use-id-autocomplete.js.map +1 -1
- package/dist/ui/components/index.d.ts +42 -40
- package/dist/ui/components/input/input.d.ts +3 -2
- package/dist/ui/components/input/input.js +1 -1
- package/dist/ui/components/input/input.js.map +1 -1
- package/dist/ui/components/input/splitted-input-diff.d.ts +3 -2
- package/dist/ui/components/input/splitted-input-diff.js +10 -9
- package/dist/ui/components/input/splitted-input-diff.js.map +1 -1
- package/dist/ui/components/input/subcomponent/input-diff.d.ts +2 -11
- package/dist/ui/components/input/subcomponent/input-diff.d.ts.map +1 -1
- package/dist/ui/components/input/subcomponent/input-diff.js.map +1 -1
- package/dist/ui/components/input/subcomponent/text-diff.d.ts +3 -12
- package/dist/ui/components/input/subcomponent/text-diff.d.ts.map +1 -1
- package/dist/ui/components/input/subcomponent/text-diff.js.map +1 -1
- package/dist/ui/components/json-viewer/json-viewer.d.ts +3 -2
- package/dist/ui/components/json-viewer/json-viewer.js +1 -1
- package/dist/ui/components/json-viewer/json-viewer.js.map +1 -1
- package/dist/ui/components/popover/popover.d.ts +3 -2
- package/dist/ui/components/popover/popover.js +1 -1
- package/dist/ui/components/popover/popover.js.map +1 -1
- package/dist/ui/components/radio-group-field/radio-group-field.d.ts +3 -2
- package/dist/ui/components/radio-group-field/radio-group-field.js +4 -3
- package/dist/ui/components/radio-group-field/radio-group-field.js.map +1 -1
- package/dist/ui/components/radio-group-field/radio-group.d.ts +3 -2
- package/dist/ui/components/radio-group-field/radio-group.js +1 -1
- package/dist/ui/components/radio-group-field/radio-group.js.map +1 -1
- package/dist/ui/components/radio-group-field/radio.d.ts +3 -2
- package/dist/ui/components/radio-group-field/radio.js +1 -1
- package/dist/ui/components/radio-group-field/radio.js.map +1 -1
- package/dist/ui/components/search-autocomplete/index.d.ts +6 -4
- package/dist/ui/components/search-autocomplete/search-autocomplete.d.ts +3 -2
- package/dist/ui/components/search-autocomplete/search-autocomplete.js.map +1 -1
- package/dist/ui/components/search-autocomplete/types.d.ts +3 -2
- package/dist/ui/components/search-autocomplete/use-search-autocomplete.d.ts +3 -2
- package/dist/ui/components/search-autocomplete/use-search-autocomplete.js.map +1 -1
- package/dist/ui/components/select-field/content.d.ts +3 -2
- package/dist/ui/components/select-field/content.js +1 -1
- package/dist/ui/components/select-field/content.js.map +1 -1
- package/dist/ui/components/select-field/select-field.d.ts +3 -2
- package/dist/ui/components/select-field/select-field.js +1 -1
- package/dist/ui/components/select-field/select-field.js.map +1 -1
- package/dist/ui/components/select-field/selected-content.d.ts +3 -2
- package/dist/ui/components/select-field/selected-content.js +1 -1
- package/dist/ui/components/select-field/selected-content.js.map +1 -1
- package/dist/ui/components/select-field/subcomponents/CommandItemList.d.ts +3 -4
- package/dist/ui/components/select-field/subcomponents/CommandItemList.d.ts.map +1 -1
- package/dist/ui/components/select-field/subcomponents/CommandItemList.js +1 -1
- package/dist/ui/components/select-field/subcomponents/CommandItemList.js.map +1 -1
- package/dist/ui/components/select-field/use-select-field.d.ts +4 -12
- package/dist/ui/components/select-field/use-select-field.d.ts.map +1 -1
- package/dist/ui/components/select-field/use-select-field.js.map +1 -1
- package/dist/ui/components/sidebar/index.d.ts +6 -4
- package/dist/ui/components/sidebar/sidebar.d.ts +3 -2
- package/dist/ui/components/sidebar/sidebar.js +1 -1
- package/dist/ui/components/sidebar/sidebar.js.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-content-area.d.ts +2 -7
- package/dist/ui/components/sidebar/subcomponents/sidebar-content-area.d.ts.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-content-area.js +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-content-area.js.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-header.d.ts +2 -2
- package/dist/ui/components/sidebar/subcomponents/sidebar-header.d.ts.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-header.js.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-item.d.ts +3 -18
- package/dist/ui/components/sidebar/subcomponents/sidebar-item.d.ts.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-item.js +4 -3
- package/dist/ui/components/sidebar/subcomponents/sidebar-item.js.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-pinning-area.d.ts +2 -4
- package/dist/ui/components/sidebar/subcomponents/sidebar-pinning-area.d.ts.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-pinning-area.js.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-provider/index.d.ts +4 -2
- package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-provider.d.ts +3 -2
- package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-provider.js +2 -2
- package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-provider.js.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-reducer.d.ts +7 -8
- package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-reducer.d.ts.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-reducer.js +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-reducer.js.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-search/index.d.ts +2 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-search/search-navigation-arrow.d.ts +2 -2
- package/dist/ui/components/sidebar/subcomponents/sidebar-search/search-navigation-arrow.d.ts.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-search/search-navigation-arrow.js.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-search/search-result-counter.d.ts +2 -2
- package/dist/ui/components/sidebar/subcomponents/sidebar-search/search-result-counter.d.ts.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-search/search-result-counter.js.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-search/sidebar-search.d.ts +2 -2
- package/dist/ui/components/sidebar/subcomponents/sidebar-search/sidebar-search.d.ts.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-search/sidebar-search.js +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-search/sidebar-search.js.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-skeleton-item.d.ts +2 -8
- package/dist/ui/components/sidebar/subcomponents/sidebar-skeleton-item.d.ts.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-skeleton-item.js +2 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-skeleton-item.js.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-skeleton.d.ts +2 -4
- package/dist/ui/components/sidebar/subcomponents/sidebar-skeleton.d.ts.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-skeleton.js.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/status-icon.d.ts +3 -9
- package/dist/ui/components/sidebar/subcomponents/status-icon.d.ts.map +1 -1
- package/dist/ui/components/sidebar/subcomponents/status-icon.js +1 -1
- package/dist/ui/components/sidebar/subcomponents/status-icon.js.map +1 -1
- package/dist/ui/components/sidebar/types.d.ts +3 -2
- package/dist/ui/components/sidebar/types.js +1 -1
- package/dist/ui/components/sidebar/types.js.map +1 -1
- package/dist/ui/components/sidebar/use-ellipsis.d.ts +2 -2
- package/dist/ui/components/sidebar/use-ellipsis.d.ts.map +1 -1
- package/dist/ui/components/sidebar/use-ellipsis.js.map +1 -1
- package/dist/ui/components/sidebar/use-sidebar-resize.d.ts +3 -9
- package/dist/ui/components/sidebar/use-sidebar-resize.d.ts.map +1 -1
- package/dist/ui/components/sidebar/use-sidebar-resize.js.map +1 -1
- package/dist/ui/components/sidebar/utils.d.ts +10 -11
- package/dist/ui/components/sidebar/utils.d.ts.map +1 -1
- package/dist/ui/components/sidebar/utils.js.map +1 -1
- package/dist/ui/components/text-field/text-field.d.ts +3 -2
- package/dist/ui/components/text-field/text-field.js +3 -2
- package/dist/ui/components/text-field/text-field.js.map +1 -1
- package/dist/ui/components/text-input/text-input-diff.d.ts +3 -2
- package/dist/ui/components/text-input/text-input-diff.js.map +1 -1
- package/dist/ui/components/text-input/text-input.d.ts +3 -2
- package/dist/ui/components/text-input/text-input.js +1 -1
- package/dist/ui/components/text-input/text-input.js.map +1 -1
- package/dist/ui/components/text-input/types.d.ts +3 -2
- package/dist/ui/components/tooltip/tooltip.d.ts +3 -2
- package/dist/ui/components/tooltip/tooltip.js +1 -1
- package/dist/ui/components/tooltip/tooltip.js.map +1 -1
- package/dist/ui/components/types.d.ts +3 -2
- package/dist/ui/components/value-transformer/value-transformer.d.ts +3 -2
- package/dist/ui/components/value-transformer/value-transformer.js +5 -3
- package/dist/ui/components/value-transformer/value-transformer.js.map +1 -1
- package/dist/ui/components/with-field-validation/with-field-validation.d.ts +3 -2
- package/dist/ui/components/with-field-validation/with-field-validation.js +1 -1
- package/dist/ui/components/with-field-validation/with-field-validation.js.map +1 -1
- package/dist/ui/index.d.ts +44 -42
- package/dist/ui/lib/date-picker.d.ts +4 -5
- package/dist/ui/lib/date-picker.d.ts.map +1 -1
- package/dist/ui/lib/date-picker.js +2 -1
- package/dist/ui/lib/date-picker.js.map +1 -1
- package/dist/ui/lib/date-time-picker.d.ts +6 -6
- package/dist/ui/lib/date-time-picker.d.ts.map +1 -1
- package/dist/ui/lib/date-time-picker.js.map +1 -1
- package/dist/ui/lib/deep-equal.d.ts +2 -2
- package/dist/ui/lib/deep-equal.d.ts.map +1 -1
- package/dist/ui/lib/deep-equal.js.map +1 -1
- package/dist/ui/lib/index.d.ts +2 -1
- package/dist/ui/lib/is-empty.d.ts +2 -2
- package/dist/ui/lib/is-empty.d.ts.map +1 -1
- package/dist/ui/lib/is-empty.js.map +1 -1
- package/dist/ui/lib/shared-value-transformers.d.ts +3 -4
- package/dist/ui/lib/shared-value-transformers.d.ts.map +1 -1
- package/dist/ui/lib/shared-value-transformers.js.map +1 -1
- package/dist/ui/lib/types.d.ts +3 -2
- package/dist/ui/lib/value-cast.d.ts +4 -4
- package/dist/ui/lib/value-cast.d.ts.map +1 -1
- package/dist/ui/lib/value-cast.js +10 -4
- package/dist/ui/lib/value-cast.js.map +1 -1
- package/dist/ui/types.d.ts +4 -3
- package/dist/{use-id-autocomplete-By7YSChC.d.ts → use-id-autocomplete-WH2ROfQn.d.ts} +5 -16
- package/dist/use-id-autocomplete-WH2ROfQn.d.ts.map +1 -0
- package/dist/{use-search-autocomplete-IfcQ_gKh.d.ts → use-search-autocomplete-vSvcsvcB.d.ts} +5 -6
- package/dist/use-search-autocomplete-vSvcsvcB.d.ts.map +1 -0
- package/dist/{value-transformer-DQjqtNih.d.ts → value-transformer-Cg5TEYP2.d.ts} +5 -7
- package/dist/value-transformer-Cg5TEYP2.d.ts.map +1 -0
- package/dist/{with-field-validation-Di5D8vU-.d.ts → with-field-validation-CObZoT4r.d.ts} +3 -3
- package/dist/with-field-validation-CObZoT4r.d.ts.map +1 -0
- package/package.json +17 -12
- package/plugins.css +6 -0
- package/tailwind.css +175 -0
- package/vendor.css +3 -0
- package/dist/button-C8doazjv.d.ts +0 -15
- package/dist/button-C8doazjv.d.ts.map +0 -1
- package/dist/character-counter-BWoglM2P.d.ts.map +0 -1
- package/dist/checkbox-CGBtXQnI.d.ts.map +0 -1
- package/dist/checkbox-base-CZo-4eL0.d.ts.map +0 -1
- package/dist/command-tFzjgzge.d.ts.map +0 -1
- package/dist/content-BHWIqmio.d.ts.map +0 -1
- package/dist/enum-field-CwZVs3Ux.d.ts.map +0 -1
- package/dist/form-CKRKn0TQ.d.ts.map +0 -1
- package/dist/form-description-CYkcMEzm.d.ts.map +0 -1
- package/dist/form-group-C8kL6pdZ.d.ts.map +0 -1
- package/dist/form-label-b6nQi0XO.d.ts.map +0 -1
- package/dist/form-message-Dq72nBXz.d.ts.map +0 -1
- package/dist/form-server-error-message-DXbaiTfF.d.ts +0 -7
- package/dist/form-server-error-message-DXbaiTfF.d.ts.map +0 -1
- package/dist/icon-C4QOpsdI.js.map +0 -1
- package/dist/id-autocomplete-C-hwriS5.d.ts.map +0 -1
- package/dist/id-autocomplete-input-container-DFEyPh5p.d.ts.map +0 -1
- package/dist/id-autocomplete-list-EzLpF23C.d.ts.map +0 -1
- package/dist/id-autocomplete-list-option-CB5B07Hi.d.ts.map +0 -1
- package/dist/index--hDSfvJT.d.ts.map +0 -1
- package/dist/index--okzibnx.d.ts +0 -1
- package/dist/index-BLwMeReG.d.ts +0 -1
- package/dist/index-Cw3C7_1f.d.ts +0 -1
- package/dist/index-E7Wvm5uX.d.ts +0 -1
- package/dist/index-J3R2mDFQ.d.ts +0 -1
- package/dist/input-BpEQjaWV.d.ts.map +0 -1
- package/dist/json-viewer-DaTgmzkS.d.ts +0 -8
- package/dist/json-viewer-DaTgmzkS.d.ts.map +0 -1
- package/dist/message-list-C4mPpBBa.d.ts.map +0 -1
- package/dist/popover-XSBOuSih.d.ts.map +0 -1
- package/dist/radio-eL0Oy86J.d.ts.map +0 -1
- package/dist/radio-group-Bkli6nUz.d.ts.map +0 -1
- package/dist/radio-group-field-wlqeiLN3.d.ts.map +0 -1
- package/dist/search-autocomplete-BJJkrZ1i.d.ts.map +0 -1
- package/dist/select-field-C97QIhUL.d.ts.map +0 -1
- package/dist/selected-content-CGsK5PR4.d.ts.map +0 -1
- package/dist/sidebar-DOoE4krt.d.ts.map +0 -1
- package/dist/sidebar-provider-C2eyz9TL.d.ts.map +0 -1
- package/dist/splitted-input-diff-CwPedpov.d.ts +0 -18
- package/dist/splitted-input-diff-CwPedpov.d.ts.map +0 -1
- package/dist/src-CVV6HzQZ.js.map +0 -1
- package/dist/text-field-DSInH67J.d.ts +0 -10
- package/dist/text-field-DSInH67J.d.ts.map +0 -1
- package/dist/text-input-8zXIWHLi.d.ts.map +0 -1
- package/dist/text-input-diff-B0vLSKQm.d.ts +0 -20
- package/dist/text-input-diff-B0vLSKQm.d.ts.map +0 -1
- package/dist/tooltip-BxS9HpML.d.ts.map +0 -1
- package/dist/types-BTq-St7H.d.ts.map +0 -1
- package/dist/types-Bsn62tJB.d.ts.map +0 -1
- package/dist/types-C04Q_Fan.d.ts.map +0 -1
- package/dist/types-CNbvfWjh.d.ts.map +0 -1
- package/dist/use-id-autocomplete-By7YSChC.d.ts.map +0 -1
- package/dist/use-search-autocomplete-IfcQ_gKh.d.ts.map +0 -1
- package/dist/value-transformer-DQjqtNih.d.ts.map +0 -1
- package/dist/with-field-validation-Di5D8vU-.d.ts.map +0 -1
package/dist/connect/index.js
CHANGED
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import { n as getDimensions, t as Icon } from "../icon-
|
|
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
|
|
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, createElement, forwardRef, useCallback, 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 {
|
|
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,
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
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";
|
|
25
21
|
import { isValidName } from "@powerhousedao/shared/document-drive";
|
|
26
22
|
import { capitalCase } from "change-case";
|
|
27
23
|
import { getUpdateTarget, parseInstallSpec } from "@powerhousedao/shared/registry/updates";
|
|
28
|
-
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
29
24
|
//#region src/connect/components/account-popover/account-popover.tsx
|
|
30
25
|
const AccountPopover = ({ children, content, open, onOpenChange }) => {
|
|
31
26
|
return /* @__PURE__ */ jsxs(Popover, {
|
|
@@ -245,6 +240,9 @@ function Breadcrumbs() {
|
|
|
245
240
|
const selectedDriveId = useSelectedDriveId();
|
|
246
241
|
const selectedNodePath = useSelectedNodePath();
|
|
247
242
|
const [isCreating, setIsCreating] = useState(false);
|
|
243
|
+
const driveContext = useDriveContext();
|
|
244
|
+
const setSelectedDrive = useSetSelectedDrive();
|
|
245
|
+
const setSelectedNode = useSetSelectedNode();
|
|
248
246
|
function onAddNew() {
|
|
249
247
|
setIsCreating(true);
|
|
250
248
|
}
|
|
@@ -261,6 +259,7 @@ function Breadcrumbs() {
|
|
|
261
259
|
function onCancel() {
|
|
262
260
|
setIsCreating(false);
|
|
263
261
|
}
|
|
262
|
+
const driveTarget = selectedDrive ? { driveSlug: makeDriveSlug(selectedDrive) } : void 0;
|
|
264
263
|
const hasSelectedDrive = !!selectedDrive;
|
|
265
264
|
const hasNodePath = !!selectedNodePath.length;
|
|
266
265
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -282,6 +281,7 @@ function Breadcrumbs() {
|
|
|
282
281
|
id: selectedDriveId,
|
|
283
282
|
parentId: void 0,
|
|
284
283
|
name: selectedDrive.state.global.name || selectedDrive.header.name,
|
|
284
|
+
target: driveTarget,
|
|
285
285
|
onClick: () => setSelectedDrive(selectedDrive)
|
|
286
286
|
}),
|
|
287
287
|
/* @__PURE__ */ jsx("span", { children: "/" })
|
|
@@ -290,6 +290,7 @@ function Breadcrumbs() {
|
|
|
290
290
|
id: node.id,
|
|
291
291
|
parentId: node.parentFolder,
|
|
292
292
|
name: node.name,
|
|
293
|
+
target: getNodeTarget(node, driveContext?.drive),
|
|
293
294
|
onClick: () => setSelectedNode(node)
|
|
294
295
|
}), /* @__PURE__ */ jsx("span", { children: "/" })] }, node.id)),
|
|
295
296
|
isAllowedToCreateDocuments && (isCreating ? /* @__PURE__ */ jsx(NodeInput, {
|
|
@@ -311,160 +312,363 @@ function Breadcrumbs() {
|
|
|
311
312
|
});
|
|
312
313
|
}
|
|
313
314
|
function Breadcrumb(props) {
|
|
314
|
-
const { name, id, parentId, onClick } = props;
|
|
315
|
+
const { name, id, parentId, target, onClick } = props;
|
|
316
|
+
const navigation = usePHNavigation();
|
|
317
|
+
const isCurrent = navigation.useIsCurrent?.(target) ?? false;
|
|
318
|
+
const href = props.href ?? (target ? navigation.hrefFor?.(target) : void 0);
|
|
315
319
|
const { isDragging, ...dragProps } = useDragNode({
|
|
316
320
|
srcId: id,
|
|
317
321
|
parentId: parentId ?? void 0
|
|
318
322
|
});
|
|
319
323
|
const { isDropTarget, ...dropProps } = useDropNode(id);
|
|
320
324
|
const containerStyles = twMerge("cursor-pointer transition-colors last-of-type:text-foreground hover:hover-effect", isDragging ? "opacity-60" : isDropTarget ? "bg-info/10" : "");
|
|
325
|
+
if (href) {
|
|
326
|
+
const onLinkClick = (event) => {
|
|
327
|
+
if (!isPlainClick(event)) return;
|
|
328
|
+
event.preventDefault();
|
|
329
|
+
onClick();
|
|
330
|
+
};
|
|
331
|
+
return /* @__PURE__ */ jsx("a", {
|
|
332
|
+
...dragProps,
|
|
333
|
+
...dropProps,
|
|
334
|
+
href,
|
|
335
|
+
"aria-current": target && isCurrent ? "page" : void 0,
|
|
336
|
+
className: containerStyles,
|
|
337
|
+
onClick: onLinkClick,
|
|
338
|
+
children: name
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
const onKeyDown = (event) => {
|
|
342
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
343
|
+
event.preventDefault();
|
|
344
|
+
onClick();
|
|
345
|
+
};
|
|
321
346
|
return /* @__PURE__ */ jsx("div", {
|
|
322
347
|
...dragProps,
|
|
323
348
|
...dropProps,
|
|
324
349
|
className: containerStyles,
|
|
325
350
|
onClick,
|
|
351
|
+
onKeyDown,
|
|
326
352
|
role: "button",
|
|
353
|
+
tabIndex: 0,
|
|
327
354
|
children: name
|
|
328
355
|
});
|
|
329
356
|
}
|
|
330
357
|
//#endregion
|
|
331
|
-
//#region src/connect/components/
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
358
|
+
//#region src/connect/components/catch-up-inspector/catch-up-inspector.tsx
|
|
359
|
+
const COLUMNS$3 = [
|
|
360
|
+
{
|
|
361
|
+
key: "consumerId",
|
|
362
|
+
label: "Consumer",
|
|
363
|
+
width: "180px"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
key: "thread",
|
|
367
|
+
label: "Thread",
|
|
368
|
+
width: "90px"
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
key: "appliedThrough",
|
|
372
|
+
label: "Applied Through",
|
|
373
|
+
width: "110px"
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
key: "lag",
|
|
377
|
+
label: "Lag",
|
|
378
|
+
width: "70px"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
key: "trackedAbove",
|
|
382
|
+
label: "Tracked Above",
|
|
383
|
+
width: "100px"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
key: "lastAdvance",
|
|
387
|
+
label: "Last Advance",
|
|
388
|
+
width: "160px"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
key: "blockedOrdinal",
|
|
392
|
+
label: "Blocked At",
|
|
393
|
+
width: "90px"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
key: "blockedDocument",
|
|
397
|
+
label: "Document",
|
|
398
|
+
width: "150px"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
key: "blockedScope",
|
|
402
|
+
label: "Scope",
|
|
403
|
+
width: "80px"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
key: "blockedBranch",
|
|
407
|
+
label: "Branch",
|
|
408
|
+
width: "80px"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
key: "blockedType",
|
|
412
|
+
label: "Type",
|
|
413
|
+
width: "140px"
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
key: "blockedError",
|
|
417
|
+
label: "Error",
|
|
418
|
+
width: "180px"
|
|
419
|
+
}
|
|
420
|
+
];
|
|
421
|
+
const POLL_INTERVAL_MS = 2e3;
|
|
422
|
+
function truncateId$3(id, maxLength = 12) {
|
|
423
|
+
if (id.length <= maxLength) return id;
|
|
424
|
+
return id.slice(0, maxLength) + "...";
|
|
425
|
+
}
|
|
426
|
+
function formatDuration(ms) {
|
|
427
|
+
const totalSeconds = Math.max(0, Math.floor(ms / 1e3));
|
|
428
|
+
const hours = Math.floor(totalSeconds / 3600);
|
|
429
|
+
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
430
|
+
const seconds = totalSeconds % 60;
|
|
431
|
+
if (hours > 0) return `${hours}h ${minutes}m ${seconds}s`;
|
|
432
|
+
if (minutes > 0) return `${minutes}m ${seconds}s`;
|
|
433
|
+
return `${seconds}s`;
|
|
434
|
+
}
|
|
435
|
+
function Empty() {
|
|
436
|
+
return /* @__PURE__ */ jsx("span", {
|
|
437
|
+
className: "text-muted-foreground",
|
|
438
|
+
children: "-"
|
|
339
439
|
});
|
|
340
440
|
}
|
|
341
|
-
function
|
|
342
|
-
return /* @__PURE__ */ jsx(
|
|
343
|
-
|
|
344
|
-
children
|
|
345
|
-
name: "Xmark",
|
|
346
|
-
size: 16
|
|
347
|
-
})
|
|
441
|
+
function Cell({ children }) {
|
|
442
|
+
return /* @__PURE__ */ jsx("td", {
|
|
443
|
+
className: "border-l border-border px-3 py-2 text-xs text-foreground",
|
|
444
|
+
children
|
|
348
445
|
});
|
|
349
446
|
}
|
|
350
|
-
function
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
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]
|
|
447
|
+
function TruncatedText({ text, className }) {
|
|
448
|
+
return /* @__PURE__ */ jsx("span", {
|
|
449
|
+
className: twMerge("block truncate", className),
|
|
450
|
+
title: text,
|
|
451
|
+
children: text
|
|
360
452
|
});
|
|
361
453
|
}
|
|
362
|
-
function
|
|
363
|
-
const
|
|
364
|
-
const
|
|
365
|
-
const
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
454
|
+
function CatchUpInspector({ status, onRefresh, onSweepNow }) {
|
|
455
|
+
const [loading, setLoading] = useState(true);
|
|
456
|
+
const [sweeping, setSweeping] = useState(false);
|
|
457
|
+
const [error, setError] = useState(null);
|
|
458
|
+
const [now, setNow] = useState();
|
|
459
|
+
const loadStatus = useCallback(async () => {
|
|
460
|
+
try {
|
|
461
|
+
await onRefresh();
|
|
462
|
+
setError(null);
|
|
463
|
+
setNow(Date.now());
|
|
464
|
+
} catch (e) {
|
|
465
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
466
|
+
} finally {
|
|
467
|
+
setLoading(false);
|
|
468
|
+
}
|
|
469
|
+
}, [onRefresh]);
|
|
470
|
+
useEffect(() => {
|
|
471
|
+
loadStatus();
|
|
472
|
+
const interval = setInterval(() => {
|
|
473
|
+
loadStatus();
|
|
474
|
+
}, POLL_INTERVAL_MS);
|
|
475
|
+
return () => clearInterval(interval);
|
|
476
|
+
}, [loadStatus]);
|
|
477
|
+
const handleRefresh = useCallback(async () => {
|
|
478
|
+
setLoading(true);
|
|
479
|
+
await loadStatus();
|
|
480
|
+
}, [loadStatus]);
|
|
481
|
+
const handleSweepNow = useCallback(async () => {
|
|
482
|
+
setSweeping(true);
|
|
483
|
+
try {
|
|
484
|
+
await onSweepNow();
|
|
485
|
+
setError(null);
|
|
486
|
+
} catch (e) {
|
|
487
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
488
|
+
} finally {
|
|
489
|
+
setSweeping(false);
|
|
490
|
+
}
|
|
491
|
+
await loadStatus();
|
|
492
|
+
}, [onSweepNow, loadStatus]);
|
|
493
|
+
const watermark = status?.watermark;
|
|
494
|
+
const consumers = status?.consumers ?? [];
|
|
495
|
+
const settledThrough = watermark?.settledThrough ?? 0;
|
|
496
|
+
const blockedCount = consumers.filter((c) => c.blockedAt).length;
|
|
497
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
498
|
+
className: "flex h-full flex-col gap-2",
|
|
499
|
+
children: [
|
|
500
|
+
/* @__PURE__ */ jsxs("div", {
|
|
501
|
+
className: "flex shrink-0 items-center justify-between",
|
|
502
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
503
|
+
className: "text-lg font-semibold text-foreground",
|
|
504
|
+
children: "Catch-up Inspector"
|
|
505
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
506
|
+
className: "flex items-center gap-2",
|
|
507
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
508
|
+
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",
|
|
509
|
+
disabled: sweeping,
|
|
510
|
+
onClick: () => void handleSweepNow(),
|
|
511
|
+
type: "button",
|
|
512
|
+
children: "Sweep now"
|
|
513
|
+
}), /* @__PURE__ */ jsxs("button", {
|
|
514
|
+
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",
|
|
515
|
+
disabled: loading,
|
|
516
|
+
onClick: () => void handleRefresh(),
|
|
517
|
+
type: "button",
|
|
518
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
519
|
+
name: "Reload",
|
|
520
|
+
size: 14
|
|
521
|
+
}), "Refresh"]
|
|
522
|
+
})]
|
|
523
|
+
})]
|
|
524
|
+
}),
|
|
525
|
+
watermark && /* @__PURE__ */ jsxs("div", {
|
|
526
|
+
className: "flex shrink-0 flex-wrap items-center gap-4 rounded-lg bg-muted px-4 py-2 text-sm",
|
|
527
|
+
children: [
|
|
528
|
+
/* @__PURE__ */ jsxs("div", {
|
|
529
|
+
className: "text-foreground",
|
|
530
|
+
children: ["Head: ", /* @__PURE__ */ jsx("span", {
|
|
531
|
+
className: "font-medium",
|
|
532
|
+
children: watermark.head
|
|
533
|
+
})]
|
|
534
|
+
}),
|
|
535
|
+
/* @__PURE__ */ jsxs("div", {
|
|
536
|
+
className: "text-foreground",
|
|
537
|
+
children: [
|
|
538
|
+
"Settled through:",
|
|
539
|
+
" ",
|
|
540
|
+
/* @__PURE__ */ jsx("span", {
|
|
541
|
+
className: "font-medium",
|
|
542
|
+
children: watermark.settledThrough
|
|
543
|
+
})
|
|
544
|
+
]
|
|
545
|
+
}),
|
|
546
|
+
/* @__PURE__ */ jsxs("div", {
|
|
547
|
+
className: "text-foreground",
|
|
548
|
+
children: [
|
|
549
|
+
"Lag:",
|
|
550
|
+
" ",
|
|
551
|
+
/* @__PURE__ */ jsx("span", {
|
|
552
|
+
className: "font-medium",
|
|
553
|
+
children: watermark.head - watermark.settledThrough
|
|
554
|
+
})
|
|
555
|
+
]
|
|
556
|
+
}),
|
|
557
|
+
/* @__PURE__ */ jsxs("div", {
|
|
558
|
+
className: "text-foreground",
|
|
559
|
+
children: [
|
|
560
|
+
"Waiting on:",
|
|
561
|
+
" ",
|
|
562
|
+
/* @__PURE__ */ jsx("span", {
|
|
563
|
+
className: "font-medium",
|
|
564
|
+
children: watermark.waitingOn.length > 0 ? watermark.waitingOn.join(", ") : "none"
|
|
565
|
+
})
|
|
566
|
+
]
|
|
567
|
+
}),
|
|
568
|
+
watermark.stalledSinceUtcMs !== void 0 && now !== void 0 && /* @__PURE__ */ jsxs("div", {
|
|
569
|
+
className: "flex items-center gap-2 text-destructive",
|
|
570
|
+
children: [
|
|
571
|
+
/* @__PURE__ */ jsx("span", { className: "size-2 rounded-full bg-destructive" }),
|
|
572
|
+
"Stalled for:",
|
|
573
|
+
" ",
|
|
574
|
+
/* @__PURE__ */ jsx("span", {
|
|
575
|
+
className: "font-medium",
|
|
576
|
+
title: new Date(watermark.stalledSinceUtcMs).toISOString(),
|
|
577
|
+
children: formatDuration(now - watermark.stalledSinceUtcMs)
|
|
578
|
+
})
|
|
579
|
+
]
|
|
580
|
+
}),
|
|
581
|
+
/* @__PURE__ */ jsxs("div", {
|
|
582
|
+
className: "flex items-center gap-2 text-foreground",
|
|
583
|
+
children: [
|
|
584
|
+
/* @__PURE__ */ jsx("span", { className: "size-2 rounded-full bg-destructive" }),
|
|
585
|
+
"Blocked: ",
|
|
586
|
+
/* @__PURE__ */ jsx("span", {
|
|
587
|
+
className: "font-medium",
|
|
588
|
+
children: blockedCount
|
|
589
|
+
})
|
|
590
|
+
]
|
|
591
|
+
})
|
|
592
|
+
]
|
|
593
|
+
}),
|
|
594
|
+
error && /* @__PURE__ */ jsxs("div", {
|
|
595
|
+
className: "shrink-0 rounded-lg border border-destructive bg-destructive/10 px-4 py-2 text-sm text-destructive",
|
|
596
|
+
children: ["Catch-up request failed: ", error]
|
|
597
|
+
}),
|
|
598
|
+
/* @__PURE__ */ jsx("div", {
|
|
599
|
+
className: "max-h-full overflow-auto rounded-lg border border-border",
|
|
600
|
+
children: /* @__PURE__ */ jsxs("table", {
|
|
601
|
+
className: "w-full border-collapse",
|
|
602
|
+
children: [/* @__PURE__ */ jsx("thead", {
|
|
603
|
+
className: "sticky top-0 bg-muted",
|
|
604
|
+
children: /* @__PURE__ */ jsx("tr", { children: COLUMNS$3.map((column, index) => /* @__PURE__ */ jsx("th", {
|
|
605
|
+
className: twMerge("px-3 py-2 text-left text-xs font-medium text-foreground", index > 0 && "border-l border-border"),
|
|
606
|
+
style: { width: column.width },
|
|
607
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
608
|
+
className: "truncate",
|
|
609
|
+
children: column.label
|
|
610
|
+
})
|
|
611
|
+
}, column.key)) })
|
|
612
|
+
}), /* @__PURE__ */ jsx("tbody", { children: loading && !status ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
|
|
613
|
+
className: "px-3 py-8 text-center text-sm text-muted-foreground",
|
|
614
|
+
colSpan: COLUMNS$3.length,
|
|
615
|
+
children: "Loading..."
|
|
616
|
+
}) }) : consumers.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
|
|
617
|
+
className: "px-3 py-8 text-center text-sm text-muted-foreground",
|
|
618
|
+
colSpan: COLUMNS$3.length,
|
|
619
|
+
children: "No catch-up consumers"
|
|
620
|
+
}) }) : consumers.map((consumer) => {
|
|
621
|
+
const blocked = consumer.blockedAt;
|
|
622
|
+
const lastAdvance = new Date(consumer.lastAdvanceUtcMs);
|
|
623
|
+
return /* @__PURE__ */ jsxs("tr", {
|
|
624
|
+
className: twMerge("hover:hover-effect", blocked ? "bg-destructive/10" : "odd:bg-card even:bg-background"),
|
|
625
|
+
children: [
|
|
626
|
+
/* @__PURE__ */ jsx("td", {
|
|
627
|
+
className: "px-3 py-2 text-xs text-foreground",
|
|
628
|
+
children: /* @__PURE__ */ jsx(TruncatedText, { text: consumer.consumerId })
|
|
629
|
+
}),
|
|
630
|
+
/* @__PURE__ */ jsx(Cell, { children: consumer.thread }),
|
|
631
|
+
/* @__PURE__ */ jsx(Cell, { children: consumer.appliedThrough }),
|
|
632
|
+
/* @__PURE__ */ jsx(Cell, { children: settledThrough - consumer.appliedThrough }),
|
|
633
|
+
/* @__PURE__ */ jsx(Cell, { children: consumer.trackedAbove }),
|
|
634
|
+
/* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx("span", {
|
|
635
|
+
className: "block truncate",
|
|
636
|
+
title: lastAdvance.toISOString(),
|
|
637
|
+
children: lastAdvance.toLocaleString()
|
|
638
|
+
}) }),
|
|
639
|
+
/* @__PURE__ */ jsx(Cell, { children: blocked ? blocked.ordinal : /* @__PURE__ */ jsx(Empty, {}) }),
|
|
640
|
+
/* @__PURE__ */ jsx(Cell, { children: blocked ? /* @__PURE__ */ jsx("span", {
|
|
641
|
+
className: "block truncate",
|
|
642
|
+
title: blocked.documentId,
|
|
643
|
+
children: truncateId$3(blocked.documentId)
|
|
644
|
+
}) : /* @__PURE__ */ jsx(Empty, {}) }),
|
|
645
|
+
/* @__PURE__ */ jsx(Cell, { children: blocked ? blocked.scope : /* @__PURE__ */ jsx(Empty, {}) }),
|
|
646
|
+
/* @__PURE__ */ jsx(Cell, { children: blocked ? blocked.branch : /* @__PURE__ */ jsx(Empty, {}) }),
|
|
647
|
+
/* @__PURE__ */ jsx(Cell, { children: blocked ? /* @__PURE__ */ jsx(TruncatedText, { text: blocked.type }) : /* @__PURE__ */ jsx(Empty, {}) }),
|
|
648
|
+
/* @__PURE__ */ jsx(Cell, { children: blocked ? /* @__PURE__ */ jsx(TruncatedText, {
|
|
649
|
+
className: "text-destructive",
|
|
650
|
+
text: blocked.error
|
|
651
|
+
}) : /* @__PURE__ */ jsx(Empty, {}) })
|
|
652
|
+
]
|
|
653
|
+
}, consumer.consumerId);
|
|
654
|
+
}) })]
|
|
655
|
+
})
|
|
656
|
+
}),
|
|
657
|
+
/* @__PURE__ */ jsxs("div", {
|
|
658
|
+
className: "shrink-0 text-sm text-foreground",
|
|
659
|
+
children: [
|
|
660
|
+
"Showing ",
|
|
661
|
+
consumers.length,
|
|
662
|
+
" consumer(s)"
|
|
663
|
+
]
|
|
440
664
|
})
|
|
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
|
-
})
|
|
665
|
+
]
|
|
465
666
|
});
|
|
466
667
|
}
|
|
467
668
|
//#endregion
|
|
669
|
+
//#region src/connect/components/combobox/combobox.tsx
|
|
670
|
+
const Combobox = lazyComponent(() => import("../combobox.impl-EqgAawKJ.js").then((m) => m.Combobox));
|
|
671
|
+
//#endregion
|
|
468
672
|
//#region src/connect/components/consent-banner/consent-banner.tsx
|
|
469
673
|
const CookieBanner = (props) => {
|
|
470
674
|
const { children, cookies, submitLabel, rejectLabel, onSubmit = () => {}, onReject = () => {}, className, ...divProps } = props;
|
|
@@ -527,8 +731,9 @@ function ModalButton(props) {
|
|
|
527
731
|
const { variant, className, ...rest } = props;
|
|
528
732
|
const confirmStyle = twMerge(defaultStyle, "bg-primary text-primary-foreground");
|
|
529
733
|
const cancelStyle = twMerge(defaultStyle, "bg-muted text-muted-foreground");
|
|
734
|
+
const variantStyle = twMerge(variant === "confirm" ? confirmStyle : cancelStyle, className);
|
|
530
735
|
return /* @__PURE__ */ jsx("button", {
|
|
531
|
-
className:
|
|
736
|
+
className: variantStyle,
|
|
532
737
|
...rest
|
|
533
738
|
});
|
|
534
739
|
}
|
|
@@ -702,7 +907,7 @@ function SchemaTreeSidebar({ schema, tables, selectedTable, onSelectTable, onRef
|
|
|
702
907
|
//#endregion
|
|
703
908
|
//#region src/connect/components/select/select.tsx
|
|
704
909
|
function fixedForwardRef(render) {
|
|
705
|
-
return
|
|
910
|
+
return /*#__PURE__*/ forwardRef(render);
|
|
706
911
|
}
|
|
707
912
|
const ConnectSelect = /* @__PURE__ */ fixedForwardRef(function Select(props, ref) {
|
|
708
913
|
const { items, value, id, onChange, containerClassName, menuClassName, itemClassName, absolutePositionMenu = false, borderRadius = "6px", listClassName } = props;
|
|
@@ -1279,9 +1484,10 @@ function DBExplorer({ schema, getTables, getTableRows, getDefaultSort, pageSize
|
|
|
1279
1484
|
]);
|
|
1280
1485
|
const handleCopyAll = useCallback(async () => {
|
|
1281
1486
|
if (!selectedTable) return "";
|
|
1487
|
+
const limit = pagination.total ?? 1e6;
|
|
1282
1488
|
return rowsToCsv((await getTableRows(selectedTable, {
|
|
1283
1489
|
schema,
|
|
1284
|
-
limit
|
|
1490
|
+
limit,
|
|
1285
1491
|
offset: 0,
|
|
1286
1492
|
sort,
|
|
1287
1493
|
filters
|
|
@@ -1638,9 +1844,7 @@ const SEQUENCE = [
|
|
|
1638
1844
|
}
|
|
1639
1845
|
];
|
|
1640
1846
|
const ANIM_DUR = 460;
|
|
1641
|
-
const
|
|
1642
|
-
const LAST_DROP = 1220;
|
|
1643
|
-
const LOOP_TOTAL = LAST_DROP + ANIM_DUR + HOLD + 1040 + ANIM_DUR + 400;
|
|
1847
|
+
const LOOP_TOTAL = 4380;
|
|
1644
1848
|
const DROP_STYLE = `brickDrop ${ANIM_DUR}ms cubic-bezier(0.28, 1.08, 0.58, 1) forwards`;
|
|
1645
1849
|
const FALL_STYLE = `brickFall ${ANIM_DUR}ms cubic-bezier(0.28, 1.08, 0.58, 1) forwards`;
|
|
1646
1850
|
const PATHS = {
|
|
@@ -1699,7 +1903,7 @@ function LogoAnimation({ size = 48, className = "" }) {
|
|
|
1699
1903
|
clearTimers();
|
|
1700
1904
|
resetAll();
|
|
1701
1905
|
SEQUENCE.forEach(({ id, dropDelay }) => runDrop(id, dropDelay));
|
|
1702
|
-
const fallStart =
|
|
1906
|
+
const fallStart = 2480;
|
|
1703
1907
|
SEQUENCE.forEach(({ id, fallDelay }) => runFall(id, fallStart + fallDelay));
|
|
1704
1908
|
schedule(startLoop, LOOP_TOTAL);
|
|
1705
1909
|
}
|
|
@@ -1789,7 +1993,7 @@ function TabContent(props) {
|
|
|
1789
1993
|
const toTabValue = (label) => label.trim().replace(/\s+/g, "-");
|
|
1790
1994
|
const resolveTabValue = (props) => props.value ?? toTabValue(props.label);
|
|
1791
1995
|
function Tabs({ children, defaultValue, onValueChange, listClassName }) {
|
|
1792
|
-
return /* @__PURE__ */ jsxs(Root$
|
|
1996
|
+
return /* @__PURE__ */ jsxs(Root$1, {
|
|
1793
1997
|
defaultValue: toTabValue(defaultValue),
|
|
1794
1998
|
onValueChange,
|
|
1795
1999
|
className: "flex min-h-0 flex-1 flex-col gap-2",
|
|
@@ -1798,10 +2002,10 @@ function Tabs({ children, defaultValue, onValueChange, listClassName }) {
|
|
|
1798
2002
|
children: /* @__PURE__ */ jsx(List, {
|
|
1799
2003
|
className: "flex w-full gap-x-2 rounded-xl p-1 text-sm font-semibold text-foreground outline-none",
|
|
1800
2004
|
children: React.Children.map(children, (child, _i) => {
|
|
1801
|
-
if (
|
|
2005
|
+
if (!/*#__PURE__*/ React.isValidElement(child)) return;
|
|
1802
2006
|
const props = child.props;
|
|
1803
2007
|
const value = resolveTabValue(props);
|
|
1804
|
-
return /* @__PURE__ */ jsx(Trigger$
|
|
2008
|
+
return /* @__PURE__ */ jsx(Trigger$1, {
|
|
1805
2009
|
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
2010
|
value,
|
|
1807
2011
|
disabled: props.disabled ?? false,
|
|
@@ -1812,10 +2016,11 @@ function Tabs({ children, defaultValue, onValueChange, listClassName }) {
|
|
|
1812
2016
|
}), /* @__PURE__ */ jsx("div", {
|
|
1813
2017
|
className: "mt-3 min-h-0 flex-1 rounded-md bg-background",
|
|
1814
2018
|
children: React.Children.map(children, (child, i) => {
|
|
1815
|
-
if (
|
|
1816
|
-
|
|
2019
|
+
if (!/*#__PURE__*/ React.isValidElement(child)) return;
|
|
2020
|
+
const value = resolveTabValue(child.props);
|
|
2021
|
+
return /* @__PURE__ */ jsx(Content$1, {
|
|
1817
2022
|
className: "h-full",
|
|
1818
|
-
value
|
|
2023
|
+
value,
|
|
1819
2024
|
children: child
|
|
1820
2025
|
}, i);
|
|
1821
2026
|
})
|
|
@@ -1827,292 +2032,29 @@ function Tabs({ children, defaultValue, onValueChange, listClassName }) {
|
|
|
1827
2032
|
function formatScopeLabel(text) {
|
|
1828
2033
|
if (!text) return "";
|
|
1829
2034
|
return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase();
|
|
1830
|
-
}
|
|
1831
|
-
function DocumentStateViewer({ state, ignoredScopes = ["auth", "document"], defaultScope, className }) {
|
|
1832
|
-
const scopes = useMemo(() => Object.keys(state).filter((scope) => !ignoredScopes.includes(scope)), [state, ignoredScopes]);
|
|
1833
|
-
const initialScope = defaultScope || scopes.at(0) || "global";
|
|
1834
|
-
if (scopes.length === 0) return /* @__PURE__ */ jsx("div", {
|
|
1835
|
-
className: "text-sm text-muted-foreground",
|
|
1836
|
-
children: "No state data"
|
|
1837
|
-
});
|
|
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
|
-
})
|
|
2035
|
+
}
|
|
2036
|
+
function DocumentStateViewer({ state, ignoredScopes = ["auth", "document"], defaultScope, className }) {
|
|
2037
|
+
const scopes = useMemo(() => Object.keys(state).filter((scope) => !ignoredScopes.includes(scope)), [state, ignoredScopes]);
|
|
2038
|
+
const initialScope = defaultScope || scopes.at(0) || "global";
|
|
2039
|
+
if (scopes.length === 0) return /* @__PURE__ */ jsx("div", {
|
|
2040
|
+
className: "text-sm text-muted-foreground",
|
|
2041
|
+
children: "No state data"
|
|
2114
2042
|
});
|
|
2115
|
-
|
|
2043
|
+
return /* @__PURE__ */ jsx(Tabs, {
|
|
2044
|
+
defaultValue: formatScopeLabel(initialScope),
|
|
2045
|
+
children: scopes.map((scope) => /* @__PURE__ */ jsx(TabContent, {
|
|
2046
|
+
label: formatScopeLabel(scope),
|
|
2047
|
+
description: scope,
|
|
2048
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
2049
|
+
className: twMerge("-mt-2 rounded-md border border-border bg-background p-3 font-mono text-sm", className),
|
|
2050
|
+
children: /* @__PURE__ */ jsx(JsonViewer, { data: state[scope] })
|
|
2051
|
+
})
|
|
2052
|
+
}, scope))
|
|
2053
|
+
});
|
|
2054
|
+
}
|
|
2055
|
+
//#endregion
|
|
2056
|
+
//#region src/connect/components/document-timeline/document-timeline.tsx
|
|
2057
|
+
const DocumentTimeline = lazyComponent(() => import("../document-timeline.impl-CCkyXpt5.js").then((m) => m.DocumentTimeline));
|
|
2116
2058
|
//#endregion
|
|
2117
2059
|
//#region src/connect/components/document-toolbar/containers.tsx
|
|
2118
2060
|
/**
|
|
@@ -2239,12 +2181,11 @@ function ToolbarRedoButton(props) {
|
|
|
2239
2181
|
}) } = props;
|
|
2240
2182
|
const { redo, canRedo } = useRedo(document?.header.id);
|
|
2241
2183
|
const onClick = makeOnClick(document, onClickOverride, redo);
|
|
2242
|
-
const disabled = !canRedo;
|
|
2243
2184
|
return /* @__PURE__ */ jsx(ToolbarButton, {
|
|
2244
2185
|
"data-testid": "toolbar-redo-button",
|
|
2245
2186
|
"aria-label": "Redo",
|
|
2246
2187
|
className,
|
|
2247
|
-
disabled,
|
|
2188
|
+
disabled: !canRedo,
|
|
2248
2189
|
onClick,
|
|
2249
2190
|
children
|
|
2250
2191
|
});
|
|
@@ -2315,7 +2256,8 @@ function ToolbarHistoryButton(props) {
|
|
|
2315
2256
|
/**
|
|
2316
2257
|
* Toolbar control for closing the current document view.
|
|
2317
2258
|
*
|
|
2318
|
-
* By default, this
|
|
2259
|
+
* By default, this goes back when the app's history allows, else it selects the
|
|
2260
|
+
* current document's parent folder. Provide
|
|
2319
2261
|
* `children` to replace the default icon, or `onClick` to override the default
|
|
2320
2262
|
* close behavior.
|
|
2321
2263
|
*/
|
|
@@ -2324,8 +2266,7 @@ function ToolbarCloseButton(props) {
|
|
|
2324
2266
|
name: "XmarkLight",
|
|
2325
2267
|
size: 16
|
|
2326
2268
|
}) } = props;
|
|
2327
|
-
const
|
|
2328
|
-
const onClick = makeOnClick(document, onClickOverride, () => setSelectedNode(parentFolder));
|
|
2269
|
+
const onClick = makeOnClick(document, onClickOverride, useCloseNode(document?.header.id));
|
|
2329
2270
|
return /* @__PURE__ */ jsx(ToolbarButton, {
|
|
2330
2271
|
"data-testid": "toolbar-close-button",
|
|
2331
2272
|
"aria-label": "Close document",
|
|
@@ -2860,7 +2801,7 @@ function UploadFileItemStatusRow(props) {
|
|
|
2860
2801
|
}
|
|
2861
2802
|
//#endregion
|
|
2862
2803
|
//#region src/connect/components/upload-file-item/upload-file-item.tsx
|
|
2863
|
-
const UploadFileItem =
|
|
2804
|
+
const UploadFileItem = /*#__PURE__*/ forwardRef(function UploadFileItem(props, ref) {
|
|
2864
2805
|
const { fileName, fileSize, status, documentType, progress = 0, errorDetails, onClose, onOpenDocument, onFindResolution, className, ...delegatedProps } = props;
|
|
2865
2806
|
return /* @__PURE__ */ jsxs("div", {
|
|
2866
2807
|
ref,
|
|
@@ -3100,7 +3041,7 @@ function uploadsReducer(state, action) {
|
|
|
3100
3041
|
}
|
|
3101
3042
|
}
|
|
3102
3043
|
function useUploadTracker(useLocalStorage = false, driveId) {
|
|
3103
|
-
const
|
|
3044
|
+
const getInitialState = useCallback(() => {
|
|
3104
3045
|
if (useLocalStorage && driveId) try {
|
|
3105
3046
|
const stored = localStorage.getItem(`uploadTracker_${driveId}`);
|
|
3106
3047
|
if (stored) return JSON.parse(stored);
|
|
@@ -3110,7 +3051,8 @@ function useUploadTracker(useLocalStorage = false, driveId) {
|
|
|
3110
3051
|
return {};
|
|
3111
3052
|
}
|
|
3112
3053
|
return {};
|
|
3113
|
-
}, [useLocalStorage, driveId])
|
|
3054
|
+
}, [useLocalStorage, driveId]);
|
|
3055
|
+
const [uploads, dispatch] = useReducer(uploadsReducer, getInitialState());
|
|
3114
3056
|
useEffect(() => {
|
|
3115
3057
|
if (useLocalStorage && driveId) try {
|
|
3116
3058
|
localStorage.setItem(`uploadTracker_${driveId}`, JSON.stringify(uploads));
|
|
@@ -3152,11 +3094,12 @@ function useUploadTracker(useLocalStorage = false, driveId) {
|
|
|
3152
3094
|
});
|
|
3153
3095
|
};
|
|
3154
3096
|
try {
|
|
3097
|
+
const fileNode = await onAddFile(file, parent, progressCallback);
|
|
3155
3098
|
dispatch({
|
|
3156
3099
|
type: "SET_FILE_NODE",
|
|
3157
3100
|
payload: {
|
|
3158
3101
|
id: fileId,
|
|
3159
|
-
fileNode:
|
|
3102
|
+
fileNode: fileNode || void 0
|
|
3160
3103
|
}
|
|
3161
3104
|
});
|
|
3162
3105
|
} catch (error) {
|
|
@@ -3262,6 +3205,7 @@ function DropZone(props) {
|
|
|
3262
3205
|
setConflictUploadId(null);
|
|
3263
3206
|
};
|
|
3264
3207
|
const { isDropTarget, ...dropProps } = useDropFile(handleAddFile);
|
|
3208
|
+
const setSelectedNode = useSetSelectedNode();
|
|
3265
3209
|
return /* @__PURE__ */ jsxs("div", {
|
|
3266
3210
|
className: twMerge("relative", className),
|
|
3267
3211
|
...enable ? dropProps : {},
|
|
@@ -3429,23 +3373,6 @@ function EditorUndoRedoButtons(props) {
|
|
|
3429
3373
|
});
|
|
3430
3374
|
}
|
|
3431
3375
|
//#endregion
|
|
3432
|
-
//#region assets/powerhouse-rounded.png
|
|
3433
|
-
var powerhouse_rounded_default = "data:image/png;base64,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";
|
|
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
|
-
}
|
|
3446
|
-
});
|
|
3447
|
-
}
|
|
3448
|
-
//#endregion
|
|
3449
3376
|
//#region src/connect/constants/options.tsx
|
|
3450
3377
|
const defaultDriveOptions = [
|
|
3451
3378
|
"DOWNLOAD",
|
|
@@ -3675,6 +3602,11 @@ function getDriveSharingType$1(drive) {
|
|
|
3675
3602
|
}
|
|
3676
3603
|
function FileItem(props) {
|
|
3677
3604
|
const { fileNode, className, customDocumentIconSrc } = props;
|
|
3605
|
+
const setSelectedNode = useSetSelectedNode();
|
|
3606
|
+
const preloadNode = usePreloadNode();
|
|
3607
|
+
const target = useNodeTarget(fileNode);
|
|
3608
|
+
const link = useLinkProps(target, () => setSelectedNode(fileNode));
|
|
3609
|
+
const href = props.href ?? (target ? link.href : void 0);
|
|
3678
3610
|
const [mode, setMode] = useState("READ");
|
|
3679
3611
|
const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState(false);
|
|
3680
3612
|
const [selectedDrive] = useSelectedDriveSafe();
|
|
@@ -3685,9 +3617,12 @@ function FileItem(props) {
|
|
|
3685
3617
|
});
|
|
3686
3618
|
const { isAllowedToCreateDocuments } = useUserPermissions();
|
|
3687
3619
|
const editorModules = useEditorModulesForDocumentType(fileNode.documentType);
|
|
3688
|
-
const
|
|
3689
|
-
|
|
3690
|
-
|
|
3620
|
+
const preload = () => {
|
|
3621
|
+
editorModules?.forEach((editorModule) => {
|
|
3622
|
+
preloadEditorModule(editorModule);
|
|
3623
|
+
});
|
|
3624
|
+
preloadNode(fileNode);
|
|
3625
|
+
};
|
|
3691
3626
|
const { onRenameNode, onRenameDriveNodes, onDuplicateNode } = useNodeActions();
|
|
3692
3627
|
const downloadDocument = useDownloadDocument(fileNode.id);
|
|
3693
3628
|
const isReadMode = mode === "READ";
|
|
@@ -3758,6 +3693,7 @@ function FileItem(props) {
|
|
|
3758
3693
|
children: /* @__PURE__ */ jsx("button", {
|
|
3759
3694
|
className: twMerge("hidden group-hover:block", isDropdownMenuOpen && "block"),
|
|
3760
3695
|
onClick: (e) => {
|
|
3696
|
+
e.preventDefault();
|
|
3761
3697
|
e.stopPropagation();
|
|
3762
3698
|
setIsDropdownMenuOpen(true);
|
|
3763
3699
|
},
|
|
@@ -3773,10 +3709,15 @@ function FileItem(props) {
|
|
|
3773
3709
|
onCancel,
|
|
3774
3710
|
onSubmit
|
|
3775
3711
|
});
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3712
|
+
const isLink = isReadMode && !!href;
|
|
3713
|
+
return /* @__PURE__ */ jsx(isLink ? "a" : "div", {
|
|
3714
|
+
href: isLink ? href : void 0,
|
|
3715
|
+
"aria-current": isLink ? link["aria-current"] : void 0,
|
|
3716
|
+
className: "relative block w-64",
|
|
3717
|
+
onClick: isLink ? link.onClick : isReadMode ? () => setSelectedNode(fileNode) : void 0,
|
|
3718
|
+
onMouseEnter: preload,
|
|
3719
|
+
onTouchStart: preload,
|
|
3720
|
+
onFocus: preload,
|
|
3780
3721
|
...dragProps,
|
|
3781
3722
|
children: /* @__PURE__ */ jsx("div", {
|
|
3782
3723
|
className: containerStyles,
|
|
@@ -3902,6 +3843,11 @@ function DefaultFileIcon() {
|
|
|
3902
3843
|
//#region src/connect/components/folder-item/folder-item.tsx
|
|
3903
3844
|
function FolderItem(props) {
|
|
3904
3845
|
const { folderNode, className } = props;
|
|
3846
|
+
const setSelectedNode = useSetSelectedNode();
|
|
3847
|
+
const preloadNode = usePreloadNode();
|
|
3848
|
+
const target = useNodeTarget(folderNode);
|
|
3849
|
+
const link = useLinkProps(target, () => setSelectedNode(folderNode));
|
|
3850
|
+
const href = props.href ?? (target ? link.href : void 0);
|
|
3905
3851
|
const { isAllowedToCreateDocuments } = useUserPermissions();
|
|
3906
3852
|
const [mode, setMode] = useState("READ");
|
|
3907
3853
|
const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState(false);
|
|
@@ -3949,9 +3895,15 @@ function FolderItem(props) {
|
|
|
3949
3895
|
onSubmit
|
|
3950
3896
|
});
|
|
3951
3897
|
const containerStyles = twMerge("group flex h-12 cursor-pointer items-center rounded-lg bg-muted px-2 select-none", isDragging ? "opacity-60" : isDropTarget ? "bg-info/10" : "", className);
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3898
|
+
const isLink = isReadMode && !!href;
|
|
3899
|
+
return /* @__PURE__ */ jsx(isLink ? "a" : "div", {
|
|
3900
|
+
href: isLink ? href : void 0,
|
|
3901
|
+
"aria-current": isLink ? link["aria-current"] : void 0,
|
|
3902
|
+
className: "relative block w-64 hover:hover-effect",
|
|
3903
|
+
onClick: isLink ? link.onClick : isReadMode ? () => setSelectedNode(folderNode) : void 0,
|
|
3904
|
+
onMouseEnter: () => preloadNode(folderNode),
|
|
3905
|
+
onTouchStart: () => preloadNode(folderNode),
|
|
3906
|
+
onFocus: () => preloadNode(folderNode),
|
|
3955
3907
|
children: /* @__PURE__ */ jsxs("div", {
|
|
3956
3908
|
...dragProps,
|
|
3957
3909
|
...dropProps,
|
|
@@ -3976,6 +3928,7 @@ function FolderItem(props) {
|
|
|
3976
3928
|
children: /* @__PURE__ */ jsx("button", {
|
|
3977
3929
|
className: twMerge("ml-auto hidden group-hover:block", isDropdownMenuOpen && "block"),
|
|
3978
3930
|
onClick: (e) => {
|
|
3931
|
+
e.preventDefault();
|
|
3979
3932
|
e.stopPropagation();
|
|
3980
3933
|
setIsDropdownMenuOpen(true);
|
|
3981
3934
|
},
|
|
@@ -4008,7 +3961,7 @@ const Footer = ({ children, className, ...props }) => {
|
|
|
4008
3961
|
};
|
|
4009
3962
|
//#endregion
|
|
4010
3963
|
//#region src/connect/components/form-input/form-input.tsx
|
|
4011
|
-
const FormInput =
|
|
3964
|
+
const FormInput = /*#__PURE__*/ forwardRef(function FormInput(props, ref) {
|
|
4012
3965
|
const { icon, errorMessage, isDirty, containerClassName, inputClassName, errorMessageClassName, hideErrors = false, ...delegatedProps } = props;
|
|
4013
3966
|
const type = props.type ?? "text";
|
|
4014
3967
|
const isError = !!errorMessage;
|
|
@@ -4029,287 +3982,11 @@ const FormInput = /* @__PURE__ */ forwardRef(function FormInput(props, ref) {
|
|
|
4029
3982
|
})] });
|
|
4030
3983
|
});
|
|
4031
3984
|
//#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
3985
|
//#region src/connect/components/form/add-local-drive-form.tsx
|
|
4067
|
-
|
|
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
|
-
}
|
|
3986
|
+
const AddLocalDriveForm = lazyComponent(() => import("../add-local-drive-form.impl-xsC6R634.js").then((m) => m.AddLocalDriveForm));
|
|
4173
3987
|
//#endregion
|
|
4174
3988
|
//#region src/connect/components/form/add-remote-drive-form.tsx
|
|
4175
|
-
|
|
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
|
-
}
|
|
4265
|
-
//#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
|
-
});
|
|
4312
|
-
}
|
|
3989
|
+
const AddRemoteDriveForm = lazyComponent(() => import("../add-remote-drive-form.impl-B2DxdWGF.js").then((m) => m.AddRemoteDriveForm));
|
|
4313
3990
|
//#endregion
|
|
4314
3991
|
//#region src/connect/components/home-screen/home-background-image.tsx
|
|
4315
3992
|
const HomeBackgroundImage = ({ src } = {}) => {
|
|
@@ -4407,10 +4084,15 @@ const HomeBackgroundImage = ({ src } = {}) => {
|
|
|
4407
4084
|
//#endregion
|
|
4408
4085
|
//#region src/connect/components/home-screen/home-screen-item.tsx
|
|
4409
4086
|
const HomeScreenItem = function HomeScreenItem(props) {
|
|
4410
|
-
const { icon, title, description, containerClassName, shareable, onClick } = props;
|
|
4411
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
4087
|
+
const { icon, title, description, containerClassName, shareable, href, onClick, onPreload } = props;
|
|
4088
|
+
return /* @__PURE__ */ jsxs(href ? "a" : "div", {
|
|
4089
|
+
href,
|
|
4090
|
+
"aria-current": href ? props["aria-current"] : void 0,
|
|
4412
4091
|
className: twMerge("relative flex h-24 w-40 cursor-pointer flex-col items-center justify-center overflow-hidden rounded-md p-2 text-center text-sm text-foreground hover:hover-effect", containerClassName, onClick && "cursor-pointer"),
|
|
4413
4092
|
onClick,
|
|
4093
|
+
onMouseEnter: onPreload,
|
|
4094
|
+
onTouchStart: onPreload,
|
|
4095
|
+
onFocus: href ? onPreload : void 0,
|
|
4414
4096
|
children: [
|
|
4415
4097
|
/* @__PURE__ */ jsx("div", {
|
|
4416
4098
|
className: "mx-auto pb-2",
|
|
@@ -4490,7 +4172,8 @@ function IntegrityInspector({ onValidate, onRebuildKeyframes, onRebuildSnapshots
|
|
|
4490
4172
|
clearResults();
|
|
4491
4173
|
setStatus("running");
|
|
4492
4174
|
try {
|
|
4493
|
-
|
|
4175
|
+
const result = await onValidate(documentId.trim(), branch.trim() || void 0);
|
|
4176
|
+
setValidationResult(result);
|
|
4494
4177
|
setStatus("done");
|
|
4495
4178
|
} catch (err) {
|
|
4496
4179
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4507,7 +4190,8 @@ function IntegrityInspector({ onValidate, onRebuildKeyframes, onRebuildSnapshots
|
|
|
4507
4190
|
clearResults();
|
|
4508
4191
|
setStatus("running");
|
|
4509
4192
|
try {
|
|
4510
|
-
|
|
4193
|
+
const result = await onRebuildKeyframes(documentId.trim(), branch.trim() || void 0);
|
|
4194
|
+
setRebuildResult(result);
|
|
4511
4195
|
setStatus("done");
|
|
4512
4196
|
} catch (err) {
|
|
4513
4197
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4524,7 +4208,8 @@ function IntegrityInspector({ onValidate, onRebuildKeyframes, onRebuildSnapshots
|
|
|
4524
4208
|
clearResults();
|
|
4525
4209
|
setStatus("running");
|
|
4526
4210
|
try {
|
|
4527
|
-
|
|
4211
|
+
const result = await onRebuildSnapshots(documentId.trim(), branch.trim() || void 0);
|
|
4212
|
+
setRebuildResult(result);
|
|
4528
4213
|
setStatus("done");
|
|
4529
4214
|
} catch (err) {
|
|
4530
4215
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -5102,165 +4787,8 @@ function ConnectDeleteItemModal(props) {
|
|
|
5102
4787
|
});
|
|
5103
4788
|
}
|
|
5104
4789
|
//#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
4790
|
//#region src/connect/components/form/drive-settings-form.tsx
|
|
5169
|
-
|
|
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
|
-
}
|
|
4791
|
+
const DriveSettingsForm = lazyComponent(() => import("../drive-settings-form.impl-Bwam9-CG.js").then((m) => m.DriveSettingsForm));
|
|
5264
4792
|
//#endregion
|
|
5265
4793
|
//#region src/connect/components/modal/drive-settings-modal.tsx
|
|
5266
4794
|
function DriveSettingsModal(props) {
|
|
@@ -5487,7 +5015,8 @@ function ProcessorsInspector({ getProcessors, onRetry }) {
|
|
|
5487
5015
|
const [error, setError] = useState(null);
|
|
5488
5016
|
const loadProcessors = useCallback(async () => {
|
|
5489
5017
|
try {
|
|
5490
|
-
|
|
5018
|
+
const result = await getProcessors();
|
|
5019
|
+
setProcessors(result);
|
|
5491
5020
|
setError(null);
|
|
5492
5021
|
} catch (e) {
|
|
5493
5022
|
setError(e instanceof Error ? e.message : String(e));
|
|
@@ -5517,9 +5046,10 @@ function ProcessorsInspector({ getProcessors, onRetry }) {
|
|
|
5517
5046
|
}
|
|
5518
5047
|
}, [onRetry, loadProcessors]);
|
|
5519
5048
|
const handleSort = (columnKey) => {
|
|
5049
|
+
const newDirection = sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc";
|
|
5520
5050
|
setSort({
|
|
5521
5051
|
column: columnKey,
|
|
5522
|
-
direction:
|
|
5052
|
+
direction: newDirection
|
|
5523
5053
|
});
|
|
5524
5054
|
};
|
|
5525
5055
|
const sortedProcessors = sortProcessors(processors, sort);
|
|
@@ -5841,7 +5371,8 @@ function QueueInspector({ getQueueState, onPause, onResume }) {
|
|
|
5841
5371
|
const [actionInProgress, setActionInProgress] = useState(false);
|
|
5842
5372
|
const [selectedJob, setSelectedJob] = useState(null);
|
|
5843
5373
|
const loadState = useCallback(async () => {
|
|
5844
|
-
|
|
5374
|
+
const newState = await getQueueState();
|
|
5375
|
+
setState(newState);
|
|
5845
5376
|
setLoading(false);
|
|
5846
5377
|
}, [getQueueState]);
|
|
5847
5378
|
useEffect(() => {
|
|
@@ -5868,9 +5399,10 @@ function QueueInspector({ getQueueState, onPause, onResume }) {
|
|
|
5868
5399
|
loadState
|
|
5869
5400
|
]);
|
|
5870
5401
|
const handleSort = (columnKey) => {
|
|
5402
|
+
const newDirection = sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc";
|
|
5871
5403
|
setSort({
|
|
5872
5404
|
column: columnKey,
|
|
5873
|
-
direction:
|
|
5405
|
+
direction: newDirection
|
|
5874
5406
|
});
|
|
5875
5407
|
};
|
|
5876
5408
|
const sortedJobs = sortJobs([...state.executingJobs.map((job) => ({
|
|
@@ -6071,8 +5603,9 @@ const stateStyles = {
|
|
|
6071
5603
|
disconnected: "bg-muted text-foreground"
|
|
6072
5604
|
};
|
|
6073
5605
|
function ConnectionStateBadge({ state, failureCount }) {
|
|
5606
|
+
const style = stateStyles[state] ?? "bg-muted text-foreground";
|
|
6074
5607
|
return /* @__PURE__ */ jsxs("span", {
|
|
6075
|
-
className: twMerge("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",
|
|
5608
|
+
className: twMerge("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium", style),
|
|
6076
5609
|
children: [state, failureCount > 0 && /* @__PURE__ */ jsxs("span", {
|
|
6077
5610
|
className: "text-xs opacity-75",
|
|
6078
5611
|
children: [
|
|
@@ -6722,6 +6255,175 @@ function ChannelInspector({ remoteName, channel, onBack, onRefresh, connectionSt
|
|
|
6722
6255
|
});
|
|
6723
6256
|
}
|
|
6724
6257
|
//#endregion
|
|
6258
|
+
//#region src/connect/components/remotes-inspector/components/peer-agreement-panel.tsx
|
|
6259
|
+
const cell = "px-3 py-1.5 text-xs text-foreground";
|
|
6260
|
+
const head = "px-3 py-1.5 text-left text-xs font-medium text-foreground";
|
|
6261
|
+
function versions(list) {
|
|
6262
|
+
return list && list.length > 0 ? list.join(", ") : "none";
|
|
6263
|
+
}
|
|
6264
|
+
/** How a remote's peer announced itself. */
|
|
6265
|
+
function peerManifestLabel(peer) {
|
|
6266
|
+
if (peer === void 0) return "Not yet heard (baseline)";
|
|
6267
|
+
if (peer.manifest === null) return "Silent (baseline)";
|
|
6268
|
+
return `Announced, revision ${peer.manifest.revision.slice(0, 8)}`;
|
|
6269
|
+
}
|
|
6270
|
+
function PeerAgreementPanel({ remoteName, collectionId, peer, agreement, holds }) {
|
|
6271
|
+
const local = agreement.local();
|
|
6272
|
+
const theirs = agreement.peer(remoteName);
|
|
6273
|
+
const protocols = Object.keys(local.protocols).sort();
|
|
6274
|
+
const features = Object.keys(local.features).sort();
|
|
6275
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
6276
|
+
"aria-label": "Peer agreement",
|
|
6277
|
+
className: "flex flex-col gap-2 rounded-lg border border-border p-3",
|
|
6278
|
+
children: [
|
|
6279
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6280
|
+
className: "flex items-center justify-between",
|
|
6281
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
6282
|
+
className: "text-sm font-semibold text-foreground",
|
|
6283
|
+
children: "Peer agreement"
|
|
6284
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6285
|
+
className: "text-xs text-muted-foreground",
|
|
6286
|
+
children: peerManifestLabel(peer)
|
|
6287
|
+
})]
|
|
6288
|
+
}),
|
|
6289
|
+
/* @__PURE__ */ jsxs("table", {
|
|
6290
|
+
className: "w-full border-collapse",
|
|
6291
|
+
children: [/* @__PURE__ */ jsx("thead", {
|
|
6292
|
+
className: "bg-muted",
|
|
6293
|
+
children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
6294
|
+
/* @__PURE__ */ jsx("th", {
|
|
6295
|
+
className: head,
|
|
6296
|
+
children: "Protocol"
|
|
6297
|
+
}),
|
|
6298
|
+
/* @__PURE__ */ jsx("th", {
|
|
6299
|
+
className: head,
|
|
6300
|
+
children: "Local"
|
|
6301
|
+
}),
|
|
6302
|
+
/* @__PURE__ */ jsx("th", {
|
|
6303
|
+
className: head,
|
|
6304
|
+
children: "Peer"
|
|
6305
|
+
}),
|
|
6306
|
+
/* @__PURE__ */ jsx("th", {
|
|
6307
|
+
className: head,
|
|
6308
|
+
children: "Limits new documents"
|
|
6309
|
+
})
|
|
6310
|
+
] })
|
|
6311
|
+
}), /* @__PURE__ */ jsxs("tbody", { children: [protocols.map((protocol) => {
|
|
6312
|
+
const limits = agreement.limitedBy(collectionId, protocol).includes(remoteName);
|
|
6313
|
+
return /* @__PURE__ */ jsxs("tr", {
|
|
6314
|
+
className: "odd:bg-card even:bg-background",
|
|
6315
|
+
children: [
|
|
6316
|
+
/* @__PURE__ */ jsx("td", {
|
|
6317
|
+
className: cell,
|
|
6318
|
+
children: protocol
|
|
6319
|
+
}),
|
|
6320
|
+
/* @__PURE__ */ jsx("td", {
|
|
6321
|
+
className: cell,
|
|
6322
|
+
children: versions(local.protocols[protocol])
|
|
6323
|
+
}),
|
|
6324
|
+
/* @__PURE__ */ jsx("td", {
|
|
6325
|
+
className: cell,
|
|
6326
|
+
children: versions(theirs.protocols[protocol])
|
|
6327
|
+
}),
|
|
6328
|
+
/* @__PURE__ */ jsx("td", {
|
|
6329
|
+
className: twMerge(cell, limits && "text-warning"),
|
|
6330
|
+
children: limits ? "Yes" : "No"
|
|
6331
|
+
})
|
|
6332
|
+
]
|
|
6333
|
+
}, protocol);
|
|
6334
|
+
}), features.map((feature) => /* @__PURE__ */ jsxs("tr", {
|
|
6335
|
+
className: "odd:bg-card even:bg-background",
|
|
6336
|
+
children: [
|
|
6337
|
+
/* @__PURE__ */ jsxs("td", {
|
|
6338
|
+
className: cell,
|
|
6339
|
+
children: [feature, " (feature)"]
|
|
6340
|
+
}),
|
|
6341
|
+
/* @__PURE__ */ jsx("td", {
|
|
6342
|
+
className: cell,
|
|
6343
|
+
children: versions(local.features[feature])
|
|
6344
|
+
}),
|
|
6345
|
+
/* @__PURE__ */ jsx("td", {
|
|
6346
|
+
className: cell,
|
|
6347
|
+
children: versions(theirs.features[feature])
|
|
6348
|
+
}),
|
|
6349
|
+
/* @__PURE__ */ jsx("td", {
|
|
6350
|
+
className: cell,
|
|
6351
|
+
children: "-"
|
|
6352
|
+
})
|
|
6353
|
+
]
|
|
6354
|
+
}, feature))] })]
|
|
6355
|
+
}),
|
|
6356
|
+
/* @__PURE__ */ jsxs("h4", {
|
|
6357
|
+
className: "text-xs font-semibold text-foreground",
|
|
6358
|
+
children: [
|
|
6359
|
+
"Held documents (",
|
|
6360
|
+
holds.length,
|
|
6361
|
+
")"
|
|
6362
|
+
]
|
|
6363
|
+
}),
|
|
6364
|
+
holds.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
6365
|
+
className: "text-xs text-muted-foreground",
|
|
6366
|
+
children: "No documents held"
|
|
6367
|
+
}) : /* @__PURE__ */ jsxs("table", {
|
|
6368
|
+
className: "w-full border-collapse",
|
|
6369
|
+
children: [/* @__PURE__ */ jsx("thead", {
|
|
6370
|
+
className: "bg-muted",
|
|
6371
|
+
children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
6372
|
+
/* @__PURE__ */ jsx("th", {
|
|
6373
|
+
className: head,
|
|
6374
|
+
children: "Document"
|
|
6375
|
+
}),
|
|
6376
|
+
/* @__PURE__ */ jsx("th", {
|
|
6377
|
+
className: head,
|
|
6378
|
+
children: "Branch"
|
|
6379
|
+
}),
|
|
6380
|
+
/* @__PURE__ */ jsx("th", {
|
|
6381
|
+
className: head,
|
|
6382
|
+
children: "Requires"
|
|
6383
|
+
}),
|
|
6384
|
+
/* @__PURE__ */ jsx("th", {
|
|
6385
|
+
className: head,
|
|
6386
|
+
children: "Peer runs"
|
|
6387
|
+
}),
|
|
6388
|
+
/* @__PURE__ */ jsx("th", {
|
|
6389
|
+
className: head,
|
|
6390
|
+
children: "Held since"
|
|
6391
|
+
})
|
|
6392
|
+
] })
|
|
6393
|
+
}), /* @__PURE__ */ jsx("tbody", { children: holds.map((hold) => /* @__PURE__ */ jsxs("tr", {
|
|
6394
|
+
className: "odd:bg-card even:bg-background",
|
|
6395
|
+
children: [
|
|
6396
|
+
/* @__PURE__ */ jsx("td", {
|
|
6397
|
+
className: cell,
|
|
6398
|
+
children: hold.documentId
|
|
6399
|
+
}),
|
|
6400
|
+
/* @__PURE__ */ jsx("td", {
|
|
6401
|
+
className: cell,
|
|
6402
|
+
children: hold.branch
|
|
6403
|
+
}),
|
|
6404
|
+
/* @__PURE__ */ jsxs("td", {
|
|
6405
|
+
className: cell,
|
|
6406
|
+
children: [
|
|
6407
|
+
hold.reason.protocol,
|
|
6408
|
+
" ",
|
|
6409
|
+
hold.reason.version
|
|
6410
|
+
]
|
|
6411
|
+
}),
|
|
6412
|
+
/* @__PURE__ */ jsx("td", {
|
|
6413
|
+
className: cell,
|
|
6414
|
+
children: versions(hold.reason.peerSupports)
|
|
6415
|
+
}),
|
|
6416
|
+
/* @__PURE__ */ jsx("td", {
|
|
6417
|
+
className: cell,
|
|
6418
|
+
children: new Date(hold.heldAtUtcMs).toLocaleString()
|
|
6419
|
+
})
|
|
6420
|
+
]
|
|
6421
|
+
}, `${hold.documentId}:${hold.branch}`)) })]
|
|
6422
|
+
})
|
|
6423
|
+
]
|
|
6424
|
+
});
|
|
6425
|
+
}
|
|
6426
|
+
//#endregion
|
|
6725
6427
|
//#region src/connect/components/remotes-inspector/remotes-inspector.tsx
|
|
6726
6428
|
const BASE_COLUMNS = [
|
|
6727
6429
|
{
|
|
@@ -6749,6 +6451,11 @@ const BASE_COLUMNS = [
|
|
|
6749
6451
|
label: "Filter",
|
|
6750
6452
|
width: "200px"
|
|
6751
6453
|
},
|
|
6454
|
+
{
|
|
6455
|
+
key: "peer",
|
|
6456
|
+
label: "Peer",
|
|
6457
|
+
width: "160px"
|
|
6458
|
+
},
|
|
6752
6459
|
{
|
|
6753
6460
|
key: "channel",
|
|
6754
6461
|
label: "Channel",
|
|
@@ -6795,7 +6502,7 @@ function sortRemotes(remotes, sort) {
|
|
|
6795
6502
|
return sort.direction === "asc" ? comparison : -comparison;
|
|
6796
6503
|
});
|
|
6797
6504
|
}
|
|
6798
|
-
function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPull, connectionStates }) {
|
|
6505
|
+
function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPull, connectionStates, getAgreement, getHolds }) {
|
|
6799
6506
|
const [remotes, setRemotes] = useState([]);
|
|
6800
6507
|
const [loading, setLoading] = useState(true);
|
|
6801
6508
|
const [sort, setSort] = useState();
|
|
@@ -6803,29 +6510,47 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6803
6510
|
const [manualUrl, setManualUrl] = useState("");
|
|
6804
6511
|
const [adding, setAdding] = useState(false);
|
|
6805
6512
|
const [addError, setAddError] = useState();
|
|
6513
|
+
const [holds, setHolds] = useState([]);
|
|
6806
6514
|
const hasRowActions = !!removeRemote || !!triggerPull;
|
|
6807
6515
|
const columns = useMemo(() => hasRowActions ? [...BASE_COLUMNS, ACTIONS_COLUMN] : BASE_COLUMNS, [hasRowActions]);
|
|
6808
6516
|
const loadRemotes = useCallback(async () => {
|
|
6809
6517
|
setLoading(true);
|
|
6810
|
-
|
|
6518
|
+
const data = await getRemotes();
|
|
6519
|
+
setRemotes(data);
|
|
6811
6520
|
setLoading(false);
|
|
6812
6521
|
}, [getRemotes]);
|
|
6813
6522
|
useEffect(() => {
|
|
6814
6523
|
loadRemotes();
|
|
6815
6524
|
}, [loadRemotes]);
|
|
6525
|
+
useEffect(() => {
|
|
6526
|
+
if (!selectedRemote || !getHolds) return;
|
|
6527
|
+
let current = true;
|
|
6528
|
+
getHolds(selectedRemote.meta.name).then((loaded) => {
|
|
6529
|
+
if (current) setHolds(loaded);
|
|
6530
|
+
}).catch(() => {
|
|
6531
|
+
if (current) setHolds([]);
|
|
6532
|
+
});
|
|
6533
|
+
return () => {
|
|
6534
|
+
current = false;
|
|
6535
|
+
};
|
|
6536
|
+
}, [selectedRemote, getHolds]);
|
|
6816
6537
|
const handleRefresh = useCallback(async () => {
|
|
6817
6538
|
await loadRemotes();
|
|
6818
|
-
if (selectedRemote)
|
|
6539
|
+
if (selectedRemote) {
|
|
6540
|
+
const updated = remotes.find((r) => r.meta.id === selectedRemote.meta.id);
|
|
6541
|
+
setSelectedRemote(updated);
|
|
6542
|
+
}
|
|
6819
6543
|
}, [
|
|
6820
6544
|
loadRemotes,
|
|
6821
6545
|
selectedRemote,
|
|
6822
6546
|
remotes
|
|
6823
6547
|
]);
|
|
6824
6548
|
const handleSort = (columnKey) => {
|
|
6825
|
-
if (columnKey === "channel" || columnKey === "actions" || columnKey === "status") return;
|
|
6549
|
+
if (columnKey === "channel" || columnKey === "actions" || columnKey === "status" || columnKey === "peer") return;
|
|
6550
|
+
const newDirection = sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc";
|
|
6826
6551
|
setSort({
|
|
6827
6552
|
column: columnKey,
|
|
6828
|
-
direction:
|
|
6553
|
+
direction: newDirection
|
|
6829
6554
|
});
|
|
6830
6555
|
};
|
|
6831
6556
|
const handleViewChannel = (remote) => {
|
|
@@ -6867,13 +6592,30 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6867
6592
|
const handlePull = useCallback((remote) => {
|
|
6868
6593
|
triggerPull?.(remote.meta.name);
|
|
6869
6594
|
}, [triggerPull]);
|
|
6870
|
-
if (selectedRemote)
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6595
|
+
if (selectedRemote) {
|
|
6596
|
+
let agreement;
|
|
6597
|
+
try {
|
|
6598
|
+
agreement = getAgreement?.();
|
|
6599
|
+
} catch {
|
|
6600
|
+
agreement = void 0;
|
|
6601
|
+
}
|
|
6602
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6603
|
+
className: "flex h-full flex-col gap-2 overflow-auto",
|
|
6604
|
+
children: [agreement && /* @__PURE__ */ jsx(PeerAgreementPanel, {
|
|
6605
|
+
agreement,
|
|
6606
|
+
collectionId: selectedRemote.meta.collectionId.key,
|
|
6607
|
+
holds,
|
|
6608
|
+
peer: selectedRemote.meta.peer,
|
|
6609
|
+
remoteName: selectedRemote.meta.name
|
|
6610
|
+
}), /* @__PURE__ */ jsx(ChannelInspector, {
|
|
6611
|
+
channel: selectedRemote.channel,
|
|
6612
|
+
connectionState: connectionStates?.get(selectedRemote.meta.name),
|
|
6613
|
+
onBack: handleBack,
|
|
6614
|
+
onRefresh: () => void handleRefresh(),
|
|
6615
|
+
remoteName: selectedRemote.meta.name
|
|
6616
|
+
})]
|
|
6617
|
+
});
|
|
6618
|
+
}
|
|
6877
6619
|
const sortedRemotes = sortRemotes(remotes, sort);
|
|
6878
6620
|
return /* @__PURE__ */ jsxs("div", {
|
|
6879
6621
|
className: "flex h-full flex-col gap-2",
|
|
@@ -6930,7 +6672,7 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6930
6672
|
children: /* @__PURE__ */ jsx("tr", { children: columns.map((column, index) => {
|
|
6931
6673
|
const isActive = sort?.column === column.key;
|
|
6932
6674
|
const sortDirection = isActive ? sort.direction : "asc";
|
|
6933
|
-
const isSortable = column.key !== "channel" && column.key !== "actions" && column.key !== "status";
|
|
6675
|
+
const isSortable = column.key !== "channel" && column.key !== "actions" && column.key !== "status" && column.key !== "peer";
|
|
6934
6676
|
return /* @__PURE__ */ jsx("th", {
|
|
6935
6677
|
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
6678
|
onClick: () => isSortable && handleSort(column.key),
|
|
@@ -6996,8 +6738,15 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6996
6738
|
className: "border-l border-border px-3 py-2 text-xs text-foreground",
|
|
6997
6739
|
children: /* @__PURE__ */ jsx("span", {
|
|
6998
6740
|
className: "block truncate",
|
|
6999
|
-
title: formatFilter(remote.meta.filter),
|
|
7000
|
-
children: formatFilter(remote.meta.filter)
|
|
6741
|
+
title: formatFilter(remote.meta.filter),
|
|
6742
|
+
children: formatFilter(remote.meta.filter)
|
|
6743
|
+
})
|
|
6744
|
+
}),
|
|
6745
|
+
/* @__PURE__ */ jsx("td", {
|
|
6746
|
+
className: "border-l border-border px-3 py-2 text-xs text-foreground",
|
|
6747
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
6748
|
+
className: "block truncate",
|
|
6749
|
+
children: peerManifestLabel(remote.meta.peer)
|
|
7001
6750
|
})
|
|
7002
6751
|
}),
|
|
7003
6752
|
/* @__PURE__ */ jsx("td", {
|
|
@@ -7077,7 +6826,8 @@ function WorkerInspector({ getInfo, onRestart }) {
|
|
|
7077
6826
|
const [restarting, setRestarting] = useState(false);
|
|
7078
6827
|
const loadInfo = useCallback(async () => {
|
|
7079
6828
|
try {
|
|
7080
|
-
|
|
6829
|
+
const next = await getInfo();
|
|
6830
|
+
setInfo(next);
|
|
7081
6831
|
setError(null);
|
|
7082
6832
|
} catch (e) {
|
|
7083
6833
|
setError(e instanceof Error ? e.message : String(e));
|
|
@@ -7172,7 +6922,7 @@ function InspectorUnavailable({ message }) {
|
|
|
7172
6922
|
})]
|
|
7173
6923
|
});
|
|
7174
6924
|
}
|
|
7175
|
-
function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExplorerProps, remotesInspectorProps, queueInspectorProps, processorsInspectorProps, integrityInspectorProps, workerInspectorProps, unavailableTabs, defaultTab = "Database" }) {
|
|
6925
|
+
function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExplorerProps, remotesInspectorProps, queueInspectorProps, processorsInspectorProps, integrityInspectorProps, catchUpInspectorProps, workerInspectorProps, unavailableTabs, defaultTab = "Database" }) {
|
|
7176
6926
|
return /* @__PURE__ */ jsx(Modal, {
|
|
7177
6927
|
...modalProps,
|
|
7178
6928
|
contentProps: {
|
|
@@ -7257,6 +7007,20 @@ function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExpl
|
|
|
7257
7007
|
label: "Integrity",
|
|
7258
7008
|
children: /* @__PURE__ */ jsx(InspectorUnavailable, { message: unavailableTabs.Integrity })
|
|
7259
7009
|
}) : null,
|
|
7010
|
+
catchUpInspectorProps ? /* @__PURE__ */ jsx(TabContent, {
|
|
7011
|
+
description: "Catch-up inspector",
|
|
7012
|
+
label: "Catch-up",
|
|
7013
|
+
value: "CatchUp",
|
|
7014
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
7015
|
+
className: "h-full",
|
|
7016
|
+
children: /* @__PURE__ */ jsx(CatchUpInspector, { ...catchUpInspectorProps })
|
|
7017
|
+
})
|
|
7018
|
+
}) : unavailableTabs?.CatchUp ? /* @__PURE__ */ jsx(TabContent, {
|
|
7019
|
+
description: "Catch-up inspector",
|
|
7020
|
+
label: "Catch-up",
|
|
7021
|
+
value: "CatchUp",
|
|
7022
|
+
children: /* @__PURE__ */ jsx(InspectorUnavailable, { message: unavailableTabs.CatchUp })
|
|
7023
|
+
}) : null,
|
|
7260
7024
|
workerInspectorProps && /* @__PURE__ */ jsx(TabContent, {
|
|
7261
7025
|
description: "Worker inspector",
|
|
7262
7026
|
label: "Worker",
|
|
@@ -7380,10 +7144,12 @@ function ReadRequiredModal(props) {
|
|
|
7380
7144
|
useEffect(() => {
|
|
7381
7145
|
const checkScroll = () => {
|
|
7382
7146
|
const element = contentRef.current;
|
|
7383
|
-
if (element)
|
|
7384
|
-
|
|
7385
|
-
|
|
7386
|
-
|
|
7147
|
+
if (element) {
|
|
7148
|
+
if (element.scrollHeight > element.clientHeight) {
|
|
7149
|
+
setDisableClose(true);
|
|
7150
|
+
element.addEventListener("scroll", handleScroll);
|
|
7151
|
+
} else setDisableClose(false);
|
|
7152
|
+
}
|
|
7387
7153
|
};
|
|
7388
7154
|
const handleScroll = () => {
|
|
7389
7155
|
const element = contentRef.current;
|
|
@@ -7649,28 +7415,8 @@ function LocalStorage(props) {
|
|
|
7649
7415
|
}
|
|
7650
7416
|
//#endregion
|
|
7651
7417
|
//#region src/connect/components/modal/settings-modal-v2/default-editor.tsx
|
|
7652
|
-
|
|
7653
|
-
|
|
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
|
-
}
|
|
7418
|
+
const DefaultEditor = lazyComponent(() => import("../default-editor.impl-a6EOuEme.js").then((m) => m.DefaultEditor));
|
|
7419
|
+
const DefaultEditorSelect = lazyComponent(() => import("../default-editor.impl-a6EOuEme.js").then((m) => m.DefaultEditorSelect));
|
|
7674
7420
|
//#endregion
|
|
7675
7421
|
//#region src/connect/components/modal/settings-modal-v2/package-manager/parse-package-spec.ts
|
|
7676
7422
|
/**
|
|
@@ -7896,6 +7642,7 @@ const VersionPicker = (props) => {
|
|
|
7896
7642
|
className: "px-3 py-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase",
|
|
7897
7643
|
children: "Tags"
|
|
7898
7644
|
}), filteredTags.map(([tag, ver]) => {
|
|
7645
|
+
const isSelected = selected.kind === "tag" && selected.value === tag;
|
|
7899
7646
|
return /* @__PURE__ */ jsxs("button", {
|
|
7900
7647
|
type: "button",
|
|
7901
7648
|
onClick: () => {
|
|
@@ -7906,7 +7653,7 @@ const VersionPicker = (props) => {
|
|
|
7906
7653
|
setOpen(false);
|
|
7907
7654
|
setQuery("");
|
|
7908
7655
|
},
|
|
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",
|
|
7656
|
+
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
7657
|
children: [/* @__PURE__ */ jsx("span", {
|
|
7911
7658
|
className: "truncate text-foreground",
|
|
7912
7659
|
children: tag
|
|
@@ -7927,6 +7674,7 @@ const VersionPicker = (props) => {
|
|
|
7927
7674
|
className: "px-3 py-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase",
|
|
7928
7675
|
children: "Versions"
|
|
7929
7676
|
}), filteredVersions.map((ver) => {
|
|
7677
|
+
const isSelected = selected.kind === "version" && selected.value === ver;
|
|
7930
7678
|
return /* @__PURE__ */ jsx("button", {
|
|
7931
7679
|
type: "button",
|
|
7932
7680
|
onClick: () => {
|
|
@@ -7937,7 +7685,7 @@ const VersionPicker = (props) => {
|
|
|
7937
7685
|
setOpen(false);
|
|
7938
7686
|
setQuery("");
|
|
7939
7687
|
},
|
|
7940
|
-
className: twMerge("flex w-full items-center px-3 py-1.5 text-left text-xs transition-colors", "hover:hover-effect",
|
|
7688
|
+
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
7689
|
children: /* @__PURE__ */ jsxs("span", {
|
|
7942
7690
|
className: "flex min-w-0 items-center gap-1.5 text-foreground",
|
|
7943
7691
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -8086,6 +7834,14 @@ const PackageManagerListItem = (props) => {
|
|
|
8086
7834
|
updateTarget
|
|
8087
7835
|
]
|
|
8088
7836
|
}),
|
|
7837
|
+
registryPackage.sharedDepWarnings && registryPackage.sharedDepWarnings.length > 0 && /* @__PURE__ */ jsxs("span", {
|
|
7838
|
+
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",
|
|
7839
|
+
title: registryPackage.sharedDepWarnings.join("\n"),
|
|
7840
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
7841
|
+
name: "Exclamation",
|
|
7842
|
+
size: 10
|
|
7843
|
+
}), "Shared deps out of date"]
|
|
7844
|
+
}),
|
|
8089
7845
|
!(canPickVersion && hasVersionMetadata) && registryPackage.version && /* @__PURE__ */ jsxs("span", {
|
|
8090
7846
|
className: "text-xs font-normal text-muted-foreground",
|
|
8091
7847
|
children: ["v", registryPackage.version]
|
|
@@ -8129,7 +7885,8 @@ const PackageManagerListItem = (props) => {
|
|
|
8129
7885
|
items: dropdownItems,
|
|
8130
7886
|
onItemClick: (id) => {
|
|
8131
7887
|
if (id === "install") {
|
|
8132
|
-
|
|
7888
|
+
const spec = canPickVersion && hasVersionMetadata ? buildPackageSpec(registryPackage.name, selected.value) : registryPackage.name;
|
|
7889
|
+
onInstall(spec).catch(console.error);
|
|
8133
7890
|
return;
|
|
8134
7891
|
}
|
|
8135
7892
|
if (id === "update") {
|
|
@@ -8597,619 +8354,8 @@ function ConnectUpgradeDriveModal(props) {
|
|
|
8597
8354
|
});
|
|
8598
8355
|
}
|
|
8599
8356
|
//#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
8357
|
//#region src/connect/components/revision-history/revision-history.tsx
|
|
9148
|
-
|
|
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
|
-
}
|
|
8358
|
+
const RevisionHistory = lazyComponent(() => import("../revision-history.impl-CrtSnhXQ.js").then((m) => m.RevisionHistory));
|
|
9213
8359
|
//#endregion
|
|
9214
8360
|
//#region src/connect/components/search-bar/filter-item.tsx
|
|
9215
8361
|
const FilterItem = (props) => {
|
|
@@ -9275,27 +8421,60 @@ const ConnectSearchBar = (props) => {
|
|
|
9275
8421
|
});
|
|
9276
8422
|
};
|
|
9277
8423
|
//#endregion
|
|
8424
|
+
//#region src/connect/components/tooltip/tooltip.tsx
|
|
8425
|
+
function ConnectTooltip(props) {
|
|
8426
|
+
const { children, content, open, defaultOpen, onOpenChange, className, side = "top", sideOffset = 5, delayDuration, ...rest } = props;
|
|
8427
|
+
return /* @__PURE__ */ jsxs(Root, {
|
|
8428
|
+
defaultOpen,
|
|
8429
|
+
delayDuration,
|
|
8430
|
+
onOpenChange,
|
|
8431
|
+
open,
|
|
8432
|
+
children: [/* @__PURE__ */ jsx(Trigger, {
|
|
8433
|
+
asChild: true,
|
|
8434
|
+
children
|
|
8435
|
+
}), /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content, {
|
|
8436
|
+
...rest,
|
|
8437
|
+
side,
|
|
8438
|
+
sideOffset,
|
|
8439
|
+
className: twMerge("z-50 rounded-lg border border-border bg-popover p-2 text-xs text-popover-foreground shadow-tooltip", className),
|
|
8440
|
+
children: content
|
|
8441
|
+
}) })]
|
|
8442
|
+
});
|
|
8443
|
+
}
|
|
8444
|
+
const ConnectTooltipProvider = Provider;
|
|
8445
|
+
//#endregion
|
|
9278
8446
|
//#region src/connect/components/sidebar/sidebar-item.tsx
|
|
9279
8447
|
const SidebarItem = function SidebarItem(props) {
|
|
9280
|
-
const { icon, title, description: _description, containerClassName, active, onClick } = props;
|
|
8448
|
+
const { icon, title, description: _description, containerClassName, active, href, onClick, onPreload } = props;
|
|
8449
|
+
const Element = href ? "a" : "div";
|
|
8450
|
+
const current = href ? props["aria-current"] : void 0;
|
|
9281
8451
|
return /* @__PURE__ */ jsx(ConnectTooltip, {
|
|
9282
8452
|
content: title,
|
|
9283
8453
|
side: "right",
|
|
9284
8454
|
sideOffset: 12,
|
|
9285
8455
|
className: "border-none bg-primary px-3 py-2 text-sm text-primary-foreground",
|
|
9286
|
-
children: /* @__PURE__ */ jsxs(
|
|
9287
|
-
|
|
8456
|
+
children: /* @__PURE__ */ jsxs(Element, {
|
|
8457
|
+
href,
|
|
8458
|
+
"aria-current": current,
|
|
8459
|
+
className: twMerge("group/sidebar-item relative flex cursor-pointer flex-col items-center justify-center text-center text-sm text-foreground", containerClassName, "aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground", active && "bg-sidebar-accent text-sidebar-accent-foreground", onClick && "cursor-pointer"),
|
|
9288
8460
|
onClick,
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
-
|
|
8461
|
+
onMouseEnter: onPreload,
|
|
8462
|
+
onTouchStart: onPreload,
|
|
8463
|
+
onFocus: href ? onPreload : void 0,
|
|
8464
|
+
children: [
|
|
8465
|
+
/* @__PURE__ */ jsx("div", { className: twMerge("absolute top-1/2 left-0 hidden h-10 w-1 -translate-y-1/2 rounded-r-sm bg-info group-aria-[current=page]/sidebar-item:block", active && "block") }),
|
|
8466
|
+
/* @__PURE__ */ jsx("div", { className: twMerge("absolute top-1/2 left-0 h-6 w-1 -translate-y-1/2 rounded-r-sm bg-secondary opacity-0 transition-opacity group-hover/sidebar-item:opacity-100 group-aria-[current=page]/sidebar-item:hidden", active && "hidden") }),
|
|
8467
|
+
/* @__PURE__ */ jsx("div", {
|
|
8468
|
+
className: "mx-auto py-4",
|
|
8469
|
+
children: icon || /* @__PURE__ */ jsx("div", {
|
|
8470
|
+
className: "flex size-8 items-center justify-center rounded-lg bg-primary",
|
|
8471
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
8472
|
+
className: "text-sm font-medium text-primary-foreground",
|
|
8473
|
+
children: title.slice(0, 1).toUpperCase()
|
|
8474
|
+
})
|
|
9296
8475
|
})
|
|
9297
8476
|
})
|
|
9298
|
-
|
|
8477
|
+
]
|
|
9299
8478
|
})
|
|
9300
8479
|
});
|
|
9301
8480
|
};
|
|
@@ -9460,7 +8639,15 @@ const SidebarUser = ({ address, ensName, avatarUrl, etherscanUrl, onDisconnect }
|
|
|
9460
8639
|
};
|
|
9461
8640
|
//#endregion
|
|
9462
8641
|
//#region src/connect/components/sidebar/sidebar-footer.tsx
|
|
9463
|
-
const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin, onClickSettings, onDisconnect, onHomeClick, showDebug, onDebugClick, etherscanUrl = "", ...props }) => {
|
|
8642
|
+
const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin, onClickSettings, settingsHref, settingsCurrent, onDisconnect, onHomeClick, showDebug, onDebugClick, etherscanUrl = "", ...props }) => {
|
|
8643
|
+
const settingsIcon = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Settings, {
|
|
8644
|
+
className: "text-foreground",
|
|
8645
|
+
size: 24,
|
|
8646
|
+
strokeWidth: 2
|
|
8647
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
8648
|
+
className: "hidden text-sm/6 font-semibold text-foreground",
|
|
8649
|
+
children: "Settings"
|
|
8650
|
+
})] });
|
|
9464
8651
|
return /* @__PURE__ */ jsxs(SidebarFooter, {
|
|
9465
8652
|
...props,
|
|
9466
8653
|
className: twMerge("flex flex-col items-center gap-3 border-t border-sidebar-border px-2 py-4 dark:border-none", className),
|
|
@@ -9497,19 +8684,19 @@ const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin,
|
|
|
9497
8684
|
etherscanUrl
|
|
9498
8685
|
}) : /* @__PURE__ */ jsx(SidebarLogin, { onLogin })
|
|
9499
8686
|
}),
|
|
9500
|
-
/* @__PURE__ */
|
|
8687
|
+
settingsHref ? /* @__PURE__ */ jsx("a", {
|
|
8688
|
+
"aria-label": "Settings",
|
|
8689
|
+
href: settingsHref,
|
|
8690
|
+
"aria-current": settingsCurrent,
|
|
8691
|
+
className: "cursor-pointer rounded-md aria-[current=page]:bg-sidebar-accent",
|
|
8692
|
+
onClick: onClickSettings,
|
|
8693
|
+
children: settingsIcon
|
|
8694
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
9501
8695
|
"aria-label": "Settings",
|
|
9502
8696
|
type: "button",
|
|
9503
8697
|
className: twMerge(onClickSettings ? "cursor-pointer" : "cursor-wait"),
|
|
9504
8698
|
onClick: onClickSettings,
|
|
9505
|
-
children:
|
|
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
|
-
})]
|
|
8699
|
+
children: settingsIcon
|
|
9513
8700
|
})
|
|
9514
8701
|
]
|
|
9515
8702
|
});
|
|
@@ -9526,7 +8713,7 @@ const ConnectSidebarHeader = ({ className, children, ...props }) => {
|
|
|
9526
8713
|
};
|
|
9527
8714
|
//#endregion
|
|
9528
8715
|
//#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 }) => {
|
|
8716
|
+
const ConnectSidebar = ({ onClick, address, ensName, avatarUrl, headerContent, onClickSettings, settingsHref, settingsCurrent, maxWidth = "304px", minWidth = "58px", onLogin, onDisconnect, etherscanUrl, showDebug, onDebugClick, ...props }) => {
|
|
9530
8717
|
return /* @__PURE__ */ jsxs(Sidebar, {
|
|
9531
8718
|
...props,
|
|
9532
8719
|
maxWidth,
|
|
@@ -9539,6 +8726,8 @@ const ConnectSidebar = ({ onClick, address, ensName, avatarUrl, headerContent, o
|
|
|
9539
8726
|
ensName,
|
|
9540
8727
|
avatarUrl,
|
|
9541
8728
|
onClickSettings,
|
|
8729
|
+
settingsHref,
|
|
8730
|
+
settingsCurrent,
|
|
9542
8731
|
onLogin,
|
|
9543
8732
|
onDisconnect,
|
|
9544
8733
|
etherscanUrl,
|
|
@@ -9617,6 +8806,21 @@ function ThemeSwitch({ horizontal = false }) {
|
|
|
9617
8806
|
});
|
|
9618
8807
|
}
|
|
9619
8808
|
//#endregion
|
|
8809
|
+
//#region src/connect/components/toggle/toggle.tsx
|
|
8810
|
+
const Toggle = /*#__PURE__*/ forwardRef(function Toggle(props, ref) {
|
|
8811
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
8812
|
+
className: "relative cursor-pointer items-center",
|
|
8813
|
+
htmlFor: props.id,
|
|
8814
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
8815
|
+
className: "peer sr-only",
|
|
8816
|
+
ref,
|
|
8817
|
+
type: "checkbox",
|
|
8818
|
+
value: "",
|
|
8819
|
+
...props
|
|
8820
|
+
}), /* @__PURE__ */ jsx("div", { className: "peer h-6 w-11 rounded-full bg-muted-foreground peer-checked:bg-info peer-focus:outline-none after:absolute after:inset-s-0.5 after:top-0.5 after:size-5 after:rounded-full after:border after:border-none after:bg-background after:transition-all peer-checked:after:translate-x-full" })]
|
|
8821
|
+
});
|
|
8822
|
+
});
|
|
8823
|
+
//#endregion
|
|
9620
8824
|
//#region src/connect/utils/get-folder-status.ts
|
|
9621
8825
|
/**
|
|
9622
8826
|
* Retrieves the sync status of a folder based on its path and their children files.
|
|
@@ -9663,6 +8867,6 @@ const removeSuccessFiles = (files) => {
|
|
|
9663
8867
|
return files.filter((file) => file.status !== "SUCCESS");
|
|
9664
8868
|
};
|
|
9665
8869
|
//#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 };
|
|
8870
|
+
export { About, AccountPopover, AccountPopoverLogin, AddDriveModal, AddLocalDriveForm, AddRemoteDriveForm, AnimatedLoader, AvailablePackagesPanel, Breadcrumb, Breadcrumbs, CONFLICT, CatchUpInspector, ChannelInspector, Checkbox, 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, Icon, InspectorModal, InstalledPackagesPanel, IntegrityInspector, LoadingScreen, LogoAnimation, MISSING, Modal, ModalButton, NodeInput, ObjectInspectorModal, PackageInstallModal, PackageList, PackageManager, PackageManagerListItem, PackagePanelScrollArea, PackageRegistryError, PackageSubSection, PeerAgreementPanel, PowerhouseButton, 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, peerManifestLabel, removeSuccessFiles, sharingTypeOptions, sortFilesByStatus, syncStatuses, useEns, useWindowSize, verifyPackageJsonFields };
|
|
9667
8871
|
|
|
9668
8872
|
//# sourceMappingURL=index.js.map
|