@powerhousedao/design-system 6.2.3-dev.9 → 6.2.3-dev.91
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-COIpcmgW.js +76 -0
- package/dist/add-local-drive-form.impl-COIpcmgW.js.map +1 -0
- package/dist/add-remote-drive-form.impl-_SqOzbSt.js +123 -0
- package/dist/add-remote-drive-form.impl-_SqOzbSt.js.map +1 -0
- package/dist/address-DVC3zalI.js +92 -0
- package/dist/address-DVC3zalI.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-BIAGwP7d.d.ts} +4 -4
- package/dist/checkbox-BIAGwP7d.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-CQHG0NgO.js +144 -0
- package/dist/combobox.impl-CQHG0NgO.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 +539 -364
- package/dist/connect/index.d.ts.map +1 -1
- package/dist/connect/index.js +1175 -1653
- package/dist/connect/index.js.map +1 -1
- package/dist/{content-BHWIqmio.d.ts → content-Cv0kRppo.d.ts} +3 -3
- package/dist/content-Cv0kRppo.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-zx6f7k2d.js +254 -0
- package/dist/document-timeline.impl-zx6f7k2d.js.map +1 -0
- package/dist/drive-settings-form.impl-yV9u4h5c.js +172 -0
- package/dist/drive-settings-form.impl-yV9u4h5c.js.map +1 -0
- package/dist/{enum-field-CwZVs3Ux.d.ts → enum-field-Cub1rt3e.d.ts} +4 -4
- package/dist/enum-field-Cub1rt3e.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-COERJCiE.js +58 -0
- package/dist/formatted-json-viewer.impl-COERJCiE.js.map +1 -0
- package/dist/icon-DQ2yrWYv.js +358 -0
- package/dist/icon-DQ2yrWYv.js.map +1 -0
- package/dist/{icon-C4QOpsdI.js → icon-components-NK-y5dkv.js} +7 -481
- package/dist/icon-components-NK-y5dkv.js.map +1 -0
- package/dist/{id-autocomplete-C-hwriS5.d.ts → id-autocomplete-8LcmtjSR.d.ts} +3 -3
- package/dist/id-autocomplete-8LcmtjSR.d.ts.map +1 -0
- package/dist/{id-autocomplete-input-container-DFEyPh5p.d.ts → id-autocomplete-input-container-D2L7p-Yh.d.ts} +3 -3
- package/dist/id-autocomplete-input-container-D2L7p-Yh.d.ts.map +1 -0
- package/dist/{id-autocomplete-list-EzLpF23C.d.ts → id-autocomplete-list-BXvN07Hr.d.ts} +3 -3
- package/dist/id-autocomplete-list-BXvN07Hr.d.ts.map +1 -0
- package/dist/{id-autocomplete-list-option-CB5B07Hi.d.ts → id-autocomplete-list-option-D_1BOv50.d.ts} +4 -3
- package/dist/id-autocomplete-list-option-D_1BOv50.d.ts.map +1 -0
- package/dist/{index--hDSfvJT.d.ts → index-5FEr1tXH.d.ts} +25 -59
- package/dist/index-5FEr1tXH.d.ts.map +1 -0
- package/dist/index-C-Tup7Br.d.ts +4 -0
- package/dist/index-D6Zk5OLV.d.ts +4 -0
- package/dist/index-i-xHUsLr.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-X18o287K.d.ts} +5 -6
- package/dist/radio-group-field-X18o287K.d.ts.map +1 -0
- package/dist/revision-history.impl-DRbeai2m.js +642 -0
- package/dist/revision-history.impl-DRbeai2m.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-DHaCiAso.d.ts} +5 -5
- package/dist/select-field-DHaCiAso.d.ts.map +1 -0
- package/dist/{selected-content-CGsK5PR4.d.ts → selected-content-CSTFkQr9.d.ts} +3 -3
- package/dist/selected-content-CSTFkQr9.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-DNKcSOAB.d.ts +11 -0
- package/dist/splitted-input-diff-DNKcSOAB.d.ts.map +1 -0
- package/dist/{src-CVV6HzQZ.js → src-DhSJCeu5.js} +180 -24
- package/dist/src-DhSJCeu5.js.map +1 -0
- package/dist/style.css +144 -62
- package/dist/text-field-Dq1DTC_t.d.ts +9 -0
- package/dist/text-field-Dq1DTC_t.d.ts.map +1 -0
- package/dist/{text-input-8zXIWHLi.d.ts → text-input-CRjOT54_.d.ts} +5 -6
- package/dist/text-input-CRjOT54_.d.ts.map +1 -0
- package/dist/text-input-diff-CcF0QblL.d.ts +12 -0
- package/dist/text-input-diff-CcF0QblL.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-m9Bf0qCy.d.ts} +5 -16
- package/dist/use-id-autocomplete-m9Bf0qCy.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-BtUh3-UP.d.ts} +5 -7
- package/dist/value-transformer-BtUh3-UP.d.ts.map +1 -0
- package/dist/{with-field-validation-Di5D8vU-.d.ts → with-field-validation-Bh26a6fr.d.ts} +3 -3
- package/dist/with-field-validation-Bh26a6fr.d.ts.map +1 -0
- package/package.json +17 -12
- package/plugins.css +6 -0
- package/tailwind.css +213 -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,27 @@
|
|
|
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-DhSJCeu5.js";
|
|
2
|
+
import { n as getDimensions, t as Icon } from "../icon-DQ2yrWYv.js";
|
|
3
|
+
import { Checkbox } from "../ui/components/checkbox/checkbox.js";
|
|
3
4
|
import { Popover, PopoverContent, PopoverTrigger } from "../ui/components/popover/popover.js";
|
|
4
|
-
import { SelectFieldRaw } from "../ui/components/select-field/select-field.js";
|
|
5
5
|
import { Input } from "../ui/components/input/input.js";
|
|
6
6
|
import { JsonViewer } from "../ui/components/json-viewer/json-viewer.js";
|
|
7
|
-
import
|
|
7
|
+
import "../ui/index.js";
|
|
8
|
+
import { a as lazyComponent, i as ENSAvatar, n as useEns, r as FormattedJsonViewer, t as formatEthAddress } from "../address-DVC3zalI.js";
|
|
9
|
+
import { t as Label } from "../label-nH2HoKfI.js";
|
|
10
|
+
import React, { Fragment, createContext, createElement, forwardRef, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
8
11
|
import { twJoin, twMerge } from "tailwind-merge";
|
|
9
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
13
|
import { Content, Portal, Provider, Root, Trigger } from "@radix-ui/react-tooltip";
|
|
11
|
-
import {
|
|
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, useReactorClient, useSelectedDocumentSafe, useSelectedDriveId, useSelectedDriveSafe, useSelectedNodePath, useSetSelectedDrive, useSetSelectedNode, useTheme, useUserPermissions } from "@powerhousedao/reactor-browser";
|
|
17
|
+
import { Content as Content$1, List, Root as Root$1, Trigger as Trigger$1 } from "@radix-ui/react-tabs";
|
|
18
|
+
import { addProp, defaultTo, entries, filter, hasAtLeast, isArray, isDefined, isIncludedIn, isTruthy, keys, map, pipe, prop, values } from "remeda";
|
|
19
|
+
import { redo, undo, undoCapabilitiesOf } from "@powerhousedao/shared/document-model";
|
|
21
20
|
import { RenownLogo } from "@powerhousedao/reactor-browser/renown";
|
|
22
|
-
import {
|
|
23
|
-
import { darkTheme } from "@uiw/react-json-view/dark";
|
|
24
|
-
import { lightTheme } from "@uiw/react-json-view/light";
|
|
21
|
+
import { colorVariants, imageVariants, layerStyle, normalizeBackground } from "@powerhousedao/shared/connect";
|
|
25
22
|
import { isValidName } from "@powerhousedao/shared/document-drive";
|
|
26
23
|
import { capitalCase } from "change-case";
|
|
27
24
|
import { getUpdateTarget, parseInstallSpec } from "@powerhousedao/shared/registry/updates";
|
|
28
|
-
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
29
25
|
//#region src/connect/components/account-popover/account-popover.tsx
|
|
30
26
|
const AccountPopover = ({ children, content, open, onOpenChange }) => {
|
|
31
27
|
return /* @__PURE__ */ jsxs(Popover, {
|
|
@@ -245,6 +241,9 @@ function Breadcrumbs() {
|
|
|
245
241
|
const selectedDriveId = useSelectedDriveId();
|
|
246
242
|
const selectedNodePath = useSelectedNodePath();
|
|
247
243
|
const [isCreating, setIsCreating] = useState(false);
|
|
244
|
+
const driveContext = useDriveContext();
|
|
245
|
+
const setSelectedDrive = useSetSelectedDrive();
|
|
246
|
+
const setSelectedNode = useSetSelectedNode();
|
|
248
247
|
function onAddNew() {
|
|
249
248
|
setIsCreating(true);
|
|
250
249
|
}
|
|
@@ -261,6 +260,7 @@ function Breadcrumbs() {
|
|
|
261
260
|
function onCancel() {
|
|
262
261
|
setIsCreating(false);
|
|
263
262
|
}
|
|
263
|
+
const driveTarget = selectedDrive ? { driveSlug: makeDriveSlug(selectedDrive) } : void 0;
|
|
264
264
|
const hasSelectedDrive = !!selectedDrive;
|
|
265
265
|
const hasNodePath = !!selectedNodePath.length;
|
|
266
266
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -282,6 +282,7 @@ function Breadcrumbs() {
|
|
|
282
282
|
id: selectedDriveId,
|
|
283
283
|
parentId: void 0,
|
|
284
284
|
name: selectedDrive.state.global.name || selectedDrive.header.name,
|
|
285
|
+
target: driveTarget,
|
|
285
286
|
onClick: () => setSelectedDrive(selectedDrive)
|
|
286
287
|
}),
|
|
287
288
|
/* @__PURE__ */ jsx("span", { children: "/" })
|
|
@@ -290,6 +291,7 @@ function Breadcrumbs() {
|
|
|
290
291
|
id: node.id,
|
|
291
292
|
parentId: node.parentFolder,
|
|
292
293
|
name: node.name,
|
|
294
|
+
target: getNodeTarget(node, driveContext?.drive),
|
|
293
295
|
onClick: () => setSelectedNode(node)
|
|
294
296
|
}), /* @__PURE__ */ jsx("span", { children: "/" })] }, node.id)),
|
|
295
297
|
isAllowedToCreateDocuments && (isCreating ? /* @__PURE__ */ jsx(NodeInput, {
|
|
@@ -311,160 +313,363 @@ function Breadcrumbs() {
|
|
|
311
313
|
});
|
|
312
314
|
}
|
|
313
315
|
function Breadcrumb(props) {
|
|
314
|
-
const { name, id, parentId, onClick } = props;
|
|
316
|
+
const { name, id, parentId, target, onClick } = props;
|
|
317
|
+
const navigation = usePHNavigation();
|
|
318
|
+
const isCurrent = navigation.useIsCurrent?.(target) ?? false;
|
|
319
|
+
const href = props.href ?? (target ? navigation.hrefFor?.(target) : void 0);
|
|
315
320
|
const { isDragging, ...dragProps } = useDragNode({
|
|
316
321
|
srcId: id,
|
|
317
322
|
parentId: parentId ?? void 0
|
|
318
323
|
});
|
|
319
324
|
const { isDropTarget, ...dropProps } = useDropNode(id);
|
|
320
325
|
const containerStyles = twMerge("cursor-pointer transition-colors last-of-type:text-foreground hover:hover-effect", isDragging ? "opacity-60" : isDropTarget ? "bg-info/10" : "");
|
|
326
|
+
if (href) {
|
|
327
|
+
const onLinkClick = (event) => {
|
|
328
|
+
if (!isPlainClick(event)) return;
|
|
329
|
+
event.preventDefault();
|
|
330
|
+
onClick();
|
|
331
|
+
};
|
|
332
|
+
return /* @__PURE__ */ jsx("a", {
|
|
333
|
+
...dragProps,
|
|
334
|
+
...dropProps,
|
|
335
|
+
href,
|
|
336
|
+
"aria-current": target && isCurrent ? "page" : void 0,
|
|
337
|
+
className: containerStyles,
|
|
338
|
+
onClick: onLinkClick,
|
|
339
|
+
children: name
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
const onKeyDown = (event) => {
|
|
343
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
344
|
+
event.preventDefault();
|
|
345
|
+
onClick();
|
|
346
|
+
};
|
|
321
347
|
return /* @__PURE__ */ jsx("div", {
|
|
322
348
|
...dragProps,
|
|
323
349
|
...dropProps,
|
|
324
350
|
className: containerStyles,
|
|
325
351
|
onClick,
|
|
352
|
+
onKeyDown,
|
|
326
353
|
role: "button",
|
|
354
|
+
tabIndex: 0,
|
|
327
355
|
children: name
|
|
328
356
|
});
|
|
329
357
|
}
|
|
330
358
|
//#endregion
|
|
331
|
-
//#region src/connect/components/
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
359
|
+
//#region src/connect/components/catch-up-inspector/catch-up-inspector.tsx
|
|
360
|
+
const COLUMNS$3 = [
|
|
361
|
+
{
|
|
362
|
+
key: "consumerId",
|
|
363
|
+
label: "Consumer",
|
|
364
|
+
width: "180px"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
key: "thread",
|
|
368
|
+
label: "Thread",
|
|
369
|
+
width: "90px"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
key: "appliedThrough",
|
|
373
|
+
label: "Applied Through",
|
|
374
|
+
width: "110px"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
key: "lag",
|
|
378
|
+
label: "Lag",
|
|
379
|
+
width: "70px"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
key: "trackedAbove",
|
|
383
|
+
label: "Tracked Above",
|
|
384
|
+
width: "100px"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
key: "lastAdvance",
|
|
388
|
+
label: "Last Advance",
|
|
389
|
+
width: "160px"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
key: "blockedOrdinal",
|
|
393
|
+
label: "Blocked At",
|
|
394
|
+
width: "90px"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
key: "blockedDocument",
|
|
398
|
+
label: "Document",
|
|
399
|
+
width: "150px"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
key: "blockedScope",
|
|
403
|
+
label: "Scope",
|
|
404
|
+
width: "80px"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
key: "blockedBranch",
|
|
408
|
+
label: "Branch",
|
|
409
|
+
width: "80px"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
key: "blockedType",
|
|
413
|
+
label: "Type",
|
|
414
|
+
width: "140px"
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
key: "blockedError",
|
|
418
|
+
label: "Error",
|
|
419
|
+
width: "180px"
|
|
420
|
+
}
|
|
421
|
+
];
|
|
422
|
+
const POLL_INTERVAL_MS = 2e3;
|
|
423
|
+
function truncateId$3(id, maxLength = 12) {
|
|
424
|
+
if (id.length <= maxLength) return id;
|
|
425
|
+
return id.slice(0, maxLength) + "...";
|
|
426
|
+
}
|
|
427
|
+
function formatDuration(ms) {
|
|
428
|
+
const totalSeconds = Math.max(0, Math.floor(ms / 1e3));
|
|
429
|
+
const hours = Math.floor(totalSeconds / 3600);
|
|
430
|
+
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
431
|
+
const seconds = totalSeconds % 60;
|
|
432
|
+
if (hours > 0) return `${hours}h ${minutes}m ${seconds}s`;
|
|
433
|
+
if (minutes > 0) return `${minutes}m ${seconds}s`;
|
|
434
|
+
return `${seconds}s`;
|
|
435
|
+
}
|
|
436
|
+
function Empty() {
|
|
437
|
+
return /* @__PURE__ */ jsx("span", {
|
|
438
|
+
className: "text-muted-foreground",
|
|
439
|
+
children: "-"
|
|
339
440
|
});
|
|
340
441
|
}
|
|
341
|
-
function
|
|
342
|
-
return /* @__PURE__ */ jsx(
|
|
343
|
-
|
|
344
|
-
children
|
|
345
|
-
name: "Xmark",
|
|
346
|
-
size: 16
|
|
347
|
-
})
|
|
442
|
+
function Cell({ children }) {
|
|
443
|
+
return /* @__PURE__ */ jsx("td", {
|
|
444
|
+
className: "border-l border-border px-3 py-2 text-xs text-foreground",
|
|
445
|
+
children
|
|
348
446
|
});
|
|
349
447
|
}
|
|
350
|
-
function
|
|
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]
|
|
448
|
+
function TruncatedText({ text, className }) {
|
|
449
|
+
return /* @__PURE__ */ jsx("span", {
|
|
450
|
+
className: twMerge("block truncate", className),
|
|
451
|
+
title: text,
|
|
452
|
+
children: text
|
|
360
453
|
});
|
|
361
454
|
}
|
|
362
|
-
function
|
|
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
|
-
|
|
455
|
+
function CatchUpInspector({ status, onRefresh, onSweepNow }) {
|
|
456
|
+
const [loading, setLoading] = useState(true);
|
|
457
|
+
const [sweeping, setSweeping] = useState(false);
|
|
458
|
+
const [error, setError] = useState(null);
|
|
459
|
+
const [now, setNow] = useState();
|
|
460
|
+
const loadStatus = useCallback(async () => {
|
|
461
|
+
try {
|
|
462
|
+
await onRefresh();
|
|
463
|
+
setError(null);
|
|
464
|
+
setNow(Date.now());
|
|
465
|
+
} catch (e) {
|
|
466
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
467
|
+
} finally {
|
|
468
|
+
setLoading(false);
|
|
469
|
+
}
|
|
470
|
+
}, [onRefresh]);
|
|
471
|
+
useEffect(() => {
|
|
472
|
+
loadStatus();
|
|
473
|
+
const interval = setInterval(() => {
|
|
474
|
+
loadStatus();
|
|
475
|
+
}, POLL_INTERVAL_MS);
|
|
476
|
+
return () => clearInterval(interval);
|
|
477
|
+
}, [loadStatus]);
|
|
478
|
+
const handleRefresh = useCallback(async () => {
|
|
479
|
+
setLoading(true);
|
|
480
|
+
await loadStatus();
|
|
481
|
+
}, [loadStatus]);
|
|
482
|
+
const handleSweepNow = useCallback(async () => {
|
|
483
|
+
setSweeping(true);
|
|
484
|
+
try {
|
|
485
|
+
await onSweepNow();
|
|
486
|
+
setError(null);
|
|
487
|
+
} catch (e) {
|
|
488
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
489
|
+
} finally {
|
|
490
|
+
setSweeping(false);
|
|
491
|
+
}
|
|
492
|
+
await loadStatus();
|
|
493
|
+
}, [onSweepNow, loadStatus]);
|
|
494
|
+
const watermark = status?.watermark;
|
|
495
|
+
const consumers = status?.consumers ?? [];
|
|
496
|
+
const settledThrough = watermark?.settledThrough ?? 0;
|
|
497
|
+
const blockedCount = consumers.filter((c) => c.blockedAt).length;
|
|
498
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
499
|
+
className: "flex h-full flex-col gap-2",
|
|
500
|
+
children: [
|
|
501
|
+
/* @__PURE__ */ jsxs("div", {
|
|
502
|
+
className: "flex shrink-0 items-center justify-between",
|
|
503
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
504
|
+
className: "text-lg font-semibold text-foreground",
|
|
505
|
+
children: "Catch-up Inspector"
|
|
506
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
507
|
+
className: "flex items-center gap-2",
|
|
508
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
509
|
+
className: "flex items-center gap-1 rounded-sm border border-border bg-background px-3 py-1.5 text-sm text-foreground hover:hover-effect disabled:disabled-effect",
|
|
510
|
+
disabled: sweeping,
|
|
511
|
+
onClick: () => void handleSweepNow(),
|
|
512
|
+
type: "button",
|
|
513
|
+
children: "Sweep now"
|
|
514
|
+
}), /* @__PURE__ */ jsxs("button", {
|
|
515
|
+
className: "flex items-center gap-1 rounded-sm border border-border bg-background px-3 py-1.5 text-sm text-foreground hover:hover-effect disabled:disabled-effect",
|
|
516
|
+
disabled: loading,
|
|
517
|
+
onClick: () => void handleRefresh(),
|
|
518
|
+
type: "button",
|
|
519
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
520
|
+
name: "Reload",
|
|
521
|
+
size: 14
|
|
522
|
+
}), "Refresh"]
|
|
523
|
+
})]
|
|
524
|
+
})]
|
|
525
|
+
}),
|
|
526
|
+
watermark && /* @__PURE__ */ jsxs("div", {
|
|
527
|
+
className: "flex shrink-0 flex-wrap items-center gap-4 rounded-lg bg-muted px-4 py-2 text-sm",
|
|
528
|
+
children: [
|
|
529
|
+
/* @__PURE__ */ jsxs("div", {
|
|
530
|
+
className: "text-foreground",
|
|
531
|
+
children: ["Head: ", /* @__PURE__ */ jsx("span", {
|
|
532
|
+
className: "font-medium",
|
|
533
|
+
children: watermark.head
|
|
534
|
+
})]
|
|
535
|
+
}),
|
|
536
|
+
/* @__PURE__ */ jsxs("div", {
|
|
537
|
+
className: "text-foreground",
|
|
538
|
+
children: [
|
|
539
|
+
"Settled through:",
|
|
540
|
+
" ",
|
|
541
|
+
/* @__PURE__ */ jsx("span", {
|
|
542
|
+
className: "font-medium",
|
|
543
|
+
children: watermark.settledThrough
|
|
544
|
+
})
|
|
545
|
+
]
|
|
546
|
+
}),
|
|
547
|
+
/* @__PURE__ */ jsxs("div", {
|
|
548
|
+
className: "text-foreground",
|
|
549
|
+
children: [
|
|
550
|
+
"Lag:",
|
|
551
|
+
" ",
|
|
552
|
+
/* @__PURE__ */ jsx("span", {
|
|
553
|
+
className: "font-medium",
|
|
554
|
+
children: watermark.head - watermark.settledThrough
|
|
555
|
+
})
|
|
556
|
+
]
|
|
557
|
+
}),
|
|
558
|
+
/* @__PURE__ */ jsxs("div", {
|
|
559
|
+
className: "text-foreground",
|
|
560
|
+
children: [
|
|
561
|
+
"Waiting on:",
|
|
562
|
+
" ",
|
|
563
|
+
/* @__PURE__ */ jsx("span", {
|
|
564
|
+
className: "font-medium",
|
|
565
|
+
children: watermark.waitingOn.length > 0 ? watermark.waitingOn.join(", ") : "none"
|
|
566
|
+
})
|
|
567
|
+
]
|
|
568
|
+
}),
|
|
569
|
+
watermark.stalledSinceUtcMs !== void 0 && now !== void 0 && /* @__PURE__ */ jsxs("div", {
|
|
570
|
+
className: "flex items-center gap-2 text-destructive",
|
|
571
|
+
children: [
|
|
572
|
+
/* @__PURE__ */ jsx("span", { className: "size-2 rounded-full bg-destructive" }),
|
|
573
|
+
"Stalled for:",
|
|
574
|
+
" ",
|
|
575
|
+
/* @__PURE__ */ jsx("span", {
|
|
576
|
+
className: "font-medium",
|
|
577
|
+
title: new Date(watermark.stalledSinceUtcMs).toISOString(),
|
|
578
|
+
children: formatDuration(now - watermark.stalledSinceUtcMs)
|
|
579
|
+
})
|
|
580
|
+
]
|
|
581
|
+
}),
|
|
582
|
+
/* @__PURE__ */ jsxs("div", {
|
|
583
|
+
className: "flex items-center gap-2 text-foreground",
|
|
584
|
+
children: [
|
|
585
|
+
/* @__PURE__ */ jsx("span", { className: "size-2 rounded-full bg-destructive" }),
|
|
586
|
+
"Blocked: ",
|
|
587
|
+
/* @__PURE__ */ jsx("span", {
|
|
588
|
+
className: "font-medium",
|
|
589
|
+
children: blockedCount
|
|
590
|
+
})
|
|
591
|
+
]
|
|
592
|
+
})
|
|
593
|
+
]
|
|
594
|
+
}),
|
|
595
|
+
error && /* @__PURE__ */ jsxs("div", {
|
|
596
|
+
className: "shrink-0 rounded-lg border border-destructive bg-destructive/10 px-4 py-2 text-sm text-destructive",
|
|
597
|
+
children: ["Catch-up request failed: ", error]
|
|
598
|
+
}),
|
|
599
|
+
/* @__PURE__ */ jsx("div", {
|
|
600
|
+
className: "max-h-full overflow-auto rounded-lg border border-border",
|
|
601
|
+
children: /* @__PURE__ */ jsxs("table", {
|
|
602
|
+
className: "w-full border-collapse",
|
|
603
|
+
children: [/* @__PURE__ */ jsx("thead", {
|
|
604
|
+
className: "sticky top-0 bg-muted",
|
|
605
|
+
children: /* @__PURE__ */ jsx("tr", { children: COLUMNS$3.map((column, index) => /* @__PURE__ */ jsx("th", {
|
|
606
|
+
className: twMerge("px-3 py-2 text-left text-xs font-medium text-foreground", index > 0 && "border-l border-border"),
|
|
607
|
+
style: { width: column.width },
|
|
608
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
609
|
+
className: "truncate",
|
|
610
|
+
children: column.label
|
|
611
|
+
})
|
|
612
|
+
}, column.key)) })
|
|
613
|
+
}), /* @__PURE__ */ jsx("tbody", { children: loading && !status ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
|
|
614
|
+
className: "px-3 py-8 text-center text-sm text-muted-foreground",
|
|
615
|
+
colSpan: COLUMNS$3.length,
|
|
616
|
+
children: "Loading..."
|
|
617
|
+
}) }) : consumers.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
|
|
618
|
+
className: "px-3 py-8 text-center text-sm text-muted-foreground",
|
|
619
|
+
colSpan: COLUMNS$3.length,
|
|
620
|
+
children: "No catch-up consumers"
|
|
621
|
+
}) }) : consumers.map((consumer) => {
|
|
622
|
+
const blocked = consumer.blockedAt;
|
|
623
|
+
const lastAdvance = new Date(consumer.lastAdvanceUtcMs);
|
|
624
|
+
return /* @__PURE__ */ jsxs("tr", {
|
|
625
|
+
className: twMerge("hover:hover-effect", blocked ? "bg-destructive/10" : "odd:bg-card even:bg-background"),
|
|
626
|
+
children: [
|
|
627
|
+
/* @__PURE__ */ jsx("td", {
|
|
628
|
+
className: "px-3 py-2 text-xs text-foreground",
|
|
629
|
+
children: /* @__PURE__ */ jsx(TruncatedText, { text: consumer.consumerId })
|
|
630
|
+
}),
|
|
631
|
+
/* @__PURE__ */ jsx(Cell, { children: consumer.thread }),
|
|
632
|
+
/* @__PURE__ */ jsx(Cell, { children: consumer.appliedThrough }),
|
|
633
|
+
/* @__PURE__ */ jsx(Cell, { children: settledThrough - consumer.appliedThrough }),
|
|
634
|
+
/* @__PURE__ */ jsx(Cell, { children: consumer.trackedAbove }),
|
|
635
|
+
/* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx("span", {
|
|
636
|
+
className: "block truncate",
|
|
637
|
+
title: lastAdvance.toISOString(),
|
|
638
|
+
children: lastAdvance.toLocaleString()
|
|
639
|
+
}) }),
|
|
640
|
+
/* @__PURE__ */ jsx(Cell, { children: blocked ? blocked.ordinal : /* @__PURE__ */ jsx(Empty, {}) }),
|
|
641
|
+
/* @__PURE__ */ jsx(Cell, { children: blocked ? /* @__PURE__ */ jsx("span", {
|
|
642
|
+
className: "block truncate",
|
|
643
|
+
title: blocked.documentId,
|
|
644
|
+
children: truncateId$3(blocked.documentId)
|
|
645
|
+
}) : /* @__PURE__ */ jsx(Empty, {}) }),
|
|
646
|
+
/* @__PURE__ */ jsx(Cell, { children: blocked ? blocked.scope : /* @__PURE__ */ jsx(Empty, {}) }),
|
|
647
|
+
/* @__PURE__ */ jsx(Cell, { children: blocked ? blocked.branch : /* @__PURE__ */ jsx(Empty, {}) }),
|
|
648
|
+
/* @__PURE__ */ jsx(Cell, { children: blocked ? /* @__PURE__ */ jsx(TruncatedText, { text: blocked.type }) : /* @__PURE__ */ jsx(Empty, {}) }),
|
|
649
|
+
/* @__PURE__ */ jsx(Cell, { children: blocked ? /* @__PURE__ */ jsx(TruncatedText, {
|
|
650
|
+
className: "text-destructive",
|
|
651
|
+
text: blocked.error
|
|
652
|
+
}) : /* @__PURE__ */ jsx(Empty, {}) })
|
|
653
|
+
]
|
|
654
|
+
}, consumer.consumerId);
|
|
655
|
+
}) })]
|
|
656
|
+
})
|
|
657
|
+
}),
|
|
658
|
+
/* @__PURE__ */ jsxs("div", {
|
|
659
|
+
className: "shrink-0 text-sm text-foreground",
|
|
660
|
+
children: [
|
|
661
|
+
"Showing ",
|
|
662
|
+
consumers.length,
|
|
663
|
+
" consumer(s)"
|
|
664
|
+
]
|
|
440
665
|
})
|
|
441
|
-
|
|
442
|
-
theme: (theme) => ({
|
|
443
|
-
...theme,
|
|
444
|
-
colors: {
|
|
445
|
-
...theme.colors,
|
|
446
|
-
primary: dark ? "var(--color-slate-700)" : "var(--color-slate-100)",
|
|
447
|
-
primary25: dark ? "var(--color-slate-800)" : "var(--color-slate-50)",
|
|
448
|
-
primary50: dark ? "var(--color-slate-700)" : "var(--color-slate-100)",
|
|
449
|
-
primary75: dark ? "var(--color-slate-700)" : "var(--color-slate-100)",
|
|
450
|
-
danger: dark ? "var(--color-red-400)" : "var(--color-red-900)",
|
|
451
|
-
dangerLight: dark ? "var(--color-red-900)" : "var(--color-red-100)",
|
|
452
|
-
neutral0: dark ? "var(--color-slate-800)" : "var(--color-white)",
|
|
453
|
-
neutral5: dark ? "var(--color-slate-800)" : "var(--color-gray-50)",
|
|
454
|
-
neutral10: dark ? "var(--color-slate-700)" : "var(--color-gray-100)",
|
|
455
|
-
neutral20: dark ? "var(--color-slate-600)" : "var(--color-gray-200)",
|
|
456
|
-
neutral30: dark ? "var(--color-slate-600)" : "var(--color-gray-300)",
|
|
457
|
-
neutral40: dark ? "var(--color-slate-400)" : "var(--color-gray-400)",
|
|
458
|
-
neutral50: dark ? "var(--color-slate-300)" : "var(--color-gray-500)",
|
|
459
|
-
neutral60: dark ? "var(--color-slate-200)" : "var(--color-gray-600)",
|
|
460
|
-
neutral70: dark ? "var(--color-slate-100)" : "var(--color-gray-700)",
|
|
461
|
-
neutral80: dark ? "var(--color-slate-50)" : "var(--color-gray-800)",
|
|
462
|
-
neutral90: dark ? "var(--color-slate-50)" : "var(--color-gray-900)"
|
|
463
|
-
}
|
|
464
|
-
})
|
|
666
|
+
]
|
|
465
667
|
});
|
|
466
668
|
}
|
|
467
669
|
//#endregion
|
|
670
|
+
//#region src/connect/components/combobox/combobox.tsx
|
|
671
|
+
const Combobox = lazyComponent(() => import("../combobox.impl-CQHG0NgO.js").then((m) => m.Combobox));
|
|
672
|
+
//#endregion
|
|
468
673
|
//#region src/connect/components/consent-banner/consent-banner.tsx
|
|
469
674
|
const CookieBanner = (props) => {
|
|
470
675
|
const { children, cookies, submitLabel, rejectLabel, onSubmit = () => {}, onReject = () => {}, className, ...divProps } = props;
|
|
@@ -527,8 +732,9 @@ function ModalButton(props) {
|
|
|
527
732
|
const { variant, className, ...rest } = props;
|
|
528
733
|
const confirmStyle = twMerge(defaultStyle, "bg-primary text-primary-foreground");
|
|
529
734
|
const cancelStyle = twMerge(defaultStyle, "bg-muted text-muted-foreground");
|
|
735
|
+
const variantStyle = twMerge(variant === "confirm" ? confirmStyle : cancelStyle, className);
|
|
530
736
|
return /* @__PURE__ */ jsx("button", {
|
|
531
|
-
className:
|
|
737
|
+
className: variantStyle,
|
|
532
738
|
...rest
|
|
533
739
|
});
|
|
534
740
|
}
|
|
@@ -702,7 +908,7 @@ function SchemaTreeSidebar({ schema, tables, selectedTable, onSelectTable, onRef
|
|
|
702
908
|
//#endregion
|
|
703
909
|
//#region src/connect/components/select/select.tsx
|
|
704
910
|
function fixedForwardRef(render) {
|
|
705
|
-
return
|
|
911
|
+
return /*#__PURE__*/ forwardRef(render);
|
|
706
912
|
}
|
|
707
913
|
const ConnectSelect = /* @__PURE__ */ fixedForwardRef(function Select(props, ref) {
|
|
708
914
|
const { items, value, id, onChange, containerClassName, menuClassName, itemClassName, absolutePositionMenu = false, borderRadius = "6px", listClassName } = props;
|
|
@@ -1279,9 +1485,10 @@ function DBExplorer({ schema, getTables, getTableRows, getDefaultSort, pageSize
|
|
|
1279
1485
|
]);
|
|
1280
1486
|
const handleCopyAll = useCallback(async () => {
|
|
1281
1487
|
if (!selectedTable) return "";
|
|
1488
|
+
const limit = pagination.total ?? 1e6;
|
|
1282
1489
|
return rowsToCsv((await getTableRows(selectedTable, {
|
|
1283
1490
|
schema,
|
|
1284
|
-
limit
|
|
1491
|
+
limit,
|
|
1285
1492
|
offset: 0,
|
|
1286
1493
|
sort,
|
|
1287
1494
|
filters
|
|
@@ -1638,9 +1845,7 @@ const SEQUENCE = [
|
|
|
1638
1845
|
}
|
|
1639
1846
|
];
|
|
1640
1847
|
const ANIM_DUR = 460;
|
|
1641
|
-
const
|
|
1642
|
-
const LAST_DROP = 1220;
|
|
1643
|
-
const LOOP_TOTAL = LAST_DROP + ANIM_DUR + HOLD + 1040 + ANIM_DUR + 400;
|
|
1848
|
+
const LOOP_TOTAL = 4380;
|
|
1644
1849
|
const DROP_STYLE = `brickDrop ${ANIM_DUR}ms cubic-bezier(0.28, 1.08, 0.58, 1) forwards`;
|
|
1645
1850
|
const FALL_STYLE = `brickFall ${ANIM_DUR}ms cubic-bezier(0.28, 1.08, 0.58, 1) forwards`;
|
|
1646
1851
|
const PATHS = {
|
|
@@ -1655,7 +1860,63 @@ const PATHS = {
|
|
|
1655
1860
|
b9: "M18.0156 9.8918C18.0156 9.61566 18.2394 9.39181 18.5155 9.39181L43.0627 9.39138C44.9475 11.8519 46.3659 14.6855 47.1892 17.7635L18.5154 17.7641C18.2392 17.7641 18.0154 17.5402 18.0154 17.2641L18.0156 9.8918Z",
|
|
1656
1861
|
b10: "M25.0158 -2.51999e-05C31.418 0.265176 37.1737 3.03916 41.3227 7.36511L25.5156 7.36547C25.2395 7.36547 25.0156 7.14161 25.0156 6.86546L25.0158 -2.51999e-05Z"
|
|
1657
1862
|
};
|
|
1863
|
+
/** A project's loading image, declared by the build as
|
|
1864
|
+
* `<meta name="ph-loader" content="<file>" data-animation data-size>`
|
|
1865
|
+
* (powerhouse.config.json `icons.loader`). */
|
|
1866
|
+
const LOADER_MOTION = {
|
|
1867
|
+
pulse: "ph-loader-pulse 1.6s ease-in-out infinite",
|
|
1868
|
+
spin: "ph-loader-spin 1.4s linear infinite",
|
|
1869
|
+
none: "none"
|
|
1870
|
+
};
|
|
1871
|
+
const LOADER_KEYFRAMES = "@keyframes ph-loader-pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.6;transform:scale(.94)}}@keyframes ph-loader-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){[data-ph-loader-img]{animation:none!important}}";
|
|
1872
|
+
let projectLoader;
|
|
1873
|
+
/** The page's project loader, or null when Connect's logo stays. Read once:
|
|
1874
|
+
* the meta tag is static in index.html. */
|
|
1875
|
+
function getProjectLoader() {
|
|
1876
|
+
if (projectLoader !== void 0) return projectLoader;
|
|
1877
|
+
if (typeof document === "undefined") return null;
|
|
1878
|
+
const meta = document.querySelector("meta[name=\"ph-loader\"]");
|
|
1879
|
+
const file = meta?.content;
|
|
1880
|
+
if (!meta || !file) return projectLoader = null;
|
|
1881
|
+
const animation = meta.dataset.animation;
|
|
1882
|
+
const size = Number(meta.dataset.size);
|
|
1883
|
+
projectLoader = {
|
|
1884
|
+
src: new URL(file, document.baseURI).toString(),
|
|
1885
|
+
animation: animation === "spin" || animation === "none" ? animation : "pulse",
|
|
1886
|
+
size: Number.isFinite(size) && size > 0 ? size : 96
|
|
1887
|
+
};
|
|
1888
|
+
return projectLoader;
|
|
1889
|
+
}
|
|
1890
|
+
/** The project's loading image with its motion. */
|
|
1891
|
+
function ProjectLoaderImage({ loader, className = "" }) {
|
|
1892
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("style", { children: LOADER_KEYFRAMES }), /* @__PURE__ */ jsx("img", {
|
|
1893
|
+
"data-ph-loader-img": "",
|
|
1894
|
+
src: loader.src,
|
|
1895
|
+
alt: "",
|
|
1896
|
+
"aria-label": "Loading",
|
|
1897
|
+
width: loader.size,
|
|
1898
|
+
className,
|
|
1899
|
+
style: {
|
|
1900
|
+
width: loader.size,
|
|
1901
|
+
height: "auto",
|
|
1902
|
+
animation: LOADER_MOTION[loader.animation]
|
|
1903
|
+
}
|
|
1904
|
+
})] });
|
|
1905
|
+
}
|
|
1906
|
+
/** Connect's loading animation: the project's loader when one is
|
|
1907
|
+
* configured, else the animated Powerhouse logo. */
|
|
1658
1908
|
function LogoAnimation({ size = 48, className = "" }) {
|
|
1909
|
+
const loader = getProjectLoader();
|
|
1910
|
+
if (loader) return /* @__PURE__ */ jsx(ProjectLoaderImage, {
|
|
1911
|
+
loader,
|
|
1912
|
+
className
|
|
1913
|
+
});
|
|
1914
|
+
return /* @__PURE__ */ jsx(PowerhouseLogoAnimation, {
|
|
1915
|
+
size,
|
|
1916
|
+
className
|
|
1917
|
+
});
|
|
1918
|
+
}
|
|
1919
|
+
function PowerhouseLogoAnimation({ size = 48, className = "" }) {
|
|
1659
1920
|
const refsMap = useRef({});
|
|
1660
1921
|
const timers = useRef([]);
|
|
1661
1922
|
function getEls(id) {
|
|
@@ -1699,7 +1960,7 @@ function LogoAnimation({ size = 48, className = "" }) {
|
|
|
1699
1960
|
clearTimers();
|
|
1700
1961
|
resetAll();
|
|
1701
1962
|
SEQUENCE.forEach(({ id, dropDelay }) => runDrop(id, dropDelay));
|
|
1702
|
-
const fallStart =
|
|
1963
|
+
const fallStart = 2480;
|
|
1703
1964
|
SEQUENCE.forEach(({ id, fallDelay }) => runFall(id, fallStart + fallDelay));
|
|
1704
1965
|
schedule(startLoop, LOOP_TOTAL);
|
|
1705
1966
|
}
|
|
@@ -1789,7 +2050,7 @@ function TabContent(props) {
|
|
|
1789
2050
|
const toTabValue = (label) => label.trim().replace(/\s+/g, "-");
|
|
1790
2051
|
const resolveTabValue = (props) => props.value ?? toTabValue(props.label);
|
|
1791
2052
|
function Tabs({ children, defaultValue, onValueChange, listClassName }) {
|
|
1792
|
-
return /* @__PURE__ */ jsxs(Root$
|
|
2053
|
+
return /* @__PURE__ */ jsxs(Root$1, {
|
|
1793
2054
|
defaultValue: toTabValue(defaultValue),
|
|
1794
2055
|
onValueChange,
|
|
1795
2056
|
className: "flex min-h-0 flex-1 flex-col gap-2",
|
|
@@ -1798,10 +2059,10 @@ function Tabs({ children, defaultValue, onValueChange, listClassName }) {
|
|
|
1798
2059
|
children: /* @__PURE__ */ jsx(List, {
|
|
1799
2060
|
className: "flex w-full gap-x-2 rounded-xl p-1 text-sm font-semibold text-foreground outline-none",
|
|
1800
2061
|
children: React.Children.map(children, (child, _i) => {
|
|
1801
|
-
if (
|
|
2062
|
+
if (!/*#__PURE__*/ React.isValidElement(child)) return;
|
|
1802
2063
|
const props = child.props;
|
|
1803
2064
|
const value = resolveTabValue(props);
|
|
1804
|
-
return /* @__PURE__ */ jsx(Trigger$
|
|
2065
|
+
return /* @__PURE__ */ jsx(Trigger$1, {
|
|
1805
2066
|
className: "flex min-h-7 flex-1 items-center justify-center rounded-lg border border-border bg-background py-2 text-foreground transition duration-300 data-disabled:disabled-effect data-[state=active]:bg-accent data-[state=active]:text-foreground",
|
|
1806
2067
|
value,
|
|
1807
2068
|
disabled: props.disabled ?? false,
|
|
@@ -1812,10 +2073,11 @@ function Tabs({ children, defaultValue, onValueChange, listClassName }) {
|
|
|
1812
2073
|
}), /* @__PURE__ */ jsx("div", {
|
|
1813
2074
|
className: "mt-3 min-h-0 flex-1 rounded-md bg-background",
|
|
1814
2075
|
children: React.Children.map(children, (child, i) => {
|
|
1815
|
-
if (
|
|
1816
|
-
|
|
2076
|
+
if (!/*#__PURE__*/ React.isValidElement(child)) return;
|
|
2077
|
+
const value = resolveTabValue(child.props);
|
|
2078
|
+
return /* @__PURE__ */ jsx(Content$1, {
|
|
1817
2079
|
className: "h-full",
|
|
1818
|
-
value
|
|
2080
|
+
value,
|
|
1819
2081
|
children: child
|
|
1820
2082
|
}, i);
|
|
1821
2083
|
})
|
|
@@ -1848,271 +2110,8 @@ function DocumentStateViewer({ state, ignoredScopes = ["auth", "document"], defa
|
|
|
1848
2110
|
});
|
|
1849
2111
|
}
|
|
1850
2112
|
//#endregion
|
|
1851
|
-
//#region src/connect/components/tooltip/tooltip.tsx
|
|
1852
|
-
function ConnectTooltip(props) {
|
|
1853
|
-
const { children, content, open, defaultOpen, onOpenChange, className, side = "top", sideOffset = 5, delayDuration, ...rest } = props;
|
|
1854
|
-
return /* @__PURE__ */ jsxs(Root, {
|
|
1855
|
-
defaultOpen,
|
|
1856
|
-
delayDuration,
|
|
1857
|
-
onOpenChange,
|
|
1858
|
-
open,
|
|
1859
|
-
children: [/* @__PURE__ */ jsx(Trigger, {
|
|
1860
|
-
asChild: true,
|
|
1861
|
-
children
|
|
1862
|
-
}), /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content, {
|
|
1863
|
-
...rest,
|
|
1864
|
-
side,
|
|
1865
|
-
sideOffset,
|
|
1866
|
-
className: twMerge("z-50 rounded-lg border border-border bg-popover p-2 text-xs text-popover-foreground shadow-tooltip", className),
|
|
1867
|
-
children: content
|
|
1868
|
-
}) })]
|
|
1869
|
-
});
|
|
1870
|
-
}
|
|
1871
|
-
const ConnectTooltipProvider = Provider;
|
|
1872
|
-
//#endregion
|
|
1873
|
-
//#region src/connect/components/document-timeline/components/h-divider.tsx
|
|
1874
|
-
const HDivider = (props) => {
|
|
1875
|
-
const { className, timestampUtcMs: timestamp, title, subtitle, onClick, isSelected = false } = props;
|
|
1876
|
-
const [open, setOpen] = useState(false);
|
|
1877
|
-
const hasContent = !!title || !!subtitle || !!timestamp;
|
|
1878
|
-
useEffect(() => {
|
|
1879
|
-
if (open) {
|
|
1880
|
-
setOpen(false);
|
|
1881
|
-
setTimeout(() => hasContent && setOpen(true), 50);
|
|
1882
|
-
}
|
|
1883
|
-
}, [
|
|
1884
|
-
title,
|
|
1885
|
-
subtitle,
|
|
1886
|
-
timestamp,
|
|
1887
|
-
hasContent
|
|
1888
|
-
]);
|
|
1889
|
-
const formatTimestamp = (isoString) => {
|
|
1890
|
-
if (!isoString) return "";
|
|
1891
|
-
try {
|
|
1892
|
-
return formatDistanceToNow(new Date(isoString), { addSuffix: true });
|
|
1893
|
-
} catch {
|
|
1894
|
-
return isoString;
|
|
1895
|
-
}
|
|
1896
|
-
};
|
|
1897
|
-
const tooltipContent = /* @__PURE__ */ jsxs("div", {
|
|
1898
|
-
className: "flex flex-col text-xs",
|
|
1899
|
-
children: [
|
|
1900
|
-
!!title && /* @__PURE__ */ jsx("div", { children: title }),
|
|
1901
|
-
!!subtitle && /* @__PURE__ */ jsx("div", {
|
|
1902
|
-
className: "text-foreground",
|
|
1903
|
-
children: subtitle
|
|
1904
|
-
}),
|
|
1905
|
-
!!timestamp && /* @__PURE__ */ jsx("div", { children: formatTimestamp(timestamp) })
|
|
1906
|
-
]
|
|
1907
|
-
});
|
|
1908
|
-
const handleMouseEnter = () => {
|
|
1909
|
-
if (hasContent) setOpen(true);
|
|
1910
|
-
};
|
|
1911
|
-
const handleMouseLeave = () => {
|
|
1912
|
-
setOpen(false);
|
|
1913
|
-
};
|
|
1914
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1915
|
-
className: "relative",
|
|
1916
|
-
onMouseEnter: handleMouseEnter,
|
|
1917
|
-
onMouseLeave: handleMouseLeave,
|
|
1918
|
-
children: [isSelected && /* @__PURE__ */ jsx(Icon, {
|
|
1919
|
-
name: "TimelineCaret",
|
|
1920
|
-
color: "#4EA9FF",
|
|
1921
|
-
size: 10,
|
|
1922
|
-
className: "absolute top-[-11px] z-40"
|
|
1923
|
-
}), /* @__PURE__ */ jsx(ConnectTooltip, {
|
|
1924
|
-
className: "rounded-md bg-primary text-primary-foreground",
|
|
1925
|
-
content: tooltipContent,
|
|
1926
|
-
open: open && hasContent,
|
|
1927
|
-
onOpenChange: setOpen,
|
|
1928
|
-
delayDuration: 0,
|
|
1929
|
-
side: "bottom",
|
|
1930
|
-
sideOffset: 5,
|
|
1931
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
1932
|
-
className: twMerge("mx-0.5 flex h-6.25 w-1.5 cursor-pointer flex-col items-center justify-center rounded-xs hover:hover-effect", isSelected && "bg-info/10", className),
|
|
1933
|
-
onClick,
|
|
1934
|
-
"data-title": title,
|
|
1935
|
-
"data-subtitle": subtitle,
|
|
1936
|
-
"data-timestamp": timestamp,
|
|
1937
|
-
children: /* @__PURE__ */ jsx("div", { className: "h-0.5 w-1 rounded-full bg-muted" })
|
|
1938
|
-
})
|
|
1939
|
-
})]
|
|
1940
|
-
});
|
|
1941
|
-
};
|
|
1942
|
-
//#endregion
|
|
1943
|
-
//#region src/connect/components/document-timeline/components/timeline-bar.tsx
|
|
1944
|
-
const getBarHeight = (size = 0) => {
|
|
1945
|
-
switch (true) {
|
|
1946
|
-
case size <= 0: return "h-[1px]";
|
|
1947
|
-
case size === 1: return "h-[3px]";
|
|
1948
|
-
case size === 2: return "h-[6px]";
|
|
1949
|
-
case size === 3: return "h-[9px]";
|
|
1950
|
-
case size >= 4: return "h-[12px]";
|
|
1951
|
-
default: return "h-[1px]";
|
|
1952
|
-
}
|
|
1953
|
-
};
|
|
1954
|
-
const formatTimestamp$1 = (isoString) => {
|
|
1955
|
-
if (!isoString) return "";
|
|
1956
|
-
try {
|
|
1957
|
-
return format(parseISO(isoString), "HH:mm, dd, MMMM");
|
|
1958
|
-
} catch {
|
|
1959
|
-
return isoString;
|
|
1960
|
-
}
|
|
1961
|
-
};
|
|
1962
|
-
const TimelineBar = ({ onClick, className, timestampUtcMs: timestamp, additions, deletions, addSize = 0, delSize = 0, isSelected = false }) => {
|
|
1963
|
-
const [open, setOpen] = useState(false);
|
|
1964
|
-
const noChanges = addSize === 0 && delSize === 0;
|
|
1965
|
-
const addBarHeight = getBarHeight(addSize);
|
|
1966
|
-
const delBarHeight = getBarHeight(delSize);
|
|
1967
|
-
const tooltipContent = /* @__PURE__ */ jsxs("div", {
|
|
1968
|
-
className: "flex flex-col text-xs",
|
|
1969
|
-
children: [
|
|
1970
|
-
/* @__PURE__ */ jsx("div", { children: formatTimestamp$1(timestamp) }),
|
|
1971
|
-
/* @__PURE__ */ jsx("div", {
|
|
1972
|
-
className: "text-success",
|
|
1973
|
-
children: `${additions} additions +`
|
|
1974
|
-
}),
|
|
1975
|
-
/* @__PURE__ */ jsx("div", {
|
|
1976
|
-
className: "text-destructive",
|
|
1977
|
-
children: `${deletions} deletions -`
|
|
1978
|
-
})
|
|
1979
|
-
]
|
|
1980
|
-
});
|
|
1981
|
-
const handleMouseEnter = () => {
|
|
1982
|
-
if (!noChanges) setOpen(true);
|
|
1983
|
-
};
|
|
1984
|
-
const handleMouseLeave = () => {
|
|
1985
|
-
setOpen(false);
|
|
1986
|
-
};
|
|
1987
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1988
|
-
className: "relative",
|
|
1989
|
-
onMouseEnter: handleMouseEnter,
|
|
1990
|
-
onMouseLeave: handleMouseLeave,
|
|
1991
|
-
children: [isSelected && /* @__PURE__ */ jsx(Icon, {
|
|
1992
|
-
name: "TimelineCaret",
|
|
1993
|
-
color: "#4EA9FF",
|
|
1994
|
-
size: 10,
|
|
1995
|
-
className: "absolute top-[-11px] left-[-2px] z-40"
|
|
1996
|
-
}), noChanges ? /* @__PURE__ */ jsx("div", {
|
|
1997
|
-
className: twMerge("flex h-[25px] w-1.5 cursor-pointer flex-col items-center justify-center rounded-[2px] hover:hover-effect", className),
|
|
1998
|
-
"data-timestamp": timestamp,
|
|
1999
|
-
onClick,
|
|
2000
|
-
children: /* @__PURE__ */ jsx("div", { className: "size-[3px] rounded-full bg-muted-foreground" })
|
|
2001
|
-
}) : /* @__PURE__ */ jsx(ConnectTooltip, {
|
|
2002
|
-
className: "rounded-md bg-primary text-primary-foreground",
|
|
2003
|
-
content: tooltipContent,
|
|
2004
|
-
open,
|
|
2005
|
-
onOpenChange: setOpen,
|
|
2006
|
-
delayDuration: 0,
|
|
2007
|
-
side: "bottom",
|
|
2008
|
-
sideOffset: 5,
|
|
2009
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
2010
|
-
className: twMerge("flex h-[25px] w-1.5 cursor-pointer flex-col items-center justify-center rounded-[2px] hover:hover-effect", className, isSelected && "bg-info/10"),
|
|
2011
|
-
"data-timestamp": timestamp,
|
|
2012
|
-
onClick,
|
|
2013
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
2014
|
-
className: "flex h-3 w-0.5 items-end",
|
|
2015
|
-
children: /* @__PURE__ */ jsx("div", { className: twMerge("h-3 w-0.5 rounded-t-full bg-success", addBarHeight) })
|
|
2016
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
2017
|
-
className: "flex h-3 w-0.5 items-start",
|
|
2018
|
-
children: /* @__PURE__ */ jsx("div", { className: twMerge("h-3 w-0.5 rounded-b-full bg-destructive", delBarHeight) })
|
|
2019
|
-
})]
|
|
2020
|
-
})
|
|
2021
|
-
})]
|
|
2022
|
-
});
|
|
2023
|
-
};
|
|
2024
|
-
//#endregion
|
|
2025
2113
|
//#region src/connect/components/document-timeline/document-timeline.tsx
|
|
2026
|
-
const
|
|
2027
|
-
id: "default",
|
|
2028
|
-
type: "bar",
|
|
2029
|
-
addSize: 0,
|
|
2030
|
-
delSize: 0
|
|
2031
|
-
};
|
|
2032
|
-
const DocumentTimeline = (props) => {
|
|
2033
|
-
const { timeline = [], onItemClick } = props;
|
|
2034
|
-
const [selectedItem, setSelectedItem] = useState(null);
|
|
2035
|
-
const scrollContainerRef = useRef(null);
|
|
2036
|
-
const handleClick = (item) => {
|
|
2037
|
-
if (item.id === selectedItem || item.id === defaultTimeLineItem.id) {
|
|
2038
|
-
onItemClick?.(null);
|
|
2039
|
-
setSelectedItem(null);
|
|
2040
|
-
} else {
|
|
2041
|
-
onItemClick?.(item);
|
|
2042
|
-
setSelectedItem(item.id);
|
|
2043
|
-
}
|
|
2044
|
-
};
|
|
2045
|
-
const mergedTimelineItems = [...timeline, defaultTimeLineItem];
|
|
2046
|
-
const [unselectedItems, selectedItems] = useMemo(() => {
|
|
2047
|
-
const indexSelected = mergedTimelineItems.findIndex((item) => item.id === selectedItem);
|
|
2048
|
-
return indexSelected === -1 ? [mergedTimelineItems, []] : [mergedTimelineItems.slice(0, indexSelected), mergedTimelineItems.slice(indexSelected)];
|
|
2049
|
-
}, [mergedTimelineItems, selectedItem]);
|
|
2050
|
-
const renderTimelineItems = useCallback((items) => {
|
|
2051
|
-
return items.map((item) => {
|
|
2052
|
-
if (item.type === "divider") {
|
|
2053
|
-
const { timestampUtcMs, title, subtitle } = item;
|
|
2054
|
-
return /* @__PURE__ */ jsx(HDivider, {
|
|
2055
|
-
timestampUtcMs,
|
|
2056
|
-
title,
|
|
2057
|
-
subtitle,
|
|
2058
|
-
onClick: () => handleClick(item),
|
|
2059
|
-
isSelected: item.id === selectedItem
|
|
2060
|
-
}, item.id);
|
|
2061
|
-
}
|
|
2062
|
-
return /* @__PURE__ */ jsx(TimelineBar, {
|
|
2063
|
-
timestampUtcMs: item.timestampUtcMs,
|
|
2064
|
-
addSize: item.addSize,
|
|
2065
|
-
delSize: item.delSize,
|
|
2066
|
-
additions: item.additions,
|
|
2067
|
-
deletions: item.deletions,
|
|
2068
|
-
isSelected: item.id === selectedItem,
|
|
2069
|
-
onClick: () => handleClick(item)
|
|
2070
|
-
}, item.id);
|
|
2071
|
-
});
|
|
2072
|
-
}, [handleClick, selectedItem]);
|
|
2073
|
-
const unselectedContent = useMemo(() => renderTimelineItems(unselectedItems), [unselectedItems, renderTimelineItems]);
|
|
2074
|
-
const selectedContent = useMemo(() => renderTimelineItems(selectedItems), [selectedItems, renderTimelineItems]);
|
|
2075
|
-
useEffect(() => {
|
|
2076
|
-
if (scrollContainerRef.current) scrollContainerRef.current.scrollLeft = scrollContainerRef.current.scrollWidth;
|
|
2077
|
-
}, []);
|
|
2078
|
-
return /* @__PURE__ */ jsx(ConnectTooltipProvider, {
|
|
2079
|
-
delayDuration: 0,
|
|
2080
|
-
skipDelayDuration: 0,
|
|
2081
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
2082
|
-
className: "relative h-[36px] w-full",
|
|
2083
|
-
children: [
|
|
2084
|
-
/* @__PURE__ */ jsx("div", {
|
|
2085
|
-
className: "absolute left-0 z-20 h-[17px] w-[6px] bg-background",
|
|
2086
|
-
children: /* @__PURE__ */ jsx("div", { className: "mt-[11px] h-[6px] w-[6px] rounded-tl-md bg-background" })
|
|
2087
|
-
}),
|
|
2088
|
-
/* @__PURE__ */ jsx("div", {
|
|
2089
|
-
className: "absolute top-[11px] right-0 z-20 h-[6px] w-[6px] bg-background",
|
|
2090
|
-
children: /* @__PURE__ */ jsx("div", { className: "h-[6px] w-[6px] rounded-tr-md bg-background" })
|
|
2091
|
-
}),
|
|
2092
|
-
/* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 bottom-0 h-[25px] rounded-md bg-background" }),
|
|
2093
|
-
/* @__PURE__ */ jsx("div", {
|
|
2094
|
-
className: "absolute inset-x-0 bottom-0 h-[36px]",
|
|
2095
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
2096
|
-
ref: scrollContainerRef,
|
|
2097
|
-
className: "h-full overflow-x-auto rounded-md",
|
|
2098
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
2099
|
-
className: "ml-auto flex h-[36px] w-max items-end px-2 pb-0",
|
|
2100
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
2101
|
-
className: "flex",
|
|
2102
|
-
children: unselectedContent
|
|
2103
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
2104
|
-
className: "flex rounded-sm bg-info/10",
|
|
2105
|
-
children: selectedContent
|
|
2106
|
-
})]
|
|
2107
|
-
})
|
|
2108
|
-
})
|
|
2109
|
-
}),
|
|
2110
|
-
/* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute bottom-0 left-0 z-10 h-[25px] w-2 rounded-l-md bg-background" }),
|
|
2111
|
-
/* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute right-0 bottom-0 z-10 h-[25px] w-2 rounded-r-md bg-background" })
|
|
2112
|
-
]
|
|
2113
|
-
})
|
|
2114
|
-
});
|
|
2115
|
-
};
|
|
2114
|
+
const DocumentTimeline = lazyComponent(() => import("../document-timeline.impl-zx6f7k2d.js").then((m) => m.DocumentTimeline));
|
|
2116
2115
|
//#endregion
|
|
2117
2116
|
//#region src/connect/components/document-toolbar/containers.tsx
|
|
2118
2117
|
/**
|
|
@@ -2147,6 +2146,105 @@ function ToolbarControlsContainer(props) {
|
|
|
2147
2146
|
}
|
|
2148
2147
|
//#endregion
|
|
2149
2148
|
//#region src/connect/components/document-toolbar/use-document-undo-redo.ts
|
|
2149
|
+
const UNAVAILABLE = {
|
|
2150
|
+
canUndo: false,
|
|
2151
|
+
canRedo: false
|
|
2152
|
+
};
|
|
2153
|
+
/** The scope `undo()` and `redo()` target by default. */
|
|
2154
|
+
const UNDO_SCOPE = "global";
|
|
2155
|
+
function isRetractionDocument(document) {
|
|
2156
|
+
const create = document.operations?.document?.[0]?.action;
|
|
2157
|
+
const input = create?.type === "CREATE_DOCUMENT" ? create.input : void 0;
|
|
2158
|
+
return undoCapabilitiesOf(document.header, input)?.undo === "retraction";
|
|
2159
|
+
}
|
|
2160
|
+
function undoRoute(client, document) {
|
|
2161
|
+
if (!document || !isRetractionDocument(document)) return "dispatch";
|
|
2162
|
+
return client ? "client" : "none";
|
|
2163
|
+
}
|
|
2164
|
+
const DISABLED = {
|
|
2165
|
+
canUndo: false,
|
|
2166
|
+
canRedo: false,
|
|
2167
|
+
undo: () => void 0,
|
|
2168
|
+
redo: () => void 0
|
|
2169
|
+
};
|
|
2170
|
+
const availabilityReads = /* @__PURE__ */ new WeakMap();
|
|
2171
|
+
function readAvailability(client, documentId, revision) {
|
|
2172
|
+
let reads = availabilityReads.get(client);
|
|
2173
|
+
if (!reads) {
|
|
2174
|
+
reads = /* @__PURE__ */ new Map();
|
|
2175
|
+
availabilityReads.set(client, reads);
|
|
2176
|
+
}
|
|
2177
|
+
const cached = reads.get(documentId);
|
|
2178
|
+
if (cached?.revision === revision) return cached.read;
|
|
2179
|
+
const entry = {
|
|
2180
|
+
revision,
|
|
2181
|
+
read: Promise.resolve(UNAVAILABLE)
|
|
2182
|
+
};
|
|
2183
|
+
entry.read = client.undoRedoAvailability(documentId, UNDO_SCOPE).catch((error) => {
|
|
2184
|
+
console.error("Failed to read undo and redo availability:", error);
|
|
2185
|
+
if (reads.get(documentId) === entry) reads.delete(documentId);
|
|
2186
|
+
return UNAVAILABLE;
|
|
2187
|
+
});
|
|
2188
|
+
reads.set(documentId, entry);
|
|
2189
|
+
return entry.read;
|
|
2190
|
+
}
|
|
2191
|
+
const pendingPresses = /* @__PURE__ */ new WeakMap();
|
|
2192
|
+
function queuePress(client, documentId, press, failure) {
|
|
2193
|
+
let presses = pendingPresses.get(client);
|
|
2194
|
+
if (!presses) {
|
|
2195
|
+
presses = /* @__PURE__ */ new Map();
|
|
2196
|
+
pendingPresses.set(client, presses);
|
|
2197
|
+
}
|
|
2198
|
+
const queue = presses;
|
|
2199
|
+
const prior = queue.get(documentId);
|
|
2200
|
+
const run = (prior ? prior.then(press) : new Promise((resolve) => resolve(press()))).catch((error) => {
|
|
2201
|
+
console.error(failure, error);
|
|
2202
|
+
});
|
|
2203
|
+
queue.set(documentId, run);
|
|
2204
|
+
run.finally(() => {
|
|
2205
|
+
if (queue.get(documentId) === run) queue.delete(documentId);
|
|
2206
|
+
});
|
|
2207
|
+
}
|
|
2208
|
+
/**
|
|
2209
|
+
* Undo and redo of a base-reducer 3 document through the reactor client, so
|
|
2210
|
+
* the author signs the RETRACT it submits. Availability is read when the
|
|
2211
|
+
* global or document revision changes, and presses run one at a time.
|
|
2212
|
+
* Without a client the controls are disabled. Returns undefined below
|
|
2213
|
+
* base-reducer 3, where the caller dispatches UNDO and REDO itself.
|
|
2214
|
+
*/
|
|
2215
|
+
function useBaseReducer3UndoRedo(document) {
|
|
2216
|
+
const client = useReactorClient();
|
|
2217
|
+
const route = undoRoute(client, document);
|
|
2218
|
+
const documentId = route === "client" ? document?.header.id : void 0;
|
|
2219
|
+
const revision = `${document?.header.revision[UNDO_SCOPE] ?? 0}:${document?.header.revision.document ?? 0}`;
|
|
2220
|
+
const [availability, setAvailability] = useState({ value: UNAVAILABLE });
|
|
2221
|
+
useEffect(() => {
|
|
2222
|
+
if (!client || !documentId) return;
|
|
2223
|
+
let cancelled = false;
|
|
2224
|
+
readAvailability(client, documentId, revision).then((value) => {
|
|
2225
|
+
if (!cancelled) setAvailability({
|
|
2226
|
+
documentId,
|
|
2227
|
+
value
|
|
2228
|
+
});
|
|
2229
|
+
});
|
|
2230
|
+
return () => {
|
|
2231
|
+
cancelled = true;
|
|
2232
|
+
};
|
|
2233
|
+
}, [
|
|
2234
|
+
client,
|
|
2235
|
+
documentId,
|
|
2236
|
+
revision
|
|
2237
|
+
]);
|
|
2238
|
+
if (route === "none") return DISABLED;
|
|
2239
|
+
if (!client || !documentId) return void 0;
|
|
2240
|
+
const { canUndo, canRedo } = availability.documentId === documentId ? availability.value : UNAVAILABLE;
|
|
2241
|
+
return {
|
|
2242
|
+
canUndo,
|
|
2243
|
+
canRedo,
|
|
2244
|
+
undo: () => queuePress(client, documentId, () => client.undo(documentId, UNDO_SCOPE), "Failed to undo:"),
|
|
2245
|
+
redo: () => queuePress(client, documentId, () => client.redo(documentId, UNDO_SCOPE), "Failed to redo:")
|
|
2246
|
+
};
|
|
2247
|
+
}
|
|
2150
2248
|
/**
|
|
2151
2249
|
* Checks whether a document has at least one non-zero revision count.
|
|
2152
2250
|
*
|
|
@@ -2160,11 +2258,17 @@ function hasRevisions(document) {
|
|
|
2160
2258
|
/**
|
|
2161
2259
|
* Returns undo state and an undo dispatcher for a document.
|
|
2162
2260
|
*
|
|
2163
|
-
*
|
|
2164
|
-
*
|
|
2261
|
+
* On base-reducer 3 both come from the reactor client, and without one undo
|
|
2262
|
+
* is disabled. Otherwise `canUndo` is true when the document has at least one
|
|
2263
|
+
* non-zero revision count across any revision scope, and undo dispatches UNDO.
|
|
2165
2264
|
*/
|
|
2166
2265
|
function useUndo(documentId) {
|
|
2167
2266
|
const [document, dispatch] = useDocumentById(documentId);
|
|
2267
|
+
const client = useBaseReducer3UndoRedo(document);
|
|
2268
|
+
if (client) return {
|
|
2269
|
+
canUndo: client.canUndo,
|
|
2270
|
+
undo: client.undo
|
|
2271
|
+
};
|
|
2168
2272
|
return {
|
|
2169
2273
|
canUndo: hasRevisions(document),
|
|
2170
2274
|
undo: () => dispatch(undo())
|
|
@@ -2173,11 +2277,18 @@ function useUndo(documentId) {
|
|
|
2173
2277
|
/**
|
|
2174
2278
|
* Returns redo state and a redo dispatcher for a document.
|
|
2175
2279
|
*
|
|
2176
|
-
*
|
|
2177
|
-
*
|
|
2280
|
+
* On base-reducer 3 both come from the reactor client, and without one redo
|
|
2281
|
+
* is disabled. Otherwise `canRedo` is true when the document clipboard
|
|
2282
|
+
* contains at least one operation that can be reapplied, and redo dispatches
|
|
2283
|
+
* REDO.
|
|
2178
2284
|
*/
|
|
2179
2285
|
function useRedo(documentId) {
|
|
2180
2286
|
const [document, dispatch] = useDocumentById(documentId);
|
|
2287
|
+
const client = useBaseReducer3UndoRedo(document);
|
|
2288
|
+
if (client) return {
|
|
2289
|
+
canRedo: client.canRedo,
|
|
2290
|
+
redo: client.redo
|
|
2291
|
+
};
|
|
2181
2292
|
return {
|
|
2182
2293
|
canRedo: hasAtLeast(document?.clipboard ?? [], 1),
|
|
2183
2294
|
redo: () => dispatch(redo())
|
|
@@ -2239,12 +2350,11 @@ function ToolbarRedoButton(props) {
|
|
|
2239
2350
|
}) } = props;
|
|
2240
2351
|
const { redo, canRedo } = useRedo(document?.header.id);
|
|
2241
2352
|
const onClick = makeOnClick(document, onClickOverride, redo);
|
|
2242
|
-
const disabled = !canRedo;
|
|
2243
2353
|
return /* @__PURE__ */ jsx(ToolbarButton, {
|
|
2244
2354
|
"data-testid": "toolbar-redo-button",
|
|
2245
2355
|
"aria-label": "Redo",
|
|
2246
2356
|
className,
|
|
2247
|
-
disabled,
|
|
2357
|
+
disabled: !canRedo,
|
|
2248
2358
|
onClick,
|
|
2249
2359
|
children
|
|
2250
2360
|
});
|
|
@@ -2315,7 +2425,8 @@ function ToolbarHistoryButton(props) {
|
|
|
2315
2425
|
/**
|
|
2316
2426
|
* Toolbar control for closing the current document view.
|
|
2317
2427
|
*
|
|
2318
|
-
* By default, this
|
|
2428
|
+
* By default, this goes back when the app's history allows, else it selects the
|
|
2429
|
+
* current document's parent folder. Provide
|
|
2319
2430
|
* `children` to replace the default icon, or `onClick` to override the default
|
|
2320
2431
|
* close behavior.
|
|
2321
2432
|
*/
|
|
@@ -2324,8 +2435,7 @@ function ToolbarCloseButton(props) {
|
|
|
2324
2435
|
name: "XmarkLight",
|
|
2325
2436
|
size: 16
|
|
2326
2437
|
}) } = props;
|
|
2327
|
-
const
|
|
2328
|
-
const onClick = makeOnClick(document, onClickOverride, () => setSelectedNode(parentFolder));
|
|
2438
|
+
const onClick = makeOnClick(document, onClickOverride, useCloseNode(document?.header.id));
|
|
2329
2439
|
return /* @__PURE__ */ jsx(ToolbarButton, {
|
|
2330
2440
|
"data-testid": "toolbar-close-button",
|
|
2331
2441
|
"aria-label": "Close document",
|
|
@@ -2860,7 +2970,7 @@ function UploadFileItemStatusRow(props) {
|
|
|
2860
2970
|
}
|
|
2861
2971
|
//#endregion
|
|
2862
2972
|
//#region src/connect/components/upload-file-item/upload-file-item.tsx
|
|
2863
|
-
const UploadFileItem =
|
|
2973
|
+
const UploadFileItem = /*#__PURE__*/ forwardRef(function UploadFileItem(props, ref) {
|
|
2864
2974
|
const { fileName, fileSize, status, documentType, progress = 0, errorDetails, onClose, onOpenDocument, onFindResolution, className, ...delegatedProps } = props;
|
|
2865
2975
|
return /* @__PURE__ */ jsxs("div", {
|
|
2866
2976
|
ref,
|
|
@@ -3100,7 +3210,7 @@ function uploadsReducer(state, action) {
|
|
|
3100
3210
|
}
|
|
3101
3211
|
}
|
|
3102
3212
|
function useUploadTracker(useLocalStorage = false, driveId) {
|
|
3103
|
-
const
|
|
3213
|
+
const getInitialState = useCallback(() => {
|
|
3104
3214
|
if (useLocalStorage && driveId) try {
|
|
3105
3215
|
const stored = localStorage.getItem(`uploadTracker_${driveId}`);
|
|
3106
3216
|
if (stored) return JSON.parse(stored);
|
|
@@ -3110,7 +3220,8 @@ function useUploadTracker(useLocalStorage = false, driveId) {
|
|
|
3110
3220
|
return {};
|
|
3111
3221
|
}
|
|
3112
3222
|
return {};
|
|
3113
|
-
}, [useLocalStorage, driveId])
|
|
3223
|
+
}, [useLocalStorage, driveId]);
|
|
3224
|
+
const [uploads, dispatch] = useReducer(uploadsReducer, getInitialState());
|
|
3114
3225
|
useEffect(() => {
|
|
3115
3226
|
if (useLocalStorage && driveId) try {
|
|
3116
3227
|
localStorage.setItem(`uploadTracker_${driveId}`, JSON.stringify(uploads));
|
|
@@ -3152,11 +3263,12 @@ function useUploadTracker(useLocalStorage = false, driveId) {
|
|
|
3152
3263
|
});
|
|
3153
3264
|
};
|
|
3154
3265
|
try {
|
|
3266
|
+
const fileNode = await onAddFile(file, parent, progressCallback);
|
|
3155
3267
|
dispatch({
|
|
3156
3268
|
type: "SET_FILE_NODE",
|
|
3157
3269
|
payload: {
|
|
3158
3270
|
id: fileId,
|
|
3159
|
-
fileNode:
|
|
3271
|
+
fileNode: fileNode || void 0
|
|
3160
3272
|
}
|
|
3161
3273
|
});
|
|
3162
3274
|
} catch (error) {
|
|
@@ -3262,6 +3374,7 @@ function DropZone(props) {
|
|
|
3262
3374
|
setConflictUploadId(null);
|
|
3263
3375
|
};
|
|
3264
3376
|
const { isDropTarget, ...dropProps } = useDropFile(handleAddFile);
|
|
3377
|
+
const setSelectedNode = useSetSelectedNode();
|
|
3265
3378
|
return /* @__PURE__ */ jsxs("div", {
|
|
3266
3379
|
className: twMerge("relative", className),
|
|
3267
3380
|
...enable ? dropProps : {},
|
|
@@ -3429,22 +3542,32 @@ function EditorUndoRedoButtons(props) {
|
|
|
3429
3542
|
});
|
|
3430
3543
|
}
|
|
3431
3544
|
//#endregion
|
|
3432
|
-
//#region
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3545
|
+
//#region src/connect/components/branding/connect-branding.tsx
|
|
3546
|
+
/**
|
|
3547
|
+
* Connect's branding as the components see it: the host app provides it once
|
|
3548
|
+
* at its root (images already resolved to data URIs) and the components read
|
|
3549
|
+
* it from here instead of reaching into configuration. `icons` are the drive
|
|
3550
|
+
* explorer's, which the generic plugin owns; `appName`, `icon` and
|
|
3551
|
+
* `homeBackground` are Connect's identity (`connect.branding`). Without a
|
|
3552
|
+
* provider every built-in icon renders.
|
|
3553
|
+
*/
|
|
3554
|
+
const ConnectBrandingContext = /*#__PURE__*/ createContext({});
|
|
3555
|
+
function ConnectBrandingProvider(props) {
|
|
3556
|
+
return /* @__PURE__ */ jsx(ConnectBrandingContext.Provider, {
|
|
3557
|
+
value: props.branding ?? {},
|
|
3558
|
+
children: props.children
|
|
3446
3559
|
});
|
|
3447
3560
|
}
|
|
3561
|
+
/** The provided branding; `{}` (built-in look) without a provider. */
|
|
3562
|
+
function useConnectBranding() {
|
|
3563
|
+
return useContext(ConnectBrandingContext);
|
|
3564
|
+
}
|
|
3565
|
+
/** The icon for a document of `documentType`: the explorer's icon for that
|
|
3566
|
+
* type, else its default document icon, else undefined (the icon the package
|
|
3567
|
+
* ships, or the built-in one). */
|
|
3568
|
+
function brandedDocumentIcon(branding, documentType) {
|
|
3569
|
+
return branding.icons?.documents?.[documentType] ?? branding.icons?.document ?? void 0;
|
|
3570
|
+
}
|
|
3448
3571
|
//#endregion
|
|
3449
3572
|
//#region src/connect/constants/options.tsx
|
|
3450
3573
|
const defaultDriveOptions = [
|
|
@@ -3675,6 +3798,11 @@ function getDriveSharingType$1(drive) {
|
|
|
3675
3798
|
}
|
|
3676
3799
|
function FileItem(props) {
|
|
3677
3800
|
const { fileNode, className, customDocumentIconSrc } = props;
|
|
3801
|
+
const setSelectedNode = useSetSelectedNode();
|
|
3802
|
+
const preloadNode = usePreloadNode();
|
|
3803
|
+
const target = useNodeTarget(fileNode);
|
|
3804
|
+
const link = useLinkProps(target, () => setSelectedNode(fileNode));
|
|
3805
|
+
const href = props.href ?? (target ? link.href : void 0);
|
|
3678
3806
|
const [mode, setMode] = useState("READ");
|
|
3679
3807
|
const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState(false);
|
|
3680
3808
|
const [selectedDrive] = useSelectedDriveSafe();
|
|
@@ -3685,9 +3813,12 @@ function FileItem(props) {
|
|
|
3685
3813
|
});
|
|
3686
3814
|
const { isAllowedToCreateDocuments } = useUserPermissions();
|
|
3687
3815
|
const editorModules = useEditorModulesForDocumentType(fileNode.documentType);
|
|
3688
|
-
const
|
|
3689
|
-
|
|
3690
|
-
|
|
3816
|
+
const preload = () => {
|
|
3817
|
+
editorModules?.forEach((editorModule) => {
|
|
3818
|
+
preloadEditorModule(editorModule);
|
|
3819
|
+
});
|
|
3820
|
+
preloadNode(fileNode);
|
|
3821
|
+
};
|
|
3691
3822
|
const { onRenameNode, onRenameDriveNodes, onDuplicateNode } = useNodeActions();
|
|
3692
3823
|
const downloadDocument = useDownloadDocument(fileNode.id);
|
|
3693
3824
|
const isReadMode = mode === "READ";
|
|
@@ -3718,13 +3849,15 @@ function FileItem(props) {
|
|
|
3718
3849
|
handler();
|
|
3719
3850
|
setIsDropdownMenuOpen(false);
|
|
3720
3851
|
}
|
|
3852
|
+
const branding = useConnectBranding();
|
|
3853
|
+
const documentIconSrc = customDocumentIconSrc ?? brandedDocumentIcon(branding, fileNode.documentType);
|
|
3721
3854
|
const iconNode = /* @__PURE__ */ jsxs("div", {
|
|
3722
3855
|
className: "relative",
|
|
3723
|
-
children: [
|
|
3856
|
+
children: [documentIconSrc ? /* @__PURE__ */ jsx("img", {
|
|
3724
3857
|
alt: "file icon",
|
|
3725
|
-
className: "max-w-none",
|
|
3858
|
+
className: "max-w-none object-contain",
|
|
3726
3859
|
height: 34,
|
|
3727
|
-
src:
|
|
3860
|
+
src: documentIconSrc,
|
|
3728
3861
|
width: 32,
|
|
3729
3862
|
draggable: false
|
|
3730
3863
|
}) : /* @__PURE__ */ jsx(DefaultFileIcon, {}), isReadMode && syncStatus && /* @__PURE__ */ jsx("div", {
|
|
@@ -3758,6 +3891,7 @@ function FileItem(props) {
|
|
|
3758
3891
|
children: /* @__PURE__ */ jsx("button", {
|
|
3759
3892
|
className: twMerge("hidden group-hover:block", isDropdownMenuOpen && "block"),
|
|
3760
3893
|
onClick: (e) => {
|
|
3894
|
+
e.preventDefault();
|
|
3761
3895
|
e.stopPropagation();
|
|
3762
3896
|
setIsDropdownMenuOpen(true);
|
|
3763
3897
|
},
|
|
@@ -3773,10 +3907,15 @@ function FileItem(props) {
|
|
|
3773
3907
|
onCancel,
|
|
3774
3908
|
onSubmit
|
|
3775
3909
|
});
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3910
|
+
const isLink = isReadMode && !!href;
|
|
3911
|
+
return /* @__PURE__ */ jsx(isLink ? "a" : "div", {
|
|
3912
|
+
href: isLink ? href : void 0,
|
|
3913
|
+
"aria-current": isLink ? link["aria-current"] : void 0,
|
|
3914
|
+
className: "relative block w-64",
|
|
3915
|
+
onClick: isLink ? link.onClick : isReadMode ? () => setSelectedNode(fileNode) : void 0,
|
|
3916
|
+
onMouseEnter: preload,
|
|
3917
|
+
onTouchStart: preload,
|
|
3918
|
+
onFocus: preload,
|
|
3780
3919
|
...dragProps,
|
|
3781
3920
|
children: /* @__PURE__ */ jsx("div", {
|
|
3782
3921
|
className: containerStyles,
|
|
@@ -3902,6 +4041,12 @@ function DefaultFileIcon() {
|
|
|
3902
4041
|
//#region src/connect/components/folder-item/folder-item.tsx
|
|
3903
4042
|
function FolderItem(props) {
|
|
3904
4043
|
const { folderNode, className } = props;
|
|
4044
|
+
const folderIconSrc = useConnectBranding().icons?.folder;
|
|
4045
|
+
const setSelectedNode = useSetSelectedNode();
|
|
4046
|
+
const preloadNode = usePreloadNode();
|
|
4047
|
+
const target = useNodeTarget(folderNode);
|
|
4048
|
+
const link = useLinkProps(target, () => setSelectedNode(folderNode));
|
|
4049
|
+
const href = props.href ?? (target ? link.href : void 0);
|
|
3905
4050
|
const { isAllowedToCreateDocuments } = useUserPermissions();
|
|
3906
4051
|
const [mode, setMode] = useState("READ");
|
|
3907
4052
|
const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState(false);
|
|
@@ -3949,9 +4094,15 @@ function FolderItem(props) {
|
|
|
3949
4094
|
onSubmit
|
|
3950
4095
|
});
|
|
3951
4096
|
const containerStyles = twMerge("group flex h-12 cursor-pointer items-center rounded-lg bg-muted px-2 select-none", isDragging ? "opacity-60" : isDropTarget ? "bg-info/10" : "", className);
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
4097
|
+
const isLink = isReadMode && !!href;
|
|
4098
|
+
return /* @__PURE__ */ jsx(isLink ? "a" : "div", {
|
|
4099
|
+
href: isLink ? href : void 0,
|
|
4100
|
+
"aria-current": isLink ? link["aria-current"] : void 0,
|
|
4101
|
+
className: "relative block w-64 hover:hover-effect",
|
|
4102
|
+
onClick: isLink ? link.onClick : isReadMode ? () => setSelectedNode(folderNode) : void 0,
|
|
4103
|
+
onMouseEnter: () => preloadNode(folderNode),
|
|
4104
|
+
onTouchStart: () => preloadNode(folderNode),
|
|
4105
|
+
onFocus: () => preloadNode(folderNode),
|
|
3955
4106
|
children: /* @__PURE__ */ jsxs("div", {
|
|
3956
4107
|
...dragProps,
|
|
3957
4108
|
...dropProps,
|
|
@@ -3962,7 +4113,14 @@ function FolderItem(props) {
|
|
|
3962
4113
|
className: "p-1",
|
|
3963
4114
|
children: /* @__PURE__ */ jsx("div", {
|
|
3964
4115
|
className: "relative text-foreground",
|
|
3965
|
-
children: /* @__PURE__ */ jsx(
|
|
4116
|
+
children: folderIconSrc ? /* @__PURE__ */ jsx("img", {
|
|
4117
|
+
alt: "folder icon",
|
|
4118
|
+
className: "object-contain",
|
|
4119
|
+
src: folderIconSrc,
|
|
4120
|
+
width: 24,
|
|
4121
|
+
height: 24,
|
|
4122
|
+
draggable: false
|
|
4123
|
+
}) : /* @__PURE__ */ jsx(Icon, {
|
|
3966
4124
|
name: "FolderClose",
|
|
3967
4125
|
size: 24
|
|
3968
4126
|
})
|
|
@@ -3976,6 +4134,7 @@ function FolderItem(props) {
|
|
|
3976
4134
|
children: /* @__PURE__ */ jsx("button", {
|
|
3977
4135
|
className: twMerge("ml-auto hidden group-hover:block", isDropdownMenuOpen && "block"),
|
|
3978
4136
|
onClick: (e) => {
|
|
4137
|
+
e.preventDefault();
|
|
3979
4138
|
e.stopPropagation();
|
|
3980
4139
|
setIsDropdownMenuOpen(true);
|
|
3981
4140
|
},
|
|
@@ -3991,334 +4150,105 @@ function FolderItem(props) {
|
|
|
3991
4150
|
//#endregion
|
|
3992
4151
|
//#region src/connect/components/footer/footer-link.tsx
|
|
3993
4152
|
function FooterLink(props) {
|
|
3994
|
-
const { as: Component = "a", className, ...restProps } = props;
|
|
3995
|
-
return /* @__PURE__ */ jsx(Component, {
|
|
3996
|
-
className: twMerge("flex cursor-pointer items-center hover:underline", typeof className === "string" && className),
|
|
3997
|
-
...restProps
|
|
3998
|
-
});
|
|
3999
|
-
}
|
|
4000
|
-
//#endregion
|
|
4001
|
-
//#region src/connect/components/footer/footer.tsx
|
|
4002
|
-
const Footer = ({ children, className, ...props }) => {
|
|
4003
|
-
return /* @__PURE__ */ jsx("footer", {
|
|
4004
|
-
className: twMerge("flex items-center gap-x-6 text-xs font-medium text-foreground", typeof className === "string" && className),
|
|
4005
|
-
...props,
|
|
4006
|
-
children
|
|
4007
|
-
});
|
|
4008
|
-
};
|
|
4009
|
-
//#endregion
|
|
4010
|
-
//#region src/connect/components/form-input/form-input.tsx
|
|
4011
|
-
const FormInput = /* @__PURE__ */ forwardRef(function FormInput(props, ref) {
|
|
4012
|
-
const { icon, errorMessage, isDirty, containerClassName, inputClassName, errorMessageClassName, hideErrors = false, ...delegatedProps } = props;
|
|
4013
|
-
const type = props.type ?? "text";
|
|
4014
|
-
const isError = !!errorMessage;
|
|
4015
|
-
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
|
|
4016
|
-
className: twMerge("mb-1 flex gap-2 rounded-md border border-border bg-background p-3 text-foreground placeholder:text-muted-foreground disabled:disabled-effect", isError && "border-destructive", containerClassName),
|
|
4017
|
-
children: [icon && /* @__PURE__ */ jsx("span", {
|
|
4018
|
-
className: twJoin((!isDirty || isError) && "text-foreground"),
|
|
4019
|
-
children: icon
|
|
4020
|
-
}), /* @__PURE__ */ jsx("input", {
|
|
4021
|
-
...delegatedProps,
|
|
4022
|
-
className: twMerge("w-full bg-transparent font-semibold outline-none", inputClassName),
|
|
4023
|
-
ref,
|
|
4024
|
-
type
|
|
4025
|
-
})]
|
|
4026
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
4027
|
-
className: twMerge("hidden min-h-4 text-xs text-destructive", isError && "block", hideErrors && "hidden", errorMessageClassName),
|
|
4028
|
-
children: errorMessage
|
|
4029
|
-
})] });
|
|
4030
|
-
});
|
|
4031
|
-
//#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
|
-
//#region src/connect/components/form/add-local-drive-form.tsx
|
|
4067
|
-
function AddLocalDriveForm(props) {
|
|
4068
|
-
const { register, handleSubmit, control, formState: { errors } } = useForm({ defaultValues: {
|
|
4069
|
-
name: "",
|
|
4070
|
-
sharingType: "LOCAL",
|
|
4071
|
-
availableOffline: false,
|
|
4072
|
-
id: props.appOptions[0].id
|
|
4073
|
-
} });
|
|
4074
|
-
return /* @__PURE__ */ jsx("form", {
|
|
4075
|
-
name: "add-local-drive",
|
|
4076
|
-
onSubmit: (e) => void handleSubmit(props.onSubmit)(e),
|
|
4077
|
-
className: "flex flex-col gap-4",
|
|
4078
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
4079
|
-
className: "flex flex-col gap-4",
|
|
4080
|
-
children: [
|
|
4081
|
-
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Label, {
|
|
4082
|
-
htmlFor: "name",
|
|
4083
|
-
className: "text-sm font-medium text-foreground",
|
|
4084
|
-
children: "Drive Name"
|
|
4085
|
-
}), /* @__PURE__ */ jsx(FormInput, {
|
|
4086
|
-
...register("name", { required: "Drive name is required" }),
|
|
4087
|
-
errorMessage: errors.name?.message,
|
|
4088
|
-
placeholder: "Drive name"
|
|
4089
|
-
})] }),
|
|
4090
|
-
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Label, {
|
|
4091
|
-
htmlFor: "driveApp",
|
|
4092
|
-
className: "text-sm font-medium text-foreground",
|
|
4093
|
-
children: "Drive App"
|
|
4094
|
-
}), /* @__PURE__ */ jsx(AppFormInput, {
|
|
4095
|
-
control,
|
|
4096
|
-
appOptions: props.appOptions
|
|
4097
|
-
})] }),
|
|
4098
|
-
/* @__PURE__ */ jsx(PowerhouseButton, {
|
|
4099
|
-
className: "mt-2 w-full",
|
|
4100
|
-
type: "submit",
|
|
4101
|
-
children: "Create new drive"
|
|
4102
|
-
})
|
|
4103
|
-
]
|
|
4104
|
-
})
|
|
4153
|
+
const { as: Component = "a", className, ...restProps } = props;
|
|
4154
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
4155
|
+
className: twMerge("flex cursor-pointer items-center hover:underline", typeof className === "string" && className),
|
|
4156
|
+
...restProps
|
|
4105
4157
|
});
|
|
4106
4158
|
}
|
|
4107
4159
|
//#endregion
|
|
4108
|
-
//#region src/connect/components/
|
|
4109
|
-
const
|
|
4110
|
-
return /* @__PURE__ */
|
|
4111
|
-
className: "
|
|
4112
|
-
|
|
4113
|
-
children
|
|
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" })]
|
|
4160
|
+
//#region src/connect/components/footer/footer.tsx
|
|
4161
|
+
const Footer = ({ children, className, ...props }) => {
|
|
4162
|
+
return /* @__PURE__ */ jsx("footer", {
|
|
4163
|
+
className: twMerge("flex items-center gap-x-6 text-xs font-medium text-foreground", typeof className === "string" && className),
|
|
4164
|
+
...props,
|
|
4165
|
+
children
|
|
4120
4166
|
});
|
|
4121
|
-
}
|
|
4167
|
+
};
|
|
4122
4168
|
//#endregion
|
|
4123
|
-
//#region src/connect/components/form/
|
|
4124
|
-
const
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
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",
|
|
4169
|
+
//#region src/connect/components/form-input/form-input.tsx
|
|
4170
|
+
const FormInput = /*#__PURE__*/ forwardRef(function FormInput(props, ref) {
|
|
4171
|
+
const { icon, errorMessage, isDirty, containerClassName, inputClassName, errorMessageClassName, hideErrors = false, ...delegatedProps } = props;
|
|
4172
|
+
const type = props.type ?? "text";
|
|
4173
|
+
const isError = !!errorMessage;
|
|
4174
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
|
|
4175
|
+
className: twMerge("mb-1 flex gap-2 rounded-md border border-border bg-background p-3 text-foreground placeholder:text-muted-foreground disabled:disabled-effect", isError && "border-destructive", containerClassName),
|
|
4176
|
+
children: [icon && /* @__PURE__ */ jsx("span", {
|
|
4177
|
+
className: twJoin((!isDirty || isError) && "text-foreground"),
|
|
4178
|
+
children: icon
|
|
4179
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
4180
|
+
...delegatedProps,
|
|
4181
|
+
className: twMerge("w-full bg-transparent font-semibold outline-none", inputClassName),
|
|
4143
4182
|
ref,
|
|
4144
|
-
|
|
4183
|
+
type
|
|
4145
4184
|
})]
|
|
4146
|
-
})
|
|
4185
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
4186
|
+
className: twMerge("hidden min-h-4 text-xs text-destructive", isError && "block", hideErrors && "hidden", errorMessageClassName),
|
|
4187
|
+
children: errorMessage
|
|
4188
|
+
})] });
|
|
4147
4189
|
});
|
|
4148
4190
|
//#endregion
|
|
4149
|
-
//#region src/connect/components/form/
|
|
4150
|
-
|
|
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
|
-
}
|
|
4191
|
+
//#region src/connect/components/form/add-local-drive-form.tsx
|
|
4192
|
+
const AddLocalDriveForm = lazyComponent(() => import("../add-local-drive-form.impl-COIpcmgW.js").then((m) => m.AddLocalDriveForm));
|
|
4173
4193
|
//#endregion
|
|
4174
4194
|
//#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
|
-
}
|
|
4195
|
+
const AddRemoteDriveForm = lazyComponent(() => import("../add-remote-drive-form.impl-_SqOzbSt.js").then((m) => m.AddRemoteDriveForm));
|
|
4265
4196
|
//#endregion
|
|
4266
|
-
//#region src/connect/components/
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
]
|
|
4309
|
-
});
|
|
4310
|
-
} })]
|
|
4311
|
-
});
|
|
4197
|
+
//#region src/connect/components/branding/background-layers.tsx
|
|
4198
|
+
/**
|
|
4199
|
+
* A decorated pane: the configured page colour with the background's layers
|
|
4200
|
+
* painted over it, in order, and the children above them all. Each layer is
|
|
4201
|
+
* placed by the shared `layerStyle`, the same declarations the desktop
|
|
4202
|
+
* loading page emits as static CSS, so a background configured once looks
|
|
4203
|
+
* the same in both hosts. Images come resolved (data URIs or URLs); a
|
|
4204
|
+
* light/dark pair follows the `.dark` theme class, not the OS scheme.
|
|
4205
|
+
* Without a background the pane is the theme's page colour and nothing more.
|
|
4206
|
+
*/
|
|
4207
|
+
function BackgroundLayers(props) {
|
|
4208
|
+
const background = normalizeBackground(props.background);
|
|
4209
|
+
const color = colorVariants(background?.color);
|
|
4210
|
+
const style = color ? {
|
|
4211
|
+
"--ph-pane-bg": color.light,
|
|
4212
|
+
"--ph-pane-bg-dark": color.dark ?? color.light
|
|
4213
|
+
} : void 0;
|
|
4214
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
4215
|
+
className: twMerge("relative size-full overflow-hidden", color ? "bg-(--ph-pane-bg) dark:bg-(--ph-pane-bg-dark)" : "bg-background", props.className),
|
|
4216
|
+
style,
|
|
4217
|
+
children: [background?.layers.map((layer, index) => /* @__PURE__ */ jsx(BackgroundLayer, { layer }, index)), props.children]
|
|
4218
|
+
});
|
|
4219
|
+
}
|
|
4220
|
+
function BackgroundLayer({ layer }) {
|
|
4221
|
+
const { light, dark } = imageVariants(layer.src);
|
|
4222
|
+
const style = layerStyle(layer);
|
|
4223
|
+
if (!dark) return /* @__PURE__ */ jsx("img", {
|
|
4224
|
+
src: light,
|
|
4225
|
+
alt: "",
|
|
4226
|
+
style
|
|
4227
|
+
});
|
|
4228
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("img", {
|
|
4229
|
+
src: light,
|
|
4230
|
+
alt: "",
|
|
4231
|
+
style,
|
|
4232
|
+
className: "dark:hidden"
|
|
4233
|
+
}), /* @__PURE__ */ jsx("img", {
|
|
4234
|
+
src: dark,
|
|
4235
|
+
alt: "",
|
|
4236
|
+
style,
|
|
4237
|
+
className: "hidden dark:block"
|
|
4238
|
+
})] });
|
|
4312
4239
|
}
|
|
4313
4240
|
//#endregion
|
|
4314
4241
|
//#region src/connect/components/home-screen/home-background-image.tsx
|
|
4242
|
+
/** The default home-screen gradient. A custom `src` is kept for callers that
|
|
4243
|
+
* still pass one, sized to its box; HomeScreen itself renders custom images
|
|
4244
|
+
* as a hero below the drive tiles instead. */
|
|
4315
4245
|
const HomeBackgroundImage = ({ src } = {}) => {
|
|
4316
4246
|
if (src) return /* @__PURE__ */ jsx("picture", {
|
|
4317
|
-
className: "pointer-events-none absolute inset-8 z-0
|
|
4247
|
+
className: "pointer-events-none absolute inset-8 z-0",
|
|
4318
4248
|
children: /* @__PURE__ */ jsx("img", {
|
|
4319
4249
|
src,
|
|
4320
|
-
alt: "
|
|
4321
|
-
className: "object-contain"
|
|
4250
|
+
alt: "",
|
|
4251
|
+
className: "size-full object-contain"
|
|
4322
4252
|
})
|
|
4323
4253
|
});
|
|
4324
4254
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -4407,10 +4337,15 @@ const HomeBackgroundImage = ({ src } = {}) => {
|
|
|
4407
4337
|
//#endregion
|
|
4408
4338
|
//#region src/connect/components/home-screen/home-screen-item.tsx
|
|
4409
4339
|
const HomeScreenItem = function HomeScreenItem(props) {
|
|
4410
|
-
const { icon, title, description, containerClassName, shareable, onClick } = props;
|
|
4411
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
4340
|
+
const { icon, title, description, containerClassName, shareable, href, onClick, onPreload } = props;
|
|
4341
|
+
return /* @__PURE__ */ jsxs(href ? "a" : "div", {
|
|
4342
|
+
href,
|
|
4343
|
+
"aria-current": href ? props["aria-current"] : void 0,
|
|
4412
4344
|
className: twMerge("relative flex h-24 w-40 cursor-pointer flex-col items-center justify-center overflow-hidden rounded-md p-2 text-center text-sm text-foreground hover:hover-effect", containerClassName, onClick && "cursor-pointer"),
|
|
4413
4345
|
onClick,
|
|
4346
|
+
onMouseEnter: onPreload,
|
|
4347
|
+
onTouchStart: onPreload,
|
|
4348
|
+
onFocus: href ? onPreload : void 0,
|
|
4414
4349
|
children: [
|
|
4415
4350
|
/* @__PURE__ */ jsx("div", {
|
|
4416
4351
|
className: "mx-auto pb-2",
|
|
@@ -4460,13 +4395,19 @@ const HomeScreenAddDriveItem = function HomeScreenAddDriveItem(props) {
|
|
|
4460
4395
|
//#endregion
|
|
4461
4396
|
//#region src/connect/components/home-screen/home-screen.tsx
|
|
4462
4397
|
const HomeScreen = function HomeScreen(props) {
|
|
4463
|
-
const { children, containerClassName
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4398
|
+
const { children, containerClassName } = props;
|
|
4399
|
+
const background = normalizeBackground(props.homeBackground);
|
|
4400
|
+
const content = /* @__PURE__ */ jsxs("div", {
|
|
4401
|
+
className: twMerge("relative isolate container mx-auto flex h-full flex-col", containerClassName),
|
|
4402
|
+
children: [!background && /* @__PURE__ */ jsx(HomeBackgroundImage, {}), /* @__PURE__ */ jsx("div", {
|
|
4403
|
+
className: twMerge("relative z-10 m-8 flex flex-wrap justify-center gap-4 pt-12", background && "rounded-2xl bg-background/75 px-6 pb-6 backdrop-blur-sm"),
|
|
4404
|
+
children
|
|
4405
|
+
})]
|
|
4406
|
+
});
|
|
4407
|
+
if (!background) return content;
|
|
4408
|
+
return /* @__PURE__ */ jsx(BackgroundLayers, {
|
|
4409
|
+
background,
|
|
4410
|
+
children: content
|
|
4470
4411
|
});
|
|
4471
4412
|
};
|
|
4472
4413
|
//#endregion
|
|
@@ -4490,7 +4431,8 @@ function IntegrityInspector({ onValidate, onRebuildKeyframes, onRebuildSnapshots
|
|
|
4490
4431
|
clearResults();
|
|
4491
4432
|
setStatus("running");
|
|
4492
4433
|
try {
|
|
4493
|
-
|
|
4434
|
+
const result = await onValidate(documentId.trim(), branch.trim() || void 0);
|
|
4435
|
+
setValidationResult(result);
|
|
4494
4436
|
setStatus("done");
|
|
4495
4437
|
} catch (err) {
|
|
4496
4438
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4507,7 +4449,8 @@ function IntegrityInspector({ onValidate, onRebuildKeyframes, onRebuildSnapshots
|
|
|
4507
4449
|
clearResults();
|
|
4508
4450
|
setStatus("running");
|
|
4509
4451
|
try {
|
|
4510
|
-
|
|
4452
|
+
const result = await onRebuildKeyframes(documentId.trim(), branch.trim() || void 0);
|
|
4453
|
+
setRebuildResult(result);
|
|
4511
4454
|
setStatus("done");
|
|
4512
4455
|
} catch (err) {
|
|
4513
4456
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4524,7 +4467,8 @@ function IntegrityInspector({ onValidate, onRebuildKeyframes, onRebuildSnapshots
|
|
|
4524
4467
|
clearResults();
|
|
4525
4468
|
setStatus("running");
|
|
4526
4469
|
try {
|
|
4527
|
-
|
|
4470
|
+
const result = await onRebuildSnapshots(documentId.trim(), branch.trim() || void 0);
|
|
4471
|
+
setRebuildResult(result);
|
|
4528
4472
|
setStatus("done");
|
|
4529
4473
|
} catch (err) {
|
|
4530
4474
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4864,7 +4808,8 @@ function AddDriveModal(props) {
|
|
|
4864
4808
|
//#region src/connect/components/modal/create-document-modal.tsx
|
|
4865
4809
|
const CLOSE_ANIMATION_DURATION$1 = 300;
|
|
4866
4810
|
function CreateDocumentModal(props) {
|
|
4867
|
-
const { onOpenChange, onContinue, overlayProps, contentProps, ...restProps } = props;
|
|
4811
|
+
const { onOpenChange, onContinue, overlayProps, contentProps, drives, driveId, onDriveChange, onAddDrive, ...restProps } = props;
|
|
4812
|
+
const needsDrive = !!drives && !driveId;
|
|
4868
4813
|
const [nodeName, setNodeName] = useState("");
|
|
4869
4814
|
const [isValid, setIsValid] = useState(false);
|
|
4870
4815
|
const handleCancel = () => {
|
|
@@ -4872,11 +4817,12 @@ function CreateDocumentModal(props) {
|
|
|
4872
4817
|
setTimeout(() => setNodeName(""), CLOSE_ANIMATION_DURATION$1);
|
|
4873
4818
|
};
|
|
4874
4819
|
const handleCreate = useCallback(() => {
|
|
4875
|
-
if (!isValid) return;
|
|
4820
|
+
if (!isValid || needsDrive) return;
|
|
4876
4821
|
onContinue(nodeName);
|
|
4877
4822
|
setTimeout(() => setNodeName(""), CLOSE_ANIMATION_DURATION$1);
|
|
4878
4823
|
}, [
|
|
4879
4824
|
isValid,
|
|
4825
|
+
needsDrive,
|
|
4880
4826
|
nodeName,
|
|
4881
4827
|
onContinue
|
|
4882
4828
|
]);
|
|
@@ -4903,20 +4849,51 @@ function CreateDocumentModal(props) {
|
|
|
4903
4849
|
}),
|
|
4904
4850
|
/* @__PURE__ */ jsxs("div", {
|
|
4905
4851
|
className: "my-6",
|
|
4906
|
-
children: [
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4852
|
+
children: [
|
|
4853
|
+
!isValid && nodeName && /* @__PURE__ */ jsx("div", {
|
|
4854
|
+
className: "mb-2 text-destructive",
|
|
4855
|
+
children: "Document name must not be empty or contain control characters."
|
|
4856
|
+
}),
|
|
4857
|
+
/* @__PURE__ */ jsx(FormInput, {
|
|
4858
|
+
icon: /* @__PURE__ */ jsx(Icon, { name: "BrickGlobe" }),
|
|
4859
|
+
onChange: (e) => {
|
|
4860
|
+
const name = e.target.value;
|
|
4861
|
+
setNodeName(name);
|
|
4862
|
+
setIsValid(isValidName(name));
|
|
4863
|
+
},
|
|
4864
|
+
placeholder: "Document name",
|
|
4865
|
+
required: true,
|
|
4866
|
+
value: nodeName
|
|
4867
|
+
}),
|
|
4868
|
+
!!drives?.length && /* @__PURE__ */ jsxs("label", {
|
|
4869
|
+
className: "mt-4 flex flex-col gap-1 text-sm text-muted-foreground",
|
|
4870
|
+
children: ["Drive", /* @__PURE__ */ jsxs("select", {
|
|
4871
|
+
className: "rounded-md border border-border bg-background px-3 py-2 text-foreground",
|
|
4872
|
+
value: driveId ?? "",
|
|
4873
|
+
onChange: (e) => onDriveChange?.(e.target.value),
|
|
4874
|
+
children: [!driveId && /* @__PURE__ */ jsx("option", {
|
|
4875
|
+
value: "",
|
|
4876
|
+
children: "Choose a drive"
|
|
4877
|
+
}), drives.map((drive) => /* @__PURE__ */ jsx("option", {
|
|
4878
|
+
value: drive.id,
|
|
4879
|
+
children: drive.name
|
|
4880
|
+
}, drive.id))]
|
|
4881
|
+
})]
|
|
4882
|
+
}),
|
|
4883
|
+
drives?.length === 0 && /* @__PURE__ */ jsxs("p", {
|
|
4884
|
+
className: "mt-4 text-sm text-muted-foreground",
|
|
4885
|
+
children: [
|
|
4886
|
+
"There's no drive to create it in.",
|
|
4887
|
+
" ",
|
|
4888
|
+
onAddDrive && /* @__PURE__ */ jsx("button", {
|
|
4889
|
+
type: "button",
|
|
4890
|
+
className: "cursor-pointer text-foreground underline",
|
|
4891
|
+
onClick: onAddDrive,
|
|
4892
|
+
children: "Add a drive"
|
|
4893
|
+
})
|
|
4894
|
+
]
|
|
4895
|
+
})
|
|
4896
|
+
]
|
|
4920
4897
|
}),
|
|
4921
4898
|
/* @__PURE__ */ jsxs("div", {
|
|
4922
4899
|
className: "mt-8 flex justify-between gap-3",
|
|
@@ -4928,7 +4905,7 @@ function CreateDocumentModal(props) {
|
|
|
4928
4905
|
}), /* @__PURE__ */ jsx(ModalButton, {
|
|
4929
4906
|
variant: "confirm",
|
|
4930
4907
|
type: "submit",
|
|
4931
|
-
disabled: !isValid,
|
|
4908
|
+
disabled: !isValid || needsDrive,
|
|
4932
4909
|
children: "Create"
|
|
4933
4910
|
})]
|
|
4934
4911
|
})
|
|
@@ -5102,169 +5079,12 @@ function ConnectDeleteItemModal(props) {
|
|
|
5102
5079
|
});
|
|
5103
5080
|
}
|
|
5104
5081
|
//#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
5082
|
//#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
|
-
}
|
|
5083
|
+
const DriveSettingsForm = lazyComponent(() => import("../drive-settings-form.impl-yV9u4h5c.js").then((m) => m.DriveSettingsForm));
|
|
5264
5084
|
//#endregion
|
|
5265
5085
|
//#region src/connect/components/modal/drive-settings-modal.tsx
|
|
5266
5086
|
function DriveSettingsModal(props) {
|
|
5267
|
-
const { drive, open, sharingType, availableOffline, systemInfo, onOpenChange, onDeleteDrive, onRenameDrive, onChangeSharingType, onChangeAvailableOffline, modalProps, containerProps } = props;
|
|
5087
|
+
const { drive, open, sharingType, availableOffline, systemInfo, onOpenChange, onDeleteDrive, onRenameDrive, onChangeSharingType, onChangeAvailableOffline, modalProps, containerProps, children } = props;
|
|
5268
5088
|
const onSubmit = (data) => {
|
|
5269
5089
|
if (data.name !== drive.header.name) onRenameDrive(drive, data.name);
|
|
5270
5090
|
if (data.sharingType !== sharingType) onChangeSharingType(drive, data.sharingType);
|
|
@@ -5311,7 +5131,8 @@ function DriveSettingsModal(props) {
|
|
|
5311
5131
|
drive,
|
|
5312
5132
|
sharingType,
|
|
5313
5133
|
availableOffline,
|
|
5314
|
-
systemInfo
|
|
5134
|
+
systemInfo,
|
|
5135
|
+
children
|
|
5315
5136
|
})
|
|
5316
5137
|
]
|
|
5317
5138
|
})
|
|
@@ -5487,7 +5308,8 @@ function ProcessorsInspector({ getProcessors, onRetry }) {
|
|
|
5487
5308
|
const [error, setError] = useState(null);
|
|
5488
5309
|
const loadProcessors = useCallback(async () => {
|
|
5489
5310
|
try {
|
|
5490
|
-
|
|
5311
|
+
const result = await getProcessors();
|
|
5312
|
+
setProcessors(result);
|
|
5491
5313
|
setError(null);
|
|
5492
5314
|
} catch (e) {
|
|
5493
5315
|
setError(e instanceof Error ? e.message : String(e));
|
|
@@ -5517,9 +5339,10 @@ function ProcessorsInspector({ getProcessors, onRetry }) {
|
|
|
5517
5339
|
}
|
|
5518
5340
|
}, [onRetry, loadProcessors]);
|
|
5519
5341
|
const handleSort = (columnKey) => {
|
|
5342
|
+
const newDirection = sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc";
|
|
5520
5343
|
setSort({
|
|
5521
5344
|
column: columnKey,
|
|
5522
|
-
direction:
|
|
5345
|
+
direction: newDirection
|
|
5523
5346
|
});
|
|
5524
5347
|
};
|
|
5525
5348
|
const sortedProcessors = sortProcessors(processors, sort);
|
|
@@ -5841,7 +5664,8 @@ function QueueInspector({ getQueueState, onPause, onResume }) {
|
|
|
5841
5664
|
const [actionInProgress, setActionInProgress] = useState(false);
|
|
5842
5665
|
const [selectedJob, setSelectedJob] = useState(null);
|
|
5843
5666
|
const loadState = useCallback(async () => {
|
|
5844
|
-
|
|
5667
|
+
const newState = await getQueueState();
|
|
5668
|
+
setState(newState);
|
|
5845
5669
|
setLoading(false);
|
|
5846
5670
|
}, [getQueueState]);
|
|
5847
5671
|
useEffect(() => {
|
|
@@ -5868,9 +5692,10 @@ function QueueInspector({ getQueueState, onPause, onResume }) {
|
|
|
5868
5692
|
loadState
|
|
5869
5693
|
]);
|
|
5870
5694
|
const handleSort = (columnKey) => {
|
|
5695
|
+
const newDirection = sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc";
|
|
5871
5696
|
setSort({
|
|
5872
5697
|
column: columnKey,
|
|
5873
|
-
direction:
|
|
5698
|
+
direction: newDirection
|
|
5874
5699
|
});
|
|
5875
5700
|
};
|
|
5876
5701
|
const sortedJobs = sortJobs([...state.executingJobs.map((job) => ({
|
|
@@ -6071,8 +5896,9 @@ const stateStyles = {
|
|
|
6071
5896
|
disconnected: "bg-muted text-foreground"
|
|
6072
5897
|
};
|
|
6073
5898
|
function ConnectionStateBadge({ state, failureCount }) {
|
|
5899
|
+
const style = stateStyles[state] ?? "bg-muted text-foreground";
|
|
6074
5900
|
return /* @__PURE__ */ jsxs("span", {
|
|
6075
|
-
className: twMerge("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",
|
|
5901
|
+
className: twMerge("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium", style),
|
|
6076
5902
|
children: [state, failureCount > 0 && /* @__PURE__ */ jsxs("span", {
|
|
6077
5903
|
className: "text-xs opacity-75",
|
|
6078
5904
|
children: [
|
|
@@ -6722,6 +6548,175 @@ function ChannelInspector({ remoteName, channel, onBack, onRefresh, connectionSt
|
|
|
6722
6548
|
});
|
|
6723
6549
|
}
|
|
6724
6550
|
//#endregion
|
|
6551
|
+
//#region src/connect/components/remotes-inspector/components/peer-agreement-panel.tsx
|
|
6552
|
+
const cell = "px-3 py-1.5 text-xs text-foreground";
|
|
6553
|
+
const head = "px-3 py-1.5 text-left text-xs font-medium text-foreground";
|
|
6554
|
+
function versions(list) {
|
|
6555
|
+
return list && list.length > 0 ? list.join(", ") : "none";
|
|
6556
|
+
}
|
|
6557
|
+
/** How a remote's peer announced itself. */
|
|
6558
|
+
function peerManifestLabel(peer) {
|
|
6559
|
+
if (peer === void 0) return "Not yet heard (baseline)";
|
|
6560
|
+
if (peer.manifest === null) return "Silent (baseline)";
|
|
6561
|
+
return `Announced, revision ${peer.manifest.revision.slice(0, 8)}`;
|
|
6562
|
+
}
|
|
6563
|
+
function PeerAgreementPanel({ remoteName, collectionId, peer, agreement, holds }) {
|
|
6564
|
+
const local = agreement.local();
|
|
6565
|
+
const theirs = agreement.peer(remoteName);
|
|
6566
|
+
const protocols = Object.keys(local.protocols).sort();
|
|
6567
|
+
const features = Object.keys(local.features).sort();
|
|
6568
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
6569
|
+
"aria-label": "Peer agreement",
|
|
6570
|
+
className: "flex flex-col gap-2 rounded-lg border border-border p-3",
|
|
6571
|
+
children: [
|
|
6572
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6573
|
+
className: "flex items-center justify-between",
|
|
6574
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
6575
|
+
className: "text-sm font-semibold text-foreground",
|
|
6576
|
+
children: "Peer agreement"
|
|
6577
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6578
|
+
className: "text-xs text-muted-foreground",
|
|
6579
|
+
children: peerManifestLabel(peer)
|
|
6580
|
+
})]
|
|
6581
|
+
}),
|
|
6582
|
+
/* @__PURE__ */ jsxs("table", {
|
|
6583
|
+
className: "w-full border-collapse",
|
|
6584
|
+
children: [/* @__PURE__ */ jsx("thead", {
|
|
6585
|
+
className: "bg-muted",
|
|
6586
|
+
children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
6587
|
+
/* @__PURE__ */ jsx("th", {
|
|
6588
|
+
className: head,
|
|
6589
|
+
children: "Protocol"
|
|
6590
|
+
}),
|
|
6591
|
+
/* @__PURE__ */ jsx("th", {
|
|
6592
|
+
className: head,
|
|
6593
|
+
children: "Local"
|
|
6594
|
+
}),
|
|
6595
|
+
/* @__PURE__ */ jsx("th", {
|
|
6596
|
+
className: head,
|
|
6597
|
+
children: "Peer"
|
|
6598
|
+
}),
|
|
6599
|
+
/* @__PURE__ */ jsx("th", {
|
|
6600
|
+
className: head,
|
|
6601
|
+
children: "Limits new documents"
|
|
6602
|
+
})
|
|
6603
|
+
] })
|
|
6604
|
+
}), /* @__PURE__ */ jsxs("tbody", { children: [protocols.map((protocol) => {
|
|
6605
|
+
const limits = agreement.limitedBy(collectionId, protocol).includes(remoteName);
|
|
6606
|
+
return /* @__PURE__ */ jsxs("tr", {
|
|
6607
|
+
className: "odd:bg-card even:bg-background",
|
|
6608
|
+
children: [
|
|
6609
|
+
/* @__PURE__ */ jsx("td", {
|
|
6610
|
+
className: cell,
|
|
6611
|
+
children: protocol
|
|
6612
|
+
}),
|
|
6613
|
+
/* @__PURE__ */ jsx("td", {
|
|
6614
|
+
className: cell,
|
|
6615
|
+
children: versions(local.protocols[protocol])
|
|
6616
|
+
}),
|
|
6617
|
+
/* @__PURE__ */ jsx("td", {
|
|
6618
|
+
className: cell,
|
|
6619
|
+
children: versions(theirs.protocols[protocol])
|
|
6620
|
+
}),
|
|
6621
|
+
/* @__PURE__ */ jsx("td", {
|
|
6622
|
+
className: twMerge(cell, limits && "text-warning"),
|
|
6623
|
+
children: limits ? "Yes" : "No"
|
|
6624
|
+
})
|
|
6625
|
+
]
|
|
6626
|
+
}, protocol);
|
|
6627
|
+
}), features.map((feature) => /* @__PURE__ */ jsxs("tr", {
|
|
6628
|
+
className: "odd:bg-card even:bg-background",
|
|
6629
|
+
children: [
|
|
6630
|
+
/* @__PURE__ */ jsxs("td", {
|
|
6631
|
+
className: cell,
|
|
6632
|
+
children: [feature, " (feature)"]
|
|
6633
|
+
}),
|
|
6634
|
+
/* @__PURE__ */ jsx("td", {
|
|
6635
|
+
className: cell,
|
|
6636
|
+
children: versions(local.features[feature])
|
|
6637
|
+
}),
|
|
6638
|
+
/* @__PURE__ */ jsx("td", {
|
|
6639
|
+
className: cell,
|
|
6640
|
+
children: versions(theirs.features[feature])
|
|
6641
|
+
}),
|
|
6642
|
+
/* @__PURE__ */ jsx("td", {
|
|
6643
|
+
className: cell,
|
|
6644
|
+
children: "-"
|
|
6645
|
+
})
|
|
6646
|
+
]
|
|
6647
|
+
}, feature))] })]
|
|
6648
|
+
}),
|
|
6649
|
+
/* @__PURE__ */ jsxs("h4", {
|
|
6650
|
+
className: "text-xs font-semibold text-foreground",
|
|
6651
|
+
children: [
|
|
6652
|
+
"Held documents (",
|
|
6653
|
+
holds.length,
|
|
6654
|
+
")"
|
|
6655
|
+
]
|
|
6656
|
+
}),
|
|
6657
|
+
holds.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
6658
|
+
className: "text-xs text-muted-foreground",
|
|
6659
|
+
children: "No documents held"
|
|
6660
|
+
}) : /* @__PURE__ */ jsxs("table", {
|
|
6661
|
+
className: "w-full border-collapse",
|
|
6662
|
+
children: [/* @__PURE__ */ jsx("thead", {
|
|
6663
|
+
className: "bg-muted",
|
|
6664
|
+
children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
6665
|
+
/* @__PURE__ */ jsx("th", {
|
|
6666
|
+
className: head,
|
|
6667
|
+
children: "Document"
|
|
6668
|
+
}),
|
|
6669
|
+
/* @__PURE__ */ jsx("th", {
|
|
6670
|
+
className: head,
|
|
6671
|
+
children: "Branch"
|
|
6672
|
+
}),
|
|
6673
|
+
/* @__PURE__ */ jsx("th", {
|
|
6674
|
+
className: head,
|
|
6675
|
+
children: "Requires"
|
|
6676
|
+
}),
|
|
6677
|
+
/* @__PURE__ */ jsx("th", {
|
|
6678
|
+
className: head,
|
|
6679
|
+
children: "Peer runs"
|
|
6680
|
+
}),
|
|
6681
|
+
/* @__PURE__ */ jsx("th", {
|
|
6682
|
+
className: head,
|
|
6683
|
+
children: "Held since"
|
|
6684
|
+
})
|
|
6685
|
+
] })
|
|
6686
|
+
}), /* @__PURE__ */ jsx("tbody", { children: holds.map((hold) => /* @__PURE__ */ jsxs("tr", {
|
|
6687
|
+
className: "odd:bg-card even:bg-background",
|
|
6688
|
+
children: [
|
|
6689
|
+
/* @__PURE__ */ jsx("td", {
|
|
6690
|
+
className: cell,
|
|
6691
|
+
children: hold.documentId
|
|
6692
|
+
}),
|
|
6693
|
+
/* @__PURE__ */ jsx("td", {
|
|
6694
|
+
className: cell,
|
|
6695
|
+
children: hold.branch
|
|
6696
|
+
}),
|
|
6697
|
+
/* @__PURE__ */ jsxs("td", {
|
|
6698
|
+
className: cell,
|
|
6699
|
+
children: [
|
|
6700
|
+
hold.reason.protocol,
|
|
6701
|
+
" ",
|
|
6702
|
+
hold.reason.version
|
|
6703
|
+
]
|
|
6704
|
+
}),
|
|
6705
|
+
/* @__PURE__ */ jsx("td", {
|
|
6706
|
+
className: cell,
|
|
6707
|
+
children: versions(hold.reason.peerSupports)
|
|
6708
|
+
}),
|
|
6709
|
+
/* @__PURE__ */ jsx("td", {
|
|
6710
|
+
className: cell,
|
|
6711
|
+
children: new Date(hold.heldAtUtcMs).toLocaleString()
|
|
6712
|
+
})
|
|
6713
|
+
]
|
|
6714
|
+
}, `${hold.documentId}:${hold.branch}`)) })]
|
|
6715
|
+
})
|
|
6716
|
+
]
|
|
6717
|
+
});
|
|
6718
|
+
}
|
|
6719
|
+
//#endregion
|
|
6725
6720
|
//#region src/connect/components/remotes-inspector/remotes-inspector.tsx
|
|
6726
6721
|
const BASE_COLUMNS = [
|
|
6727
6722
|
{
|
|
@@ -6749,6 +6744,11 @@ const BASE_COLUMNS = [
|
|
|
6749
6744
|
label: "Filter",
|
|
6750
6745
|
width: "200px"
|
|
6751
6746
|
},
|
|
6747
|
+
{
|
|
6748
|
+
key: "peer",
|
|
6749
|
+
label: "Peer",
|
|
6750
|
+
width: "160px"
|
|
6751
|
+
},
|
|
6752
6752
|
{
|
|
6753
6753
|
key: "channel",
|
|
6754
6754
|
label: "Channel",
|
|
@@ -6795,7 +6795,7 @@ function sortRemotes(remotes, sort) {
|
|
|
6795
6795
|
return sort.direction === "asc" ? comparison : -comparison;
|
|
6796
6796
|
});
|
|
6797
6797
|
}
|
|
6798
|
-
function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPull, connectionStates }) {
|
|
6798
|
+
function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPull, connectionStates, getAgreement, getHolds }) {
|
|
6799
6799
|
const [remotes, setRemotes] = useState([]);
|
|
6800
6800
|
const [loading, setLoading] = useState(true);
|
|
6801
6801
|
const [sort, setSort] = useState();
|
|
@@ -6803,29 +6803,47 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6803
6803
|
const [manualUrl, setManualUrl] = useState("");
|
|
6804
6804
|
const [adding, setAdding] = useState(false);
|
|
6805
6805
|
const [addError, setAddError] = useState();
|
|
6806
|
+
const [holds, setHolds] = useState([]);
|
|
6806
6807
|
const hasRowActions = !!removeRemote || !!triggerPull;
|
|
6807
6808
|
const columns = useMemo(() => hasRowActions ? [...BASE_COLUMNS, ACTIONS_COLUMN] : BASE_COLUMNS, [hasRowActions]);
|
|
6808
6809
|
const loadRemotes = useCallback(async () => {
|
|
6809
6810
|
setLoading(true);
|
|
6810
|
-
|
|
6811
|
+
const data = await getRemotes();
|
|
6812
|
+
setRemotes(data);
|
|
6811
6813
|
setLoading(false);
|
|
6812
6814
|
}, [getRemotes]);
|
|
6813
6815
|
useEffect(() => {
|
|
6814
6816
|
loadRemotes();
|
|
6815
6817
|
}, [loadRemotes]);
|
|
6818
|
+
useEffect(() => {
|
|
6819
|
+
if (!selectedRemote || !getHolds) return;
|
|
6820
|
+
let current = true;
|
|
6821
|
+
getHolds(selectedRemote.meta.name).then((loaded) => {
|
|
6822
|
+
if (current) setHolds(loaded);
|
|
6823
|
+
}).catch(() => {
|
|
6824
|
+
if (current) setHolds([]);
|
|
6825
|
+
});
|
|
6826
|
+
return () => {
|
|
6827
|
+
current = false;
|
|
6828
|
+
};
|
|
6829
|
+
}, [selectedRemote, getHolds]);
|
|
6816
6830
|
const handleRefresh = useCallback(async () => {
|
|
6817
6831
|
await loadRemotes();
|
|
6818
|
-
if (selectedRemote)
|
|
6832
|
+
if (selectedRemote) {
|
|
6833
|
+
const updated = remotes.find((r) => r.meta.id === selectedRemote.meta.id);
|
|
6834
|
+
setSelectedRemote(updated);
|
|
6835
|
+
}
|
|
6819
6836
|
}, [
|
|
6820
6837
|
loadRemotes,
|
|
6821
6838
|
selectedRemote,
|
|
6822
6839
|
remotes
|
|
6823
6840
|
]);
|
|
6824
6841
|
const handleSort = (columnKey) => {
|
|
6825
|
-
if (columnKey === "channel" || columnKey === "actions" || columnKey === "status") return;
|
|
6842
|
+
if (columnKey === "channel" || columnKey === "actions" || columnKey === "status" || columnKey === "peer") return;
|
|
6843
|
+
const newDirection = sort?.column === columnKey && sort.direction === "asc" ? "desc" : "asc";
|
|
6826
6844
|
setSort({
|
|
6827
6845
|
column: columnKey,
|
|
6828
|
-
direction:
|
|
6846
|
+
direction: newDirection
|
|
6829
6847
|
});
|
|
6830
6848
|
};
|
|
6831
6849
|
const handleViewChannel = (remote) => {
|
|
@@ -6867,13 +6885,30 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6867
6885
|
const handlePull = useCallback((remote) => {
|
|
6868
6886
|
triggerPull?.(remote.meta.name);
|
|
6869
6887
|
}, [triggerPull]);
|
|
6870
|
-
if (selectedRemote)
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6888
|
+
if (selectedRemote) {
|
|
6889
|
+
let agreement;
|
|
6890
|
+
try {
|
|
6891
|
+
agreement = getAgreement?.();
|
|
6892
|
+
} catch {
|
|
6893
|
+
agreement = void 0;
|
|
6894
|
+
}
|
|
6895
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6896
|
+
className: "flex h-full flex-col gap-2 overflow-auto",
|
|
6897
|
+
children: [agreement && /* @__PURE__ */ jsx(PeerAgreementPanel, {
|
|
6898
|
+
agreement,
|
|
6899
|
+
collectionId: selectedRemote.meta.collectionId.key,
|
|
6900
|
+
holds,
|
|
6901
|
+
peer: selectedRemote.meta.peer,
|
|
6902
|
+
remoteName: selectedRemote.meta.name
|
|
6903
|
+
}), /* @__PURE__ */ jsx(ChannelInspector, {
|
|
6904
|
+
channel: selectedRemote.channel,
|
|
6905
|
+
connectionState: connectionStates?.get(selectedRemote.meta.name),
|
|
6906
|
+
onBack: handleBack,
|
|
6907
|
+
onRefresh: () => void handleRefresh(),
|
|
6908
|
+
remoteName: selectedRemote.meta.name
|
|
6909
|
+
})]
|
|
6910
|
+
});
|
|
6911
|
+
}
|
|
6877
6912
|
const sortedRemotes = sortRemotes(remotes, sort);
|
|
6878
6913
|
return /* @__PURE__ */ jsxs("div", {
|
|
6879
6914
|
className: "flex h-full flex-col gap-2",
|
|
@@ -6930,7 +6965,7 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6930
6965
|
children: /* @__PURE__ */ jsx("tr", { children: columns.map((column, index) => {
|
|
6931
6966
|
const isActive = sort?.column === column.key;
|
|
6932
6967
|
const sortDirection = isActive ? sort.direction : "asc";
|
|
6933
|
-
const isSortable = column.key !== "channel" && column.key !== "actions" && column.key !== "status";
|
|
6968
|
+
const isSortable = column.key !== "channel" && column.key !== "actions" && column.key !== "status" && column.key !== "peer";
|
|
6934
6969
|
return /* @__PURE__ */ jsx("th", {
|
|
6935
6970
|
className: twMerge("group px-3 py-2 text-left text-xs font-medium text-foreground", index > 0 && "border-l border-border", isSortable && "cursor-pointer hover:hover-effect"),
|
|
6936
6971
|
onClick: () => isSortable && handleSort(column.key),
|
|
@@ -7000,6 +7035,13 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
7000
7035
|
children: formatFilter(remote.meta.filter)
|
|
7001
7036
|
})
|
|
7002
7037
|
}),
|
|
7038
|
+
/* @__PURE__ */ jsx("td", {
|
|
7039
|
+
className: "border-l border-border px-3 py-2 text-xs text-foreground",
|
|
7040
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
7041
|
+
className: "block truncate",
|
|
7042
|
+
children: peerManifestLabel(remote.meta.peer)
|
|
7043
|
+
})
|
|
7044
|
+
}),
|
|
7003
7045
|
/* @__PURE__ */ jsx("td", {
|
|
7004
7046
|
className: "border-l border-border px-3 py-2",
|
|
7005
7047
|
children: /* @__PURE__ */ jsxs("button", {
|
|
@@ -7077,7 +7119,8 @@ function WorkerInspector({ getInfo, onRestart }) {
|
|
|
7077
7119
|
const [restarting, setRestarting] = useState(false);
|
|
7078
7120
|
const loadInfo = useCallback(async () => {
|
|
7079
7121
|
try {
|
|
7080
|
-
|
|
7122
|
+
const next = await getInfo();
|
|
7123
|
+
setInfo(next);
|
|
7081
7124
|
setError(null);
|
|
7082
7125
|
} catch (e) {
|
|
7083
7126
|
setError(e instanceof Error ? e.message : String(e));
|
|
@@ -7172,7 +7215,7 @@ function InspectorUnavailable({ message }) {
|
|
|
7172
7215
|
})]
|
|
7173
7216
|
});
|
|
7174
7217
|
}
|
|
7175
|
-
function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExplorerProps, remotesInspectorProps, queueInspectorProps, processorsInspectorProps, integrityInspectorProps, workerInspectorProps, unavailableTabs, defaultTab = "Database" }) {
|
|
7218
|
+
function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExplorerProps, remotesInspectorProps, queueInspectorProps, processorsInspectorProps, integrityInspectorProps, catchUpInspectorProps, workerInspectorProps, unavailableTabs, defaultTab = "Database" }) {
|
|
7176
7219
|
return /* @__PURE__ */ jsx(Modal, {
|
|
7177
7220
|
...modalProps,
|
|
7178
7221
|
contentProps: {
|
|
@@ -7257,6 +7300,20 @@ function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExpl
|
|
|
7257
7300
|
label: "Integrity",
|
|
7258
7301
|
children: /* @__PURE__ */ jsx(InspectorUnavailable, { message: unavailableTabs.Integrity })
|
|
7259
7302
|
}) : null,
|
|
7303
|
+
catchUpInspectorProps ? /* @__PURE__ */ jsx(TabContent, {
|
|
7304
|
+
description: "Catch-up inspector",
|
|
7305
|
+
label: "Catch-up",
|
|
7306
|
+
value: "CatchUp",
|
|
7307
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
7308
|
+
className: "h-full",
|
|
7309
|
+
children: /* @__PURE__ */ jsx(CatchUpInspector, { ...catchUpInspectorProps })
|
|
7310
|
+
})
|
|
7311
|
+
}) : unavailableTabs?.CatchUp ? /* @__PURE__ */ jsx(TabContent, {
|
|
7312
|
+
description: "Catch-up inspector",
|
|
7313
|
+
label: "Catch-up",
|
|
7314
|
+
value: "CatchUp",
|
|
7315
|
+
children: /* @__PURE__ */ jsx(InspectorUnavailable, { message: unavailableTabs.CatchUp })
|
|
7316
|
+
}) : null,
|
|
7260
7317
|
workerInspectorProps && /* @__PURE__ */ jsx(TabContent, {
|
|
7261
7318
|
description: "Worker inspector",
|
|
7262
7319
|
label: "Worker",
|
|
@@ -7380,10 +7437,12 @@ function ReadRequiredModal(props) {
|
|
|
7380
7437
|
useEffect(() => {
|
|
7381
7438
|
const checkScroll = () => {
|
|
7382
7439
|
const element = contentRef.current;
|
|
7383
|
-
if (element)
|
|
7384
|
-
|
|
7385
|
-
|
|
7386
|
-
|
|
7440
|
+
if (element) {
|
|
7441
|
+
if (element.scrollHeight > element.clientHeight) {
|
|
7442
|
+
setDisableClose(true);
|
|
7443
|
+
element.addEventListener("scroll", handleScroll);
|
|
7444
|
+
} else setDisableClose(false);
|
|
7445
|
+
}
|
|
7387
7446
|
};
|
|
7388
7447
|
const handleScroll = () => {
|
|
7389
7448
|
const element = contentRef.current;
|
|
@@ -7649,28 +7708,8 @@ function LocalStorage(props) {
|
|
|
7649
7708
|
}
|
|
7650
7709
|
//#endregion
|
|
7651
7710
|
//#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
|
-
}
|
|
7711
|
+
const DefaultEditor = lazyComponent(() => import("../default-editor.impl-a6EOuEme.js").then((m) => m.DefaultEditor));
|
|
7712
|
+
const DefaultEditorSelect = lazyComponent(() => import("../default-editor.impl-a6EOuEme.js").then((m) => m.DefaultEditorSelect));
|
|
7674
7713
|
//#endregion
|
|
7675
7714
|
//#region src/connect/components/modal/settings-modal-v2/package-manager/parse-package-spec.ts
|
|
7676
7715
|
/**
|
|
@@ -7896,6 +7935,7 @@ const VersionPicker = (props) => {
|
|
|
7896
7935
|
className: "px-3 py-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase",
|
|
7897
7936
|
children: "Tags"
|
|
7898
7937
|
}), filteredTags.map(([tag, ver]) => {
|
|
7938
|
+
const isSelected = selected.kind === "tag" && selected.value === tag;
|
|
7899
7939
|
return /* @__PURE__ */ jsxs("button", {
|
|
7900
7940
|
type: "button",
|
|
7901
7941
|
onClick: () => {
|
|
@@ -7906,7 +7946,7 @@ const VersionPicker = (props) => {
|
|
|
7906
7946
|
setOpen(false);
|
|
7907
7947
|
setQuery("");
|
|
7908
7948
|
},
|
|
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",
|
|
7949
|
+
className: twMerge("flex w-full items-center justify-between gap-2 px-3 py-1.5 text-left text-xs transition-colors", "hover:hover-effect", isSelected && "bg-muted font-semibold"),
|
|
7910
7950
|
children: [/* @__PURE__ */ jsx("span", {
|
|
7911
7951
|
className: "truncate text-foreground",
|
|
7912
7952
|
children: tag
|
|
@@ -7927,6 +7967,7 @@ const VersionPicker = (props) => {
|
|
|
7927
7967
|
className: "px-3 py-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase",
|
|
7928
7968
|
children: "Versions"
|
|
7929
7969
|
}), filteredVersions.map((ver) => {
|
|
7970
|
+
const isSelected = selected.kind === "version" && selected.value === ver;
|
|
7930
7971
|
return /* @__PURE__ */ jsx("button", {
|
|
7931
7972
|
type: "button",
|
|
7932
7973
|
onClick: () => {
|
|
@@ -7937,7 +7978,7 @@ const VersionPicker = (props) => {
|
|
|
7937
7978
|
setOpen(false);
|
|
7938
7979
|
setQuery("");
|
|
7939
7980
|
},
|
|
7940
|
-
className: twMerge("flex w-full items-center px-3 py-1.5 text-left text-xs transition-colors", "hover:hover-effect",
|
|
7981
|
+
className: twMerge("flex w-full items-center px-3 py-1.5 text-left text-xs transition-colors", "hover:hover-effect", isSelected && "bg-muted font-semibold"),
|
|
7941
7982
|
children: /* @__PURE__ */ jsxs("span", {
|
|
7942
7983
|
className: "flex min-w-0 items-center gap-1.5 text-foreground",
|
|
7943
7984
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -8086,6 +8127,14 @@ const PackageManagerListItem = (props) => {
|
|
|
8086
8127
|
updateTarget
|
|
8087
8128
|
]
|
|
8088
8129
|
}),
|
|
8130
|
+
registryPackage.sharedDepWarnings && registryPackage.sharedDepWarnings.length > 0 && /* @__PURE__ */ jsxs("span", {
|
|
8131
|
+
className: "inline-flex items-center gap-1 rounded-full border border-warning/40 bg-warning/10 px-2 py-0.5 text-[11px] font-medium text-warning",
|
|
8132
|
+
title: registryPackage.sharedDepWarnings.join("\n"),
|
|
8133
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
8134
|
+
name: "Exclamation",
|
|
8135
|
+
size: 10
|
|
8136
|
+
}), "Shared deps out of date"]
|
|
8137
|
+
}),
|
|
8089
8138
|
!(canPickVersion && hasVersionMetadata) && registryPackage.version && /* @__PURE__ */ jsxs("span", {
|
|
8090
8139
|
className: "text-xs font-normal text-muted-foreground",
|
|
8091
8140
|
children: ["v", registryPackage.version]
|
|
@@ -8129,7 +8178,8 @@ const PackageManagerListItem = (props) => {
|
|
|
8129
8178
|
items: dropdownItems,
|
|
8130
8179
|
onItemClick: (id) => {
|
|
8131
8180
|
if (id === "install") {
|
|
8132
|
-
|
|
8181
|
+
const spec = canPickVersion && hasVersionMetadata ? buildPackageSpec(registryPackage.name, selected.value) : registryPackage.name;
|
|
8182
|
+
onInstall(spec).catch(console.error);
|
|
8133
8183
|
return;
|
|
8134
8184
|
}
|
|
8135
8185
|
if (id === "update") {
|
|
@@ -8597,619 +8647,8 @@ function ConnectUpgradeDriveModal(props) {
|
|
|
8597
8647
|
});
|
|
8598
8648
|
}
|
|
8599
8649
|
//#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
8650
|
//#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
|
-
}
|
|
8651
|
+
const RevisionHistory = lazyComponent(() => import("../revision-history.impl-DRbeai2m.js").then((m) => m.RevisionHistory));
|
|
9213
8652
|
//#endregion
|
|
9214
8653
|
//#region src/connect/components/search-bar/filter-item.tsx
|
|
9215
8654
|
const FilterItem = (props) => {
|
|
@@ -9275,27 +8714,70 @@ const ConnectSearchBar = (props) => {
|
|
|
9275
8714
|
});
|
|
9276
8715
|
};
|
|
9277
8716
|
//#endregion
|
|
8717
|
+
//#region src/connect/components/tooltip/tooltip.tsx
|
|
8718
|
+
function ConnectTooltip(props) {
|
|
8719
|
+
const { children, content, open, defaultOpen, onOpenChange, className, side = "top", sideOffset = 5, delayDuration, ...rest } = props;
|
|
8720
|
+
return /* @__PURE__ */ jsxs(Root, {
|
|
8721
|
+
defaultOpen,
|
|
8722
|
+
delayDuration,
|
|
8723
|
+
onOpenChange,
|
|
8724
|
+
open,
|
|
8725
|
+
children: [/* @__PURE__ */ jsx(Trigger, {
|
|
8726
|
+
asChild: true,
|
|
8727
|
+
children
|
|
8728
|
+
}), /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content, {
|
|
8729
|
+
...rest,
|
|
8730
|
+
side,
|
|
8731
|
+
sideOffset,
|
|
8732
|
+
className: twMerge("z-50 rounded-lg border border-border bg-popover p-2 text-xs text-popover-foreground shadow-tooltip", className),
|
|
8733
|
+
children: content
|
|
8734
|
+
}) })]
|
|
8735
|
+
});
|
|
8736
|
+
}
|
|
8737
|
+
const ConnectTooltipProvider = Provider;
|
|
8738
|
+
//#endregion
|
|
9278
8739
|
//#region src/connect/components/sidebar/sidebar-item.tsx
|
|
9279
8740
|
const SidebarItem = function SidebarItem(props) {
|
|
9280
|
-
const { icon, title, description
|
|
8741
|
+
const { icon, title, description, containerClassName, active, href, onClick, onPreload } = props;
|
|
8742
|
+
const Element = href ? "a" : onClick ? "button" : "div";
|
|
8743
|
+
const current = href ? props["aria-current"] : void 0;
|
|
9281
8744
|
return /* @__PURE__ */ jsx(ConnectTooltip, {
|
|
9282
|
-
content:
|
|
8745
|
+
content: description ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
8746
|
+
className: "block font-medium",
|
|
8747
|
+
children: title
|
|
8748
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
8749
|
+
className: "block opacity-80",
|
|
8750
|
+
children: description
|
|
8751
|
+
})] }) : title,
|
|
9283
8752
|
side: "right",
|
|
9284
8753
|
sideOffset: 12,
|
|
9285
8754
|
className: "border-none bg-primary px-3 py-2 text-sm text-primary-foreground",
|
|
9286
|
-
children: /* @__PURE__ */ jsxs(
|
|
9287
|
-
|
|
8755
|
+
children: /* @__PURE__ */ jsxs(Element, {
|
|
8756
|
+
href,
|
|
8757
|
+
type: Element === "button" ? "button" : void 0,
|
|
8758
|
+
"aria-label": title,
|
|
8759
|
+
"aria-description": description,
|
|
8760
|
+
"aria-current": current,
|
|
8761
|
+
className: twMerge("group/sidebar-item relative flex cursor-pointer flex-col items-center justify-center text-center text-sm text-foreground", containerClassName, "aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground", active && "bg-sidebar-accent text-sidebar-accent-foreground", onClick && "cursor-pointer"),
|
|
9288
8762
|
onClick,
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
-
|
|
8763
|
+
onMouseEnter: onPreload,
|
|
8764
|
+
onTouchStart: onPreload,
|
|
8765
|
+
onFocus: href ? onPreload : void 0,
|
|
8766
|
+
children: [
|
|
8767
|
+
/* @__PURE__ */ jsx("div", { className: twMerge("absolute top-1/2 left-0 hidden h-10 w-1 -translate-y-1/2 rounded-r-sm bg-info group-aria-[current=page]/sidebar-item:block max-sm:hidden!", active && "block") }),
|
|
8768
|
+
/* @__PURE__ */ jsx("div", { className: twMerge("absolute top-1/2 left-0 h-6 w-1 -translate-y-1/2 rounded-r-sm bg-secondary opacity-0 transition-opacity group-hover/sidebar-item:opacity-100 group-aria-[current=page]/sidebar-item:hidden max-sm:hidden", active && "hidden") }),
|
|
8769
|
+
/* @__PURE__ */ jsx("div", {
|
|
8770
|
+
className: "mx-auto py-4 max-sm:px-3 max-sm:py-2",
|
|
8771
|
+
children: icon || /* @__PURE__ */ jsx("div", {
|
|
8772
|
+
"aria-hidden": true,
|
|
8773
|
+
className: "flex size-8 items-center justify-center rounded-lg bg-primary",
|
|
8774
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
8775
|
+
className: "text-sm font-medium text-primary-foreground",
|
|
8776
|
+
children: title.slice(0, 1).toUpperCase()
|
|
8777
|
+
})
|
|
9296
8778
|
})
|
|
9297
8779
|
})
|
|
9298
|
-
|
|
8780
|
+
]
|
|
9299
8781
|
})
|
|
9300
8782
|
});
|
|
9301
8783
|
};
|
|
@@ -9460,17 +8942,32 @@ const SidebarUser = ({ address, ensName, avatarUrl, etherscanUrl, onDisconnect }
|
|
|
9460
8942
|
};
|
|
9461
8943
|
//#endregion
|
|
9462
8944
|
//#region src/connect/components/sidebar/sidebar-footer.tsx
|
|
9463
|
-
const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin, onClickSettings, onDisconnect, onHomeClick, showDebug, onDebugClick, etherscanUrl = "", ...props }) => {
|
|
8945
|
+
const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin, onClickSettings, settingsHref, settingsCurrent, onDisconnect, onHomeClick, showDebug, onDebugClick, etherscanUrl = "", ...props }) => {
|
|
8946
|
+
const appLogoSrc = useConnectBranding().icon;
|
|
8947
|
+
const settingsIcon = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Settings, {
|
|
8948
|
+
className: "text-foreground",
|
|
8949
|
+
size: 24,
|
|
8950
|
+
strokeWidth: 2
|
|
8951
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
8952
|
+
className: "hidden text-sm/6 font-semibold text-foreground",
|
|
8953
|
+
children: "Settings"
|
|
8954
|
+
})] });
|
|
9464
8955
|
return /* @__PURE__ */ jsxs(SidebarFooter, {
|
|
9465
8956
|
...props,
|
|
9466
|
-
className: twMerge("flex flex-col items-center gap-3 border-t border-sidebar-border px-2 py-4 dark:border-none", className),
|
|
8957
|
+
className: twMerge("flex flex-col items-center gap-3 border-t border-sidebar-border px-2 py-4 max-sm:flex-row max-sm:border-t-0 max-sm:border-l max-sm:py-2 dark:border-none", className),
|
|
9467
8958
|
children: [
|
|
9468
8959
|
onHomeClick && /* @__PURE__ */ jsx("button", {
|
|
9469
8960
|
"aria-label": "Home",
|
|
9470
8961
|
type: "button",
|
|
9471
8962
|
className: "cursor-pointer",
|
|
9472
8963
|
onClick: onHomeClick,
|
|
9473
|
-
children: /* @__PURE__ */ jsx(
|
|
8964
|
+
children: appLogoSrc ? /* @__PURE__ */ jsx("img", {
|
|
8965
|
+
alt: "",
|
|
8966
|
+
className: "object-contain",
|
|
8967
|
+
src: appLogoSrc,
|
|
8968
|
+
width: 24,
|
|
8969
|
+
height: 24
|
|
8970
|
+
}) : /* @__PURE__ */ jsx(Icon, {
|
|
9474
8971
|
className: "text-muted-foreground",
|
|
9475
8972
|
name: "ConnectSmall",
|
|
9476
8973
|
size: 24
|
|
@@ -9488,7 +8985,7 @@ const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin,
|
|
|
9488
8985
|
})
|
|
9489
8986
|
}),
|
|
9490
8987
|
/* @__PURE__ */ jsx("div", {
|
|
9491
|
-
className: onHomeClick ? "mt-3" : "",
|
|
8988
|
+
className: onHomeClick ? "mt-3 max-sm:mt-0" : "",
|
|
9492
8989
|
children: address ? /* @__PURE__ */ jsx(SidebarUser, {
|
|
9493
8990
|
address,
|
|
9494
8991
|
ensName,
|
|
@@ -9497,19 +8994,19 @@ const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin,
|
|
|
9497
8994
|
etherscanUrl
|
|
9498
8995
|
}) : /* @__PURE__ */ jsx(SidebarLogin, { onLogin })
|
|
9499
8996
|
}),
|
|
9500
|
-
/* @__PURE__ */
|
|
8997
|
+
settingsHref ? /* @__PURE__ */ jsx("a", {
|
|
8998
|
+
"aria-label": "Settings",
|
|
8999
|
+
href: settingsHref,
|
|
9000
|
+
"aria-current": settingsCurrent,
|
|
9001
|
+
className: "cursor-pointer rounded-md aria-[current=page]:bg-sidebar-accent",
|
|
9002
|
+
onClick: onClickSettings,
|
|
9003
|
+
children: settingsIcon
|
|
9004
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
9501
9005
|
"aria-label": "Settings",
|
|
9502
9006
|
type: "button",
|
|
9503
9007
|
className: twMerge(onClickSettings ? "cursor-pointer" : "cursor-wait"),
|
|
9504
9008
|
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
|
-
})]
|
|
9009
|
+
children: settingsIcon
|
|
9513
9010
|
})
|
|
9514
9011
|
]
|
|
9515
9012
|
});
|
|
@@ -9526,19 +9023,29 @@ const ConnectSidebarHeader = ({ className, children, ...props }) => {
|
|
|
9526
9023
|
};
|
|
9527
9024
|
//#endregion
|
|
9528
9025
|
//#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 }) => {
|
|
9026
|
+
const ConnectSidebar = ({ onClick, address, ensName, avatarUrl, headerContent, onClickSettings, settingsHref, settingsCurrent, maxWidth = "304px", minWidth = "58px", onLogin, onDisconnect, etherscanUrl, showDebug, onDebugClick, ...props }) => {
|
|
9530
9027
|
return /* @__PURE__ */ jsxs(Sidebar, {
|
|
9531
9028
|
...props,
|
|
9029
|
+
"data-connect-sidebar": "",
|
|
9532
9030
|
maxWidth,
|
|
9533
9031
|
minWidth,
|
|
9534
|
-
children: [/* @__PURE__ */ jsxs(SidebarPanel, {
|
|
9535
|
-
className: "flex
|
|
9536
|
-
children:
|
|
9537
|
-
|
|
9032
|
+
children: [/* @__PURE__ */ jsxs(SidebarPanel, {
|
|
9033
|
+
className: "max-sm:flex max-sm:overflow-x-auto max-sm:overflow-y-hidden",
|
|
9034
|
+
children: [/* @__PURE__ */ jsx(ConnectSidebarHeader, {
|
|
9035
|
+
className: "max-sm:hidden",
|
|
9036
|
+
children: headerContent
|
|
9037
|
+
}), /* @__PURE__ */ jsx("nav", {
|
|
9038
|
+
"aria-label": "Drives and pages",
|
|
9039
|
+
className: "flex flex-col max-sm:flex-row",
|
|
9040
|
+
children: props.children
|
|
9041
|
+
})]
|
|
9042
|
+
}), /* @__PURE__ */ jsx(ConnectSidebarFooter, {
|
|
9538
9043
|
address,
|
|
9539
9044
|
ensName,
|
|
9540
9045
|
avatarUrl,
|
|
9541
9046
|
onClickSettings,
|
|
9047
|
+
settingsHref,
|
|
9048
|
+
settingsCurrent,
|
|
9542
9049
|
onLogin,
|
|
9543
9050
|
onDisconnect,
|
|
9544
9051
|
etherscanUrl,
|
|
@@ -9617,6 +9124,21 @@ function ThemeSwitch({ horizontal = false }) {
|
|
|
9617
9124
|
});
|
|
9618
9125
|
}
|
|
9619
9126
|
//#endregion
|
|
9127
|
+
//#region src/connect/components/toggle/toggle.tsx
|
|
9128
|
+
const Toggle = /*#__PURE__*/ forwardRef(function Toggle(props, ref) {
|
|
9129
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
9130
|
+
className: "relative cursor-pointer items-center",
|
|
9131
|
+
htmlFor: props.id,
|
|
9132
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
9133
|
+
className: "peer sr-only",
|
|
9134
|
+
ref,
|
|
9135
|
+
type: "checkbox",
|
|
9136
|
+
value: "",
|
|
9137
|
+
...props
|
|
9138
|
+
}), /* @__PURE__ */ jsx("div", { className: "peer h-6 w-11 rounded-full bg-muted-foreground peer-checked:bg-info peer-focus:outline-none after:absolute after:inset-s-0.5 after:top-0.5 after:size-5 after:rounded-full after:border after:border-none after:bg-background after:transition-all peer-checked:after:translate-x-full" })]
|
|
9139
|
+
});
|
|
9140
|
+
});
|
|
9141
|
+
//#endregion
|
|
9620
9142
|
//#region src/connect/utils/get-folder-status.ts
|
|
9621
9143
|
/**
|
|
9622
9144
|
* Retrieves the sync status of a folder based on its path and their children files.
|
|
@@ -9663,6 +9185,6 @@ const removeSuccessFiles = (files) => {
|
|
|
9663
9185
|
return files.filter((file) => file.status !== "SUCCESS");
|
|
9664
9186
|
};
|
|
9665
9187
|
//#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 };
|
|
9188
|
+
export { About, AccountPopover, AccountPopoverLogin, AddDriveModal, AddLocalDriveForm, AddRemoteDriveForm, AnimatedLoader, AvailablePackagesPanel, BackgroundLayers, Breadcrumb, Breadcrumbs, CONFLICT, CatchUpInspector, ChannelInspector, Checkbox, Combobox, ConnectBrandingProvider, ConnectConfirmationModal, ConnectDeleteDriveModal, ConnectDeleteItemModal, ConnectDropdownMenu, ConnectReplaceDuplicateModal, ConnectSearchBar, ConnectSelect, ConnectSidebar, ConnectSidebarFooter, ConnectSidebarHeader, ConnectTooltip, ConnectTooltipProvider, ConnectUpgradeDriveModal, ConnectionStateBadge, CookieBanner, CreateDocumentModal, CreateDocumentWithTypeModal, DBExplorer, DangerZone, DebugInspector, DefaultEditor, DefaultEditorLoader, DefaultEditorSelect, DependencyVersions, Disclosure, Divider, DocumentStateViewer, DocumentTimeline, DocumentToolbar, DriveAuthGate, DriveSettingsModal, DropZone, DropZoneWrapper, ENSAvatar, ERROR, EditorActionButtons, EditorUndoRedoButtons, FileItem, FolderItem, Footer, FooterLink, FormInput, FormattedJsonViewer, HomeBackgroundImage, HomeScreen, HomeScreenAddDriveItem, HomeScreenItem, INITIAL_SYNC, Icon, InspectorModal, InstalledPackagesPanel, IntegrityInspector, LoadingScreen, LogoAnimation, MISSING, Modal, ModalButton, NodeInput, ObjectInspectorModal, PackageInstallModal, PackageList, PackageManager, PackageManagerListItem, PackagePanelScrollArea, PackageRegistryError, PackageSubSection, PeerAgreementPanel, PowerhouseButton, ProcessorsInspector, ProjectLoaderImage, QueueInspector, ReadRequiredModal, RemotesInspector, RenownLoginMethods, RevisionHistory, SUCCESS, SYNCING, SettingsModal, SidebarAddDriveItem, SidebarItem, SidebarLogin, SidebarUser, SyncStatusIcon, TabContent, Tabs, ThemeSwitch, Toggle, ToolbarButton, ToolbarCloseButton, ToolbarContainer, ToolbarControlsContainer, ToolbarDownloadButton, ToolbarHistoryButton, ToolbarInput, ToolbarName, ToolbarRedoButton, ToolbarSwitchboardButton, ToolbarUndoButton, UploadFileItem, UploadFileList, UploadFileListContainer, WorkerInspector, brandedDocumentIcon, debugNodeOptions, debugNodeOptionsMap, defaultDriveOptions, defaultNodeOptions, fileNodeDropdownOptions, folderNodeDropdownOptions, formatEthAddress, formatFileSize, generateId, getFolderStatus, getProjectLoader, locationInfoByLocation, mapProgressStageToStatus, mapUploadsToFileItems, nodeOptions, normalNodeOptions, peerManifestLabel, removeSuccessFiles, sharingTypeOptions, sortFilesByStatus, syncStatuses, useBaseReducer3UndoRedo, useConnectBranding, useEns, useWindowSize, verifyPackageJsonFields };
|
|
9667
9189
|
|
|
9668
9190
|
//# sourceMappingURL=index.js.map
|